mirror of
https://github.com/OpenMW/openmw.git
synced 2025-07-07 03:41:35 +00:00
Remove ESM::LandObject dependency on ESM::Land
This commit is contained in:
parent
8a88a2d61f
commit
e6f35373b5
4 changed files with 13 additions and 23 deletions
|
@ -6,6 +6,7 @@ ESM::LandData::LandData(const ESM::Land& land, int loadFlags)
|
||||||
: mLoadFlags(loadFlags)
|
: mLoadFlags(loadFlags)
|
||||||
, mSize(Constants::CellSizeInUnits)
|
, mSize(Constants::CellSizeInUnits)
|
||||||
, mLandSize(ESM::Land::LAND_SIZE)
|
, mLandSize(ESM::Land::LAND_SIZE)
|
||||||
|
, mPlugin(land.getPlugin())
|
||||||
{
|
{
|
||||||
ESM::Land::LandData data;
|
ESM::Land::LandData data;
|
||||||
land.loadData(loadFlags, &data);
|
land.loadData(loadFlags, &data);
|
||||||
|
|
|
@ -27,6 +27,7 @@ namespace ESM
|
||||||
float getMaxHeight() const { return mMaxHeight; }
|
float getMaxHeight() const { return mMaxHeight; }
|
||||||
int getLandSize() const { return mLandSize; }
|
int getLandSize() const { return mLandSize; }
|
||||||
int getLoadFlags() const { return mLoadFlags; }
|
int getLoadFlags() const { return mLoadFlags; }
|
||||||
|
int getPlugin() const { return mPlugin; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int mLoadFlags = 0;
|
int mLoadFlags = 0;
|
||||||
|
@ -34,6 +35,7 @@ namespace ESM
|
||||||
float mMaxHeight = 0.f;
|
float mMaxHeight = 0.f;
|
||||||
float mSize = 0.f;
|
float mSize = 0.f;
|
||||||
int mLandSize = 0;
|
int mLandSize = 0;
|
||||||
|
int mPlugin = 0;
|
||||||
std::vector<float> mHeights;
|
std::vector<float> mHeights;
|
||||||
std::vector<std::int8_t> mNormals;
|
std::vector<std::int8_t> mNormals;
|
||||||
std::vector<std::uint8_t> mColors;
|
std::vector<std::uint8_t> mColors;
|
||||||
|
|
|
@ -46,30 +46,21 @@ namespace ESMTerrain
|
||||||
Map mMap;
|
Map mMap;
|
||||||
};
|
};
|
||||||
|
|
||||||
LandObject::LandObject()
|
|
||||||
: mLand(nullptr)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
LandObject::LandObject(const ESM4::Land* land, int loadFlags)
|
LandObject::LandObject(const ESM4::Land* land, int loadFlags)
|
||||||
: mLand(nullptr)
|
: mData(*land, loadFlags)
|
||||||
, mData(*land, loadFlags)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
LandObject::LandObject(const ESM::Land* land, int loadFlags)
|
LandObject::LandObject(const ESM::Land* land, int loadFlags)
|
||||||
: mLand(land)
|
: mData(*land, loadFlags)
|
||||||
, mData(*land, loadFlags)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
LandObject::LandObject(const LandObject& copy, const osg::CopyOp& copyop)
|
LandObject::LandObject(const LandObject& /*copy*/, const osg::CopyOp& /*copyOp*/)
|
||||||
: mLand(nullptr)
|
|
||||||
{
|
{
|
||||||
|
throw std::logic_error("LandObject copy constructor is not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
LandObject::~LandObject() {}
|
|
||||||
|
|
||||||
const float defaultHeight = ESM::Land::DEFAULT_HEIGHT;
|
const float defaultHeight = ESM::Land::DEFAULT_HEIGHT;
|
||||||
|
|
||||||
Storage::Storage(const VFS::Manager* vfs, const std::string& normalMapPattern,
|
Storage::Storage(const VFS::Manager* vfs, const std::string& normalMapPattern,
|
||||||
|
|
|
@ -36,30 +36,26 @@ namespace ESMTerrain
|
||||||
class LandObject : public osg::Object
|
class LandObject : public osg::Object
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LandObject();
|
LandObject() = default;
|
||||||
LandObject(const ESM::Land* land, int loadFlags);
|
LandObject(const ESM::Land* land, int loadFlags);
|
||||||
LandObject(const ESM4::Land* land, int loadFlags);
|
LandObject(const ESM4::Land* land, int loadFlags);
|
||||||
|
|
||||||
LandObject(const LandObject& copy, const osg::CopyOp& copyop);
|
|
||||||
virtual ~LandObject();
|
|
||||||
|
|
||||||
META_Object(ESMTerrain, LandObject)
|
META_Object(ESMTerrain, LandObject)
|
||||||
|
|
||||||
inline const ESM::LandData* getData(int flags) const
|
const ESM::LandData* getData(int flags) const
|
||||||
{
|
{
|
||||||
if ((mData.getLoadFlags() & flags) != flags)
|
if ((mData.getLoadFlags() & flags) != flags)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
return &mData;
|
return &mData;
|
||||||
}
|
}
|
||||||
inline int getPlugin() const { return mLand->getPlugin(); }
|
|
||||||
inline int getLandSize() const { return mData.getLandSize(); }
|
int getPlugin() const { return mData.getPlugin(); }
|
||||||
inline int getRealSize() const { return mData.getSize(); }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const ESM::Land* mLand;
|
|
||||||
|
|
||||||
ESM::LandData mData;
|
ESM::LandData mData;
|
||||||
|
|
||||||
|
LandObject(const LandObject& copy, const osg::CopyOp& copyOp);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Since plugins can define new texture palettes, we need to know the plugin index too
|
// Since plugins can define new texture palettes, we need to know the plugin index too
|
||||||
|
|
Loading…
Reference in a new issue