aboutsummaryrefslogtreecommitdiff
path: root/src/script
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/script
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/script')
-rw-r--r--src/script/common/c_content.cpp15
-rw-r--r--src/script/common/c_content.h3
2 files changed, 11 insertions, 7 deletions
diff --git a/src/script/common/c_content.cpp b/src/script/common/c_content.cpp
index 42c6889d8..3754fc2ff 100644
--- a/src/script/common/c_content.cpp
+++ b/src/script/common/c_content.cpp
@@ -258,17 +258,20 @@ void push_object_properties(lua_State *L, ObjectProperties *prop)
}
/******************************************************************************/
-TileDef read_tiledef(lua_State *L, int index)
+TileDef read_tiledef(lua_State *L, int index, u8 drawtype)
{
if(index < 0)
index = lua_gettop(L) + 1 + index;
TileDef tiledef;
-
+ bool default_tiling = (drawtype == NDT_PLANTLIKE || drawtype == NDT_FIRELIKE)
+ ? false : true;
// key at index -2 and value at index
if(lua_isstring(L, index)){
// "default_lava.png"
tiledef.name = lua_tostring(L, index);
+ tiledef.tileable_vertical = default_tiling;
+ tiledef.tileable_horizontal = default_tiling;
}
else if(lua_istable(L, index))
{
@@ -279,9 +282,9 @@ TileDef read_tiledef(lua_State *L, int index)
tiledef.backface_culling = getboolfield_default(
L, index, "backface_culling", true);
tiledef.tileable_horizontal = getboolfield_default(
- L, index, "tileable_horizontal", true);
+ L, index, "tileable_horizontal", default_tiling);
tiledef.tileable_vertical = getboolfield_default(
- L, index, "tileable_vertical", true);
+ L, index, "tileable_vertical", default_tiling);
// animation = {}
lua_getfield(L, index, "animation");
if(lua_istable(L, -1)){
@@ -357,7 +360,7 @@ ContentFeatures read_content_features(lua_State *L, int index)
int i = 0;
while(lua_next(L, table) != 0){
// Read tiledef from value
- f.tiledef[i] = read_tiledef(L, -1);
+ f.tiledef[i] = read_tiledef(L, -1, f.drawtype);
// removes value, keeps key for next iteration
lua_pop(L, 1);
i++;
@@ -392,7 +395,7 @@ ContentFeatures read_content_features(lua_State *L, int index)
int i = 0;
while(lua_next(L, table) != 0){
// Read tiledef from value
- f.tiledef_special[i] = read_tiledef(L, -1);
+ f.tiledef_special[i] = read_tiledef(L, -1, f.drawtype);
// removes value, keeps key for next iteration
lua_pop(L, 1);
i++;
diff --git a/src/script/common/c_content.h b/src/script/common/c_content.h
index 4547009e7..46416ad8e 100644
--- a/src/script/common/c_content.h
+++ b/src/script/common/c_content.h
@@ -63,7 +63,8 @@ class Schematic;
ContentFeatures read_content_features (lua_State *L, int index);
-TileDef read_tiledef (lua_State *L, int index);
+TileDef read_tiledef (lua_State *L, int index,
+ u8 drawtype);
void read_soundspec (lua_State *L, int index,
SimpleSoundSpec &spec);
NodeBox read_nodebox (lua_State *L, int index);