X-Git-Url: https://git.jsancho.org/?p=lugaru.git;a=blobdiff_plain;f=Source%2FGame.hpp;h=51232cc5a5fa7342b0434253bd25078d20c3947f;hp=c5a3632ed6c7430a7039bd0b0b80610c33e74125;hb=6a8cb464330e92163c8feaf101b8b5837c973bba;hpb=5fca41ab430df85d6dd620a7f4130df01bc1430f diff --git a/Source/Game.hpp b/Source/Game.hpp index c5a3632..51232cc 100644 --- a/Source/Game.hpp +++ b/Source/Game.hpp @@ -26,22 +26,22 @@ along with Lugaru. If not, see . #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 #include +#include #define NB_CAMPAIGN_MENU_ITEM 7 @@ -70,7 +70,7 @@ extern float deltah, deltav; extern int mousecoordh, mousecoordv; extern int oldmousecoordh, oldmousecoordv; extern float yaw, pitch; -extern SkyBox *skybox; +extern SkyBox* skybox; extern bool cameramode; extern bool firstLoadDone; @@ -97,8 +97,8 @@ extern int musictype; extern XYZ mapcenter; extern float mapradius; -extern Text *text; -extern Text *textmono; +extern Text* text; +extern Text* textmono; extern float fps; extern bool editorenabled; @@ -168,43 +168,69 @@ 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_Window* sdlwindow; 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 pathtypes +{ + wpkeepwalking, + wppause +}; -enum editortypes {typeactive, typesitting, typesittingwall, typesleeping, - typedead1, typedead2, typedead3, typedead4 - }; +extern const char* pathtypenames[2]; -extern const char *editortypenames[8]; +enum editortypes +{ + typeactive, + typesitting, + typesittingwall, + typesleeping, + typedead1, + typedead2, + typedead3, + typedead4 +}; -SDL_bool sdlEventProc(const SDL_Event &e); +extern const char* editortypenames[8]; +SDL_bool sdlEventProc(const SDL_Event& e); -enum optionIndex { UNKNOWN, VERSION, 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 = 10;