From ed3662c0852c4312a612b4fc35bd03aba8d13db7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Verschelde?= Date: Sun, 11 Dec 2016 15:06:33 +0100 Subject: [PATCH] Rename all C++ headers with .hpp extension Also improve header inclusion to follow this logic: - "Own" header comes first (`Folders.hpp` in `Folder.cpp`) - Lugaru headers come next, in alphabetical order - System headers come next, using the `
` format --- CMakeLists.txt | 72 +++++++++---------- Source/Animation/Animation.cpp | 9 +-- .../Animation/{Animation.h => Animation.hpp} | 7 +- Source/Animation/Joint.cpp | 3 +- Source/Animation/{Joint.h => Joint.hpp} | 7 +- Source/Animation/Muscle.cpp | 3 +- Source/Animation/{Muscle.h => Muscle.hpp} | 7 +- Source/Animation/Skeleton.cpp | 12 ++-- Source/Animation/{Skeleton.h => Skeleton.hpp} | 23 +++--- Source/Audio/Sounds.cpp | 8 +-- Source/Audio/{Sounds.h => Sounds.hpp} | 6 +- Source/Audio/openal_wrapper.cpp | 11 +-- .../{openal_wrapper.h => openal_wrapper.hpp} | 21 +++--- Source/Devtools/ConsoleCmds.cpp | 11 +-- .../{ConsoleCmds.h => ConsoleCmds.hpp} | 0 Source/Environment/Lights.cpp | 3 +- Source/Environment/{Lights.h => Lights.hpp} | 10 ++- Source/Environment/Skybox.cpp | 5 +- Source/Environment/{Skybox.h => Skybox.hpp} | 16 ++--- Source/Environment/Terrain.cpp | 9 +-- Source/Environment/{Terrain.h => Terrain.hpp} | 19 +++-- Source/Game.cpp | 9 +-- Source/{Game.h => Game.hpp} | 41 ++++++----- Source/GameDraw.cpp | 15 ++-- Source/GameInitDispose.cpp | 15 ++-- Source/GameTick.cpp | 34 ++++----- Source/Globals.cpp | 9 ++- Source/Graphic/Models.cpp | 7 +- Source/Graphic/{Models.h => Models.hpp} | 22 +++--- Source/Graphic/Sprite.cpp | 7 +- Source/Graphic/{Sprite.h => Sprite.hpp} | 23 +++--- Source/Graphic/Stereo.cpp | 4 +- Source/Graphic/{Stereo.h => Stereo.hpp} | 6 +- Source/Graphic/Text.cpp | 6 +- Source/Graphic/{Text.h => Text.hpp} | 15 ++-- Source/Graphic/Texture.cpp | 8 +-- Source/Graphic/{Texture.h => Texture.hpp} | 9 ++- Source/Graphic/{gamegl.h => gamegl.hpp} | 16 ++--- Source/Level/Awards.cpp | 7 +- Source/Level/{Awards.h => Awards.hpp} | 4 +- Source/Level/Campaign.cpp | 7 +- Source/Level/{Campaign.h => Campaign.hpp} | 6 +- Source/Level/Dialog.cpp | 10 +-- Source/Level/{Dialog.h => Dialog.hpp} | 10 +-- Source/Level/Hotspot.cpp | 2 +- Source/Level/{Hotspot.h => Hotspot.hpp} | 7 +- Source/MacCompatibility.cpp | 16 ++--- ...acCompatibility.h => MacCompatibility.hpp} | 9 +-- Source/Math/Frustum.cpp | 6 +- Source/Math/{Frustum.h => Frustum.hpp} | 4 +- .../Math/{PhysicsMath.h => PhysicsMath.hpp} | 8 +-- Source/Math/Quaternions.cpp | 2 +- .../Math/{Quaternions.h => Quaternions.hpp} | 10 +-- Source/Math/{Random.h => Random.hpp} | 4 +- Source/Menu/Menu.cpp | 21 +++--- Source/Menu/{Menu.h => Menu.hpp} | 6 +- Source/Objects/Objects.cpp | 2 +- Source/Objects/{Objects.h => Objects.hpp} | 23 +++--- Source/Objects/Person.cpp | 19 +++-- Source/Objects/{Person.h => Person.hpp} | 25 ++++--- Source/Objects/Weapons.cpp | 15 ++-- Source/Objects/{Weapons.h => Weapons.hpp} | 23 +++--- Source/User/Account.cpp | 8 ++- Source/User/{Account.h => Account.hpp} | 10 +-- Source/User/Settings.cpp | 9 +-- Source/User/{Settings.h => Settings.hpp} | 6 +- Source/Utils/Folders.cpp | 9 ++- Source/Utils/{Folders.h => Folders.hpp} | 4 +- Source/Utils/ImageIO.cpp | 11 ++- Source/Utils/{ImageIO.h => ImageIO.hpp} | 13 ++-- Source/Utils/Input.cpp | 3 +- Source/Utils/{Input.h => Input.hpp} | 10 +-- Source/Utils/pack.c | 4 +- Source/Utils/private.c | 4 +- Source/Utils/unpack.c | 4 +- Source/WinDefs.cpp | 8 +-- Source/{WinDefs.h => WinDefs.hpp} | 13 ++-- Source/main.cpp | 24 +++---- Source/win-res/{resource.h => resource.hpp} | 0 79 files changed, 450 insertions(+), 444 deletions(-) rename Source/Animation/{Animation.h => Animation.hpp} (96%) rename Source/Animation/{Joint.h => Joint.hpp} (95%) rename Source/Animation/{Muscle.h => Muscle.hpp} (95%) rename Source/Animation/{Skeleton.h => Skeleton.hpp} (89%) rename Source/Audio/{Sounds.h => Sounds.hpp} (95%) rename Source/Audio/{openal_wrapper.h => openal_wrapper.hpp} (95%) rename Source/Devtools/{ConsoleCmds.h => ConsoleCmds.hpp} (100%) rename Source/Environment/{Lights.h => Lights.hpp} (90%) rename Source/Environment/{Skybox.h => Skybox.hpp} (84%) rename Source/Environment/{Terrain.h => Terrain.hpp} (94%) rename Source/{Game.h => Game.hpp} (90%) rename Source/Graphic/{Models.h => Models.hpp} (95%) rename Source/Graphic/{Sprite.h => Sprite.hpp} (88%) rename Source/Graphic/{Stereo.h => Stereo.hpp} (96%) rename Source/Graphic/{Text.h => Text.hpp} (91%) rename Source/Graphic/{Texture.h => Texture.hpp} (95%) rename Source/Graphic/{gamegl.h => gamegl.hpp} (89%) rename Source/Level/{Awards.h => Awards.hpp} (97%) rename Source/Level/{Campaign.h => Campaign.hpp} (98%) rename Source/Level/{Dialog.h => Dialog.hpp} (95%) rename Source/Level/{Hotspot.h => Hotspot.hpp} (93%) rename Source/{MacCompatibility.h => MacCompatibility.hpp} (96%) rename Source/Math/{Frustum.h => Frustum.hpp} (95%) rename Source/Math/{PhysicsMath.h => PhysicsMath.hpp} (99%) rename Source/Math/{Quaternions.h => Quaternions.hpp} (99%) rename Source/Math/{Random.h => Random.hpp} (95%) rename Source/Menu/{Menu.h => Menu.hpp} (97%) rename Source/Objects/{Objects.h => Objects.hpp} (87%) rename Source/Objects/{Person.h => Person.hpp} (97%) rename Source/Objects/{Weapons.h => Weapons.hpp} (89%) rename Source/User/{Account.h => Account.hpp} (98%) rename Source/User/{Settings.h => Settings.hpp} (95%) rename Source/Utils/{Folders.h => Folders.hpp} (97%) rename Source/Utils/{ImageIO.h => ImageIO.hpp} (92%) rename Source/Utils/{Input.h => Input.hpp} (93%) rename Source/{WinDefs.h => WinDefs.hpp} (96%) rename Source/win-res/{resource.h => resource.hpp} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 62a62f2..6faa895 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,42 +86,42 @@ set(LUGARU_SRCS ) set(LUGARU_H - ${SRCDIR}/Animation/Animation.h - ${SRCDIR}/Animation/Joint.h - ${SRCDIR}/Animation/Muscle.h - ${SRCDIR}/Animation/Skeleton.h - ${SRCDIR}/Audio/openal_wrapper.h - ${SRCDIR}/Audio/Sounds.h - ${SRCDIR}/Devtools/ConsoleCmds.h - ${SRCDIR}/Environment/Lights.h - ${SRCDIR}/Environment/Skybox.h - ${SRCDIR}/Environment/Terrain.h - ${SRCDIR}/Graphic/gamegl.h - ${SRCDIR}/Graphic/Models.h - ${SRCDIR}/Graphic/Sprite.h - ${SRCDIR}/Graphic/Stereo.h - ${SRCDIR}/Graphic/Text.h - ${SRCDIR}/Graphic/Texture.h - ${SRCDIR}/Level/Campaign.h - ${SRCDIR}/Level/Dialog.h - ${SRCDIR}/Level/Hotspot.h - ${SRCDIR}/Math/Frustum.h - ${SRCDIR}/Math/PhysicsMath.h - ${SRCDIR}/Math/Quaternions.h - ${SRCDIR}/Math/Random.h - ${SRCDIR}/Menu/Menu.h - ${SRCDIR}/Objects/Objects.h - ${SRCDIR}/Objects/Person.h - ${SRCDIR}/Objects/Weapons.h + ${SRCDIR}/Animation/Animation.hpp + ${SRCDIR}/Animation/Joint.hpp + ${SRCDIR}/Animation/Muscle.hpp + ${SRCDIR}/Animation/Skeleton.hpp + ${SRCDIR}/Audio/openal_wrapper.hpp + ${SRCDIR}/Audio/Sounds.hpp + ${SRCDIR}/Devtools/ConsoleCmds.hpp + ${SRCDIR}/Environment/Lights.hpp + ${SRCDIR}/Environment/Skybox.hpp + ${SRCDIR}/Environment/Terrain.hpp + ${SRCDIR}/Graphic/gamegl.hpp + ${SRCDIR}/Graphic/Models.hpp + ${SRCDIR}/Graphic/Sprite.hpp + ${SRCDIR}/Graphic/Stereo.hpp + ${SRCDIR}/Graphic/Text.hpp + ${SRCDIR}/Graphic/Texture.hpp + ${SRCDIR}/Level/Campaign.hpp + ${SRCDIR}/Level/Dialog.hpp + ${SRCDIR}/Level/Hotspot.hpp + ${SRCDIR}/Math/Frustum.hpp + ${SRCDIR}/Math/PhysicsMath.hpp + ${SRCDIR}/Math/Quaternions.hpp + ${SRCDIR}/Math/Random.hpp + ${SRCDIR}/Menu/Menu.hpp + ${SRCDIR}/Objects/Objects.hpp + ${SRCDIR}/Objects/Person.hpp + ${SRCDIR}/Objects/Weapons.hpp ${SRCDIR}/Thirdparty/optionparser.h - ${SRCDIR}/User/Account.h - ${SRCDIR}/User/Settings.h + ${SRCDIR}/User/Account.hpp + ${SRCDIR}/User/Settings.hpp ${SRCDIR}/Utils/binio.h - ${SRCDIR}/Utils/Folders.h - ${SRCDIR}/Utils/ImageIO.h - ${SRCDIR}/Utils/Input.h + ${SRCDIR}/Utils/Folders.hpp + ${SRCDIR}/Utils/ImageIO.hpp + ${SRCDIR}/Utils/Input.hpp ${SRCDIR}/Utils/private.h - ${SRCDIR}/Game.h + ${SRCDIR}/Game.hpp ) @@ -132,7 +132,7 @@ if(UNIX) ) set(LUGARU_H ${LUGARU_H} - ${SRCDIR}/MacCompatibility.h + ${SRCDIR}/MacCompatibility.hpp ) endif(UNIX) @@ -152,8 +152,8 @@ if(WIN32) set(LUGARU_H ${LUGARU_H} - ${SRCDIR}/WinDefs.h - ${SRCDIR}/win-res/resource.h) + ${SRCDIR}/WinDefs.hpp + ${SRCDIR}/win-res/resource.hpp) endif(WIN32) if(APPLE) diff --git a/Source/Animation/Animation.cpp b/Source/Animation/Animation.cpp index 4433800..27b82ad 100644 --- a/Source/Animation/Animation.cpp +++ b/Source/Animation/Animation.cpp @@ -17,10 +17,11 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include "Animation/Animation.h" -#include "Animation/Skeleton.h" -#include "Utils/Folders.h" -#include "Game.h" +#include "Animation/Animation.hpp" + +#include "Animation/Skeleton.hpp" +#include "Game.hpp" +#include "Utils/Folders.hpp" extern bool visibleloading; diff --git a/Source/Animation/Animation.h b/Source/Animation/Animation.hpp similarity index 96% rename from Source/Animation/Animation.h rename to Source/Animation/Animation.hpp index 91205ab..b58f6ba 100644 --- a/Source/Animation/Animation.h +++ b/Source/Animation/Animation.hpp @@ -17,11 +17,12 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#ifndef ANIMATION_H -#define ANIMATION_H +#ifndef _ANIMATION_HPP_ +#define _ANIMATION_HPP_ + +#include "Math/Quaternions.hpp" #include -#include "Math/Quaternions.h" enum anim_attack_type { neutral, normalattack, reversed, reversal diff --git a/Source/Animation/Joint.cpp b/Source/Animation/Joint.cpp index 4428cb8..f615bfe 100644 --- a/Source/Animation/Joint.cpp +++ b/Source/Animation/Joint.cpp @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include "Animation/Joint.h" +#include "Animation/Joint.hpp" + #include "Utils/binio.h" Joint::Joint() : diff --git a/Source/Animation/Joint.h b/Source/Animation/Joint.hpp similarity index 95% rename from Source/Animation/Joint.h rename to Source/Animation/Joint.hpp index 124d7a6..4b4f221 100644 --- a/Source/Animation/Joint.h +++ b/Source/Animation/Joint.hpp @@ -18,10 +18,11 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#ifndef _JOINT_H_ -#define _JOINT_H_ +#ifndef _JOINT_HPP_ +#define _JOINT_HPP_ + +#include "Math/Quaternions.hpp" -#include "Math/Quaternions.h" #include enum bodypart { diff --git a/Source/Animation/Muscle.cpp b/Source/Animation/Muscle.cpp index c4f201a..4485c5e 100644 --- a/Source/Animation/Muscle.cpp +++ b/Source/Animation/Muscle.cpp @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include "Animation/Muscle.h" +#include "Animation/Muscle.hpp" + #include "Utils/binio.h" extern float multiplier; diff --git a/Source/Animation/Muscle.h b/Source/Animation/Muscle.hpp similarity index 95% rename from Source/Animation/Muscle.h rename to Source/Animation/Muscle.hpp index a286928..d3ea815 100644 --- a/Source/Animation/Muscle.h +++ b/Source/Animation/Muscle.hpp @@ -18,11 +18,12 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#ifndef _MUSCLE_H_ -#define _MUSCLE_H_ +#ifndef _MUSCLE_HPP_ +#define _MUSCLE_HPP_ + +#include "Animation/Joint.hpp" #include -#include "Animation/Joint.h" enum muscle_type {boneconnect, constraint, muscle}; diff --git a/Source/Animation/Skeleton.cpp b/Source/Animation/Skeleton.cpp index f525240..3f5e65c 100644 --- a/Source/Animation/Skeleton.cpp +++ b/Source/Animation/Skeleton.cpp @@ -18,12 +18,12 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -/**> HEADER FILES <**/ -#include "Game.h" -#include "Animation/Animation.h" -#include "Animation/Skeleton.h" -#include "Audio/openal_wrapper.h" -#include "Utils/Folders.h" +#include "Animation/Skeleton.hpp" + +#include "Animation/Animation.hpp" +#include "Audio/openal_wrapper.hpp" +#include "Game.hpp" +#include "Utils/Folders.hpp" extern float multiplier; extern float gravity; diff --git a/Source/Animation/Skeleton.h b/Source/Animation/Skeleton.hpp similarity index 89% rename from Source/Animation/Skeleton.h rename to Source/Animation/Skeleton.hpp index 19db503..6685062 100644 --- a/Source/Animation/Skeleton.h +++ b/Source/Animation/Skeleton.hpp @@ -18,18 +18,17 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#ifndef _SKELETON_H_ -#define _SKELETON_H_ - -/**> HEADER FILES <**/ -#include "Animation/Animation.h" -#include "Animation/Joint.h" -#include "Animation/Muscle.h" -#include "Graphic/gamegl.h" -#include "Graphic/Models.h" -#include "Graphic/Sprite.h" -#include "Math/Quaternions.h" -#include "Objects/Objects.h" +#ifndef _SKELETON_HPP_ +#define _SKELETON_HPP_ + +#include "Animation/Animation.hpp" +#include "Animation/Joint.hpp" +#include "Animation/Muscle.hpp" +#include "Graphic/gamegl.hpp" +#include "Graphic/Models.hpp" +#include "Graphic/Sprite.hpp" +#include "Math/Quaternions.hpp" +#include "Objects/Objects.hpp" #include "Utils/binio.h" const int max_joints = 50; diff --git a/Source/Audio/Sounds.cpp b/Source/Audio/Sounds.cpp index 2e47da0..063e0c8 100644 --- a/Source/Audio/Sounds.cpp +++ b/Source/Audio/Sounds.cpp @@ -17,10 +17,10 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include "Audio/openal_wrapper.h" -#include "Audio/Sounds.h" -#include "Math/Quaternions.h" -#include "Utils/Folders.h" +#include "Audio/Sounds.hpp" + +#include "Audio/openal_wrapper.hpp" +#include "Utils/Folders.hpp" struct OPENAL_SAMPLE *samp[sounds_count]; diff --git a/Source/Audio/Sounds.h b/Source/Audio/Sounds.hpp similarity index 95% rename from Source/Audio/Sounds.h rename to Source/Audio/Sounds.hpp index 7557993..1ec3139 100644 --- a/Source/Audio/Sounds.h +++ b/Source/Audio/Sounds.hpp @@ -17,8 +17,10 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#ifndef SOUNDS_H -#define SOUNDS_H +#ifndef _SOUNDS_HPP_ +#define _SOUNDS_HPP_ + +#include "Math/Quaternions.hpp" enum sound_types { #define DECLARE_SOUND(id, filename) id, diff --git a/Source/Audio/openal_wrapper.cpp b/Source/Audio/openal_wrapper.cpp index e1e2346..bcc5d73 100644 --- a/Source/Audio/openal_wrapper.cpp +++ b/Source/Audio/openal_wrapper.cpp @@ -18,15 +18,16 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ +#include "Audio/openal_wrapper.hpp" + +#include "Audio/Sounds.hpp" +#include "Game.hpp" +#include "Math/Quaternions.hpp" + #include #include #include -#include "Math/Quaternions.h" -#include "Audio/openal_wrapper.h" -#include "Audio/Sounds.h" -#include "Game.h" - extern float slomofreq; // NOTE: diff --git a/Source/Audio/openal_wrapper.h b/Source/Audio/openal_wrapper.hpp similarity index 95% rename from Source/Audio/openal_wrapper.h rename to Source/Audio/openal_wrapper.hpp index b8de914..cea4797 100644 --- a/Source/Audio/openal_wrapper.h +++ b/Source/Audio/openal_wrapper.hpp @@ -18,22 +18,21 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#ifndef OPENAL_WRAPPER_H -#define OPENAL_WRAPPER_H +#ifndef _OPENAL_WRAPPER_HPP_ +#define _OPENAL_WRAPPER_HPP_ + +#include "MacCompatibility.hpp" +#include "Math/Quaternions.hpp" + +#include +#include +#include +#include #ifdef _WIN32 #include #endif -#include "AL/al.h" -#include "AL/alc.h" - -#include "ogg/ogg.h" -#include "vorbis/vorbisfile.h" - -#include "Math/Quaternions.h" -#include "MacCompatibility.h" - #if 0 /* this should only be enable if OPENAL doesn't provide AL_API on all platforms */ #if (!defined(WIN32) && !defined(_WIN32) && !defined(__WIN32__) && !defined(_WIN64) && !defined(_WIN32_WCE) && !defined(_XBOX)) || (defined(__GNUC__) && defined(WIN32)) #ifndef __cdecl diff --git a/Source/Devtools/ConsoleCmds.cpp b/Source/Devtools/ConsoleCmds.cpp index dc4c275..a65315b 100644 --- a/Source/Devtools/ConsoleCmds.cpp +++ b/Source/Devtools/ConsoleCmds.cpp @@ -18,11 +18,12 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include "Game.h" -#include "Devtools/ConsoleCmds.h" -#include "Level/Dialog.h" -#include "Level/Hotspot.h" -#include "Utils/Folders.h" +#include "Devtools/ConsoleCmds.hpp" + +#include "Game.hpp" +#include "Level/Dialog.hpp" +#include "Level/Hotspot.hpp" +#include "Utils/Folders.hpp" const char *cmd_names[cmd_count] = { #define DECLARE_COMMAND(cmd) #cmd, diff --git a/Source/Devtools/ConsoleCmds.h b/Source/Devtools/ConsoleCmds.hpp similarity index 100% rename from Source/Devtools/ConsoleCmds.h rename to Source/Devtools/ConsoleCmds.hpp diff --git a/Source/Environment/Lights.cpp b/Source/Environment/Lights.cpp index 17efb4c..d448cd8 100644 --- a/Source/Environment/Lights.cpp +++ b/Source/Environment/Lights.cpp @@ -18,8 +18,7 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -/**> HEADER FILES <**/ -#include "Environment/Lights.h" +#include "Environment/Lights.hpp" void SetUpLight(Light* whichsource, int whichlight) { diff --git a/Source/Environment/Lights.h b/Source/Environment/Lights.hpp similarity index 90% rename from Source/Environment/Lights.h rename to Source/Environment/Lights.hpp index ba1fd6c..ca113e0 100644 --- a/Source/Environment/Lights.h +++ b/Source/Environment/Lights.hpp @@ -18,13 +18,11 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#ifndef _LIGHTS_H_ -#define _LIGHTS_H_ +#ifndef _LIGHTS_HPP_ +#define _LIGHTS_HPP_ - -/**> HEADER FILES <**/ -#include "Graphic/gamegl.h" -#include "Math/Quaternions.h" +#include "Graphic/gamegl.hpp" +#include "Math/Quaternions.hpp" class Light { diff --git a/Source/Environment/Skybox.cpp b/Source/Environment/Skybox.cpp index ce58adf..47bd28a 100644 --- a/Source/Environment/Skybox.cpp +++ b/Source/Environment/Skybox.cpp @@ -18,8 +18,9 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include "Environment/Skybox.h" -#include "Game.h" +#include "Environment/Skybox.hpp" + +#include "Game.hpp" extern float viewdistance; extern float blurness; diff --git a/Source/Environment/Skybox.h b/Source/Environment/Skybox.hpp similarity index 84% rename from Source/Environment/Skybox.h rename to Source/Environment/Skybox.hpp index d2b5d72..1a9d36a 100644 --- a/Source/Environment/Skybox.h +++ b/Source/Environment/Skybox.hpp @@ -18,14 +18,14 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#ifndef _SKYBOX_H_ -#define _SKYBOX_H_ - -#include "Graphic/gamegl.h" -#include "Graphic/Texture.h" -#include "Math/Quaternions.h" -#include "Math/Quaternions.h" -#include "Utils/ImageIO.h" +#ifndef _SKYBOX_HPP_ +#define _SKYBOX_HPP_ + +#include "Graphic/gamegl.hpp" +#include "Graphic/Texture.hpp" +#include "Math/Quaternions.hpp" +#include "Math/Quaternions.hpp" +#include "Utils/ImageIO.hpp" class SkyBox { diff --git a/Source/Environment/Terrain.cpp b/Source/Environment/Terrain.cpp index 8c79cd4..164dce3 100644 --- a/Source/Environment/Terrain.cpp +++ b/Source/Environment/Terrain.cpp @@ -18,10 +18,11 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include "Game.h" -#include "Environment/Terrain.h" -#include "Objects/Objects.h" -#include "Utils/Folders.h" +#include "Environment/Terrain.hpp" + +#include "Game.hpp" +#include "Objects/Objects.hpp" +#include "Utils/Folders.hpp" extern XYZ viewer; extern float viewdistance; diff --git a/Source/Environment/Terrain.h b/Source/Environment/Terrain.hpp similarity index 94% rename from Source/Environment/Terrain.h rename to Source/Environment/Terrain.hpp index f9319f7..3c30e3d 100644 --- a/Source/Environment/Terrain.h +++ b/Source/Environment/Terrain.hpp @@ -18,16 +18,15 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#ifndef _TERRAIN_H_ -#define _TERRAIN_H_ - -#include "Environment/Lights.h" -#include "Graphic/gamegl.h" -#include "Graphic/Texture.h" -#include "Math/Frustum.h" -#include "Math/Quaternions.h" -#include "Math/Quaternions.h" -#include "Utils/ImageIO.h" +#ifndef _TERRAIN_HPP_ +#define _TERRAIN_HPP_ + +#include "Environment/Lights.hpp" +#include "Graphic/gamegl.hpp" +#include "Graphic/Texture.hpp" +#include "Math/Frustum.hpp" +#include "Math/Quaternions.hpp" +#include "Utils/ImageIO.hpp" #define max_terrain_size 256 #define curr_terrain_size size diff --git a/Source/Game.cpp b/Source/Game.cpp index e740aa6..76455fb 100644 --- a/Source/Game.cpp +++ b/Source/Game.cpp @@ -18,11 +18,12 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include "SDL_thread.h" -#include "Game.h" -#include "Audio/openal_wrapper.h" -#include "Level/Dialog.h" +#include "Game.hpp" +#include "Audio/openal_wrapper.hpp" +#include "Level/Dialog.hpp" + +#include extern int mainmenu; diff --git a/Source/Game.h b/Source/Game.hpp similarity index 90% rename from Source/Game.h rename to Source/Game.hpp index 176d245..596ade4 100644 --- a/Source/Game.h +++ b/Source/Game.hpp @@ -18,31 +18,30 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#ifndef _GAME_H_ -#define _GAME_H_ - -#include "SDL.h" - -#include "Animation/Skeleton.h" -#include "Audio/Sounds.h" -#include "Environment/Lights.h" -#include "Environment/Skybox.h" -#include "Environment/Terrain.h" -#include "Graphic/gamegl.h" -#include "Graphic/Models.h" -#include "Graphic/Sprite.h" -#include "Graphic/Stereo.h" -#include "Graphic/Text.h" -#include "Graphic/Texture.h" -#include "Objects/Objects.h" -#include "Objects/Person.h" -#include "Objects/Weapons.h" +#ifndef _GAME_HPP_ +#define _GAME_HPP_ + +#include "Animation/Skeleton.hpp" +#include "Audio/Sounds.hpp" +#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 "Objects/Objects.hpp" +#include "Objects/Person.hpp" +#include "Objects/Weapons.hpp" #include "Thirdparty/optionparser.h" -#include "User/Account.h" +#include "User/Account.hpp" #include "Utils/binio.h" -#include "Utils/ImageIO.h" +#include "Utils/ImageIO.hpp" #include +#include #define NB_CAMPAIGN_MENU_ITEM 7 diff --git a/Source/GameDraw.cpp b/Source/GameDraw.cpp index d46b9b6..fcee8b5 100644 --- a/Source/GameDraw.cpp +++ b/Source/GameDraw.cpp @@ -18,13 +18,14 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include "Game.h" -#include "Audio/openal_wrapper.h" -#include "Level/Awards.h" -#include "Level/Dialog.h" -#include "Level/Hotspot.h" -#include "Menu/Menu.h" -#include "Utils/Input.h" +#include "Game.hpp" + +#include "Audio/openal_wrapper.hpp" +#include "Level/Awards.hpp" +#include "Level/Dialog.hpp" +#include "Level/Hotspot.hpp" +#include "Menu/Menu.hpp" +#include "Utils/Input.hpp" extern XYZ viewer; extern int environment; diff --git a/Source/GameInitDispose.cpp b/Source/GameInitDispose.cpp index 036f80f..d950c2e 100644 --- a/Source/GameInitDispose.cpp +++ b/Source/GameInitDispose.cpp @@ -18,12 +18,13 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include "Game.h" -#include "Animation/Animation.h" -#include "Audio/openal_wrapper.h" -#include "Graphic/Texture.h" -#include "Menu/Menu.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; @@ -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; diff --git a/Source/GameTick.cpp b/Source/GameTick.cpp index 37a29f5..ed61f24 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -21,6 +21,20 @@ along with Lugaru. If not, see . // Enable full math definitions #define _USE_MATH_DEFINES +#include "Game.hpp" + +#include "Animation/Animation.hpp" +#include "Audio/openal_wrapper.hpp" +#include "Devtools/ConsoleCmds.hpp" +#include "Level/Awards.hpp" +#include "Level/Campaign.hpp" +#include "Level/Dialog.hpp" +#include "Level/Hotspot.hpp" +#include "Menu/Menu.hpp" +#include "User/Settings.hpp" +#include "Utils/Folders.hpp" +#include "Utils/Input.hpp" + #if PLATFORM_UNIX #include #include @@ -29,25 +43,11 @@ along with Lugaru. If not, see . #include #endif - -#include -#include +#include #include +#include #include -#include "Game.h" -#include "Animation/Animation.h" -#include "Audio/openal_wrapper.h" -#include "Devtools/ConsoleCmds.h" -#include "Level/Awards.h" -#include "Level/Campaign.h" -#include "Level/Dialog.h" -#include "Level/Hotspot.h" -#include "Menu/Menu.h" -#include "User/Settings.h" -#include "Utils/Folders.h" -#include "Utils/Input.h" - -#include +#include #include using namespace std; diff --git a/Source/Globals.cpp b/Source/Globals.cpp index 66c6c9b..485b607 100644 --- a/Source/Globals.cpp +++ b/Source/Globals.cpp @@ -18,14 +18,13 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include "SDL.h" +#include "Graphic/Stereo.hpp" +#include "Math/Quaternions.hpp" +#include "Objects/Weapons.hpp" +#include #include -#include "Graphic/Stereo.h" -#include "Math/Quaternions.h" -#include "Objects/Weapons.h" - bool visibleloading = 0; float volume = 0; diff --git a/Source/Graphic/Models.cpp b/Source/Graphic/Models.cpp index a9833d0..649bcde 100644 --- a/Source/Graphic/Models.cpp +++ b/Source/Graphic/Models.cpp @@ -18,9 +18,10 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include "Game.h" -#include "Graphic/Models.h" -#include "Utils/Folders.h" +#include "Graphic/Models.hpp" + +#include "Game.hpp" +#include "Utils/Folders.hpp" extern float multiplier; extern float viewdistance; diff --git a/Source/Graphic/Models.h b/Source/Graphic/Models.hpp similarity index 95% rename from Source/Graphic/Models.h rename to Source/Graphic/Models.hpp index e14ebe6..621a9af 100644 --- a/Source/Graphic/Models.h +++ b/Source/Graphic/Models.hpp @@ -18,24 +18,20 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#ifndef _MODELS_H_ -#define _MODELS_H_ +#ifndef _MODELS_HPP_ +#define _MODELS_HPP_ + +#include "Environment/Terrain.hpp" +#include "Graphic/gamegl.hpp" +#include "Graphic/Texture.hpp" +#include "Math/Quaternions.hpp" +#include "Utils/binio.h" -/**> Model Loading <**/ -// -// Model Maximums -// -#include "Graphic/gamegl.h" -#include #include +#include #include #include -#include "Environment/Terrain.h" -#include "Graphic/Texture.h" -#include "Math/Quaternions.h" -#include "Utils/binio.h" - // // Textures List // diff --git a/Source/Graphic/Sprite.cpp b/Source/Graphic/Sprite.cpp index 4276ce5..8cd5c7f 100644 --- a/Source/Graphic/Sprite.cpp +++ b/Source/Graphic/Sprite.cpp @@ -18,9 +18,10 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include "Game.h" -#include "Graphic/Sprite.h" -#include "Objects/Person.h" +#include "Graphic/Sprite.hpp" + +#include "Game.hpp" +#include "Objects/Person.hpp" extern XYZ viewer; extern float viewdistance; diff --git a/Source/Graphic/Sprite.h b/Source/Graphic/Sprite.hpp similarity index 88% rename from Source/Graphic/Sprite.h rename to Source/Graphic/Sprite.hpp index bed8439..01e68a3 100644 --- a/Source/Graphic/Sprite.h +++ b/Source/Graphic/Sprite.hpp @@ -18,18 +18,17 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#ifndef _SPRITE_H_ -#define _SPRITE_H_ - -#include "Environment/Lights.h" -#include "Environment/Terrain.h" -#include "Graphic/gamegl.h" -#include "Graphic/Texture.h" -#include "Math/Frustum.h" -#include "Math/Quaternions.h" -#include "Math/Quaternions.h" -#include "Objects/Objects.h" -#include "Utils/ImageIO.h" +#ifndef _SPRITE_HPP_ +#define _SPRITE_HPP_ + +#include "Environment/Lights.hpp" +#include "Environment/Terrain.hpp" +#include "Graphic/gamegl.hpp" +#include "Graphic/Texture.hpp" +#include "Math/Frustum.hpp" +#include "Math/Quaternions.hpp" +#include "Objects/Objects.hpp" +#include "Utils/ImageIO.hpp" #include diff --git a/Source/Graphic/Stereo.cpp b/Source/Graphic/Stereo.cpp index efb300b..66938e2 100644 --- a/Source/Graphic/Stereo.cpp +++ b/Source/Graphic/Stereo.cpp @@ -18,9 +18,9 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include "Game.h" -#include "Graphic/Stereo.h" +#include "Graphic/Stereo.hpp" +#include "Game.hpp" extern int kContextWidth; extern int kContextHeight; diff --git a/Source/Graphic/Stereo.h b/Source/Graphic/Stereo.hpp similarity index 96% rename from Source/Graphic/Stereo.h rename to Source/Graphic/Stereo.hpp index 8e70e5e..e93d113 100644 --- a/Source/Graphic/Stereo.h +++ b/Source/Graphic/Stereo.hpp @@ -18,8 +18,10 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#ifndef STEREO_H_ -#define STEREO_H_ +#ifndef _STEREO_HPP_ +#define _STEREO_HPP_ + +#include enum StereoMode { stereoNone, diff --git a/Source/Graphic/Text.cpp b/Source/Graphic/Text.cpp index 31bbe9f..47d8c3e 100644 --- a/Source/Graphic/Text.cpp +++ b/Source/Graphic/Text.cpp @@ -18,9 +18,9 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -/**> HEADER FILES <**/ -#include "Graphic/Text.h" -#include "Game.h" +#include "Graphic/Text.hpp" + +#include "Game.hpp" void Text::LoadFontTexture(const std::string& fileName) { diff --git a/Source/Graphic/Text.h b/Source/Graphic/Text.hpp similarity index 91% rename from Source/Graphic/Text.h rename to Source/Graphic/Text.hpp index b5cc8a1..d830af4 100644 --- a/Source/Graphic/Text.h +++ b/Source/Graphic/Text.hpp @@ -18,14 +18,13 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#ifndef _TEXT_H_ -#define _TEXT_H_ - -/**> HEADER FILES <**/ -#include "Graphic/gamegl.h" -#include "Graphic/Texture.h" -#include "Math/Quaternions.h" -#include "Utils/ImageIO.h" +#ifndef _TEXT_HPP_ +#define _TEXT_HPP_ + +#include "Graphic/gamegl.hpp" +#include "Graphic/Texture.hpp" +#include "Math/Quaternions.hpp" +#include "Utils/ImageIO.hpp" class Text { diff --git a/Source/Graphic/Texture.cpp b/Source/Graphic/Texture.cpp index 3f5211a..e2565e9 100644 --- a/Source/Graphic/Texture.cpp +++ b/Source/Graphic/Texture.cpp @@ -18,10 +18,10 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include "Graphic/gamegl.h" -#include "Graphic/Texture.h" -#include "Utils/Folders.h" -#include "Utils/ImageIO.h" +#include "Graphic/Texture.hpp" + +#include "Utils/Folders.hpp" +#include "Utils/ImageIO.hpp" using namespace std; diff --git a/Source/Graphic/Texture.h b/Source/Graphic/Texture.hpp similarity index 95% rename from Source/Graphic/Texture.h rename to Source/Graphic/Texture.hpp index 95547bf..ab51cdb 100644 --- a/Source/Graphic/Texture.h +++ b/Source/Graphic/Texture.hpp @@ -18,12 +18,15 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#ifndef _TEXTURE_H_ -#define _TEXTURE_H_ +#ifndef _TEXTURE_HPP_ +#define _TEXTURE_HPP_ + +#include "Graphic/gamegl.hpp" #include -#include #include +#include + using namespace std; class TextureRes diff --git a/Source/Graphic/gamegl.h b/Source/Graphic/gamegl.hpp similarity index 89% rename from Source/Graphic/gamegl.h rename to Source/Graphic/gamegl.hpp index 9bee196..0b5f693 100644 --- a/Source/Graphic/gamegl.h +++ b/Source/Graphic/gamegl.hpp @@ -18,14 +18,15 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#ifndef _LUGARU_GL_H_ -#define _LUGARU_GL_H_ +#ifndef _GAMEGL_HPP_ +#define _GAMEGL_HPP_ +#include "MacCompatibility.hpp" +#include #include -#include #include -#include +#include #include #include @@ -37,10 +38,9 @@ along with Lugaru. If not, see . #endif #define GL_GLEXT_PROTOTYPES 1 -#include "GL/gl.h" -#include "GL/glu.h" -#include "GL/glext.h" -#include "MacCompatibility.h" +#include +#include +#include using namespace std; diff --git a/Source/Level/Awards.cpp b/Source/Level/Awards.cpp index 0a561e5..933f518 100644 --- a/Source/Level/Awards.cpp +++ b/Source/Level/Awards.cpp @@ -17,9 +17,10 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include "Level/Awards.h" -#include "Objects/Person.h" -#include "Game.h" +#include "Level/Awards.hpp" + +#include "Game.hpp" +#include "Objects/Person.hpp" int bonus; float bonusvalue; diff --git a/Source/Level/Awards.h b/Source/Level/Awards.hpp similarity index 97% rename from Source/Level/Awards.h rename to Source/Level/Awards.hpp index 882fbef..ba2bdf8 100644 --- a/Source/Level/Awards.h +++ b/Source/Level/Awards.hpp @@ -17,8 +17,8 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#ifndef AWARDS_H -#define AWARDS_H +#ifndef _AWARDS_HPP_ +#define _AWARDS_HPP_ enum bonus_types { #define DECLARE_BONUS(id, ...) id, diff --git a/Source/Level/Campaign.cpp b/Source/Level/Campaign.cpp index 2aa5f17..236f631 100644 --- a/Source/Level/Campaign.cpp +++ b/Source/Level/Campaign.cpp @@ -18,9 +18,10 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include "Game.h" -#include "Level/Campaign.h" -#include "Utils/Folders.h" +#include "Level/Campaign.hpp" + +#include "Game.hpp" +#include "Utils/Folders.hpp" #include diff --git a/Source/Level/Campaign.h b/Source/Level/Campaign.hpp similarity index 98% rename from Source/Level/Campaign.h rename to Source/Level/Campaign.hpp index 3cd4d51..5381672 100644 --- a/Source/Level/Campaign.h +++ b/Source/Level/Campaign.hpp @@ -18,10 +18,10 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include -#include +#include "Math/Quaternions.hpp" -#include "Math/Quaternions.h" +#include +#include extern bool campaign; diff --git a/Source/Level/Dialog.cpp b/Source/Level/Dialog.cpp index 915fba1..a60b115 100644 --- a/Source/Level/Dialog.cpp +++ b/Source/Level/Dialog.cpp @@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include "Game.h" +#include "Level/Dialog.hpp" -#include "Level/Dialog.h" -#include "Objects/Person.h" +#include "Game.hpp" +#include "Objects/Person.hpp" #include "Utils/binio.h" -#include "Utils/Folders.h" -#include "Utils/Input.h" +#include "Utils/Folders.hpp" +#include "Utils/Input.hpp" extern int hostile; diff --git a/Source/Level/Dialog.h b/Source/Level/Dialog.hpp similarity index 95% rename from Source/Level/Dialog.h rename to Source/Level/Dialog.hpp index 50691c5..43bc31c 100644 --- a/Source/Level/Dialog.h +++ b/Source/Level/Dialog.hpp @@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#ifndef _DIALOG_H_ -#define _DIALOG_H_ +#ifndef _DIALOG_HPP_ +#define _DIALOG_HPP_ -#include "stdio.h" -#include +#include "Math/Quaternions.hpp" -#include "Math/Quaternions.h" +#include +#include class DialogScene { diff --git a/Source/Level/Hotspot.cpp b/Source/Level/Hotspot.cpp index 1f7956e..f1b2ced 100644 --- a/Source/Level/Hotspot.cpp +++ b/Source/Level/Hotspot.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include "Level/Hotspot.h" +#include "Level/Hotspot.hpp" std::vector Hotspot::hotspots; int Hotspot::current = 0; diff --git a/Source/Level/Hotspot.h b/Source/Level/Hotspot.hpp similarity index 93% rename from Source/Level/Hotspot.h rename to Source/Level/Hotspot.hpp index a8ef2ec..3629a55 100644 --- a/Source/Level/Hotspot.h +++ b/Source/Level/Hotspot.hpp @@ -18,10 +18,11 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#ifndef _HOTSPOT_H_ -#define _HOTSPOT_H_ +#ifndef _HOTSPOT_HPP_ +#define _HOTSPOT_HPP_ + +#include "Math/Quaternions.hpp" -#include "Math/Quaternions.h" #include class Hotspot diff --git a/Source/MacCompatibility.cpp b/Source/MacCompatibility.cpp index 6e47632..ac0e63c 100644 --- a/Source/MacCompatibility.cpp +++ b/Source/MacCompatibility.cpp @@ -18,12 +18,7 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -/**> HEADER FILES <**/ -#include "MacCompatibility.h" - -#ifdef WIN32 -#include -#endif +#include "MacCompatibility.hpp" #include #include @@ -31,11 +26,16 @@ along with Lugaru. If not, see . #include #include +#ifdef WIN32 +#include +#endif + #if PLATFORM_UNIX +#include #include -#include #include -#include +#include + typedef long long __int64; typedef __int64 LARGE_INTEGER; static int QueryPerformanceFrequency(LARGE_INTEGER *liptr) diff --git a/Source/MacCompatibility.h b/Source/MacCompatibility.hpp similarity index 96% rename from Source/MacCompatibility.h rename to Source/MacCompatibility.hpp index 26b0b60..57cdc41 100644 --- a/Source/MacCompatibility.h +++ b/Source/MacCompatibility.hpp @@ -18,12 +18,14 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#ifndef _MACCOMPATIBLITY_H_ -#define _MACCOMPATIBLITY_H_ +#ifndef _MACCOMPATIBLITY_HPP_ +#define _MACCOMPATIBLITY_HPP_ + +#include "Math/Random.hpp" -#include #include #include +#include // stuff to make Mac code compatable with Windows/Linux/etc @@ -58,7 +60,6 @@ typedef signed char SInt8; typedef unsigned int UInt32; -#include "Math/Random.h" typedef struct AbsoluteTime { unsigned long hi; diff --git a/Source/Math/Frustum.cpp b/Source/Math/Frustum.cpp index 164074b..e8b1366 100644 --- a/Source/Math/Frustum.cpp +++ b/Source/Math/Frustum.cpp @@ -18,11 +18,11 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include "Math/Frustum.h" -#include +#include "Math/Frustum.hpp" -#include "Graphic/gamegl.h" +#include "Graphic/gamegl.hpp" +#include void FRUSTUM:: GetFrustum() diff --git a/Source/Math/Frustum.h b/Source/Math/Frustum.hpp similarity index 95% rename from Source/Math/Frustum.h rename to Source/Math/Frustum.hpp index 918a047..79f4e48 100644 --- a/Source/Math/Frustum.h +++ b/Source/Math/Frustum.hpp @@ -18,8 +18,8 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#ifndef FRUSTUM_H -#define FRUSTUM_H +#ifndef _FRUSTUM_HPP_ +#define _FRUSTUM_HPP_ class FRUSTUM { diff --git a/Source/Math/PhysicsMath.h b/Source/Math/PhysicsMath.hpp similarity index 99% rename from Source/Math/PhysicsMath.h rename to Source/Math/PhysicsMath.hpp index 7dc9461..6d1e5a6 100644 --- a/Source/Math/PhysicsMath.h +++ b/Source/Math/PhysicsMath.hpp @@ -18,12 +18,10 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#ifndef _PHYSICSMATH_H_ -#define _PHYSICSMATH_H_ +#ifndef _PHYSICSMATH_HPP_ +#define _PHYSICSMATH_HPP_ -//#include - -#include "MacCompatibility.h" +#include "MacCompatibility.hpp" //------------------------------------------------------------------------// // Misc. Constants diff --git a/Source/Math/Quaternions.cpp b/Source/Math/Quaternions.cpp index 7e68b97..0feaa70 100644 --- a/Source/Math/Quaternions.cpp +++ b/Source/Math/Quaternions.cpp @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include "Math/Quaternions.h" +#include "Math/Quaternions.hpp" // Functions quaternion Quat_Mult(quaternion q1, quaternion q2) diff --git a/Source/Math/Quaternions.h b/Source/Math/Quaternions.hpp similarity index 99% rename from Source/Math/Quaternions.h rename to Source/Math/Quaternions.hpp index de07302..3220545 100644 --- a/Source/Math/Quaternions.h +++ b/Source/Math/Quaternions.hpp @@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ +#ifndef _QUATERNIONS_HPP_ +#define _QUATERNIONS_HPP_ -#ifndef _QUATERNIONS_H_ -#define _QUATERNIONS_H_ +#include "PhysicsMath.hpp" +#include "Graphic/gamegl.hpp" -#include "math.h" -#include "PhysicsMath.h" -#include "Graphic/gamegl.h" +#include /**> Quaternion Structures <**/ #define PI 3.14159265355555897932384626 diff --git a/Source/Math/Random.h b/Source/Math/Random.hpp similarity index 95% rename from Source/Math/Random.h rename to Source/Math/Random.hpp index 096cedc..430023c 100644 --- a/Source/Math/Random.h +++ b/Source/Math/Random.hpp @@ -18,8 +18,8 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#ifndef _RANDOM_H_ -#define _RANDOM_H_ +#ifndef _RANDOM_HPP_ +#define _RANDOM_HPP_ #include diff --git a/Source/Menu/Menu.cpp b/Source/Menu/Menu.cpp index 3639740..7d8bce8 100644 --- a/Source/Menu/Menu.cpp +++ b/Source/Menu/Menu.cpp @@ -18,19 +18,20 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include -#include -#include +#include "Menu/Menu.hpp" -#include "Graphic/gamegl.h" -#include "Level/Campaign.h" -#include "Menu/Menu.h" -#include "User/Settings.h" -#include "Utils/Input.h" +#include "Audio/openal_wrapper.hpp" +#include "Graphic/gamegl.hpp" +#include "Level/Campaign.hpp" +#include "User/Settings.hpp" +#include "Utils/Input.hpp" // Should not be needed, Menu should call methods from other classes to launch maps and challenges and so on -#include "Level/Awards.h" -#include "Audio/openal_wrapper.h" +#include "Level/Awards.hpp" + +#include +#include +#include using namespace Game; diff --git a/Source/Menu/Menu.h b/Source/Menu/Menu.hpp similarity index 97% rename from Source/Menu/Menu.h rename to Source/Menu/Menu.hpp index bf99bdc..eea5a5c 100644 --- a/Source/Menu/Menu.h +++ b/Source/Menu/Menu.hpp @@ -18,10 +18,10 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#ifndef _MENU_H_ -#define _MENU_H_ +#ifndef _MENU_HPP_ +#define _MENU_HPP_ -#include "Game.h" +#include "Game.hpp" struct MenuItem { enum MenuItemType {NONE, LABEL, BUTTON, IMAGE, IMAGEBUTTON, MAPMARKER, MAPLINE, MAPLABEL} type; diff --git a/Source/Objects/Objects.cpp b/Source/Objects/Objects.cpp index 20e117c..9064ff8 100644 --- a/Source/Objects/Objects.cpp +++ b/Source/Objects/Objects.cpp @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include "Objects/Objects.h" +#include "Objects/Objects.hpp" extern XYZ viewer; extern float viewdistance; diff --git a/Source/Objects/Objects.h b/Source/Objects/Objects.hpp similarity index 87% rename from Source/Objects/Objects.h rename to Source/Objects/Objects.hpp index 83f17c2..70f382a 100644 --- a/Source/Objects/Objects.h +++ b/Source/Objects/Objects.hpp @@ -18,19 +18,18 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#ifndef _OBJECTS_H_ -#define _OBJECTS_H_ +#ifndef _OBJECTS_HPP_ +#define _OBJECTS_HPP_ -#include "Environment/Lights.h" -#include "Environment/Terrain.h" -#include "Graphic/gamegl.h" -#include "Graphic/Models.h" -#include "Graphic/Sprite.h" -#include "Graphic/Texture.h" -#include "Math/Frustum.h" -#include "Math/Quaternions.h" -#include "Math/Quaternions.h" -#include "Utils/ImageIO.h" +#include "Environment/Lights.hpp" +#include "Environment/Terrain.hpp" +#include "Graphic/gamegl.hpp" +#include "Graphic/Models.hpp" +#include "Graphic/Sprite.hpp" +#include "Graphic/Texture.hpp" +#include "Math/Frustum.hpp" +#include "Math/Quaternions.hpp" +#include "Utils/ImageIO.hpp" #include // diff --git a/Source/Objects/Person.cpp b/Source/Objects/Person.cpp index c1eb88d..8181e81 100644 --- a/Source/Objects/Person.cpp +++ b/Source/Objects/Person.cpp @@ -18,16 +18,15 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -/**> HEADER FILES <**/ -#include "Animation/Animation.h" -#include "Audio/openal_wrapper.h" -#include "Audio/Sounds.h" -#include "Level/Awards.h" -#include "Level/Dialog.h" -#include "Objects/Person.h" -#include "Utils/Folders.h" - -#include "Game.h" +#include "Objects/Person.hpp" + +#include "Animation/Animation.hpp" +#include "Audio/openal_wrapper.hpp" +#include "Audio/Sounds.hpp" +#include "Game.hpp" +#include "Level/Awards.hpp" +#include "Level/Dialog.hpp" +#include "Utils/Folders.hpp" extern float multiplier; extern Terrain terrain; diff --git a/Source/Objects/Person.h b/Source/Objects/Person.hpp similarity index 97% rename from Source/Objects/Person.h rename to Source/Objects/Person.hpp index 4fa115f..62af3a6 100644 --- a/Source/Objects/Person.h +++ b/Source/Objects/Person.hpp @@ -18,21 +18,20 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#ifndef _PERSON_H_ -#define _PERSON_H_ - -/**> HEADER FILES <**/ -#include "Animation/Animation.h" -#include "Animation/Skeleton.h" -#include "Environment/Terrain.h" -#include "Graphic/gamegl.h" -#include "Graphic/Models.h" -#include "Graphic/Sprite.h" -#include "Math/Quaternions.h" -#include "Objects/Weapons.h" +#ifndef _PERSON_HPP_ +#define _PERSON_HPP_ + +#include "Animation/Animation.hpp" +#include "Animation/Skeleton.hpp" +#include "Environment/Terrain.hpp" +#include "Graphic/gamegl.hpp" +#include "Graphic/Models.hpp" +#include "Graphic/Sprite.hpp" +#include "Math/Quaternions.hpp" +#include "Objects/Weapons.hpp" -#include #include +#include #define passivetype 0 #define guardtype 1 diff --git a/Source/Objects/Weapons.cpp b/Source/Objects/Weapons.cpp index c56779d..0126c2e 100644 --- a/Source/Objects/Weapons.cpp +++ b/Source/Objects/Weapons.cpp @@ -20,14 +20,13 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -/**> HEADER FILES <**/ -#include "Animation/Animation.h" -#include "Audio/openal_wrapper.h" -#include "Audio/Sounds.h" -#include "Level/Awards.h" -#include "Objects/Weapons.h" - -#include "Game.h" +#include "Objects/Weapons.hpp" + +#include "Animation/Animation.hpp" +#include "Audio/openal_wrapper.hpp" +#include "Audio/Sounds.hpp" +#include "Game.hpp" +#include "Level/Awards.hpp" extern float multiplier; extern Terrain terrain; diff --git a/Source/Objects/Weapons.h b/Source/Objects/Weapons.hpp similarity index 89% rename from Source/Objects/Weapons.h rename to Source/Objects/Weapons.hpp index 51ab000..9258e9e 100644 --- a/Source/Objects/Weapons.h +++ b/Source/Objects/Weapons.hpp @@ -18,18 +18,17 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#ifndef _WEAPONS_H_ -#define _WEAPONS_H_ - -/**> HEADER FILES <**/ -#include "Animation/Skeleton.h" -#include "Environment/Terrain.h" -#include "Graphic/gamegl.h" -#include "Graphic/Models.h" -#include "Graphic/Sprite.h" -#include "Graphic/Texture.h" -#include "Math/Quaternions.h" -#include "Objects/Person.h" +#ifndef _WEAPONS_HPP_ +#define _WEAPONS_HPP_ + +#include "Animation/Skeleton.hpp" +#include "Environment/Terrain.hpp" +#include "Graphic/gamegl.hpp" +#include "Graphic/Models.hpp" +#include "Graphic/Sprite.hpp" +#include "Graphic/Texture.hpp" +#include "Math/Quaternions.hpp" +#include "Objects/Person.hpp" #include diff --git a/Source/User/Account.cpp b/Source/User/Account.cpp index ff4b04f..ed0a654 100644 --- a/Source/User/Account.cpp +++ b/Source/User/Account.cpp @@ -18,12 +18,14 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include "User/Account.h" +#include "User/Account.hpp" + +#include "MacCompatibility.hpp" #include "Utils/binio.h" -#include "MacCompatibility.h" + #include -#include "string.h" #include +#include using namespace std; diff --git a/Source/User/Account.h b/Source/User/Account.hpp similarity index 98% rename from Source/User/Account.h rename to Source/User/Account.hpp index 385c6fa..3c9e2e2 100644 --- a/Source/User/Account.h +++ b/Source/User/Account.hpp @@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#ifndef _Account_H_ -#define _Account_H_ +#ifndef _ACCOUNT_HPP_ +#define _ACCOUNT_HPP_ -#include -#include -#include #include +#include +#include +#include struct CampaignProgress { float highscore; diff --git a/Source/User/Settings.cpp b/Source/User/Settings.cpp index 9948e63..5f7909e 100644 --- a/Source/User/Settings.cpp +++ b/Source/User/Settings.cpp @@ -18,10 +18,11 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include "Game.h" -#include "User/Settings.h" -#include "Utils/Folders.h" -#include "Utils/Input.h" +#include "User/Settings.hpp" + +#include "Game.hpp" +#include "Utils/Folders.hpp" +#include "Utils/Input.hpp" using namespace Game; diff --git a/Source/User/Settings.h b/Source/User/Settings.hpp similarity index 95% rename from Source/User/Settings.h rename to Source/User/Settings.hpp index e5f983a..ca5327c 100644 --- a/Source/User/Settings.h +++ b/Source/User/Settings.hpp @@ -18,10 +18,10 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#ifndef SETTINGS_H_ -#define SETTINGS_H_ +#ifndef _SETTINGS_HPP_ +#define _SETTINGS_HPP_ -#include "Game.h" +#include "Game.hpp" extern float usermousesensitivity; extern bool ismotionblur; diff --git a/Source/Utils/Folders.cpp b/Source/Utils/Folders.cpp index b667daa..e2956e5 100644 --- a/Source/Utils/Folders.cpp +++ b/Source/Utils/Folders.cpp @@ -18,17 +18,20 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include "Folders.h" +#include "Folders.hpp" + #include #include + #if PLATFORM_UNIX +#include #include #include -#include #endif + #if _WIN32 -#include #include // to get paths related functions +#include #endif const std::string Folders::dataDir = DATA_DIR; diff --git a/Source/Utils/Folders.h b/Source/Utils/Folders.hpp similarity index 97% rename from Source/Utils/Folders.h rename to Source/Utils/Folders.hpp index 495f149..52be0f0 100644 --- a/Source/Utils/Folders.h +++ b/Source/Utils/Folders.hpp @@ -18,8 +18,8 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#ifndef _FOLDERS_H_ -#define _FOLDERS_H_ +#ifndef _FOLDERS_HPP_ +#define _FOLDERS_HPP_ #include diff --git a/Source/Utils/ImageIO.cpp b/Source/Utils/ImageIO.cpp index 7a405fc..778492c 100644 --- a/Source/Utils/ImageIO.cpp +++ b/Source/Utils/ImageIO.cpp @@ -18,17 +18,16 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -/**> HEADER FILES <**/ +#include "Utils/ImageIO.hpp" + +#include "Game.hpp" +#include "Utils/Folders.hpp" -#include #include #include +#include #include -#include "Game.h" -#include "Utils/ImageIO.h" -#include "Utils/Folders.h" - extern bool visibleloading; /* These two are needed for screenshot */ diff --git a/Source/Utils/ImageIO.h b/Source/Utils/ImageIO.hpp similarity index 92% rename from Source/Utils/ImageIO.h rename to Source/Utils/ImageIO.hpp index 0c587bf..6b43bad 100644 --- a/Source/Utils/ImageIO.h +++ b/Source/Utils/ImageIO.hpp @@ -18,26 +18,25 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#ifndef _IMAGE_IO_H_ -#define _IMAGE_IO_H_ +#ifndef _IMAGE_IO_HPP_ +#define _IMAGE_IO_HPP_ #ifdef _MSC_VER #pragma once #endif - -/**> HEADER FILES <**/ -#include #include +#include #include + #ifdef WIN32 #define WIN32_LEAN_AND_MEAN #define Polygon WinPolygon #include #undef Polygon -#include "GL/gl.h" +#include #else -#include "Graphic/gamegl.h" +#include "Graphic/gamegl.hpp" #endif /**> DATA STRUCTURES <**/ diff --git a/Source/Utils/Input.cpp b/Source/Utils/Input.cpp index 9376522..30667c7 100644 --- a/Source/Utils/Input.cpp +++ b/Source/Utils/Input.cpp @@ -18,8 +18,7 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -/**> HEADER FILES <**/ -#include "Utils/Input.h" +#include "Utils/Input.hpp" bool keyDown[SDL_NUM_SCANCODES + 6]; bool keyPressed[SDL_NUM_SCANCODES + 6]; diff --git a/Source/Utils/Input.h b/Source/Utils/Input.hpp similarity index 93% rename from Source/Utils/Input.h rename to Source/Utils/Input.hpp index 3bf8d79..af83cb1 100644 --- a/Source/Utils/Input.h +++ b/Source/Utils/Input.hpp @@ -18,12 +18,12 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#ifndef _Input_H_ -#define _Input_H_ +#ifndef _INPUT_HPP_ +#define _INPUT_HPP_ -/**> HEADER FILES <**/ -#include "SDL.h" -#include "Game.h" +#include "Game.hpp" + +#include /**> CONSTANT DECLARATIONS <**/ #define MOUSEBUTTON1 (SDL_NUM_SCANCODES + SDL_BUTTON_LEFT) diff --git a/Source/Utils/pack.c b/Source/Utils/pack.c index 736085d..da5c2ae 100644 --- a/Source/Utils/pack.c +++ b/Source/Utils/pack.c @@ -18,11 +18,11 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include - #include "binio.h" #include "private.h" +#include + struct BinIOPackContext { uint8_t *buffer; va_list args; diff --git a/Source/Utils/private.c b/Source/Utils/private.c index 6ff2b59..3e37728 100644 --- a/Source/Utils/private.c +++ b/Source/Utils/private.c @@ -18,10 +18,10 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include - #include "private.h" +#include + void BinIOConvert1(int from_byte_order, int to_byte_order, const uint8_t *src, uint8_t *dst, unsigned int count) diff --git a/Source/Utils/unpack.c b/Source/Utils/unpack.c index fbcce38..5a31c91 100644 --- a/Source/Utils/unpack.c +++ b/Source/Utils/unpack.c @@ -18,11 +18,11 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include - #include "binio.h" #include "private.h" +#include + struct BinIOUnpackContext { const uint8_t *data; va_list args; diff --git a/Source/WinDefs.cpp b/Source/WinDefs.cpp index b032f5e..4557d1e 100644 --- a/Source/WinDefs.cpp +++ b/Source/WinDefs.cpp @@ -18,12 +18,12 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -/**> HEADER FILES <**/ -#include "WinDefs.h" -#include +#include "WinDefs.hpp" + #include -#include #include +#include +#include class AppTime diff --git a/Source/WinDefs.h b/Source/WinDefs.hpp similarity index 96% rename from Source/WinDefs.h rename to Source/WinDefs.hpp index 3668453..ab4113b 100644 --- a/Source/WinDefs.h +++ b/Source/WinDefs.hpp @@ -18,16 +18,16 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#ifndef _WINDEFS_H_ -#define _WINDEFS_H_ +#ifndef _WINDEFS_HPP_ +#define _WINDEFS_HPP_ #ifdef WIN32 - -#include #include +#include -// stuff to make Mac code compatable with Windows +#include "Math/Random.hpp" +// stuff to make Mac code compatable with Windows // disable warnings about double to float conversions #pragma warning(disable:4305) @@ -48,9 +48,6 @@ typedef signed char SInt8; typedef unsigned int UInt32; -#include "Math/Random.h" - - typedef struct AbsoluteTime { unsigned long hi; unsigned long lo; diff --git a/Source/main.cpp b/Source/main.cpp index 2144a8c..8463907 100644 --- a/Source/main.cpp +++ b/Source/main.cpp @@ -18,27 +18,27 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ +#include "Game.hpp" + +#include "Audio/openal_wrapper.hpp" +#include "Graphic/gamegl.hpp" +#include "MacCompatibility.hpp" +#include "User/Settings.hpp" + +#include +#include #include +#include #include #include -#include -#include #include -#include -#include "MacCompatibility.h" -#include "Graphic/gamegl.h" -#include "User/Settings.h" - -#include "Game.h" using namespace Game; -#include "Audio/openal_wrapper.h" - #ifdef WIN32 -#include #include -#include "win-res/resource.h" +#include +#include "win-res/resource.hpp" #endif extern float multiplier; diff --git a/Source/win-res/resource.h b/Source/win-res/resource.hpp similarity index 100% rename from Source/win-res/resource.h rename to Source/win-res/resource.hpp -- 2.39.2