aboutsummaryrefslogtreecommitdiff
path: root/src/client/tile.h
diff options
context:
space:
mode:
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;