]> git.jsancho.org Git - lugaru.git/blobdiff - Source/GameInitDispose.cpp
Rename all C++ headers with .hpp extension
[lugaru.git] / Source / GameInitDispose.cpp
index 705ae23154c4ef830bc2e2a000fcb7ef986e510c..d950c2ebb9d52bd9a228131f19c5a4c65cd509e0 100644 (file)
@@ -18,11 +18,13 @@ You should have received a copy of the GNU General Public License
 along with Lugaru.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include "Game.h"
-#include "openal_wrapper.h"
-#include "Animation/Animation.h"
-#include "Texture.h"
-#include "Utils/Folders.h"
+#include "Game.hpp"
+
+#include "Animation/Animation.hpp"
+#include "Audio/openal_wrapper.hpp"
+#include "Graphic/Texture.hpp"
+#include "Menu/Menu.hpp"
+#include "Utils/Folders.hpp"
 
 extern float screenwidth, screenheight;
 extern float viewdistance;
@@ -56,7 +58,6 @@ extern float flashamount, flashr, flashg, flashb;
 extern int flashdelay;
 extern int whichjointstartarray[26];
 extern int whichjointendarray[26];
-extern int difficulty;
 extern float slomospeed;
 extern bool gamestarted;
 
@@ -78,11 +79,11 @@ void Dispose()
     LOGFUNC;
 
     if (Game::endgame == 2) {
-        Game::accountactive->endGame();
+        Account::active().endGame();
         Game::endgame = 0;
     }
 
-    Account::saveFile(Folders::getUserDataPath()+"/users", Game::accountactive);
+    Account::saveFile(Folders::getUserDataPath()+"/users");
 
     //textures.clear();
 
@@ -457,7 +458,7 @@ void Game::InitGame()
 
     numchallengelevels = 14;
 
-    accountactive = Account::loadFile(Folders::getUserDataPath()+"/users");
+    Account::loadFile(Folders::getUserDataPath()+"/users");
 
     whichjointstartarray[0] = righthip;
     whichjointendarray[0] = rightfoot;
@@ -627,7 +628,7 @@ void Game::InitGame()
     newscreenwidth = screenwidth;
     newscreenheight = screenheight;
 
-    LoadMenu();
+    Menu::Load();
 
     Animation::loadAll();
 }
@@ -650,7 +651,7 @@ void Game::LoadScreenTexture()
     glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, kTextureSize, kTextureSize, 0);
 }
 
-//TODO: move LoadStuff() closer to GameTick.cpp to get rid of various vars shared in Game.h
+//TODO: move LoadStuff() closer to GameTick.cpp to get rid of various vars shared in Game.hpp
 void Game::LoadStuff()
 {
     static float temptexdetail;
@@ -825,9 +826,9 @@ void Game::LoadStuff()
     XYZ moveamount;
     moveamount = 0;
     moveamount.z = 2;
-    // FIXME - Why this uses skeleton.num_joints and not Animation::numjoints? (are they equal?)
-    // It seems skeleton.num_joints is 0 at this point, so this is useless.
-    for (i = 0; i < Person::players[0]->skeleton.num_joints; i++) {
+    // FIXME - Why this uses skeleton.joints.size() and not Animation::numjoints? (are they equal?)
+    // It seems skeleton.joints.size() is 0 at this point, so this is useless.
+    for (i = 0; i < Person::players[0]->skeleton.joints.size(); i++) {
         for (j = 0; j < Animation::animations[knifesneakattackanim].frames.size(); j++) {
             Animation::animations[knifesneakattackanim].frames[j].joints[i].position += moveamount;
         }
@@ -835,7 +836,7 @@ void Game::LoadStuff()
 
     LoadingScreen();
 
-    for (i = 0; i < Person::players[0]->skeleton.num_joints; i++) {
+    for (i = 0; i < Person::players[0]->skeleton.joints.size(); i++) {
         for (j = 0; j < Animation::animations[knifesneakattackedanim].frames.size(); j++) {
             Animation::animations[knifesneakattackedanim].frames[j].joints[i].position += moveamount;
         }
@@ -843,7 +844,7 @@ void Game::LoadStuff()
 
     LoadingScreen();
 
-    for (i = 0; i < Person::players[0]->skeleton.num_joints; i++) {
+    for (i = 0; i < Person::players[0]->skeleton.joints.size(); i++) {
         Animation::animations[dead1anim].frames[1].joints[i].position = Animation::animations[dead1anim].frames[0].joints[i].position;
         Animation::animations[dead2anim].frames[1].joints[i].position = Animation::animations[dead2anim].frames[0].joints[i].position;
         Animation::animations[dead3anim].frames[1].joints[i].position = Animation::animations[dead3anim].frames[0].joints[i].position;
@@ -859,7 +860,7 @@ void Game::LoadStuff()
     Animation::animations[dead3anim].frames[1].speed = 0.001;
     Animation::animations[dead4anim].frames[1].speed = 0.001;
 
-    for (i = 0; i < Person::players[0]->skeleton.num_joints; i++) {
+    for (i = 0; i < Person::players[0]->skeleton.joints.size(); i++) {
         for (j = 0; j < Animation::animations[swordsneakattackanim].frames.size(); j++) {
             Animation::animations[swordsneakattackanim].frames[j].joints[i].position += moveamount;
         }
@@ -871,7 +872,7 @@ void Game::LoadStuff()
 
     LoadingScreen();
 
-    for (i = 0; i < Person::players[0]->skeleton.num_joints; i++) {
+    for (i = 0; i < Person::players[0]->skeleton.joints.size(); i++) {
         for (j = 0; j < Animation::animations[swordsneakattackedanim].frames.size(); j++) {
             Animation::animations[swordsneakattackedanim].frames[j].joints[i].position += moveamount;
         }