]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Game.hpp
Fix mismatched usage length, build fail on g++
[lugaru.git] / Source / Game.hpp
index efa119e073b07a2b236a681af2dd017cc32dc616..9bb6adbcf3f2b7f902c9f639d847dfc77e875932 100644 (file)
@@ -1,6 +1,6 @@
 /*
 Copyright (C) 2003, 2010 - Wolfire Games
-Copyright (C) 2010-2016 - Lugaru contributors (see AUTHORS file)
+Copyright (C) 2010-2017 - Lugaru contributors (see AUTHORS file)
 
 This file is part of Lugaru.
 
@@ -26,22 +26,22 @@ along with Lugaru.  If not, see <http://www.gnu.org/licenses/>.
 #include "Environment/Lights.hpp"
 #include "Environment/Skybox.hpp"
 #include "Environment/Terrain.hpp"
-#include "Graphic/gamegl.hpp"
 #include "Graphic/Models.hpp"
 #include "Graphic/Sprite.hpp"
 #include "Graphic/Stereo.hpp"
 #include "Graphic/Text.hpp"
 #include "Graphic/Texture.hpp"
+#include "Graphic/gamegl.hpp"
 #include "Objects/Object.hpp"
 #include "Objects/Person.hpp"
 #include "Objects/Weapons.hpp"
 #include "Thirdparty/optionparser.h"
 #include "User/Account.hpp"
-#include "Utils/binio.h"
 #include "Utils/ImageIO.hpp"
+#include "Utils/binio.h"
 
-#include <fstream>
 #include <SDL.h>
+#include <fstream>
 
 #define NB_CAMPAIGN_MENU_ITEM 7
 
@@ -70,9 +70,9 @@ extern float deltah, deltav;
 extern int mousecoordh, mousecoordv;
 extern int oldmousecoordh, oldmousecoordv;
 extern float yaw, pitch;
-extern SkyBox *skybox;
+extern SkyBoxskybox;
 extern bool cameramode;
-extern bool firstload;
+extern bool firstLoadDone;
 
 extern float leveltime;
 extern float wonleveltime;
@@ -97,7 +97,8 @@ extern int musictype;
 extern XYZ mapcenter;
 extern float mapradius;
 
-extern Text *text;
+extern Text* text;
+extern Text* textmono;
 extern float fps;
 
 extern bool editorenabled;
@@ -143,11 +144,16 @@ void LoadingScreen();
 int DrawGLScene(StereoSide side);
 void playdialoguescenesound();
 int findClosestPlayer();
-void Loadlevel(int which);
-void Loadlevel(const std::string& name, bool tutorial = false);
+bool LoadLevel(int which);
+bool LoadLevel(const std::string& name, bool tutorial = false);
+
+void ProcessInput();
+void ProcessDevInput();
+
 void Tick();
 void TickOnce();
 void TickOnceAfter();
+
 void SetUpLighting();
 GLvoid ReSizeGLScene(float fov, float near);
 
@@ -156,56 +162,79 @@ void fireSound(int sound = fireendsound);
 void inputText(std::string& str, unsigned* charselected);
 void flash(float amount = 1, int delay = 1);
 }
+float roughDirection(XYZ vec);
+float roughDirectionTo(XYZ start, XYZ end);
+float pitchTo(XYZ start, XYZ end);
+float sq(float n);
 
 #ifndef __forceinline
-#  ifdef __GNUC__
-#    define __forceinline inline __attribute__((always_inline))
-#  endif
+#ifdef __GNUC__
+#define __forceinline inline __attribute__((always_inline))
+#endif
 #endif
 
 static __forceinline void swap_gl_buffers(void)
 {
-    extern SDL_Window *sdlwindow;
+    extern SDL_Windowsdlwindow;
     SDL_GL_SwapWindow(sdlwindow);
 
     // try to limit this to 60fps, even if vsync fails.
     Uint32 now;
     static Uint32 frameticks = 0;
     const Uint32 endticks = (frameticks + 16);
-    while ((now = SDL_GetTicks()) < endticks) { /* spin. */ }
+    while ((now = SDL_GetTicks()) < endticks) { /* spin. */
+    }
     frameticks = now;
 }
 
-enum maptypes {
-    mapkilleveryone, mapgosomewhere,
-    mapkillsomeone, mapkillmost // These two are unused
+enum maptypes
+{
+    mapkilleveryone,
+    mapgosomewhere,
+    mapkillsomeone,
+    mapkillmost // These two are unused
 };
 
-enum pathtypes {wpkeepwalking, wppause};
-
-extern const char *pathtypenames[2];
-
-enum editortypes {typeactive, typesitting, typesittingwall, typesleeping,
-                  typedead1, typedead2, typedead3, typedead4
-                 };
-
-extern const char *editortypenames[8];
-
-extern const char *rabbitskin[10];
-
-extern const char *wolfskin[3];
+enum pathtypes
+{
+    wpkeepwalking,
+    wppause
+};
 
-extern const char **creatureskin[2];
+extern const char* pathtypenames[2];
 
-SDL_bool sdlEventProc(const SDL_Event &e);
+enum editortypes
+{
+    typeactive,
+    typesitting,
+    typesittingwall,
+    typesleeping,
+    typedead1,
+    typedead2,
+    typedead3,
+    typedead4
+};
 
+extern const char* editortypenames[8];
 
+SDL_bool sdlEventProc(const SDL_Event& e);
 
-enum  optionIndex { UNKNOWN, HELP, FULLSCREEN, NOMOUSEGRAB, SOUND, OPENALINFO, SHOWRESOLUTIONS, DEVTOOLS };
+enum optionIndex
+{
+    UNKNOWN,
+    VERSION,
+    HELP,
+    FULLSCREEN,
+    NOMOUSEGRAB,
+    SOUND,
+    OPENALINFO,
+    SHOWRESOLUTIONS,
+    DEVTOOLS
+};
 /* Number of options + 1 */
-const int commandLineOptionsNumber = 9;
+const int commandLineOptionsNumber = 10;
 
-extern const option::Descriptor usage[13];
+extern const option::Descriptor usage[];
 
 extern option::Option commandLineOptions[commandLineOptionsNumber];
 extern option::Option* commandLineOptionsBuffer;