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 | |
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')
-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); |