diff --git a/apps/opencs/model/world/idtable.cpp b/apps/opencs/model/world/idtable.cpp index cebd0ebdb..9dbe38998 100644 --- a/apps/opencs/model/world/idtable.cpp +++ b/apps/opencs/model/world/idtable.cpp @@ -2,6 +2,8 @@ #include +#include + #include "collectionbase.hpp" #include "columnbase.hpp" @@ -259,7 +261,7 @@ std::pair CSMWorld::IdTable::view (int row) return std::make_pair (UniversalId::Type_None, ""); if (id[0]=='#') - id = "sys::default"; + id = ESM::CellId::sDefaultWorldspace; return std::make_pair (UniversalId (UniversalId::Type_Scene, id), hint); } diff --git a/apps/opencs/view/world/regionmap.cpp b/apps/opencs/view/world/regionmap.cpp index 4de470dbc..31e5d94ca 100644 --- a/apps/opencs/view/world/regionmap.cpp +++ b/apps/opencs/view/world/regionmap.cpp @@ -303,7 +303,7 @@ void CSVWorld::RegionMap::view() hint << cellId; } - emit editRequest (CSMWorld::UniversalId (CSMWorld::UniversalId::Type_Scene, "sys::default"), + emit editRequest (CSMWorld::UniversalId (CSMWorld::UniversalId::Type_Scene, ESM::CellId::sDefaultWorldspace), hint.str()); } diff --git a/apps/opencs/view/world/scenesubview.cpp b/apps/opencs/view/world/scenesubview.cpp index 624029353..c84818b37 100644 --- a/apps/opencs/view/world/scenesubview.cpp +++ b/apps/opencs/view/world/scenesubview.cpp @@ -38,7 +38,7 @@ CSVWorld::SceneSubView::SceneSubView (const CSMWorld::UniversalId& id, CSMDoc::D CSVRender::WorldspaceWidget* worldspaceWidget = NULL; widgetType whatWidget; - if (id.getId()=="sys::default") + if (id.getId()==ESM::CellId::sDefaultWorldspace) { whatWidget = widget_Paged; @@ -160,7 +160,7 @@ void CSVWorld::SceneSubView::cellSelectionChanged (const CSMWorld::UniversalId& void CSVWorld::SceneSubView::cellSelectionChanged (const CSMWorld::CellSelection& selection) { - setUniversalId(CSMWorld::UniversalId(CSMWorld::UniversalId::Type_Scene, "sys::default")); + setUniversalId(CSMWorld::UniversalId(CSMWorld::UniversalId::Type_Scene, ESM::CellId::sDefaultWorldspace)); int size = selection.getSize(); std::ostringstream stream; diff --git a/apps/openmw/mwgui/mapwindow.cpp b/apps/openmw/mwgui/mapwindow.cpp index 1b8d5ab43..7c52f09cb 100644 --- a/apps/openmw/mwgui/mapwindow.cpp +++ b/apps/openmw/mwgui/mapwindow.cpp @@ -322,7 +322,7 @@ namespace MWGui { ESM::CellId cellId; cellId.mPaged = !mInterior; - cellId.mWorldspace = (mInterior ? mPrefix : "sys::default"); + cellId.mWorldspace = (mInterior ? mPrefix : ESM::CellId::sDefaultWorldspace); cellId.mIndex.mX = mCurX+dX; cellId.mIndex.mY = mCurY+dY; @@ -738,7 +738,7 @@ namespace MWGui mEditingMarker.mCell.mWorldspace = LocalMapBase::mPrefix; else { - mEditingMarker.mCell.mWorldspace = "sys::default"; + mEditingMarker.mCell.mWorldspace = ESM::CellId::sDefaultWorldspace; mEditingMarker.mCell.mIndex.mX = x; mEditingMarker.mCell.mIndex.mY = y; } @@ -848,7 +848,7 @@ namespace MWGui ESM::CellId cellId; cellId.mIndex.mX = x; cellId.mIndex.mY = y; - cellId.mWorldspace = "sys::default"; + cellId.mWorldspace = ESM::CellId::sDefaultWorldspace; cellId.mPaged = true; CustomMarkerCollection::RangeType markers = mCustomMarkers.getMarkers(cellId); std::vector destNotes; diff --git a/apps/openmw/mwworld/cells.cpp b/apps/openmw/mwworld/cells.cpp index 47b2af053..384d7e124 100644 --- a/apps/openmw/mwworld/cells.cpp +++ b/apps/openmw/mwworld/cells.cpp @@ -105,7 +105,7 @@ MWWorld::CellStore *MWWorld::Cells::getExterior (int x, int y) { // Cell isn't predefined. Make one on the fly. ESM::Cell record; - record.mCellId.mWorldspace = "sys::default"; + record.mCellId.mWorldspace = ESM::CellId::sDefaultWorldspace; record.mCellId.mPaged = true; record.mCellId.mIndex.mX = x; record.mCellId.mIndex.mY = y; diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index cb31d6e0d..ec581c3e3 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -972,7 +972,7 @@ namespace MWWorld { mPhysics->clearQueuedMovement(); - if (changeEvent && mCurrentWorldSpace != "sys::default") // FIXME + if (changeEvent && mCurrentWorldSpace != ESM::CellId::sDefaultWorldspace) { // changed worldspace mProjectileManager->clear(); diff --git a/components/esm/cellid.cpp b/components/esm/cellid.cpp index f77e2eb55..ad91d30e0 100644 --- a/components/esm/cellid.cpp +++ b/components/esm/cellid.cpp @@ -3,6 +3,8 @@ #include "esmreader.hpp" #include "esmwriter.hpp" +const std::string ESM::CellId::sDefaultWorldspace = "sys::default"; + void ESM::CellId::load (ESMReader &esm) { mWorldspace = esm.getHNString ("SPAC"); diff --git a/components/esm/cellid.hpp b/components/esm/cellid.hpp index 56d5a674e..a28b71794 100644 --- a/components/esm/cellid.hpp +++ b/components/esm/cellid.hpp @@ -20,6 +20,8 @@ namespace ESM CellIndex mIndex; bool mPaged; + static const std::string sDefaultWorldspace; + void load (ESMReader &esm); void save (ESMWriter &esm) const; }; diff --git a/components/esm/loadcell.cpp b/components/esm/loadcell.cpp index 3a8a11779..7c4349d31 100644 --- a/components/esm/loadcell.cpp +++ b/components/esm/loadcell.cpp @@ -96,7 +96,7 @@ namespace ESM if (mCellId.mPaged) { - mCellId.mWorldspace = "sys::default"; + mCellId.mWorldspace = ESM::CellId::sDefaultWorldspace; mCellId.mIndex.mX = mData.mX; mCellId.mIndex.mY = mData.mY; }