X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FGameInitDispose.cpp;h=935b69d0541af59df7623f0606b74620a451f611;hb=ff29f47f799d99cec7c2a6aa2cf818da2b931fc5;hp=0ce61eeb704cbb2a8a4faa017e86e406dc96d2b0;hpb=2d54e57ffa32e0a02013d79be57b8a2f3bc8db05;p=lugaru.git diff --git a/Source/GameInitDispose.cpp b/Source/GameInitDispose.cpp index 0ce61ee..935b69d 100644 --- a/Source/GameInitDispose.cpp +++ b/Source/GameInitDispose.cpp @@ -52,7 +52,6 @@ extern float multiplier; extern int netdatanew; extern float mapinfo; extern bool stillloading; -extern ImageRec texture; extern short vRefNum; extern long dirID; extern int mainmenu; @@ -62,7 +61,6 @@ extern int flashdelay; extern int whichjointstartarray[26]; extern int whichjointendarray[26]; extern int difficulty; -extern float tintr, tintg, tintb; extern float slomospeed; extern bool gamestarted; @@ -120,10 +118,6 @@ void Dispose() } OPENAL_Close(); - if (texture.data) { - free(texture.data); - } - texture.data = 0; #endif } @@ -170,7 +164,8 @@ void LoadSave(const char *fileName, GLuint *textureid, bool mipmap, GLubyte *arr texdetail = 1; //Load Image - upload_image(ConvertFileName(fileName)); + ImageRec texture; + load_image(ConvertFileName(fileName), texture); texdetail = temptexdetail; int bytesPerPixel = texture.bpp / 8; @@ -472,9 +467,6 @@ void FadeLoadingScreen(float howmuch) swap_gl_buffers(); } - -extern bool cmdline(const char *cmd); - void Game::InitGame() { LOGFUNC; @@ -483,10 +475,6 @@ void Game::InitGame() accountactive = Account::loadFile(":Data:Users"); - tintr = 1; - tintg = 1; - tintb = 1; - whichjointstartarray[0] = righthip; whichjointendarray[0] = rightfoot; @@ -569,8 +557,6 @@ void Game::InitGame() stillloading = 1; - texture.data = ( GLubyte* )malloc( 1024 * 1024 * 4 ); - int temptexdetail = texdetail; texdetail = 1; text->LoadFontTexture(":Data:Textures:Font.png"); @@ -594,15 +580,14 @@ void Game::InitGame() #if PLATFORM_LINUX unsigned char rc = 0; int output = OPENAL_OUTPUT_ALSA; // Try alsa first... - if (cmdline("forceoss")) // ...but let user override that. - output = OPENAL_OUTPUT_OSS; - else if (cmdline("nosound")) - output = OPENAL_OUTPUT_NOSOUND; + if (commandLineOptions[SOUND]) { + output = commandLineOptions[SOUND].last()->type(); // ...but let user override that. + } OPENAL_SetOutput(output); if ((rc = OPENAL_Init(44100, 32, 0)) == false) { // if we tried ALSA and failed, fall back to OSS. - if ( (output == OPENAL_OUTPUT_ALSA) && (!cmdline("forcealsa")) ) { + if ( (output == OPENAL_OUTPUT_ALSA) && (commandLineOptions[SOUND].last()->type() != OPENAL_OUTPUT_ALSA) ) { OPENAL_Close(); output = OPENAL_OUTPUT_OSS; OPENAL_SetOutput(output);