Yes. I'm still deliberating on how to store object files for multiple settings. You're probably enjoying a two second compile time, yes? That will go up in smoke every time you switch to a GMK with different settings if I don't do something to store objects for each configuration. It's definitely going to involve some Make and YAML hackery.
I guess, instead, I could do my best to keep setting-dependent code in separate functions or variables in a single source, then have the systems use those.... We'll see. This method would be less efficient, but it shouldn't be that noticeable, and when you went to compile the final product, we could pass the settings in as macros to the sources in question. Thus, we'd have something like this:
// For erroring on undefined vars struct var { ... #if !defined OPT_UNIV_ERROR_UNDEFINED || OPT_UNIV_ERROR_UNDEFINED bool initialized; #endif ... variant &operator* () ... #if !defined OPT_UNIV_ERROR_UNDEFINED || OPT_UNIV_ERROR_UNDEFINED if (!initialized) show_error("Variable not defined"); // I'll probably use some C++ trickery to resolve the name #endif ... var(): #if !defined OPT_UNIV_ERROR_UNDEFINED || OPT_UNIV_ERROR_UNDEFINED initialized(false), #endif ...
// It will be the responsibility of IsmAvatar to ensure !(!OPT_UNIV_SHOW_ERRORS && OPT_UNIV_ERROR_UNDEFINED) // But I'll probably double check it and not error
void show_error(...) { #if !defined OPT_UNIV_SHOW_ERRORS || OPT_UNIV_SHOW_ERRORS #if !defined OPT_UNIV_ERROR_FATAL || !OPT_UNIV_ERROR_FATAL if (MessageBox(enigma::hWnd, ...) == ID_ABORT) exit(0); #else MessageBox(enigma::hWnd, ...); exit(0); #endif #endif }
|