More work on 'thou shalt not include irrlicht.h everywhere carelessly', plus add debug checks to track.hpp in a desperate attempt to make STK Arthur_D-proof

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@8661 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2011-05-22 18:31:25 +00:00
parent d501753ef2
commit a37008d014
20 changed files with 89 additions and 21 deletions

View File

@ -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 <keycodes.h>
#include "input/binding.hpp"
#include "utils/string_utils.hpp"
#include "utils/translation.hpp"

View File

@ -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;

View File

@ -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"

View File

@ -21,7 +21,7 @@
#define HEADER_REMOTE_KART_INFO_HPP
#include <string>
#include "irrlicht.h"
#include <irrString.h>
class RemoteKartInfo
{

View File

@ -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"

View File

@ -19,7 +19,14 @@
#ifndef HEADER_CREDITS_HPP
#define HEADER_CREDITS_HPP
#include "irrlicht.h"
#include <rect.h>
namespace irr
{
namespace video { class IVideoDriver; }
}
using namespace irr;
#include "guiengine/screen.hpp"
#include "utils/ptr_vector.hpp"

View File

@ -20,7 +20,7 @@
#define __HEADER_OPTIONS_SCREEN_PLAYERS_HPP__
#include <string>
#include "irrlicht.h"
#include <irrString.h>
#include "guiengine/screen.hpp"

View File

@ -24,7 +24,7 @@
#include <string>
#include <vector>
#include "irrlicht.h"
#include <irrString.h>
using namespace irr;
#include "config/player.hpp"

View File

@ -22,7 +22,15 @@
#include <vector>
#include "irrlicht.h"
#include <irrString.h>
#include <vector2d.h>
#include <rect.h>
#include <dimension2d.h>
#include <SColor.h>
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;

View File

@ -18,7 +18,7 @@
#ifndef TUTORIALSCREEN_H
#define TUTORIALSCREEN_H
#include "irrlicht.h"
#include <irrString.h>
#include "guiengine/screen.hpp"
#include "guiengine/CGUISpriteBank.h"

View File

@ -20,7 +20,7 @@
#ifndef HEADER_AMBIENT_LIGHT_SPHERE_HPP
#define HEADER_AMBIENT_LIGHT_SPHERE_HPP
#include "irrlicht.h"
#include <SColor.h>
using namespace irr;
#include "tracks/check_sphere.hpp"

View File

@ -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;

View File

@ -23,6 +23,12 @@
#include <SColor.h>
#include "utils/vec3.hpp"
namespace irr
{
namespace video { class S3DVertex; }
}
using namespace irr;
class btTransform;
/**

View File

@ -27,6 +27,14 @@
#include "tracks/quad_set.hpp"
#include "utils/aligned_array.hpp"
#include <dimension2d.h>
namespace irr
{
namespace scene { class ISceneNode; class IMesh; class IMeshBuffer; }
namespace video { class ITexture; }
}
using namespace irr;
class CheckLine;
/**

View File

@ -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
//-----------------------------------------------------------------------------

View File

@ -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. */

View File

@ -20,7 +20,12 @@
#ifndef HEADER_TRACK_OBJECT_HPP
#define HEADER_TRACK_OBJECT_HPP
#include "irrlicht.h"
#include <vector3d.h>
#include <IAnimatedMeshSceneNode.h>
namespace irr
{
namespace scene { class IAnimatedMesh; class ISceneNode; }
}
using namespace irr;
#include "utils/vec3.hpp"

View File

@ -26,7 +26,7 @@
#include <string>
#include <vector>
#include <fstream>
#include <irrlicht.h>
#include <irrString.h>
// SuperTuxKart includes
#include "utils/no_copy.hpp"

View File

@ -20,7 +20,7 @@
#ifndef TRANSLATION_HPP
#define TRANSLATION_HPP
#include "irrlicht.h"
#include <irrString.h>
#include <vector>
#include <string>
#include "utils/string_utils.hpp"

View File

@ -21,7 +21,8 @@
#ifndef HEADER_VEC3_HPP
#define HEADER_VEC3_HPP
#include "irrlicht.h"
#include <vector3d.h>
#include <vector2d.h>
using namespace irr;
#include "LinearMath/btVector3.h"