mirror of
https://github.com/minetest/minetest.git
synced 2025-02-14 18:30:25 +01:00
Fix updating glow on entities
was broken in #10021 more than 2 years ago(!)
This commit is contained in:
parent
ae555465ba
commit
a83d81ff45
@ -858,7 +858,7 @@ void GenericCAO::addToScene(ITextureSource *tsrc, scene::ISceneManager *smgr)
|
|||||||
|
|
||||||
void GenericCAO::updateLight(u32 day_night_ratio)
|
void GenericCAO::updateLight(u32 day_night_ratio)
|
||||||
{
|
{
|
||||||
if (m_glow < 0)
|
if (m_prop.glow < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
u16 light_at_pos = 0;
|
u16 light_at_pos = 0;
|
||||||
@ -883,7 +883,7 @@ void GenericCAO::updateLight(u32 day_night_ratio)
|
|||||||
if (!pos_ok)
|
if (!pos_ok)
|
||||||
light_at_pos = LIGHT_SUN;
|
light_at_pos = LIGHT_SUN;
|
||||||
|
|
||||||
video::SColor light = encode_light(light_at_pos, m_glow);
|
video::SColor light = encode_light(light_at_pos, m_prop.glow);
|
||||||
if (!m_enable_shaders)
|
if (!m_enable_shaders)
|
||||||
final_color_blend(&light, light_at_pos, day_night_ratio);
|
final_color_blend(&light, light_at_pos, day_night_ratio);
|
||||||
|
|
||||||
@ -1319,7 +1319,6 @@ void GenericCAO::updateTextures(std::string mod)
|
|||||||
|
|
||||||
m_previous_texture_modifier = m_current_texture_modifier;
|
m_previous_texture_modifier = m_current_texture_modifier;
|
||||||
m_current_texture_modifier = mod;
|
m_current_texture_modifier = mod;
|
||||||
m_glow = m_prop.glow;
|
|
||||||
|
|
||||||
video::ITexture *shadow_texture = nullptr;
|
video::ITexture *shadow_texture = nullptr;
|
||||||
if (auto shadow = RenderingEngine::get_shadow_renderer())
|
if (auto shadow = RenderingEngine::get_shadow_renderer())
|
||||||
@ -1496,7 +1495,7 @@ void GenericCAO::updateTextures(std::string mod)
|
|||||||
material.setFlag(video::EMF_ANISOTROPIC_FILTER, use_anisotropic_filter);
|
material.setFlag(video::EMF_ANISOTROPIC_FILTER, use_anisotropic_filter);
|
||||||
}
|
}
|
||||||
// Set mesh color (only if lighting is disabled)
|
// Set mesh color (only if lighting is disabled)
|
||||||
if (!m_prop.colors.empty() && m_glow < 0)
|
if (!m_prop.colors.empty() && m_prop.glow < 0)
|
||||||
setMeshColor(mesh, m_prop.colors[0]);
|
setMeshColor(mesh, m_prop.colors[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -127,7 +127,6 @@ private:
|
|||||||
float m_step_distance_counter = 0.0f;
|
float m_step_distance_counter = 0.0f;
|
||||||
video::SColor m_last_light = video::SColor(0xFFFFFFFF);
|
video::SColor m_last_light = video::SColor(0xFFFFFFFF);
|
||||||
bool m_is_visible = false;
|
bool m_is_visible = false;
|
||||||
s8 m_glow = 0;
|
|
||||||
// Material
|
// Material
|
||||||
video::E_MATERIAL_TYPE m_material_type;
|
video::E_MATERIAL_TYPE m_material_type;
|
||||||
// Settings
|
// Settings
|
||||||
|
Loading…
Reference in New Issue
Block a user