Revision: 16185
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16185
Author:   campbellbarton
Date:     2008-08-19 01:48:59 +0200 (Tue, 19 Aug 2008)

Log Message:
-----------
BGE Blend file loading was using BLO_read_from_memory which meant relative 
linked libraries could not be found.
This is odd because BLO_read_from_file was commented out with """//this doesn't 
work anymore for relative paths, so use BLO_read_from_memory instead"""
Undoing Erwins changes from r7497, just use normal file loading. From the 
commit log its not clear if he means relative filenames or relative linked libs 
but from testing both work now.

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

Modified: 
trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
===================================================================
--- trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp     
2008-08-18 22:39:55 UTC (rev 16184)
+++ trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp     
2008-08-18 23:48:59 UTC (rev 16185)
@@ -90,33 +90,10 @@
 
 static BlendFileData *load_game_data(char *filename) {
        BlendReadError error;
-       //this doesn't work anymore for relative paths, so use 
BLO_read_from_memory instead
-       //BlendFileData *bfd= BLO_read_from_file(filename, &error);
-       FILE* file = fopen(filename,"rb");
-       BlendFileData *bfd  = 0;
-       if (file)
-       {
-               fseek(file, 0L, SEEK_END);
-               int len= ftell(file);
-               fseek(file, 0L, SEEK_SET);      
-               char* filebuffer= new char[len];//MEM_mallocN(len, 
"text_buffer");
-               int sizeread = fread(filebuffer,len,1,file);
-               if (sizeread==1){
-                       bfd = BLO_read_from_memory(filebuffer, len, &error);
-               } else {
-                       error = BRE_UNABLE_TO_READ;
-               }
-               fclose(file);
-               // the memory is not released in BLO_read_from_memory, must do 
it here
-               delete filebuffer;
-       } else {
-               error = BRE_UNABLE_TO_OPEN;
-       }
-
+       BlendFileData *bfd= BLO_read_from_file(filename, &error);
        if (!bfd) {
                printf("Loading %s failed: %s\n", filename, 
BLO_bre_as_string(error));
        }
-       
        return bfd;
 }
 


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

Reply via email to