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

Merge branch 'master' into feat/renderers-cleanup

This commit is contained in:
2026-11-16 21:44:48 +01:00
264 changed files with 41203 additions and 10041 deletions

View File

@@ -43,6 +43,11 @@ std::unique_ptr<gfx_renderer> gfx_renderer_factory::create(const std::string &ba
return nullptr;
}
bool gfx_renderer_factory::has_backend(const std::string &name) const
{
return backends.contains(name);
}
gfx_renderer_factory *gfx_renderer_factory::get_instance()
{
if (!instance)
@@ -53,6 +58,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, int const HoleSamples, std::uint8_t const *Holes )
{
// without blending the chunk gets the material which covers the most of it