From 16ff2a7a1b35a9d7d8de1db60324f3097fda417a Mon Sep 17 00:00:00 2001 From: Jason Hooks Date: Thu, 24 Nov 2011 01:48:54 -0500 Subject: [PATCH] Changing to Actors;NPCAnimation;CreatureAnimation --- apps/openmw/CMakeLists.txt | 2 +- apps/openmw/mwclass/creature.hpp | 2 +- apps/openmw/mwclass/npc.hpp | 2 +- apps/openmw/mwrender/actors.hpp | 23 +++++++++++++++++++++ apps/openmw/mwrender/animation.cpp | 0 apps/openmw/mwrender/animation.hpp | 10 +++++++++ apps/openmw/mwrender/creatureanimation.cpp | 0 apps/openmw/mwrender/creatureanimation.hpp | 12 +++++++++++ apps/openmw/mwrender/creatures.cpp | 2 -- apps/openmw/mwrender/creatures.hpp | 10 --------- apps/openmw/mwrender/npcanimation.cpp | 0 apps/openmw/mwrender/npcanimation.hpp | 12 +++++++++++ apps/openmw/mwrender/npcs.cpp | 2 -- apps/openmw/mwrender/npcs.hpp | 9 -------- apps/openmw/mwrender/renderinginterface.hpp | 7 +++---- apps/openmw/mwrender/renderingmanager.cpp | 11 +++++----- apps/openmw/mwrender/renderingmanager.hpp | 12 +++++------ 17 files changed, 74 insertions(+), 42 deletions(-) create mode 100644 apps/openmw/mwrender/actors.hpp create mode 100644 apps/openmw/mwrender/animation.cpp create mode 100644 apps/openmw/mwrender/animation.hpp create mode 100644 apps/openmw/mwrender/creatureanimation.cpp create mode 100644 apps/openmw/mwrender/creatureanimation.hpp delete mode 100644 apps/openmw/mwrender/creatures.cpp delete mode 100644 apps/openmw/mwrender/creatures.hpp create mode 100644 apps/openmw/mwrender/npcanimation.cpp create mode 100644 apps/openmw/mwrender/npcanimation.hpp delete mode 100644 apps/openmw/mwrender/npcs.cpp delete mode 100644 apps/openmw/mwrender/npcs.hpp diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index b3bd51e20..aae2251a1 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -16,7 +16,7 @@ set(GAME_HEADER source_group(game FILES ${GAME} ${GAME_HEADER}) add_openmw_dir (mwrender - renderingmanager debugging sky player npcs creatures objects renderinginterface + renderingmanager debugging sky player animation npcanimation creatureanimation actors objects renderinginterface ) add_openmw_dir (mwinput diff --git a/apps/openmw/mwclass/creature.hpp b/apps/openmw/mwclass/creature.hpp index f74cdf991..46f83ff0c 100644 --- a/apps/openmw/mwclass/creature.hpp +++ b/apps/openmw/mwclass/creature.hpp @@ -2,7 +2,7 @@ #define GAME_MWCLASS_CREATURE_H #include "../mwworld/class.hpp" -#include "../mwrender/creatures.hpp" + namespace MWClass { diff --git a/apps/openmw/mwclass/npc.hpp b/apps/openmw/mwclass/npc.hpp index 271d66392..cc9dbef7f 100644 --- a/apps/openmw/mwclass/npc.hpp +++ b/apps/openmw/mwclass/npc.hpp @@ -2,7 +2,7 @@ #define GAME_MWCLASS_NPC_H #include "../mwworld/class.hpp" -#include "../mwrender/npcs.hpp" + namespace MWClass { diff --git a/apps/openmw/mwrender/actors.hpp b/apps/openmw/mwrender/actors.hpp new file mode 100644 index 000000000..86be6d140 --- /dev/null +++ b/apps/openmw/mwrender/actors.hpp @@ -0,0 +1,23 @@ +#ifndef _GAME_RENDER_ACTORS_H +#define _GAME_RENDER_ACTORS_H + +#include "components/esm_store/cell_store.hpp" + +#include "../mwworld/refdata.hpp" +#include "../mwworld/ptr.hpp" +#include +namespace MWRender{ + class Actors{ + OEngine::Render::OgreRenderer &mRend; + std::map mCellSceneNodes; + std::map mSG; + Ogre::SceneNode* mMwRoot; + bool isStatic; + static int uniqueID; + + public: + Actors(OEngine::Render::OgreRenderer& _rend): mRend(_rend){} + ~Actors(){} + }; +} +#endif \ No newline at end of file diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/apps/openmw/mwrender/animation.hpp b/apps/openmw/mwrender/animation.hpp new file mode 100644 index 000000000..cb922d7f3 --- /dev/null +++ b/apps/openmw/mwrender/animation.hpp @@ -0,0 +1,10 @@ +#ifndef _GAME_RENDER_ANIMATION_H +#define _GAME_RENDER_ANIMATION_H +#include +namespace MWRender{ +class Animation{ + std::vector transformations; + std::map textmappings; +}; +} +#endif \ No newline at end of file diff --git a/apps/openmw/mwrender/creatureanimation.cpp b/apps/openmw/mwrender/creatureanimation.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/apps/openmw/mwrender/creatureanimation.hpp b/apps/openmw/mwrender/creatureanimation.hpp new file mode 100644 index 000000000..2bad5f769 --- /dev/null +++ b/apps/openmw/mwrender/creatureanimation.hpp @@ -0,0 +1,12 @@ +#ifndef _GAME_RENDER_CREATUREANIMATION_H +#define _GAME_RENDER_CREATUREANIMATION_H + +#include "animation.hpp" +#include +namespace MWRender{ + +class CreatureAnimation: Animation{ + std::vector shapes; //All the NiTriShapeData for this creature +}; +} +#endif \ No newline at end of file diff --git a/apps/openmw/mwrender/creatures.cpp b/apps/openmw/mwrender/creatures.cpp deleted file mode 100644 index 998951249..000000000 --- a/apps/openmw/mwrender/creatures.cpp +++ /dev/null @@ -1,2 +0,0 @@ -#include "creatures.hpp" -using namespace MWRender; \ No newline at end of file diff --git a/apps/openmw/mwrender/creatures.hpp b/apps/openmw/mwrender/creatures.hpp deleted file mode 100644 index 9aabb175b..000000000 --- a/apps/openmw/mwrender/creatures.hpp +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef _GAME_RENDER_CREATURES_H -#define _GAME_RENDER_CREATURES_H -#include - -namespace MWRender{ -class Creatures{ - -}; -} -#endif \ No newline at end of file diff --git a/apps/openmw/mwrender/npcanimation.cpp b/apps/openmw/mwrender/npcanimation.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/apps/openmw/mwrender/npcanimation.hpp b/apps/openmw/mwrender/npcanimation.hpp new file mode 100644 index 000000000..9358e2c0a --- /dev/null +++ b/apps/openmw/mwrender/npcanimation.hpp @@ -0,0 +1,12 @@ +#ifndef _GAME_RENDER_NPCANIMATION_H +#define _GAME_RENDER_NPCANIMATION_H +#include "animation.hpp" +#include +#include +namespace MWRender{ + +class NpcAnimation: Animation{ + std::vector> shapeparts; //All the NiTriShape data that we need for animating this particular npc +}; +} +#endif \ No newline at end of file diff --git a/apps/openmw/mwrender/npcs.cpp b/apps/openmw/mwrender/npcs.cpp deleted file mode 100644 index 7012ccb18..000000000 --- a/apps/openmw/mwrender/npcs.cpp +++ /dev/null @@ -1,2 +0,0 @@ -#include "npcs.hpp" -using namespace MWRender; diff --git a/apps/openmw/mwrender/npcs.hpp b/apps/openmw/mwrender/npcs.hpp deleted file mode 100644 index 88ee5ca30..000000000 --- a/apps/openmw/mwrender/npcs.hpp +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _GAME_RENDER_NPCS_H -#define _GAME_RENDER_NPCS_H -#include -namespace MWRender{ -class Npcs{ - -}; -} -#endif diff --git a/apps/openmw/mwrender/renderinginterface.hpp b/apps/openmw/mwrender/renderinginterface.hpp index ebd4af2bd..03935bef6 100644 --- a/apps/openmw/mwrender/renderinginterface.hpp +++ b/apps/openmw/mwrender/renderinginterface.hpp @@ -1,16 +1,15 @@ #ifndef _GAME_RENDERING_INTERFACE_H #define _GAME_RENDERING_INTERFACE_H namespace MWRender{ - class Npcs; - class Creatures; class Objects; + class Actors; class Player; + class RenderingInterface{ public: - virtual MWRender::Npcs& getNPCs() = 0; - virtual MWRender::Creatures& getCreatures() = 0; virtual MWRender::Objects& getObjects() = 0; virtual MWRender::Player& getPlayer() = 0; + virtual MWRender::Actors& getActors() = 0; virtual ~RenderingInterface(){}; }; } diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index 878a76b3d..aee08bd0b 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -22,7 +22,7 @@ namespace MWRender { RenderingManager::RenderingManager (OEngine::Render::OgreRenderer& _rend, const boost::filesystem::path& resDir, OEngine::Physic::PhysicEngine* engine) -:mRendering(_rend), mObjects(mRendering), mDebugging(engine) +:mRendering(_rend), mObjects(mRendering), mDebugging(engine), mActors(mRendering) { mRendering.createScene("PlayerCam", 55, 5); mSkyManager = MWRender::SkyManager::create(mRendering.getWindow(), mRendering.getCamera(), resDir); @@ -61,15 +61,14 @@ RenderingManager::~RenderingManager () delete mSkyManager; } -MWRender::Npcs& RenderingManager::getNPCs(){ - return mNpcs; -} + MWRender::Objects& RenderingManager::getObjects(){ return mObjects; } -MWRender::Creatures& RenderingManager::getCreatures(){ - return mCreatures; +MWRender::Actors& RenderingManager::getActors(){ + return mActors; } + MWRender::Player& RenderingManager::getPlayer(){ return (*mPlayer); } diff --git a/apps/openmw/mwrender/renderingmanager.hpp b/apps/openmw/mwrender/renderingmanager.hpp index f212b4289..5189db870 100644 --- a/apps/openmw/mwrender/renderingmanager.hpp +++ b/apps/openmw/mwrender/renderingmanager.hpp @@ -19,9 +19,9 @@ #include #include "renderinginterface.hpp" -#include "npcs.hpp" -#include "creatures.hpp" + #include "objects.hpp" +#include "actors.hpp" #include "player.hpp" namespace Ogre @@ -49,9 +49,9 @@ class RenderingManager: private RenderingInterface { private: - virtual MWRender::Npcs& getNPCs(); - virtual MWRender::Creatures& getCreatures(); + virtual MWRender::Objects& getObjects(); + virtual MWRender::Actors& getActors(); public: RenderingManager(OEngine::Render::OgreRenderer& _rend, const boost::filesystem::path& resDir, OEngine::Physic::PhysicEngine* engine); @@ -110,9 +110,9 @@ class RenderingManager: private RenderingInterface { void setAmbientMode(); SkyManager* mSkyManager; OEngine::Render::OgreRenderer &mRendering; - MWRender::Npcs mNpcs; - MWRender::Creatures mCreatures; + MWRender::Objects mObjects; + MWRender::Actors mActors; // 0 normal, 1 more bright, 2 max int mAmbientMode;