mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 16:45:20 +02:00
Various uninitialised variable fixes
sky.cpp: m_bgcolor.getAlpha() was being used before initialised mesh related: m_highlight_mesh_color was being used uninitialised
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user