18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-20 02:15:00 +01:00

Merge pull request #386 from MaSzyna-EU07/fix/editor-trackbed-texture-crash

fix(editor): the texture pickers let go of the images scrolled past, the memory no longer runs out
This commit is contained in:
2026-11-16 16:01:30 +00:00
committed by GitHub
14 changed files with 147 additions and 12 deletions

View File

@@ -44,6 +44,16 @@ gfx_renderer_factory *gfx_renderer_factory::get_instance()
gfx_renderer_factory *gfx_renderer_factory::instance;
void gfx_renderer::Unload_Material( material_handle const Material )
{
if( Material == null_handle ) {
return;
}
for( auto const texture : this->Material( Material )->GetAllTextures() ) {
Unload_Texture( texture );
}
}
material_handle gfx_renderer::Terrain_Material( material_handle const Reuse, std::vector<gfx::terrain_layer> const &Layers, int const Samples, std::uint8_t const *Weights, glm::vec3 const &Placement )
{
// without blending the chunk gets the material which covers the most of it