]> git.jsancho.org Git - lugaru.git/blobdiff - Source/GameTick.cpp
Removed ununused field hasAlpha
[lugaru.git] / Source / GameTick.cpp
index 11571d612dea0b756ded2b87078551c8a1cf8626..a251430198746370c04b231cf3f8efebe1d6b6ee 100644 (file)
@@ -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;
@@ -602,18 +600,18 @@ void Setenvironment(int which)
         if (ambientsound)
             emit_stream_np(stream_wind);
 
-        objects.treetextureptr.load(":Data:Textures:snowtree.png", 0, 1);
-        objects.bushtextureptr.load(":Data:Textures:bushsnow.png", 0, 1);
-        objects.rocktextureptr.load(":Data:Textures:bouldersnow.jpg", 1, 0);
-        objects.boxtextureptr.load(":Data:Textures:snowbox.jpg", 1, 0);
+        objects.treetextureptr.load(":Data:Textures:snowtree.png", 0);
+        objects.bushtextureptr.load(":Data:Textures:bushsnow.png", 0);
+        objects.rocktextureptr.load(":Data:Textures:bouldersnow.jpg", 1);
+        objects.boxtextureptr.load(":Data:Textures:snowbox.jpg", 1);
 
         footstepsound = footstepsn1;
         footstepsound2 = footstepsn2;
         footstepsound3 = footstepst1;
         footstepsound4 = footstepst2;
 
-        terraintexture.load(":Data:Textures:snow.jpg", 1, 0);
-        terraintexture2.load(":Data:Textures:rock.jpg", 1, 0);
+        terraintexture.load(":Data:Textures:snow.jpg", 1);
+        terraintexture2.load(":Data:Textures:rock.jpg", 1);
 
 
         temptexdetail = texdetail;
@@ -633,10 +631,10 @@ void Setenvironment(int which)
     } else if (environment == desertenvironment) {
         windvector = 0;
         windvector.z = 2;
-        objects.treetextureptr.load(":Data:Textures:deserttree.png", 0, 1);
-        objects.bushtextureptr.load(":Data:Textures:bushdesert.png", 0, 1);
-        objects.rocktextureptr.load(":Data:Textures:boulderdesert.jpg", 1, 0);
-        objects.boxtextureptr.load(":Data:Textures:desertbox.jpg", 1, 0);
+        objects.treetextureptr.load(":Data:Textures:deserttree.png", 0);
+        objects.bushtextureptr.load(":Data:Textures:bushdesert.png", 0);
+        objects.rocktextureptr.load(":Data:Textures:boulderdesert.jpg", 1);
+        objects.boxtextureptr.load(":Data:Textures:desertbox.jpg", 1);
 
 
         if (ambientsound)
@@ -647,8 +645,8 @@ void Setenvironment(int which)
         footstepsound3 = footstepsn1;
         footstepsound4 = footstepsn2;
 
-        terraintexture.load(":Data:Textures:sand.jpg", 1, 0);
-        terraintexture2.load(":Data:Textures:sandslope.jpg", 1, 0);
+        terraintexture.load(":Data:Textures:sand.jpg", 1);
+        terraintexture2.load(":Data:Textures:sandslope.jpg", 1);
 
 
         temptexdetail = texdetail;
@@ -668,10 +666,10 @@ void Setenvironment(int which)
     } else if (environment == grassyenvironment) {
         windvector = 0;
         windvector.z = 2;
-        objects.treetextureptr.load(":Data:Textures:tree.png", 0, 1);
-        objects.bushtextureptr.load(":Data:Textures:bush.png", 0, 1);
-        objects.rocktextureptr.load(":Data:Textures:boulder.jpg", 1, 0);
-        objects.boxtextureptr.load(":Data:Textures:grassbox.jpg", 1, 0);
+        objects.treetextureptr.load(":Data:Textures:tree.png", 0);
+        objects.bushtextureptr.load(":Data:Textures:bush.png", 0);
+        objects.rocktextureptr.load(":Data:Textures:boulder.jpg", 1);
+        objects.boxtextureptr.load(":Data:Textures:grassbox.jpg", 1);
 
         if (ambientsound)
             emit_stream_np(stream_wind, 100.);
@@ -681,8 +679,8 @@ void Setenvironment(int which)
         footstepsound3 = footstepst1;
         footstepsound4 = footstepst2;
 
-        terraintexture.load(":Data:Textures:grassdirt.jpg", 1, 0);
-        terraintexture2.load(":Data:Textures:mossrock.jpg", 1, 0);
+        terraintexture.load(":Data:Textures:grassdirt.jpg", 1);
+        terraintexture2.load(":Data:Textures:mossrock.jpg", 1);
 
 
         temptexdetail = texdetail;
@@ -733,9 +731,9 @@ void LoadCampaign()
 
     ifstream test(ConvertFileName((":Data:Textures:" + accountactive->getCurrentCampaign() + ":World.png").c_str()));
     if (test.good()) {
-        Mainmenuitems[7].load((":Data:Textures:" + accountactive->getCurrentCampaign() + ":World.png").c_str(), 0, 0);
+        Mainmenuitems[7].load((":Data:Textures:" + accountactive->getCurrentCampaign() + ":World.png").c_str(), 0);
     } else {
-        Mainmenuitems[7].load(":Data:Textures:World.png", 0, 0);
+        Mainmenuitems[7].load(":Data:Textures:World.png", 0);
     }
 
     if (accountactive->getCampaignChoicesMade() == 0) {
@@ -817,7 +815,6 @@ void Game::Loadlevel(const char *name)
         tutorialstagetime = 0;
         tutorialmaxtime = 1;
     }
-    loadingstuff = 1;
     pause_sound(whooshsound);
     pause_sound(stream_firesound);
 
@@ -954,7 +951,6 @@ void Game::Loadlevel(const char *name)
             funpackf(tfile, "Bf Bf Bf Bf Bf Bi", &Person::players[0]->coords.x, &Person::players[0]->coords.y, &Person::players[0]->coords.z, &Person::players[0]->yaw, &Person::players[0]->targetyaw, &Person::players[0]->num_weapons);
         if (stealthloading)
             funpackf(tfile, "Bf Bf Bf Bf Bf Bi", &lamefloat, &lamefloat, &lamefloat, &lamefloat, &lamefloat, &Person::players[0]->num_weapons);
-        Person::players[0]->originalcoords = Person::players[0]->coords;
         if (Person::players[0]->num_weapons > 0 && Person::players[0]->num_weapons < 5)
             for (int j = 0; j < Person::players[0]->num_weapons; j++) {
                 Person::players[0]->weaponids[j] = weapons.size();
@@ -1280,7 +1276,7 @@ void Game::Loadlevel(const char *name)
                         (char *)":Data:Models:Body7.solid",
                         (char *)":Data:Models:Bodylow.solid",
                         (char *)":Data:Models:Belt.solid", 1);
-                    Person::players[i]->skeleton.drawmodelclothes.textureptr.load(":Data:Textures:Belt.png", 1, 1);
+                    Person::players[i]->skeleton.drawmodelclothes.textureptr.load(":Data:Textures:Belt.png", 1);
                 }
                 if (Person::players[i]->creature == wolftype) {
                     Person::players[i]->skeleton.Load(
@@ -1324,7 +1320,6 @@ void Game::Loadlevel(const char *name)
             Person::players[i]->normalsupdatedelay = 0;
 
             Person::players[i]->aitype = passivetype;
-            Person::players[i]->madskills = 0;
 
             if (i == 0) {
                 Person::players[i]->proportionhead = 1.2;
@@ -1436,7 +1431,6 @@ void Game::Loadlevel(const char *name)
         perror("Problem");
     }
     leveltime = 0;
-    loadingstuff = 0;
     visibleloading = 0;
 }
 
@@ -2394,7 +2388,7 @@ void doDebugKeys()
                     Person::players.back()->whichskin = 2;
                 }
 
