]> git.jsancho.org Git - lugaru.git/blobdiff - Source/GameInitDispose.cpp
Removed unused globals
[lugaru.git] / Source / GameInitDispose.cpp
index 0ce61eeb704cbb2a8a4faa017e86e406dc96d2b0..b825162a6b7442e097f2d5147f6678546e0369f6 100644 (file)
@@ -26,13 +26,10 @@ along with Lugaru.  If not, see <http://www.gnu.org/licenses/>.
 extern float screenwidth, screenheight;
 extern float viewdistance;
 extern XYZ viewer;
-extern XYZ lightlocation;
 extern float fadestart;
 extern float texscale;
 extern float gravity;
 extern Light light;
-extern Skeleton testskeleton;
-extern int numsounds;
 extern Terrain terrain;
 extern int kTextureSize;
 extern float texdetail;
@@ -52,9 +49,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;
 extern bool visibleloading;
 extern float flashamount, flashr, flashg, flashb;
@@ -62,7 +56,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 +113,6 @@ void Dispose()
     }
 
     OPENAL_Close();
-    if (texture.data) {
-        free(texture.data);
-    }
-    texture.data = 0;
 #endif
 }
 
@@ -170,7 +159,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 +462,6 @@ void FadeLoadingScreen(float howmuch)
     swap_gl_buffers();
 }
 
-
-extern bool cmdline(const char *cmd);
-
 void Game::InitGame()
 {
     LOGFUNC;
@@ -483,10 +470,6 @@ void Game::InitGame()
 
     accountactive = Account::loadFile(":Data:Users");
 
-    tintr = 1;
-    tintg = 1;
-    tintb = 1;
-
     whichjointstartarray[0] = righthip;
     whichjointendarray[0] = rightfoot;
 
@@ -569,8 +552,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 +575,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);
@@ -710,8 +690,6 @@ void Game::LoadStuff()
     text->BuildFont();
     texdetail = temptexdetail;
 
-    numsounds = 71;
-
     viewdistdetail = 2;
     viewdistance = 50 * megascale * viewdistdetail;