Inline certain terrain storage functions

pull/2234/head
bzzt 6 years ago committed by Capostrophic
parent e131e6699c
commit b42ad0f610

@ -46,19 +46,6 @@ namespace ESMTerrain
{ {
} }
const ESM::Land::LandData *LandObject::getData(int flags) const
{
if ((mData.mDataLoaded & flags) != flags)
return nullptr;
return &mData;
}
int LandObject::getPlugin() const
{
return mLand->mPlugin;
}
const float defaultHeight = ESM::Land::DEFAULT_HEIGHT; const float defaultHeight = ESM::Land::DEFAULT_HEIGHT;
Storage::Storage(const VFS::Manager *vfs, const std::string& normalMapPattern, const std::string& normalHeightMapPattern, bool autoUseNormalMaps, const std::string& specularMapPattern, bool autoUseSpecularMaps) Storage::Storage(const VFS::Manager *vfs, const std::string& normalMapPattern, const std::string& normalHeightMapPattern, bool autoUseNormalMaps, const std::string& specularMapPattern, bool autoUseSpecularMaps)

@ -29,8 +29,17 @@ namespace ESMTerrain
META_Object(ESMTerrain, LandObject) META_Object(ESMTerrain, LandObject)
const ESM::Land::LandData* getData(int flags) const; inline const ESM::Land::LandData* getData(int flags) const
int getPlugin() const; {
if ((mData.mDataLoaded & flags) != flags)
return nullptr;
return &mData;
}
inline int getPlugin() const
{
return mLand->mPlugin;
}
private: private:
const ESM::Land* mLand; const ESM::Land* mLand;
@ -105,21 +114,20 @@ namespace ESMTerrain
private: private:
const VFS::Manager* mVFS; const VFS::Manager* mVFS;
void fixNormal (osg::Vec3f& normal, int cellX, int cellY, int col, int row, LandCache& cache); inline void fixNormal (osg::Vec3f& normal, int cellX, int cellY, int col, int row, LandCache& cache);
void fixColour (osg::Vec4ub& colour, int cellX, int cellY, int col, int row, LandCache& cache); inline void fixColour (osg::Vec4ub& colour, int cellX, int cellY, int col, int row, LandCache& cache);
void averageNormal (osg::Vec3f& normal, int cellX, int cellY, int col, int row, LandCache& cache); inline void averageNormal (osg::Vec3f& normal, int cellX, int cellY, int col, int row, LandCache& cache);
float getVertexHeight (const ESM::Land::LandData* data, int x, int y); inline float getVertexHeight (const ESM::Land::LandData* data, int x, int y);
const LandObject* getLand(int cellX, int cellY, LandCache& cache); inline const LandObject* getLand(int cellX, int cellY, LandCache& cache);
// 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
// in order to retrieve the correct texture name. // in order to retrieve the correct texture name.
// pair <texture id, plugin id> // pair <texture id, plugin id>
typedef std::pair<short, short> UniqueTextureId; typedef std::pair<short, short> UniqueTextureId;
UniqueTextureId getVtexIndexAt(int cellX, int cellY, inline UniqueTextureId getVtexIndexAt(int cellX, int cellY, int x, int y, LandCache&);
int x, int y, LandCache&);
std::string getTextureName (UniqueTextureId id); std::string getTextureName (UniqueTextureId id);
std::map<std::string, Terrain::LayerInfo> mLayerInfoMap; std::map<std::string, Terrain::LayerInfo> mLayerInfoMap;

Loading…
Cancel
Save