What is Nostr?
bonkmaykr /
npub108n…8dkg
2025-01-19 23:45:18

bonkmaykr on Nostr: I use derived classes and virtual functions to define each object type in my game ...

I use derived classes and virtual functions to define each object type in my game engine.

Tried to implement the first projectile type today and immediately encountered a problem.

For some reason, on any derived classes deeper than 1 layer, the compiler starts making things private when they should not be.

Making it a struct and thus forcing everything to be public by default fixes that in a way that's efficient enough, but now GCC is literally throwing away functions from the base struct that the world engine needs to fucking work. Like, they don't exist anymore.

I derive o_bulletGeneric from o_bullet which inherits o_worldObjectGeneric. The compiler is only exposing functions from o_bullet. Making an override does not work. The world updater needs access to the function at it's expected location.
Author Public Key
npub108nnguyqy3mx4kh6a5zptm0mdddfsskgyhv969gzrm4tf840knus5h8dkg