Commit 3a608e83 authored by cutealien's avatar cutealien

Add parameter useAlphaChannel to second IGUIEnvironment::addImage function as...

Add parameter useAlphaChannel to second IGUIEnvironment::addImage function as it's rather confusing when they have different defaults. Unfortunately can't use same parameter order anymore without messing up existing user-code now (some things can only be done right on first try...).

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4223 dfc29bdd-3216-0410-991c-e03cc46cb475
parent b2dcd0aa
......@@ -300,11 +300,13 @@ public:
\param parent Parent gui element of the image.
\param id Id to identify the gui element.
\param text Title text of the image.
\param useAlphaChannel Sets if the image should use the alpha channel
of the texture to draw itself.
\return Pointer to the created image element. Returns 0 if an error
occurred. This pointer should not be dropped. See
IReferenceCounted::drop() for more information. */
virtual IGUIImage* addImage(const core::rect<s32>& rectangle,
IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) = 0;
IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0, bool useAlphaChannel=true) = 0;
//! Adds a checkbox element.
/** \param checked Define the initial state of the check box.
......
......@@ -1113,7 +1113,7 @@ IGUIImage* CGUIEnvironment::addImage(video::ITexture* image, core::position2d<s3
//! adds an image. The returned pointer must not be dropped.
IGUIImage* CGUIEnvironment::addImage(const core::rect<s32>& rectangle, IGUIElement* parent, s32 id, const wchar_t* text)
IGUIImage* CGUIEnvironment::addImage(const core::rect<s32>& rectangle, IGUIElement* parent, s32 id, const wchar_t* text, bool useAlphaChannel)
{
IGUIImage* img = new CGUIImage(this, parent ? parent : this,
id, rectangle);
......@@ -1121,6 +1121,9 @@ IGUIImage* CGUIEnvironment::addImage(const core::rect<s32>& rectangle, IGUIEleme
if (text)
img->setText(text);
if ( useAlphaChannel )
img->setUseAlphaChannel(true);
img->drop();
return img;
}
......
......@@ -116,7 +116,7 @@ public:
//! adds an image. The returned pointer must not be dropped.
virtual IGUIImage* addImage(const core::rect<s32>& rectangle,
IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0);
IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0, bool useAlphaChannel=true);
//! adds a checkbox
virtual IGUICheckBox* addCheckBox(bool checked, const core::rect<s32>& rectangle, IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0);
......
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