Just before that, I had reviewed the factory registering system so that it was enough to just write
MomentumFactory mf("momentum");
as a top-level declaration to get everything up and running. But that meant there was no more reference from the main .o files of the game/demo that would require .o files with the factory code (and instance declaration), so they wouldn't be packed in, and certainly wouldn't be initialized either.So I started thinking about weird mechanisms invoking bool pointers to dummy variables, or no-code functions, and even why not
UsingPlatformer
empty class that would extend UsingMomentum
, UsingDpad
and others... Then I realized that all this happened because the .o files (compilation output, that is. Equivalent of your *.OBJ if you're on MS-DOS) are packed into a static library and only pulled to populate the .NDS file on-demand at link-time. If instead I explicitly say "link Demo/*.o Controllers/*.o", they are put into the binary and no trick is needed anymore.
No comments:
Post a Comment