Bugfix: modified game material settings in blender didn't get
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Sat, 4 Oct 2008 17:04:23 +0000 (17:04 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Sat, 4 Oct 2008 17:04:23 +0000 (17:04 +0000)
taken into account when loading a new .blend.

source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp

index 0d58810e1561f3c9ce7191dc8c1b35b9d87a34b8..1110c4e0b4819c39cbfaff434a2d6cd162ec0157 100644 (file)
@@ -135,15 +135,6 @@ extern "C" void StartKetsjiShell(struct ScrArea *area,
                bool frameRate = (SYS_GetCommandLineInt(syshandle, "show_framerate", 0) != 0);
                bool game2ipo = (SYS_GetCommandLineInt(syshandle, "game2ipo", 0) != 0);
                bool displaylists = (SYS_GetCommandLineInt(syshandle, "displaylists", 0) != 0);
-               bool usemat = false, useglslmat = false;
-
-               if(GLEW_ARB_multitexture && GLEW_VERSION_1_1)
-                       usemat = (SYS_GetCommandLineInt(syshandle, "blender_material", 1) != 0);
-
-               if(GPU_extensions_minimum_support())
-                       useglslmat = (SYS_GetCommandLineInt(syshandle, "blender_glsl_material", 1) != 0);
-               else if(G.fileflags & G_FILE_GAME_MAT_GLSL)
-                       usemat = false;
 
                // create the canvas, rasterizer and rendertools
                RAS_ICanvas* canvas = new KX_BlenderCanvas(area);
@@ -316,10 +307,18 @@ extern "C" void StartKetsjiShell(struct ScrArea *area,
                        if (always_use_expand_framing)
                                sceneconverter->SetAlwaysUseExpandFraming(true);
 
-                       if(usemat && (G.fileflags & G_FILE_GAME_MAT))
-                               sceneconverter->SetMaterials(true);
-                       if(useglslmat && (G.fileflags & G_FILE_GAME_MAT_GLSL))
-                               sceneconverter->SetGLSLMaterials(true);
+                       bool usemat = false, useglslmat = false;
+
+                       if(GLEW_ARB_multitexture && GLEW_VERSION_1_1)
+                               usemat = true;
+
+                       if(GPU_extensions_minimum_support())
+                               useglslmat = true;
+                       else if(G.fileflags & G_FILE_GAME_MAT_GLSL)
+                               usemat = false;
+
+                       sceneconverter->SetMaterials(usemat && (G.fileflags & G_FILE_GAME_MAT));
+                       sceneconverter->SetGLSLMaterials(useglslmat && (G.fileflags & G_FILE_GAME_MAT_GLSL));
                                        
                        KX_Scene* startscene = new KX_Scene(keyboarddevice,
                                mousedevice,