From a21d162d5a07da36e52e48fda1bf856ffc41b731 Mon Sep 17 00:00:00 2001 From: vlj Date: Sun, 23 Mar 2014 00:29:47 +0100 Subject: [PATCH] Add an overload for draw2DImage with a single color --- src/graphics/glwrap.cpp | 10 ++++++++++ src/graphics/glwrap.hpp | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/src/graphics/glwrap.cpp b/src/graphics/glwrap.cpp index 3a7364670..e0c384d9a 100644 --- a/src/graphics/glwrap.cpp +++ b/src/graphics/glwrap.cpp @@ -360,6 +360,16 @@ void drawTexQuad(const video::ITexture *texture, float width, float height, } } +void draw2DImage(const video::ITexture* texture, const core::rect& destRect, + const core::rect& sourceRect, const core::rect* clipRect, + const video::SColor &colors, bool useAlphaChannelOfTexture) +{ + video::SColor duplicatedArray[4] = { + colors, colors, colors, colors + }; + draw2DImage(texture, destRect, sourceRect, clipRect, duplicatedArray, useAlphaChannelOfTexture); +} + void draw2DImage(const video::ITexture* texture, const core::rect& destRect, const core::rect& sourceRect, const core::rect* clipRect, const video::SColor* const colors, bool useAlphaChannelOfTexture) diff --git a/src/graphics/glwrap.hpp b/src/graphics/glwrap.hpp index da7ad1f1c..9e3e8cf7b 100644 --- a/src/graphics/glwrap.hpp +++ b/src/graphics/glwrap.hpp @@ -136,6 +136,10 @@ GLint LoadProgram(Types ... args) GLuint getTextureGLuint(irr::video::ITexture *tex); GLuint getDepthTexture(irr::video::ITexture *tex); +void draw2DImage(const irr::video::ITexture* texture, const irr::core::rect& destRect, + const irr::core::rect& sourceRect, const irr::core::rect* clipRect, + const irr::video::SColor &color, bool useAlphaChannelOfTexture); + void draw2DImage(const irr::video::ITexture* texture, const irr::core::rect& destRect, const irr::core::rect& sourceRect, const irr::core::rect* clipRect, const irr::video::SColor* const colors, bool useAlphaChannelOfTexture);