Skip to content

Commit

Permalink
#5584: Rename RenderableStaticSurface to RenderableModelSurface
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Jan 16, 2022
1 parent 6df202a commit 7118ec6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
Expand Up @@ -6,27 +6,27 @@
namespace model
{

// Wraps a StaticModelSurface to implement the IRenderableSurface interface
// required to draw an oriented mesh in the scene.
class RenderableStaticSurface final :
// Wraps an IIndexedModelSurface to implement the IRenderableSurface interface
// required to draw a composite mesh in the scene.
class RenderableModelSurface final :
public render::RenderableSurface
{
private:
const IIndexedModelSurface& _surface;
const Matrix4& _localToWorld;

public:
using Ptr = std::shared_ptr<RenderableStaticSurface>;
using Ptr = std::shared_ptr<RenderableModelSurface>;

// Construct this renderable around the existing surface.
// The reference to the orientation matrix is stored and needs to remain valid
RenderableStaticSurface(const IIndexedModelSurface& surface, const Matrix4& localToWorld) :
RenderableModelSurface(const IIndexedModelSurface& surface, const Matrix4& localToWorld) :
_surface(surface),
_localToWorld(localToWorld)
{}

RenderableStaticSurface(const RenderableStaticSurface& other) = delete;
RenderableStaticSurface& operator=(const RenderableStaticSurface& other) = delete;
RenderableModelSurface(const RenderableModelSurface& other) = delete;
RenderableModelSurface& operator=(const RenderableModelSurface& other) = delete;

const IIndexedModelSurface& getSurface() const
{
Expand Down
2 changes: 1 addition & 1 deletion radiantcore/model/StaticModelNode.cpp
Expand Up @@ -30,7 +30,7 @@ void StaticModelNode::onInsertIntoScene(scene::IMapRootNode& root)
// Renderables will acquire their shaders in onPreRender
_model->foreachSurface([&](const StaticModelSurface& surface)
{
_renderableSurfaces.emplace_back(std::make_shared<RenderableStaticSurface>(surface, localToWorld()));
_renderableSurfaces.emplace_back(std::make_shared<RenderableModelSurface>(surface, localToWorld()));
});

Node::onInsertIntoScene(root);
Expand Down
4 changes: 2 additions & 2 deletions radiantcore/model/StaticModelNode.h
Expand Up @@ -10,7 +10,7 @@
#include "render/VectorLightList.h"
#include "StaticModel.h"
#include "scene/Node.h"
#include "RenderableStaticSurface.h"
#include "RenderableModelSurface.h"

namespace model
{
Expand Down Expand Up @@ -42,7 +42,7 @@ class StaticModelNode final :
std::string _skin;

// The renderable surfaces attached to the shaders
std::vector<RenderableStaticSurface::Ptr> _renderableSurfaces;
std::vector<RenderableModelSurface::Ptr> _renderableSurfaces;

// We need to keep a reference for skin swapping
RenderSystemWeakPtr _renderSystem;
Expand Down
2 changes: 1 addition & 1 deletion tools/msvc/DarkRadiantCore.vcxproj
Expand Up @@ -931,7 +931,7 @@
<ClInclude Include="..\..\radiantcore\model\picomodel\lib\pm_fm.h" />
<ClInclude Include="..\..\radiantcore\model\picomodel\PicoModelLoader.h" />
<ClInclude Include="..\..\radiantcore\model\picomodel\PicoModelModule.h" />
<ClInclude Include="..\..\radiantcore\model\RenderableStaticSurface.h" />
<ClInclude Include="..\..\radiantcore\model\RenderableModelSurface.h" />
<ClInclude Include="..\..\radiantcore\model\StaticModel.h" />
<ClInclude Include="..\..\radiantcore\model\StaticModelNode.h" />
<ClInclude Include="..\..\radiantcore\model\StaticModelSurface.h" />
Expand Down
2 changes: 1 addition & 1 deletion tools/msvc/DarkRadiantCore.vcxproj.filters
Expand Up @@ -2274,7 +2274,7 @@
<ClInclude Include="..\..\radiantcore\brush\RenderableBrushVertices.h">
<Filter>src\brush</Filter>
</ClInclude>
<ClInclude Include="..\..\radiantcore\model\RenderableStaticSurface.h">
<ClInclude Include="..\..\radiantcore\model\RenderableModelSurface.h">
<Filter>src\model</Filter>
</ClInclude>
</ItemGroup>
Expand Down

0 comments on commit 7118ec6

Please sign in to comment.