Commit 37e15009 authored by hybrid's avatar hybrid

Const correctness for a pointer.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1499 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 763acaa7
......@@ -507,7 +507,7 @@ namespace video
blended. */
virtual void draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect,
const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect = 0,
video::SColor* colors=0, bool useAlphaChannelOfTexture=false) = 0;
const video::SColor * const colors=0, bool useAlphaChannelOfTexture=false) = 0;
//! Draws a 2d rectangle.
/** \param color Color of the rectangle to draw. The alpha
......
......@@ -1012,7 +1012,7 @@ void CD3D8Driver::draw2DImage(const video::ITexture* texture, const core::positi
void CD3D8Driver::draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect,
const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect,
video::SColor* colors, bool useAlphaChannelOfTexture)
const video::SColor* const colors, bool useAlphaChannelOfTexture)
{
if(!texture)
return;
......@@ -1055,7 +1055,7 @@ void CD3D8Driver::draw2DImage(const video::ITexture* texture, const core::rect<s
npos.LowerRightCorner.X = ( clippedRect.LowerRightCorner.X * xFact ) - 1.0f;
npos.LowerRightCorner.Y = 1.0f - ( clippedRect.LowerRightCorner.Y * yFact );
video::SColor temp[4] =
const video::SColor temp[4] =
{
0xFFFFFFFF,
0xFFFFFFFF,
......@@ -1063,7 +1063,7 @@ void CD3D8Driver::draw2DImage(const video::ITexture* texture, const core::rect<s
0xFFFFFFFF
};
video::SColor* useColor = colors ? colors : temp;
const video::SColor* const useColor = colors ? colors : temp;
S3DVertex vtx[4]; // clock wise
vtx[0] = S3DVertex(npos.UpperLeftCorner.X, npos.UpperLeftCorner.Y, 0.0f,
......
......@@ -78,7 +78,7 @@ namespace video
//! 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,
video::SColor* colors=0, bool useAlphaChannelOfTexture=false);
const video::SColor* const colors=0, bool useAlphaChannelOfTexture=false);
//!Draws an 2d rectangle with a gradient.
virtual void draw2DRectangle(const core::rect<s32>& pos,
......
......@@ -1180,7 +1180,7 @@ void CD3D9Driver::drawVertexPrimitiveList(const void* vertices, u32 vertexCount,
void CD3D9Driver::draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect,
const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect,
video::SColor* colors, bool useAlphaChannelOfTexture)
const video::SColor* const colors, bool useAlphaChannelOfTexture)
{
if(!texture)
return;
......@@ -1201,7 +1201,7 @@ void CD3D9Driver::draw2DImage(const video::ITexture* texture, const core::rect<s
npos.LowerRightCorner.X = ( destRect.LowerRightCorner.X * xFact ) - 1.0f;
npos.LowerRightCorner.Y = 1.0f - ( destRect.LowerRightCorner.Y * yFact );
video::SColor temp[4] =
const video::SColor temp[4] =
{
0xFFFFFFFF,
0xFFFFFFFF,
......@@ -1209,7 +1209,7 @@ void CD3D9Driver::draw2DImage(const video::ITexture* texture, const core::rect<s
0xFFFFFFFF
};
video::SColor* useColor = colors ? colors : temp;
const video::SColor* const useColor = colors ? colors : temp;
S3DVertex vtx[4]; // clock wise
vtx[0] = S3DVertex(npos.UpperLeftCorner.X, npos.UpperLeftCorner.Y, 0.0f,
......
......@@ -98,7 +98,7 @@ namespace video
//! 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,
video::SColor* colors=0, bool useAlphaChannelOfTexture=false);
const video::SColor* const colors=0, bool useAlphaChannelOfTexture=false);
//!Draws an 2d rectangle with a gradient.
virtual void draw2DRectangle(const core::rect<s32>& pos,
......
......@@ -75,11 +75,7 @@ void CGUIImage::draw()
{
if (ScaleImage)
{
video::SColor Colors[4];
Colors[0] = Color;
Colors[1] = Color;
Colors[2] = Color;
Colors[3] = Color;
const video::SColor Colors[] = {Color,Color,Color,Color};
driver->draw2DImage(Texture, AbsoluteRect,
core::rect<s32>(core::position2d<s32>(0,0), Texture->getOriginalSize()),
......
......@@ -642,12 +642,11 @@ void CNullDriver::draw2DImage(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,
video::SColor* colors, bool useAlphaChannelOfTexture)
const video::SColor* const colors, bool useAlphaChannelOfTexture)
{
}
//! 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.
void CNullDriver::draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos,
const core::rect<s32>& sourceRect,
......
......@@ -160,7 +160,7 @@ namespace video
//! 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,
video::SColor* colors=0, bool useAlphaChannelOfTexture=false);
const video::SColor* const colors=0, bool useAlphaChannelOfTexture=false);
//! draw an 2d rectangle
virtual void draw2DRectangle(SColor color, const core::rect<s32>& pos, const core::rect<s32>* clip = 0);
......
......@@ -1205,7 +1205,7 @@ void COpenGLDriver::draw2DImage(const video::ITexture* texture,
//! The same, but with a four element array of colors, one for each vertex
void COpenGLDriver::draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect,
const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect,
video::SColor* colors, bool useAlphaChannelOfTexture)
const video::SColor* const colors, bool useAlphaChannelOfTexture)
{
if (!texture)
return;
......@@ -1221,7 +1221,7 @@ void COpenGLDriver::draw2DImage(const video::ITexture* texture, const core::rect
sourceRect.LowerRightCorner.X * invW,
(isRTT?sourceRect.UpperLeftCorner.Y:sourceRect.LowerRightCorner.Y) *invH);
video::SColor temp[4] =
const video::SColor temp[4] =
{
0xFFFFFFFF,
0xFFFFFFFF,
......@@ -1229,7 +1229,7 @@ void COpenGLDriver::draw2DImage(const video::ITexture* texture, const core::rect
0xFFFFFFFF
};
video::SColor* useColor = colors ? colors : temp;
const video::SColor* const useColor = colors ? colors : temp;
disableTextures(1);
setTexture(0, texture);
......
......@@ -178,7 +178,7 @@ namespace video
//! 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,
video::SColor* colors=0, bool useAlphaChannelOfTexture=false);
const video::SColor* const colors=0, bool useAlphaChannelOfTexture=false);
//! draw an 2d rectangle
virtual void draw2DRectangle(SColor color, const core::rect<s32>& pos,
......
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