From 3295f3c40157c2bc385a903611bfa803a69b617d Mon Sep 17 00:00:00 2001 From: RealBadAngel Date: Wed, 5 Aug 2015 22:52:32 +0200 Subject: Fix tiling issues for PLANTLIKE and FIRELIKE with FSAA --- src/client/tile.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/client') 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; -- cgit v1.2.3