]> git.jsancho.org Git - lugaru.git/blobdiff - Source/GameInitDispose.cpp
Made a few more filepaths use ConvertFileName(), so it works on Windows compiled...
[lugaru.git] / Source / GameInitDispose.cpp
index e712154a69fd5f97ba7e492e833ff2c73891a773..faa4f0316a1e792184627cd10e3f612f26ac6d87 100644 (file)
@@ -138,10 +138,10 @@ void Game::Dispose()
        }
 
 
-       sprintf (mapname, ":Data:Users");
+       sprintf (ConvertFileName(mapname), ":Data:Users");
 
        FILE                    *tfile;
-       tfile=fopen( mapname, "wb" );
+       tfile=fopen( ConvertFileName(mapname), "wb" );
        if (tfile)
        {
                fpackf(tfile, "Bi", numaccounts);
@@ -427,8 +427,11 @@ void Game::LoadTexture(const char *fileName, GLuint *textureid,int mipmap, bool
 
        LOG(std::string("Loading texture...") + fileName);
 
+       // Fix filename so that is os appropreate
+       char * fixedFN = ConvertFileName(fileName);
+
        unsigned char fileNamep[256];
-       CopyCStringToPascal(fileName,fileNamep);
+       CopyCStringToPascal(fixedFN, fileNamep);
        //Load Image
        upload_image( fileNamep ,hasalpha);
 
@@ -484,7 +487,7 @@ void Game::LoadTextureSave(const char *fileName, GLuint *textureid,int mipmap,GL
 
        //Load Image
        unsigned char fileNamep[256];
-       CopyCStringToPascal(fileName,fileNamep);
+       CopyCStringToPascal(ConvertFileName(fileName), fileNamep);
        //Load Image
        upload_image( fileNamep ,0);
        //LoadTGA( fileName );
@@ -550,9 +553,13 @@ void Game::LoadSave(const char *fileName, GLuint *textureid,bool mipmap,GLubyte
        texdetail=1;
        //upload_image( fileName );
        //LoadTGA( fileName );
+
+       // Converting file to something os specific
+       char * fixedFN = ConvertFileName(fileName);
+
        //Load Image
        unsigned char fileNamep[256];
-       CopyCStringToPascal(fileName,fileNamep);
+       CopyCStringToPascal(fixedFN, fileNamep);
        //Load Image
        upload_image( fileNamep ,0);
        texdetail=temptexdetail;
@@ -1007,8 +1014,8 @@ void Game::InitGame()
 
        accountactive=-1;
 
-       sprintf (mapname, ":Data:Users");
-       tfile=fopen( mapname, "rb" );
+       sprintf (ConvertFileName(mapname), ":Data:Users");
+       tfile=fopen( ConvertFileName(mapname), "rb" );
        if(tfile)
        {
                funpackf(tfile, "Bi", &numaccounts);
@@ -1246,7 +1253,7 @@ void Game::InitGame()
        samp[firestartsound] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:firestart.ogg"), OPENAL_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
        OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
 
-       strm[stream_firesound] = OPENAL_Stream_Open(":Data:Sounds:fire.ogg", OPENAL_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
+       strm[stream_firesound] = OPENAL_Stream_Open(ConvertFileName(":Data:Sounds:fire.ogg"), OPENAL_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
 //     OPENAL_Sample_SetMinMaxDistance(strm[stream_firesound], 8.0f, 2000.0f);
        OPENAL_Stream_SetMode(strm[stream_firesound], OPENAL_LOOP_NORMAL);