1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-15 18:57:08 +00:00

Fix some (MSVC) compiler warnings

This commit is contained in:
Lars Mueller 2025-04-04 17:09:12 +02:00 committed by Lars Müller
parent 695d526764
commit e1143783e5
8 changed files with 13 additions and 15 deletions

View file

@ -704,8 +704,8 @@ void Minimap::updateActiveMarkers()
continue;
}
m_active_markers.emplace_back(((float)pos.X / (float)MINIMAP_MAX_SX) - 0.5,
(1.0 - (float)pos.Z / (float)MINIMAP_MAX_SY) - 0.5);
m_active_markers.emplace_back(((float)pos.X / (float)MINIMAP_MAX_SX) - 0.5f,
(1.0f - (float)pos.Z / (float)MINIMAP_MAX_SY) - 0.5f);
}
}

View file

@ -36,7 +36,7 @@ ShadowRenderer::ShadowRenderer(IrrlichtDevice *device, Client *client) :
m_shadow_map_max_distance = g_settings->getFloat("shadow_map_max_distance");
m_shadow_map_texture_size = g_settings->getFloat("shadow_map_texture_size");
m_shadow_map_texture_size = g_settings->getU32("shadow_map_texture_size");
m_shadow_map_texture_32bit = g_settings->getBool("shadow_map_texture_32bit");
m_shadow_map_colored = g_settings->getBool("shadow_map_color");
@ -273,7 +273,7 @@ void ShadowRenderer::updateSMTextures()
// Static shader values.
for (auto cb : {m_shadow_depth_cb, m_shadow_depth_entity_cb, m_shadow_depth_trans_cb}) {
if (cb) {
cb->MapRes = (f32)m_shadow_map_texture_size;
cb->MapRes = (u32)m_shadow_map_texture_size;
cb->MaxFar = (f32)m_shadow_map_max_distance * BS;
cb->PerspectiveBiasXY = getPerspectiveBiasXY();
cb->PerspectiveBiasZ = getPerspectiveBiasZ();

View file

@ -124,7 +124,7 @@ private:
video::SColor m_shadow_tint;
float m_shadow_strength_gamma;
float m_shadow_map_max_distance;
float m_shadow_map_texture_size;
u32 m_shadow_map_texture_size;
float m_time_day;
int m_shadow_samples;
bool m_shadow_map_texture_32bit;

View file

@ -104,7 +104,7 @@ void read_item_definition(lua_State* L, int index,
} else if (lua_isstring(L, -1)) {
video::SColor color;
read_color(L, -1, &color);
def.wear_bar_params = WearBarParams({{0.0, color}},
def.wear_bar_params = WearBarParams({{0.0f, color}},
WearBarParams::BLEND_MODE_CONSTANT);
}

View file

@ -320,7 +320,7 @@ void TestUtilities::testUTF8()
// try to check that the conversion function does not accidentally keep
// its internal state across invocations.
// \xC4\x81 is UTF-8 for \u0101
utf8_to_wide("\xC4");
static_cast<void>(utf8_to_wide("\xC4"));
UASSERT(utf8_to_wide("\x81") != L"\u0101");
}