Created by: betstick
Reorder #define
directives to be ordered from oldest to newest render layers: USE_DX9
-> USE_DX11
-> USE_OGL
Not all could be organized this way without substantial code duplication.
Got rid of almost if not all of the negative(?) defines for render layers. Examples:
#ifndef USE_OGL
-> #if defined(USE_DX9) || defined(USE_DX11)
#if !defined(USE_DX9) && !defined(USE_DX11)
-> #if defined(USE_OGL)
This should help in the event that a new render layer is added to prevent unexpected code to be compiled/run. This predicates on there only ever being one layer active at a time per "unit" or whatever. So #if defined(USE_DX9) && defined(USE_DX11)
should always be false.
Explicitly defined some conditions for readability and to prevent unpredictable behavior in the event that the render layers are changed. Example:
#ifdef USE_DX9
//some code
#else
//some code
#endif
becomes the following:
#ifdef USE_DX9
//some code
#elif defined(USE_DX11) || defined(USE_OGL)
//some code
#else
#error No graphics API selected or in use!
#endif
Finally, added some fail conditions so that if no render layers are used for a given code fragment the compiler will error out. Example:
#if defined(USE_DX9) || defined(USE_DX11)
//some code
#elif defined(USE_OGL)
//some code
#else
#error No graphics API selected or in use!
#endif
I tried to avoid any changes possible to code style/format outside of reordering lines.
Note, I named the commit a bad name and I can't figure out how to undo this. Also, the created/modified dates on the files are totally screwed up since I tar'd and untar'd a local copy of the repo a few times across Windows and Linux to test compilation. This is not a 100% cleanup, but it was everything I could find across several text searches of the repo for specific directives. This is my first pull request so please let me know if I messed up/broke something.