From c85aaafac2fd07592d80de7636b471851ec85a27 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Tue, 3 Jul 2012 15:32:38 +0200 Subject: [PATCH] more include cleanup (most removing Ogre.h) --- apps/openmw/mwgui/tooltips.cpp | 2 ++ apps/openmw/mwmechanics/actors.cpp | 2 ++ apps/openmw/mwrender/actors.cpp | 4 +-- apps/openmw/mwrender/animation.cpp | 5 +++ apps/openmw/mwrender/creatureanimation.cpp | 5 +++ apps/openmw/mwrender/debugging.cpp | 1 + apps/openmw/mwrender/localmap.cpp | 1 + apps/openmw/mwrender/npcanimation.cpp | 4 +++ apps/openmw/mwrender/objects.cpp | 5 +++ apps/openmw/mwrender/player.cpp | 7 ++++ apps/openmw/mwrender/player.hpp | 6 ++-- apps/openmw/mwrender/renderingmanager.cpp | 17 ++++++---- apps/openmw/mwrender/shaderhelper.cpp | 1 + apps/openmw/mwrender/sky.cpp | 7 ++++ apps/openmw/mwrender/terrain.cpp | 1 + apps/openmw/mwrender/water.cpp | 9 ++++++ apps/openmw/mwrender/water.hpp | 19 +++++++++-- apps/openmw/mwworld/refdata.cpp | 2 ++ apps/openmw/mwworld/refdata.hpp | 7 ++-- components/nif/data.hpp | 37 +++++++++++----------- components/nifogre/ogre_nif_loader.cpp | 18 ++++++++--- components/nifogre/ogre_nif_loader.hpp | 11 +++---- libs/openengine/bullet/BtOgre.cpp | 4 +++ libs/openengine/bullet/BtOgreGP.h | 5 ++- libs/openengine/bullet/pmove.h | 4 +-- 25 files changed, 136 insertions(+), 48 deletions(-) diff --git a/apps/openmw/mwgui/tooltips.cpp b/apps/openmw/mwgui/tooltips.cpp index e79436adc..34dec2d0b 100644 --- a/apps/openmw/mwgui/tooltips.cpp +++ b/apps/openmw/mwgui/tooltips.cpp @@ -2,6 +2,8 @@ #include +#include + #include #include "../mwbase/world.hpp" diff --git a/apps/openmw/mwmechanics/actors.cpp b/apps/openmw/mwmechanics/actors.cpp index 8f8fd6871..95747dbbf 100644 --- a/apps/openmw/mwmechanics/actors.cpp +++ b/apps/openmw/mwmechanics/actors.cpp @@ -3,6 +3,8 @@ #include +#include + #include #include "../mwworld/class.hpp" diff --git a/apps/openmw/mwrender/actors.cpp b/apps/openmw/mwrender/actors.cpp index 152cf3277..b37921b0c 100644 --- a/apps/openmw/mwrender/actors.cpp +++ b/apps/openmw/mwrender/actors.cpp @@ -1,7 +1,7 @@ #include "actors.hpp" -#include - +#include +#include using namespace Ogre; diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index fc6258208..f0a6ab683 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -1,5 +1,10 @@ #include "animation.hpp" +#include +#include +#include +#include +#include namespace MWRender{ std::map Animation::mUniqueIDs; diff --git a/apps/openmw/mwrender/creatureanimation.cpp b/apps/openmw/mwrender/creatureanimation.cpp index a19d411a4..e1fa7868c 100644 --- a/apps/openmw/mwrender/creatureanimation.cpp +++ b/apps/openmw/mwrender/creatureanimation.cpp @@ -1,4 +1,9 @@ #include "creatureanimation.hpp" + +#include +#include +#include + #include "renderconst.hpp" #include "../mwbase/world.hpp" diff --git a/apps/openmw/mwrender/debugging.cpp b/apps/openmw/mwrender/debugging.cpp index 5fe59f5e5..91b217a36 100644 --- a/apps/openmw/mwrender/debugging.cpp +++ b/apps/openmw/mwrender/debugging.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include diff --git a/apps/openmw/mwrender/localmap.cpp b/apps/openmw/mwrender/localmap.cpp index 9d38f14da..dd0351721 100644 --- a/apps/openmw/mwrender/localmap.cpp +++ b/apps/openmw/mwrender/localmap.cpp @@ -2,6 +2,7 @@ #include #include +#include #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" diff --git a/apps/openmw/mwrender/npcanimation.cpp b/apps/openmw/mwrender/npcanimation.cpp index 6fc61904c..fa88b7277 100644 --- a/apps/openmw/mwrender/npcanimation.cpp +++ b/apps/openmw/mwrender/npcanimation.cpp @@ -1,5 +1,9 @@ #include "npcanimation.hpp" +#include +#include +#include + #include #include "../mwbase/environment.hpp" diff --git a/apps/openmw/mwrender/objects.cpp b/apps/openmw/mwrender/objects.cpp index 03bb925c3..fb2bfb3c5 100644 --- a/apps/openmw/mwrender/objects.cpp +++ b/apps/openmw/mwrender/objects.cpp @@ -1,6 +1,11 @@ #include "objects.hpp" #include +#include +#include +#include +#include +#include #include #include diff --git a/apps/openmw/mwrender/player.cpp b/apps/openmw/mwrender/player.cpp index d6baac4b5..27ae28e14 100644 --- a/apps/openmw/mwrender/player.cpp +++ b/apps/openmw/mwrender/player.cpp @@ -1,6 +1,8 @@ #include "player.hpp" +#include + namespace MWRender { Player::Player (Ogre::Camera *camera, Ogre::SceneNode* node) @@ -24,4 +26,9 @@ namespace MWRender pitchNode->setOrientation(xr); yawNode->setOrientation(yr); } + + std::string Player::getHandle() const + { + return mNode->getName(); + } } diff --git a/apps/openmw/mwrender/player.hpp b/apps/openmw/mwrender/player.hpp index 406bedb0a..0ba936f6f 100644 --- a/apps/openmw/mwrender/player.hpp +++ b/apps/openmw/mwrender/player.hpp @@ -1,12 +1,12 @@ #ifndef GAME_MWRENDER_PLAYER_H #define GAME_MWRENDER_PLAYER_H -#include -#include +#include namespace Ogre { class Camera; + class SceneNode; } namespace MWRender @@ -26,7 +26,7 @@ namespace MWRender /// Set where the player is looking at. Uses Morrowind (euler) angles void setRot(float x, float y, float z); - std::string getHandle() const { return mNode->getName(); } + std::string getHandle() const; Ogre::SceneNode* getNode() {return mNode;} }; } diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index 7ca5f8982..5b76f5ae2 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -2,12 +2,17 @@ #include -#include "OgreRoot.h" -#include "OgreRenderWindow.h" -#include "OgreSceneManager.h" -#include "OgreViewport.h" -#include "OgreCamera.h" -#include "OgreTextureManager.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/apps/openmw/mwrender/shaderhelper.cpp b/apps/openmw/mwrender/shaderhelper.cpp index 59154a295..1f9086db4 100644 --- a/apps/openmw/mwrender/shaderhelper.cpp +++ b/apps/openmw/mwrender/shaderhelper.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include diff --git a/apps/openmw/mwrender/sky.cpp b/apps/openmw/mwrender/sky.cpp index cf4386793..45e48240b 100644 --- a/apps/openmw/mwrender/sky.cpp +++ b/apps/openmw/mwrender/sky.cpp @@ -4,9 +4,16 @@ #include #include #include +#include #include #include #include +#include +#include +#include +#include +#include +#include #include diff --git a/apps/openmw/mwrender/terrain.cpp b/apps/openmw/mwrender/terrain.cpp index cbc2f33b6..f14db34e6 100644 --- a/apps/openmw/mwrender/terrain.cpp +++ b/apps/openmw/mwrender/terrain.cpp @@ -2,6 +2,7 @@ #include #include +#include #include diff --git a/apps/openmw/mwrender/water.cpp b/apps/openmw/mwrender/water.cpp index dc9e1fbee..94fb3d6d9 100644 --- a/apps/openmw/mwrender/water.cpp +++ b/apps/openmw/mwrender/water.cpp @@ -1,5 +1,14 @@ #include "water.hpp" +#include +#include +#include +#include +#include +#include +#include +#include + #include "sky.hpp" #include "renderingmanager.hpp" #include "compositors.hpp" diff --git a/apps/openmw/mwrender/water.hpp b/apps/openmw/mwrender/water.hpp index 4d617ea47..71f261f2b 100644 --- a/apps/openmw/mwrender/water.hpp +++ b/apps/openmw/mwrender/water.hpp @@ -1,19 +1,34 @@ #ifndef GAME_MWRENDER_WATER_H #define GAME_MWRENDER_WATER_H -#include +#include +#include +#include +#include +#include +#include + #include #include #include "renderconst.hpp" +namespace Ogre +{ + class Camera; + class SceneManager; + class SceneNode; + class Entity; + class Vector3; + struct RenderTargetEvent; +}; namespace MWRender { class SkyManager; class RenderingManager; - /// Water rendering + /// Water rendering class Water : public Ogre::RenderTargetListener, public Ogre::RenderQueueListener { static const int CELL_SIZE = 8192; diff --git a/apps/openmw/mwworld/refdata.cpp b/apps/openmw/mwworld/refdata.cpp index a8aa058bc..14ddd3ec5 100644 --- a/apps/openmw/mwworld/refdata.cpp +++ b/apps/openmw/mwworld/refdata.cpp @@ -1,6 +1,8 @@ #include "refdata.hpp" +#include + #include "customdata.hpp" #include "cellstore.hpp" diff --git a/apps/openmw/mwworld/refdata.hpp b/apps/openmw/mwworld/refdata.hpp index 30d676f13..41521e47a 100644 --- a/apps/openmw/mwworld/refdata.hpp +++ b/apps/openmw/mwworld/refdata.hpp @@ -3,12 +3,15 @@ #include -#include - #include #include "../mwscript/locals.hpp" +namespace Ogre +{ + class SceneNode; +} + namespace ESM { class Script; diff --git a/components/nif/data.hpp b/components/nif/data.hpp index df9079758..10337d2c9 100644 --- a/components/nif/data.hpp +++ b/components/nif/data.hpp @@ -25,8 +25,9 @@ #define _NIF_DATA_H_ #include "controlled.hpp" -#include -#include + +#include +#include namespace Nif { @@ -466,7 +467,7 @@ public: std::vector > getAdditionalVertices(){ return additionalVertices; } - + void read(NIFFile *nif) { int morphCount = nif->getInt(); @@ -481,7 +482,7 @@ void read(NIFFile *nif) float z = nif->getFloat(); initialVertices.push_back(Ogre::Vector3(x, y, z)); } - + for(int i=1; igetInt(); @@ -543,8 +544,8 @@ class NiKeyframeData : public Record std::vector tbcscale; int stype; - - + + public: void clone(NiKeyframeData c) { @@ -559,11 +560,11 @@ public: translist1 = c.getTranslist1(); - translist2 = c.getTranslist2(); + translist2 = c.getTranslist2(); translist3 = c.getTranslist3(); transtime = c.gettTime(); - + bonename = c.getBonename(); @@ -611,7 +612,7 @@ public: Ogre::Quaternion quat = Ogre::Quaternion(Ogre::Real(w), Ogre::Real(x), Ogre::Real(y), Ogre::Real(z)); quats.push_back(quat); rottime.push_back(time); - //if(time == 0.0 || time > 355.5) + //if(time == 0.0 || time > 355.5) // std::cout <<"Time:" << time << "W:" << w <<"X:" << x << "Y:" << y << "Z:" << z << "\n"; } } @@ -632,7 +633,7 @@ public: quats.push_back(quat); rottime.push_back(time); tbc.push_back(vec); - //if(time == 0.0 || time > 355.5) + //if(time == 0.0 || time > 355.5) // std::cout <<"Time:" << time << "W:" << w <<"X:" << x << "Y:" << y << "Z:" << z << "\n"; } @@ -661,7 +662,7 @@ public: // Then translation count = nif->getInt(); - + if(count) { ttype = nif->getInt(); @@ -700,7 +701,7 @@ public: translist2.push_back(trans2); translist3.push_back(trans3); } - + //nif->getFloatLen(count*10); // trans1 + forward + backward } else if(ttype == 3){ @@ -729,12 +730,12 @@ public: { stype = nif->getInt(); - + for(int i = 0; i < count; i++){ - - + + //int size = 0; - if(stype >= 1 && stype < 4) + if(stype >= 1 && stype < 4) { float time = nif->getFloat(); float scale = nif->getFloat(); @@ -759,10 +760,10 @@ public: //size = 5; // 1 + tbc } - + } } - else + else stype = 0; } int getRtype(){ diff --git a/components/nifogre/ogre_nif_loader.cpp b/components/nifogre/ogre_nif_loader.cpp index 331701c2a..895c51a0d 100644 --- a/components/nifogre/ogre_nif_loader.cpp +++ b/components/nifogre/ogre_nif_loader.cpp @@ -25,6 +25,14 @@ #include "ogre_nif_loader.hpp" +#include +#include +#include +#include +#include +#include +#include + #include #include @@ -230,7 +238,7 @@ void NIFLoader::createMaterial(const String &name, //tech->setSchemeName("blahblah"); Pass* pass = tech->createPass(); pass->setVertexProgram("Ogre/BasicVertexPrograms/AmbientOneTexture");*/ - + // This assigns the texture to this material. If the texture name is // a file name, and this file exists (in a resource directory), it @@ -478,7 +486,7 @@ void NIFLoader::createOgreSubMesh(NiTriShape *shape, const String &material, std bind->setBinding(nextBuf++, vbuf); } - + // Vertex colors if (data->colors.length) { @@ -795,7 +803,7 @@ void NIFLoader::handleNiTriShape(NiTriShape *shape, int flags, BoundsFinder &bou std::list vertexBoneAssignments; Nif::NiTriShapeCopy copy = shape->clone(); - + if(!shape->controller.empty()) { Nif::Controller* cont = shape->controller.getPtr(); @@ -984,7 +992,7 @@ void NIFLoader::handleNiTriShape(NiTriShape *shape, int flags, BoundsFinder &bou } if(!mSkel.isNull() ){ int boneIndex; - + boneIndex = mSkel->getNumBones() - 1; for(int i = 0; i < numVerts; i++){ VertexBoneAssignment vba; @@ -1388,7 +1396,7 @@ void NIFLoader::loadResource(Resource *resource) vba.boneIndex = boneIndex; vba.vertexIndex = 0; vba.weight = 1; - + (*iter)->addBoneAssignment(vba); } diff --git a/components/nifogre/ogre_nif_loader.hpp b/components/nifogre/ogre_nif_loader.hpp index 794459e46..d73948fa8 100644 --- a/components/nifogre/ogre_nif_loader.hpp +++ b/components/nifogre/ogre_nif_loader.hpp @@ -26,12 +26,10 @@ #include #include -#include + +#include #include -#include -#include -#include -#include +#include #include #include "../nif/nif_file.hpp" @@ -45,7 +43,6 @@ #include #include // For warning messages -#include #include using namespace boost::algorithm; @@ -193,7 +190,7 @@ class NIFLoader : Ogre::ManualResourceLoader std::vector mS; std::vector needBoneAssignments; bool inTheSkeletonTree; - + }; diff --git a/libs/openengine/bullet/BtOgre.cpp b/libs/openengine/bullet/BtOgre.cpp index 618739083..f50465159 100644 --- a/libs/openengine/bullet/BtOgre.cpp +++ b/libs/openengine/bullet/BtOgre.cpp @@ -17,6 +17,10 @@ #include "BtOgreGP.h" #include "BtOgreExtras.h" +#include +#include +#include + using namespace Ogre; namespace BtOgre { diff --git a/libs/openengine/bullet/BtOgreGP.h b/libs/openengine/bullet/BtOgreGP.h index f0534de4b..4ce2f181e 100644 --- a/libs/openengine/bullet/BtOgreGP.h +++ b/libs/openengine/bullet/BtOgreGP.h @@ -19,7 +19,10 @@ #include "btBulletDynamicsCommon.h" #include "BtOgreExtras.h" -#include "Ogre.h" + +#include +#include +#include namespace BtOgre { diff --git a/libs/openengine/bullet/pmove.h b/libs/openengine/bullet/pmove.h index 6cedd3599..0fdb8f0d8 100644 --- a/libs/openengine/bullet/pmove.h +++ b/libs/openengine/bullet/pmove.h @@ -6,12 +6,12 @@ which was released under the GNU GPL (v2) in 2005. Quake 3 Arena is copyright (C) 1999-2005 Id Software, Inc. */ -#include #include #include #include "trace.h" #include "physic.hpp" +#include //#include "GameMath.h" //#include "GameTime.h" @@ -154,7 +154,7 @@ struct playerMove KEYUP }; - playercmd() : forwardmove(0), rightmove(0), upmove(0), serverTime(50), ducking(false), + playercmd() : forwardmove(0), rightmove(0), upmove(0), serverTime(50), ducking(false), activating(false), lastActivatingState(false), procActivating(NO_CHANGE), dropping(false), lastDroppingState(false), procDropping(NO_CHANGE) {