mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Check if the renderer is initialised. Fixes crash in replay mode.
This was SVN commit r12948.
This commit is contained in:
@@ -106,7 +106,8 @@ CTerrainTextureEntry::CTerrainTextureEntry(CTerrainPropertiesPtr properties, con
|
||||
else if (child_name == el_material)
|
||||
{
|
||||
VfsPath mat = VfsPath("art/materials") / child.GetText().FromUTF8();
|
||||
m_Material = g_Renderer.GetMaterialManager().LoadMaterial(mat);
|
||||
if (CRenderer::IsInitialised())
|
||||
m_Material = g_Renderer.GetMaterialManager().LoadMaterial(mat);
|
||||
}
|
||||
else if (child_name == el_alphamap)
|
||||
{
|
||||
@@ -141,8 +142,9 @@ CTerrainTextureEntry::CTerrainTextureEntry(CTerrainPropertiesPtr properties, con
|
||||
m_Material.AddSampler(CMaterial::TextureSampler(samplers[i].first, texptr));
|
||||
}
|
||||
}
|
||||
|
||||
LoadAlphaMaps(alphamap);
|
||||
|
||||
if (CRenderer::IsInitialised())
|
||||
LoadAlphaMaps(alphamap);
|
||||
|
||||
float texAngle = 0.f;
|
||||
float texSize = 1.f;
|
||||
|
||||
Reference in New Issue
Block a user