-                Person::players.back()->skeleton.drawmodelclothes.textureptr.load(":Data:Textures:Belt.png", 1, 1);
+                Person::players.back()->skeleton.drawmodelclothes.textureptr.load(":Data:Textures:Belt.png", 1);
                 Person::players.back()->power = 1;
                 Person::players.back()->speedmult = 1;
                 Person::players.back()->animCurrent = bounceidleanim;
@@ -2493,7 +2487,6 @@ void doDebugKeys()
                 Person::players.back()->bleeding = 0;
                 Person::players.back()->numwaypoints = 0;
                 Person::players.back()->waypoint = 0;
-                Person::players.back()->jumppath = 0;
                 Person::players.back()->weaponstuck = -1;
                 Person::players.back()->weaponactive = -1;
                 Person::players.back()->num_weapons = 0;
@@ -2939,12 +2932,8 @@ void doAerialAcrobatics()
                                 Person::players[k]->animTarget = Person::players[k]->getLanding();
                                 emit_sound_at(landsound, Person::players[k]->coords, 128.);
                                 if (k == 0) {
-                                    envsound[numenvsounds] = Person::players[k]->coords;
-                                    envsoundvol[numenvsounds] = 16;
-                                    envsoundlife[numenvsounds] = .4;
-                                    numenvsounds++;
+                                    addEnvSound(Person::players[k]->coords);
                                 }
-
                             }
                         }
                     }
@@ -3384,8 +3373,7 @@ void doAttacks()
                                             !Person::players[i]->skeleton.free &&
                                             Person::players[i]->animTarget != getupfrombackanim &&
                                             Person::players[i]->animTarget != getupfromfrontanim &&
-                                            (Person::players[i]->stunned > 0 && Person::players[k]->madskills ||
-                                             Person::players[i]->surprised > 0 ||
+                                            (Person::players[i]->surprised > 0 ||
                                              Person::players[i]->aitype == passivetype ||
                                              attackweapon && Person::players[i]->stunned > 0) &&
                                             normaldotproduct(Person::players[i]->facing, Person::players[i]->coords - Person::players[k]->coords) > 0) {
@@ -5411,13 +5399,6 @@ void MenuTick()
         }
     }
 
-    if (Input::isKeyDown(SDL_SCANCODE_Q) && Input::isKeyDown(SDL_SCANCODE_LGUI)) {
-        tryquit = 1;
-        if (mainmenu == 3) {
-            SaveSettings();
-        }
-    }
-
     OPENAL_SetFrequency(channels[stream_menutheme], 22050);
 
     if (entername) {
@@ -5467,7 +5448,6 @@ void Game::Tick()
         displaytime[i] += multiplier;
     }
 
-    keyboardfrozen = false;
     Input::Tick();
 
     if (Input::isKeyPressed(SDL_SCANCODE_F6)) {
@@ -5640,15 +5620,6 @@ void Game::Tick()
             }
         }
 
-
-
-        if (Input::isKeyDown(SDL_SCANCODE_Q) && Input::isKeyDown(SDL_SCANCODE_LGUI)) {
-            tryquit = 1;
-            if (mainmenu == 3) {
-                SaveSettings();
-            }
-        }
-
         static int oldwinfreeze;
         if (winfreeze && !oldwinfreeze) {
             OPENAL_SetFrequency(OPENAL_ALL, 0.001);