misc small edits, remove remaining Id's
authorCampbell Barton <ideasman42@gmail.com>
Tue, 25 Oct 2011 04:01:09 +0000 (04:01 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 25 Oct 2011 04:01:09 +0000 (04:01 +0000)
CMakeLists.txt
source/gameengine/GamePlayer/ghost/GPG_ghost.cpp

index 7631b24..d419317 100644 (file)
@@ -61,13 +61,6 @@ set(CMAKE_BUILD_TYPE_INIT "Release")
 # quiet output for Makefiles, 'make -s' helps too
 # set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
 
-# global compile definitions since add_definitions() adds for all.
-set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG           DEBUG _DEBUG)
-set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE         NDEBUG)
-set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_MINSIZEREL      NDEBUG)
-set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO  DEBUG _DEBUG)
-
-
 #-----------------------------------------------------------------------------
 # Set policy
 
@@ -510,8 +503,8 @@ if(UNIX AND NOT APPLE)
 
        set(PLATFORM_LINKFLAGS "-pthread")
 
-       # lfs on glibc, all compilers should use
-       add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE)
+       set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE")
+       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE")
 
        # GNU Compiler
        if(CMAKE_COMPILER_IS_GNUCC)
@@ -619,21 +612,21 @@ elseif(WIN32)
                set(CMAKE_C_FLAGS   "/nologo /J /W0 /Gd /wd4018 /wd4244 /wd4305 /wd4800 /wd4065 /wd4267 /we4013 /EHsc" CACHE STRING "MSVC MT C++ flags " FORCE)
 
                if(CMAKE_CL_64)
-                       set(CMAKE_CXX_FLAGS_DEBUG "/Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE)
+                       set(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE)
                else()
-                       set(CMAKE_CXX_FLAGS_DEBUG "/Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /ZI /J" CACHE STRING "MSVC MT flags " FORCE)
+                       set(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /ZI /J" CACHE STRING "MSVC MT flags " FORCE)
                endif()
-               set(CMAKE_CXX_FLAGS_RELEASE "/O2 /Ob2 /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
-               set(CMAKE_CXX_FLAGS_MINSIZEREL "/O1 /Ob1 /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
-               set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/O2 /Ob1 /EHsc /MT /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE)
+               set(CMAKE_CXX_FLAGS_RELEASE "/O2 /Ob2 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
+               set(CMAKE_CXX_FLAGS_MINSIZEREL "/O1 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
+               set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/O2 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE)
                if(CMAKE_CL_64)
-                       set(CMAKE_C_FLAGS_DEBUG "/Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE)
+                       set(CMAKE_C_FLAGS_DEBUG "/D_DEBUG /Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE)
                else()
-                       set(CMAKE_C_FLAGS_DEBUG "/Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /ZI /J" CACHE STRING "MSVC MT flags " FORCE)
+                       set(CMAKE_C_FLAGS_DEBUG "/D_DEBUG /Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /ZI /J" CACHE STRING "MSVC MT flags " FORCE)
                endif()
-               set(CMAKE_C_FLAGS_RELEASE "/O2 /Ob2 /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
-               set(CMAKE_C_FLAGS_MINSIZEREL "/O1 /Ob1 /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
-               set(CMAKE_C_FLAGS_RELWITHDEBINFO "/O2 /Ob1 /EHsc /MT /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE)
+               set(CMAKE_C_FLAGS_RELEASE "/O2 /Ob2 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
+               set(CMAKE_C_FLAGS_MINSIZEREL "/O1 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
+               set(CMAKE_C_FLAGS_RELWITHDEBINFO "/O2 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE)
 
                if(WITH_INTERNATIONAL)
                        set(GETTEXT ${LIBDIR}/gettext)
@@ -791,6 +784,9 @@ elseif(WIN32)
 
                add_definitions(-DFREE_WINDOWS)
 
+               set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")
+               set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG")
+
                if(WITH_INTERNATIONAL)
                        set(GETTEXT ${LIBDIR}/gcc/gettext)
                        set(GETTEXT_INCLUDE_DIRS ${GETTEXT}/include)
@@ -1221,6 +1217,21 @@ endif()
 #-----------------------------------------------------------------------------
 # Extra compile flags
 
+if((NOT WIN32) AND (NOT MSVC))
+       # used for internal debug checks
+       set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")
+       set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG")
+
+       # assert() checks for this.
+       set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG")
+       set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -DNDEBUG")
+       set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DNDEBUG")
+
+       set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNDEBUG")
+       set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -DNDEBUG")
+       set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DNDEBUG")
+endif()
+
 if(CMAKE_COMPILER_IS_GNUCC)
 
        ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ALL -Wall)
index b1781f1..140dbad 100644 (file)
@@ -365,7 +365,6 @@ int main(int argc, char** argv)
        GHOST_TEmbedderWindowID parentWindow = 0;
        bool isBlenderPlayer = false;
        int validArguments=0;
-       bool samplesParFound = false;
        GHOST_TUns16 aasamples = 0;
        
 #ifdef __linux__
@@ -407,8 +406,6 @@ int main(int argc, char** argv)
        
        initglobals();
 
-       // Blender's VBOs cause odd problems with modifiers (we have our own vbo code)
-       U.gameflags |= USER_DISABLE_VBO;
        // We load our own G.main, so free the one that initglobals() gives us
        free_main(G.main);
        G.main = NULL;
@@ -584,14 +581,8 @@ int main(int argc, char** argv)
                                break;
                        case 'm':
                                i++;
-                               samplesParFound = true;
                                if ((i+1) <= validArguments )
-                                       aasamples = atoi(argv[i++]);
-                               else
-                               {
-                                       error = true;
-                                       printf("error: No argument supplied for -m");
-                               }
+                               aasamples = atoi(argv[i++]);
                                break;
                        case 'c':
                                i++;
@@ -827,7 +818,7 @@ int main(int argc, char** argv)
                                                if ((!fullScreenParFound) && (!windowParFound))
                                                {
                                                        // Only use file settings when command line did not override
-                                                       if ((scene->gm.playerflag & GAME_PLAYER_FULLSCREEN)) {
+                                                       if (scene->gm.fullscreen) {
                                                                //printf("fullscreen option found in Blender file\n");
                                                                fullScreen = true;
                                                                fullScreenWidth= scene->gm.xplay;
@@ -856,9 +847,6 @@ int main(int argc, char** argv)
                                                else
                                                        scene->gm.stereoflag = STEREO_ENABLED;
 
-                                               if (!samplesParFound)
-                                                       aasamples = scene->gm.aasamples;
-
                                                if (stereoFlag == STEREO_DOME){
                                                        stereomode = RAS_IRasterizer::RAS_STEREO_DOME;
                                                        scene->gm.stereoflag = STEREO_DOME;
@@ -904,7 +892,7 @@ int main(int argc, char** argv)
 #endif
                                                                {
                                                                        app.startFullScreen(fullScreenWidth, fullScreenHeight, fullScreenBpp, fullScreenFrequency,
-                                                                               stereoWindow, stereomode, aasamples, (scene->gm.playerflag & GAME_PLAYER_DESKTOP_RESOLUTION));
+                                                                               stereoWindow, stereomode, aasamples);
                                                                }
                                                        }
                                                        else