fix for recent stereo changes+tweaks
authorDalai Felinto <dfelinto@gmail.com>
Mon, 20 Jul 2009 22:36:56 +0000 (22:36 +0000)
committerDalai Felinto <dfelinto@gmail.com>
Mon, 20 Jul 2009 22:36:56 +0000 (22:36 +0000)
(it's the 3rd commit in a row. But as they say, the 3rd is always a charm ;)

I still think we have a little mess with the DEFINE parameters in BGE (as in RAS_IRasterizer::StereoMode).
We used to have them duplicated and hardcoded in 2.4xx, but I think we can do it in another way now.

(I didn't change gameplayer, but I can do it once we have it linking and building properly)

release/ui/space_logic.py
source/blender/blenloader/intern/readfile.c
source/blender/makesdna/DNA_scene_types.h
source/blender/makesrna/intern/rna_scene.c
source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp

index 13400e276b50ffc67de7b3f1fc9ae4010accbcd3..83d48896c3bae78f76d12b97174ef4f10e713b2c 100644 (file)
@@ -95,16 +95,16 @@ class LOGIC_PT_stereo(bpy.types.Panel):
                if stereo_mode == 'STEREO':
                        col = layout.column(align=True)
                        row = col.row()
+                       row.item_enumR(gs, "stereo_mode", "ANAGLYPH")
                        row.item_enumR(gs, "stereo_mode", "QUADBUFFERED")
-                       row.item_enumR(gs, "stereo_mode", "ABOVEBELOW")
                        
                        row = col.row()
                        row.item_enumR(gs, "stereo_mode", "INTERLACED")
-                       row.item_enumR(gs, "stereo_mode", "ANAGLYPH")
+                       row.item_enumR(gs, "stereo_mode", "VINTERLACE")
                        
                        row = col.row()
                        row.item_enumR(gs, "stereo_mode", "SIDEBYSIDE")
-                       row.item_enumR(gs, "stereo_mode", "VINTERLACE")
+                       row.item_enumR(gs, "stereo_mode", "ABOVEBELOW")
 
 #                      row = layout.column_flow()
 #                      row.itemR(gs, "stereo_mode")
index 46db41094403c9de24f12888ff199ed0c1af6fa4..f258746dafe3807cf3ff443e7955edd5dc2e40fa 100644 (file)
@@ -9214,6 +9214,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
        /* TODO: should be moved into one of the version blocks once this branch moves to trunk and we can
           bump the version (or sub-version.) */
        {
+               World *wo;
                Object *ob;
                Material *ma;
                Scene *sce;
@@ -9347,7 +9348,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                                sce->gm.stereomode = STEREO_ANAGLYPH;
                        }
                        else
-                               sce->gm.stereoflag = STEREO_ENABLE;
+                               sce->gm.stereoflag = STEREO_ENABLED;
 
                        //Framing
                        sce->gm.framing = sce->framing;
@@ -9357,16 +9358,17 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                        sce->gm.depth= sce->r.depth;
 
                        //Physic (previously stored in world)
-                       if (0){
-//                     if (sce->world){ // XXX I think we need to run lib_link_all() before do_version()
-                               sce->gm.gravity = sce->world->gravity;
-                               sce->gm.physicsEngine= sce->world->physicsEngine;
-                               sce->gm.mode = sce->world->mode;
-                               sce->gm.occlusionRes = sce->world->occlusionRes;
-                               sce->gm.ticrate = sce->world->ticrate;
-                               sce->gm.maxlogicstep = sce->world->maxlogicstep;
-                               sce->gm.physubstep = sce->world->physubstep;
-                               sce->gm.maxphystep = sce->world->maxphystep;
+                       //temporarily getting the correct world address
+                       wo = newlibadr(fd, sce->id.lib, sce->world);
+                       if (wo){
+                               sce->gm.gravity = wo->gravity;
+                               sce->gm.physicsEngine= wo->physicsEngine;
+                               sce->gm.mode = wo->mode;
+                               sce->gm.occlusionRes = wo->occlusionRes;
+                               sce->gm.ticrate = wo->ticrate;
+                               sce->gm.maxlogicstep = wo->maxlogicstep;
+                               sce->gm.physubstep = wo->physubstep;
+                               sce->gm.maxphystep = wo->maxphystep;
                        }
                        else{
                                sce->gm.gravity =9.8f;
index 31d7a63b31b2bdb9ee315bf1889e387209ad6213..516a718849bf66f060e2baee777767bc018698a7 100644 (file)
@@ -403,7 +403,7 @@ typedef struct GameData {
        float pad12;
 } GameData;
 #define STEREO_NOSTEREO                1
-#define STEREO_ENABLE          2
+#define STEREO_ENABLED                 2
 #define STEREO_DOME                    3
 
 //#define STEREO_NOSTEREO               1
index a41bff8431c32a934e0f64e5746c43a1f42e591b..bf122c1a13c89f22de438d092a329bbe5edc5a26 100644 (file)
@@ -586,7 +586,7 @@ void rna_def_scene_game_data(BlenderRNA *brna)
                
        static EnumPropertyItem stereo_items[] ={
                {STEREO_NOSTEREO, "NO_STEREO", 0, "No Stereo", ""},
-               {STEREO_ENABLE, "STEREO", 0, "Stereo", ""},
+               {STEREO_ENABLED, "STEREO", 0, "Stereo", ""},
                {STEREO_DOME, "DOME", 0, "Dome", ""},
                {0, NULL, 0, NULL, NULL}};
 
index b62667627a1dd73144feb9e1d266088ea39cdec0..03dd5d07eb00964c6460fd0f4bf06ae5dec80458 100644 (file)
@@ -332,8 +332,10 @@ extern "C" void StartKetsjiShell(struct bContext *C, int always_use_expand_frami
                        ketsjiengine->SetGame2IpoMode(game2ipo,startFrame);
                        
                        // Quad buffered needs a special window.
-                       if (blscene->gm.stereomode != RAS_IRasterizer::RAS_STEREO_QUADBUFFERED)
-                               rasterizer->SetStereoMode((RAS_IRasterizer::StereoMode) blscene->gm.stereomode);
+                       if(blscene->gm.stereoflag == STEREO_ENABLED){
+                               if (blscene->gm.stereomode != RAS_IRasterizer::RAS_STEREO_QUADBUFFERED)
+                                       rasterizer->SetStereoMode((RAS_IRasterizer::StereoMode) blscene->gm.stereomode);
+                       }
                }
                
                if (exitrequested != KX_EXIT_REQUEST_QUIT_GAME)
@@ -672,8 +674,10 @@ extern "C" void StartKetsjiShellSimulation(struct wmWindow *win,
                }
 
                // Quad buffered needs a special window.
-               if (blscene->gm.stereomode != RAS_IRasterizer::RAS_STEREO_QUADBUFFERED)
-                       rasterizer->SetStereoMode((RAS_IRasterizer::StereoMode) blscene->gm.stereomode);
+               if(blscene->gm.stereoflag == STEREO_ENABLED){
+                       if (blscene->gm.stereomode != RAS_IRasterizer::RAS_STEREO_QUADBUFFERED)
+                               rasterizer->SetStereoMode((RAS_IRasterizer::StereoMode) blscene->gm.stereomode);
+               }
 
                if (exitrequested != KX_EXIT_REQUEST_QUIT_GAME)
                {