@@ -1029,7 +1029,7 @@ static void updateAllFastFaceRows(MeshMakeData *data,
1029
1029
1030
1030
MapBlockMesh::MapBlockMesh (MeshMakeData *data, v3s16 camera_offset):
1031
1031
m_mesh(new scene::SMesh()),
1032
- m_minimap_mapblock(new MinimapMapblock ),
1032
+ m_minimap_mapblock(NULL ),
1033
1033
m_gamedef(data->m_gamedef),
1034
1034
m_tsrc(m_gamedef->getTextureSource ()),
1035
1035
m_shdrsrc(m_gamedef->getShaderSource ()),
@@ -1044,29 +1044,9 @@ MapBlockMesh::MapBlockMesh(MeshMakeData *data, v3s16 camera_offset):
1044
1044
m_enable_highlighting = g_settings->getBool (" enable_node_highlighting" );
1045
1045
1046
1046
if (g_settings->getBool (" enable_minimap" )) {
1047
- v3s16 blockpos_nodes = data->m_blockpos * MAP_BLOCKSIZE;
1048
- for (s16 x = 0 ; x < MAP_BLOCKSIZE; x++) {
1049
- for (s16 z = 0 ; z < MAP_BLOCKSIZE; z++) {
1050
- s16 air_count = 0 ;
1051
- bool surface_found = false ;
1052
- MinimapPixel* minimap_pixel = &m_minimap_mapblock->data [x + z * MAP_BLOCKSIZE];
1053
- for (s16 y = MAP_BLOCKSIZE -1 ; y > -1 ; y--) {
1054
- v3s16 p (x, y, z);
1055
- MapNode n = data->m_vmanip .getNodeNoEx (blockpos_nodes + p);
1056
- if (!surface_found && n.getContent () != CONTENT_AIR) {
1057
- minimap_pixel->height = y;
1058
- minimap_pixel->id = n.getContent ();
1059
- surface_found = true ;
1060
- } else if (n.getContent () == CONTENT_AIR) {
1061
- air_count++;
1062
- }
1063
- }
1064
- if (!surface_found) {
1065
- minimap_pixel->id = CONTENT_AIR;
1066
- }
1067
- minimap_pixel->air_count = air_count;
1068
- }
1069
- }
1047
+ m_minimap_mapblock = new MinimapMapblock;
1048
+ m_minimap_mapblock->getMinimapNodes (
1049
+ &data->m_vmanip , data->m_blockpos * MAP_BLOCKSIZE);
1070
1050
}
1071
1051
1072
1052
// 4-21ms for MAP_BLOCKSIZE=16 (NOTE: probably outdated)
@@ -1183,7 +1163,7 @@ MapBlockMesh::MapBlockMesh(MeshMakeData *data, v3s16 camera_offset):
1183
1163
}
1184
1164
1185
1165
if (m_enable_highlighting && p.tile .material_flags & MATERIAL_FLAG_HIGHLIGHTED)
1186
- m_highlighted_materials.push_back (i);
1166
+ m_highlighted_materials.push_back (i);
1187
1167
1188
1168
for (u32 j = 0 ; j < p.vertices .size (); j++)
1189
1169
{
@@ -1400,7 +1380,7 @@ bool MapBlockMesh::animate(bool faraway, float time, int crack, u32 daynight_rat
1400
1380
// Node highlighting
1401
1381
if (m_enable_highlighting) {
1402
1382
u8 day = m_highlight_mesh_color.getRed ();
1403
- u8 night = m_highlight_mesh_color.getGreen ();
1383
+ u8 night = m_highlight_mesh_color.getGreen ();
1404
1384
video::SColor hc;
1405
1385
finalColorBlend (hc, day, night, daynight_ratio);
1406
1386
float sin_r = 0.07 * sin (1.5 * time );
0 commit comments