Changeset 25224

Timestamp:
Apr 9, 2021, 5:45:31 PM (3 years ago)
Author:
wraitii
Message:

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

Location:
ps/trunk/source
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • ps/trunk/source/graphics/ModelAbstract.h

    r22051 r25224  
    1 /* Copyright (C) 2019 Wildfire Games.
     1/* Copyright (C) 20 Wildfire Games.
    22 * This file is part of 0 A.D.
    33 *
     
    2424#include "simulation2/helpers/Player.h"
    2525
     26
    2627class CModel;
    2728class CModelDecal;
     
    7475
    7576    /// Dynamic cast
    76     virtual CModel* ToCModel() { return NULL; }
     77    virtual CModel; }
    7778
    7879    /// Dynamic cast
    79     virtual CModelDecal* ToCModelDecal() { return NULL; }
     80    virtual CModel; }
    8081
    8182    /// Dynamic cast
    82     virtual CModelParticleEmitter* ToCModelParticleEmitter() { return NULL; }
     83    virtual CModelDecal* ToCModelDecal() { return nullptr; }
     84
     85    /// Dynamic cast
     86    virtual CModelParticleEmitter* ToCModelParticleEmitter() { return nullptr; }
    8387
    8488    // (This dynamic casting is a bit ugly, but we won't have many subclasses
  • ps/trunk/source/graphics/ObjectEntry.cpp

    r25210 r25224  
    2626#include "graphics/Model.h"
    2727#include "graphics/ModelDef.h"
     28
    2829#include "graphics/ObjectBase.h"
    2930#include "graphics/ObjectManager.h"
     
    7677        else
    7778            m_Color = CColor(r/255.0f, g/255.0f, b/255.0f, 1.0f);
     79
     80
     81
     82
     83
     84
    7885    }
    7986
  • ps/trunk/source/renderer/Scene.cpp

    r9151 r25224  
    1 /* Copyright (C) 2011 Wildfire Games.
     1/* Copyright (C) 201 Wildfire Games.
    22 * This file is part of 0 A.D.
    33 *
     
    5656        Submit(model->ToCModelParticleEmitter()->m_Emitter.get());
    5757    }
     58
     59
     60
    5861    else
    5962        debug_warn(L"unknown model type");
Note: See TracChangeset for help on using the changeset viewer.