From e330c22d68ab8f850a00e1b8a3a299595ccce775 Mon Sep 17 00:00:00 2001 From: Jason Hooks Date: Sun, 19 Feb 2012 02:04:47 -0500 Subject: [PATCH] Removing unneeded files --- apps/openmw/class2/activator.cpp | 66 ------ apps/openmw/class2/activator.hpp | 28 --- apps/openmw/class2/apparatus.cpp | 81 -------- apps/openmw/class2/apparatus.hpp | 37 ---- apps/openmw/class2/armor.cpp | 93 --------- apps/openmw/class2/armor.hpp | 43 ---- apps/openmw/class2/book.cpp | 83 -------- apps/openmw/class2/book.hpp | 37 ---- apps/openmw/class2/classes.cpp | 50 ----- apps/openmw/class2/classes.hpp | 10 - apps/openmw/class2/clothing.cpp | 81 -------- apps/openmw/class2/clothing.hpp | 37 ---- apps/openmw/class2/container.cpp | 80 ------- apps/openmw/class2/container.hpp | 33 --- apps/openmw/class2/containerutil.hpp | 28 --- apps/openmw/class2/creature.cpp | 138 ------------- apps/openmw/class2/creature.hpp | 51 ----- apps/openmw/class2/creaturelevlist.cpp | 19 -- apps/openmw/class2/creaturelevlist.hpp | 20 -- apps/openmw/class2/door.cpp | 129 ------------ apps/openmw/class2/door.hpp | 39 ---- apps/openmw/class2/ingredient.cpp | 82 -------- apps/openmw/class2/ingredient.hpp | 37 ---- apps/openmw/class2/itemlevlist.cpp | 19 -- apps/openmw/class2/itemlevlist.hpp | 20 -- apps/openmw/class2/light.cpp | 110 ---------- apps/openmw/class2/light.hpp | 42 ---- apps/openmw/class2/lockpick.cpp | 81 -------- apps/openmw/class2/lockpick.hpp | 37 ---- apps/openmw/class2/misc.cpp | 80 ------- apps/openmw/class2/misc.hpp | 37 ---- apps/openmw/class2/npc.cpp | 276 ------------------------- apps/openmw/class2/npc.hpp | 72 ------- apps/openmw/class2/potion.cpp | 81 -------- apps/openmw/class2/potion.hpp | 37 ---- apps/openmw/class2/probe.cpp | 81 -------- apps/openmw/class2/probe.hpp | 37 ---- apps/openmw/class2/repair.cpp | 80 ------- apps/openmw/class2/repair.hpp | 37 ---- apps/openmw/class2/static.cpp | 52 ----- apps/openmw/class2/static.hpp | 26 --- apps/openmw/class2/weapon.cpp | 94 --------- apps/openmw/class2/weapon.hpp | 43 ---- 43 files changed, 2644 deletions(-) delete mode 100644 apps/openmw/class2/activator.cpp delete mode 100644 apps/openmw/class2/activator.hpp delete mode 100644 apps/openmw/class2/apparatus.cpp delete mode 100644 apps/openmw/class2/apparatus.hpp delete mode 100644 apps/openmw/class2/armor.cpp delete mode 100644 apps/openmw/class2/armor.hpp delete mode 100644 apps/openmw/class2/book.cpp delete mode 100644 apps/openmw/class2/book.hpp delete mode 100644 apps/openmw/class2/classes.cpp delete mode 100644 apps/openmw/class2/classes.hpp delete mode 100644 apps/openmw/class2/clothing.cpp delete mode 100644 apps/openmw/class2/clothing.hpp delete mode 100644 apps/openmw/class2/container.cpp delete mode 100644 apps/openmw/class2/container.hpp delete mode 100644 apps/openmw/class2/containerutil.hpp delete mode 100644 apps/openmw/class2/creature.cpp delete mode 100644 apps/openmw/class2/creature.hpp delete mode 100644 apps/openmw/class2/creaturelevlist.cpp delete mode 100644 apps/openmw/class2/creaturelevlist.hpp delete mode 100644 apps/openmw/class2/door.cpp delete mode 100644 apps/openmw/class2/door.hpp delete mode 100644 apps/openmw/class2/ingredient.cpp delete mode 100644 apps/openmw/class2/ingredient.hpp delete mode 100644 apps/openmw/class2/itemlevlist.cpp delete mode 100644 apps/openmw/class2/itemlevlist.hpp delete mode 100644 apps/openmw/class2/light.cpp delete mode 100644 apps/openmw/class2/light.hpp delete mode 100644 apps/openmw/class2/lockpick.cpp delete mode 100644 apps/openmw/class2/lockpick.hpp delete mode 100644 apps/openmw/class2/misc.cpp delete mode 100644 apps/openmw/class2/misc.hpp delete mode 100644 apps/openmw/class2/npc.cpp delete mode 100644 apps/openmw/class2/npc.hpp delete mode 100644 apps/openmw/class2/potion.cpp delete mode 100644 apps/openmw/class2/potion.hpp delete mode 100644 apps/openmw/class2/probe.cpp delete mode 100644 apps/openmw/class2/probe.hpp delete mode 100644 apps/openmw/class2/repair.cpp delete mode 100644 apps/openmw/class2/repair.hpp delete mode 100644 apps/openmw/class2/static.cpp delete mode 100644 apps/openmw/class2/static.hpp delete mode 100644 apps/openmw/class2/weapon.cpp delete mode 100644 apps/openmw/class2/weapon.hpp diff --git a/apps/openmw/class2/activator.cpp b/apps/openmw/class2/activator.cpp deleted file mode 100644 index 086cb433dd..0000000000 --- a/apps/openmw/class2/activator.cpp +++ /dev/null @@ -1,66 +0,0 @@ - -#include "activator.hpp" -#include "../mwrender/objects.hpp" - -#include - -#include - -#include "../mwworld/ptr.hpp" - - -namespace MWClass -{ - void Activator::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - assert (ref->base != NULL); - const std::string &model = ref->base->model; - - if (!model.empty()) - { - MWRender::Objects& objects = renderingInterface.getObjects(); - objects.insertBegin(ptr, ptr.getRefData().isEnabled(), true); - objects.insertMesh(ptr, "meshes\\" + model); - } - } - - void Activator::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - - const std::string &model = ref->base->model; - assert (ref->base != NULL); - if(!model.empty()){ - physics.insertObjectPhysics(ptr, "meshes\\" + model); - } - - } - - std::string Activator::getName (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->name; - } - - std::string Activator::getScript (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->script; - } - - void Activator::registerSelf() - { - boost::shared_ptr instance (new Activator); - - registerClass (typeid (ESM::Activator).name(), instance); - } -} diff --git a/apps/openmw/class2/activator.hpp b/apps/openmw/class2/activator.hpp deleted file mode 100644 index 08be8a5ff1..0000000000 --- a/apps/openmw/class2/activator.hpp +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef GAME_MWCLASS_ACTIVATOR_H -#define GAME_MWCLASS_ACTIVATOR_H - -#include "../mwworld/class.hpp" - -namespace MWClass -{ - class Activator : public MWWorld::Class - { - public: - - virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const; - ///< Add reference into a cell for rendering - - virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const; - - virtual std::string getName (const MWWorld::Ptr& ptr) const; - ///< \return name (the one that is to be presented to the user; not the internal one); - /// can return an empty string. - - virtual std::string getScript (const MWWorld::Ptr& ptr) const; - ///< Return name of the script attached to ptr - - static void registerSelf(); - }; -} - -#endif diff --git a/apps/openmw/class2/apparatus.cpp b/apps/openmw/class2/apparatus.cpp deleted file mode 100644 index 4c5ba07219..0000000000 --- a/apps/openmw/class2/apparatus.cpp +++ /dev/null @@ -1,81 +0,0 @@ - -#include "apparatus.hpp" - -#include - -#include - -#include "../mwworld/ptr.hpp" -#include "../mwworld/actiontake.hpp" - - -#include "containerutil.hpp" - -namespace MWClass -{ - void Apparatus::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - assert (ref->base != NULL); - const std::string &model = ref->base->model; - - if (!model.empty()) - { - MWRender::Objects& objects = renderingInterface.getObjects(); - objects.insertBegin(ptr, ptr.getRefData().isEnabled(), true); - objects.insertMesh(ptr, "meshes\\" + model); - } - } - - void Apparatus::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - - const std::string &model = ref->base->model; - assert (ref->base != NULL); - if(!model.empty()){ - physics.insertObjectPhysics(ptr, "meshes\\" + model); - } - - } - - std::string Apparatus::getName (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->name; - } - - boost::shared_ptr Apparatus::activate (const MWWorld::Ptr& ptr, - const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const - { - return boost::shared_ptr ( - new MWWorld::ActionTake (ptr)); - } - - void Apparatus::insertIntoContainer (const MWWorld::Ptr& ptr, - MWWorld::ContainerStore& containerStore) const - { - insertIntoContainerStore (ptr, containerStore.appas); - } - - std::string Apparatus::getScript (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->script; - } - - void Apparatus::registerSelf() - { - boost::shared_ptr instance (new Apparatus); - - registerClass (typeid (ESM::Apparatus).name(), instance); - } -} diff --git a/apps/openmw/class2/apparatus.hpp b/apps/openmw/class2/apparatus.hpp deleted file mode 100644 index 4c8a2c0e2d..0000000000 --- a/apps/openmw/class2/apparatus.hpp +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef GAME_MWCLASS_APPARATUS_H -#define GAME_MWCLASS_APPARATUS_H - -#include "../mwworld/class.hpp" -#include "../mwrender/objects.hpp" - -namespace MWClass -{ - class Apparatus : public MWWorld::Class - { - public: - - virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const; - ///< Add reference into a cell for rendering - - virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const; - - virtual std::string getName (const MWWorld::Ptr& ptr) const; - ///< \return name (the one that is to be presented to the user; not the internal one); - /// can return an empty string. - - virtual boost::shared_ptr activate (const MWWorld::Ptr& ptr, - const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const; - ///< Generate action for activation - - virtual void insertIntoContainer (const MWWorld::Ptr& ptr, - MWWorld::ContainerStore& containerStore) const; - ///< Insert into a containe - - virtual std::string getScript (const MWWorld::Ptr& ptr) const; - ///< Return name of the script attached to ptr - - static void registerSelf(); - }; -} - -#endif diff --git a/apps/openmw/class2/armor.cpp b/apps/openmw/class2/armor.cpp deleted file mode 100644 index 2ad1dbfa25..0000000000 --- a/apps/openmw/class2/armor.cpp +++ /dev/null @@ -1,93 +0,0 @@ - -#include "armor.hpp" - -#include - -#include - -#include "../mwworld/ptr.hpp" -#include "../mwworld/actiontake.hpp" - - -#include "containerutil.hpp" - -namespace MWClass -{ - void Armor::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - assert (ref->base != NULL); - const std::string &model = ref->base->model; - - if (!model.empty()) - { - MWRender::Objects& objects = renderingInterface.getObjects(); - objects.insertBegin(ptr, ptr.getRefData().isEnabled(), true); - objects.insertMesh(ptr, "meshes\\" + model); - } - } - - void Armor::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - const std::string &model = ref->base->model; - assert (ref->base != NULL); - if(!model.empty()){ - physics.insertObjectPhysics(ptr, "meshes\\" + model); - } - - } - - std::string Armor::getName (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->name; - } - - boost::shared_ptr Armor::activate (const MWWorld::Ptr& ptr, - const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const - { - return boost::shared_ptr ( - new MWWorld::ActionTake (ptr)); - } - - bool Armor::hasItemHealth (const MWWorld::Ptr& ptr) const - { - return true; - } - - int Armor::getItemMaxHealth (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->data.health; - } - - void Armor::insertIntoContainer (const MWWorld::Ptr& ptr, - MWWorld::ContainerStore& containerStore) const - { - insertIntoContainerStore (ptr, containerStore.armors); - } - - std::string Armor::getScript (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->script; - } - - void Armor::registerSelf() - { - boost::shared_ptr instance (new Armor); - - registerClass (typeid (ESM::Armor).name(), instance); - } -} diff --git a/apps/openmw/class2/armor.hpp b/apps/openmw/class2/armor.hpp deleted file mode 100644 index c5f9812b79..0000000000 --- a/apps/openmw/class2/armor.hpp +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef GAME_MWCLASS_ARMOR_H -#define GAME_MWCLASS_ARMOR_H - -#include "../mwworld/class.hpp" -#include "../mwrender/objects.hpp" - -namespace MWClass -{ - class Armor : public MWWorld::Class - { - public: - - virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const; - ///< Add reference into a cell for rendering - - virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const; - - virtual std::string getName (const MWWorld::Ptr& ptr) const; - ///< \return name (the one that is to be presented to the user; not the internal one); - /// can return an empty string. - - virtual boost::shared_ptr activate (const MWWorld::Ptr& ptr, - const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const; - ///< Generate action for activation - - virtual bool hasItemHealth (const MWWorld::Ptr& ptr) const; - ///< \return Item health data available? - - virtual int getItemMaxHealth (const MWWorld::Ptr& ptr) const; - ///< Return item max health or throw an exception, if class does not have item health - - virtual void insertIntoContainer (const MWWorld::Ptr& ptr, - MWWorld::ContainerStore& containerStore) const; - ///< Insert into a containe - - virtual std::string getScript (const MWWorld::Ptr& ptr) const; - ///< Return name of the script attached to ptr - - static void registerSelf(); - }; -} - -#endif diff --git a/apps/openmw/class2/book.cpp b/apps/openmw/class2/book.cpp deleted file mode 100644 index 5c0d8767a0..0000000000 --- a/apps/openmw/class2/book.cpp +++ /dev/null @@ -1,83 +0,0 @@ - -#include "book.hpp" - -#include - -#include - -#include "../mwworld/ptr.hpp" -#include "../mwworld/actiontake.hpp" - - -#include "containerutil.hpp" - -namespace MWClass -{ - void Book::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - assert (ref->base != NULL); - const std::string &model = ref->base->model; - - if (!model.empty()) - { - MWRender::Objects& objects = renderingInterface.getObjects(); - objects.insertBegin(ptr, ptr.getRefData().isEnabled(), true); - objects.insertMesh(ptr, "meshes\\" + model); - } - } - - void Book::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - - const std::string &model = ref->base->model; - assert (ref->base != NULL); - if(!model.empty()){ - physics.insertObjectPhysics(ptr, "meshes\\" + model); - } - - } - - std::string Book::getName (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->name; - } - - boost::shared_ptr Book::activate (const MWWorld::Ptr& ptr, - const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const - { - // TODO implement reading - - return boost::shared_ptr ( - new MWWorld::ActionTake (ptr)); - } - - void Book::insertIntoContainer (const MWWorld::Ptr& ptr, - MWWorld::ContainerStore& containerStore) const - { - insertIntoContainerStore (ptr, containerStore.books); - } - - std::string Book::getScript (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->script; - } - - void Book::registerSelf() - { - boost::shared_ptr instance (new Book); - - registerClass (typeid (ESM::Book).name(), instance); - } -} diff --git a/apps/openmw/class2/book.hpp b/apps/openmw/class2/book.hpp deleted file mode 100644 index f0e38cceba..0000000000 --- a/apps/openmw/class2/book.hpp +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef GAME_MWCLASS_BOOK_H -#define GAME_MWCLASS_BOOK_H - -#include "../mwworld/class.hpp" -#include "../mwrender/objects.hpp" - -namespace MWClass -{ - class Book : public MWWorld::Class - { - public: - - virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const; - ///< Add reference into a cell for rendering - - virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const; - - virtual std::string getName (const MWWorld::Ptr& ptr) const; - ///< \return name (the one that is to be presented to the user; not the internal one); - /// can return an empty string. - - virtual boost::shared_ptr activate (const MWWorld::Ptr& ptr, - const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const; - ///< Generate action for activation - - virtual void insertIntoContainer (const MWWorld::Ptr& ptr, - MWWorld::ContainerStore& containerStore) const; - ///< Insert into a containe - - virtual std::string getScript (const MWWorld::Ptr& ptr) const; - ///< Return name of the script attached to ptr - - static void registerSelf(); - }; -} - -#endif diff --git a/apps/openmw/class2/classes.cpp b/apps/openmw/class2/classes.cpp deleted file mode 100644 index e9538a6cb4..0000000000 --- a/apps/openmw/class2/classes.cpp +++ /dev/null @@ -1,50 +0,0 @@ - -#include "classes.hpp" - -#include "activator.hpp" -#include "creature.hpp" -#include "npc.hpp" -#include "weapon.hpp" -#include "armor.hpp" -#include "potion.hpp" -#include "apparatus.hpp" -#include "book.hpp" -#include "clothing.hpp" -#include "container.hpp" -#include "door.hpp" -#include "ingredient.hpp" -#include "creaturelevlist.hpp" -#include "itemlevlist.hpp" -#include "light.hpp" -#include "lockpick.hpp" -#include "misc.hpp" -#include "probe.hpp" -#include "repair.hpp" -#include "static.hpp" - -namespace MWClass -{ - void registerClasses() - { - Activator::registerSelf(); - Creature::registerSelf(); - Npc::registerSelf(); - Weapon::registerSelf(); - Armor::registerSelf(); - Potion::registerSelf(); - Apparatus::registerSelf(); - Book::registerSelf(); - Clothing::registerSelf(); - Container::registerSelf(); - Door::registerSelf(); - Ingredient::registerSelf(); - CreatureLevList::registerSelf(); - ItemLevList::registerSelf(); - Light::registerSelf(); - Lockpick::registerSelf(); - Miscellaneous::registerSelf(); - Probe::registerSelf(); - Repair::registerSelf(); - Static::registerSelf(); - } -} diff --git a/apps/openmw/class2/classes.hpp b/apps/openmw/class2/classes.hpp deleted file mode 100644 index 0ab90b677b..0000000000 --- a/apps/openmw/class2/classes.hpp +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef GAME_MWCLASS_CLASSES_H -#define GAME_MWCLASS_CLASSES_H - -namespace MWClass -{ - void registerClasses(); - ///< register all known classes -} - -#endif diff --git a/apps/openmw/class2/clothing.cpp b/apps/openmw/class2/clothing.cpp deleted file mode 100644 index b81a181f4b..0000000000 --- a/apps/openmw/class2/clothing.cpp +++ /dev/null @@ -1,81 +0,0 @@ - -#include "clothing.hpp" - -#include - -#include - -#include "../mwworld/ptr.hpp" -#include "../mwworld/actiontake.hpp" - - -#include "containerutil.hpp" - -namespace MWClass -{ - void Clothing::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - assert (ref->base != NULL); - const std::string &model = ref->base->model; - - if (!model.empty()) - { - MWRender::Objects& objects = renderingInterface.getObjects(); - objects.insertBegin(ptr, ptr.getRefData().isEnabled(), true); - objects.insertMesh(ptr, "meshes\\" + model); - } - } - - void Clothing::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - - const std::string &model = ref->base->model; - assert (ref->base != NULL); - if(!model.empty()){ - physics.insertObjectPhysics(ptr, "meshes\\" + model); - } - - } - - std::string Clothing::getName (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->name; - } - - boost::shared_ptr Clothing::activate (const MWWorld::Ptr& ptr, - const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const - { - return boost::shared_ptr ( - new MWWorld::ActionTake (ptr)); - } - - void Clothing::insertIntoContainer (const MWWorld::Ptr& ptr, - MWWorld::ContainerStore& containerStore) const - { - insertIntoContainerStore (ptr, containerStore.clothes); - } - - std::string Clothing::getScript (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->script; - } - - void Clothing::registerSelf() - { - boost::shared_ptr instance (new Clothing); - - registerClass (typeid (ESM::Clothing).name(), instance); - } -} diff --git a/apps/openmw/class2/clothing.hpp b/apps/openmw/class2/clothing.hpp deleted file mode 100644 index 76c2c4a3e4..0000000000 --- a/apps/openmw/class2/clothing.hpp +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef GAME_MWCLASS_CLOTHING_H -#define GAME_MWCLASS_CLOTHING_H - -#include "../mwworld/class.hpp" -#include "../mwrender/objects.hpp" - -namespace MWClass -{ - class Clothing : public MWWorld::Class - { - public: - - virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const; - ///< Add reference into a cell for rendering - - virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const; - - virtual std::string getName (const MWWorld::Ptr& ptr) const; - ///< \return name (the one that is to be presented to the user; not the internal one); - /// can return an empty string. - - virtual boost::shared_ptr activate (const MWWorld::Ptr& ptr, - const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const; - ///< Generate action for activation - - virtual void insertIntoContainer (const MWWorld::Ptr& ptr, - MWWorld::ContainerStore& containerStore) const; - ///< Insert into a containe - - virtual std::string getScript (const MWWorld::Ptr& ptr) const; - ///< Return name of the script attached to ptr - - static void registerSelf(); - }; -} - -#endif diff --git a/apps/openmw/class2/container.cpp b/apps/openmw/class2/container.cpp deleted file mode 100644 index fff3a9bda7..0000000000 --- a/apps/openmw/class2/container.cpp +++ /dev/null @@ -1,80 +0,0 @@ - -#include "container.hpp" - -#include - -#include - -#include "../mwworld/ptr.hpp" - -namespace MWClass -{ - void Container::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - assert (ref->base != NULL); - const std::string &model = ref->base->model; - - if (!model.empty()) - { - MWRender::Objects& objects = renderingInterface.getObjects(); - objects.insertBegin(ptr, ptr.getRefData().isEnabled(), true); - objects.insertMesh(ptr, "meshes\\" + model); - } - } - - void Container::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - - const std::string &model = ref->base->model; - assert (ref->base != NULL); - if(!model.empty()){ - physics.insertObjectPhysics(ptr, "meshes\\" + model); - } - - } - - std::string Container::getName (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->name; - } - - MWWorld::ContainerStore& Container::getContainerStore (const MWWorld::Ptr& ptr) - const - { - if (!ptr.getRefData().getContainerStore().get()) - { - boost::shared_ptr > store ( - new MWWorld::ContainerStore); - - // TODO add initial content - - ptr.getRefData().getContainerStore() = store; - } - - return *ptr.getRefData().getContainerStore(); - } - - std::string Container::getScript (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->script; - } - - void Container::registerSelf() - { - boost::shared_ptr instance (new Container); - - registerClass (typeid (ESM::Container).name(), instance); - } -} diff --git a/apps/openmw/class2/container.hpp b/apps/openmw/class2/container.hpp deleted file mode 100644 index 01763870ad..0000000000 --- a/apps/openmw/class2/container.hpp +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef GAME_MWCLASS_CONTAINER_H -#define GAME_MWCLASS_CONTAINER_H - -#include "../mwworld/class.hpp" -#include "../mwrender/objects.hpp" - -namespace MWClass -{ - class Container : public MWWorld::Class - { - public: - - virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const; - ///< Add reference into a cell for rendering - - virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const; - - virtual std::string getName (const MWWorld::Ptr& ptr) const; - ///< \return name (the one that is to be presented to the user; not the internal one); - /// can return an empty string. - - virtual MWWorld::ContainerStore& getContainerStore ( - const MWWorld::Ptr& ptr) const; - ///< Return container store - - virtual std::string getScript (const MWWorld::Ptr& ptr) const; - ///< Return name of the script attached to ptr - - static void registerSelf(); - }; -} - -#endif diff --git a/apps/openmw/class2/containerutil.hpp b/apps/openmw/class2/containerutil.hpp deleted file mode 100644 index 76bdf02361..0000000000 --- a/apps/openmw/class2/containerutil.hpp +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef GAME_MWCLASS_CONTAINERUTIL_H -#define GAME_MWCLASS_CONTAINERUTIL_H - -#include - -#include "../mwworld/ptr.hpp" -#include "../mwworld/containerstore.hpp" - -namespace MWClass -{ - template - void insertIntoContainerStore (const MWWorld::Ptr& ptr, - ESMS::CellRefList& containerStore) - { - if (!ptr.isEmpty()) - { - // TODO check stacking - - ESMS::LiveCellRef cellRef(ptr.getCellRef(), ptr.get()->base); - cellRef.mData = ptr.getRefData(); - - containerStore.list.push_back (cellRef); - - } - } -} - -#endif diff --git a/apps/openmw/class2/creature.cpp b/apps/openmw/class2/creature.cpp deleted file mode 100644 index 5aa203a49a..0000000000 --- a/apps/openmw/class2/creature.cpp +++ /dev/null @@ -1,138 +0,0 @@ - -#include "creature.hpp" - -#include - -#include "../mwmechanics/creaturestats.hpp" - -#include "../mwworld/ptr.hpp" -#include "../mwworld/actiontalk.hpp" -#include "../mwworld/environment.hpp" - - -#include "../mwmechanics/mechanicsmanager.hpp" - -namespace MWClass -{ - std::string Creature::getId (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->mId; - } - - void Creature::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const - { - - /*ESMS::LiveCellRef *ref = - ptr.get(); - - assert (ref->base != NULL); - const std::string &model = ref->base->model; - - if (!model.empty()) - {*/ - MWRender::Actors& actors = renderingInterface.getActors(); - actors.insertCreature(ptr); - - } - - void Creature::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - - const std::string &model = ref->base->model; - assert (ref->base != NULL); - if(!model.empty()){ - physics.insertActorPhysics(ptr, "meshes\\" + model); - } - - } - - void Creature::enable (const MWWorld::Ptr& ptr, MWWorld::Environment& environment) const - { - environment.mMechanicsManager->addActor (ptr); - } - - void Creature::disable (const MWWorld::Ptr& ptr, MWWorld::Environment& environment) const - { - environment.mMechanicsManager->removeActor (ptr); - } - - std::string Creature::getName (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->name; - } - - MWMechanics::CreatureStats& Creature::getCreatureStats (const MWWorld::Ptr& ptr) const - { - if (!ptr.getRefData().getCreatureStats().get()) - { - boost::shared_ptr stats ( - new MWMechanics::CreatureStats); - - ESMS::LiveCellRef *ref = ptr.get(); - - stats->mAttributes[0].set (ref->base->data.strength); - stats->mAttributes[1].set (ref->base->data.intelligence); - stats->mAttributes[2].set (ref->base->data.willpower); - stats->mAttributes[3].set (ref->base->data.agility); - stats->mAttributes[4].set (ref->base->data.speed); - stats->mAttributes[5].set (ref->base->data.endurance); - stats->mAttributes[6].set (ref->base->data.personality); - stats->mAttributes[7].set (ref->base->data.luck); - stats->mDynamic[0].set (ref->base->data.health); - stats->mDynamic[1].set (ref->base->data.mana); - stats->mDynamic[2].set (ref->base->data.fatigue); - - stats->mLevel = ref->base->data.level; - - ptr.getRefData().getCreatureStats() = stats; - } - - return *ptr.getRefData().getCreatureStats(); - } - - boost::shared_ptr Creature::activate (const MWWorld::Ptr& ptr, - const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const - { - return boost::shared_ptr (new MWWorld::ActionTalk (ptr)); - } - - MWWorld::ContainerStore& Creature::getContainerStore (const MWWorld::Ptr& ptr) - const - { - if (!ptr.getRefData().getContainerStore().get()) - { - boost::shared_ptr > store ( - new MWWorld::ContainerStore); - - // TODO add initial content - - ptr.getRefData().getContainerStore() = store; - } - - return *ptr.getRefData().getContainerStore(); - } - - std::string Creature::getScript (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->script; - } - - void Creature::registerSelf() - { - boost::shared_ptr instance (new Creature); - - registerClass (typeid (ESM::Creature).name(), instance); - } -} diff --git a/apps/openmw/class2/creature.hpp b/apps/openmw/class2/creature.hpp deleted file mode 100644 index b7b654bc01..0000000000 --- a/apps/openmw/class2/creature.hpp +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef GAME_MWCLASS_CREATURE_H -#define GAME_MWCLASS_CREATURE_H - -#include "../mwworld/class.hpp" -#include "../mwrender/renderinginterface.hpp" -#include "../mwrender/actors.hpp" - - -namespace MWClass -{ - class Creature : public MWWorld::Class - { - public: - - virtual std::string getId (const MWWorld::Ptr& ptr) const; - ///< Return ID of \a ptr - - virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const; - ///< Add reference into a cell for rendering - - virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const; - - virtual void enable (const MWWorld::Ptr& ptr, MWWorld::Environment& environment) const; - ///< Enable reference; only does the non-rendering part - - virtual void disable (const MWWorld::Ptr& ptr, MWWorld::Environment& environment) const; - ///< Enable reference; only does the non-rendering part - - virtual std::string getName (const MWWorld::Ptr& ptr) const; - ///< \return name (the one that is to be presented to the user; not the internal one); - /// can return an empty string. - - virtual MWMechanics::CreatureStats& getCreatureStats (const MWWorld::Ptr& ptr) const; - ///< Return creature stats - - virtual boost::shared_ptr activate (const MWWorld::Ptr& ptr, - const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const; - ///< Generate action for activation - - virtual MWWorld::ContainerStore& getContainerStore ( - const MWWorld::Ptr& ptr) const; - ///< Return container store - - virtual std::string getScript (const MWWorld::Ptr& ptr) const; - ///< Return name of the script attached to ptr - - static void registerSelf(); - }; -} - -#endif diff --git a/apps/openmw/class2/creaturelevlist.cpp b/apps/openmw/class2/creaturelevlist.cpp deleted file mode 100644 index 53dd34bb48..0000000000 --- a/apps/openmw/class2/creaturelevlist.cpp +++ /dev/null @@ -1,19 +0,0 @@ - -#include "creaturelevlist.hpp" - -#include - -namespace MWClass -{ - std::string CreatureLevList::getName (const MWWorld::Ptr& ptr) const - { - return ""; - } - - void CreatureLevList::registerSelf() - { - boost::shared_ptr instance (new CreatureLevList); - - registerClass (typeid (ESM::CreatureLevList).name(), instance); - } -} diff --git a/apps/openmw/class2/creaturelevlist.hpp b/apps/openmw/class2/creaturelevlist.hpp deleted file mode 100644 index 81965efd58..0000000000 --- a/apps/openmw/class2/creaturelevlist.hpp +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef GAME_MWCLASS_CREATURELEVLIST_H -#define GAME_MWCLASS_CREATURELEVLIST_H - -#include "../mwworld/class.hpp" - -namespace MWClass -{ - class CreatureLevList : public MWWorld::Class - { - public: - - virtual std::string getName (const MWWorld::Ptr& ptr) const; - ///< \return name (the one that is to be presented to the user; not the internal one); - /// can return an empty string. - - static void registerSelf(); - }; -} - -#endif diff --git a/apps/openmw/class2/door.cpp b/apps/openmw/class2/door.cpp deleted file mode 100644 index baced8a9cc..0000000000 --- a/apps/openmw/class2/door.cpp +++ /dev/null @@ -1,129 +0,0 @@ - -#include "door.hpp" - -#include - -#include - -#include "../mwworld/player.hpp" -#include "../mwworld/ptr.hpp" -#include "../mwworld/nullaction.hpp" -#include "../mwworld/actionteleport.hpp" -#include "../mwworld/environment.hpp" -#include "../mwworld/world.hpp" - -#include "../mwrender/objects.hpp" - -#include - -namespace MWClass -{ - void Door::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - assert (ref->base != NULL); - const std::string &model = ref->base->model; - - if (!model.empty()) - { - MWRender::Objects& objects = renderingInterface.getObjects(); - objects.insertBegin(ptr, ptr.getRefData().isEnabled(), true); - objects.insertMesh(ptr, "meshes\\" + model); - } - } - - void Door::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - - const std::string &model = ref->base->model; - assert (ref->base != NULL); - if(!model.empty()){ - physics.insertObjectPhysics(ptr, "meshes\\" + model); - } - - } - - std::string Door::getName (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - if (ref->ref.teleport && !ref->ref.destCell.empty()) // TODO doors that lead to exteriors - return ref->ref.destCell; - - return ref->base->name; - } - - boost::shared_ptr Door::activate (const MWWorld::Ptr& ptr, - const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - if (ptr.getCellRef().lockLevel>0) - { - // TODO check for key - // TODO report failure to player (message, sound?). Look up behaviour of original MW. - std::cout << "Locked!" << std::endl; - return boost::shared_ptr (new MWWorld::NullAction); - } - - // TODO check trap - - if (ref->ref.teleport) - { - // teleport door - if (environment.mWorld->getPlayer().getPlayer()==actor) - { - // the player is using the door - return boost::shared_ptr ( - new MWWorld::ActionTeleportPlayer (ref->ref.destCell, ref->ref.doorDest)); - } - else - { - // another NPC or a create is using the door - // TODO return action for teleporting other NPC/creature - return boost::shared_ptr (new MWWorld::NullAction); - } - } - else - { - // animated door - // TODO return action for rotating the door - return boost::shared_ptr (new MWWorld::NullAction); - } - } - - void Door::lock (const MWWorld::Ptr& ptr, int lockLevel) const - { - if (lockLevel<0) - lockLevel = 0; - - ptr.getCellRef().lockLevel = lockLevel; - } - - void Door::unlock (const MWWorld::Ptr& ptr) const - { - ptr.getCellRef().lockLevel = 0; - } - - std::string Door::getScript (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->script; - } - - void Door::registerSelf() - { - boost::shared_ptr instance (new Door); - - registerClass (typeid (ESM::Door).name(), instance); - } -} diff --git a/apps/openmw/class2/door.hpp b/apps/openmw/class2/door.hpp deleted file mode 100644 index c230cf3576..0000000000 --- a/apps/openmw/class2/door.hpp +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef GAME_MWCLASS_DOOR_H -#define GAME_MWCLASS_DOOR_H - -#include "../mwworld/class.hpp" -#include "../mwrender/objects.hpp" - -namespace MWClass -{ - class Door : public MWWorld::Class - { - public: - - virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const; - ///< Add reference into a cell for rendering - - virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const; - - virtual std::string getName (const MWWorld::Ptr& ptr) const; - ///< \return name (the one that is to be presented to the user; not the internal one); - /// can return an empty string. - - virtual boost::shared_ptr activate (const MWWorld::Ptr& ptr, - const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const; - ///< Generate action for activation - - virtual void lock (const MWWorld::Ptr& ptr, int lockLevel) const; - ///< Lock object - - virtual void unlock (const MWWorld::Ptr& ptr) const; - ///< Unlock object - - virtual std::string getScript (const MWWorld::Ptr& ptr) const; - ///< Return name of the script attached to ptr - - static void registerSelf(); - }; -} - -#endif diff --git a/apps/openmw/class2/ingredient.cpp b/apps/openmw/class2/ingredient.cpp deleted file mode 100644 index 42e3d11e49..0000000000 --- a/apps/openmw/class2/ingredient.cpp +++ /dev/null @@ -1,82 +0,0 @@ - -#include "ingredient.hpp" - -#include - -#include - -#include "../mwworld/ptr.hpp" -#include "../mwworld/actiontake.hpp" - - -#include "containerutil.hpp" - -namespace MWClass -{ - void Ingredient::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - assert (ref->base != NULL); - const std::string &model = ref->base->model; - - if (!model.empty()) - { - MWRender::Objects& objects = renderingInterface.getObjects(); - objects.insertBegin(ptr, ptr.getRefData().isEnabled(), true); - objects.insertMesh(ptr, "meshes\\" + model); - } - } - - void Ingredient::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - - - const std::string &model = ref->base->model; - assert (ref->base != NULL); - if(!model.empty()){ - physics.insertObjectPhysics(ptr, "meshes\\" + model); - } - - } - - std::string Ingredient::getName (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->name; - } - - boost::shared_ptr Ingredient::activate (const MWWorld::Ptr& ptr, - const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const - { - return boost::shared_ptr ( - new MWWorld::ActionTake (ptr)); - } - - void Ingredient::insertIntoContainer (const MWWorld::Ptr& ptr, - MWWorld::ContainerStore& containerStore) const - { - insertIntoContainerStore (ptr, containerStore.ingreds); - } - - std::string Ingredient::getScript (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->script; - } - - void Ingredient::registerSelf() - { - boost::shared_ptr instance (new Ingredient); - - registerClass (typeid (ESM::Ingredient).name(), instance); - } -} diff --git a/apps/openmw/class2/ingredient.hpp b/apps/openmw/class2/ingredient.hpp deleted file mode 100644 index 47bd1a9e5c..0000000000 --- a/apps/openmw/class2/ingredient.hpp +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef GAME_MWCLASS_INGREDIENT_H -#define GAME_MWCLASS_INGREDIENT_H - -#include "../mwworld/class.hpp" -#include "../mwrender/objects.hpp" - -namespace MWClass -{ - class Ingredient : public MWWorld::Class - { - public: - - virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const; - ///< Add reference into a cell for rendering - - virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const; - - virtual std::string getName (const MWWorld::Ptr& ptr) const; - ///< \return name (the one that is to be presented to the user; not the internal one); - /// can return an empty string. - - virtual boost::shared_ptr activate (const MWWorld::Ptr& ptr, - const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const; - ///< Generate action for activation - - virtual void insertIntoContainer (const MWWorld::Ptr& ptr, - MWWorld::ContainerStore& containerStore) const; - ///< Insert into a containe - - virtual std::string getScript (const MWWorld::Ptr& ptr) const; - ///< Return name of the script attached to ptr - - static void registerSelf(); - }; -} - -#endif diff --git a/apps/openmw/class2/itemlevlist.cpp b/apps/openmw/class2/itemlevlist.cpp deleted file mode 100644 index 6ed9ab2e53..0000000000 --- a/apps/openmw/class2/itemlevlist.cpp +++ /dev/null @@ -1,19 +0,0 @@ - -#include "itemlevlist.hpp" - -#include - -namespace MWClass -{ - std::string ItemLevList::getName (const MWWorld::Ptr& ptr) const - { - return ""; - } - - void ItemLevList::registerSelf() - { - boost::shared_ptr instance (new ItemLevList); - - registerClass (typeid (ESM::ItemLevList).name(), instance); - } -} diff --git a/apps/openmw/class2/itemlevlist.hpp b/apps/openmw/class2/itemlevlist.hpp deleted file mode 100644 index 0b71b072c8..0000000000 --- a/apps/openmw/class2/itemlevlist.hpp +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef GAME_MWCLASS_ITEMLEVLIST_H -#define GAME_MWCLASS_ITEMLEVLIST_H - -#include "../mwworld/class.hpp" - -namespace MWClass -{ - class ItemLevList : public MWWorld::Class - { - public: - - virtual std::string getName (const MWWorld::Ptr& ptr) const; - ///< \return name (the one that is to be presented to the user; not the internal one); - /// can return an empty string. - - static void registerSelf(); - }; -} - -#endif diff --git a/apps/openmw/class2/light.cpp b/apps/openmw/class2/light.cpp deleted file mode 100644 index a3ceea4a68..0000000000 --- a/apps/openmw/class2/light.cpp +++ /dev/null @@ -1,110 +0,0 @@ - -#include "light.hpp" - -#include - -#include - -#include "../mwworld/ptr.hpp" -#include "../mwworld/actiontake.hpp" -#include "../mwworld/nullaction.hpp" -#include "../mwworld/environment.hpp" - -#include "../mwsound/soundmanager.hpp" - -#include "containerutil.hpp" - -namespace MWClass -{ - void Light::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - assert (ref->base != NULL); - const std::string &model = ref->base->model; - - if (!model.empty()) - { - MWRender::Objects& objects = renderingInterface.getObjects(); - objects.insertBegin(ptr, ptr.getRefData().isEnabled(), true); - objects.insertMesh(ptr, "meshes\\" + model); - const int color = ref->base->data.color; - const float r = ((color >> 0) & 0xFF) / 255.0f; - const float g = ((color >> 8) & 0xFF) / 255.0f; - const float b = ((color >> 16) & 0xFF) / 255.0f; - const float radius = float (ref->base->data.radius); - objects.insertLight (ptr, r, g, b, radius); - } - } - - void Light::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - - const std::string &model = ref->base->model; - assert (ref->base != NULL); - if(!model.empty()){ - physics.insertObjectPhysics(ptr, "meshes\\" + model); - } - - } - - void Light::enable (const MWWorld::Ptr& ptr, MWWorld::Environment& environment) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - if (!ref->base->sound.empty()) - { - environment.mSoundManager->playSound3D (ptr, ref->base->sound, 1.0, 1.0, true); - } - } - - std::string Light::getName (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - if (ref->base->model.empty()) - return ""; - - return ref->base->name; - } - - boost::shared_ptr Light::activate (const MWWorld::Ptr& ptr, - const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - if (!(ref->base->data.flags & ESM::Light::Carry)) - return boost::shared_ptr (new MWWorld::NullAction); - - return boost::shared_ptr ( - new MWWorld::ActionTake (ptr)); - } - - void Light::insertIntoContainer (const MWWorld::Ptr& ptr, - MWWorld::ContainerStore& containerStore) const - { - insertIntoContainerStore (ptr, containerStore.lights); - } - - std::string Light::getScript (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->script; - } - - void Light::registerSelf() - { - boost::shared_ptr instance (new Light); - - registerClass (typeid (ESM::Light).name(), instance); - } -} diff --git a/apps/openmw/class2/light.hpp b/apps/openmw/class2/light.hpp deleted file mode 100644 index 34421ff513..0000000000 --- a/apps/openmw/class2/light.hpp +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef GAME_MWCLASS_LIGHT_H -#define GAME_MWCLASS_LIGHT_H - -#include "../mwworld/class.hpp" -#include "../mwrender/objects.hpp" - -namespace MWClass -{ - class Light : public MWWorld::Class - { - public: - - virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const; - ///< Add reference into a cell for rendering - - virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const; - - virtual void enable (const MWWorld::Ptr& ptr, MWWorld::Environment& environment) const; - ///< Enable reference; only does the non-rendering part - /// \attention This is not the same as the script instruction with the same name. References - /// should only be enabled while in an active cell. - - virtual std::string getName (const MWWorld::Ptr& ptr) const; - ///< \return name (the one that is to be presented to the user; not the internal one); - /// can return an empty string. - - virtual boost::shared_ptr activate (const MWWorld::Ptr& ptr, - const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const; - ///< Generate action for activation - - virtual void insertIntoContainer (const MWWorld::Ptr& ptr, - MWWorld::ContainerStore& containerStore) const; - ///< Insert into a containe - - virtual std::string getScript (const MWWorld::Ptr& ptr) const; - ///< Return name of the script attached to ptr - - static void registerSelf(); - }; -} - -#endif diff --git a/apps/openmw/class2/lockpick.cpp b/apps/openmw/class2/lockpick.cpp deleted file mode 100644 index c07d5592c7..0000000000 --- a/apps/openmw/class2/lockpick.cpp +++ /dev/null @@ -1,81 +0,0 @@ - -#include "lockpick.hpp" - -#include - -#include - -#include "../mwworld/ptr.hpp" -#include "../mwworld/actiontake.hpp" - -#include "containerutil.hpp" - -namespace MWClass -{ - void Lockpick::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - assert (ref->base != NULL); - const std::string &model = ref->base->model; - - if (!model.empty()) - { - MWRender::Objects& objects = renderingInterface.getObjects(); - objects.insertBegin(ptr, ptr.getRefData().isEnabled(), true); - objects.insertMesh(ptr, "meshes\\" + model); - } - } - - void Lockpick::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - - const std::string &model = ref->base->model; - assert (ref->base != NULL); - if(!model.empty()){ - physics.insertObjectPhysics(ptr, "meshes\\" + model); - } - - } - - - std::string Lockpick::getName (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->name; - } - - boost::shared_ptr Lockpick::activate (const MWWorld::Ptr& ptr, - const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const - { - return boost::shared_ptr ( - new MWWorld::ActionTake (ptr)); - } - - void Lockpick::insertIntoContainer (const MWWorld::Ptr& ptr, - MWWorld::ContainerStore& containerStore) const - { - insertIntoContainerStore (ptr, containerStore.lockpicks); - } - - std::string Lockpick::getScript (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->script; - } - - void Lockpick::registerSelf() - { - boost::shared_ptr instance (new Lockpick); - - registerClass (typeid (ESM::Tool).name(), instance); - } -} diff --git a/apps/openmw/class2/lockpick.hpp b/apps/openmw/class2/lockpick.hpp deleted file mode 100644 index c5f1539b4c..0000000000 --- a/apps/openmw/class2/lockpick.hpp +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef GAME_MWCLASS_LOCKPICK_H -#define GAME_MWCLASS_LOCKPICK_H - -#include "../mwworld/class.hpp" -#include "../mwrender/objects.hpp" - -namespace MWClass -{ - class Lockpick : public MWWorld::Class - { - public: - - virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const; - ///< Add reference into a cell for rendering - - virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const; - - virtual std::string getName (const MWWorld::Ptr& ptr) const; - ///< \return name (the one that is to be presented to the user; not the internal one); - /// can return an empty string. - - virtual boost::shared_ptr activate (const MWWorld::Ptr& ptr, - const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const; - ///< Generate action for activation - - virtual void insertIntoContainer (const MWWorld::Ptr& ptr, - MWWorld::ContainerStore& containerStore) const; - ///< Insert into a containe - - virtual std::string getScript (const MWWorld::Ptr& ptr) const; - ///< Return name of the script attached to ptr - - static void registerSelf(); - }; -} - -#endif diff --git a/apps/openmw/class2/misc.cpp b/apps/openmw/class2/misc.cpp deleted file mode 100644 index a58142905c..0000000000 --- a/apps/openmw/class2/misc.cpp +++ /dev/null @@ -1,80 +0,0 @@ - -#include "misc.hpp" - -#include - -#include - -#include "../mwworld/ptr.hpp" -#include "../mwworld/actiontake.hpp" - -#include "containerutil.hpp" - -namespace MWClass -{ - void Miscellaneous::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - assert (ref->base != NULL); - const std::string &model = ref->base->model; - - if (!model.empty()) - { - MWRender::Objects& objects = renderingInterface.getObjects(); - objects.insertBegin(ptr, ptr.getRefData().isEnabled(), true); - objects.insertMesh(ptr, "meshes\\" + model); - } - } - - void Miscellaneous::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - - const std::string &model = ref->base->model; - assert (ref->base != NULL); - if(!model.empty()){ - physics.insertObjectPhysics(ptr, "meshes\\" + model); - } - - } - - std::string Miscellaneous::getName (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->name; - } - - boost::shared_ptr Miscellaneous::activate (const MWWorld::Ptr& ptr, - const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const - { - return boost::shared_ptr ( - new MWWorld::ActionTake (ptr)); - } - - void Miscellaneous::insertIntoContainer (const MWWorld::Ptr& ptr, - MWWorld::ContainerStore& containerStore) const - { - insertIntoContainerStore (ptr, containerStore.miscItems); - } - - std::string Miscellaneous::getScript (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->script; - } - - void Miscellaneous::registerSelf() - { - boost::shared_ptr instance (new Miscellaneous); - - registerClass (typeid (ESM::Miscellaneous).name(), instance); - } -} diff --git a/apps/openmw/class2/misc.hpp b/apps/openmw/class2/misc.hpp deleted file mode 100644 index 36ee2c1b26..0000000000 --- a/apps/openmw/class2/misc.hpp +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef GAME_MWCLASS_MISC_H -#define GAME_MWCLASS_MISC_H - -#include "../mwworld/class.hpp" -#include "../mwrender/objects.hpp" - -namespace MWClass -{ - class Miscellaneous : public MWWorld::Class - { - public: - - virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const; - ///< Add reference into a cell for rendering - - virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const; - - virtual std::string getName (const MWWorld::Ptr& ptr) const; - ///< \return name (the one that is to be presented to the user; not the internal one); - /// can return an empty string. - - virtual boost::shared_ptr activate (const MWWorld::Ptr& ptr, - const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const; - ///< Generate action for activation - - virtual void insertIntoContainer (const MWWorld::Ptr& ptr, - MWWorld::ContainerStore& containerStore) const; - ///< Insert into a containe - - virtual std::string getScript (const MWWorld::Ptr& ptr) const; - ///< Return name of the script attached to ptr - - static void registerSelf(); - }; -} - -#endif diff --git a/apps/openmw/class2/npc.cpp b/apps/openmw/class2/npc.cpp deleted file mode 100644 index acb0a5a351..0000000000 --- a/apps/openmw/class2/npc.cpp +++ /dev/null @@ -1,276 +0,0 @@ - -#include "npc.hpp" - -#include - -#include "../mwmechanics/creaturestats.hpp" -#include "../mwmechanics/npcstats.hpp" - -#include "../mwworld/ptr.hpp" -#include "../mwworld/actiontalk.hpp" -#include "../mwworld/environment.hpp" -#include "../mwworld/world.hpp" - -#include "../mwmechanics/mechanicsmanager.hpp" -#include - -namespace -{ - const Ogre::Radian kOgrePi (Ogre::Math::PI); - const Ogre::Radian kOgrePiOverTwo (Ogre::Math::PI / Ogre::Real(2.0)); -} - -namespace MWClass -{ - std::string Npc::getId (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->mId; - } - - void Npc::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const - { - renderingInterface.getActors().insertNPC(ptr); - } - - void Npc::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const - { - - - ESMS::LiveCellRef *ref = - ptr.get(); - - - const std::string &model = ref->base->model; - assert (ref->base != NULL); - std::string headID = ref->base->head; - std::string bodyRaceID = headID.substr(0, headID.find_last_of("head_") - 4); - bool beast = bodyRaceID == "b_n_khajiit_m_" || bodyRaceID == "b_n_khajiit_f_" || bodyRaceID == "b_n_argonian_m_" || bodyRaceID == "b_n_argonian_f_"; - - - std::string smodel = "meshes\\base_anim.nif"; - if(beast) - smodel = "meshes\\base_animkna.nif"; - physics.insertActorPhysics(ptr, smodel); - - - } - - void Npc::enable (const MWWorld::Ptr& ptr, MWWorld::Environment& environment) const - { - environment.mMechanicsManager->addActor (ptr); - } - - void Npc::disable (const MWWorld::Ptr& ptr, MWWorld::Environment& environment) const - { - environment.mMechanicsManager->removeActor (ptr); - } - - std::string Npc::getName (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->name; - } - - MWMechanics::CreatureStats& Npc::getCreatureStats (const MWWorld::Ptr& ptr) const - { - if (!ptr.getRefData().getCreatureStats().get()) - { - boost::shared_ptr stats ( - new MWMechanics::CreatureStats); - - ESMS::LiveCellRef *ref = ptr.get(); - - stats->mAttributes[0].set (ref->base->npdt52.strength); - stats->mAttributes[1].set (ref->base->npdt52.intelligence); - stats->mAttributes[2].set (ref->base->npdt52.willpower); - stats->mAttributes[3].set (ref->base->npdt52.agility); - stats->mAttributes[4].set (ref->base->npdt52.speed); - stats->mAttributes[5].set (ref->base->npdt52.endurance); - stats->mAttributes[6].set (ref->base->npdt52.personality); - stats->mAttributes[7].set (ref->base->npdt52.luck); - stats->mDynamic[0].set (ref->base->npdt52.health); - stats->mDynamic[1].set (ref->base->npdt52.mana); - stats->mDynamic[2].set (ref->base->npdt52.fatigue); - - stats->mLevel = ref->base->npdt52.level; - - ptr.getRefData().getCreatureStats() = stats; - } - - return *ptr.getRefData().getCreatureStats(); - } - - MWMechanics::NpcStats& Npc::getNpcStats (const MWWorld::Ptr& ptr) const - { - if (!ptr.getRefData().getNpcStats().get()) - { - boost::shared_ptr stats ( - new MWMechanics::NpcStats); - - ESMS::LiveCellRef *ref = ptr.get(); - - if (!ref->base->faction.empty()) - { - // TODO research how initial rank is stored. The information in loadnpc.hpp are at - // best very unclear. - stats->mFactionRank[ref->base->faction] = 0; - } - - for (int i=0; i<27; ++i) - stats->mSkill[i].setBase (ref->base->npdt52.skills[i]); - - ptr.getRefData().getNpcStats() = stats; - } - - return *ptr.getRefData().getNpcStats(); - } - - boost::shared_ptr Npc::activate (const MWWorld::Ptr& ptr, - const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const - { - return boost::shared_ptr (new MWWorld::ActionTalk (ptr)); - } - - MWWorld::ContainerStore& Npc::getContainerStore (const MWWorld::Ptr& ptr) - const - { - if (!ptr.getRefData().getContainerStore().get()) - { - boost::shared_ptr > store ( - new MWWorld::ContainerStore); - - // TODO add initial content - - ptr.getRefData().getContainerStore() = store; - } - - return *ptr.getRefData().getContainerStore(); - } - - std::string Npc::getScript (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->script; - } - - void Npc::setForceStance (const MWWorld::Ptr& ptr, Stance stance, bool force) const - { - MWMechanics::NpcStats& stats = getNpcStats (ptr); - - switch (stance) - { - case Run: - - stats.mForceRun = force; - break; - - case Sneak: - - stats.mForceSneak = force; - break; - - case Combat: - - throw std::runtime_error ("combat stance not enforcable for NPCs"); - } - } - - void Npc::setStance (const MWWorld::Ptr& ptr, Stance stance, bool set) const - { - MWMechanics::NpcStats& stats = getNpcStats (ptr); - - switch (stance) - { - case Run: - - stats.mRun = set; - break; - - case Sneak: - - stats.mSneak = set; - break; - - case Combat: - - stats.mCombat = set; - break; - } - } - - bool Npc::getStance (const MWWorld::Ptr& ptr, Stance stance, bool ignoreForce) const - { - MWMechanics::NpcStats& stats = getNpcStats (ptr); - - switch (stance) - { - case Run: - - if (!ignoreForce && stats.mForceRun) - return true; - - return stats.mRun; - - case Sneak: - - if (!ignoreForce && stats.mForceSneak) - return true; - - return stats.mSneak; - - case Combat: - - return stats.mCombat; - } - - return false; - } - - float Npc::getSpeed (const MWWorld::Ptr& ptr) const - { - return getStance (ptr, Run) ? 600 : 300; // TODO calculate these values from stats - } - - MWMechanics::Movement& Npc::getMovementSettings (const MWWorld::Ptr& ptr) const - { - if (!ptr.getRefData().getMovement().get()) - { - boost::shared_ptr movement ( - new MWMechanics::Movement); - - ptr.getRefData().getMovement() = movement; - } - - return *ptr.getRefData().getMovement(); - } - - Ogre::Vector3 Npc::getMovementVector (const MWWorld::Ptr& ptr) const - { - Ogre::Vector3 vector (0, 0, 0); - - if (ptr.getRefData().getMovement().get()) - { - vector.x = - ptr.getRefData().getMovement()->mLeftRight * 200; - vector.y = ptr.getRefData().getMovement()->mForwardBackward * 200; - - if (getStance (ptr, Run, false)) - vector *= 2; - } - - return vector; - } - - void Npc::registerSelf() - { - boost::shared_ptr instance (new Npc); - - registerClass (typeid (ESM::NPC).name(), instance); - } -} diff --git a/apps/openmw/class2/npc.hpp b/apps/openmw/class2/npc.hpp deleted file mode 100644 index cc9dbef7fa..0000000000 --- a/apps/openmw/class2/npc.hpp +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef GAME_MWCLASS_NPC_H -#define GAME_MWCLASS_NPC_H - -#include "../mwworld/class.hpp" - - -namespace MWClass -{ - class Npc : public MWWorld::Class - { - public: - - virtual std::string getId (const MWWorld::Ptr& ptr) const; - ///< Return ID of \a ptr - - virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const; - ///< Add reference into a cell for rendering - - virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const; - - virtual void enable (const MWWorld::Ptr& ptr, MWWorld::Environment& environment) const; - ///< Enable reference; only does the non-rendering part - - virtual void disable (const MWWorld::Ptr& ptr, MWWorld::Environment& environment) const; - ///< Enable reference; only does the non-rendering part - - virtual std::string getName (const MWWorld::Ptr& ptr) const; - ///< \return name (the one that is to be presented to the user; not the internal one); - /// can return an empty string. - - virtual MWMechanics::CreatureStats& getCreatureStats (const MWWorld::Ptr& ptr) const; - ///< Return creature stats - - virtual MWMechanics::NpcStats& getNpcStats (const MWWorld::Ptr& ptr) const; - ///< Return NPC stats - - virtual MWWorld::ContainerStore& getContainerStore ( - const MWWorld::Ptr& ptr) const; - ///< Return container store - - virtual boost::shared_ptr activate (const MWWorld::Ptr& ptr, - const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const; - ///< Generate action for activation - - virtual std::string getScript (const MWWorld::Ptr& ptr) const; - ///< Return name of the script attached to ptr - - virtual void setForceStance (const MWWorld::Ptr& ptr, Stance stance, bool force) const; - ///< Force or unforce a stance. - - virtual void setStance (const MWWorld::Ptr& ptr, Stance stance, bool set) const; - ///< Set or unset a stance. - - virtual bool getStance (const MWWorld::Ptr& ptr, Stance stance, bool ignoreForce = false) - const; - ////< Check if a stance is active or not. - - virtual float getSpeed (const MWWorld::Ptr& ptr) const; - ///< Return movement speed. - - virtual MWMechanics::Movement& getMovementSettings (const MWWorld::Ptr& ptr) const; - ///< Return desired movement. - - virtual Ogre::Vector3 getMovementVector (const MWWorld::Ptr& ptr) const; - ///< Return desired movement vector (determined based on movement settings, - /// stance and stats). - - static void registerSelf(); - }; -} - -#endif diff --git a/apps/openmw/class2/potion.cpp b/apps/openmw/class2/potion.cpp deleted file mode 100644 index 0ab1c7aad6..0000000000 --- a/apps/openmw/class2/potion.cpp +++ /dev/null @@ -1,81 +0,0 @@ - -#include "potion.hpp" - -#include - -#include - -#include "../mwworld/ptr.hpp" -#include "../mwworld/actiontake.hpp" - - -#include "containerutil.hpp" - -namespace MWClass -{ - void Potion::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - assert (ref->base != NULL); - const std::string &model = ref->base->model; - - if (!model.empty()) - { - MWRender::Objects& objects = renderingInterface.getObjects(); - objects.insertBegin(ptr, ptr.getRefData().isEnabled(), true); - objects.insertMesh(ptr, "meshes\\" + model); - } - } - - void Potion::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - - const std::string &model = ref->base->model; - assert (ref->base != NULL); - if(!model.empty()){ - physics.insertObjectPhysics(ptr, "meshes\\" + model); - } - - } - - std::string Potion::getName (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->name; - } - - boost::shared_ptr Potion::activate (const MWWorld::Ptr& ptr, - const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const - { - return boost::shared_ptr ( - new MWWorld::ActionTake (ptr)); - } - - void Potion::insertIntoContainer (const MWWorld::Ptr& ptr, - MWWorld::ContainerStore& containerStore) const - { - insertIntoContainerStore (ptr, containerStore.potions); - } - - std::string Potion::getScript (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->script; - } - - void Potion::registerSelf() - { - boost::shared_ptr instance (new Potion); - - registerClass (typeid (ESM::Potion).name(), instance); - } -} diff --git a/apps/openmw/class2/potion.hpp b/apps/openmw/class2/potion.hpp deleted file mode 100644 index 85678121fb..0000000000 --- a/apps/openmw/class2/potion.hpp +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef GAME_MWCLASS_POTION_H -#define GAME_MWCLASS_POTION_H - -#include "../mwworld/class.hpp" -#include "../mwrender/objects.hpp" - -namespace MWClass -{ - class Potion : public MWWorld::Class - { - public: - - virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const; - ///< Add reference into a cell for rendering - - virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const; - - virtual std::string getName (const MWWorld::Ptr& ptr) const; - ///< \return name (the one that is to be presented to the user; not the internal one); - /// can return an empty string. - - virtual boost::shared_ptr activate (const MWWorld::Ptr& ptr, - const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const; - ///< Generate action for activation - - virtual void insertIntoContainer (const MWWorld::Ptr& ptr, - MWWorld::ContainerStore& containerStore) const; - ///< Insert into a containe - - virtual std::string getScript (const MWWorld::Ptr& ptr) const; - ///< Return name of the script attached to ptr - - static void registerSelf(); - }; -} - -#endif diff --git a/apps/openmw/class2/probe.cpp b/apps/openmw/class2/probe.cpp deleted file mode 100644 index 83c0e1ef47..0000000000 --- a/apps/openmw/class2/probe.cpp +++ /dev/null @@ -1,81 +0,0 @@ - -#include "probe.hpp" - -#include - -#include - -#include "../mwworld/ptr.hpp" -#include "../mwworld/actiontake.hpp" - -#include "containerutil.hpp" -#include "../mwrender/objects.hpp" - -namespace MWClass -{ - void Probe::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - assert (ref->base != NULL); - const std::string &model = ref->base->model; - - if (!model.empty()) - { - MWRender::Objects& objects = renderingInterface.getObjects(); - objects.insertBegin(ptr, ptr.getRefData().isEnabled(), true); - objects.insertMesh(ptr, "meshes\\" + model); - } - } - - void Probe::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - - const std::string &model = ref->base->model; - assert (ref->base != NULL); - if(!model.empty()){ - physics.insertObjectPhysics(ptr, "meshes\\" + model); - } - - } - - - std::string Probe::getName (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->name; - } - boost::shared_ptr Probe::activate (const MWWorld::Ptr& ptr, - const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const - { - return boost::shared_ptr ( - new MWWorld::ActionTake (ptr)); - } - - void Probe::insertIntoContainer (const MWWorld::Ptr& ptr, - MWWorld::ContainerStore& containerStore) const - { - insertIntoContainerStore (ptr, containerStore.probes); - } - - std::string Probe::getScript (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->script; - } - - void Probe::registerSelf() - { - boost::shared_ptr instance (new Probe); - - registerClass (typeid (ESM::Probe).name(), instance); - } -} diff --git a/apps/openmw/class2/probe.hpp b/apps/openmw/class2/probe.hpp deleted file mode 100644 index d7b9df7385..0000000000 --- a/apps/openmw/class2/probe.hpp +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef GAME_MWCLASS_PROBE_H -#define GAME_MWCLASS_PROBE_H - -#include "../mwworld/class.hpp" - - -namespace MWClass -{ - class Probe : public MWWorld::Class - { - public: - - virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const; - ///< Add reference into a cell for rendering - - virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const; - - virtual std::string getName (const MWWorld::Ptr& ptr) const; - ///< \return name (the one that is to be presented to the user; not the internal one); - /// can return an empty string. - - virtual boost::shared_ptr activate (const MWWorld::Ptr& ptr, - const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const; - ///< Generate action for activation - - virtual void insertIntoContainer (const MWWorld::Ptr& ptr, - MWWorld::ContainerStore& containerStore) const; - ///< Insert into a containe - - virtual std::string getScript (const MWWorld::Ptr& ptr) const; - ///< Return name of the script attached to ptr - - static void registerSelf(); - }; -} - -#endif diff --git a/apps/openmw/class2/repair.cpp b/apps/openmw/class2/repair.cpp deleted file mode 100644 index feee7e988b..0000000000 --- a/apps/openmw/class2/repair.cpp +++ /dev/null @@ -1,80 +0,0 @@ - -#include "repair.hpp" - -#include - -#include - -#include "../mwworld/ptr.hpp" -#include "../mwworld/actiontake.hpp" - -#include "containerutil.hpp" - -namespace MWClass -{ - void Repair::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - assert (ref->base != NULL); - const std::string &model = ref->base->model; - - if (!model.empty()) - { - MWRender::Objects& objects = renderingInterface.getObjects(); - objects.insertBegin(ptr, ptr.getRefData().isEnabled(), true); - objects.insertMesh(ptr, "meshes\\" + model); - } - } - - void Repair::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - - const std::string &model = ref->base->model; - assert (ref->base != NULL); - if(!model.empty()){ - physics.insertObjectPhysics(ptr, "meshes\\" + model); - } - - } - - std::string Repair::getName (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->name; - } - - boost::shared_ptr Repair::activate (const MWWorld::Ptr& ptr, - const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const - { - return boost::shared_ptr ( - new MWWorld::ActionTake (ptr)); - } - - void Repair::insertIntoContainer (const MWWorld::Ptr& ptr, - MWWorld::ContainerStore& containerStore) const - { - insertIntoContainerStore (ptr, containerStore.repairs); - } - - std::string Repair::getScript (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->script; - } - - void Repair::registerSelf() - { - boost::shared_ptr instance (new Repair); - - registerClass (typeid (ESM::Repair).name(), instance); - } -} diff --git a/apps/openmw/class2/repair.hpp b/apps/openmw/class2/repair.hpp deleted file mode 100644 index 1e0ea51785..0000000000 --- a/apps/openmw/class2/repair.hpp +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef GAME_MWCLASS_REPAIR_H -#define GAME_MWCLASS_REPAIR_H - -#include "../mwworld/class.hpp" -#include "../mwrender/objects.hpp" - -namespace MWClass -{ - class Repair : public MWWorld::Class - { - public: - - virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const; - ///< Add reference into a cell for rendering - - virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const; - - virtual std::string getName (const MWWorld::Ptr& ptr) const; - ///< \return name (the one that is to be presented to the user; not the internal one); - /// can return an empty string. - - virtual boost::shared_ptr activate (const MWWorld::Ptr& ptr, - const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const; - ///< Generate action for activation - - virtual void insertIntoContainer (const MWWorld::Ptr& ptr, - MWWorld::ContainerStore& containerStore) const; - ///< Insert into a containe - - virtual std::string getScript (const MWWorld::Ptr& ptr) const; - ///< Return name of the script attached to ptr - - static void registerSelf(); - }; -} - -#endif diff --git a/apps/openmw/class2/static.cpp b/apps/openmw/class2/static.cpp deleted file mode 100644 index af14bb3069..0000000000 --- a/apps/openmw/class2/static.cpp +++ /dev/null @@ -1,52 +0,0 @@ - -#include "static.hpp" - -#include - -#include "../mwworld/ptr.hpp" - - -namespace MWClass -{ - void Static::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - assert (ref->base != NULL); - const std::string &model = ref->base->model; - - if (!model.empty()) - { - MWRender::Objects& objects = renderingInterface.getObjects(); - objects.insertBegin(ptr, ptr.getRefData().isEnabled(), true); - objects.insertMesh(ptr, "meshes\\" + model); - } - } - - void Static::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - - const std::string &model = ref->base->model; - assert (ref->base != NULL); - if(!model.empty()){ - physics.insertObjectPhysics(ptr, "meshes\\" + model); - } - - } - - std::string Static::getName (const MWWorld::Ptr& ptr) const - { - return ""; - } - - void Static::registerSelf() - { - boost::shared_ptr instance (new Static); - - registerClass (typeid (ESM::Static).name(), instance); - } -} diff --git a/apps/openmw/class2/static.hpp b/apps/openmw/class2/static.hpp deleted file mode 100644 index be3fdb1804..0000000000 --- a/apps/openmw/class2/static.hpp +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef GAME_MWCLASS_STATIC_H -#define GAME_MWCLASS_STATIC_H - -#include "../mwworld/class.hpp" -#include "../mwrender/objects.hpp" - -namespace MWClass -{ - class Static : public MWWorld::Class - { - public: - - virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const; - ///< Add reference into a cell for rendering - - virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const; - - virtual std::string getName (const MWWorld::Ptr& ptr) const; - ///< \return name (the one that is to be presented to the user; not the internal one); - /// can return an empty string. - - static void registerSelf(); - }; -} - -#endif diff --git a/apps/openmw/class2/weapon.cpp b/apps/openmw/class2/weapon.cpp deleted file mode 100644 index d5f7e68536..0000000000 --- a/apps/openmw/class2/weapon.cpp +++ /dev/null @@ -1,94 +0,0 @@ - -#include "weapon.hpp" - -#include - -#include - -#include "../mwworld/ptr.hpp" -#include "../mwworld/actiontake.hpp" - - -#include "containerutil.hpp" - -namespace MWClass -{ - void Weapon::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - assert (ref->base != NULL); - const std::string &model = ref->base->model; - - if (!model.empty()) - { - MWRender::Objects& objects = renderingInterface.getObjects(); - objects.insertBegin(ptr, ptr.getRefData().isEnabled(),true); - objects.insertMesh(ptr, "meshes\\" + model); - } - } - - void Weapon::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - - const std::string &model = ref->base->model; - assert (ref->base != NULL); - if(!model.empty()){ - physics.insertObjectPhysics(ptr, "meshes\\" + model); - } - - } - - std::string Weapon::getName (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->name; - } - - boost::shared_ptr Weapon::activate (const MWWorld::Ptr& ptr, - const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const - { - return boost::shared_ptr ( - new MWWorld::ActionTake (ptr)); - } - - bool Weapon::hasItemHealth (const MWWorld::Ptr& ptr) const - { - return true; - } - - int Weapon::getItemMaxHealth (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->data.health; - } - - void Weapon::insertIntoContainer (const MWWorld::Ptr& ptr, - MWWorld::ContainerStore& containerStore) const - { - insertIntoContainerStore (ptr, containerStore.weapons); - } - - std::string Weapon::getScript (const MWWorld::Ptr& ptr) const - { - ESMS::LiveCellRef *ref = - ptr.get(); - - return ref->base->script; - } - - void Weapon::registerSelf() - { - boost::shared_ptr instance (new Weapon); - - registerClass (typeid (ESM::Weapon).name(), instance); - } -} diff --git a/apps/openmw/class2/weapon.hpp b/apps/openmw/class2/weapon.hpp deleted file mode 100644 index 79bc4d4dec..0000000000 --- a/apps/openmw/class2/weapon.hpp +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef GAME_MWCLASS_WEAPON_H -#define GAME_MWCLASS_WEAPON_H - -#include "../mwworld/class.hpp" -#include "../mwrender/objects.hpp" - -namespace MWClass -{ - class Weapon : public MWWorld::Class - { - public: - - virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const; - ///< Add reference into a cell for rendering - - virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const; - - virtual std::string getName (const MWWorld::Ptr& ptr) const; - ///< \return name (the one that is to be presented to the user; not the internal one); - /// can return an empty string. - - virtual boost::shared_ptr activate (const MWWorld::Ptr& ptr, - const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const; - ///< Generate action for activation - - virtual bool hasItemHealth (const MWWorld::Ptr& ptr) const; - ///< \return Item health data available? - - virtual int getItemMaxHealth (const MWWorld::Ptr& ptr) const; - ///< Return item max health or throw an exception, if class does not have item health - - virtual void insertIntoContainer (const MWWorld::Ptr& ptr, - MWWorld::ContainerStore& containerStore) const; - ///< Insert into a containe - - virtual std::string getScript (const MWWorld::Ptr& ptr) const; - ///< Return name of the script attached to ptr - - static void registerSelf(); - }; -} - -#endif