Mapblock mesh: Fix updateFastFaceRow tiling issue
Increase maximum length of tiled node rows from 2 to mapblock size.master
parent
5c0e659516
commit
7f4c6f32da
|
@ -839,7 +839,7 @@ static void updateFastFaceRow(
|
||||||
{
|
{
|
||||||
v3s16 p = startpos;
|
v3s16 p = startpos;
|
||||||
|
|
||||||
u16 continuous_tiles_count = 0;
|
u16 continuous_tiles_count = 1;
|
||||||
|
|
||||||
bool makes_face = false;
|
bool makes_face = false;
|
||||||
v3s16 p_corrected;
|
v3s16 p_corrected;
|
||||||
|
@ -889,8 +889,8 @@ static void updateFastFaceRow(
|
||||||
&& (tile.material_flags & MATERIAL_FLAG_TILEABLE_HORIZONTAL)
|
&& (tile.material_flags & MATERIAL_FLAG_TILEABLE_HORIZONTAL)
|
||||||
&& (tile.material_flags & MATERIAL_FLAG_TILEABLE_VERTICAL)) {
|
&& (tile.material_flags & MATERIAL_FLAG_TILEABLE_VERTICAL)) {
|
||||||
next_is_different = false;
|
next_is_different = false;
|
||||||
}
|
continuous_tiles_count++;
|
||||||
else{
|
} else {
|
||||||
/*if(makes_face){
|
/*if(makes_face){
|
||||||
g_profiler->add("Meshgen: diff: next_makes_face != makes_face",
|
g_profiler->add("Meshgen: diff: next_makes_face != makes_face",
|
||||||
next_makes_face != makes_face ? 1 : 0);
|
next_makes_face != makes_face ? 1 : 0);
|
||||||
|
@ -915,8 +915,6 @@ static void updateFastFaceRow(
|
||||||
g_profiler->add("Meshgen: diff: last position", 1);*/
|
g_profiler->add("Meshgen: diff: last position", 1);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
continuous_tiles_count++;
|
|
||||||
|
|
||||||
if(next_is_different)
|
if(next_is_different)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
@ -928,8 +926,6 @@ static void updateFastFaceRow(
|
||||||
v3f pf(p_corrected.X, p_corrected.Y, p_corrected.Z);
|
v3f pf(p_corrected.X, p_corrected.Y, p_corrected.Z);
|
||||||
// Center point of face (kind of)
|
// Center point of face (kind of)
|
||||||
v3f sp = pf - ((f32)continuous_tiles_count / 2.0 - 0.5) * translate_dir_f;
|
v3f sp = pf - ((f32)continuous_tiles_count / 2.0 - 0.5) * translate_dir_f;
|
||||||
if(continuous_tiles_count != 1)
|
|
||||||
sp += translate_dir_f;
|
|
||||||
v3f scale(1,1,1);
|
v3f scale(1,1,1);
|
||||||
|
|
||||||
if(translate_dir.X != 0) {
|
if(translate_dir.X != 0) {
|
||||||
|
@ -952,19 +948,18 @@ static void updateFastFaceRow(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
continuous_tiles_count = 0;
|
continuous_tiles_count = 1;
|
||||||
|
|
||||||
makes_face = next_makes_face;
|
|
||||||
p_corrected = next_p_corrected;
|
|
||||||
face_dir_corrected = next_face_dir_corrected;
|
|
||||||
lights[0] = next_lights[0];
|
|
||||||
lights[1] = next_lights[1];
|
|
||||||
lights[2] = next_lights[2];
|
|
||||||
lights[3] = next_lights[3];
|
|
||||||
tile = next_tile;
|
|
||||||
light_source = next_light_source;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
makes_face = next_makes_face;
|
||||||
|
p_corrected = next_p_corrected;
|
||||||
|
face_dir_corrected = next_face_dir_corrected;
|
||||||
|
lights[0] = next_lights[0];
|
||||||
|
lights[1] = next_lights[1];
|
||||||
|
lights[2] = next_lights[2];
|
||||||
|
lights[3] = next_lights[3];
|
||||||
|
tile = next_tile;
|
||||||
|
light_source = next_light_source;
|
||||||
p = p_next;
|
p = p_next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue