Clean up irrlicht includes; avoiding including the huge irrlicht.h when we only need one specific class, especially in header files; use forwards when possible

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@8660 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2011-05-22 18:03:28 +00:00
parent c790ecc1e0
commit d501753ef2
52 changed files with 129 additions and 73 deletions

View File

@ -113,4 +113,4 @@ std::string Addon::getDateAsString() const
char s[16];
strftime(s, 128, "%d.%m.%Y", t);
return s;
} // getDateAsString
} // getDateAsString

View File

@ -60,4 +60,4 @@ void Request::notifyAddon()
{
if(m_icon_addon)
m_icon_addon->setIconReady();
} // notifyAddon
} // notifyAddon

View File

@ -20,6 +20,7 @@
#include <assert.h>
#include "config/device_config.hpp"
#include <keycodes.h>
//==== D E V I C E C O N F I G =================================================

View File

@ -227,7 +227,7 @@ Material *MaterialManager::getMaterial(const std::string& fname,
m_materials.push_back(m);
if(make_permanent)
{
assert(m_shared_material_index==m_materials.size()-1);
assert(m_shared_material_index==(int)m_materials.size()-1);
m_shared_material_index = (int)m_materials.size();
}
return m ;

View File

@ -587,7 +587,6 @@
#include <iostream>
#include <assert.h>
#include "io/file_manager.hpp"
#include "input/input_manager.hpp"
#include "guiengine/event_handler.hpp"

View File

@ -23,19 +23,17 @@
* \defgroup guiengine
*/
namespace irr
{
class IrrlichtDevice;
namespace gui { class IGUIEnvironment; class ScalableFont; }
namespace video { class IVideoDriver; class ITexture; }
}
#include <irrlicht.h>
#include <string>
#include "utils/constants.hpp"
#include "utils/ptr_vector.hpp"
namespace irr
{
namespace gui
{
class ScalableFont;
}
}
/**
* \ingroup guiengine

View File

@ -18,7 +18,7 @@
#ifndef HEADER_EVENT_HANDLER_HPP
#define HEADER_EVENT_HANDLER_HPP
#include "irrlicht.h"
#include <IEventReceiver.h>
#include "input/input.hpp"
/**

View File

@ -18,7 +18,11 @@
#ifndef HEADER_MODAL_DIALOG_HPP
#define HEADER_MODAL_DIALOG_HPP
#include "irrlicht.h"
namespace irr
{
namespace gui { class IGUIWindow; }
}
#include "utils/ptr_vector.hpp"
#include "guiengine/abstract_top_level_container.hpp"
//#include "guiengine/event_handler.hpp"

View File

@ -5,12 +5,12 @@
#include "guiengine/scalable_font.hpp"
#include <iostream>
#include <IGUIEnvironment.h>
#include <IXMLReader.h>
#include <IReadFile.h>
#include <IVideoDriver.h>
#include <IGUISpriteBank.h>
#include "IGUIEnvironment.h"
#include "IXMLReader.h"
#include "IReadFile.h"
#include "IVideoDriver.h"
#include "IGUISpriteBank.h"
#include "guiengine/engine.hpp"
#include "io/file_manager.hpp"
#include "utils/translation.hpp"

View File

@ -23,7 +23,12 @@
#include <string>
#include <typeinfo>
#include "irrlicht.h"
#include <irrString.h>
namespace irr
{
namespace gui { class IGUIElement; }
}
using namespace irr;
#include "config/stk_config.hpp"
#include "guiengine/abstract_top_level_container.hpp"

View File

@ -19,7 +19,11 @@
#ifndef HEADER_WIDGET_HPP
#define HEADER_WIDGET_HPP
#include <irrlicht.h>
#include <irrString.h>
namespace irr
{
namespace gui { class IGUIElement; }
}
#include <map>
#include "guiengine/event_handler.hpp"

View File

@ -18,7 +18,9 @@
#ifndef __BUBBLE_WIDGET_HPP__
#define __BUBBLE_WIDGET_HPP__
#include <irrlicht.h>
#include <rect.h>
#include <irrString.h>
#include "guiengine/widget.hpp"
namespace GUIEngine

View File

@ -24,7 +24,7 @@
* \defgroup widgets Guiengine/Widgets
*/
#include <irrlicht.h>
#include <irrString.h>
#include "guiengine/widget.hpp"
#include "utils/ptr_vector.hpp"

View File

@ -20,8 +20,6 @@
#ifndef HEADER_CHECKBOX_HPP
#define HEADER_CHECKBOX_HPP
#include <irrlicht.h>
#include "guiengine/widget.hpp"
#include "utils/ptr_vector.hpp"

View File

@ -20,7 +20,7 @@
#ifndef HEADER_RIBBONGRID_HPP
#define HEADER_RIBBONGRID_HPP
#include <irrlicht.h>
#include <irrString.h>
#include "guiengine/widget.hpp"
#include "guiengine/widgets/ribbon_widget.hpp"

View File

@ -20,7 +20,12 @@
#ifndef HEADER_IBTN_HPP
#define HEADER_IBTN_HPP
#include <irrlicht.h>
#include <irrString.h>
namespace irr
{
namespace gui { class IGUIStaticText; }
namespace video { class ITexture; }
}
#include "guiengine/widget.hpp"
#include "utils/ptr_vector.hpp"

View File

@ -20,7 +20,8 @@
#ifndef HEADER_LABEL_HPP
#define HEADER_LABEL_HPP
#include <irrlicht.h>
#include <irrString.h>
#include <SColor.h>
#include "guiengine/widget.hpp"
#include "utils/ptr_vector.hpp"

View File

@ -20,7 +20,7 @@
#ifndef HEADER_LISTWIDGET_HPP
#define HEADER_LISTWIDGET_HPP
#include <irrlicht.h>
#include <irrString.h>
#include "guiengine/widget.hpp"
#include "guiengine/widgets/button_widget.hpp"

View File

@ -24,7 +24,7 @@
* \defgroup widgets Guiengine/Widgets
*/
#include <irrlicht.h>
#include <irrString.h>
#include "guiengine/widget.hpp"
#include "utils/ptr_vector.hpp"

View File

@ -20,7 +20,7 @@
#ifndef HEADER_RIBBON_HPP
#define HEADER_RIBBON_HPP
#include <irrlicht.h>
#include <irrString.h>
#include "guiengine/widget.hpp"
#include "guiengine/widgets/icon_button_widget.hpp"

View File

@ -20,7 +20,11 @@
#ifndef HEADER_SPINNER_HPP
#define HEADER_SPINNER_HPP
#include <irrlicht.h>
#include <irrString.h>
namespace irr
{
namespace video { class ITexture; }
}
#include "guiengine/widget.hpp"
#include "utils/ptr_vector.hpp"

View File

@ -20,7 +20,7 @@
#ifndef HEADER_TEXTBOX_HPP
#define HEADER_TEXTBOX_HPP
#include <irrlicht.h>
#include <irrString.h>
#include "guiengine/widget.hpp"
#include "utils/ptr_vector.hpp"

View File

@ -23,9 +23,10 @@
#include <fstream>
#include "irrlicht.h"
#include <irrString.h>
#include "input/input.hpp"
#include "utils/no_copy.hpp"
#include <irrXML.h>
/**
* \ingroup config

View File

@ -28,7 +28,9 @@
#include <vector>
#include <set>
#include "irrlicht.h"
#include <irrString.h>
#include <IFileSystem.h>
namespace irr { class IrrlichtDevice; }
using namespace irr;
#include "io/xml_node.hpp"

View File

@ -23,7 +23,13 @@
#include <string>
#include <map>
#include <vector>
#include "irrlicht.h"
#include <irrString.h>
#include <IXMLReader.h>
#include <SColor.h>
#include <vector2d.h>
#include <vector3d.h>
#include <path.h>
using namespace irr;
#include "utils/no_copy.hpp"

View File

@ -21,7 +21,7 @@
#define HEADER_XML_WRITER_HPP
#include <fstream>
#include <irrlicht.h>
#include <irrString.h>
/**
* \brief utility class used to write wide (UTF-16 or UTF-32, depending of size of wchar_t) XML files

View File

@ -19,7 +19,11 @@
#ifndef HEADER_ATTACHMENT_MANAGER_HPP
#define HEADER_ATTACHMENT_MANAGER_HPP
#include "irrlicht.h"
namespace irr
{
namespace scene { class IAnimatedMesh; }
}
#include "items/attachment.hpp"
#include "utils/no_copy.hpp"

View File

@ -20,7 +20,10 @@
#ifndef HEADER_BOWLING_HPP
#define HEADER_BOWLING_HPP
#include "irrlicht.h"
namespace irr
{
namespace scene { class IMesh; }
}
using namespace irr;
#include "items/flyable.hpp"

View File

@ -23,7 +23,10 @@
#ifndef HEADER_CAKE_HPP
#define HEADER_CAKE_HPP
#include "irrlicht.h"
namespace irr
{
namespace scene { class IMesh; }
}
#include "items/flyable.hpp"

View File

@ -23,7 +23,10 @@
#ifndef HEADER_FLYABLE_HPP
#define HEADER_FLYABLE_HPP
#include "irrlicht.h"
namespace irr
{
namespace scene { class IMesh; }
}
using namespace irr;
#include "audio/sfx_manager.hpp"

View File

@ -24,7 +24,10 @@
* \defgroup items
*/
#include "irrlicht.h"
namespace irr
{
namespace scene { class IMesh; }
}
using namespace irr;
#include "karts/kart.hpp"

View File

@ -23,9 +23,6 @@
#ifndef HEADER_MISSILE_HPP
#define HEADER_MISSILE_HPP
#include "irrlicht.h"
using namespace irr;
#include "items/flyable.hpp"
class Kart;

View File

@ -20,7 +20,10 @@
#ifndef HEADER_POWERUPMANAGER_HPP
#define HEADER_POWERUPMANAGER_HPP
#include "irrlicht.h"
namespace irr
{
namespace scene { class IMesh; }
}
#include <string>
#include <vector>

View File

@ -21,7 +21,11 @@
#define HEADER_PROJECTILEMANAGER_HPP
#include <vector>
#include "irrlicht.h"
namespace irr
{
namespace scene { class IMesh; }
}
#include "audio/sfx_manager.hpp"
#include "items/powerup_manager.hpp"

View File

@ -21,7 +21,10 @@
#ifndef HEADER_MOVEABLE_HPP
#define HEADER_MOVEABLE_HPP
#include "irrlicht.h"
namespace irr
{
namespace scene { class IMesh; class IMeshSceneNode; }
}
using namespace irr;
#include "btBulletDynamicsCommon.h"

View File

@ -40,7 +40,7 @@
#include <sstream>
#include <algorithm>
#include "IEventReceiver.h"
#include <IEventReceiver.h>
#include "main_loop.hpp"
#include "addons/addons_manager.hpp"

View File

@ -20,7 +20,6 @@
#include "race/grand_prix_manager.hpp"
#include <set>
#include "io/file_manager.hpp"
#include "utils/string_utils.hpp"

View File

@ -25,7 +25,7 @@
#include "race/race_manager.hpp"
#include "irrlicht.h"
#include <irrString.h>
class XMLNode;
class XMLWriter;

View File

@ -19,10 +19,14 @@
#ifndef HEADER_CHALLENGES_HPP
#define HEADER_CHALLENGES_HPP
#include "irrlicht.h"
#include "guiengine/screen.hpp"
#include "utils/ptr_vector.hpp"
namespace irr
{
namespace video { class IVideoDriver; }
}
/**
* \brief Handles the screen where the player is shown active and solved challenges

View File

@ -24,7 +24,13 @@
#include <string>
#include <vector>
#include "irrlicht.h"
#include <vector2d.h>
#include <irrString.h>
#include <dimension2d.h>
namespace irr
{
namespace video { class ITexture; }
}
using namespace irr;
#include "config/player.hpp"

View File

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

View File

@ -20,14 +20,11 @@
#define __HEADER_OPTIONS_SCREEN_INPUT_HPP__
#include <string>
//#include <map>
#include "irrlicht.h"
#include "guiengine/screen.hpp"
namespace GUIEngine { class Widget; }
class DeviceConfig;
namespace irr { namespace gui { class STKModifiedSpriteBank; } }
namespace irr { namespace gui { class STKModifiedSpriteBank; } namespace video { class IVideoDriver; } }
struct Input;

View File

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

View File

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

View File

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

View File

@ -20,9 +20,6 @@
#ifndef HEADER_CHECK_LAP_HPP
#define HEADER_CHECK_LAP_HPP
#include "irrlicht.h"
using namespace irr;
#include "tracks/check_structure.hpp"
class XMLNode;

View File

@ -20,7 +20,8 @@
#ifndef HEADER_CHECK_LINE_HPP
#define HEADER_CHECK_LINE_HPP
#include "irrlicht.h"
#include <line2d.h>
#include <IMeshSceneNode.h>
using namespace irr;
#include "tracks/check_structure.hpp"

View File

@ -22,7 +22,9 @@
#include <vector>
#include "irrlicht.h"
#include <vector2d.h>
#include <dimension2d.h>
#include <line2d.h>
#include "tracks/quad.hpp"
#include "tracks/quad_set.hpp"

View File

@ -20,6 +20,7 @@
#include "tracks/quad.hpp"
#include "irrlicht.h"
#include <algorithm>
#include "LinearMath/btTransform.h"

View File

@ -20,10 +20,7 @@
#ifndef HEADER_QUAD_HPP
#define HEADER_QUAD_HPP
#include <vector>
#include "irrlicht.h"
#include <SColor.h>
#include "utils/vec3.hpp"
class btTransform;

View File

@ -23,7 +23,11 @@
#include <string>
#include <vector>
#include "irrlicht.h"
namespace irr
{
namespace video { class ITexture; class SColor; }
namespace scene { class IMesh; }
}
using namespace irr;
#include "LinearMath/btTransform.h"

View File

@ -35,8 +35,6 @@
#include <iostream>
#include <vector>
#include "irrlicht.h"
#include "io/file_manager.hpp"
#include "utils/constants.hpp"