Skip to content

Commit

Permalink
#5532: Rename ShaderLayer interface to IShaderLayer
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Mar 13, 2021
1 parent dd315a2 commit c9d942b
Show file tree
Hide file tree
Showing 24 changed files with 222 additions and 222 deletions.
14 changes: 7 additions & 7 deletions include/iglrender.h
Expand Up @@ -172,11 +172,11 @@ class OpenGLState
* which hold the actual values of many parameters, some of them
* time-dependent or depending on entity parameters.
*/
ShaderLayer::Ptr stage0;
ShaderLayer::Ptr stage1;
ShaderLayer::Ptr stage2;
ShaderLayer::Ptr stage3;
ShaderLayer::Ptr stage4;
IShaderLayer::Ptr stage0;
IShaderLayer::Ptr stage1;
IShaderLayer::Ptr stage2;
IShaderLayer::Ptr stage3;
IShaderLayer::Ptr stage4;

/**
* \brief
Expand Down Expand Up @@ -211,7 +211,7 @@ class OpenGLState
* \brief
* The cube-map texgen mode for rendering.
*/
ShaderLayer::CubeMapMode cubeMapMode;
IShaderLayer::CubeMapMode cubeMapMode;

/// Default constructor
OpenGLState()
Expand All @@ -235,6 +235,6 @@ class OpenGLState
m_linestipple_factor(1),
m_linestipple_pattern(0xAAAA),
glProgram(NULL),
cubeMapMode(ShaderLayer::CUBE_MAP_NONE)
cubeMapMode(IShaderLayer::CUBE_MAP_NONE)
{ }
};
6 changes: 3 additions & 3 deletions include/irender.h
Expand Up @@ -305,14 +305,14 @@ class RenderInfo
Vector3 _viewerLocation;

// Cube map mode
ShaderLayer::CubeMapMode _cubeMapMode;
IShaderLayer::CubeMapMode _cubeMapMode;

public:

/// Default constructor
RenderInfo(RenderStateFlags flags = RENDER_DEFAULT,
const Vector3& viewer = Vector3(0, 0, 0),
ShaderLayer::CubeMapMode cubeMode = ShaderLayer::CUBE_MAP_NONE)
IShaderLayer::CubeMapMode cubeMode = IShaderLayer::CUBE_MAP_NONE)
: _flags(flags),
_viewerLocation(viewer),
_cubeMapMode(cubeMode)
Expand All @@ -337,7 +337,7 @@ class RenderInfo
}

