Commit 5f4c2795 authored by nadro's avatar nadro

- Added support for rotation 2D images. This patch base on FuzzYspo0N patch...

- Added support for rotation 2D images. This patch base on FuzzYspo0N patch from irrEXT. (Software drivers aren't supported).

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4478 dfc29bdd-3216-0410-991c-e03cc46cb475
parent c2b593fb
......@@ -827,10 +827,11 @@ namespace video
alpha component is used: If alpha is other than 255, the image
will be transparent.
\param useAlphaChannelOfTexture: If true, the alpha channel of
the texture is used to draw the image.*/
the texture is used to draw the image.
\param rotation Rotation of the image. */
virtual void draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos,
const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect =0,
SColor color=SColor(255,255,255,255), bool useAlphaChannelOfTexture=false) =0;
SColor color=SColor(255,255,255,255), bool useAlphaChannelOfTexture=false, f32 rotation = 0.f) =0;
//! Draws a set of 2d images, using a color and the alpha channel of the texture.
/** The images are drawn beginning at pos and concatenated in
......@@ -851,7 +852,8 @@ namespace video
Note that the alpha component is used. If alpha is other than
255, the image will be transparent.
\param useAlphaChannelOfTexture: If true, the alpha channel of
the texture is used to draw the image. */
the texture is used to draw the image.
\param rotation Rotation of the image. */
virtual void draw2DImageBatch(const video::ITexture* texture,
const core::position2d<s32>& pos,
const core::array<core::rect<s32> >& sourceRects,
......@@ -859,7 +861,8 @@ namespace video
s32 kerningWidth=0,
const core::rect<s32>* clipRect=0,
SColor color=SColor(255,255,255,255),
bool useAlphaChannelOfTexture=false) =0;
bool useAlphaChannelOfTexture=false,
f32 rotation = 0.f) =0;
//! Draws a set of 2d images, using a color and the alpha channel of the texture.
/** All drawings are clipped against clipRect (if != 0).
......@@ -876,13 +879,15 @@ namespace video
Note that the alpha component is used. If alpha is other than
255, the image will be transparent.
\param useAlphaChannelOfTexture: If true, the alpha channel of
the texture is used to draw the image. */
the texture is used to draw the image.
\param rotation Rotation of the image. */
virtual void draw2DImageBatch(const video::ITexture* texture,
const core::array<core::position2d<s32> >& positions,
const core::array<core::rect<s32> >& sourceRects,
const core::rect<s32>* clipRect=0,
SColor color=SColor(255,255,255,255),
bool useAlphaChannelOfTexture=false) =0;
bool useAlphaChannelOfTexture=false,
f32 rotation = 0.f) =0;
//! Draws a part of the texture into the rectangle. Note that colors must be an array of 4 colors if used.
/** Suggested and first implemented by zola.
......@@ -893,10 +898,11 @@ namespace video
\param colors Array of 4 colors denoting the color values of
the corners of the destRect
\param useAlphaChannelOfTexture True if alpha channel will be
blended. */
blended.
\param rotation Rotation of the image. */
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) =0;
const video::SColor * const colors=0, bool useAlphaChannelOfTexture=false, f32 rotation = 0.f) =0;
//! Draws a 2d rectangle.
/** \param color Color of the rectangle to draw. The alpha
......
......@@ -1009,7 +1009,7 @@ void CD3D8Driver::draw2DImage(const video::ITexture* texture,
const core::position2d<s32>& pos,
const core::rect<s32>& sourceRect,
const core::rect<s32>* clipRect, SColor color,
bool useAlphaChannelOfTexture)
bool useAlphaChannelOfTexture, f32 rotation)
{
if (!texture)
return;
......@@ -1112,21 +1112,34 @@ void CD3D8Driver::draw2DImage(const video::ITexture* texture,
setRenderStates2DMode(color.getAlpha()<255, true, useAlphaChannelOfTexture);
core::vector2df fpos[4];
fpos[0] = core::vector2df((f32)poss.UpperLeftCorner.X, (f32)poss.UpperLeftCorner.Y);
fpos[1] = core::vector2df((f32)poss.LowerRightCorner.X, (f32)poss.UpperLeftCorner.Y);
fpos[2] = core::vector2df((f32)poss.LowerRightCorner.X, (f32)poss.LowerRightCorner.Y);
fpos[3] = core::vector2df((f32)poss.UpperLeftCorner.X, (f32)poss.LowerRightCorner.Y);
if(rotation > 0.f)
{
if(rotation > 360.0f)
rotation = fmodf(rotation, 360.f);
core::vector2d<s32> rcenter = poss.getCenter();
for (u32 i = 0; i < 4; ++i)
fpos[i].rotateBy(rotation, core::vector2df(rcenter.X, rcenter.Y));
}
S3DVertex vtx[4];
vtx[0] = S3DVertex((f32)poss.UpperLeftCorner.X,
(f32)poss.UpperLeftCorner.Y, 0.0f,
vtx[0] = S3DVertex(fpos[0].X, fpos[0].Y, 0.0f,
0.0f, 0.0f, 0.0f, color,
tcoords.UpperLeftCorner.X, tcoords.UpperLeftCorner.Y);
vtx[1] = S3DVertex((f32)poss.LowerRightCorner.X,
(f32)poss.UpperLeftCorner.Y, 0.0f,
vtx[1] = S3DVertex(fpos[1].X, fpos[1].Y, 0.0f,
0.0f, 0.0f, 0.0f, color,
tcoords.LowerRightCorner.X, tcoords.UpperLeftCorner.Y);
vtx[2] = S3DVertex((f32)poss.LowerRightCorner.X,
(f32)poss.LowerRightCorner.Y, 0.0f,
vtx[2] = S3DVertex(fpos[2].X, fpos[2].Y, 0.0f,
0.0f, 0.0f, 0.0f, color,
tcoords.LowerRightCorner.X, tcoords.LowerRightCorner.Y);
vtx[3] = S3DVertex((f32)poss.UpperLeftCorner.X,
(f32)poss.LowerRightCorner.Y, 0.0f,
vtx[3] = S3DVertex(fpos[3].X, fpos[3].Y, 0.0f,
0.0f, 0.0f, 0.0f, color,
tcoords.UpperLeftCorner.X, tcoords.LowerRightCorner.Y);
......@@ -1144,7 +1157,8 @@ void CD3D8Driver::draw2DImage(const video::ITexture* texture,
const core::rect<s32>& sourceRect,
const core::rect<s32>* clipRect,
const video::SColor* const colors,
bool useAlphaChannelOfTexture)
bool useAlphaChannelOfTexture,
f32 rotation)
{
if(!texture)
return;
......@@ -1188,17 +1202,34 @@ void CD3D8Driver::draw2DImage(const video::ITexture* texture,
const video::SColor* const useColor = colors ? colors : temp;
core::vector2df fpos[4];
fpos[0] = core::vector2df((f32)clippedRect.UpperLeftCorner.X, (f32)clippedRect.UpperLeftCorner.Y);
fpos[1] = core::vector2df((f32)clippedRect.LowerRightCorner.X, (f32)clippedRect.UpperLeftCorner.Y);
fpos[2] = core::vector2df((f32)clippedRect.LowerRightCorner.X, (f32)clippedRect.LowerRightCorner.Y);
fpos[3] = core::vector2df((f32)clippedRect.UpperLeftCorner.X, (f32)clippedRect.LowerRightCorner.Y);
if(rotation > 0.f)
{
if(rotation > 360.0f)
rotation = fmodf(rotation, 360.f);
core::vector2d<s32> rcenter = clippedRect.getCenter();
for (u32 i = 0; i < 4; ++i)
fpos[i].rotateBy(rotation, core::vector2df(rcenter.X, rcenter.Y));
}
S3DVertex vtx[4]; // clock wise
vtx[0] = S3DVertex((f32)clippedRect.UpperLeftCorner.X, (f32)clippedRect.UpperLeftCorner.Y, 0.0f,
vtx[0] = S3DVertex(fpos[0].X, fpos[0].Y, 0.0f,
0.0f, 0.0f, 0.0f, useColor[0],
tcoords.UpperLeftCorner.X, tcoords.UpperLeftCorner.Y);
vtx[1] = S3DVertex((f32)clippedRect.LowerRightCorner.X, (f32)clippedRect.UpperLeftCorner.Y, 0.0f,
vtx[1] = S3DVertex(fpos[1].X, fpos[1].Y, 0.0f,
0.0f, 0.0f, 0.0f, useColor[3],
tcoords.LowerRightCorner.X, tcoords.UpperLeftCorner.Y);
vtx[2] = S3DVertex((f32)clippedRect.LowerRightCorner.X, (f32)clippedRect.LowerRightCorner.Y, 0.0f,
vtx[2] = S3DVertex(fpos[2].X, fpos[2].Y, 0.0f,
0.0f, 0.0f, 0.0f, useColor[2],
tcoords.LowerRightCorner.X, tcoords.LowerRightCorner.Y);
vtx[3] = S3DVertex((f32)clippedRect.UpperLeftCorner.X, (f32)clippedRect.LowerRightCorner.Y, 0.0f,
vtx[3] = S3DVertex(fpos[3].X, fpos[3].Y, 0.0f,
0.0f, 0.0f, 0.0f, useColor[1],
tcoords.UpperLeftCorner.X, tcoords.LowerRightCorner.Y);
......
......@@ -81,12 +81,12 @@ namespace video
//! draws an 2d image, using a color (if color is other then Color(255,255,255,255)) and the alpha channel of the texture if wanted.
virtual void draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos,
const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect = 0,
SColor color=SColor(255,255,255,255), bool useAlphaChannelOfTexture=false);
SColor color=SColor(255,255,255,255), bool useAlphaChannelOfTexture=false, f32 rotation = 0.f);
//! 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);
const video::SColor* const colors=0, bool useAlphaChannelOfTexture=false, f32 rotation = 0.f);
//!Draws an 2d rectangle with a gradient.
virtual void draw2DRectangle(const core::rect<s32>& pos,
......
......@@ -1577,7 +1577,8 @@ void CD3D9Driver::draw2DImage(const video::ITexture* texture,
const core::rect<s32>& sourceRect,
const core::rect<s32>* clipRect,
const video::SColor* const colors,
bool useAlphaChannelOfTexture)
bool useAlphaChannelOfTexture,
f32 rotation)
{
if(!texture)
return;
......@@ -1601,17 +1602,34 @@ void CD3D9Driver::draw2DImage(const video::ITexture* texture,
const video::SColor* const useColor = colors ? colors : temp;
core::vector2df fpos[4];
fpos[0] = core::vector2df((f32)destRect.UpperLeftCorner.X, (f32)destRect.UpperLeftCorner.Y);
fpos[1] = core::vector2df((f32)destRect.LowerRightCorner.X, (f32)destRect.UpperLeftCorner.Y);
fpos[2] = core::vector2df((f32)destRect.LowerRightCorner.X, (f32)destRect.LowerRightCorner.Y);
fpos[3] = core::vector2df((f32)destRect.UpperLeftCorner.X, (f32)destRect.LowerRightCorner.Y);
if(rotation > 0.f)
{
if(rotation > 360.0f)
rotation = fmodf(rotation, 360.f);
core::vector2d<s32> rcenter = destRect.getCenter();
for (u32 i = 0; i < 4; ++i)
fpos[i].rotateBy(rotation, core::vector2df(rcenter.X, rcenter.Y));
}
S3DVertex vtx[4]; // clock wise
vtx[0] = S3DVertex((f32)destRect.UpperLeftCorner.X, (f32)destRect.UpperLeftCorner.Y, 0.0f,
vtx[0] = S3DVertex(fpos[0].X, fpos[0].Y, 0.0f,
0.0f, 0.0f, 0.0f, useColor[0],
tcoords.UpperLeftCorner.X, tcoords.UpperLeftCorner.Y);
vtx[1] = S3DVertex((f32)destRect.LowerRightCorner.X, (f32)destRect.UpperLeftCorner.Y, 0.0f,
vtx[1] = S3DVertex(fpos[1].X, fpos[1].Y, 0.0f,
0.0f, 0.0f, 0.0f, useColor[3],
tcoords.LowerRightCorner.X, tcoords.UpperLeftCorner.Y);
vtx[2] = S3DVertex((f32)destRect.LowerRightCorner.X, (f32)destRect.LowerRightCorner.Y, 0.0f,
vtx[2] = S3DVertex(fpos[2].X, fpos[2].Y, 0.0f,
0.0f, 0.0f, 0.0f, useColor[2],
tcoords.LowerRightCorner.X, tcoords.LowerRightCorner.Y);
vtx[3] = S3DVertex((f32)destRect.UpperLeftCorner.X, (f32)destRect.LowerRightCorner.Y, 0.0f,
vtx[3] = S3DVertex(fpos[3].X, fpos[3].Y, 0.0f,
0.0f, 0.0f, 0.0f, useColor[1],
tcoords.UpperLeftCorner.X, tcoords.LowerRightCorner.Y);
......@@ -1649,7 +1667,8 @@ void CD3D9Driver::draw2DImageBatch(const video::ITexture* texture,
const core::array<core::rect<s32> >& sourceRects,
const core::rect<s32>* clipRect,
SColor color,
bool useAlphaChannelOfTexture)
bool useAlphaChannelOfTexture,
f32 rotation)
{
if (!texture)
return;
......@@ -1757,16 +1776,33 @@ void CD3D9Driver::draw2DImageBatch(const video::ITexture* texture,
const core::rect<s32> poss(targetPos, sourceSize);
vtx.push_back(S3DVertex((f32)poss.UpperLeftCorner.X, (f32)poss.UpperLeftCorner.Y, 0.0f,
core::vector2df fpos[4];
fpos[0] = core::vector2df((f32)poss.UpperLeftCorner.X, (f32)poss.UpperLeftCorner.Y);
fpos[1] = core::vector2df((f32)poss.LowerRightCorner.X, (f32)poss.UpperLeftCorner.Y);
fpos[2] = core::vector2df((f32)poss.LowerRightCorner.X, (f32)poss.LowerRightCorner.Y);
fpos[3] = core::vector2df((f32)poss.UpperLeftCorner.X, (f32)poss.LowerRightCorner.Y);
if(rotation > 0.f)
{
if(rotation > 360.0f)
rotation = fmodf(rotation, 360.f);
core::vector2d<s32> rcenter = poss.getCenter();
for (u32 i = 0; i < 4; ++i)
fpos[i].rotateBy(rotation, core::vector2df(rcenter.X, rcenter.Y));
}
vtx.push_back(S3DVertex(fpos[0].X, fpos[0].Y, 0.0f,
0.0f, 0.0f, 0.0f, color,
tcoords.UpperLeftCorner.X, tcoords.UpperLeftCorner.Y));
vtx.push_back(S3DVertex((f32)poss.LowerRightCorner.X, (f32)poss.UpperLeftCorner.Y, 0.0f,
vtx.push_back(S3DVertex(fpos[1].X, fpos[1].Y, 0.0f,
0.0f, 0.0f, 0.0f, color,
tcoords.LowerRightCorner.X, tcoords.UpperLeftCorner.Y));
vtx.push_back(S3DVertex((f32)poss.LowerRightCorner.X, (f32)poss.LowerRightCorner.Y, 0.0f,
vtx.push_back(S3DVertex(fpos[2].X, fpos[2].Y, 0.0f,
0.0f, 0.0f, 0.0f, color,
tcoords.LowerRightCorner.X, tcoords.LowerRightCorner.Y));
vtx.push_back(S3DVertex((f32)poss.UpperLeftCorner.X, (f32)poss.LowerRightCorner.Y, 0.0f,
vtx.push_back(S3DVertex(fpos[3].X, fpos[3].Y, 0.0f,
0.0f, 0.0f, 0.0f, color,
tcoords.UpperLeftCorner.X, tcoords.LowerRightCorner.Y));
......@@ -1796,7 +1832,7 @@ void CD3D9Driver::draw2DImage(const video::ITexture* texture,
const core::position2d<s32>& pos,
const core::rect<s32>& sourceRect,
const core::rect<s32>* clipRect, SColor color,
bool useAlphaChannelOfTexture)
bool useAlphaChannelOfTexture, f32 rotation)
{
if (!texture)
return;
......@@ -1900,17 +1936,34 @@ void CD3D9Driver::draw2DImage(const video::ITexture* texture,
setRenderStates2DMode(color.getAlpha()<255, true, useAlphaChannelOfTexture);
core::vector2df fpos[4];
fpos[0] = core::vector2df((f32)poss.UpperLeftCorner.X, (f32)poss.UpperLeftCorner.Y);
fpos[1] = core::vector2df((f32)poss.LowerRightCorner.X, (f32)poss.UpperLeftCorner.Y);
fpos[2] = core::vector2df((f32)poss.LowerRightCorner.X, (f32)poss.LowerRightCorner.Y);
fpos[3] = core::vector2df((f32)poss.UpperLeftCorner.X, (f32)poss.LowerRightCorner.Y);
if(rotation > 0.f)
{
if(rotation > 360.0f)
rotation = fmodf(rotation, 360.f);
core::vector2d<s32> rcenter = poss.getCenter();
for (u32 i = 0; i < 4; ++i)
fpos[i].rotateBy(rotation, core::vector2df(rcenter.X, rcenter.Y));
}
S3DVertex vtx[4];
vtx[0] = S3DVertex((f32)poss.UpperLeftCorner.X, (f32)poss.UpperLeftCorner.Y, 0.0f,
vtx[0] = S3DVertex(fpos[0].X, fpos[0].Y, 0.0f,
0.0f, 0.0f, 0.0f, color,
tcoords.UpperLeftCorner.X, tcoords.UpperLeftCorner.Y);
vtx[1] = S3DVertex((f32)poss.LowerRightCorner.X, (f32)poss.UpperLeftCorner.Y, 0.0f,
vtx[1] = S3DVertex(fpos[1].X, fpos[1].Y, 0.0f,
0.0f, 0.0f, 0.0f, color,
tcoords.LowerRightCorner.X, tcoords.UpperLeftCorner.Y);
vtx[2] = S3DVertex((f32)poss.LowerRightCorner.X, (f32)poss.LowerRightCorner.Y, 0.0f,
vtx[2] = S3DVertex(fpos[2].X, fpos[2].Y, 0.0f,
0.0f, 0.0f, 0.0f, color,
tcoords.LowerRightCorner.X, tcoords.LowerRightCorner.Y);
vtx[3] = S3DVertex((f32)poss.UpperLeftCorner.X, (f32)poss.LowerRightCorner.Y, 0.0f,
vtx[3] = S3DVertex(fpos[3].X, fpos[3].Y, 0.0f,
0.0f, 0.0f, 0.0f, color,
tcoords.UpperLeftCorner.X, tcoords.LowerRightCorner.Y);
......
......@@ -163,12 +163,12 @@ namespace video
//! draws an 2d image, using a color (if color is other then Color(255,255,255,255)) and the alpha channel of the texture if wanted.
virtual void draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos,
const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect = 0,
SColor color=SColor(255,255,255,255), bool useAlphaChannelOfTexture=false);
SColor color=SColor(255,255,255,255), bool useAlphaChannelOfTexture=false, f32 rotation = 0.f);
//! 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);
const video::SColor* const colors=0, bool useAlphaChannelOfTexture=false, f32 rotation = 0.f);
//! Draws a set of 2d images, using a color and the alpha channel of the texture.
virtual void draw2DImageBatch(const video::ITexture* texture,
......@@ -176,7 +176,8 @@ namespace video
const core::array<core::rect<s32> >& sourceRects,
const core::rect<s32>* clipRect=0,
SColor color=SColor(255,255,255,255),
bool useAlphaChannelOfTexture=false);
bool useAlphaChannelOfTexture=false,
f32 rotation = 0.f);
//!Draws an 2d rectangle with a gradient.
virtual void draw2DRectangle(const core::rect<s32>& pos,
......
......@@ -736,14 +736,15 @@ void CNullDriver::draw2DImageBatch(const video::ITexture* texture,
const core::array<s32>& indices,
s32 kerningWidth,
const core::rect<s32>* clipRect, SColor color,
bool useAlphaChannelOfTexture)
bool useAlphaChannelOfTexture,
f32 rotation)
{
core::position2d<s32> target(pos);
for (u32 i=0; i<indices.size(); ++i)
{
draw2DImage(texture, target, sourceRects[indices[i]],
clipRect, color, useAlphaChannelOfTexture);
clipRect, color, useAlphaChannelOfTexture, rotation);
target.X += sourceRects[indices[i]].getWidth();
target.X += kerningWidth;
}
......@@ -756,14 +757,15 @@ void CNullDriver::draw2DImageBatch(const video::ITexture* texture,
const core::array<core::rect<s32> >& sourceRects,
const core::rect<s32>* clipRect,
SColor color,
bool useAlphaChannelOfTexture)
bool useAlphaChannelOfTexture,
f32 rotation)
{
const irr::u32 drawCount = core::min_<u32>(positions.size(), sourceRects.size());
for (u32 i=0; i<drawCount; ++i)
{
draw2DImage(texture, positions[i], sourceRects[i],
clipRect, color, useAlphaChannelOfTexture);
clipRect, color, useAlphaChannelOfTexture, rotation);
}
}
......@@ -771,12 +773,12 @@ void CNullDriver::draw2DImageBatch(const video::ITexture* texture,
//! Draws a part of the texture into the rectangle.
void CNullDriver::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)
const video::SColor* const colors, bool useAlphaChannelOfTexture, f32 rotation)
{
if (destRect.isValid())
draw2DImage(texture, core::position2d<s32>(destRect.UpperLeftCorner),
sourceRect, clipRect, colors?colors[0]:video::SColor(0xffffffff),
useAlphaChannelOfTexture);
useAlphaChannelOfTexture, rotation);
}
......@@ -784,7 +786,7 @@ void CNullDriver::draw2DImage(const video::ITexture* texture, const core::rect<s
void CNullDriver::draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos,
const core::rect<s32>& sourceRect,
const core::rect<s32>* clipRect, SColor color,
bool useAlphaChannelOfTexture)
bool useAlphaChannelOfTexture, f32 rotation)
{
}
......
......@@ -167,7 +167,8 @@ namespace video
s32 kerningWidth = 0,
const core::rect<s32>* clipRect = 0,
SColor color=SColor(255,255,255,255),
bool useAlphaChannelOfTexture=false);
bool useAlphaChannelOfTexture=false,
f32 rotation = 0.f);
//! Draws a set of 2d images, using a color and the alpha channel of the texture.
/** All drawings are clipped against clipRect (if != 0).
......@@ -190,17 +191,18 @@ namespace video
const core::array<core::rect<s32> >& sourceRects,
const core::rect<s32>* clipRect=0,
SColor color=SColor(255,255,255,255),
bool useAlphaChannelOfTexture=false);
bool useAlphaChannelOfTexture=false,
f32 rotation = 0.f);
//! Draws a 2d image, using a color (if color is other then Color(255,255,255,255)) and the alpha channel of the texture if wanted.
virtual void draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos,
const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect = 0,
SColor color=SColor(255,255,255,255), bool useAlphaChannelOfTexture=false);
SColor color=SColor(255,255,255,255), bool useAlphaChannelOfTexture=false, f32 rotation = 0.f);
//! 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);
const video::SColor* const colors=0, bool useAlphaChannelOfTexture=false, f32 rotation = 0.f);
//! Draws a 2d rectangle
virtual void draw2DRectangle(SColor color, const core::rect<s32>& pos, const core::rect<s32>* clip = 0);
......
This diff is collapsed.
......@@ -158,12 +158,13 @@ namespace video
const core::array<core::rect<s32> >& sourceRects,
const core::rect<s32>* clipRect,
SColor color,
bool useAlphaChannelOfTexture);
bool useAlphaChannelOfTexture,
f32 rotation = 0.f);
//! draws an 2d image, using a color (if color is other then Color(255,255,255,255)) and the alpha channel of the texture if wanted.
virtual void draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos,
const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect = 0,
SColor color=SColor(255,255,255,255), bool useAlphaChannelOfTexture=false);
SColor color=SColor(255,255,255,255), bool useAlphaChannelOfTexture=false, f32 rotation = 0.f);
//! draws a set of 2d images, using a color and the alpha
/** channel of the texture if desired. The images are drawn
......@@ -187,12 +188,13 @@ namespace video
const core::array<s32>& indices,
const core::rect<s32>* clipRect=0,
SColor color=SColor(255,255,255,255),
bool useAlphaChannelOfTexture=false);
bool useAlphaChannelOfTexture=false,
f32 rotation = 0.f);
//! 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);
const video::SColor* const colors=0, bool useAlphaChannelOfTexture=false, f32 rotation = 0.f);
//! draw an 2d rectangle
virtual void draw2DRectangle(SColor color, const core::rect<s32>& pos,
......
......@@ -795,7 +795,7 @@ const core::dimension2d<u32>& CSoftwareDriver::getCurrentRenderTargetSize() cons
void CSoftwareDriver::draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos,
const core::rect<s32>& sourceRect,
const core::rect<s32>* clipRect, SColor color,
bool useAlphaChannelOfTexture)
bool useAlphaChannelOfTexture, f32 rotation)
{
if (texture)
{
......
......@@ -67,7 +67,7 @@ namespace video
//! draws an 2d image, using a color (if color is other then Color(255,255,255,255)) and the alpha channel of the texture if wanted.
virtual void draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos,
const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect = 0,
SColor color=SColor(255,255,255,255), bool useAlphaChannelOfTexture=false);
SColor color=SColor(255,255,255,255), bool useAlphaChannelOfTexture=false, f32 rotation = 0.f);
//! draw an 2d rectangle
virtual void draw2DRectangle(SColor color, const core::rect<s32>& pos,
......
......@@ -2191,7 +2191,7 @@ void CBurningVideoDriver::lightVertex ( s4DVertex *dest, u32 vertexargb )
void CBurningVideoDriver::draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos,
const core::rect<s32>& sourceRect,
const core::rect<s32>* clipRect, SColor color,
bool useAlphaChannelOfTexture)
bool useAlphaChannelOfTexture, f32 rotation)
{
if (texture)
{
......@@ -2229,7 +2229,7 @@ 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)
const video::SColor* const colors, bool useAlphaChannelOfTexture, f32 rotation)
{
if (texture)
{
......
......@@ -87,12 +87,12 @@ namespace video
//! draws an 2d image, using a color (if color is other then Color(255,255,255,255)) and the alpha channel of the texture if wanted.
virtual void draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos,
const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect = 0,
SColor color=SColor(255,255,255,255), bool useAlphaChannelOfTexture=false);
SColor color=SColor(255,255,255,255), bool useAlphaChannelOfTexture=false, f32 rotation = 0.f);
//! 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);
const video::SColor* const colors=0, bool useAlphaChannelOfTexture=false, f32 rotation = 0.f);
//! Draws a 3d line.
virtual void draw3DLine(const core::vector3df& start,
......
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