diff options
author | RealBadAngel <maciej.kasatkin@o2.pl> | 2015-07-21 23:56:41 +0200 |
---|---|---|
committer | RealBadAngel <maciej.kasatkin@o2.pl> | 2015-07-21 23:56:41 +0200 |
commit | 60350699c792b816b20704d59cfbda0894cdba39 (patch) | |
tree | 59e9a369d9ea87804035ee27ea902a81b4f90060 /src/client/tile.cpp | |
parent | 5b0c719171eb9ccb8f2829eb1cc8b3fe9f24cd05 (diff) | |
download | minetest-60350699c792b816b20704d59cfbda0894cdba39.tar.gz minetest-60350699c792b816b20704d59cfbda0894cdba39.tar.bz2 minetest-60350699c792b816b20704d59cfbda0894cdba39.zip |
Add wielded (and CAOs) shader
Diffstat (limited to 'src/client/tile.cpp')
-rw-r--r-- | src/client/tile.cpp | 17 |
1 files changed, 9 insertions, 8 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(); |