Merge revision 4724:4732 from trunk to ogl-es (also noticed I did a copy-paste error on last check-in and wrote "branch" instead of "trunk" - I always meant trunk certainly):

- Improve documentation for tabcontrol.
- Write (subjectively) nicer xml's by using slightly different linebreak rules.
- Add IGUIImages::setSourceRect/getSourceRect to allow using only parts of an image (can also be used to mirror and scroll them).
- Reduce a bunch of log messages in B3DLoader from ELL_INFORMATION to ELL_DEBUG (thx@ entity for telling
- Collada dae-loader now set's the vertex colors (thx @sf17k for report and test-models)
- Change the rest of the attributes interfaces to pass parameters by const ref instead of per value.
- Ensure vector3df and all classes containing a vector3df are passed by reference instead of per value. Thanks @Danyal Zia for the patch (#280).


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@4831 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
cutealien 2014-05-08 14:01:54 +00:00
parent c73006c7a4
commit 549d13ab04
17 changed files with 255 additions and 200 deletions

View File

@ -7,6 +7,10 @@ Changes in ogl-es (not yet released - will be merged with trunk at some point)
-------------------------- --------------------------
Changes in 1.9 (not yet released) Changes in 1.9 (not yet released)
- Add IGUIImages::setSourceRect/getSourceRect to allow using only parts of an image (can also be used to mirror and scroll them).
- Dev-Cpp project file removed (wasn't really supported for some time already)
- Collada dae-loader now set's the vertex colors (thx @sf17k for report and test-models)
- IAttributes interface changed. Parameters are now passed by const-ref instead of per value.
- Fix c::b project obj folder names. Some static builds had used the shared folders (thx @ gerdb for reporting) - Fix c::b project obj folder names. Some static builds had used the shared folders (thx @ gerdb for reporting)
- Add ITexture::getSource which can be used to check where the last IVideoDriver::getTexture call found the texture. - Add ITexture::getSource which can be used to check where the last IVideoDriver::getTexture call found the texture.
- Add IMeshTextureLoader interface and replace texture-loading algorithms in most meshloaders. - Add IMeshTextureLoader interface and replace texture-loading algorithms in most meshloaders.

View File

@ -407,10 +407,10 @@ public:
*/ */
//! Adds an attribute as 3d vector //! Adds an attribute as 3d vector
virtual void addVector3d(const c8* attributeName, core::vector3df value) = 0; virtual void addVector3d(const c8* attributeName, const core::vector3df& value) = 0;
//! Sets a attribute as 3d vector //! Sets a attribute as 3d vector
virtual void setAttribute(const c8* attributeName, core::vector3df v) = 0; virtual void setAttribute(const c8* attributeName, const core::vector3df& v) = 0;
//! Gets an attribute as 3d vector //! Gets an attribute as 3d vector
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
@ -423,7 +423,7 @@ public:
virtual core::vector3df getAttributeAsVector3d(s32 index) = 0; virtual core::vector3df getAttributeAsVector3d(s32 index) = 0;
//! Sets an attribute as vector //! Sets an attribute as vector
virtual void setAttribute(s32 index, core::vector3df v) = 0; virtual void setAttribute(s32 index, const core::vector3df& v) = 0;
/* /*
@ -432,10 +432,10 @@ public:
*/ */
//! Adds an attribute as 2d vector //! Adds an attribute as 2d vector
virtual void addVector2d(const c8* attributeName, core::vector2df value) = 0; virtual void addVector2d(const c8* attributeName, const core::vector2df& value) = 0;
//! Sets a attribute as 2d vector //! Sets a attribute as 2d vector
virtual void setAttribute(const c8* attributeName, core::vector2df v) = 0; virtual void setAttribute(const c8* attributeName, const core::vector2df& v) = 0;
//! Gets an attribute as vector //! Gets an attribute as vector
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
@ -448,7 +448,7 @@ public:
virtual core::vector2df getAttributeAsVector2d(s32 index) = 0; virtual core::vector2df getAttributeAsVector2d(s32 index) = 0;
//! Sets an attribute as 2d vector //! Sets an attribute as 2d vector
virtual void setAttribute(s32 index, core::vector2df v) = 0; virtual void setAttribute(s32 index, const core::vector2df& v) = 0;
/* /*
@ -457,10 +457,10 @@ public:
*/ */
//! Adds an attribute as 2d position //! Adds an attribute as 2d position
virtual void addPosition2d(const c8* attributeName, core::position2di value) = 0; virtual void addPosition2d(const c8* attributeName, const core::position2di& value) = 0;
//! Sets a attribute as 2d position //! Sets a attribute as 2d position
virtual void setAttribute(const c8* attributeName, core::position2di v) = 0; virtual void setAttribute(const c8* attributeName, const core::position2di& v) = 0;
//! Gets an attribute as position //! Gets an attribute as position
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
@ -473,7 +473,7 @@ public:
virtual core::position2di getAttributeAsPosition2d(s32 index) = 0; virtual core::position2di getAttributeAsPosition2d(s32 index) = 0;
//! Sets an attribute as 2d position //! Sets an attribute as 2d position
virtual void setAttribute(s32 index, core::position2di v) = 0; virtual void setAttribute(s32 index, const core::position2di& v) = 0;
/* /*
@ -482,10 +482,10 @@ public:
*/ */
//! Adds an attribute as rectangle //! Adds an attribute as rectangle
virtual void addRect(const c8* attributeName, core::rect<s32> value) = 0; virtual void addRect(const c8* attributeName, const core::rect<s32>& value) = 0;
//! Sets an attribute as rectangle //! Sets an attribute as rectangle
virtual void setAttribute(const c8* attributeName, core::rect<s32> v) = 0; virtual void setAttribute(const c8* attributeName, const core::rect<s32>& v) = 0;
//! Gets an attribute as rectangle //! Gets an attribute as rectangle
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
@ -498,7 +498,7 @@ public:
virtual core::rect<s32> getAttributeAsRect(s32 index) = 0; virtual core::rect<s32> getAttributeAsRect(s32 index) = 0;
//! Sets an attribute as rectangle //! Sets an attribute as rectangle
virtual void setAttribute(s32 index, core::rect<s32> v) = 0; virtual void setAttribute(s32 index, const core::rect<s32>& v) = 0;
/* /*
@ -508,10 +508,10 @@ public:
*/ */
//! Adds an attribute as dimension2d //! Adds an attribute as dimension2d
virtual void addDimension2d(const c8* attributeName, core::dimension2d<u32> value) = 0; virtual void addDimension2d(const c8* attributeName, const core::dimension2d<u32>& value) = 0;
//! Sets an attribute as dimension2d //! Sets an attribute as dimension2d
virtual void setAttribute(const c8* attributeName, core::dimension2d<u32> v) = 0; virtual void setAttribute(const c8* attributeName, const core::dimension2d<u32>& v) = 0;
//! Gets an attribute as dimension2d //! Gets an attribute as dimension2d
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
@ -524,7 +524,7 @@ public:
virtual core::dimension2d<u32> getAttributeAsDimension2d(s32 index) = 0; virtual core::dimension2d<u32> getAttributeAsDimension2d(s32 index) = 0;
//! Sets an attribute as dimension2d //! Sets an attribute as dimension2d
virtual void setAttribute(s32 index, core::dimension2d<u32> v) = 0; virtual void setAttribute(s32 index, const core::dimension2d<u32>& v) = 0;
/* /*
@ -556,10 +556,10 @@ public:
*/ */
//! Adds an attribute as quaternion //! Adds an attribute as quaternion
virtual void addQuaternion(const c8* attributeName, core::quaternion v) = 0; virtual void addQuaternion(const c8* attributeName, const core::quaternion& v) = 0;
//! Sets an attribute as quaternion //! Sets an attribute as quaternion
virtual void setAttribute(const c8* attributeName, core::quaternion v) = 0; virtual void setAttribute(const c8* attributeName, const core::quaternion& v) = 0;
//! Gets an attribute as a quaternion //! Gets an attribute as a quaternion
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
@ -572,7 +572,7 @@ public:
virtual core::quaternion getAttributeAsQuaternion(s32 index) = 0; virtual core::quaternion getAttributeAsQuaternion(s32 index) = 0;
//! Sets an attribute as quaternion //! Sets an attribute as quaternion
virtual void setAttribute(s32 index, core::quaternion v) = 0; virtual void setAttribute(s32 index, const core::quaternion& v) = 0;
/* /*
@ -581,10 +581,10 @@ public:
*/ */
//! Adds an attribute as axis aligned bounding box //! Adds an attribute as axis aligned bounding box
virtual void addBox3d(const c8* attributeName, core::aabbox3df v) = 0; virtual void addBox3d(const c8* attributeName, const core::aabbox3df& v) = 0;
//! Sets an attribute as axis aligned bounding box //! Sets an attribute as axis aligned bounding box
virtual void setAttribute(const c8* attributeName, core::aabbox3df v) = 0; virtual void setAttribute(const c8* attributeName, const core::aabbox3df& v) = 0;
//! Gets an attribute as a axis aligned bounding box //! Gets an attribute as a axis aligned bounding box
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
@ -597,7 +597,7 @@ public:
virtual core::aabbox3df getAttributeAsBox3d(s32 index) = 0; virtual core::aabbox3df getAttributeAsBox3d(s32 index) = 0;
//! Sets an attribute as axis aligned bounding box //! Sets an attribute as axis aligned bounding box
virtual void setAttribute(s32 index, core::aabbox3df v) = 0; virtual void setAttribute(s32 index, const core::aabbox3df& v) = 0;
/* /*
@ -606,10 +606,10 @@ public:
*/ */
//! Adds an attribute as 3d plane //! Adds an attribute as 3d plane
virtual void addPlane3d(const c8* attributeName, core::plane3df v) = 0; virtual void addPlane3d(const c8* attributeName, const core::plane3df& v) = 0;
//! Sets an attribute as 3d plane //! Sets an attribute as 3d plane
virtual void setAttribute(const c8* attributeName, core::plane3df v) = 0; virtual void setAttribute(const c8* attributeName, const core::plane3df& v) = 0;
//! Gets an attribute as a 3d plane //! Gets an attribute as a 3d plane
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
@ -622,7 +622,7 @@ public:
virtual core::plane3df getAttributeAsPlane3d(s32 index) = 0; virtual core::plane3df getAttributeAsPlane3d(s32 index) = 0;
//! Sets an attribute as 3d plane //! Sets an attribute as 3d plane
virtual void setAttribute(s32 index, core::plane3df v) = 0; virtual void setAttribute(s32 index, const core::plane3df& v) = 0;
/* /*
@ -632,10 +632,10 @@ public:
*/ */
//! Adds an attribute as 3d triangle //! Adds an attribute as 3d triangle
virtual void addTriangle3d(const c8* attributeName, core::triangle3df v) = 0; virtual void addTriangle3d(const c8* attributeName, const core::triangle3df& v) = 0;
//! Sets an attribute as 3d trianle //! Sets an attribute as 3d trianle
virtual void setAttribute(const c8* attributeName, core::triangle3df v) = 0; virtual void setAttribute(const c8* attributeName, const core::triangle3df& v) = 0;
//! Gets an attribute as a 3d triangle //! Gets an attribute as a 3d triangle
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
@ -648,7 +648,7 @@ public:
virtual core::triangle3df getAttributeAsTriangle3d(s32 index) = 0; virtual core::triangle3df getAttributeAsTriangle3d(s32 index) = 0;
//! Sets an attribute as 3d triangle //! Sets an attribute as 3d triangle
virtual void setAttribute(s32 index, core::triangle3df v) = 0; virtual void setAttribute(s32 index, const core::triangle3df& v) = 0;
/* /*
@ -658,10 +658,10 @@ public:
*/ */
//! Adds an attribute as a 2d line //! Adds an attribute as a 2d line
virtual void addLine2d(const c8* attributeName, core::line2df v) = 0; virtual void addLine2d(const c8* attributeName, const core::line2df& v) = 0;
//! Sets an attribute as a 2d line //! Sets an attribute as a 2d line
virtual void setAttribute(const c8* attributeName, core::line2df v) = 0; virtual void setAttribute(const c8* attributeName, const core::line2df& v) = 0;
//! Gets an attribute as a 2d line //! Gets an attribute as a 2d line
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
@ -674,7 +674,7 @@ public:
virtual core::line2df getAttributeAsLine2d(s32 index) = 0; virtual core::line2df getAttributeAsLine2d(s32 index) = 0;
//! Sets an attribute as a 2d line //! Sets an attribute as a 2d line
virtual void setAttribute(s32 index, core::line2df v) = 0; virtual void setAttribute(s32 index, const core::line2df& v) = 0;
/* /*
@ -684,10 +684,10 @@ public:
*/ */
//! Adds an attribute as a 3d line //! Adds an attribute as a 3d line
virtual void addLine3d(const c8* attributeName, core::line3df v) = 0; virtual void addLine3d(const c8* attributeName, const core::line3df& v) = 0;
//! Sets an attribute as a 3d line //! Sets an attribute as a 3d line
virtual void setAttribute(const c8* attributeName, core::line3df v) = 0; virtual void setAttribute(const c8* attributeName, const core::line3df& v) = 0;
//! Gets an attribute as a 3d line //! Gets an attribute as a 3d line
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
@ -700,7 +700,7 @@ public:
virtual core::line3df getAttributeAsLine3d(s32 index) = 0; virtual core::line3df getAttributeAsLine3d(s32 index) = 0;
//! Sets an attribute as a 3d line //! Sets an attribute as a 3d line
virtual void setAttribute(s32 index, core::line3df v) = 0; virtual void setAttribute(s32 index, const core::line3df& v) = 0;
/* /*

View File

@ -48,6 +48,14 @@ namespace gui
//! Returns true if the image is using the alpha channel, false if not //! Returns true if the image is using the alpha channel, false if not
virtual bool isAlphaChannelUsed() const = 0; virtual bool isAlphaChannelUsed() const = 0;
//! Sets the source rectangle of the image. By default the full image is used.
/** \param sourceRect coordinates inside the image or an area with size 0 for using the full image (default). */
virtual void setSourceRect(const core::rect<s32>& sourceRect) = 0;
//! Returns the customized source rectangle of the image to be used.
/** By default an empty rectangle of width and height 0 is returned which means the full image is used. */
virtual core::rect<s32> getSourceRect() const = 0;
}; };

View File

@ -14,7 +14,7 @@ namespace irr
namespace gui namespace gui
{ {
//! A tab-page, onto which other gui elements could be added. //! A tab-page, onto which other gui elements could be added.
/** IGUITab refers to the page itself, not to the tab in the tabbar of an IGUITabControl. */ /** IGUITab refers mostly to the page itself, but also carries some data about the tab in the tabbar of an IGUITabControl. */
class IGUITab : public IGUIElement class IGUITab : public IGUIElement
{ {
public: public:
@ -41,7 +41,7 @@ namespace gui
//! returns the color of the background //! returns the color of the background
virtual video::SColor getBackgroundColor() const = 0; virtual video::SColor getBackgroundColor() const = 0;
//! sets the color of the text //! sets the color of it's text in the tab-bar
virtual void setTextColor(video::SColor c) = 0; virtual void setTextColor(video::SColor c) = 0;
//! gets the color of the text //! gets the color of the text

View File

@ -189,9 +189,9 @@ namespace scene
\return Returns the scene node containing the hit triangle nearest to ray.start. \return Returns the scene node containing the hit triangle nearest to ray.start.
If no collision is detected, then 0 is returned. */ If no collision is detected, then 0 is returned. */
virtual ISceneNode* getSceneNodeAndCollisionPointFromRay( virtual ISceneNode* getSceneNodeAndCollisionPointFromRay(
core::line3df ray, const core::line3df& ray,
core::vector3df & outCollisionPoint, core::vector3df& outCollisionPoint,
core::triangle3df & outTriangle, core::triangle3df& outTriangle,
s32 idBitMask = 0, s32 idBitMask = 0,
ISceneNode * collisionRootNode = 0, ISceneNode * collisionRootNode = 0,
bool noDebugObjects = false) = 0; bool noDebugObjects = false) = 0;

View File

@ -233,7 +233,7 @@ public:
} }
CNumbersAttribute(const char* name, core::vector3df value) : CNumbersAttribute(const char* name, const core::vector3df& value) :
ValueI(), ValueF(), Count(3), IsFloat(true) ValueI(), ValueF(), Count(3), IsFloat(true)
{ {
Name = name; Name = name;
@ -242,7 +242,7 @@ public:
ValueF.push_back(value.Z); ValueF.push_back(value.Z);
} }
CNumbersAttribute(const char* name, core::rect<s32> value) : CNumbersAttribute(const char* name, const core::rect<s32>& value) :
ValueI(), ValueF(), Count(4), IsFloat(false) ValueI(), ValueF(), Count(4), IsFloat(false)
{ {
Name = name; Name = name;
@ -252,7 +252,7 @@ public:
ValueI.push_back(value.LowerRightCorner.Y); ValueI.push_back(value.LowerRightCorner.Y);
} }
CNumbersAttribute(const char* name, core::rect<f32> value) : CNumbersAttribute(const char* name, const core::rect<f32>& value) :
ValueI(), ValueF(), Count(4), IsFloat(true) ValueI(), ValueF(), Count(4), IsFloat(true)
{ {
Name = name; Name = name;
@ -262,7 +262,7 @@ public:
ValueF.push_back(value.LowerRightCorner.Y); ValueF.push_back(value.LowerRightCorner.Y);
} }
CNumbersAttribute(const char* name, core::matrix4 value) : CNumbersAttribute(const char* name, const core::matrix4& value) :
ValueI(), ValueF(), Count(16), IsFloat(true) ValueI(), ValueF(), Count(16), IsFloat(true)
{ {
Name = name; Name = name;
@ -271,7 +271,7 @@ public:
ValueF.push_back(value(r,c)); ValueF.push_back(value(r,c));
} }
CNumbersAttribute(const char* name, core::quaternion value) : CNumbersAttribute(const char* name, const core::quaternion& value) :
ValueI(), ValueF(), Count(4), IsFloat(true) ValueI(), ValueF(), Count(4), IsFloat(true)
{ {
Name = name; Name = name;
@ -281,7 +281,7 @@ public:
ValueF.push_back(value.W); ValueF.push_back(value.W);
} }
CNumbersAttribute(const char* name, core::aabbox3d<f32> value) : CNumbersAttribute(const char* name, const core::aabbox3d<f32>& value) :
ValueI(), ValueF(), Count(6), IsFloat(true) ValueI(), ValueF(), Count(6), IsFloat(true)
{ {
Name = name; Name = name;
@ -293,7 +293,7 @@ public:
ValueF.push_back(value.MaxEdge.Z); ValueF.push_back(value.MaxEdge.Z);
} }
CNumbersAttribute(const char* name, core::plane3df value) : CNumbersAttribute(const char* name, const core::plane3df& value) :
ValueI(), ValueF(), Count(4), IsFloat(true) ValueI(), ValueF(), Count(4), IsFloat(true)
{ {
Name = name; Name = name;
@ -303,7 +303,7 @@ public:
ValueF.push_back(value.D); ValueF.push_back(value.D);
} }
CNumbersAttribute(const char* name, core::triangle3df value) : CNumbersAttribute(const char* name, const core::triangle3df& value) :
ValueI(), ValueF(), Count(9), IsFloat(true) ValueI(), ValueF(), Count(9), IsFloat(true)
{ {
Name = name; Name = name;
@ -318,7 +318,7 @@ public:
ValueF.push_back(value.pointC.Z); ValueF.push_back(value.pointC.Z);
} }
CNumbersAttribute(const char* name, core::vector2df value) : CNumbersAttribute(const char* name, const core::vector2df& value) :
ValueI(), ValueF(), Count(2), IsFloat(true) ValueI(), ValueF(), Count(2), IsFloat(true)
{ {
Name = name; Name = name;
@ -326,7 +326,7 @@ public:
ValueF.push_back(value.Y); ValueF.push_back(value.Y);
} }
CNumbersAttribute(const char* name, core::vector2di value) : CNumbersAttribute(const char* name, const core::vector2di& value) :
ValueI(), ValueF(), Count(2), IsFloat(false) ValueI(), ValueF(), Count(2), IsFloat(false)
{ {
Name = name; Name = name;
@ -334,7 +334,7 @@ public:
ValueI.push_back(value.Y); ValueI.push_back(value.Y);
} }
CNumbersAttribute(const char* name, core::line2di value) : CNumbersAttribute(const char* name, const core::line2di& value) :
ValueI(), ValueF(), Count(4), IsFloat(false) ValueI(), ValueF(), Count(4), IsFloat(false)
{ {
Name = name; Name = name;
@ -344,7 +344,7 @@ public:
ValueI.push_back(value.end.Y); ValueI.push_back(value.end.Y);
} }
CNumbersAttribute(const char* name, core::line2df value) : CNumbersAttribute(const char* name, const core::line2df& value) :
ValueI(), ValueF(), Count(4), IsFloat(true) ValueI(), ValueF(), Count(4), IsFloat(true)
{ {
Name = name; Name = name;
@ -354,7 +354,7 @@ public:
ValueF.push_back(value.end.Y); ValueF.push_back(value.end.Y);
} }
CNumbersAttribute(const char* name, core::line3df value) : CNumbersAttribute(const char* name, const core::line3df& value) :
ValueI(), ValueF(), Count(6), IsFloat(true) ValueI(), ValueF(), Count(6), IsFloat(true)
{ {
Name = name; Name = name;
@ -366,7 +366,7 @@ public:
ValueF.push_back(value.end.Z); ValueF.push_back(value.end.Z);
} }
CNumbersAttribute(const char* name, core::dimension2du value) : CNumbersAttribute(const char* name, const core::dimension2du& value) :
ValueI(), ValueF(), Count(2), IsFloat(false) ValueI(), ValueF(), Count(2), IsFloat(false)
{ {
Name = name; Name = name;
@ -375,7 +375,7 @@ public:
} }
CNumbersAttribute(const char* name, core::dimension2df value) : CNumbersAttribute(const char* name, const core::dimension2df& value) :
ValueI(), ValueF(), Count(2), IsFloat(true) ValueI(), ValueF(), Count(2), IsFloat(true)
{ {
Name = name; Name = name;
@ -832,7 +832,7 @@ public:
//} //}
} }
virtual void setPosition(core::position2di v) _IRR_OVERRIDE_ virtual void setPosition(const core::position2di& v) _IRR_OVERRIDE_
{ {
reset(); reset();
if (IsFloat) if (IsFloat)
@ -847,7 +847,7 @@ public:
} }
} }
virtual void setVector(core::vector3df v) _IRR_OVERRIDE_ virtual void setVector(const core::vector3df& v) _IRR_OVERRIDE_
{ {
reset(); reset();
if (IsFloat) if (IsFloat)
@ -903,7 +903,7 @@ public:
} }
} }
virtual void setRect(core::rect<s32> value) _IRR_OVERRIDE_ virtual void setRect(const core::rect<s32>& value) _IRR_OVERRIDE_
{ {
reset(); reset();
if (IsFloat) if (IsFloat)
@ -922,7 +922,7 @@ public:
} }
} }
virtual void setMatrix(core::matrix4 value) _IRR_OVERRIDE_ virtual void setMatrix(const core::matrix4& value) _IRR_OVERRIDE_
{ {
reset(); reset();
if (IsFloat) if (IsFloat)
@ -941,7 +941,7 @@ public:
} }
} }
virtual void setQuaternion(core::quaternion value) virtual void setQuaternion(const core::quaternion& value)
{ {
reset(); reset();
if (IsFloat) if (IsFloat)
@ -960,7 +960,7 @@ public:
} }
} }
virtual void setBoundingBox(core::aabbox3d<f32> value) virtual void setBoundingBox(const core::aabbox3d<f32>& value)
{ {
reset(); reset();
if (IsFloat) if (IsFloat)
@ -983,7 +983,7 @@ public:
} }
} }
virtual void setPlane(core::plane3df value) _IRR_OVERRIDE_ virtual void setPlane(const core::plane3df& value) _IRR_OVERRIDE_
{ {
reset(); reset();
if (IsFloat) if (IsFloat)
@ -1002,7 +1002,7 @@ public:
} }
} }
virtual void setTriangle3d(core::triangle3df value) virtual void setTriangle3d(const core::triangle3df& value)
{ {
reset(); reset();
if (IsFloat) if (IsFloat)
@ -1031,7 +1031,7 @@ public:
} }
} }
virtual void setVector2d(core::vector2df v) _IRR_OVERRIDE_ virtual void setVector2d(const core::vector2df& v) _IRR_OVERRIDE_
{ {
reset(); reset();
if (IsFloat) if (IsFloat)
@ -1046,7 +1046,7 @@ public:
} }
} }
virtual void setVector2d(core::vector2di v) virtual void setVector2d(const core::vector2di& v)
{ {
reset(); reset();
if (IsFloat) if (IsFloat)
@ -1061,7 +1061,7 @@ public:
} }
} }
virtual void setLine2d(core::line2di v) _IRR_OVERRIDE_ virtual void setLine2d(const core::line2di& v) _IRR_OVERRIDE_
{ {
reset(); reset();
if (IsFloat) if (IsFloat)
@ -1080,7 +1080,7 @@ public:
} }
} }
virtual void setLine2d(core::line2df v) _IRR_OVERRIDE_ virtual void setLine2d(const core::line2df& v) _IRR_OVERRIDE_
{ {
reset(); reset();
if (IsFloat) if (IsFloat)
@ -1099,7 +1099,7 @@ public:
} }
} }
virtual void setDimension2d(core::dimension2du v) _IRR_OVERRIDE_ virtual void setDimension2d(const core::dimension2du& v) _IRR_OVERRIDE_
{ {
reset(); reset();
if (IsFloat) if (IsFloat)
@ -1306,7 +1306,7 @@ class CVector3DAttribute : public CNumbersAttribute
{ {
public: public:
CVector3DAttribute(const char* name, core::vector3df value) : CNumbersAttribute(name, value) {} CVector3DAttribute(const char* name, const core::vector3df& value) : CNumbersAttribute(name, value) {}
virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_ virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_
{ {
@ -1332,7 +1332,7 @@ class CVector2DAttribute : public CNumbersAttribute
{ {
public: public:
CVector2DAttribute(const char* name, core::vector2df value) : CNumbersAttribute(name, value) {} CVector2DAttribute(const char* name, const core::vector2df& value) : CNumbersAttribute(name, value) {}
virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_ virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_
{ {
@ -1350,7 +1350,7 @@ class CPosition2DAttribute : public CNumbersAttribute
{ {
public: public:
CPosition2DAttribute(const char* name, core::position2di value) : CNumbersAttribute(name, value) {} CPosition2DAttribute(const char* name, const core::position2di& value) : CNumbersAttribute(name, value) {}
virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_ virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_
{ {
@ -1370,7 +1370,7 @@ class CRectAttribute : public CNumbersAttribute
{ {
public: public:
CRectAttribute(const char* name, core::rect<s32> value) : CNumbersAttribute(name, value) { } CRectAttribute(const char* name, const core::rect<s32>& value) : CNumbersAttribute(name, value) { }
virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_ virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_
{ {
@ -1389,7 +1389,7 @@ class CDimension2dAttribute : public CNumbersAttribute
{ {
public: public:
CDimension2dAttribute (const char* name, core::dimension2d<u32> value) : CNumbersAttribute(name, value) { } CDimension2dAttribute (const char* name, const core::dimension2d<u32>& value) : CNumbersAttribute(name, value) { }
virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_ virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_
{ {
@ -1407,7 +1407,7 @@ class CMatrixAttribute : public CNumbersAttribute
{ {
public: public:
CMatrixAttribute(const char* name, core::matrix4 value) : CNumbersAttribute(name, value) { } CMatrixAttribute(const char* name, const core::matrix4& value) : CNumbersAttribute(name, value) { }
virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_ virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_
{ {
@ -1430,7 +1430,7 @@ class CQuaternionAttribute : public CNumbersAttribute
{ {
public: public:
CQuaternionAttribute(const char* name, core::quaternion value) : CNumbersAttribute(name, value) { } CQuaternionAttribute(const char* name, const core::quaternion& value) : CNumbersAttribute(name, value) { }
virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_ virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_
{ {
@ -1454,7 +1454,7 @@ class CBBoxAttribute : public CNumbersAttribute
{ {
public: public:
CBBoxAttribute(const char* name, core::aabbox3df value) : CNumbersAttribute(name, value) { } CBBoxAttribute(const char* name, const core::aabbox3df& value) : CNumbersAttribute(name, value) { }
virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_ virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_
{ {
@ -1472,7 +1472,7 @@ class CPlaneAttribute : public CNumbersAttribute
{ {
public: public:
CPlaneAttribute(const char* name, core::plane3df value) : CNumbersAttribute(name, value) { } CPlaneAttribute(const char* name, const core::plane3df& value) : CNumbersAttribute(name, value) { }
virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_ virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_
{ {
@ -1490,7 +1490,7 @@ class CTriangleAttribute : public CNumbersAttribute
{ {
public: public:
CTriangleAttribute(const char* name, core::triangle3df value) : CNumbersAttribute(name, value) { } CTriangleAttribute(const char* name, const core::triangle3df& value) : CNumbersAttribute(name, value) { }
virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_ virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_
{ {
@ -1514,7 +1514,7 @@ class CLine2dAttribute : public CNumbersAttribute
{ {
public: public:
CLine2dAttribute(const char* name, core::line2df value) : CNumbersAttribute(name, value) { } CLine2dAttribute(const char* name, const core::line2df& value) : CNumbersAttribute(name, value) { }
virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_ virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_
{ {
@ -1532,7 +1532,7 @@ class CLine3dAttribute : public CNumbersAttribute
{ {
public: public:
CLine3dAttribute(const char* name, core::line3df value) : CNumbersAttribute(name, value) { } CLine3dAttribute(const char* name, const core::line3df& value) : CNumbersAttribute(name, value) { }
virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_ virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_
{ {

View File

@ -368,7 +368,7 @@ video::SColorf CAttributes::getAttributeAsColorf(const c8* attributeName, const
} }
//! Sets a attribute as 2d position //! Sets a attribute as 2d position
void CAttributes::setAttribute(const c8* attributeName, core::position2di value) void CAttributes::setAttribute(const c8* attributeName, const core::position2di& value)
{ {
IAttribute* att = getAttributeP(attributeName); IAttribute* att = getAttributeP(attributeName);
if (att) if (att)
@ -390,7 +390,7 @@ core::position2di CAttributes::getAttributeAsPosition2d(const c8* attributeName,
} }
//! Sets a attribute as rectangle //! Sets a attribute as rectangle
void CAttributes::setAttribute(const c8* attributeName, core::rect<s32> value) void CAttributes::setAttribute(const c8* attributeName, const core::rect<s32>& value)
{ {
IAttribute* att = getAttributeP(attributeName); IAttribute* att = getAttributeP(attributeName);
if (att) if (att)
@ -412,7 +412,7 @@ core::rect<s32> CAttributes::getAttributeAsRect(const c8* attributeName, const c
} }
//! Sets a attribute as dimension2d //! Sets a attribute as dimension2d
void CAttributes::setAttribute(const c8* attributeName, core::dimension2d<u32> value) void CAttributes::setAttribute(const c8* attributeName, const core::dimension2d<u32>& value)
{ {
IAttribute* att = getAttributeP(attributeName); IAttribute* att = getAttributeP(attributeName);
if (att) if (att)
@ -434,7 +434,7 @@ core::dimension2d<u32> CAttributes::getAttributeAsDimension2d(const c8* attribut
} }
//! Sets a attribute as vector //! Sets a attribute as vector
void CAttributes::setAttribute(const c8* attributeName, core::vector3df value) void CAttributes::setAttribute(const c8* attributeName, const core::vector3df& value)
{ {
IAttribute* att = getAttributeP(attributeName); IAttribute* att = getAttributeP(attributeName);
if (att) if (att)
@ -444,7 +444,7 @@ void CAttributes::setAttribute(const c8* attributeName, core::vector3df value)
} }
//! Sets a attribute as vector //! Sets a attribute as vector
void CAttributes::setAttribute(const c8* attributeName, core::vector2df value) void CAttributes::setAttribute(const c8* attributeName, const core::vector2df& value)
{ {
IAttribute* att = getAttributeP(attributeName); IAttribute* att = getAttributeP(attributeName);
if (att) if (att)
@ -850,32 +850,32 @@ void CAttributes::addColorf(const c8* attributeName, video::SColorf value)
} }
//! Adds an attribute as 3d vector //! Adds an attribute as 3d vector
void CAttributes::addVector3d(const c8* attributeName, core::vector3df value) void CAttributes::addVector3d(const c8* attributeName, const core::vector3df& value)
{ {
Attributes.push_back(new CVector3DAttribute(attributeName, value)); Attributes.push_back(new CVector3DAttribute(attributeName, value));
} }
//! Adds an attribute as 2d vector //! Adds an attribute as 2d vector
void CAttributes::addVector2d(const c8* attributeName, core::vector2df value) void CAttributes::addVector2d(const c8* attributeName, const core::vector2df& value)
{ {
Attributes.push_back(new CVector2DAttribute(attributeName, value)); Attributes.push_back(new CVector2DAttribute(attributeName, value));
} }
//! Adds an attribute as 2d position //! Adds an attribute as 2d position
void CAttributes::addPosition2d(const c8* attributeName, core::position2di value) void CAttributes::addPosition2d(const c8* attributeName, const core::position2di& value)
{ {
Attributes.push_back(new CPosition2DAttribute(attributeName, value)); Attributes.push_back(new CPosition2DAttribute(attributeName, value));
} }
//! Adds an attribute as rectangle //! Adds an attribute as rectangle
void CAttributes::addRect(const c8* attributeName, core::rect<s32> value) void CAttributes::addRect(const c8* attributeName, const core::rect<s32>& value)
{ {
Attributes.push_back(new CRectAttribute(attributeName, value)); Attributes.push_back(new CRectAttribute(attributeName, value));
} }
//! Adds an attribute as dimension2d //! Adds an attribute as dimension2d
void CAttributes::addDimension2d(const c8* attributeName, core::dimension2d<u32> value) void CAttributes::addDimension2d(const c8* attributeName, const core::dimension2d<u32>& value)
{ {
Attributes.push_back(new CDimension2dAttribute(attributeName, value)); Attributes.push_back(new CDimension2dAttribute(attributeName, value));
} }
@ -950,35 +950,35 @@ void CAttributes::setAttribute(s32 index, video::SColorf color)
} }
//! Sets a attribute as vector //! Sets a attribute as vector
void CAttributes::setAttribute(s32 index, core::vector3df v) void CAttributes::setAttribute(s32 index, const core::vector3df& v)
{ {
if ((u32)index < Attributes.size()) if ((u32)index < Attributes.size())
Attributes[index]->setVector(v); Attributes[index]->setVector(v);
} }
//! Sets a attribute as vector //! Sets a attribute as vector
void CAttributes::setAttribute(s32 index, core::vector2df v) void CAttributes::setAttribute(s32 index, const core::vector2df& v)
{ {
if ((u32)index < Attributes.size()) if ((u32)index < Attributes.size())
Attributes[index]->setVector2d(v); Attributes[index]->setVector2d(v);
} }
//! Sets a attribute as position //! Sets a attribute as position
void CAttributes::setAttribute(s32 index, core::position2di v) void CAttributes::setAttribute(s32 index, const core::position2di& v)
{ {
if ((u32)index < Attributes.size()) if ((u32)index < Attributes.size())
Attributes[index]->setPosition(v); Attributes[index]->setPosition(v);
} }
//! Sets a attribute as rectangle //! Sets a attribute as rectangle
void CAttributes::setAttribute(s32 index, core::rect<s32> v) void CAttributes::setAttribute(s32 index, const core::rect<s32>& v)
{ {
if ((u32)index < Attributes.size()) if ((u32)index < Attributes.size())
Attributes[index]->setRect(v); Attributes[index]->setRect(v);
} }
//! Sets a attribute as dimension2d //! Sets a attribute as dimension2d
void CAttributes::setAttribute(s32 index, core::dimension2d<u32> v) void CAttributes::setAttribute(s32 index, const core::dimension2d<u32>& v)
{ {
if ((u32)index < Attributes.size()) if ((u32)index < Attributes.size())
Attributes[index]->setDimension2d(v); Attributes[index]->setDimension2d(v);
@ -1054,14 +1054,14 @@ void CAttributes::setAttribute(s32 index, const core::matrix4& v)
//! Adds an attribute as quaternion //! Adds an attribute as quaternion
void CAttributes::addQuaternion(const c8* attributeName, core::quaternion v) void CAttributes::addQuaternion(const c8* attributeName, const core::quaternion& v)
{ {
Attributes.push_back(new CQuaternionAttribute(attributeName, v)); Attributes.push_back(new CQuaternionAttribute(attributeName, v));
} }
//! Sets an attribute as quaternion //! Sets an attribute as quaternion
void CAttributes::setAttribute(const c8* attributeName, core::quaternion v) void CAttributes::setAttribute(const c8* attributeName, const core::quaternion& v)
{ {
IAttribute* att = getAttributeP(attributeName); IAttribute* att = getAttributeP(attributeName);
if (att) if (att)
@ -1094,20 +1094,20 @@ core::quaternion CAttributes::getAttributeAsQuaternion(s32 index)
} }
//! Sets an attribute as quaternion //! Sets an attribute as quaternion
void CAttributes::setAttribute(s32 index, core::quaternion v) void CAttributes::setAttribute(s32 index, const core::quaternion& v)
{ {
if (index >= 0 && index < (s32)Attributes.size() ) if (index >= 0 && index < (s32)Attributes.size() )
Attributes[index]->setQuaternion(v); Attributes[index]->setQuaternion(v);
} }
//! Adds an attribute as axis aligned bounding box //! Adds an attribute as axis aligned bounding box
void CAttributes::addBox3d(const c8* attributeName, core::aabbox3df v) void CAttributes::addBox3d(const c8* attributeName, const core::aabbox3df& v)
{ {
Attributes.push_back(new CBBoxAttribute(attributeName, v)); Attributes.push_back(new CBBoxAttribute(attributeName, v));
} }
//! Sets an attribute as axis aligned bounding box //! Sets an attribute as axis aligned bounding box
void CAttributes::setAttribute(const c8* attributeName, core::aabbox3df v) void CAttributes::setAttribute(const c8* attributeName, const core::aabbox3df& v)
{ {
IAttribute* att = getAttributeP(attributeName); IAttribute* att = getAttributeP(attributeName);
if (att) if (att)
@ -1140,20 +1140,20 @@ core::aabbox3df CAttributes::getAttributeAsBox3d(s32 index)
} }
//! Sets an attribute as axis aligned bounding box //! Sets an attribute as axis aligned bounding box
void CAttributes::setAttribute(s32 index, core::aabbox3df v) void CAttributes::setAttribute(s32 index, const core::aabbox3df& v)
{ {
if (index >= 0 && index < (s32)Attributes.size() ) if (index >= 0 && index < (s32)Attributes.size() )
Attributes[index]->setBBox(v); Attributes[index]->setBBox(v);
} }
//! Adds an attribute as 3d plane //! Adds an attribute as 3d plane
void CAttributes::addPlane3d(const c8* attributeName, core::plane3df v) void CAttributes::addPlane3d(const c8* attributeName, const core::plane3df& v)
{ {
Attributes.push_back(new CPlaneAttribute(attributeName, v)); Attributes.push_back(new CPlaneAttribute(attributeName, v));
} }
//! Sets an attribute as 3d plane //! Sets an attribute as 3d plane
void CAttributes::setAttribute(const c8* attributeName, core::plane3df v) void CAttributes::setAttribute(const c8* attributeName, const core::plane3df& v)
{ {
IAttribute* att = getAttributeP(attributeName); IAttribute* att = getAttributeP(attributeName);
if (att) if (att)
@ -1186,20 +1186,20 @@ core::plane3df CAttributes::getAttributeAsPlane3d(s32 index)
} }
//! Sets an attribute as 3d plane //! Sets an attribute as 3d plane
void CAttributes::setAttribute(s32 index, core::plane3df v) void CAttributes::setAttribute(s32 index, const core::plane3df& v)
{ {
if (index >= 0 && index < (s32)Attributes.size() ) if (index >= 0 && index < (s32)Attributes.size() )
Attributes[index]->setPlane(v); Attributes[index]->setPlane(v);
} }
//! Adds an attribute as 3d triangle //! Adds an attribute as 3d triangle
void CAttributes::addTriangle3d(const c8* attributeName, core::triangle3df v) void CAttributes::addTriangle3d(const c8* attributeName, const core::triangle3df& v)
{ {
Attributes.push_back(new CTriangleAttribute(attributeName, v)); Attributes.push_back(new CTriangleAttribute(attributeName, v));
} }
//! Sets an attribute as 3d triangle //! Sets an attribute as 3d triangle
void CAttributes::setAttribute(const c8* attributeName, core::triangle3df v) void CAttributes::setAttribute(const c8* attributeName, const core::triangle3df& v)
{ {
IAttribute* att = getAttributeP(attributeName); IAttribute* att = getAttributeP(attributeName);
if (att) if (att)
@ -1233,20 +1233,20 @@ core::triangle3df CAttributes::getAttributeAsTriangle3d(s32 index)
} }
//! Sets an attribute as 3d triangle //! Sets an attribute as 3d triangle
void CAttributes::setAttribute(s32 index, core::triangle3df v) void CAttributes::setAttribute(s32 index, const core::triangle3df& v)
{ {
if (index >= 0 && index < (s32)Attributes.size() ) if (index >= 0 && index < (s32)Attributes.size() )
Attributes[index]->setTriangle(v); Attributes[index]->setTriangle(v);
} }
//! Adds an attribute as a 2d line //! Adds an attribute as a 2d line
void CAttributes::addLine2d(const c8* attributeName, core::line2df v) void CAttributes::addLine2d(const c8* attributeName, const core::line2df& v)
{ {
Attributes.push_back(new CLine2dAttribute(attributeName, v)); Attributes.push_back(new CLine2dAttribute(attributeName, v));
} }
//! Sets an attribute as a 2d line //! Sets an attribute as a 2d line
void CAttributes::setAttribute(const c8* attributeName, core::line2df v) void CAttributes::setAttribute(const c8* attributeName, const core::line2df& v)
{ {
IAttribute* att = getAttributeP(attributeName); IAttribute* att = getAttributeP(attributeName);
if (att) if (att)
@ -1279,20 +1279,20 @@ core::line2df CAttributes::getAttributeAsLine2d(s32 index)
} }
//! Sets an attribute as a 2d line //! Sets an attribute as a 2d line
void CAttributes::setAttribute(s32 index, core::line2df v) void CAttributes::setAttribute(s32 index, const core::line2df& v)
{ {
if (index >= 0 && index < (s32)Attributes.size() ) if (index >= 0 && index < (s32)Attributes.size() )
Attributes[index]->setLine2d(v); Attributes[index]->setLine2d(v);
} }
//! Adds an attribute as a 3d line //! Adds an attribute as a 3d line
void CAttributes::addLine3d(const c8* attributeName, core::line3df v) void CAttributes::addLine3d(const c8* attributeName, const core::line3df& v)
{ {
Attributes.push_back(new CLine3dAttribute(attributeName, v)); Attributes.push_back(new CLine3dAttribute(attributeName, v));
} }
//! Sets an attribute as a 3d line //! Sets an attribute as a 3d line
void CAttributes::setAttribute(const c8* attributeName, core::line3df v) void CAttributes::setAttribute(const c8* attributeName, const core::line3df& v)
{ {
IAttribute* att = getAttributeP(attributeName); IAttribute* att = getAttributeP(attributeName);
if (att) if (att)
@ -1325,7 +1325,7 @@ core::line3df CAttributes::getAttributeAsLine3d(s32 index)
} }
//! Sets an attribute as a 3d line //! Sets an attribute as a 3d line
void CAttributes::setAttribute(s32 index, core::line3df v) void CAttributes::setAttribute(s32 index, const core::line3df& v)
{ {
if (index >= 0 && index < (s32)Attributes.size() ) if (index >= 0 && index < (s32)Attributes.size() )
Attributes[index]->setLine3d(v); Attributes[index]->setLine3d(v);
@ -1333,7 +1333,7 @@ void CAttributes::setAttribute(s32 index, core::line3df v)
} }
//! Adds an attribute as user pointner //! Adds an attribute as user pointer
void CAttributes::addUserPointer(const c8* attributeName, void* userPointer) void CAttributes::addUserPointer(const c8* attributeName, void* userPointer)
{ {
Attributes.push_back(new CUserPointerAttribute(attributeName, userPointer)); Attributes.push_back(new CUserPointerAttribute(attributeName, userPointer));

View File

@ -370,10 +370,10 @@ public:
*/ */
//! Adds an attribute as 3d vector //! Adds an attribute as 3d vector
virtual void addVector3d(const c8* attributeName, core::vector3df value) _IRR_OVERRIDE_; virtual void addVector3d(const c8* attributeName, const core::vector3df& value) _IRR_OVERRIDE_;
//! Sets a attribute as 3d vector //! Sets a attribute as 3d vector
virtual void setAttribute(const c8* attributeName, core::vector3df v) _IRR_OVERRIDE_; virtual void setAttribute(const c8* attributeName, const core::vector3df& v) _IRR_OVERRIDE_;
//! Gets an attribute as 3d vector //! Gets an attribute as 3d vector
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
@ -386,7 +386,7 @@ public:
virtual core::vector3df getAttributeAsVector3d(s32 index) _IRR_OVERRIDE_; virtual core::vector3df getAttributeAsVector3d(s32 index) _IRR_OVERRIDE_;
//! Sets an attribute as vector //! Sets an attribute as vector
virtual void setAttribute(s32 index, core::vector3df v) _IRR_OVERRIDE_; virtual void setAttribute(s32 index, const core::vector3df& v) _IRR_OVERRIDE_;
/* /*
@ -396,10 +396,10 @@ public:
*/ */
//! Adds an attribute as 2d vector //! Adds an attribute as 2d vector
virtual void addVector2d(const c8* attributeName, core::vector2df value) _IRR_OVERRIDE_; virtual void addVector2d(const c8* attributeName, const core::vector2df& value) _IRR_OVERRIDE_;
//! Sets a attribute as 2d vector //! Sets a attribute as 2d vector
virtual void setAttribute(const c8* attributeName, core::vector2df v) _IRR_OVERRIDE_; virtual void setAttribute(const c8* attributeName, const core::vector2df& v) _IRR_OVERRIDE_;
//! Gets an attribute as 2d vector //! Gets an attribute as 2d vector
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
@ -412,7 +412,7 @@ public:
virtual core::vector2df getAttributeAsVector2d(s32 index) _IRR_OVERRIDE_; virtual core::vector2df getAttributeAsVector2d(s32 index) _IRR_OVERRIDE_;
//! Sets an attribute as vector //! Sets an attribute as vector
virtual void setAttribute(s32 index, core::vector2df v) _IRR_OVERRIDE_; virtual void setAttribute(s32 index, const core::vector2df& v) _IRR_OVERRIDE_;
/* /*
@ -422,10 +422,10 @@ public:
*/ */
//! Adds an attribute as 2d position //! Adds an attribute as 2d position
virtual void addPosition2d(const c8* attributeName, core::position2di value) _IRR_OVERRIDE_; virtual void addPosition2d(const c8* attributeName, const core::position2di& value) _IRR_OVERRIDE_;
//! Sets a attribute as 2d position //! Sets a attribute as 2d position
virtual void setAttribute(const c8* attributeName, core::position2di v) _IRR_OVERRIDE_; virtual void setAttribute(const c8* attributeName, const core::position2di& v) _IRR_OVERRIDE_;
//! Gets an attribute as position //! Gets an attribute as position
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
@ -438,7 +438,7 @@ public:
virtual core::position2di getAttributeAsPosition2d(s32 index) _IRR_OVERRIDE_; virtual core::position2di getAttributeAsPosition2d(s32 index) _IRR_OVERRIDE_;
//! Sets an attribute as 2d position //! Sets an attribute as 2d position
virtual void setAttribute(s32 index, core::position2di v) _IRR_OVERRIDE_; virtual void setAttribute(s32 index, const core::position2di& v) _IRR_OVERRIDE_;
/* /*
@ -447,10 +447,10 @@ public:
*/ */
//! Adds an attribute as rectangle //! Adds an attribute as rectangle
virtual void addRect(const c8* attributeName, core::rect<s32> value) _IRR_OVERRIDE_; virtual void addRect(const c8* attributeName, const core::rect<s32>& value) _IRR_OVERRIDE_;
//! Sets an attribute as rectangle //! Sets an attribute as rectangle
virtual void setAttribute(const c8* attributeName, core::rect<s32> v) _IRR_OVERRIDE_; virtual void setAttribute(const c8* attributeName, const core::rect<s32>& v) _IRR_OVERRIDE_;
//! Gets an attribute as rectangle //! Gets an attribute as rectangle
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
@ -463,7 +463,7 @@ public:
virtual core::rect<s32> getAttributeAsRect(s32 index) _IRR_OVERRIDE_; virtual core::rect<s32> getAttributeAsRect(s32 index) _IRR_OVERRIDE_;
//! Sets an attribute as rectangle //! Sets an attribute as rectangle
virtual void setAttribute(s32 index, core::rect<s32> v) _IRR_OVERRIDE_; virtual void setAttribute(s32 index, const core::rect<s32>& v) _IRR_OVERRIDE_;
/* /*
@ -473,10 +473,10 @@ public:
*/ */
//! Adds an attribute as dimension2d //! Adds an attribute as dimension2d
virtual void addDimension2d(const c8* attributeName, core::dimension2d<u32> value) _IRR_OVERRIDE_; virtual void addDimension2d(const c8* attributeName, const core::dimension2d<u32>& value) _IRR_OVERRIDE_;
//! Sets an attribute as dimension2d //! Sets an attribute as dimension2d
virtual void setAttribute(const c8* attributeName, core::dimension2d<u32> v) _IRR_OVERRIDE_; virtual void setAttribute(const c8* attributeName, const core::dimension2d<u32>& v) _IRR_OVERRIDE_;
//! Gets an attribute as dimension2d //! Gets an attribute as dimension2d
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
@ -489,7 +489,7 @@ public:
virtual core::dimension2d<u32> getAttributeAsDimension2d(s32 index) _IRR_OVERRIDE_; virtual core::dimension2d<u32> getAttributeAsDimension2d(s32 index) _IRR_OVERRIDE_;
//! Sets an attribute as dimension2d //! Sets an attribute as dimension2d
virtual void setAttribute(s32 index, core::dimension2d<u32> v) _IRR_OVERRIDE_; virtual void setAttribute(s32 index, const core::dimension2d<u32>& v) _IRR_OVERRIDE_;
/* /*
@ -523,10 +523,10 @@ public:
*/ */
//! Adds an attribute as quaternion //! Adds an attribute as quaternion
virtual void addQuaternion(const c8* attributeName, core::quaternion v) _IRR_OVERRIDE_; virtual void addQuaternion(const c8* attributeName, const core::quaternion& v) _IRR_OVERRIDE_;
//! Sets an attribute as quaternion //! Sets an attribute as quaternion
virtual void setAttribute(const c8* attributeName, core::quaternion v) _IRR_OVERRIDE_; virtual void setAttribute(const c8* attributeName, const core::quaternion& v) _IRR_OVERRIDE_;
//! Gets an attribute as a quaternion //! Gets an attribute as a quaternion
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
@ -539,7 +539,7 @@ public:
virtual core::quaternion getAttributeAsQuaternion(s32 index) _IRR_OVERRIDE_; virtual core::quaternion getAttributeAsQuaternion(s32 index) _IRR_OVERRIDE_;
//! Sets an attribute as quaternion //! Sets an attribute as quaternion
virtual void setAttribute(s32 index, core::quaternion v) _IRR_OVERRIDE_; virtual void setAttribute(s32 index, const core::quaternion& v) _IRR_OVERRIDE_;
/* /*
@ -548,10 +548,10 @@ public:
*/ */
//! Adds an attribute as axis aligned bounding box //! Adds an attribute as axis aligned bounding box
virtual void addBox3d(const c8* attributeName, core::aabbox3df v) _IRR_OVERRIDE_; virtual void addBox3d(const c8* attributeName, const core::aabbox3df& v) _IRR_OVERRIDE_;
//! Sets an attribute as axis aligned bounding box //! Sets an attribute as axis aligned bounding box
virtual void setAttribute(const c8* attributeName, core::aabbox3df v) _IRR_OVERRIDE_; virtual void setAttribute(const c8* attributeName, const core::aabbox3df& v) _IRR_OVERRIDE_;
//! Gets an attribute as a axis aligned bounding box //! Gets an attribute as a axis aligned bounding box
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
@ -564,7 +564,7 @@ public:
virtual core::aabbox3df getAttributeAsBox3d(s32 index) _IRR_OVERRIDE_; virtual core::aabbox3df getAttributeAsBox3d(s32 index) _IRR_OVERRIDE_;
//! Sets an attribute as axis aligned bounding box //! Sets an attribute as axis aligned bounding box
virtual void setAttribute(s32 index, core::aabbox3df v) _IRR_OVERRIDE_; virtual void setAttribute(s32 index, const core::aabbox3df& v) _IRR_OVERRIDE_;
/* /*
@ -573,10 +573,10 @@ public:
*/ */
//! Adds an attribute as 3d plane //! Adds an attribute as 3d plane
virtual void addPlane3d(const c8* attributeName, core::plane3df v) _IRR_OVERRIDE_; virtual void addPlane3d(const c8* attributeName, const core::plane3df& v) _IRR_OVERRIDE_;
//! Sets an attribute as 3d plane //! Sets an attribute as 3d plane
virtual void setAttribute(const c8* attributeName, core::plane3df v) _IRR_OVERRIDE_; virtual void setAttribute(const c8* attributeName, const core::plane3df& v) _IRR_OVERRIDE_;
//! Gets an attribute as a 3d plane //! Gets an attribute as a 3d plane
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
@ -589,7 +589,7 @@ public:
virtual core::plane3df getAttributeAsPlane3d(s32 index) _IRR_OVERRIDE_; virtual core::plane3df getAttributeAsPlane3d(s32 index) _IRR_OVERRIDE_;
//! Sets an attribute as 3d plane //! Sets an attribute as 3d plane
virtual void setAttribute(s32 index, core::plane3df v) _IRR_OVERRIDE_; virtual void setAttribute(s32 index, const core::plane3df& v) _IRR_OVERRIDE_;
/* /*
@ -599,10 +599,10 @@ public:
*/ */
//! Adds an attribute as 3d triangle //! Adds an attribute as 3d triangle
virtual void addTriangle3d(const c8* attributeName, core::triangle3df v) _IRR_OVERRIDE_; virtual void addTriangle3d(const c8* attributeName, const core::triangle3df& v) _IRR_OVERRIDE_;
//! Sets an attribute as 3d trianle //! Sets an attribute as 3d triangle
virtual void setAttribute(const c8* attributeName, core::triangle3df v) _IRR_OVERRIDE_; virtual void setAttribute(const c8* attributeName, const core::triangle3df& v) _IRR_OVERRIDE_;
//! Gets an attribute as a 3d triangle //! Gets an attribute as a 3d triangle
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
@ -615,7 +615,7 @@ public:
virtual core::triangle3df getAttributeAsTriangle3d(s32 index) _IRR_OVERRIDE_; virtual core::triangle3df getAttributeAsTriangle3d(s32 index) _IRR_OVERRIDE_;
//! Sets an attribute as 3d triangle //! Sets an attribute as 3d triangle
virtual void setAttribute(s32 index, core::triangle3df v) _IRR_OVERRIDE_; virtual void setAttribute(s32 index, const core::triangle3df& v) _IRR_OVERRIDE_;
/* /*
@ -625,10 +625,10 @@ public:
*/ */
//! Adds an attribute as a 2d line //! Adds an attribute as a 2d line
virtual void addLine2d(const c8* attributeName, core::line2df v) _IRR_OVERRIDE_; virtual void addLine2d(const c8* attributeName, const core::line2df& v) _IRR_OVERRIDE_;
//! Sets an attribute as a 2d line //! Sets an attribute as a 2d line
virtual void setAttribute(const c8* attributeName, core::line2df v) _IRR_OVERRIDE_; virtual void setAttribute(const c8* attributeName, const core::line2df& v) _IRR_OVERRIDE_;
//! Gets an attribute as a 2d line //! Gets an attribute as a 2d line
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
@ -641,7 +641,7 @@ public:
virtual core::line2df getAttributeAsLine2d(s32 index) _IRR_OVERRIDE_; virtual core::line2df getAttributeAsLine2d(s32 index) _IRR_OVERRIDE_;
//! Sets an attribute as a 2d line //! Sets an attribute as a 2d line
virtual void setAttribute(s32 index, core::line2df v) _IRR_OVERRIDE_; virtual void setAttribute(s32 index, const core::line2df& v) _IRR_OVERRIDE_;
/* /*
@ -651,10 +651,10 @@ public:
*/ */
//! Adds an attribute as a 3d line //! Adds an attribute as a 3d line
virtual void addLine3d(const c8* attributeName, core::line3df v) _IRR_OVERRIDE_; virtual void addLine3d(const c8* attributeName, const core::line3df& v) _IRR_OVERRIDE_;
//! Sets an attribute as a 3d line //! Sets an attribute as a 3d line
virtual void setAttribute(const c8* attributeName, core::line3df v) _IRR_OVERRIDE_; virtual void setAttribute(const c8* attributeName, const core::line3df& v) _IRR_OVERRIDE_;
//! Gets an attribute as a 3d line //! Gets an attribute as a 3d line
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
@ -667,7 +667,7 @@ public:
virtual core::line3df getAttributeAsLine3d(s32 index) _IRR_OVERRIDE_; virtual core::line3df getAttributeAsLine3d(s32 index) _IRR_OVERRIDE_;
//! Sets an attribute as a 3d line //! Sets an attribute as a 3d line
virtual void setAttribute(s32 index, core::line3df v) _IRR_OVERRIDE_; virtual void setAttribute(s32 index, const core::line3df& v) _IRR_OVERRIDE_;
/* /*
@ -702,7 +702,7 @@ public:
*/ */
//! Adds an attribute as user pointner //! Adds an attribute as user pointer
virtual void addUserPointer(const c8* attributeName, void* userPointer) _IRR_OVERRIDE_; virtual void addUserPointer(const c8* attributeName, void* userPointer) _IRR_OVERRIDE_;
//! Sets an attribute as user pointer //! Sets an attribute as user pointer

View File

@ -164,7 +164,7 @@ bool CB3DMeshFileLoader::readChunkNODE(CSkinnedMesh::SJoint *inJoint)
for ( u32 i=1; i < B3dStack.size(); ++i ) for ( u32 i=1; i < B3dStack.size(); ++i )
logStr += "-"; logStr += "-";
logStr += "read ChunkNODE"; logStr += "read ChunkNODE";
os::Printer::log(logStr.c_str(), joint->Name.c_str()); os::Printer::log(logStr.c_str(), joint->Name.c_str(), ELL_DEBUG);
#endif #endif
f32 position[3], scale[3], rotation[4]; f32 position[3], scale[3], rotation[4];
@ -250,7 +250,7 @@ bool CB3DMeshFileLoader::readChunkMESH(CSkinnedMesh::SJoint *inJoint)
for ( u32 i=1; i < B3dStack.size(); ++i ) for ( u32 i=1; i < B3dStack.size(); ++i )
logStr += "-"; logStr += "-";
logStr += "read ChunkMESH"; logStr += "read ChunkMESH";
os::Printer::log(logStr.c_str()); os::Printer::log(logStr.c_str(), ELL_DEBUG);
#endif #endif
s32 brushID; s32 brushID;
@ -346,7 +346,7 @@ bool CB3DMeshFileLoader::readChunkVRTS(CSkinnedMesh::SJoint *inJoint)
for ( u32 i=1; i < B3dStack.size(); ++i ) for ( u32 i=1; i < B3dStack.size(); ++i )
logStr += "-"; logStr += "-";
logStr += "ChunkVRTS"; logStr += "ChunkVRTS";
os::Printer::log(logStr.c_str()); os::Printer::log(logStr.c_str(), ELL_DEBUG);
#endif #endif
const s32 max_tex_coords = 3; const s32 max_tex_coords = 3;
@ -452,7 +452,7 @@ bool CB3DMeshFileLoader::readChunkTRIS(scene::SSkinMeshBuffer *meshBuffer, u32 m
for ( u32 i=1; i < B3dStack.size(); ++i ) for ( u32 i=1; i < B3dStack.size(); ++i )
logStr += "-"; logStr += "-";
logStr += "ChunkTRIS"; logStr += "ChunkTRIS";
os::Printer::log(logStr.c_str()); os::Printer::log(logStr.c_str(), ELL_DEBUG);
#endif #endif
bool showVertexWarning=false; bool showVertexWarning=false;
@ -574,7 +574,7 @@ bool CB3DMeshFileLoader::readChunkBONE(CSkinnedMesh::SJoint *inJoint)
for ( u32 i=1; i < B3dStack.size(); ++i ) for ( u32 i=1; i < B3dStack.size(); ++i )
logStr += "-"; logStr += "-";
logStr += "read ChunkBONE"; logStr += "read ChunkBONE";
os::Printer::log(logStr.c_str()); os::Printer::log(logStr.c_str(), ELL_DEBUG);
#endif #endif
if (B3dStack.getLast().length > 8) if (B3dStack.getLast().length > 8)
@ -621,7 +621,7 @@ bool CB3DMeshFileLoader::readChunkKEYS(CSkinnedMesh::SJoint *inJoint)
for ( u32 i=1; i < B3dStack.size(); ++i ) for ( u32 i=1; i < B3dStack.size(); ++i )
logStr += "-"; logStr += "-";
logStr += "read ChunkKEYS"; logStr += "read ChunkKEYS";
os::Printer::log(logStr.c_str()); os::Printer::log(logStr.c_str(), ELL_DEBUG);
} }
#endif #endif
@ -765,7 +765,7 @@ bool CB3DMeshFileLoader::readChunkANIM()
for ( u32 i=1; i < B3dStack.size(); ++i ) for ( u32 i=1; i < B3dStack.size(); ++i )
logStr += "-"; logStr += "-";
logStr += "read ChunkANIM"; logStr += "read ChunkANIM";
os::Printer::log(logStr.c_str()); os::Printer::log(logStr.c_str(), ELL_DEBUG);
#endif #endif
s32 animFlags; //not stored\used s32 animFlags; //not stored\used
@ -796,7 +796,7 @@ bool CB3DMeshFileLoader::readChunkTEXS()
for ( u32 i=1; i < B3dStack.size(); ++i ) for ( u32 i=1; i < B3dStack.size(); ++i )
logStr += "-"; logStr += "-";
logStr += "read ChunkTEXS"; logStr += "read ChunkTEXS";
os::Printer::log(logStr.c_str()); os::Printer::log(logStr.c_str(), ELL_DEBUG);
#endif #endif
while((B3dStack.getLast().startposition + B3dStack.getLast().length) > B3DFile->getPos()) //this chunk repeats while((B3dStack.getLast().startposition + B3dStack.getLast().length) > B3DFile->getPos()) //this chunk repeats
@ -807,7 +807,7 @@ bool CB3DMeshFileLoader::readChunkTEXS()
readString(B3dTexture.TextureName); readString(B3dTexture.TextureName);
B3dTexture.TextureName.replace('\\','/'); B3dTexture.TextureName.replace('\\','/');
#ifdef _B3D_READER_DEBUG #ifdef _B3D_READER_DEBUG
os::Printer::log("read Texture", B3dTexture.TextureName.c_str()); os::Printer::log("read Texture", B3dTexture.TextureName.c_str(), ELL_DEBUG);
#endif #endif
B3DFile->read(&B3dTexture.Flags, sizeof(s32)); B3DFile->read(&B3dTexture.Flags, sizeof(s32));
@ -817,8 +817,8 @@ bool CB3DMeshFileLoader::readChunkTEXS()
B3dTexture.Blend = os::Byteswap::byteswap(B3dTexture.Blend); B3dTexture.Blend = os::Byteswap::byteswap(B3dTexture.Blend);
#endif #endif
#ifdef _B3D_READER_DEBUG #ifdef _B3D_READER_DEBUG
os::Printer::log("Flags", core::stringc(B3dTexture.Flags).c_str()); os::Printer::log("Flags", core::stringc(B3dTexture.Flags).c_str(), ELL_DEBUG);
os::Printer::log("Blend", core::stringc(B3dTexture.Blend).c_str()); os::Printer::log("Blend", core::stringc(B3dTexture.Blend).c_str(), ELL_DEBUG);
#endif #endif
readFloats(&B3dTexture.Xpos, 1); readFloats(&B3dTexture.Xpos, 1);
readFloats(&B3dTexture.Ypos, 1); readFloats(&B3dTexture.Ypos, 1);
@ -840,7 +840,7 @@ bool CB3DMeshFileLoader::readChunkBRUS()
for ( u32 i=1; i < B3dStack.size(); ++i ) for ( u32 i=1; i < B3dStack.size(); ++i )
logStr += "-"; logStr += "-";
logStr += "read ChunkBRUS"; logStr += "read ChunkBRUS";
os::Printer::log(logStr.c_str()); os::Printer::log(logStr.c_str(), ELL_DEBUG);
#endif #endif
u32 n_texs; u32 n_texs;
@ -861,7 +861,7 @@ bool CB3DMeshFileLoader::readChunkBRUS()
core::stringc name; core::stringc name;
readString(name); readString(name);
#ifdef _B3D_READER_DEBUG #ifdef _B3D_READER_DEBUG
os::Printer::log("read Material", name); os::Printer::log("read Material", name, ELL_DEBUG);
#endif #endif
Materials.push_back(SB3dMaterial()); Materials.push_back(SB3dMaterial());
SB3dMaterial& B3dMaterial=Materials.getLast(); SB3dMaterial& B3dMaterial=Materials.getLast();
@ -879,8 +879,8 @@ bool CB3DMeshFileLoader::readChunkBRUS()
B3dMaterial.fx = os::Byteswap::byteswap(B3dMaterial.fx); B3dMaterial.fx = os::Byteswap::byteswap(B3dMaterial.fx);
#endif #endif
#ifdef _B3D_READER_DEBUG #ifdef _B3D_READER_DEBUG
os::Printer::log("Blend", core::stringc(B3dMaterial.blend).c_str()); os::Printer::log("Blend", core::stringc(B3dMaterial.blend).c_str(), ELL_DEBUG);
os::Printer::log("FX", core::stringc(B3dMaterial.fx).c_str()); os::Printer::log("FX", core::stringc(B3dMaterial.fx).c_str(), ELL_DEBUG);
#endif #endif
u32 i; u32 i;
@ -896,8 +896,8 @@ bool CB3DMeshFileLoader::readChunkBRUS()
{ {
B3dMaterial.Textures[i]=&Textures[texture_id]; B3dMaterial.Textures[i]=&Textures[texture_id];
#ifdef _B3D_READER_DEBUG #ifdef _B3D_READER_DEBUG
os::Printer::log("Layer", core::stringc(i).c_str()); os::Printer::log("Layer", core::stringc(i).c_str(), ELL_DEBUG);
os::Printer::log("using texture", Textures[texture_id].TextureName.c_str()); os::Printer::log("using texture", Textures[texture_id].TextureName.c_str(), ELL_DEBUG);
#endif #endif
} }
else else

View File

@ -124,7 +124,7 @@ namespace
const core::stringc profileCOMMONAttributeName = "COMMON"; const core::stringc profileCOMMONAttributeName = "COMMON";
const char* const inputSemanticNames[] = {"POSITION", "VERTEX", "NORMAL", "TEXCOORD", const char* const inputSemanticNames[] = {"POSITION", "VERTEX", "NORMAL", "TEXCOORD",
"UV", "TANGENT", "IMAGE", "TEXTURE", 0}; "UV", "TANGENT", "IMAGE", "TEXTURE", "COLOR", 0};
// We have to read ambient lights like other light types here, so we need a type for it // We have to read ambient lights like other light types here, so we need a type for it
const video::E_LIGHT_TYPE ELT_AMBIENT = video::E_LIGHT_TYPE(video::ELT_COUNT+1); const video::E_LIGHT_TYPE ELT_AMBIENT = video::E_LIGHT_TYPE(video::ELT_COUNT+1);
@ -2192,6 +2192,15 @@ void CColladaFileLoader::readPolygonSection(io::IXMLReaderUTF8* reader,
break; break;
case ECIS_TANGENT: case ECIS_TANGENT:
break; break;
case ECIS_COLOR:
{
video::SColorf col;
col.r = localInputs[k].Data[idx+0];
col.g = localInputs[k].Data[idx+1];
col.b = localInputs[k].Data[idx+2];
vtx.Color = col.toSColor();
break;
}
default: default:
break; break;
} }
@ -2326,6 +2335,15 @@ void CColladaFileLoader::readPolygonSection(io::IXMLReaderUTF8* reader,
break; break;
case ECIS_TANGENT: case ECIS_TANGENT:
break; break;
case ECIS_COLOR:
{
video::SColorf col;
col.r = localInputs[k].Data[idx+0];
col.g = localInputs[k].Data[idx+1];
col.b = localInputs[k].Data[idx+2];
vtx.Color = col.toSColor();
break;
}
default: default:
break; break;
} }

View File

@ -76,6 +76,7 @@ enum ECOLLADA_INPUT_SEMANTIC
ECIS_TANGENT, ECIS_TANGENT,
ECIS_IMAGE, ECIS_IMAGE,
ECIS_TEXTURE, ECIS_TEXTURE,
ECIS_COLOR,
ECIS_COUNT ECIS_COUNT
}; };

View File

@ -929,11 +929,9 @@ void CGUIEnvironment::writeGUIElement(io::IXMLWriter* writer, IGUIElement* node)
core::stringw(node->getTypeName()).c_str()); core::stringw(node->getTypeName()).c_str());
} }
writer->writeLineBreak();
writer->writeLineBreak(); writer->writeLineBreak();
attr->write(writer); attr->write(writer);
writer->writeLineBreak();
} }
// write children // write children
@ -942,7 +940,10 @@ void CGUIEnvironment::writeGUIElement(io::IXMLWriter* writer, IGUIElement* node)
for (; it != node->getChildren().end(); ++it) for (; it != node->getChildren().end(); ++it)
{ {
if (!(*it)->isSubElement()) if (!(*it)->isSubElement())
{
writer->writeLineBreak();
writeGUIElement(writer, (*it)); writeGUIElement(writer, (*it));
}
} }
// write closing brace if required // write closing brace if required
@ -950,7 +951,6 @@ void CGUIEnvironment::writeGUIElement(io::IXMLWriter* writer, IGUIElement* node)
{ {
writer->writeClosingTag(name); writer->writeClosingTag(name);
writer->writeLineBreak(); writer->writeLineBreak();
writer->writeLineBreak();
} }
attr->drop(); attr->drop();

View File

@ -78,18 +78,22 @@ void CGUIImage::draw()
if (Texture) if (Texture)
{ {
core::rect<s32> sourceRect(SourceRect);
if (sourceRect.getWidth() == 0 || sourceRect.getHeight() == 0)
{
sourceRect = core::rect<s32>(core::position2d<s32>(0,0), core::dimension2di(Texture->getOriginalSize()));
}
if (ScaleImage) if (ScaleImage)
{ {
const video::SColor Colors[] = {Color,Color,Color,Color}; const video::SColor Colors[] = {Color,Color,Color,Color};
driver->draw2DImage(Texture, AbsoluteRect, driver->draw2DImage(Texture, AbsoluteRect, sourceRect,
core::rect<s32>(core::position2d<s32>(0,0), core::dimension2di(Texture->getOriginalSize())),
&AbsoluteClippingRect, Colors, UseAlphaChannel); &AbsoluteClippingRect, Colors, UseAlphaChannel);
} }
else else
{ {
driver->draw2DImage(Texture, AbsoluteRect.UpperLeftCorner, driver->draw2DImage(Texture, AbsoluteRect.UpperLeftCorner, sourceRect,
core::rect<s32>(core::position2d<s32>(0,0), core::dimension2di(Texture->getOriginalSize())),
&AbsoluteClippingRect, Color, UseAlphaChannel); &AbsoluteClippingRect, Color, UseAlphaChannel);
} }
} }
@ -130,6 +134,18 @@ bool CGUIImage::isAlphaChannelUsed() const
return UseAlphaChannel; return UseAlphaChannel;
} }
//! Sets the source rectangle of the image. By default the full image is used.
void CGUIImage::setSourceRect(const core::rect<s32>& sourceRect)
{
SourceRect = sourceRect;
}
//! Returns the customized source rectangle of the image to be used.
core::rect<s32> CGUIImage::getSourceRect() const
{
return SourceRect;
}
//! Writes attributes of the element. //! Writes attributes of the element.
void CGUIImage::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const void CGUIImage::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const
@ -140,7 +156,7 @@ void CGUIImage::serializeAttributes(io::IAttributes* out, io::SAttributeReadWrit
out->addBool ("UseAlphaChannel", UseAlphaChannel); out->addBool ("UseAlphaChannel", UseAlphaChannel);
out->addColor ("Color", Color); out->addColor ("Color", Color);
out->addBool ("ScaleImage", ScaleImage); out->addBool ("ScaleImage", ScaleImage);
out->addRect ("SourceRect", SourceRect);
} }
@ -149,10 +165,11 @@ void CGUIImage::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWri
{ {
IGUIImage::deserializeAttributes(in,options); IGUIImage::deserializeAttributes(in,options);
setImage(in->getAttributeAsTexture("Texture")); setImage(in->getAttributeAsTexture("Texture", Texture));
setUseAlphaChannel(in->getAttributeAsBool("UseAlphaChannel")); setUseAlphaChannel(in->getAttributeAsBool("UseAlphaChannel", UseAlphaChannel));
setColor(in->getAttributeAsColor("Color")); setColor(in->getAttributeAsColor("Color", Color));
setScaleImage(in->getAttributeAsBool("ScaleImage")); setScaleImage(in->getAttributeAsBool("ScaleImage", UseAlphaChannel));
setSourceRect(in->getAttributeAsRect("SourceRect", SourceRect));
} }

View File

@ -52,6 +52,12 @@ namespace gui
//! Returns true if the image is using the alpha channel, false if not //! Returns true if the image is using the alpha channel, false if not
virtual bool isAlphaChannelUsed() const _IRR_OVERRIDE_; virtual bool isAlphaChannelUsed() const _IRR_OVERRIDE_;
//! Sets the source rectangle of the image. By default the full image is used.
virtual void setSourceRect(const core::rect<s32>& sourceRect) _IRR_OVERRIDE_;
//! Returns the customized source rectangle of the image to be used.
virtual core::rect<s32> getSourceRect() const _IRR_OVERRIDE_;
//! Writes attributes of the element. //! Writes attributes of the element.
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const _IRR_OVERRIDE_; virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const _IRR_OVERRIDE_;
@ -63,7 +69,7 @@ namespace gui
video::SColor Color; video::SColor Color;
bool UseAlphaChannel; bool UseAlphaChannel;
bool ScaleImage; bool ScaleImage;
core::rect<s32> SourceRect;
}; };

View File

@ -222,7 +222,7 @@ void CSceneCollisionManager::getPickedNodeBB(ISceneNode* root,
ISceneNode* CSceneCollisionManager::getSceneNodeAndCollisionPointFromRay( ISceneNode* CSceneCollisionManager::getSceneNodeAndCollisionPointFromRay(
core::line3df ray, const core::line3df& ray,
core::vector3df & outCollisionPoint, core::vector3df & outCollisionPoint,
core::triangle3df & outTriangle, core::triangle3df & outTriangle,
s32 idBitMask, s32 idBitMask,
@ -258,7 +258,8 @@ ISceneNode* CSceneCollisionManager::getSceneNodeAndCollisionPointFromRay(
// node in order to find the nearest collision point, so sorting them by // node in order to find the nearest collision point, so sorting them by
// bounding box would be pointless. // bounding box would be pointless.
getPickedNodeFromBBAndSelector(collisionRootNode, ray, idBitMask, core::line3df rayRest(ray);
getPickedNodeFromBBAndSelector(collisionRootNode, rayRest, idBitMask,
noDebugObjects, bestDistanceSquared, bestNode, noDebugObjects, bestDistanceSquared, bestNode,
outCollisionPoint, outTriangle); outCollisionPoint, outTriangle);
return bestNode; return bestNode;
@ -754,7 +755,7 @@ core::vector3df CSceneCollisionManager::collideEllipsoidWithWorld(
core::vector3df CSceneCollisionManager::collideWithWorld(s32 recursionDepth, core::vector3df CSceneCollisionManager::collideWithWorld(s32 recursionDepth,
SCollisionData &colData, core::vector3df pos, core::vector3df vel) SCollisionData &colData, const core::vector3df& pos, const core::vector3df& vel)
{ {
f32 veryCloseDistance = colData.slidingSpeed; f32 veryCloseDistance = colData.slidingSpeed;

View File

@ -72,9 +72,9 @@ namespace scene
//! Gets the scene node and nearest collision point for a ray based on //! Gets the scene node and nearest collision point for a ray based on
//! the nodes' id bitmasks, bounding boxes and triangle selectors. //! the nodes' id bitmasks, bounding boxes and triangle selectors.
virtual ISceneNode* getSceneNodeAndCollisionPointFromRay( virtual ISceneNode* getSceneNodeAndCollisionPointFromRay(
core::line3df ray, const core::line3df& ray,
core::vector3df & outCollisionPoint, core::vector3df& outCollisionPoint,
core::triangle3df & outTriangle, core::triangle3df& outTriangle,
s32 idBitMask = 0, s32 idBitMask = 0,
ISceneNode * collisionRootNode = 0, ISceneNode * collisionRootNode = 0,
bool noDebugObjects = false) _IRR_OVERRIDE_; bool noDebugObjects = false) _IRR_OVERRIDE_;
@ -141,7 +141,7 @@ namespace scene
ISceneNode*& outNode); ISceneNode*& outNode);
core::vector3df collideWithWorld(s32 recursionDepth, SCollisionData &colData, core::vector3df collideWithWorld(s32 recursionDepth, SCollisionData &colData,
core::vector3df pos, core::vector3df vel); const core::vector3df& pos, const core::vector3df& vel);
inline bool getLowestRoot(f32 a, f32 b, f32 c, f32 maxR, f32* root); inline bool getLowestRoot(f32 a, f32 b, f32 c, f32 maxR, f32* root);

View File

@ -75,21 +75,21 @@ public:
virtual void setColor(video::SColor color) {}; virtual void setColor(video::SColor color) {};
virtual void setBool(bool boolValue) {}; virtual void setBool(bool boolValue) {};
virtual void setBinary(void* data, s32 maxLenght) {}; virtual void setBinary(void* data, s32 maxLenght) {};
virtual void setVector(core::vector3df v) {}; virtual void setVector(const core::vector3df& v) {};
virtual void setPosition(core::position2di v) {}; virtual void setPosition(const core::position2di& v) {};
virtual void setRect(core::rect<s32> v) {}; virtual void setRect(const core::rect<s32>& v) {};
virtual void setQuaternion(core::quaternion v) {}; virtual void setQuaternion(const core::quaternion& v) {};
virtual void setMatrix(core::matrix4 v) {}; virtual void setMatrix(const core::matrix4& v) {};
virtual void setTriangle(core::triangle3df v) {}; virtual void setTriangle(const core::triangle3df& v) {};
virtual void setVector2d(core::vector2df v) {}; virtual void setVector2d(const core::vector2df& v) {};
virtual void setVector2d(core::vector2di v) {}; virtual void setVector2d(const core::vector2di& v) {};
virtual void setLine2d(core::line2df v) {}; virtual void setLine2d(const core::line2df& v) {};
virtual void setLine2d(core::line2di v) {}; virtual void setLine2d(const core::line2di& v) {};
virtual void setLine3d(core::line3df v) {}; virtual void setLine3d(const core::line3df& v) {};
virtual void setLine3d(core::line3di v) {}; virtual void setLine3d(const core::line3di& v) {};
virtual void setDimension2d(core::dimension2du v) {}; virtual void setDimension2d(const core::dimension2du& v) {};
virtual void setBBox(core::aabbox3d<f32> v) {}; virtual void setBBox(const core::aabbox3d<f32>& v) {};
virtual void setPlane(core::plane3df v) {}; virtual void setPlane(const core::plane3df& v) {};
virtual void setUserPointer(void* v) {}; virtual void setUserPointer(void* v) {};
virtual void setEnum(const char* enumValue, const char* const* enumerationLiterals) {}; virtual void setEnum(const char* enumValue, const char* const* enumerationLiterals) {};