1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-20 20:53:53 +00:00

various interface fixes, commented unused code

This commit is contained in:
greye 2012-11-06 14:03:36 +04:00
parent b3ad872845
commit 242a9b5a59
3 changed files with 42 additions and 21 deletions

View file

@ -269,7 +269,7 @@ MWWorld::Ptr MWWorld::Cells::getPtr (const std::string& name)
for (iter = cells.intBegin(); iter != cells.intEnd(); ++iter) for (iter = cells.intBegin(); iter != cells.intEnd(); ++iter)
{ {
Ptr::CellStore *cellStore = getCellStore (*iter); Ptr::CellStore *cellStore = getCellStore (&(*iter));
Ptr ptr = getPtrAndCache (name, *cellStore); Ptr ptr = getPtrAndCache (name, *cellStore);
@ -277,9 +277,9 @@ MWWorld::Ptr MWWorld::Cells::getPtr (const std::string& name)
return ptr; 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); Ptr ptr = getPtrAndCache (name, *cellStore);

View file

@ -29,33 +29,34 @@ namespace MWWorld
Globals::Globals (const MWWorld::ESMStore& store) Globals::Globals (const MWWorld::ESMStore& store)
{ {
for (MWWorld::RecListT<ESM::Global>::MapType::const_iterator iter const MWWorld::Store<ESM::Global> &globals = store.get<ESM::Global>();
(store.globals.list.begin()); iter != store.globals.list.end(); ++iter) MWWorld::Store<ESM::Global>::iterator iter = globals.begin();
for (; iter != globals.end(); ++iter)
{ {
char type = ' '; char type = ' ';
Data value; Data value;
switch (iter->second.mType) switch (iter->mType)
{ {
case ESM::VT_Short: case ESM::VT_Short:
type = 's'; type = 's';
value.mShort = *reinterpret_cast<const Interpreter::Type_Float *> ( value.mShort = *reinterpret_cast<const Interpreter::Type_Float *> (
&iter->second.mValue); &iter->mValue);
break; break;
case ESM::VT_Int: case ESM::VT_Int:
type = 'l'; type = 'l';
value.mLong = *reinterpret_cast<const Interpreter::Type_Float *> ( value.mLong = *reinterpret_cast<const Interpreter::Type_Float *> (
&iter->second.mValue); &iter->mValue);
break; break;
case ESM::VT_Float: case ESM::VT_Float:
type = 'f'; type = 'f';
value.mFloat = *reinterpret_cast<const Interpreter::Type_Float *> ( value.mFloat = *reinterpret_cast<const Interpreter::Type_Float *> (
&iter->second.mValue); &iter->mValue);
break; break;
default: default:
@ -63,7 +64,7 @@ namespace MWWorld
throw std::runtime_error ("unsupported global variable type"); 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()) if (mVariables.find ("dayspassed")==mVariables.end())

View file

@ -19,6 +19,9 @@ using namespace Ogre;
namespace namespace
{ {
/* // NOTE this code is never instantiated (proper copy in localscripts.cpp),
// so this commented out to not produce syntactic errors
template<typename T> template<typename T>
void listCellScripts (const MWWorld::ESMStore& store, void listCellScripts (const MWWorld::ESMStore& store,
MWWorld::CellRefList<T>& cellRefList, MWWorld::LocalScripts& localScripts, MWWorld::CellRefList<T>& cellRefList, MWWorld::LocalScripts& localScripts,
@ -28,18 +31,18 @@ namespace
cellRefList.mList.begin()); cellRefList.mList.begin());
iter!=cellRefList.mList.end(); ++iter) 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<ESM::Script>().find (iter->mBase->mScript))
{ {
iter->mData.setLocals (*script); iter->mData.setLocals (*script);
localScripts.add (iter->base->script, MWWorld::Ptr (&*iter, cell)); localScripts.add (iter->mBase->mScript, MWWorld::Ptr (&*iter, cell));
} }
} }
} }
} }
*/
template<typename T> template<typename T>
MWWorld::LiveCellRef<T> *searchViaHandle (const std::string& handle, MWWorld::LiveCellRef<T> *searchViaHandle (const std::string& handle,
MWWorld::CellRefList<T>& refList) MWWorld::CellRefList<T>& refList)
@ -793,10 +796,15 @@ namespace MWWorld
mStore.all.insert (std::make_pair (stream.str(), ESM::REC_ALCH)); mStore.all.insert (std::make_pair (stream.str(), ESM::REC_ALCH));
return std::make_pair (stream.str(), created); return std::make_pair (stream.str(), created);
*/} */
std::string id = "";
const ESM::Potion *ptr = 0;
return std::make_pair(id, ptr);
}
std::pair<std::string, const ESM::Class *> World::createRecord (const ESM::Class& record) std::pair<std::string, const ESM::Class *> World::createRecord (const ESM::Class& record)
{/* {
/*
/// \todo See function above. /// \todo See function above.
std::ostringstream stream; std::ostringstream stream;
stream << "$dynamic" << mNextDynamicRecord++; stream << "$dynamic" << mNextDynamicRecord++;
@ -807,10 +815,15 @@ namespace MWWorld
mStore.all.insert (std::make_pair (stream.str(), ESM::REC_CLAS)); mStore.all.insert (std::make_pair (stream.str(), ESM::REC_CLAS));
return std::make_pair (stream.str(), created); return std::make_pair (stream.str(), created);
*/} */
std::string id = "";
const ESM::Class *ptr = 0;
return std::make_pair(id, ptr);
}
std::pair<std::string, const ESM::Spell *> World::createRecord (const ESM::Spell& record) std::pair<std::string, const ESM::Spell *> World::createRecord (const ESM::Spell& record)
{/* {
/*
/// \todo See function above. /// \todo See function above.
std::ostringstream stream; std::ostringstream stream;
stream << "$dynamic" << mNextDynamicRecord++; stream << "$dynamic" << mNextDynamicRecord++;
@ -821,10 +834,15 @@ namespace MWWorld
mStore.all.insert (std::make_pair (stream.str(), ESM::REC_SPEL)); mStore.all.insert (std::make_pair (stream.str(), ESM::REC_SPEL));
return std::make_pair (stream.str(), created); 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) const ESM::Cell *World::createRecord (const ESM::Cell& record)
{/* {
/*
if (record.mData.mFlags & ESM::Cell::Interior) if (record.mData.mFlags & ESM::Cell::Interior)
{ {
if (mStore.cells.searchInt (record.mName)) 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)); std::make_pair (std::make_pair (record.mData.mX, record.mData.mY), cell));
return cell; return cell;
} }
*/} */
return 0;
}
void World::playAnimationGroup (const MWWorld::Ptr& ptr, const std::string& groupName, int mode, void World::playAnimationGroup (const MWWorld::Ptr& ptr, const std::string& groupName, int mode,
int number) int number)