1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-06 17:41:04 +00:00

Minimap shenanigans

Half broken lol
This commit is contained in:
Gefüllte Taubenbrust 2024-08-29 17:35:35 +02:00
parent e5afca89f7
commit ed4cc81c23
3 changed files with 18 additions and 11 deletions

View file

@ -384,6 +384,7 @@ class GameGlobalShaderConstantSetter : public IShaderConstantSetter
CachedPixelShaderSetting<float, 3> m_artificial_light{ "artificialLight" };
CachedPixelShaderSetting<float, 3> m_day_light{"dayLight"};
CachedPixelShaderSetting<float, 3> m_minimap_yaw{"yawVec"};
CachedPixelShaderSetting<float> m_minimap_size{"mapSize"};
CachedVertexShaderSetting<float, 3> m_camera_offset_vertex{"cameraOffset"};
CachedPixelShaderSetting<float, 3> m_camera_offset_pixel{ "cameraOffset" };
CachedVertexShaderSetting<float, 3> m_camera_position_vertex{"cameraPosition"};
@ -507,6 +508,8 @@ public:
if (m_client->getMinimap()) {
v3f minimap_yaw = m_client->getMinimap()->getYawVec();
m_minimap_yaw.set(minimap_yaw, services);
float minimap_size = m_client->getMinimap()->getModeDef().map_size;
m_minimap_size.set(&minimap_size, services);
}
v3f offset = intToFloat(m_client->getCamera()->getOffset(), BS);

View file

@ -607,8 +607,8 @@ void Minimap::drawMinimap(core::rect<s32> rect)
video::SMaterial &material = m_meshbuffer->getMaterial();
material.forEachTexture([] (auto &tex) {
tex.MinFilter = video::ETMINF_LINEAR_MIPMAP_LINEAR;
tex.MagFilter = video::ETMAGF_LINEAR;
tex.MinFilter = video::ETMINF_NEAREST_MIPMAP_NEAREST;
tex.MagFilter = video::ETMAGF_NEAREST;
});
material.Lighting = false;
material.TextureLayers[0].Texture = minimap_texture;
@ -648,6 +648,7 @@ void Minimap::drawMinimap(core::rect<s32> rect)
driver->setTransform(video::ETS_WORLD, matrix);
driver->setMaterial(material);
driver->drawMeshBuffer(m_meshbuffer);
driver->drawMeshBuffer(m_meshbuffer);
// Reset transformations
driver->setTransform(video::ETS_VIEW, oldViewMat);