aboutsummaryrefslogtreecommitdiff
path: root/src/client/render/pipeline.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/render/pipeline.cpp')
-rw-r--r--src/client/render/pipeline.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/client/render/pipeline.cpp b/src/client/render/pipeline.cpp
index 13898f8a4..cc275a7ef 100644
--- a/src/client/render/pipeline.cpp
+++ b/src/client/render/pipeline.cpp
@@ -101,6 +101,16 @@ void TextureBuffer::reset(PipelineContext &context)
RenderSource::reset(context);
}
+void TextureBuffer::swapTextures(u8 texture_a, u8 texture_b)
+{
+ assert(m_definitions[texture_a].valid && m_definitions[texture_b].valid);
+
+ video::ITexture *temp = m_textures[texture_a];
+ m_textures[texture_a] = m_textures[texture_b];
+ m_textures[texture_b] = temp;
+}
+
+
bool TextureBuffer::ensureTexture(video::ITexture **texture, const TextureDefinition& definition, PipelineContext &context)
{
bool modify;
@@ -230,6 +240,16 @@ void SetRenderTargetStep::run(PipelineContext &context)
step->setRenderTarget(target);
}
+SwapTexturesStep::SwapTexturesStep(TextureBuffer *_buffer, u8 _texture_a, u8 _texture_b)
+ : buffer(_buffer), texture_a(_texture_a), texture_b(_texture_b)
+{
+}
+
+void SwapTexturesStep::run(PipelineContext &context)
+{
+ buffer->swapTextures(texture_a, texture_b);
+}
+
RenderSource *RenderPipeline::getInput()
{
return &m_input;