From 3b325285c15e47e75ad5c9db05f7105f8b5af387 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=B4me=20Chilliet?= Date: Mon, 28 Nov 2016 18:50:03 +0700 Subject: [PATCH] Removed unused globals --- Source/GameDraw.cpp | 21 --------------------- Source/GameInitDispose.cpp | 7 ------- Source/GameTick.cpp | 5 ----- Source/Globals.cpp | 21 --------------------- Source/Input.cpp | 6 ++---- Source/Person.cpp | 6 ------ Source/Settings.cpp | 10 ---------- Source/Settings.h | 2 -- Source/Skeleton.cpp | 1 - Source/main.cpp | 4 ---- 10 files changed, 2 insertions(+), 81 deletions(-) diff --git a/Source/GameDraw.cpp b/Source/GameDraw.cpp index 4940424..802a1e9 100644 --- a/Source/GameDraw.cpp +++ b/Source/GameDraw.cpp @@ -30,7 +30,6 @@ extern float texscale; extern Light light; extern Terrain terrain; extern float multiplier; -extern float sps; extern float viewdistance; extern float fadestart; extern float screenwidth, screenheight; @@ -60,12 +59,6 @@ extern int netstate; extern float motionbluramount; extern bool isclient; extern bool alwaysblur; -extern int test; -extern bool tilt2weird; -extern bool tiltweird; -extern bool midweird; -extern bool proportionweird; -extern bool vertexweird[6]; extern bool velocityblur; extern bool debugmode; extern int mainmenu; @@ -94,8 +87,6 @@ extern int currenthotspot;; extern bool campaign; extern bool winfreeze; -extern float menupulse; - extern bool gamestart; extern bool gamestarted; @@ -414,18 +405,6 @@ int Game::DrawGLScene(StereoSide side) glEnable(GL_COLOR_MATERIAL); - test = 2; - tilt2weird = 0; - tiltweird = 0; - midweird = 0; - proportionweird = 0; - vertexweird[0] = 0; - vertexweird[1] = 0; - vertexweird[2] = 0; - vertexweird[3] = 0; - vertexweird[4] = 0; - vertexweird[5] = 0; - if (!cellophane) { glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_CULL_FACE); diff --git a/Source/GameInitDispose.cpp b/Source/GameInitDispose.cpp index 935b69d..b825162 100644 --- a/Source/GameInitDispose.cpp +++ b/Source/GameInitDispose.cpp @@ -26,13 +26,10 @@ along with Lugaru. If not, see . 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,8 +49,6 @@ extern float multiplier; extern int netdatanew; extern float mapinfo; extern bool stillloading; -extern short vRefNum; -extern long dirID; extern int mainmenu; extern bool visibleloading; extern float flashamount, flashr, flashg, flashb; @@ -695,8 +690,6 @@ void Game::LoadStuff() text->BuildFont(); texdetail = temptexdetail; - numsounds = 71; - viewdistdetail = 2; viewdistance = 50 * megascale * viewdistdetail; diff --git a/Source/GameTick.cpp b/Source/GameTick.cpp index 893a50e..592d0e3 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -85,8 +85,6 @@ extern bool ambientsound; extern bool mousejump; extern float viewdistance; extern bool freeze; -extern bool keyboardfrozen; -extern bool loadingstuff; extern XYZ windvector; extern bool debugmode; static int leveltheme; @@ -817,7 +815,6 @@ void Game::Loadlevel(const char *name) tutorialstagetime = 0; tutorialmaxtime = 1; } - loadingstuff = 1; pause_sound(whooshsound); pause_sound(stream_firesound); @@ -1434,7 +1431,6 @@ void Game::Loadlevel(const char *name) perror("Problem"); } leveltime = 0; - loadingstuff = 0; visibleloading = 0; } @@ -5456,7 +5452,6 @@ void Game::Tick() displaytime[i] += multiplier; } - keyboardfrozen = false; Input::Tick(); if (Input::isKeyPressed(SDL_SCANCODE_F6)) { diff --git a/Source/Globals.cpp b/Source/Globals.cpp index 78d8098..9e68823 100644 --- a/Source/Globals.cpp +++ b/Source/Globals.cpp @@ -61,17 +61,13 @@ bool fullscreen = 0; float viewdistance = 0; XYZ viewer; XYZ viewerfacing; -XYZ lightlocation; float fadestart = 0; int environment = 0; float texscale = 0; float gravity = 0; Light light; Animation animation[animation_count]; -Skeleton testskeleton; -int numsounds = 0; Terrain terrain; -float sps = 0; SDL_Window *sdlwindow; @@ -86,7 +82,6 @@ int slomo = 0; float slomodelay = 0; GLubyte bloodText[512 * 512 * 3] = {0}; GLubyte wolfbloodText[512 * 512 * 3] = {0}; -float colors[3] = {0}; int bloodtoggle = 0; float camerashake = 0; float woozy = 0; @@ -102,24 +97,17 @@ bool freeze = false; bool winfreeze = false; float flashamount = 0, flashr = 0, flashg = 0, flashb = 0; int flashdelay = 0; -bool vblsync = false; float motionbluramount = 0; -bool keyboardfrozen = false; -bool loadingstuff = false; bool stillloading = false; bool showpoints = false; bool showdamagebar = false; bool alwaysblur = false; bool immediate = false; bool velocityblur = false; -int test = 0; XYZ windvector; -short vRefNum = 0; -long dirID = 0; int mainmenu = 0; int whichjointstartarray[26] = {0}; int whichjointendarray[26] = {0}; -int kBitsPerPixel = 0; int numhotspots = 0; XYZ hotspot[40]; @@ -129,8 +117,6 @@ char hotspottext[40][256] = {0}; int currenthotspot = 0; int killhotspot = 0; -float menupulse = 0; - float smoketex = 0; float slomospeed = 0; @@ -171,15 +157,8 @@ float envsoundvol[30] = {0}; float envsoundlife[30] = {0}; int numenvsounds; - -bool tilt2weird = false; -bool tiltweird = false; -bool midweird = false; -bool proportionweird = false; -bool vertexweird[6] = {0}; bool debugmode = false; - bool campaign = false; bool gamestarted = false; diff --git a/Source/Input.cpp b/Source/Input.cpp index dde3659..b18ec6e 100644 --- a/Source/Input.cpp +++ b/Source/Input.cpp @@ -21,8 +21,6 @@ along with Lugaru. If not, see . /**> HEADER FILES <**/ #include "Input.h" -extern bool keyboardfrozen; - bool keyDown[SDL_NUM_SCANCODES + 6]; bool keyPressed[SDL_NUM_SCANCODES + 6]; @@ -44,14 +42,14 @@ void Input::Tick() bool Input::isKeyDown(int k) { - if (keyboardfrozen || k >= SDL_NUM_SCANCODES + 6) // really useful? check that. + if (k >= SDL_NUM_SCANCODES + 6) // really useful? check that. return false; return keyDown[k]; } bool Input::isKeyPressed(int k) { - if (keyboardfrozen || k >= SDL_NUM_SCANCODES + 6) + if (k >= SDL_NUM_SCANCODES + 6) return false; return keyPressed[k]; } diff --git a/Source/Person.cpp b/Source/Person.cpp index 27f4ec9..8a3579e 100644 --- a/Source/Person.cpp +++ b/Source/Person.cpp @@ -57,12 +57,6 @@ extern float flashamount, flashr, flashg, flashb; extern int flashdelay; extern bool showpoints; extern bool immediate; -extern int test; -extern bool tilt2weird; -extern bool tiltweird; -extern bool midweird; -extern bool proportionweird; -extern bool vertexweird[6]; extern XYZ envsound[30]; extern float envsoundvol[30]; extern float envsoundlife[30]; diff --git a/Source/Settings.cpp b/Source/Settings.cpp index 6c1c667..8258bec 100644 --- a/Source/Settings.cpp +++ b/Source/Settings.cpp @@ -32,7 +32,6 @@ void DefaultSettings() newscreenwidth = kContextWidth = 1024; newscreenheight = kContextHeight = 768; fullscreen = 0; - kBitsPerPixel = 32; floatjump = 0; autoslomo = 1; decals = 1; @@ -52,7 +51,6 @@ void DefaultSettings() velocityblur = 0; volume = 0.8f; ambientsound = 1; - vblsync = 1; debugmode = 0; crouchkey = SDL_SCANCODE_LSHIFT; @@ -126,8 +124,6 @@ void SaveSettings() opstream << texttoggle; opstream << "\nDebug:\n"; opstream << debugmode; - opstream << "\nVBL Sync:\n"; - opstream << vblsync; opstream << "\nShow Points:\n"; opstream << showpoints; opstream << "\nAlways Blur:\n"; @@ -208,10 +204,6 @@ bool LoadSettings() ipstream >> ismotionblur; } else if ( !strncmp(setting, "Overall Detail", 14) ) { ipstream >> detail; - if (detail != 0) - kBitsPerPixel = 32; - else - kBitsPerPixel = 16; } else if ( !strncmp(setting, "Floating jump", 13) ) { ipstream >> floatjump; } else if ( !strncmp(setting, "Mouse jump", 10) ) { @@ -247,8 +239,6 @@ bool LoadSettings() ipstream >> texttoggle; } else if ( !strncmp(setting, "Debug", 5) ) { ipstream >> debugmode; - } else if ( !strncmp(setting, "VBL Sync", 8) ) { - ipstream >> vblsync; } else if ( !strncmp(setting, "Show Points", 11) ) { ipstream >> showpoints; } else if ( !strncmp(setting, "Always Blur", 11) ) { diff --git a/Source/Settings.h b/Source/Settings.h index daa3b22..942d163 100644 --- a/Source/Settings.h +++ b/Source/Settings.h @@ -41,7 +41,6 @@ extern int difficulty; extern bool damageeffects; extern bool texttoggle; extern bool debugmode; -extern bool vblsync; extern bool showpoints; extern bool showdamagebar; extern bool alwaysblur; @@ -49,7 +48,6 @@ extern bool immediate; extern bool velocityblur; extern float volume; extern int detail; -extern int kBitsPerPixel; extern int kContextWidth; extern int kContextHeight; extern float screenwidth, screenheight; diff --git a/Source/Skeleton.cpp b/Source/Skeleton.cpp index c7c9eb0..1abc959 100644 --- a/Source/Skeleton.cpp +++ b/Source/Skeleton.cpp @@ -26,7 +26,6 @@ along with Lugaru. If not, see . extern float multiplier; extern float gravity; -extern Skeleton testskeleton; extern Terrain terrain; extern Objects objects; extern int environment; diff --git a/Source/main.cpp b/Source/main.cpp index 09f6960..1e78908 100644 --- a/Source/main.cpp +++ b/Source/main.cpp @@ -42,7 +42,6 @@ using namespace Game; #endif extern float multiplier; -extern float sps; extern float realmultiplier; extern int slomo; extern bool cellophane; @@ -243,9 +242,6 @@ bool SetUp () fprintf(stderr, "Failed to load config, creating default\n"); SaveSettings(); } - if (kBitsPerPixel != 32 && kBitsPerPixel != 16) { - kBitsPerPixel = 16; - } if (SDL_GL_LoadLibrary(NULL) == -1) { fprintf(stderr, "SDL_GL_LoadLibrary() failed: %s\n", SDL_GetError()); -- 2.39.2