From 242a9b5a59d4e8676b647176b996fe4c3cfae75c Mon Sep 17 00:00:00 2001 From: greye Date: Tue, 6 Nov 2012 14:03:36 +0400 Subject: [PATCH] various interface fixes, commented unused code --- apps/openmw/mwworld/cells.cpp | 6 ++--- apps/openmw/mwworld/globals.cpp | 15 ++++++------ apps/openmw/mwworld/worldimp.cpp | 42 +++++++++++++++++++++++--------- 3 files changed, 42 insertions(+), 21 deletions(-) diff --git a/apps/openmw/mwworld/cells.cpp b/apps/openmw/mwworld/cells.cpp index beed6f1d7..696a469f7 100644 --- a/apps/openmw/mwworld/cells.cpp +++ b/apps/openmw/mwworld/cells.cpp @@ -269,7 +269,7 @@ MWWorld::Ptr MWWorld::Cells::getPtr (const std::string& name) for (iter = cells.intBegin(); iter != cells.intEnd(); ++iter) { - Ptr::CellStore *cellStore = getCellStore (*iter); + Ptr::CellStore *cellStore = getCellStore (&(*iter)); Ptr ptr = getPtrAndCache (name, *cellStore); @@ -277,9 +277,9 @@ MWWorld::Ptr MWWorld::Cells::getPtr (const std::string& name) return ptr; } - for (iter = cells.extBegin(); iter != cells.extEnd(); ++it) + for (iter = cells.extBegin(); iter != cells.extEnd(); ++iter) { - Ptr::CellStore *cellStore = getCellStore (*iter); + Ptr::CellStore *cellStore = getCellStore (&(*iter)); Ptr ptr = getPtrAndCache (name, *cellStore); diff --git a/apps/openmw/mwworld/globals.cpp b/apps/openmw/mwworld/globals.cpp index f904dd2b1..76dede5a3 100644 --- a/apps/openmw/mwworld/globals.cpp +++ b/apps/openmw/mwworld/globals.cpp @@ -29,33 +29,34 @@ namespace MWWorld Globals::Globals (const MWWorld::ESMStore& store) { - for (MWWorld::RecListT::MapType::const_iterator iter - (store.globals.list.begin()); iter != store.globals.list.end(); ++iter) + const MWWorld::Store &globals = store.get(); + MWWorld::Store::iterator iter = globals.begin(); + for (; iter != globals.end(); ++iter) { char type = ' '; Data value; - switch (iter->second.mType) + switch (iter->mType) { case ESM::VT_Short: type = 's'; value.mShort = *reinterpret_cast ( - &iter->second.mValue); + &iter->mValue); break; case ESM::VT_Int: type = 'l'; value.mLong = *reinterpret_cast ( - &iter->second.mValue); + &iter->mValue); break; case ESM::VT_Float: type = 'f'; value.mFloat = *reinterpret_cast ( - &iter->second.mValue); + &iter->mValue); break; default: @@ -63,7 +64,7 @@ namespace MWWorld throw std::runtime_error ("unsupported global variable type"); } - mVariables.insert (std::make_pair (iter->first, std::make_pair (type, value))); + mVariables.insert (std::make_pair (iter->mId, std::make_pair (type, value))); } if (mVariables.find ("dayspassed")==mVariables.end()) diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 9a1303d76..4e98b3682 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -19,6 +19,9 @@ using namespace Ogre; namespace { +/* // NOTE this code is never instantiated (proper copy in localscripts.cpp), + // so this commented out to not produce syntactic errors + template void listCellScripts (const MWWorld::ESMStore& store, MWWorld::CellRefList& cellRefList, MWWorld::LocalScripts& localScripts, @@ -28,18 +31,18 @@ namespace cellRefList.mList.begin()); iter!=cellRefList.mList.end(); ++iter) { - if (!iter->mBase->script.empty() && iter->mData.getCount()) + if (!iter->mBase->mScript.empty() && iter->mData.getCount()) { - if (const ESM::Script *script = store.scripts.find (iter->base->script)) + if (const ESM::Script *script = store.get().find (iter->mBase->mScript)) { iter->mData.setLocals (*script); - localScripts.add (iter->base->script, MWWorld::Ptr (&*iter, cell)); + localScripts.add (iter->mBase->mScript, MWWorld::Ptr (&*iter, cell)); } } } } - +*/ template MWWorld::LiveCellRef *searchViaHandle (const std::string& handle, MWWorld::CellRefList& refList) @@ -793,10 +796,15 @@ namespace MWWorld mStore.all.insert (std::make_pair (stream.str(), ESM::REC_ALCH)); return std::make_pair (stream.str(), created); - */} + */ + std::string id = ""; + const ESM::Potion *ptr = 0; + return std::make_pair(id, ptr); + } std::pair World::createRecord (const ESM::Class& record) - {/* + { + /* /// \todo See function above. std::ostringstream stream; stream << "$dynamic" << mNextDynamicRecord++; @@ -807,10 +815,15 @@ namespace MWWorld mStore.all.insert (std::make_pair (stream.str(), ESM::REC_CLAS)); return std::make_pair (stream.str(), created); - */} + */ + std::string id = ""; + const ESM::Class *ptr = 0; + return std::make_pair(id, ptr); + } std::pair World::createRecord (const ESM::Spell& record) - {/* + { + /* /// \todo See function above. std::ostringstream stream; stream << "$dynamic" << mNextDynamicRecord++; @@ -821,10 +834,15 @@ namespace MWWorld mStore.all.insert (std::make_pair (stream.str(), ESM::REC_SPEL)); return std::make_pair (stream.str(), created); - */} + */ + std::string id = ""; + const ESM::Spell *ptr = 0; + return std::make_pair(id, ptr); + } const ESM::Cell *World::createRecord (const ESM::Cell& record) - {/* + { + /* if (record.mData.mFlags & ESM::Cell::Interior) { if (mStore.cells.searchInt (record.mName)) @@ -844,7 +862,9 @@ namespace MWWorld std::make_pair (std::make_pair (record.mData.mX, record.mData.mY), cell)); return cell; } - */} + */ + return 0; + } void World::playAnimationGroup (const MWWorld::Ptr& ptr, const std::string& groupName, int mode, int number)