Revision: 20554
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20554
Author:   campbellbarton
Date:     2009-06-01 14:36:22 +0200 (Mon, 01 Jun 2009)

Log Message:
-----------
BGE Blendfile path bug (use for loading and saving the GameLogic.globalDict)
the original blendfile path wasn't reset when loading new blendfiles.
blenderplayer was ok, but running the BGE from blender would set the blendfile 
original path and never reset it on loading other blend files.

Modified Paths:
--------------
    trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
    trunk/blender/source/gameengine/Ketsji/KX_PythonInit.cpp
    trunk/blender/source/gameengine/Ketsji/KX_PythonInit.h

Modified: 
trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
===================================================================
--- trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp     
2009-06-01 12:10:30 UTC (rev 20553)
+++ trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp     
2009-06-01 12:36:22 UTC (rev 20554)
@@ -118,6 +118,7 @@
 
        BLI_strncpy(pathname, blenderdata->name, sizeof(pathname));
        BLI_strncpy(oldsce, G.sce, sizeof(oldsce));
+       resetGamePythonPath(); // need this so running a second time wont use 
an old blendfiles path
        setGamePythonPath(G.sce);
 
        // Acquire Python's GIL (global interpreter lock)

Modified: trunk/blender/source/gameengine/Ketsji/KX_PythonInit.cpp
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_PythonInit.cpp    2009-06-01 
12:10:30 UTC (rev 20553)
+++ trunk/blender/source/gameengine/Ketsji/KX_PythonInit.cpp    2009-06-01 
12:36:22 UTC (rev 20554)
@@ -2093,3 +2093,10 @@
                BLI_strncpy(gp_GamePythonPathOrig, path, 
sizeof(gp_GamePythonPathOrig));
 }
 
+// we need this so while blender is open (not blenderplayer)
+// loading new blendfiles will reset this on starting the
+// engine but loading blend files within the BGE wont overwrite 
gp_GamePythonPathOrig
+void resetGamePythonPath()
+{
+       gp_GamePythonPathOrig[0] == '\0';
+}

Modified: trunk/blender/source/gameengine/Ketsji/KX_PythonInit.h
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_PythonInit.h      2009-06-01 
12:10:30 UTC (rev 20553)
+++ trunk/blender/source/gameengine/Ketsji/KX_PythonInit.h      2009-06-01 
12:36:22 UTC (rev 20554)
@@ -53,6 +53,7 @@
 void           exitGamePythonScripting();
 
 void           setGamePythonPath(char *path);
+void           resetGamePythonPath();
 void           pathGamePythonConfig( char *path );
 int                    saveGamePythonConfig( char **marshal_buffer);
 int                    loadGamePythonConfig(char *marshal_buffer, int 
marshal_length);


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to