Pass land reference to LandObject constructor

macos_ci_fix
elsid 1 year ago
parent e6f35373b5
commit 28614730da
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

@ -39,7 +39,7 @@ namespace CSVRender
const ESM::Land& land = mData.getLand().getRecord(index).get(); const ESM::Land& land = mData.getLand().getRecord(index).get();
return new ESMTerrain::LandObject( return new ESMTerrain::LandObject(
&land, ESM::Land::DATA_VHGT | ESM::Land::DATA_VNML | ESM::Land::DATA_VCLR | ESM::Land::DATA_VTEX); land, ESM::Land::DATA_VHGT | ESM::Land::DATA_VNML | ESM::Land::DATA_VCLR | ESM::Land::DATA_VTEX);
} }
const ESM::LandTexture* TerrainStorage::getLandTexture(int index, short plugin) const ESM::LandTexture* TerrainStorage::getLandTexture(int index, short plugin)

@ -33,7 +33,7 @@ namespace MWRender
const ESM4::Land* land = world->getStore().get<ESM4::Land>().search(cellIndex); const ESM4::Land* land = world->getStore().get<ESM4::Land>().search(cellIndex);
if (!land) if (!land)
return nullptr; return nullptr;
osg::ref_ptr<ESMTerrain::LandObject> landObj(new ESMTerrain::LandObject(land, mLoadFlags)); osg::ref_ptr<ESMTerrain::LandObject> landObj(new ESMTerrain::LandObject(*land, mLoadFlags));
mCache->addEntryToObjectCache(cellIndex, landObj.get()); mCache->addEntryToObjectCache(cellIndex, landObj.get());
return landObj; return landObj;
} }
@ -42,7 +42,7 @@ namespace MWRender
const ESM::Land* land = world->getStore().get<ESM::Land>().search(cellIndex.mX, cellIndex.mY); const ESM::Land* land = world->getStore().get<ESM::Land>().search(cellIndex.mX, cellIndex.mY);
if (!land) if (!land)
return nullptr; return nullptr;
osg::ref_ptr<ESMTerrain::LandObject> landObj(new ESMTerrain::LandObject(land, mLoadFlags)); osg::ref_ptr<ESMTerrain::LandObject> landObj(new ESMTerrain::LandObject(*land, mLoadFlags));
mCache->addEntryToObjectCache(cellIndex, landObj.get()); mCache->addEntryToObjectCache(cellIndex, landObj.get());
return landObj; return landObj;
} }

@ -46,13 +46,13 @@ namespace ESMTerrain
Map mMap; Map mMap;
}; };
LandObject::LandObject(const ESM4::Land* land, int loadFlags) LandObject::LandObject(const ESM4::Land& land, int loadFlags)
: mData(*land, loadFlags) : mData(land, loadFlags)
{ {
} }
LandObject::LandObject(const ESM::Land* land, int loadFlags) LandObject::LandObject(const ESM::Land& land, int loadFlags)
: mData(*land, loadFlags) : mData(land, loadFlags)
{ {
} }

@ -37,8 +37,8 @@ namespace ESMTerrain
{ {
public: public:
LandObject() = default; 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);
META_Object(ESMTerrain, LandObject) META_Object(ESMTerrain, LandObject)

Loading…
Cancel
Save