diff options
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/tile.cpp | 17 | ||||
-rw-r--r-- | src/client/tile.h | 6 |
2 files changed, 13 insertions, 10 deletions
diff --git a/src/client/tile.cpp b/src/client/tile.cpp index 5ad564b65..03badd817 100644 --- a/src/client/tile.cpp +++ b/src/client/tile.cpp @@ -385,7 +385,8 @@ public: video::ITexture* getNormalTexture(const std::string &name); video::SColor getTextureAverageColor(const std::string &name); - video::ITexture *getShaderFlagsTexture(TileDef *tiledef, TileSpec *tile); + video::ITexture *getShaderFlagsTexture( + bool normamap_present, bool tileable_vertical, bool tileable_horizontal); private: @@ -2050,14 +2051,14 @@ video::SColor TextureSource::getTextureAverageColor(const std::string &name) return c; } -video::ITexture *TextureSource::getShaderFlagsTexture(TileDef *tiledef, TileSpec *tile) + +video::ITexture *TextureSource::getShaderFlagsTexture( + bool normalmap_present, bool tileable_vertical, bool tileable_horizontal) { std::string tname = "__shaderFlagsTexture"; - - bool normalmap_present = tile->normal_texture ? true : false; tname += normalmap_present ? "1" : "0"; - tname += tiledef->tileable_horizontal ? "1" : "0"; - tname += tiledef->tileable_vertical ? "1" : "0"; + tname += tileable_horizontal ? "1" : "0"; + tname += tileable_vertical ? "1" : "0"; if (isKnownSourceImage(tname)) { return getTexture(tname); @@ -2069,8 +2070,8 @@ video::ITexture *TextureSource::getShaderFlagsTexture(TileDef *tiledef, TileSpec video::SColor c( 255, normalmap_present ? 255 : 0, - tiledef->tileable_horizontal ? 255 : 0, - tiledef->tileable_vertical ? 255 : 0); + tileable_horizontal ? 255 : 0, + tileable_vertical ? 255 : 0); flags_image->setPixel(0, 0, c); insertSourceImage(tname, flags_image); flags_image->drop(); diff --git a/src/client/tile.h b/src/client/tile.h index 13f1a8b34..744aa2c3d 100644 --- a/src/client/tile.h +++ b/src/client/tile.h @@ -113,7 +113,8 @@ public: const TextureFromMeshParams ¶ms)=0; virtual video::ITexture* getNormalTexture(const std::string &name)=0; virtual video::SColor getTextureAverageColor(const std::string &name)=0; - virtual video::ITexture *getShaderFlagsTexture(TileDef *tiledef, TileSpec *tile)=0; + virtual video::ITexture *getShaderFlagsTexture(bool normamap_present, + bool tileable_vertical, bool tileable_horizontal)=0; }; class IWritableTextureSource : public ITextureSource @@ -136,7 +137,8 @@ public: virtual void rebuildImagesAndTextures()=0; virtual video::ITexture* getNormalTexture(const std::string &name)=0; virtual video::SColor getTextureAverageColor(const std::string &name)=0; - virtual video::ITexture *getShaderFlagsTexture(TileDef *tiledef, TileSpec *tile)=0; + virtual video::ITexture *getShaderFlagsTexture(bool normamap_present, + bool tileable_vertical, bool tileable_horizontal)=0; }; IWritableTextureSource* createTextureSource(IrrlichtDevice *device); |