From 076c5ee2234c7f217f8941bbbd710d317485ccbc Mon Sep 17 00:00:00 2001 From: Craig Robbins Date: Tue, 7 Oct 2014 17:01:07 +1000 Subject: Various uninitialised variable fixes sky.cpp: m_bgcolor.getAlpha() was being used before initialised mesh related: m_highlight_mesh_color was being used uninitialised --- src/mapblock_mesh.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/mapblock_mesh.cpp') diff --git a/src/mapblock_mesh.cpp b/src/mapblock_mesh.cpp index a7fafa683..2459cf0d7 100644 --- a/src/mapblock_mesh.cpp +++ b/src/mapblock_mesh.cpp @@ -48,6 +48,8 @@ MeshMakeData::MeshMakeData(IGameDef *gamedef): m_crack_pos_relative(-1337, -1337, -1337), m_highlighted_pos_relative(-1337, -1337, -1337), m_smooth_lighting(false), + m_show_hud(false), + m_highlight_mesh_color(255, 255, 255, 255), m_gamedef(gamedef) {} @@ -330,7 +332,7 @@ static void finalColorBlend(video::SColor& result, // Emphase blue a bit in darker places // Each entry of this array represents a range of 8 blue levels - static u8 emphase_blue_when_dark[32] = { + static const u8 emphase_blue_when_dark[32] = { 1, 4, 6, 6, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; @@ -338,7 +340,7 @@ static void finalColorBlend(video::SColor& result, b = irr::core::clamp (b, 0, 255); // Artificial light is yellow-ish - static u8 emphase_yellow_when_artificial[16] = { + static const u8 emphase_yellow_when_artificial[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 10, 15, 15, 15 }; rg += emphase_yellow_when_artificial[night/16]; @@ -1086,7 +1088,7 @@ MapBlockMesh::MapBlockMesh(MeshMakeData *data, v3s16 camera_offset): mapblock_mesh_generate_special(data, collector); - m_highlight_mesh_color = data->m_highlight_mesh_color; + m_highlight_mesh_color = data->m_highlight_mesh_color; /* Convert MeshCollector to SMesh -- cgit v1.2.3