diff --git a/src/input/binding.cpp b/src/input/binding.cpp index 33a62c9f0..195420308 100644 --- a/src/input/binding.cpp +++ b/src/input/binding.cpp @@ -17,6 +17,7 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +#include #include "input/binding.hpp" #include "utils/string_utils.hpp" #include "utils/translation.hpp" diff --git a/src/items/rubber_band.hpp b/src/items/rubber_band.hpp index bfefc3968..04e88437f 100644 --- a/src/items/rubber_band.hpp +++ b/src/items/rubber_band.hpp @@ -23,6 +23,12 @@ #include "utils/no_copy.hpp" #include "utils/vec3.hpp" +namespace irr +{ + namespace scene { class ISceneNode; class IMesh; class IMeshBuffer; } +} +using namespace irr; + class Kart; class Plunger; diff --git a/src/karts/moveable.hpp b/src/karts/moveable.hpp index 8644f2d42..ce72233c2 100644 --- a/src/karts/moveable.hpp +++ b/src/karts/moveable.hpp @@ -23,7 +23,7 @@ namespace irr { - namespace scene { class IMesh; class IMeshSceneNode; } + namespace scene { class IMesh; class IMeshSceneNode; class ISceneNode; } } using namespace irr; #include "btBulletDynamicsCommon.h" diff --git a/src/network/remote_kart_info.hpp b/src/network/remote_kart_info.hpp index c3546958f..a2e7ce6ed 100644 --- a/src/network/remote_kart_info.hpp +++ b/src/network/remote_kart_info.hpp @@ -21,7 +21,7 @@ #define HEADER_REMOTE_KART_INFO_HPP #include -#include "irrlicht.h" +#include class RemoteKartInfo { diff --git a/src/states_screens/addons_screen.hpp b/src/states_screens/addons_screen.hpp index c68fc2282..77692c112 100644 --- a/src/states_screens/addons_screen.hpp +++ b/src/states_screens/addons_screen.hpp @@ -18,9 +18,7 @@ #ifdef ADDONS_MANAGER #ifndef HEADER_ADDONS_SCREEN_HPP -#define HEADER_ADDONS_SCREEN_HPP - -#include "irrlicht.h" +#define HEADER_ADDONS_SCREEN_HPP\ #include "addons/addons_manager.hpp" #include "guiengine/screen.hpp" diff --git a/src/states_screens/credits.hpp b/src/states_screens/credits.hpp index 200d2e1a8..1a5dbdede 100644 --- a/src/states_screens/credits.hpp +++ b/src/states_screens/credits.hpp @@ -19,7 +19,14 @@ #ifndef HEADER_CREDITS_HPP #define HEADER_CREDITS_HPP -#include "irrlicht.h" +#include +namespace irr +{ + namespace video { class IVideoDriver; } +} + +using namespace irr; + #include "guiengine/screen.hpp" #include "utils/ptr_vector.hpp" diff --git a/src/states_screens/options_screen_players.hpp b/src/states_screens/options_screen_players.hpp index ac9bc9cb7..cac4f0b8d 100644 --- a/src/states_screens/options_screen_players.hpp +++ b/src/states_screens/options_screen_players.hpp @@ -20,7 +20,7 @@ #define __HEADER_OPTIONS_SCREEN_PLAYERS_HPP__ #include -#include "irrlicht.h" +#include #include "guiengine/screen.hpp" diff --git a/src/states_screens/race_gui.hpp b/src/states_screens/race_gui.hpp index df4fb607d..9a5af67e6 100644 --- a/src/states_screens/race_gui.hpp +++ b/src/states_screens/race_gui.hpp @@ -24,7 +24,7 @@ #include #include -#include "irrlicht.h" +#include using namespace irr; #include "config/player.hpp" diff --git a/src/states_screens/race_gui_base.hpp b/src/states_screens/race_gui_base.hpp index f9340b696..26dcceb6e 100644 --- a/src/states_screens/race_gui_base.hpp +++ b/src/states_screens/race_gui_base.hpp @@ -22,7 +22,15 @@ #include -#include "irrlicht.h" +#include +#include +#include +#include +#include +namespace irr +{ + namespace video { class ITexture; class S3DVertex; } +} using namespace irr; @@ -50,7 +58,7 @@ public: float r, g, b; /** if this kart has a special title, e.g. "leader" in follow-the-leader */ - irr::core::stringw special_title; + core::stringw special_title; /** Current lap of this kart, or -1 if irrelevant */ int lap; diff --git a/src/states_screens/tutorial_screen.hpp b/src/states_screens/tutorial_screen.hpp index 9e40fe2a6..52bb9a72d 100644 --- a/src/states_screens/tutorial_screen.hpp +++ b/src/states_screens/tutorial_screen.hpp @@ -18,7 +18,7 @@ #ifndef TUTORIALSCREEN_H #define TUTORIALSCREEN_H -#include "irrlicht.h" +#include #include "guiengine/screen.hpp" #include "guiengine/CGUISpriteBank.h" diff --git a/src/tracks/ambient_light_sphere.hpp b/src/tracks/ambient_light_sphere.hpp index 7cb07162b..6b191477c 100644 --- a/src/tracks/ambient_light_sphere.hpp +++ b/src/tracks/ambient_light_sphere.hpp @@ -20,7 +20,7 @@ #ifndef HEADER_AMBIENT_LIGHT_SPHERE_HPP #define HEADER_AMBIENT_LIGHT_SPHERE_HPP -#include "irrlicht.h" +#include using namespace irr; #include "tracks/check_sphere.hpp" diff --git a/src/tracks/check_sphere.hpp b/src/tracks/check_sphere.hpp index d632d182f..31dd5a362 100644 --- a/src/tracks/check_sphere.hpp +++ b/src/tracks/check_sphere.hpp @@ -20,9 +20,6 @@ #ifndef HEADER_CHECK_SPHERE_HPP #define HEADER_CHECK_SPHERE_HPP -#include "irrlicht.h" -using namespace irr; - #include "tracks/check_structure.hpp" class XMLNode; diff --git a/src/tracks/quad.hpp b/src/tracks/quad.hpp index 1ed9de7da..fbfe02868 100644 --- a/src/tracks/quad.hpp +++ b/src/tracks/quad.hpp @@ -23,6 +23,12 @@ #include #include "utils/vec3.hpp" +namespace irr +{ + namespace video { class S3DVertex; } +} +using namespace irr; + class btTransform; /** diff --git a/src/tracks/quad_graph.hpp b/src/tracks/quad_graph.hpp index cc2492b5d..8a5797777 100644 --- a/src/tracks/quad_graph.hpp +++ b/src/tracks/quad_graph.hpp @@ -27,6 +27,14 @@ #include "tracks/quad_set.hpp" #include "utils/aligned_array.hpp" +#include +namespace irr +{ + namespace scene { class ISceneNode; class IMesh; class IMeshBuffer; } + namespace video { class ITexture; } +} +using namespace irr; + class CheckLine; /** diff --git a/src/tracks/track.cpp b/src/tracks/track.cpp index 126a5d7ca..98afab6b0 100644 --- a/src/tracks/track.cpp +++ b/src/tracks/track.cpp @@ -48,7 +48,6 @@ using namespace irr; #include "physics/physical_object.hpp" #include "physics/triangle_mesh.hpp" #include "race/race_manager.hpp" -#include "states_screens/race_gui_base.hpp" #include "tracks/bezier_curve.hpp" #include "tracks/check_manager.hpp" #include "tracks/quad_graph.hpp" @@ -63,6 +62,10 @@ const float Track::NOHIT = -99999.9f; // ---------------------------------------------------------------------------- Track::Track(std::string filename) { +#ifdef DEBUG + m_magic_number = 0x17AC3802; +#endif + m_filename = filename; m_root = StringUtils::getPath(StringUtils::removeExtension(m_filename)); m_ident = StringUtils::getBasename(m_root); @@ -89,6 +92,10 @@ Track::Track(std::string filename) /** Destructor, removes quad data structures etc. */ Track::~Track() { +#ifdef DEBUG + assert(m_magic_number == 0x17AC3802); + m_magic_number = 0xDEADBEEF; +#endif } // ~Track //----------------------------------------------------------------------------- diff --git a/src/tracks/track.hpp b/src/tracks/track.hpp index b7f6dcda0..fe0e3a831 100644 --- a/src/tracks/track.hpp +++ b/src/tracks/track.hpp @@ -66,6 +66,11 @@ enum WeatherType class Track { private: + +#ifdef DEBUG + unsigned int m_magic_number; +#endif + float m_gravity; std::string m_ident; std::string m_screenshot; @@ -181,9 +186,28 @@ private: std::string m_quad_name; /**< Name of the quad file to use. */ std::string m_graph_name; /**< Name of the graph file to use. */ std::string m_scene; /**< Name of the scene file to use. */ + +#ifdef DEBUG + unsigned int m_magic_number; +#endif + /** Default constructor, sets default names for all fields. */ TrackMode() : m_name("default"), m_quad_name("quads.xml"), - m_graph_name("graph.xml"), m_scene("scene.xml") {}; + m_graph_name("graph.xml"), m_scene("scene.xml") + { +#ifdef DEBUG + m_magic_number = 0x46825179; +#endif + } + + ~TrackMode() + { +#ifdef DEBUG + assert(m_magic_number == 0x46825179); + m_magic_number = 0xDEADBEEF; +#endif + } + }; // TrackMode /** List of all modes for a track. */ diff --git a/src/tracks/track_object.hpp b/src/tracks/track_object.hpp index 3f8dc9dce..4d5d3c0d2 100644 --- a/src/tracks/track_object.hpp +++ b/src/tracks/track_object.hpp @@ -20,7 +20,12 @@ #ifndef HEADER_TRACK_OBJECT_HPP #define HEADER_TRACK_OBJECT_HPP -#include "irrlicht.h" +#include +#include +namespace irr +{ + namespace scene { class IAnimatedMesh; class ISceneNode; } +} using namespace irr; #include "utils/vec3.hpp" diff --git a/src/tutorial/tutorial.hpp b/src/tutorial/tutorial.hpp index 37404fbd4..1de42d604 100644 --- a/src/tutorial/tutorial.hpp +++ b/src/tutorial/tutorial.hpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include // SuperTuxKart includes #include "utils/no_copy.hpp" diff --git a/src/utils/translation.hpp b/src/utils/translation.hpp index 6704a896f..9cdcbcffe 100644 --- a/src/utils/translation.hpp +++ b/src/utils/translation.hpp @@ -20,7 +20,7 @@ #ifndef TRANSLATION_HPP #define TRANSLATION_HPP -#include "irrlicht.h" +#include #include #include #include "utils/string_utils.hpp" diff --git a/src/utils/vec3.hpp b/src/utils/vec3.hpp index 6e3aa1d74..f26ecca07 100644 --- a/src/utils/vec3.hpp +++ b/src/utils/vec3.hpp @@ -21,7 +21,8 @@ #ifndef HEADER_VEC3_HPP #define HEADER_VEC3_HPP -#include "irrlicht.h" +#include +#include using namespace irr; #include "LinearMath/btVector3.h"