/// Get the cube map mode.
ShaderLayer::CubeMapMode getCubeMapMode() const
IShaderLayer::CubeMapMode getCubeMapMode() const
{
return _cubeMapMode;
}
Expand Down
10 changes: 5 additions & 5 deletions include/ishaderlayer.h
Expand Up @@ -51,10 +51,10 @@ class BlendFunc
* Each shader layer contains an image texture, a blend mode (e.g. add,
* modulate) and various other data.
*/
class ShaderLayer
class IShaderLayer
{
public:
using Ptr = std::shared_ptr<ShaderLayer>;
using Ptr = std::shared_ptr<IShaderLayer>;

/// Enumeration of layer types.
enum Type
Expand Down Expand Up @@ -103,7 +103,7 @@ class ShaderLayer
* \brief
* Destructor
*/
virtual ~ShaderLayer() {}
virtual ~IShaderLayer() {}

/// Return the layer type.
virtual Type getType() const = 0;
Expand Down Expand Up @@ -374,7 +374,7 @@ class ShaderLayer

/**
* \brief
* Vector of ShaderLayer pointers.
* Vector of IShaderLayer pointers.
*/
typedef std::vector<ShaderLayer::Ptr> ShaderLayerVector;
typedef std::vector<IShaderLayer::Ptr> IShaderLayerVector;

6 changes: 3 additions & 3 deletions include/ishaders.h
Expand Up @@ -309,15 +309,15 @@ class Material
virtual bool isDiscrete() const = 0;

/// Return the first material layer, if any
virtual ShaderLayer* firstLayer() const = 0;
virtual IShaderLayer* firstLayer() const = 0;

/**
* \brief Return a std::vector containing all layers in this material
* shader.
*
* This includes all diffuse, bump, specular or blend layers.
*/
virtual const ShaderLayerVector& getAllLayers() const = 0;
virtual const IShaderLayerVector& getAllLayers() const = 0;

/// Return the 2D light falloff texture, if this is a light shader
virtual TexturePtr lightFalloffImage() = 0;
Expand Down Expand Up @@ -466,7 +466,7 @@ class MaterialManager
* \param type
* The type of interaction layer whose default texture is required.
*/
virtual TexturePtr getDefaultInteractionTexture(ShaderLayer::Type type) = 0;
virtual TexturePtr getDefaultInteractionTexture(IShaderLayer::Type type) = 0;

/**
* greebo: This is a substitution for the "old" TexturesCache method
Expand Down
12 changes: 6 additions & 6 deletions libs/materials/ParseLib.h
Expand Up @@ -115,15 +115,15 @@ constexpr std::pair<const char*, std::pair<const char*, const char*>> BlendTypeS
{ "none", { "gl_zero", "gl_one" } },
};

constexpr std::pair<const char*, ShaderLayer::TexGenType> TexGenTypeNames[]
constexpr std::pair<const char*, IShaderLayer::TexGenType> TexGenTypeNames[]
{
{ "normal", ShaderLayer::TEXGEN_NORMAL },
{ "reflect", ShaderLayer::TEXGEN_REFLECT },
{ "skybox", ShaderLayer::TEXGEN_SKYBOX },
{ "wobbleSky", ShaderLayer::TEXGEN_WOBBLESKY },
{ "normal", IShaderLayer::TEXGEN_NORMAL },
{ "reflect", IShaderLayer::TEXGEN_REFLECT },
{ "skybox", IShaderLayer::TEXGEN_SKYBOX },
{ "wobbleSky", IShaderLayer::TEXGEN_WOBBLESKY },
};

inline std::string getStringForTexGenType(ShaderLayer::TexGenType type)
inline std::string getStringForTexGenType(IShaderLayer::TexGenType type)
{
for (const auto& pair : TexGenTypeNames)
{
Expand Down
6 changes: 3 additions & 3 deletions libs/wxutil/preview/GuiRenderer.cpp
Expand Up @@ -112,13 +112,13 @@ void GuiRenderer::render(const gui::IGuiWindowDefPtr& window, bool ignoreFilter)
if (window->backgroundShader != NULL && (matcolor[3] > 0 || _ignoreVisibility))
{
// Get the diffuse layer
const ShaderLayerVector layers = window->backgroundShader->getAllLayers();
const IShaderLayerVector layers = window->backgroundShader->getAllLayers();

TexturePtr tex;

for (ShaderLayerVector::const_iterator i = layers.begin(); i != layers.end(); ++i)
for (IShaderLayerVector::const_iterator i = layers.begin(); i != layers.end(); ++i)
{
if ((*i)->getType() == ShaderLayer::DIFFUSE)
if ((*i)->getType() == IShaderLayer::DIFFUSE)
{
// Found the diffuse
tex = (*i)->getTexture();
Expand Down
4 changes: 2 additions & 2 deletions radiant/ui/common/ShaderSelector.cpp
Expand Up @@ -259,7 +259,7 @@ bool ShaderSelector::onPreviewRender()
// Check what part of the shader we should display in the preview
if (_isLightTexture) {
// This is a light, take the first layer texture
const ShaderLayer* first = shader->firstLayer();
const IShaderLayer* first = shader->firstLayer();
if (first != NULL) {
tex = shader->firstLayer()->getTexture();
glBindTexture (GL_TEXTURE_2D, tex->getGLTexNum());
Expand Down Expand Up @@ -343,7 +343,7 @@ void ShaderSelector::displayLightShaderInfo(const MaterialPtr& shader,
wxutil::TreeModel& listStore,
int attrCol, int valueCol)
{
const ShaderLayer* first = shader->firstLayer();
const IShaderLayer* first = shader->firstLayer();
std::string texName = _("None");

if (first != NULL)
Expand Down

0 comments on commit c9d942b

Please sign in to comment.