From 74f855e94800d633e33b36709c56d0b9c6073d06 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 14 Aug 2013 01:55:51 -0700 Subject: [PATCH] Move common LiveCellRef fields to the base class --- apps/openmw/mwworld/livecellref.hpp | 23 ++++++++++++----------- apps/openmw/mwworld/ptr.hpp | 3 +-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/apps/openmw/mwworld/livecellref.hpp b/apps/openmw/mwworld/livecellref.hpp index fbfe77dd7..4c6c8f7f7 100644 --- a/apps/openmw/mwworld/livecellref.hpp +++ b/apps/openmw/mwworld/livecellref.hpp @@ -17,7 +17,16 @@ namespace MWWorld { std::string mTypeName; - LiveCellRefBase(std::string type) : mTypeName(type) + /** Information about this instance, such as 3D location and rotation + * and individual type-dependent data. + */ + ESM::CellRef mRef; + + /** runtime-data */ + RefData mData; + + LiveCellRefBase(std::string type, const ESM::CellRef &cref=ESM::CellRef()) + : mTypeName(type), mRef(cref), mData(mRef) { } }; @@ -31,23 +40,15 @@ namespace MWWorld struct LiveCellRef : public LiveCellRefBase { LiveCellRef(const ESM::CellRef& cref, const X* b = NULL) - : LiveCellRefBase(typeid(X).name()), mBase(b), mRef(cref), mData(mRef) + : LiveCellRefBase(typeid(X).name(), cref), mBase(b) {} LiveCellRef(const X* b = NULL) - : LiveCellRefBase(typeid(X).name()), mBase(b), mData(mRef) + : LiveCellRefBase(typeid(X).name()), mBase(b) {} // The object that this instance is based on. const X* mBase; - - /* Information about this instance, such as 3D location and - rotation and individual type-dependent data. - */ - ESM::CellRef mRef; - - /// runtime-data - RefData mData; }; // template bool operator==(const LiveCellRef& ref, int pRefnum); diff --git a/apps/openmw/mwworld/ptr.hpp b/apps/openmw/mwworld/ptr.hpp index c028381b4..e56aa3d71 100644 --- a/apps/openmw/mwworld/ptr.hpp +++ b/apps/openmw/mwworld/ptr.hpp @@ -38,8 +38,7 @@ namespace MWWorld return mPtr ? mPtr->mTypeName : sEmptyString; } - template - Ptr (MWWorld::LiveCellRef *liveCellRef, CellStore *cell) + Ptr (MWWorld::LiveCellRefBase *liveCellRef, CellStore *cell) : mContainerStore (0) { mPtr = liveCellRef;