1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-26 11:09:41 +00:00
openmw/apps/opencs/model/world/ref.hpp
cc9cii 86945d1912 Convert the CellRef record index lookup maps to use integer keys rather than strings.
- Morrowind load over 300,000 references, so even small inefficiencies add up to longer loading times.
- std::map is used, but should try others, std::unordered_map or even std::vector
2015-12-11 21:00:13 +11:00

31 lines
671 B
C++

#ifndef CSM_WOLRD_REF_H
#define CSM_WOLRD_REF_H
#include <utility>
#include <components/esm/cellref.hpp>
namespace CSMWorld
{
/// \brief Wrapper for CellRef sub record
struct CellRef : public ESM::CellRef
{
unsigned int mIdNum;
std::string mId;
std::string mCell;
std::string mOriginalCell;
CellRef();
CellRef(const CellRef&) = default;
CellRef& operator= (const CellRef&) = default;
CellRef (CellRef&& other);
CellRef& operator= (CellRef&& other);
/// Calculate cell index based on coordinates (x and y)
std::pair<int, int> getCellIndex() const;
};
}
#endif