OptimusPi / SKO

Stick Knights Online - 2D Side-Scroller Stickman Online Role Playing Game
GNU General Public License v3.0
10 stars 1 forks source link

OS Specific Directives: Find solution to rendering hack. #5

Closed OptimusPi closed 5 years ago

OptimusPi commented 8 years ago

There is an OS-specific directive to tell the compiler which chunks of code to use.

This is a nasty hack because I don't know why it works or how exactly to fix it, although it shouldn't be too hard and probably will speed up the game performance anyway.

Look for the string: [#if MY_OS]

Examples:

main.cpp:7869
void physics()
{
# if MY_OS == LINUX_OS

HandleUI();

# endif

main.cpp:7744
while (timestep->Check())
          {
            #if MY_OS == WINDOWS_OS
             HandleUI();
            #endif

        #if MY_OS == MAC_OS
         HandleUI();
        #endif
LeeHorobin commented 8 years ago

At the very least I believe the one on main.cpp line 7099 which uses WinMain instead of main on Windows should be unnecessary after upgrading to SDL2. https://wiki.libsdl.org/MigrationGuide

OptimusPi commented 8 years ago

I was going to say.. upgrading to SDL2 might hopefully be able to fix this too! I don't like having 2 mains .