Commit c28f47bb authored by hybrid's avatar hybrid

Added scaling draw2dimage method to burnings video. This fix is based on code...

Added scaling draw2dimage method to burnings video. This fix is based on code submission from Auria.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3701 dfc29bdd-3216-0410-991c-e03cc46cb475
parent de109a1f
This diff is collapsed.
......@@ -12,6 +12,7 @@
#include "CSoftware2MaterialRenderer.h"
#include "S3DVertex.h"
#include "S4DVertex.h"
#include "CBlit.h"
#define MAT_TEXTURE(tex) ( (video::CSoftwareTexture2*) Material.org.getTexture ( tex ) )
......@@ -2249,6 +2250,28 @@ void CBurningVideoDriver::draw2DImage(const video::ITexture* texture, const core
}
//! Draws a part of the texture into the rectangle.
void CBurningVideoDriver::draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect,
const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect,
const video::SColor* const colors, bool useAlphaChannelOfTexture)
{
if (texture)
{
if (texture->getDriverType() != EDT_BURNINGSVIDEO)
{
os::Printer::log("Fatal Error: Tried to copy from a surface not owned by this driver.", ELL_ERROR);
return;
}
if (useAlphaChannelOfTexture)
StretchBlit(BLITTER_TEXTURE_ALPHA_BLEND, RenderTargetSurface, &destRect, &sourceRect,
((CSoftwareTexture2*)texture)->getImage(), (colors ? colors[0].color : 0));
else
StretchBlit(BLITTER_TEXTURE, RenderTargetSurface, &destRect, &sourceRect,
((CSoftwareTexture2*)texture)->getImage(), (colors ? colors[0].color : 0));
}
}
//! Draws a 2d line.
void CBurningVideoDriver::draw2DLine(const core::position2d<s32>& start,
const core::position2d<s32>& end,
......
......@@ -89,6 +89,11 @@ namespace video
const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect = 0,
SColor color=SColor(255,255,255,255), bool useAlphaChannelOfTexture=false);
//! Draws a part of the texture into the rectangle.
virtual void draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect,
const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect = 0,
const video::SColor* const colors=0, bool useAlphaChannelOfTexture=false);
//! Draws a 3d line.
virtual void draw3DLine(const core::vector3df& start,
const core::vector3df& end, SColor color = SColor(255,255,255,255));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment