forked from mirrors/0ad
Allow empty actor files.
This allows empty actor files -> they map to a dummy object that renders nothing. The use case is automatically hiding objects at lower quality levels & LOD settings. Differential Revision: https://code.wildfiregames.com/D3819 This was SVN commit r25224.
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include "graphics/MeshManager.h"
|
||||
#include "graphics/Model.h"
|
||||
#include "graphics/ModelDef.h"
|
||||
#include "graphics/ModelDummy.h"
|
||||
#include "graphics/ObjectBase.h"
|
||||
#include "graphics/ObjectManager.h"
|
||||
#include "graphics/ParticleManager.h"
|
||||
@@ -77,6 +78,12 @@ bool CObjectEntry::BuildVariation(const std::vector<const std::set<CStr>*>& comp
|
||||
m_Color = CColor(r/255.0f, g/255.0f, b/255.0f, 1.0f);
|
||||
}
|
||||
|
||||
if (variation.model.empty())
|
||||
{
|
||||
m_Model = new CModelDummy();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (variation.decal.m_SizeX && variation.decal.m_SizeZ)
|
||||
{
|
||||
CMaterial material = g_Renderer.GetMaterialManager().LoadMaterial(m_Base->m_Material);
|
||||
|
||||
Reference in New Issue
Block a user