summaryrefslogtreecommitdiff
path: root/src/client/tile.h
diff options
context:
space:
mode:
authorRealBadAngel <maciej.kasatkin@o2.pl>2015-08-05 22:52:32 +0200
committerRealBadAngel <maciej.kasatkin@o2.pl>2015-08-05 22:52:32 +0200
commit3295f3c40157c2bc385a903611bfa803a69b617d (patch)
tree394f67c72df64ab26d97de963c66df1dd39b750c /src/client/tile.h
parent7a6e4dc54a3eb4187e67a21c4ece60f39bb1d13b (diff)
downloadminetest-3295f3c40157c2bc385a903611bfa803a69b617d.tar.gz
minetest-3295f3c40157c2bc385a903611bfa803a69b617d.tar.bz2
minetest-3295f3c40157c2bc385a903611bfa803a69b617d.zip
Fix tiling issues for PLANTLIKE and FIRELIKE with FSAA
Diffstat (limited to 'src/client/tile.h')
-rw-r--r--src/client/tile.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/client/tile.h b/src/client/tile.h
index 744aa2c3d..c08ffc8ad 100644
--- a/src/client/tile.h
+++ b/src/client/tile.h
@@ -168,6 +168,8 @@ enum MaterialType{
// defined by extra parameters
#define MATERIAL_FLAG_ANIMATION_VERTICAL_FRAMES 0x08
#define MATERIAL_FLAG_HIGHLIGHTED 0x10
+#define MATERIAL_FLAG_TILEABLE_HORIZONTAL 0x20
+#define MATERIAL_FLAG_TILEABLE_VERTICAL 0x40
/*
This fully defines the looks of a tile.
@@ -216,7 +218,9 @@ struct TileSpec
alpha == other.alpha &&
material_type == other.material_type &&
material_flags == other.material_flags &&
- rotation == other.rotation
+ rotation == other.rotation &&
+ (material_flags & MATERIAL_FLAG_TILEABLE_HORIZONTAL) &&
+ (material_flags & MATERIAL_FLAG_TILEABLE_VERTICAL)
);
}
@@ -250,12 +254,26 @@ struct TileSpec
}
material.BackfaceCulling = (material_flags & MATERIAL_FLAG_BACKFACE_CULLING)
? true : false;
+ if (!(material_flags & MATERIAL_FLAG_TILEABLE_HORIZONTAL)) {
+ material.TextureLayer[0].TextureWrapU = video::ETC_CLAMP_TO_EDGE;
+ }
+ if (!(material_flags & MATERIAL_FLAG_TILEABLE_VERTICAL)) {
+ material.TextureLayer[0].TextureWrapV = video::ETC_CLAMP_TO_EDGE;
+ }
}
void applyMaterialOptionsWithShaders(video::SMaterial &material) const
{
material.BackfaceCulling = (material_flags & MATERIAL_FLAG_BACKFACE_CULLING)
? true : false;
+ if (!(material_flags & MATERIAL_FLAG_TILEABLE_HORIZONTAL)) {
+ material.TextureLayer[0].TextureWrapU = video::ETC_CLAMP_TO_EDGE;
+ material.TextureLayer[1].TextureWrapU = video::ETC_CLAMP_TO_EDGE;
+ }
+ if (!(material_flags & MATERIAL_FLAG_TILEABLE_VERTICAL)) {
+ material.TextureLayer[0].TextureWrapV = video::ETC_CLAMP_TO_EDGE;
+ material.TextureLayer[1].TextureWrapV = video::ETC_CLAMP_TO_EDGE;
+ }
}
u32 texture_id;