Skip to content

Commit

Permalink
Rename RenderablePicoModel to StaticModel
Browse files Browse the repository at this point in the history
Replace the excessively long and confusing name with a more logical one. The
RenderablePicoSurface class is also renamed to StaticModelSurface.
  • Loading branch information
Matthew Mott committed Nov 3, 2020
1 parent 0553254 commit 8f2cc49
Show file tree
Hide file tree
Showing 8 changed files with 113 additions and 104 deletions.
4 changes: 2 additions & 2 deletions radiant/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ darkradiant_SOURCES = main.cpp \
modelfile/PicoModelLoader.cpp \
modelfile/PicoModelModule.cpp \
modelfile/PicoModelNode.cpp \
modelfile/RenderablePicoModel.cpp \
modelfile/RenderablePicoSurface.cpp \
modelfile/StaticModel.cpp \
modelfile/StaticModelSurface.cpp \
modelfile/WavefrontExporter.cpp \
modelfile/picomodel/pm_md3.c \
modelfile/picomodel/pm_md2.c \
Expand Down
8 changes: 4 additions & 4 deletions radiant/modelfile/PicoModelLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ scene::INodePtr PicoModelLoader::loadModel(const std::string& modelName)
}

// The cached model should be an PicoModel, otherwise we're in the wrong movie
RenderablePicoModelPtr picoModel =
std::dynamic_pointer_cast<RenderablePicoModel>(model);
StaticModelPtr picoModel =
std::dynamic_pointer_cast<StaticModel>(model);

if (picoModel)
{
Expand Down Expand Up @@ -105,8 +105,8 @@ IModelPtr PicoModelLoader::loadModelFromPath(const std::string& name)
return IModelPtr();
}

RenderablePicoModelPtr modelObj(
new RenderablePicoModel(model, fExt)
StaticModelPtr modelObj(
new StaticModel(model, fExt)
);

// Set the filename
Expand Down
12 changes: 6 additions & 6 deletions radiant/modelfile/PicoModelNode.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "PicoModelNode.h"

#include "RenderablePicoSurface.h"
#include "StaticModelSurface.h"
#include "ivolumetest.h"
#include "ishaders.h"
#include "iscenegraph.h"
Expand All @@ -12,9 +12,9 @@

namespace model {

// greebo: Construct a new RenderablePicoModel instance, we re-use the surfaces only
PicoModelNode::PicoModelNode(const RenderablePicoModelPtr& picoModel) :
_picoModel(new RenderablePicoModel(*picoModel)),
// greebo: Construct a new StaticModel instance, we re-use the surfaces only
PicoModelNode::PicoModelNode(const StaticModelPtr& picoModel) :
_picoModel(new StaticModel(*picoModel)),
_name(picoModel->getFilename()),
_lightList(GlobalRenderSystem().attachLitObject(*this))
{
Expand Down Expand Up @@ -80,11 +80,11 @@ scene::INode::Type PicoModelNode::getNodeType() const
return Type::Model;
}

const RenderablePicoModelPtr& PicoModelNode::getModel() const {
const StaticModelPtr& PicoModelNode::getModel() const {
return _picoModel;
}

void PicoModelNode::setModel(const RenderablePicoModelPtr& model) {
void PicoModelNode::setModel(const StaticModelPtr& model) {
_picoModel = model;
}

Expand Down
14 changes: 9 additions & 5 deletions radiant/modelfile/PicoModelNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@
#include "irenderable.h"
#include "pivot.h"
#include "render/VectorLightList.h"
#include "RenderablePicoModel.h"
#include "StaticModel.h"
#include "scene/Node.h"

namespace model {

/**
* \brief
* Scenegraph node representing a static model
*/
class PicoModelNode :
public scene::Node,
public ModelNode,
Expand All @@ -24,7 +28,7 @@ class PicoModelNode :
{
private:
// The actual model
RenderablePicoModelPtr _picoModel;
StaticModelPtr _picoModel;

std::string _name;

Expand All @@ -41,7 +45,7 @@ class PicoModelNode :
public:
/** Construct a PicoModelNode with a reference to the loaded picoModel.
*/
PicoModelNode(const RenderablePicoModelPtr& picoModel);
PicoModelNode(const StaticModelPtr& picoModel);

virtual ~PicoModelNode();

Expand Down Expand Up @@ -75,8 +79,8 @@ class PicoModelNode :
virtual std::string name() const override;
Type getNodeType() const override;

const RenderablePicoModelPtr& getModel() const;
void setModel(const RenderablePicoModelPtr& model);
const StaticModelPtr& getModel() const;
void setModel(const StaticModelPtr& model);

// LitObject test function
bool intersectsLight(const RendererLight& light) const override;
Expand Down

0 comments on commit 8f2cc49

Please sign in to comment.