diff options
author | Craig Robbins <kde.psych@gmail.com> | 2014-10-07 17:01:07 +1000 |
---|---|---|
committer | Kahrl <kahrl@gmx.net> | 2014-10-19 15:33:08 +0200 |
commit | 076c5ee2234c7f217f8941bbbd710d317485ccbc (patch) | |
tree | d59d05cf111a7fb79960878a9d51864ea6ff5b97 /src/mapblock_mesh.cpp | |
parent | fe8ef1be59399a327d9df50a0ab823bb2731de79 (diff) | |
download | minetest-076c5ee2234c7f217f8941bbbd710d317485ccbc.tar.gz minetest-076c5ee2234c7f217f8941bbbd710d317485ccbc.tar.bz2 minetest-076c5ee2234c7f217f8941bbbd710d317485ccbc.zip |
Various uninitialised variable fixes
sky.cpp: m_bgcolor.getAlpha() was being used before initialised
mesh related: m_highlight_mesh_color was being used uninitialised
Diffstat (limited to 'src/mapblock_mesh.cpp')
-rw-r--r-- | src/mapblock_mesh.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
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 |