Commit 9f7227b7 authored by hybrid's avatar hybrid

Some whitespace adjustment.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4500 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 6d6b2439
...@@ -29,7 +29,7 @@ namespace scene ...@@ -29,7 +29,7 @@ namespace scene
"box", // camera box against node box "box", // camera box against node box
"frustum_box", // camera frustum against node box "frustum_box", // camera frustum against node box
"frustum_sphere", // camera frustum against node sphere "frustum_sphere", // camera frustum against node sphere
"occ_query", // occlusion query "occ_query", // occlusion query
0 0
}; };
......
...@@ -19,7 +19,7 @@ namespace scene ...@@ -19,7 +19,7 @@ namespace scene
enum ESCENE_NODE_TYPE enum ESCENE_NODE_TYPE
{ {
//! of type CSceneManager (note that ISceneManager is not(!) an ISceneNode) //! of type CSceneManager (note that ISceneManager is not(!) an ISceneNode)
ESNT_SCENE_MANAGER = MAKE_IRR_ID('s','m','n','g'), ESNT_SCENE_MANAGER = MAKE_IRR_ID('s','m','n','g'),
//! simple cube scene node //! simple cube scene node
ESNT_CUBE = MAKE_IRR_ID('c','u','b','e'), ESNT_CUBE = MAKE_IRR_ID('c','u','b','e'),
......
...@@ -80,17 +80,17 @@ namespace scene ...@@ -80,17 +80,17 @@ namespace scene
//! this holds the header info of the MD3 file //! this holds the header info of the MD3 file
struct SMD3Header struct SMD3Header
{ {
c8 headerID[4]; //id of file, always "IDP3" c8 headerID[4]; //id of file, always "IDP3"
s32 Version; //this is a version number, always 15 s32 Version; //this is a version number, always 15
s8 fileName[68]; //sometimes left Blank... 65 chars, 32bit aligned == 68 chars s8 fileName[68];//sometimes left Blank... 65 chars, 32bit aligned == 68 chars
s32 numFrames; //number of KeyFrames s32 numFrames; //number of KeyFrames
s32 numTags; //number of 'tags' per frame s32 numTags; //number of 'tags' per frame
s32 numMeshes; //number of meshes/skins s32 numMeshes; //number of meshes/skins
s32 numMaxSkins; //maximum number of unique skins used in md3 file. artefact md2 s32 numMaxSkins;//maximum number of unique skins used in md3 file. artefact md2
s32 frameStart; //starting position of frame-structur s32 frameStart; //starting position of frame-structur
s32 tagStart; //starting position of tag-structures s32 tagStart; //starting position of tag-structures
s32 tagEnd; //ending position of tag-structures/starting position of mesh-structures s32 tagEnd; //ending position of tag-structures/starting position of mesh-structures
s32 fileSize; s32 fileSize;
} PACK_STRUCT; } PACK_STRUCT;
//! this holds the header info of an MD3 mesh section //! this holds the header info of an MD3 mesh section
......
...@@ -76,7 +76,7 @@ namespace scene ...@@ -76,7 +76,7 @@ namespace scene
/** If the camera's target and rotation are bound ( @see /** If the camera's target and rotation are bound ( @see
bindTargetAndRotation() ) then calling this will also change bindTargetAndRotation() ) then calling this will also change
the camera's scene node rotation to match the target. the camera's scene node rotation to match the target.
Note that setTarget uses the current absolute position Note that setTarget uses the current absolute position
internally, so if you changed setPosition since last rendering you must internally, so if you changed setPosition since last rendering you must
call updateAbsolutePosition before using this function. call updateAbsolutePosition before using this function.
\param pos Look at target of the camera, in world co-ordinates. */ \param pos Look at target of the camera, in world co-ordinates. */
...@@ -179,7 +179,7 @@ namespace scene ...@@ -179,7 +179,7 @@ namespace scene
if (!out) if (!out)
return; return;
out->addBool ("IsOrthogonal", IsOrthogonal ); out->addBool("IsOrthogonal", IsOrthogonal);
} }
//! Reads attributes of the camera node //! Reads attributes of the camera node
......
This diff is collapsed.
...@@ -20,19 +20,19 @@ namespace gui ...@@ -20,19 +20,19 @@ namespace gui
enum ECURSOR_ICON enum ECURSOR_ICON
{ {
// Following cursors might be system specific, or might use an Irrlicht icon-set. No guarantees so far. // Following cursors might be system specific, or might use an Irrlicht icon-set. No guarantees so far.
ECI_NORMAL, // arrow ECI_NORMAL, // arrow
ECI_CROSS, // Crosshair ECI_CROSS, // Crosshair
ECI_HAND, // Hand ECI_HAND, // Hand
ECI_HELP, // Arrow and question mark ECI_HELP, // Arrow and question mark
ECI_IBEAM, // typical text-selection cursor ECI_IBEAM, // typical text-selection cursor
ECI_NO, // should not click icon ECI_NO, // should not click icon
ECI_WAIT, // hourclass ECI_WAIT, // hourclass
ECI_SIZEALL, // arrow in all directions ECI_SIZEALL, // arrow in all directions
ECI_SIZENESW, // resizes in direction north-east or south-west ECI_SIZENESW, // resizes in direction north-east or south-west
ECI_SIZENWSE, // resizes in direction north-west or south-east ECI_SIZENWSE, // resizes in direction north-west or south-east
ECI_SIZENS, // resizes in direction north or south ECI_SIZENS, // resizes in direction north or south
ECI_SIZEWE, // resizes in direction west or east ECI_SIZEWE, // resizes in direction west or east
ECI_UP, // up-arrow ECI_UP, // up-arrow
// Implementer note: Should we add system specific cursors, which use guaranteed the system icons, // Implementer note: Should we add system specific cursors, which use guaranteed the system icons,
// then I would recommend using a naming scheme like ECI_W32_CROSS, ECI_X11_CROSSHAIR and adding those // then I would recommend using a naming scheme like ECI_W32_CROSS, ECI_X11_CROSSHAIR and adding those
......
...@@ -216,7 +216,7 @@ namespace irr ...@@ -216,7 +216,7 @@ namespace irr
//! The text in an editbox was changed. This does not include automatic changes in text-breaking. //! The text in an editbox was changed. This does not include automatic changes in text-breaking.
EGET_EDITBOX_CHANGED, EGET_EDITBOX_CHANGED,
//! The marked area in an editbox was changed. //! The marked area in an editbox was changed.
EGET_EDITBOX_MARKING_CHANGED, EGET_EDITBOX_MARKING_CHANGED,
//! The tab was changed in an tab control //! The tab was changed in an tab control
...@@ -345,7 +345,7 @@ struct SEvent ...@@ -345,7 +345,7 @@ struct SEvent
{ {
NUMBER_OF_BUTTONS = 32, NUMBER_OF_BUTTONS = 32,
AXIS_X = 0, // e.g. analog stick 1 left to right AXIS_X = 0, // e.g. analog stick 1 left to right
AXIS_Y, // e.g. analog stick 1 top to bottom AXIS_Y, // e.g. analog stick 1 top to bottom
AXIS_Z, // e.g. throttle, or analog 2 stick 2 left to right AXIS_Z, // e.g. throttle, or analog 2 stick 2 left to right
AXIS_R, // e.g. rudder, or analog 2 stick 2 top to bottom AXIS_R, // e.g. rudder, or analog 2 stick 2 top to bottom
...@@ -454,18 +454,18 @@ struct SJoystickInfo ...@@ -454,18 +454,18 @@ struct SJoystickInfo
/** This is an internal Irrlicht index; it does not map directly /** This is an internal Irrlicht index; it does not map directly
* to any particular hardware joystick. It corresponds to the * to any particular hardware joystick. It corresponds to the
* irr::SJoystickEvent Joystick ID. */ * irr::SJoystickEvent Joystick ID. */
u8 Joystick; u8 Joystick;
//! The name that the joystick uses to identify itself. //! The name that the joystick uses to identify itself.
core::stringc Name; core::stringc Name;
//! The number of buttons that the joystick has. //! The number of buttons that the joystick has.
u32 Buttons; u32 Buttons;
//! The number of axes that the joystick has, i.e. X, Y, Z, R, U, V. //! The number of axes that the joystick has, i.e. X, Y, Z, R, U, V.
/** Note: with a Linux device, the POV hat (if any) will use two axes. These /** Note: with a Linux device, the POV hat (if any) will use two axes. These
* will be included in this count. */ * will be included in this count. */
u32 Axes; u32 Axes;
//! An indication of whether the joystick has a POV hat. //! An indication of whether the joystick has a POV hat.
/** A Windows device will identify the presence or absence or the POV hat. A /** A Windows device will identify the presence or absence or the POV hat. A
......
...@@ -24,7 +24,7 @@ namespace gui ...@@ -24,7 +24,7 @@ namespace gui
//! call setVisible(false) //! call setVisible(false)
ECMC_HIDE = 2 ECMC_HIDE = 2
// note to implementors - this is planned as bitset, so continue with 4 if you need to add further flags. // note to implementors - this is planned as bitset, so continue with 4 if you need to add further flags.
}; };
//! GUI Context menu interface. //! GUI Context menu interface.
...@@ -64,10 +64,10 @@ namespace gui ...@@ -64,10 +64,10 @@ namespace gui
virtual u32 addItem(const wchar_t* text, s32 commandId=-1, bool enabled=true, virtual u32 addItem(const wchar_t* text, s32 commandId=-1, bool enabled=true,
bool hasSubMenu=false, bool checked=false, bool autoChecking=false) = 0; bool hasSubMenu=false, bool checked=false, bool autoChecking=false) = 0;
//! Insert a menu item at specified position. //! Insert a menu item at specified position.
/** \param idx: Position to insert the new element, /** \param idx: Position to insert the new element,
should be smaller than itemcount otherwise the item is added to the end. should be smaller than itemcount otherwise the item is added to the end.
\param text: Text of menu item. Set this to 0 to create \param text: Text of menu item. Set this to 0 to create
an separator instead of a real item, which is the same like an separator instead of a real item, which is the same like
calling addSeparator(); calling addSeparator();
\param commandId: Command id of menu item, a simple id you may \param commandId: Command id of menu item, a simple id you may
...@@ -81,11 +81,11 @@ namespace gui ...@@ -81,11 +81,11 @@ namespace gui
virtual u32 insertItem(u32 idx, const wchar_t* text, s32 commandId=-1, bool enabled=true, virtual u32 insertItem(u32 idx, const wchar_t* text, s32 commandId=-1, bool enabled=true,
bool hasSubMenu=false, bool checked=false, bool autoChecking=false) = 0; bool hasSubMenu=false, bool checked=false, bool autoChecking=false) = 0;
//! Find an item by it's CommandID //! Find an item by its CommandID
/** /**
\param commandId: We are looking for the first item which has this commandID \param commandId: We are looking for the first item which has this commandID
\param idxStartSearch: Start searching from this index. \param idxStartSearch: Start searching from this index.
\return Returns the index of the item when found or otherwise -1. */ \return Returns the index of the item when found or otherwise -1. */
virtual s32 findItemWithCommandId(s32 commandId, u32 idxStartSearch=0) const = 0; virtual s32 findItemWithCommandId(s32 commandId, u32 idxStartSearch=0) const = 0;
//! Adds a separator item to the menu //! Adds a separator item to the menu
......
...@@ -134,11 +134,11 @@ namespace gui ...@@ -134,11 +134,11 @@ namespace gui
//! Returns maximum amount of characters, previously set by setMax(); //! Returns maximum amount of characters, previously set by setMax();
virtual u32 getMax() const = 0; virtual u32 getMax() const = 0;
//! Set the character used for the cursor. //! Set the character used for the cursor.
/** By default it's "_" */ /** By default it's "_" */
virtual void setCursorChar(const wchar_t cursorChar) = 0; virtual void setCursorChar(const wchar_t cursorChar) = 0;
//! Get the character used for the cursor. //! Get the character used for the cursor.
virtual wchar_t getCursorChar() const = 0; virtual wchar_t getCursorChar() const = 0;
//! Set the blinktime for the cursor. 2x blinktime is one full cycle. //! Set the blinktime for the cursor. 2x blinktime is one full cycle.
...@@ -146,8 +146,7 @@ namespace gui ...@@ -146,8 +146,7 @@ namespace gui
virtual void setCursorBlinkTime(irr::u32 timeMs) = 0; virtual void setCursorBlinkTime(irr::u32 timeMs) = 0;
//! Get the cursor blinktime //! Get the cursor blinktime
virtual irr::u32 getCursorBlinkTime() const = 0; virtual irr::u32 getCursorBlinkTime() const = 0;
}; };
......
...@@ -564,7 +564,7 @@ public: ...@@ -564,7 +564,7 @@ public:
virtual bool sendToBack(IGUIElement* child) virtual bool sendToBack(IGUIElement* child)
{ {
core::list<IGUIElement*>::Iterator it = Children.begin(); core::list<IGUIElement*>::Iterator it = Children.begin();
if (child == (*it)) // already there if (child == (*it)) // already there
return true; return true;
for (; it != Children.end(); ++it) for (; it != Children.end(); ++it)
{ {
...@@ -748,7 +748,7 @@ public: ...@@ -748,7 +748,7 @@ public:
{ {
return GUIElementTypeNames[Type]; return GUIElementTypeNames[Type];
} }
//! Returns the name of the element. //! Returns the name of the element.
/** \return Name as character string. */ /** \return Name as character string. */
virtual const c8* getName() const virtual const c8* getName() const
...@@ -778,7 +778,7 @@ public: ...@@ -778,7 +778,7 @@ public:
scripting languages, editors, debuggers or xml serialization purposes. */ scripting languages, editors, debuggers or xml serialization purposes. */
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const
{ {
out->addString("Name", Name.c_str()); out->addString("Name", Name.c_str());
out->addInt("Id", ID ); out->addInt("Id", ID );
out->addString("Caption", getText()); out->addString("Caption", getText());
out->addRect("Rect", DesiredRect); out->addRect("Rect", DesiredRect);
...@@ -1017,7 +1017,7 @@ protected: ...@@ -1017,7 +1017,7 @@ protected:
//! tooltip //! tooltip
core::stringw ToolTipText; core::stringw ToolTipText;
//! users can set this for identificating the element by string //! users can set this for identificating the element by string
core::stringc Name; core::stringc Name;
......
...@@ -87,8 +87,8 @@ public: ...@@ -87,8 +87,8 @@ public:
virtual IGUIElement* getFocus() const = 0; virtual IGUIElement* getFocus() const = 0;
//! Returns the element which was last under the mouse cursor //! Returns the element which was last under the mouse cursor
/** NOTE: This information is updated _after_ the user-eventreceiver /** NOTE: This information is updated _after_ the user-eventreceiver
received it's mouse-events. To find the hovered element while catching received it's mouse-events. To find the hovered element while catching
mouse events you have to use instead: mouse events you have to use instead:
IGUIEnvironment::getRootGUIElement()->getElementFromPoint(mousePos); IGUIEnvironment::getRootGUIElement()->getElementFromPoint(mousePos);
\return Pointer to the element under the mouse. */ \return Pointer to the element under the mouse. */
...@@ -215,7 +215,7 @@ public: ...@@ -215,7 +215,7 @@ public:
//! Returns the root gui element. //! Returns the root gui element.
/** This is the first gui element, the (direct or indirect) parent of all /** This is the first gui element, the (direct or indirect) parent of all
other gui elements. It is a valid IGUIElement, with dimensions the same other gui elements. It is a valid IGUIElement, with dimensions the same
size as the screen. size as the screen.
\return Pointer to the root element of the GUI. The returned pointer \return Pointer to the root element of the GUI. The returned pointer
should not be dropped. See IReferenceCounted::drop() for more should not be dropped. See IReferenceCounted::drop() for more
information. */ information. */
...@@ -584,8 +584,8 @@ public: ...@@ -584,8 +584,8 @@ public:
//! Loads the gui. Note that the current gui is not cleared before. //! Loads the gui. Note that the current gui is not cleared before.
/** When a parent is set the elements will be added below the parent, the parent itself does not deserialize. /** When a parent is set the elements will be added below the parent, the parent itself does not deserialize.
When the file contains skin-settings from the gui-environment those are always serialized into the When the file contains skin-settings from the gui-environment those are always serialized into the
guienvironment independent of the parent setting. guienvironment independent of the parent setting.
\param filename Name of the file. \param filename Name of the file.
\param parent Parent for the loaded GUI, root if 0. \param parent Parent for the loaded GUI, root if 0.
\return True if loading succeeded, else false. */ \return True if loading succeeded, else false. */
...@@ -593,8 +593,8 @@ public: ...@@ -593,8 +593,8 @@ public:
//! Loads the gui. Note that the current gui is not cleared before. //! Loads the gui. Note that the current gui is not cleared before.
/** When a parent is set the elements will be added below the parent, the parent itself does not deserialize. /** When a parent is set the elements will be added below the parent, the parent itself does not deserialize.
When the file contains skin-settings from the gui-environment those are always serialized into the When the file contains skin-settings from the gui-environment those are always serialized into the
guienvironment independent of the parent setting. guienvironment independent of the parent setting.
\param file The file to load from. \param file The file to load from.
\param parent Parent for the loaded GUI, root if 0. \param parent Parent for the loaded GUI, root if 0.
\return True if loading succeeded, else false. */ \return True if loading succeeded, else false. */
......
...@@ -88,7 +88,7 @@ namespace gui ...@@ -88,7 +88,7 @@ namespace gui
virtual bool hasChildren() const = 0; virtual bool hasChildren() const = 0;
//! returns true if this node has child nodes //! returns true if this node has child nodes
/** \deprecated Deprecated in 1.8, use hasChildren() instead. /** \deprecated Deprecated in 1.8, use hasChildren() instead.
This method may be removed by Irrlicht 1.9 */ This method may be removed by Irrlicht 1.9 */
_IRR_DEPRECATED_ bool hasChilds() const _IRR_DEPRECATED_ bool hasChilds() const
{ {
......
...@@ -62,7 +62,7 @@ namespace gui ...@@ -62,7 +62,7 @@ namespace gui
So to get absolute positions you have to add the resulting rectangle to getAbsolutePosition().UpperLeftCorner.<br> So to get absolute positions you have to add the resulting rectangle to getAbsolutePosition().UpperLeftCorner.<br>
To get it relative to the parent element you have to add the resulting rectangle to getRelativePosition().UpperLeftCorner. To get it relative to the parent element you have to add the resulting rectangle to getRelativePosition().UpperLeftCorner.
Beware that adding a menu will not change the clientRect as menus are own gui elements, so in that case you might want to subtract Beware that adding a menu will not change the clientRect as menus are own gui elements, so in that case you might want to subtract
the menu area additionally. */ the menu area additionally. */
virtual core::rect<s32> getClientRect() const = 0; virtual core::rect<s32> getClientRect() const = 0;
}; };
......
...@@ -103,7 +103,7 @@ namespace scene ...@@ -103,7 +103,7 @@ namespace scene
} }
//! Renames a loaded mesh. //! Renames a loaded mesh.
/** \deprecated Use renameMesh() instead. This method may be removed by /** \deprecated Use renameMesh() instead. This method may be removed by
Irrlicht 1.9 */ Irrlicht 1.9 */
_IRR_DEPRECATED_ bool setMeshFilename(u32 index, const io::path& filename) _IRR_DEPRECATED_ bool setMeshFilename(u32 index, const io::path& filename)
{ {
...@@ -125,12 +125,12 @@ namespace scene ...@@ -125,12 +125,12 @@ namespace scene
//! Get the name of a loaded mesh, based on its index. //! Get the name of a loaded mesh, based on its index.
/** \param index: Index of the mesh, number between 0 and getMeshCount()-1. /** \param index: Index of the mesh, number between 0 and getMeshCount()-1.
\return The name if mesh was found and has a name, else the path is empty. */ \return The name if mesh was found and has a name, else the path is empty. */
virtual const io::SNamedPath& getMeshName(u32 index) const = 0; virtual const io::SNamedPath& getMeshName(u32 index) const = 0;
//! Get the name of the loaded mesh if there is any. //! Get the name of the loaded mesh if there is any.
/** \param mesh Pointer to mesh to query. /** \param mesh Pointer to mesh to query.
\return The name if mesh was found and has a name, else the path is empty. */ \return The name if mesh was found and has a name, else the path is empty. */
virtual const io::SNamedPath& getMeshName(const IMesh* const mesh) const = 0; virtual const io::SNamedPath& getMeshName(const IMesh* const mesh) const = 0;
//! Renames a loaded mesh. //! Renames a loaded mesh.
......
...@@ -119,7 +119,7 @@ namespace scene ...@@ -119,7 +119,7 @@ namespace scene
} }
//! Scales the actual mesh, not a scene node. //! Scales the actual mesh, not a scene node.
/** \deprecated Use scale() instead. This method may be removed by Irrlicht 1.9 /** \deprecated Use scale() instead. This method may be removed by Irrlicht 1.9
\param mesh Mesh on which the operation is performed. \param mesh Mesh on which the operation is performed.
\param factor Scale factor for each axis. */ \param factor Scale factor for each axis. */
_IRR_DEPRECATED_ void scaleMesh(IMesh* mesh, const core::vector3df& factor) const {return scale(mesh,factor);} _IRR_DEPRECATED_ void scaleMesh(IMesh* mesh, const core::vector3df& factor) const {return scale(mesh,factor);}
...@@ -159,7 +159,7 @@ namespace scene ...@@ -159,7 +159,7 @@ namespace scene
} }
//! Applies a transformation to a mesh //! Applies a transformation to a mesh
/** \deprecated Use transform() instead. This method may be removed by Irrlicht 1.9 /** \deprecated Use transform() instead. This method may be removed by Irrlicht 1.9
\param mesh Mesh on which the operation is performed. \param mesh Mesh on which the operation is performed.
\param m transformation matrix. */ \param m transformation matrix. */
_IRR_DEPRECATED_ virtual void transformMesh(IMesh* mesh, const core::matrix4& m) const {return transform(mesh,m);} _IRR_DEPRECATED_ virtual void transformMesh(IMesh* mesh, const core::matrix4& m) const {return transform(mesh,m);}
......
...@@ -81,7 +81,7 @@ public: ...@@ -81,7 +81,7 @@ public:
//! Set the maximum particle life-time in milliseconds //! Set the maximum particle life-time in milliseconds
virtual void setMaxLifeTime( u32 lifeTimeMax ) = 0; virtual void setMaxLifeTime( u32 lifeTimeMax ) = 0;
//! Set maximal random derivation from the direction //! Set maximal random derivation from the direction
virtual void setMaxAngleDegrees( s32 maxAngleDegrees ) = 0; virtual void setMaxAngleDegrees( s32 maxAngleDegrees ) = 0;
//! Get direction the emitter emits particles //! Get direction the emitter emits particles
...@@ -111,10 +111,9 @@ public: ...@@ -111,10 +111,9 @@ public:
//! Get the maximum particle life-time in milliseconds //! Get the maximum particle life-time in milliseconds
virtual u32 getMaxLifeTime() const = 0; virtual u32 getMaxLifeTime() const = 0;
//! Get maximal random derivation from the direction //! Get maximal random derivation from the direction
virtual s32 getMaxAngleDegrees() const = 0; virtual s32 getMaxAngleDegrees() const = 0;
//! Get emitter type //! Get emitter type
virtual E_PARTICLE_EMITTER_TYPE getType() const { return EPET_POINT; } virtual E_PARTICLE_EMITTER_TYPE getType() const { return EPET_POINT; }
}; };
......
...@@ -68,8 +68,9 @@ public: ...@@ -68,8 +68,9 @@ public:
virtual void clearParticles() = 0; virtual void clearParticles() = 0;
//! Do manually update the particles. //! Do manually update the particles.
//! This should only be called when you want to render the node outside the scenegraph, /** This should only be called when you want to render the node outside
//! as the node will care about this otherwise automatically. the scenegraph, as the node will care about this otherwise
automatically. */
virtual void doParticleSystem(u32 time) = 0; virtual void doParticleSystem(u32 time) = 0;
//! Gets the particle emitter, which creates the particles. //! Gets the particle emitter, which creates the particles.
......
...@@ -371,50 +371,48 @@ namespace quake3 ...@@ -371,50 +371,48 @@ namespace quake3
enum eQ3ModifierFunction enum eQ3ModifierFunction
{ {
TCMOD = 0, TCMOD = 0,
DEFORMVERTEXES = 1, DEFORMVERTEXES = 1,
RGBGEN = 2, RGBGEN = 2,
TCGEN = 3, TCGEN = 3,
MAP = 4, MAP = 4,
ALPHAGEN = 5, ALPHAGEN = 5,
FUNCTION2 = 0x10, FUNCTION2 = 0x10,
SCROLL = FUNCTION2 + 1, SCROLL = FUNCTION2 + 1,
SCALE = FUNCTION2 + 2, SCALE = FUNCTION2 + 2,
ROTATE = FUNCTION2 + 3, ROTATE = FUNCTION2 + 3,
STRETCH = FUNCTION2 + 4, STRETCH = FUNCTION2 + 4,
TURBULENCE = FUNCTION2 + 5, TURBULENCE = FUNCTION2 + 5,
WAVE = FUNCTION2 + 6, WAVE = FUNCTION2 + 6,
IDENTITY = FUNCTION2 + 7, IDENTITY = FUNCTION2 + 7,
VERTEX = FUNCTION2 + 8, VERTEX = FUNCTION2 + 8,
TEXTURE = FUNCTION2 + 9, TEXTURE = FUNCTION2 + 9,
LIGHTMAP = FUNCTION2 + 10, LIGHTMAP = FUNCTION2 + 10,
ENVIRONMENT = FUNCTION2 + 11, ENVIRONMENT = FUNCTION2 + 11,
DOLLAR_LIGHTMAP = FUNCTION2 + 12, DOLLAR_LIGHTMAP = FUNCTION2 + 12,
BULGE = FUNCTION2 + 13, BULGE = FUNCTION2 + 13,
AUTOSPRITE = FUNCTION2 + 14, AUTOSPRITE = FUNCTION2 + 14,
AUTOSPRITE2 = FUNCTION2 + 15, AUTOSPRITE2 = FUNCTION2 + 15,
TRANSFORM = FUNCTION2 + 16, TRANSFORM = FUNCTION2 + 16,
EXACTVERTEX = FUNCTION2 + 17, EXACTVERTEX = FUNCTION2 + 17,
CONSTANT = FUNCTION2 + 18, CONSTANT = FUNCTION2 + 18,
LIGHTINGSPECULAR = FUNCTION2 + 19, LIGHTINGSPECULAR = FUNCTION2 + 19,
MOVE = FUNCTION2 + 20, MOVE = FUNCTION2 + 20,
NORMAL = FUNCTION2 + 21, NORMAL = FUNCTION2 + 21,
IDENTITYLIGHTING = FUNCTION2 + 22, IDENTITYLIGHTING = FUNCTION2 + 22,
WAVE_MODIFIER_FUNCTION = 0x30, WAVE_MODIFIER_FUNCTION = 0x30,
SINUS = WAVE_MODIFIER_FUNCTION + 1, SINUS = WAVE_MODIFIER_FUNCTION + 1,
COSINUS = WAVE_MODIFIER_FUNCTION + 2, COSINUS = WAVE_MODIFIER_FUNCTION + 2,
SQUARE = WAVE_MODIFIER_FUNCTION + 3, SQUARE = WAVE_MODIFIER_FUNCTION + 3,
TRIANGLE = WAVE_MODIFIER_FUNCTION + 4, TRIANGLE = WAVE_MODIFIER_FUNCTION + 4,
SAWTOOTH = WAVE_MODIFIER_FUNCTION + 5, SAWTOOTH = WAVE_MODIFIER_FUNCTION + 5,
SAWTOOTH_INVERSE = WAVE_MODIFIER_FUNCTION + 6, SAWTOOTH_INVERSE = WAVE_MODIFIER_FUNCTION + 6,
NOISE = WAVE_MODIFIER_FUNCTION + 7, NOISE = WAVE_MODIFIER_FUNCTION + 7,
UNKNOWN = -2
UNKNOWN = -2
}; };
struct SModifierFunction struct SModifierFunction
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#ifdef _IRR_COMPILE_WITH_LEAK_HUNTER_ #ifdef _IRR_COMPILE_WITH_LEAK_HUNTER_
#include "leakHunter.h" #include "leakHunter.h"
#endif #endif
namespace irr namespace irr
{ {
......
...@@ -702,17 +702,17 @@ namespace scene ...@@ -702,17 +702,17 @@ namespace scene
{ {
if (!out) if (!out)
return; return;
out->addString ("Name", Name.c_str()); out->addString("Name", Name.c_str());
out->addInt ("Id", ID ); out->addInt("Id", ID );
out->addVector3d("Position", getPosition() ); out->addVector3d("Position", getPosition() );
out->addVector3d("Rotation", getRotation() ); out->addVector3d("Rotation", getRotation() );
out->addVector3d("Scale", getScale() ); out->addVector3d("Scale", getScale() );
out->addBool ("Visible", IsVisible ); out->addBool("Visible", IsVisible );
out->addInt ("AutomaticCulling", AutomaticCullingState); out->addInt("AutomaticCulling", AutomaticCullingState);
out->addInt ("DebugDataVisible", DebugDataVisible ); out->addInt("DebugDataVisible", DebugDataVisible );
out->addBool ("IsDebugObject", IsDebugObject ); out->addBool("IsDebugObject", IsDebugObject );
} }
......
...@@ -18,7 +18,7 @@ namespace scene ...@@ -18,7 +18,7 @@ namespace scene
//! Special scene node animator for FPS cameras //! Special scene node animator for FPS cameras
/** This scene node animator can be attached to a camera to make it act /** This scene node animator can be attached to a camera to make it act
like a first person shooter like a first person shooter
*/ */
class ISceneNodeAnimatorCameraFPS : public ISceneNodeAnimator class ISceneNodeAnimatorCameraFPS : public ISceneNodeAnimator
{ {
...@@ -45,15 +45,15 @@ namespace scene ...@@ -45,15 +45,15 @@ namespace scene
virtual void setKeyMap(SKeyMap *map, u32 count) = 0; virtual void setKeyMap(SKeyMap *map, u32 count) = 0;
//! Sets the keyboard mapping for this animator //! Sets the keyboard mapping for this animator
//! \param keymap The new keymap array //! \param keymap The new keymap array
virtual void setKeyMap(const core::array<SKeyMap>& keymap) = 0; virtual void setKeyMap(const core::array<SKeyMap>& keymap) = 0;
//! Gets the keyboard mapping for this animator //! Gets the keyboard mapping for this animator
virtual const core::array<SKeyMap>& getKeyMap() const = 0; virtual const core::array<SKeyMap>& getKeyMap() const = 0;
//! Sets whether vertical movement should be allowed. //! Sets whether vertical movement should be allowed.
/** If vertical movement is enabled then the camera may fight with /** If vertical movement is enabled then the camera may fight with
gravity causing camera shake. Disable this if the camera has gravity causing camera shake. Disable this if the camera has
a collision animator with gravity enabled. */ a collision animator with gravity enabled. */
virtual void setVerticalMovement(bool allow) = 0; virtual void setVerticalMovement(bool allow) = 0;
......
...@@ -29,7 +29,7 @@ public: ...@@ -29,7 +29,7 @@ public:
//! Called when the scene manager create a scene node while loading a file. //! Called when the scene manager create a scene node while loading a file.
virtual void OnCreateNode(ISceneNode* node) = 0; virtual void OnCreateNode(ISceneNode* node) = 0;
//! Called when the scene manager read a scene node while loading a file. //! Called when the scene manager read a scene node while loading a file.
/** The userData pointer contains a list of attributes with userData which /** The userData pointer contains a list of attributes with userData which
were attached to the scene node in the read scene file.*/ were attached to the scene node in the read scene file.*/
......
...@@ -152,7 +152,7 @@ namespace scene ...@@ -152,7 +152,7 @@ namespace scene
\param file The file to read the image from. File is not rewinded. \param file The file to read the image from. File is not rewinded.
\param vertexColor Color of all vertices. \param vertexColor Color of all vertices.
\param smoothFactor Number of smoothing passes. */ \param smoothFactor Number of smoothing passes. */
virtual bool loadHeightMap(io::IReadFile* file, virtual bool loadHeightMap(io::IReadFile* file,
video::SColor vertexColor=video::SColor(255,255,255,255), video::SColor vertexColor=video::SColor(255,255,255,255),
s32 smoothFactor=0) =0; s32 smoothFactor=0) =0;
......
...@@ -51,7 +51,7 @@ public: ...@@ -51,7 +51,7 @@ public:
// Day of the year, from 1 to 366 // Day of the year, from 1 to 366
u32 Yearday; u32 Yearday;
// Whether daylight saving is on // Whether daylight saving is on
bool IsDST; bool IsDST;
}; };
virtual RealTimeDate getRealTimeAndDate() const = 0; virtual RealTimeDate getRealTimeAndDate() const = 0;
......
...@@ -15,7 +15,7 @@ namespace io ...@@ -15,7 +15,7 @@ namespace io
{ {
//! Interface providing methods for making it easier to write XML files. //! Interface providing methods for making it easier to write XML files.
/** This XML Writer writes xml files using in the platform dependent /** This XML Writer writes xml files using in the platform dependent
wchar_t format and sets the xml-encoding correspondingly. */ wchar_t format and sets the xml-encoding correspondingly. */
class IXMLWriter : public virtual IReferenceCounted class IXMLWriter : public virtual IReferenceCounted
{ {
......
...@@ -161,7 +161,7 @@ If not defined, Windows Multimedia library is used, which offers also broad supp ...@@ -161,7 +161,7 @@ If not defined, Windows Multimedia library is used, which offers also broad supp
#undef _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_ #undef _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_
#endif #endif
// can't get this to compile currently under borland, can be removed if someone has a better solution // can't get this to compile currently under borland, can be removed if someone has a better solution
#if defined(__BORLANDC__) #if defined(__BORLANDC__)
#undef _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_ #undef _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_
#endif #endif
...@@ -391,7 +391,7 @@ B3D, MS3D or X meshes */ ...@@ -391,7 +391,7 @@ B3D, MS3D or X meshes */
#ifdef NO_IRR_COMPILE_WITH_OGRE_LOADER_ #ifdef NO_IRR_COMPILE_WITH_OGRE_LOADER_
#undef _IRR_COMPILE_WITH_OGRE_LOADER_ #undef _IRR_COMPILE_WITH_OGRE_LOADER_
#endif #endif
#endif // _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_ #endif // _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_
//! Define _IRR_COMPILE_WITH_IRR_MESH_LOADER_ if you want to load Irrlicht Engine .irrmesh files //! Define _IRR_COMPILE_WITH_IRR_MESH_LOADER_ if you want to load Irrlicht Engine .irrmesh files
#define _IRR_COMPILE_WITH_IRR_MESH_LOADER_ #define _IRR_COMPILE_WITH_IRR_MESH_LOADER_
...@@ -845,7 +845,6 @@ precision will be lower but speed higher. currently X86 only ...@@ -845,7 +845,6 @@ precision will be lower but speed higher. currently X86 only
#define _tfindnext __tfindnext #define _tfindnext __tfindnext
typedef long intptr_t; typedef long intptr_t;
#endif #endif
#endif #endif
#endif // __IRR_COMPILE_CONFIG_H_INCLUDED__ #endif // __IRR_COMPILE_CONFIG_H_INCLUDED__
......
...@@ -429,14 +429,14 @@ namespace video ...@@ -429,14 +429,14 @@ namespace video
{ {
u16 * dest = (u16*)data; u16 * dest = (u16*)data;
*dest = video::A8R8G8B8toA1R5G5B5( color ); *dest = video::A8R8G8B8toA1R5G5B5( color );
} }
break; break;
case ECF_R5G6B5: case ECF_R5G6B5:
{ {
u16 * dest = (u16*)data; u16 * dest = (u16*)data;
*dest = video::A8R8G8B8toR5G6B5( color ); *dest = video::A8R8G8B8toR5G6B5( color );
} }
break; break;
case ECF_R8G8B8: case ECF_R8G8B8:
...@@ -445,14 +445,14 @@ namespace video ...@@ -445,14 +445,14 @@ namespace video
dest[0] = (u8)getRed(); dest[0] = (u8)getRed();
dest[1] = (u8)getGreen(); dest[1] = (u8)getGreen();
dest[2] = (u8)getBlue(); dest[2] = (u8)getBlue();
} }
break; break;
case ECF_A8R8G8B8: case ECF_A8R8G8B8:
{ {
u32 * dest = (u32*)data; u32 * dest = (u32*)data;
*dest = color; *dest = color;
} }
break; break;
default: default:
......
...@@ -22,15 +22,15 @@ namespace video ...@@ -22,15 +22,15 @@ namespace video
//! Flag for EMT_ONETEXTURE_BLEND, ( BlendFactor ) BlendFunc = source * sourceFactor + dest * destFactor //! Flag for EMT_ONETEXTURE_BLEND, ( BlendFactor ) BlendFunc = source * sourceFactor + dest * destFactor
enum E_BLEND_FACTOR enum E_BLEND_FACTOR
{ {
EBF_ZERO = 0, //!< src & dest (0, 0, 0, 0) EBF_ZERO = 0, //!< src & dest (0, 0, 0, 0)
EBF_ONE, //!< src & dest (1, 1, 1, 1) EBF_ONE, //!< src & dest (1, 1, 1, 1)
EBF_DST_COLOR, //!< src (destR, destG, destB, destA) EBF_DST_COLOR, //!< src (destR, destG, destB, destA)
EBF_ONE_MINUS_DST_COLOR, //!< src (1-destR, 1-destG, 1-destB, 1-destA) EBF_ONE_MINUS_DST_COLOR, //!< src (1-destR, 1-destG, 1-destB, 1-destA)
EBF_SRC_COLOR, //!< dest (srcR, srcG, srcB, srcA) EBF_SRC_COLOR, //!< dest (srcR, srcG, srcB, srcA)
EBF_ONE_MINUS_SRC_COLOR, //!< dest (1-srcR, 1-srcG, 1-srcB, 1-srcA) EBF_ONE_MINUS_SRC_COLOR, //!< dest (1-srcR, 1-srcG, 1-srcB, 1-srcA)
EBF_SRC_ALPHA, //!< src & dest (srcA, srcA, srcA, srcA) EBF_SRC_ALPHA, //!< src & dest (srcA, srcA, srcA, srcA)
EBF_ONE_MINUS_SRC_ALPHA, //!< src & dest (1-srcA, 1-srcA, 1-srcA, 1-srcA) EBF_ONE_MINUS_SRC_ALPHA, //!< src & dest (1-srcA, 1-srcA, 1-srcA, 1-srcA)
EBF_DST_ALPHA, //!< src & dest (destA, destA, destA, destA) EBF_DST_ALPHA, //!< src & dest (destA, destA, destA, destA)
EBF_ONE_MINUS_DST_ALPHA, //!< src & dest (1-destA, 1-destA, 1-destA, 1-destA) EBF_ONE_MINUS_DST_ALPHA, //!< src & dest (1-destA, 1-destA, 1-destA, 1-destA)
EBF_SRC_ALPHA_SATURATE //!< src (min(srcA, 1-destA), idem, ...) EBF_SRC_ALPHA_SATURATE //!< src (min(srcA, 1-destA), idem, ...)
}; };
...@@ -39,11 +39,11 @@ namespace video ...@@ -39,11 +39,11 @@ namespace video
enum E_BLEND_OPERATION enum E_BLEND_OPERATION
{ {
EBO_NONE = 0, //!< No blending happens EBO_NONE = 0, //!< No blending happens
EBO_ADD, //!< Default blending adds the color values EBO_ADD, //!< Default blending adds the color values
EBO_SUBTRACT, //!< This mode subtracts the color values EBO_SUBTRACT, //!< This mode subtracts the color values
EBO_REVSUBTRACT,//!< This modes subtracts destination from source EBO_REVSUBTRACT,//!< This modes subtracts destination from source
EBO_MIN, //!< Choose minimum value of each color channel EBO_MIN, //!< Choose minimum value of each color channel
EBO_MAX, //!< Choose maximum value of each color channel EBO_MAX, //!< Choose maximum value of each color channel
EBO_MIN_FACTOR, //!< Choose minimum value of each color channel after applying blend factors, not widely supported EBO_MIN_FACTOR, //!< Choose minimum value of each color channel after applying blend factors, not widely supported
EBO_MAX_FACTOR, //!< Choose maximum value of each color channel after applying blend factors, not widely supported EBO_MAX_FACTOR, //!< Choose maximum value of each color channel after applying blend factors, not widely supported
EBO_MIN_ALPHA, //!< Choose minimum value of each color channel based on alpha value, not widely supported EBO_MIN_ALPHA, //!< Choose minimum value of each color channel based on alpha value, not widely supported
...@@ -128,7 +128,7 @@ namespace video ...@@ -128,7 +128,7 @@ namespace video
{ {
const u32 state = IR(param); const u32 state = IR(param);
alphaSource = (state & 0x0000F000) >> 12; alphaSource = (state & 0x0000F000) >> 12;
modulo = E_MODULATE_FUNC( ( state & 0x00000F00 ) >> 8 ); modulo = E_MODULATE_FUNC( ( state & 0x00000F00 ) >> 8 );
srcFact = E_BLEND_FACTOR ( ( state & 0x000000F0 ) >> 4 ); srcFact = E_BLEND_FACTOR ( ( state & 0x000000F0 ) >> 4 );
dstFact = E_BLEND_FACTOR ( ( state & 0x0000000F ) ); dstFact = E_BLEND_FACTOR ( ( state & 0x0000000F ) );
} }
...@@ -370,7 +370,7 @@ namespace video ...@@ -370,7 +370,7 @@ namespace video
u8 ZBuffer; u8 ZBuffer;
//! Sets the antialiasing mode //! Sets the antialiasing mode
/** Values are chosen from E_ANTI_ALIASING_MODE. Default is /** Values are chosen from E_ANTI_ALIASING_MODE. Default is
EAAM_SIMPLE|EAAM_LINE_SMOOTH, i.e. simple multi-sample EAAM_SIMPLE|EAAM_LINE_SMOOTH, i.e. simple multi-sample
anti-aliasing and lime smoothing is enabled. */ anti-aliasing and lime smoothing is enabled. */
u8 AntiAliasing; u8 AntiAliasing;
...@@ -384,7 +384,7 @@ namespace video ...@@ -384,7 +384,7 @@ namespace video
//! Defines the interpretation of vertex color in the lighting equation //! Defines the interpretation of vertex color in the lighting equation
/** Values should be chosen from E_COLOR_MATERIAL. /** Values should be chosen from E_COLOR_MATERIAL.
When lighting is enabled, vertex color can be used instead of the When lighting is enabled, vertex color can be used instead of the
material values for light modulation. This allows to easily change e.g. the material values for light modulation. This allows to easily change e.g. the
diffuse light behavior of each face. The default, ECM_DIFFUSE, will result in diffuse light behavior of each face. The default, ECM_DIFFUSE, will result in
a very similar rendering as with lighting turned off, just with light shading. */ a very similar rendering as with lighting turned off, just with light shading. */
......
...@@ -73,7 +73,7 @@ namespace video ...@@ -73,7 +73,7 @@ namespace video
~SMaterialLayer() ~SMaterialLayer()
{ {
MatrixAllocator.destruct(TextureMatrix); MatrixAllocator.destruct(TextureMatrix);
MatrixAllocator.deallocate(TextureMatrix); MatrixAllocator.deallocate(TextureMatrix);
} }
//! Assignment operator //! Assignment operator
...@@ -93,7 +93,7 @@ namespace video ...@@ -93,7 +93,7 @@ namespace video
else else
{ {
MatrixAllocator.destruct(TextureMatrix); MatrixAllocator.destruct(TextureMatrix);
MatrixAllocator.deallocate(TextureMatrix); MatrixAllocator.deallocate(TextureMatrix);
TextureMatrix = 0; TextureMatrix = 0;
} }
} }
...@@ -200,8 +200,8 @@ namespace video ...@@ -200,8 +200,8 @@ namespace video
/** In Irrlicht you can use anisotropic texture filtering /** In Irrlicht you can use anisotropic texture filtering
in conjunction with bilinear or trilinear texture in conjunction with bilinear or trilinear texture
filtering to improve rendering results. Primitives filtering to improve rendering results. Primitives
will look less blurry with this flag switched on. The number gives will look less blurry with this flag switched on. The number gives
the maximal anisotropy degree, and is often in the range 2-16. the maximal anisotropy degree, and is often in the range 2-16.
Value 1 is equivalent to 0, but should be avoided. */ Value 1 is equivalent to 0, but should be avoided. */
u8 AnisotropicFilter; u8 AnisotropicFilter;
......
...@@ -20,27 +20,26 @@ namespace core ...@@ -20,27 +20,26 @@ namespace core
// ----------- some basic quite often used string functions ----------------- // ----------- some basic quite often used string functions -----------------
//! search if a filename has a proper extension //! search if a filename has a proper extension
inline s32 isFileExtension ( const io::path& filename, inline s32 isFileExtension (const io::path& filename, const io::path& ext0,
const io::path& ext0, const io::path& ext1, const io::path& ext2)
const io::path& ext1,
const io::path& ext2)
{ {
s32 extPos = filename.findLast ( '.' ); s32 extPos = filename.findLast ( '.' );
if ( extPos < 0 ) if ( extPos < 0 )
return 0; return 0;
extPos += 1; extPos += 1;
if ( filename.equals_substring_ignore_case ( ext0, extPos ) ) return 1; if ( filename.equals_substring_ignore_case ( ext0, extPos ) )
if ( filename.equals_substring_ignore_case ( ext1, extPos ) ) return 2; return 1;
if ( filename.equals_substring_ignore_case ( ext2, extPos ) ) return 3; if ( filename.equals_substring_ignore_case ( ext1, extPos ) )
return 2;
if ( filename.equals_substring_ignore_case ( ext2, extPos ) )
return 3;
return 0; return 0;
} }
//! search if a filename has a proper extension //! search if a filename has a proper extension
inline bool hasFileExtension ( const io::path& filename, inline bool hasFileExtension(const io::path& filename, const io::path& ext0,
const io::path& ext0, const io::path& ext1 = "", const io::path& ext2 = "")
const io::path& ext1 = "",
const io::path& ext2 = "")
{ {
return isFileExtension ( filename, ext0, ext1, ext2 ) > 0; return isFileExtension ( filename, ext0, ext1, ext2 ) > 0;
} }
......
...@@ -13,8 +13,8 @@ namespace irr ...@@ -13,8 +13,8 @@ namespace irr
namespace core namespace core
{ {
//! Selection of characters which count as decimal point in fast_atof //! Selection of characters which count as decimal point in fast_atof
// TODO: This should probably also be used in irr::core::string, but the float-to-string code // TODO: This should probably also be used in irr::core::string, but
// used there has to be rewritten first. // the float-to-string code used there has to be rewritten first.
IRRLICHT_API extern irr::core::stringc LOCALE_DECIMAL_POINTS; IRRLICHT_API extern irr::core::stringc LOCALE_DECIMAL_POINTS;
// we write [17] here instead of [] to work around a swig bug // we write [17] here instead of [] to work around a swig bug
......
...@@ -25,8 +25,7 @@ class array ...@@ -25,8 +25,7 @@ class array
public: public:
//! Default constructor for empty array. //! Default constructor for empty array.
array() array() : data(0), allocated(0), used(0),
: data(0), allocated(0), used(0),
strategy(ALLOC_STRATEGY_DOUBLE), free_when_destroyed(true), is_sorted(true) strategy(ALLOC_STRATEGY_DOUBLE), free_when_destroyed(true), is_sorted(true)
{ {
} }
...@@ -34,9 +33,9 @@ public: ...@@ -34,9 +33,9 @@ public:
//! Constructs an array and allocates an initial chunk of memory. //! Constructs an array and allocates an initial chunk of memory.
/** \param start_count Amount of elements to pre-allocate. */ /** \param start_count Amount of elements to pre-allocate. */
array(u32 start_count) array(u32 start_count) : data(0), allocated(0), used(0),
: data(0), allocated(0), used(0), strategy(ALLOC_STRATEGY_DOUBLE),
strategy(ALLOC_STRATEGY_DOUBLE), free_when_destroyed(true), is_sorted(true) free_when_destroyed(true), is_sorted(true)
{ {
reallocate(start_count); reallocate(start_count);
} }
...@@ -468,8 +467,8 @@ public: ...@@ -468,8 +467,8 @@ public:
//! it is used for searching a multiset //! it is used for searching a multiset
/** The array will be sorted before the binary search if it is not /** The array will be sorted before the binary search if it is not
already sorted. already sorted.
\param element Element to search for. \param element Element to search for.
\param &last return lastIndex of equal elements \param &last return lastIndex of equal elements
\return Position of the first searched element if it was found, \return Position of the first searched element if it was found,
otherwise -1 is returned. */ otherwise -1 is returned. */
s32 binary_search_multi(const T& element, s32 &last) s32 binary_search_multi(const T& element, s32 &last)
...@@ -567,12 +566,12 @@ public: ...@@ -567,12 +566,12 @@ public:
for (i=index+count; i<used; ++i) for (i=index+count; i<used; ++i)
{ {
if (i-count >= index+count) // not already destructed before loop if (i-count >= index+count) // not already destructed before loop
allocator.destruct(&data[i-count]); allocator.destruct(&data[i-count]);
allocator.construct(&data[i-count], data[i]); // data[i-count] = data[i]; allocator.construct(&data[i-count], data[i]); // data[i-count] = data[i];
if (i >= used-count) // those which are not overwritten if (i >= used-count) // those which are not overwritten
allocator.destruct(&data[i]); allocator.destruct(&data[i]);
} }
...@@ -590,14 +589,14 @@ public: ...@@ -590,14 +589,14 @@ public:
//! Swap the content of this array container with the content of another array //! Swap the content of this array container with the content of another array
/** Afterwards this object will contain the content of the other object and the other /** Afterwards this object will contain the content of the other object and the other
object will contain the content of this object. object will contain the content of this object.
\param other Swap content with this object */ \param other Swap content with this object */
void swap(array<T, TAlloc>& other) void swap(array<T, TAlloc>& other)
{ {
core::swap(data, other.data); core::swap(data, other.data);
core::swap(allocated, other.allocated); core::swap(allocated, other.allocated);
core::swap(used, other.used); core::swap(used, other.used);
core::swap(allocator, other.allocator); // memory is still released by the same allocator used for allocation core::swap(allocator, other.allocator); // memory is still released by the same allocator used for allocation
eAllocStrategy helper_strategy(strategy); // can't use core::swap with bitfields eAllocStrategy helper_strategy(strategy); // can't use core::swap with bitfields
strategy = other.strategy; strategy = other.strategy;
other.strategy = helper_strategy; other.strategy = helper_strategy;
bool helper_free_when_destroyed(free_when_destroyed); bool helper_free_when_destroyed(free_when_destroyed);
......
...@@ -389,13 +389,13 @@ public: ...@@ -389,13 +389,13 @@ public:
/** Afterwards this object will contain the content of the other object and the other /** Afterwards this object will contain the content of the other object and the other
object will contain the content of this object. Iterators will afterwards be valid for object will contain the content of this object. Iterators will afterwards be valid for
the swapped object. the swapped object.
\param other Swap content with this object */ \param other Swap content with this object */
void swap(list<T>& other) void swap(list<T>& other)
{ {
core::swap(First, other.First); core::swap(First, other.First);
core::swap(Last, other.Last); core::swap(Last, other.Last);
core::swap(Size, other.Size); core::swap(Size, other.Size);
core::swap(allocator, other.allocator); // memory is still released by the same allocator used for allocation core::swap(allocator, other.allocator); // memory is still released by the same allocator used for allocation
} }
......
...@@ -41,16 +41,16 @@ class map ...@@ -41,16 +41,16 @@ class map
p->setParent(this); p->setParent(this);
} }
void setParent(RBTree* p) { Parent=p; } void setParent(RBTree* p) { Parent=p; }
void setValue(const ValueTypeRB& v) { Value = v; } void setValue(const ValueTypeRB& v) { Value = v; }
void setRed() { IsRed = true; } void setRed() { IsRed = true; }
void setBlack() { IsRed = false; } void setBlack() { IsRed = false; }
RBTree* getLeftChild() const { return LeftChild; } RBTree* getLeftChild() const { return LeftChild; }
RBTree* getRightChild() const { return RightChild; } RBTree* getRightChild() const { return RightChild; }
RBTree* getParent() const { return Parent; } RBTree* getParent() const { return Parent; }
const ValueTypeRB& getValue() const const ValueTypeRB& getValue() const
{ {
...@@ -118,13 +118,13 @@ class map ...@@ -118,13 +118,13 @@ class map
private: private:
RBTree(); RBTree();
RBTree* LeftChild; RBTree* LeftChild;
RBTree* RightChild; RBTree* RightChild;
RBTree* Parent; RBTree* Parent;
KeyTypeRB Key; KeyTypeRB Key;
ValueTypeRB Value; ValueTypeRB Value;
bool IsRed; bool IsRed;
}; // RBTree }; // RBTree
...@@ -442,7 +442,7 @@ class map ...@@ -442,7 +442,7 @@ class map
{ {
public: public:
ParentFirstIterator() : Root(0), Cur(0) {} ParentFirstIterator() : Root(0), Cur(0) {}
explicit ParentFirstIterator(Node* root) : Root(root), Cur(0) explicit ParentFirstIterator(Node* root) : Root(root), Cur(0)
{ {
...@@ -938,7 +938,7 @@ class map ...@@ -938,7 +938,7 @@ class map
/** Afterwards this object will contain the content of the other object and the other /** Afterwards this object will contain the content of the other object and the other
object will contain the content of this object. Iterators will afterwards be valid for object will contain the content of this object. Iterators will afterwards be valid for
the swapped object. the swapped object.
\param other Swap content with this object */ \param other Swap content with this object */
void swap(map<KeyType, ValueType>& other) void swap(map<KeyType, ValueType>& other)
{ {
core::swap(Root, other.Root); core::swap(Root, other.Root);
......
...@@ -53,19 +53,19 @@ namespace core ...@@ -53,19 +53,19 @@ namespace core
#undef PI #undef PI
#endif #endif
//! Constant for PI. //! Constant for PI.
const f32 PI = 3.14159265359f; const f32 PI = 3.14159265359f;
//! Constant for reciprocal of PI. //! Constant for reciprocal of PI.
const f32 RECIPROCAL_PI = 1.0f/PI; const f32 RECIPROCAL_PI = 1.0f/PI;
//! Constant for half of PI. //! Constant for half of PI.
const f32 HALF_PI = PI/2.0f; const f32 HALF_PI = PI/2.0f;
#ifdef PI64 // make sure we don't collide with a define #ifdef PI64 // make sure we don't collide with a define
#undef PI64 #undef PI64
#endif #endif
//! Constant for 64bit PI. //! Constant for 64bit PI.
const f64 PI64 = 3.1415926535897932384626433832795028841971693993751; const f64 PI64 = 3.1415926535897932384626433832795028841971693993751;
//! Constant for 64bit reciprocal of PI. //! Constant for 64bit reciprocal of PI.
const f64 RECIPROCAL_PI64 = 1.0/PI64; const f64 RECIPROCAL_PI64 = 1.0/PI64;
...@@ -84,7 +84,7 @@ namespace core ...@@ -84,7 +84,7 @@ namespace core
//! Utility function to convert a radian value to degrees //! Utility function to convert a radian value to degrees
/** Provided as it can be clearer to write radToDeg(X) than RADTODEG * X /** Provided as it can be clearer to write radToDeg(X) than RADTODEG * X
\param radians The radians value to convert to degrees. \param radians The radians value to convert to degrees.
*/ */
inline f32 radToDeg(f32 radians) inline f32 radToDeg(f32 radians)
{ {
...@@ -93,7 +93,7 @@ namespace core ...@@ -93,7 +93,7 @@ namespace core
//! Utility function to convert a radian value to degrees //! Utility function to convert a radian value to degrees
/** Provided as it can be clearer to write radToDeg(X) than RADTODEG * X /** Provided as it can be clearer to write radToDeg(X) than RADTODEG * X
\param radians The radians value to convert to degrees. \param radians The radians value to convert to degrees.
*/ */
inline f64 radToDeg(f64 radians) inline f64 radToDeg(f64 radians)
{ {
...@@ -102,7 +102,7 @@ namespace core ...@@ -102,7 +102,7 @@ namespace core
//! Utility function to convert a degrees value to radians //! Utility function to convert a degrees value to radians
/** Provided as it can be clearer to write degToRad(X) than DEGTORAD * X /** Provided as it can be clearer to write degToRad(X) than DEGTORAD * X
\param degrees The degrees value to convert to radians. \param degrees The degrees value to convert to radians.
*/ */
inline f32 degToRad(f32 degrees) inline f32 degToRad(f32 degrees)
{ {
...@@ -111,7 +111,7 @@ namespace core ...@@ -111,7 +111,7 @@ namespace core
//! Utility function to convert a degrees value to radians //! Utility function to convert a degrees value to radians
/** Provided as it can be clearer to write degToRad(X) than DEGTORAD * X /** Provided as it can be clearer to write degToRad(X) than DEGTORAD * X
\param degrees The degrees value to convert to radians. \param degrees The degrees value to convert to radians.
*/ */
inline f64 degToRad(f64 degrees) inline f64 degToRad(f64 degrees)
{ {
...@@ -348,26 +348,26 @@ namespace core ...@@ -348,26 +348,26 @@ namespace core
//! code is taken from IceFPU //! code is taken from IceFPU
//! Integer representation of a floating-point value. //! Integer representation of a floating-point value.
#ifdef IRRLICHT_FAST_MATH #ifdef IRRLICHT_FAST_MATH
#define IR(x) ((u32&)(x)) #define IR(x) ((u32&)(x))
#else #else
inline u32 IR(f32 x) {inttofloat tmp; tmp.f=x; return tmp.u;} inline u32 IR(f32 x) {inttofloat tmp; tmp.f=x; return tmp.u;}
#endif #endif
//! Absolute integer representation of a floating-point value //! Absolute integer representation of a floating-point value
#define AIR(x) (IR(x)&0x7fffffff) #define AIR(x) (IR(x)&0x7fffffff)
//! Floating-point representation of an integer value. //! Floating-point representation of an integer value.
#ifdef IRRLICHT_FAST_MATH #ifdef IRRLICHT_FAST_MATH
#define FR(x) ((f32&)(x)) #define FR(x) ((f32&)(x))
#else #else
inline f32 FR(u32 x) {inttofloat tmp; tmp.u=x; return tmp.f;} inline f32 FR(u32 x) {inttofloat tmp; tmp.u=x; return tmp.f;}
inline f32 FR(s32 x) {inttofloat tmp; tmp.s=x; return tmp.f;} inline f32 FR(s32 x) {inttofloat tmp; tmp.s=x; return tmp.f;}
#endif #endif
//! integer representation of 1.0 //! integer representation of 1.0
#define IEEE_1_0 0x3f800000 #define IEEE_1_0 0x3f800000
//! integer representation of 255.0 //! integer representation of 255.0
#define IEEE_255_0 0x437f0000 #define IEEE_255_0 0x437f0000
#ifdef IRRLICHT_FAST_MATH #ifdef IRRLICHT_FAST_MATH
#define F32_LOWER_0(f) (F32_AS_U32(f) > F32_SIGN_BIT) #define F32_LOWER_0(f) (F32_AS_U32(f) > F32_SIGN_BIT)
......
...@@ -74,7 +74,7 @@ typedef signed int s32; ...@@ -74,7 +74,7 @@ typedef signed int s32;
typedef unsigned __int64 u64; typedef unsigned __int64 u64;
#elif __GNUC__ #elif __GNUC__
#if __WORDSIZE == 64 #if __WORDSIZE == 64
typedef unsigned long int u64; typedef unsigned long int u64;
#else #else
__extension__ typedef unsigned long long u64; __extension__ typedef unsigned long long u64;
#endif #endif
...@@ -88,7 +88,7 @@ typedef unsigned long long u64; ...@@ -88,7 +88,7 @@ typedef unsigned long long u64;
typedef __int64 s64; typedef __int64 s64;
#elif __GNUC__ #elif __GNUC__
#if __WORDSIZE == 64 #if __WORDSIZE == 64
typedef long int s64; typedef long int s64;
#else #else
__extension__ typedef long long s64; __extension__ typedef long long s64;
#endif #endif
...@@ -164,18 +164,18 @@ strings ...@@ -164,18 +164,18 @@ strings
//! define a break macro for debugging. //! define a break macro for debugging.
#if defined(_DEBUG) #if defined(_DEBUG)
#if defined(_IRR_WINDOWS_API_) && defined(_MSC_VER) && !defined (_WIN32_WCE) #if defined(_IRR_WINDOWS_API_) && defined(_MSC_VER) && !defined (_WIN32_WCE)
#if defined(WIN64) || defined(_WIN64) // using portable common solution for x64 configuration #if defined(WIN64) || defined(_WIN64) // using portable common solution for x64 configuration
#include <crtdbg.h> #include <crtdbg.h>
#define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) if (_CONDITION_) {_CrtDbgBreak();} #define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) if (_CONDITION_) {_CrtDbgBreak();}
#else #else
#define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) if (_CONDITION_) {_asm int 3} #define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) if (_CONDITION_) {_asm int 3}
#endif #endif
#else #else
#include "assert.h" #include "assert.h"
#define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) assert( !(_CONDITION_) ); #define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) assert( !(_CONDITION_) );
#endif #endif
#else #else
#define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) #define _IRR_DEBUG_BREAK_IF( _CONDITION_ )
#endif #endif
//! Defines a deprecated macro which generates a warning at compile time //! Defines a deprecated macro which generates a warning at compile time
......
...@@ -381,7 +381,7 @@ namespace io ...@@ -381,7 +381,7 @@ namespace io
xmlChar<T>(unsigned short in) : c(static_cast<T>(in)) {} xmlChar<T>(unsigned short in) : c(static_cast<T>(in)) {}
xmlChar<T>(unsigned int in) : c(static_cast<T>(in)) {} xmlChar<T>(unsigned int in) : c(static_cast<T>(in)) {}
xmlChar<T>(unsigned long in) : c(static_cast<T>(in)) {} xmlChar<T>(unsigned long in) : c(static_cast<T>(in)) {}
#else #else
explicit xmlChar<T>(unsigned char in) : c(static_cast<T>(in)) {} explicit xmlChar<T>(unsigned char in) : c(static_cast<T>(in)) {}
explicit xmlChar<T>(unsigned short in) : c(static_cast<T>(in)) {} explicit xmlChar<T>(unsigned short in) : c(static_cast<T>(in)) {}
explicit xmlChar<T>(unsigned int in) : c(static_cast<T>(in)) {} explicit xmlChar<T>(unsigned int in) : c(static_cast<T>(in)) {}
......
...@@ -13,40 +13,40 @@ ...@@ -13,40 +13,40 @@
namespace irr namespace irr
{ {
class IReferenceCounted; class IReferenceCounted;
//! A calls helping to find unrelease objects of type IReferenceCounted. //! A calls helping to find unrelease objects of type IReferenceCounted.
/** To use this you have recompile Irrlicht with _IRR_COMPILE_WITH_LEAK_HUNTER_. /** To use this you have recompile Irrlicht with _IRR_COMPILE_WITH_LEAK_HUNTER_.
Note that this will slow down your application and should only be used for debugging. Note that this will slow down your application and should only be used for debugging.
The way to use is that you can check after you closed and dropped your last Irrlicht device The way to use is that you can check after you closed and dropped your last Irrlicht device
if there are still any IReferenceCounted left over which have not been deleted. if there are still any IReferenceCounted left over which have not been deleted.
*/ */
class LeakHunter class LeakHunter
{ {
public: public:
friend class IReferenceCounted; friend class IReferenceCounted;
//! Clear all IReferenceCounted objects inside LeakHunter //! Clear all IReferenceCounted objects inside LeakHunter
/** This does not affect the IReferenceCounted themselfes only the /** This does not affect the IReferenceCounted themselfes only the
counting of them. Usually you don't ever need to clear, but counting of them. Usually you don't ever need to clear, but
sometimes it helps when for example you want for to ignore sometimes it helps when for example you want for to ignore
certain leaks. certain leaks.
*/ */
static void clearReferenceCountedObjects() static void clearReferenceCountedObjects()
{ {
ReferenceCountedObjects.clear(); ReferenceCountedObjects.clear();
} }
static inline irr::core::array<const IReferenceCounted*> getReferenceCountedObjects() static inline irr::core::array<const IReferenceCounted*> getReferenceCountedObjects()
{ {
return ReferenceCountedObjects; return ReferenceCountedObjects;
} }
protected: protected:
static inline void addObject(const IReferenceCounted* object) static inline void addObject(const IReferenceCounted* object)
{ {
ReferenceCountedObjects.push_back(object); ReferenceCountedObjects.push_back(object);
} }
static inline void removeObject(const IReferenceCounted* object) static inline void removeObject(const IReferenceCounted* object)
{ {
irr::s32 idx = ReferenceCountedObjects.linear_search(object ); irr::s32 idx = ReferenceCountedObjects.linear_search(object );
...@@ -56,10 +56,10 @@ namespace irr ...@@ -56,10 +56,10 @@ namespace irr
ReferenceCountedObjects.erase( ReferenceCountedObjects.size()-1 ); ReferenceCountedObjects.erase( ReferenceCountedObjects.size()-1 );
} }
} }
private: private:
// NOTE: We don't do additional grab()/drop()'s here as we want to supervise reference counted objects and not affect them otherwise. // NOTE: We don't do additional grab()/drop()'s here as we want to supervise reference counted objects and not affect them otherwise.
IRRLICHT_API static irr::core::array<const IReferenceCounted*> ReferenceCountedObjects; IRRLICHT_API static irr::core::array<const IReferenceCounted*> ReferenceCountedObjects;
}; };
} // end namespace irr } // end namespace irr
......
...@@ -218,7 +218,7 @@ class line2d ...@@ -218,7 +218,7 @@ class line2d
vector2d<f64> c((f64)(point.X-start.X), (f64)(point.Y- start.Y)); vector2d<f64> c((f64)(point.X-start.X), (f64)(point.Y- start.Y));
vector2d<f64> v((f64)(end.X-start.X), (f64)(end.Y-start.Y)); vector2d<f64> v((f64)(end.X-start.X), (f64)(end.Y-start.Y));
f64 d = v.getLength(); f64 d = v.getLength();
if ( d == 0 ) // can't tell much when the line is just a single point if ( d == 0 ) // can't tell much when the line is just a single point
return start; return start;
v /= d; v /= d;
f64 t = v.dotProduct(c); f64 t = v.dotProduct(c);
...@@ -246,7 +246,7 @@ class line2d ...@@ -246,7 +246,7 @@ class line2d
vector2df c = point - start; vector2df c = point - start;
vector2df v = end - start; vector2df v = end - start;
f32 d = (f32)v.getLength(); f32 d = (f32)v.getLength();
if ( d == 0 ) // can't tell much when the line is just a single point if ( d == 0 ) // can't tell much when the line is just a single point
return start; return start;
v /= d; v /= d;
f32 t = v.dotProduct(c); f32 t = v.dotProduct(c);
......
...@@ -947,18 +947,18 @@ namespace core ...@@ -947,18 +947,18 @@ namespace core
template <class T> template <class T>
inline CMatrix4<T>& CMatrix4<T>::setRotationAxisRadians( const T& angle, const vector3d<T>& axis ) inline CMatrix4<T>& CMatrix4<T>::setRotationAxisRadians( const T& angle, const vector3d<T>& axis )
{ {
const f64 c = cos(angle); const f64 c = cos(angle);
const f64 s = sin(angle); const f64 s = sin(angle);
const f64 t = 1.0 - c; const f64 t = 1.0 - c;
const f64 tx = t * axis.X; const f64 tx = t * axis.X;
const f64 ty = t * axis.Y; const f64 ty = t * axis.Y;
const f64 tz = t * axis.Z; const f64 tz = t * axis.Z;
const f64 sx = s * axis.X; const f64 sx = s * axis.X;
const f64 sy = s * axis.Y; const f64 sy = s * axis.Y;
const f64 sz = s * axis.Z; const f64 sz = s * axis.Z;
M[0] = (T)(tx * axis.X + c); M[0] = (T)(tx * axis.X + c);
M[1] = (T)(tx * axis.Y + sz); M[1] = (T)(tx * axis.Y + sz);
M[2] = (T)(tx * axis.Z - sy); M[2] = (T)(tx * axis.Z - sy);
......
...@@ -37,14 +37,14 @@ class plane3d ...@@ -37,14 +37,14 @@ class plane3d
// Constructors // Constructors
plane3d(): Normal(0,1,0) { recalculateD(vector3d<T>(0,0,0)); } plane3d(): Normal(0,1,0) { recalculateD(vector3d<T>(0,0,0)); }
plane3d(const vector3d<T>& MPoint, const vector3d<T>& Normal) : Normal(Normal) { recalculateD(MPoint); } plane3d(const vector3d<T>& MPoint, const vector3d<T>& Normal) : Normal(Normal) { recalculateD(MPoint); }
plane3d(T px, T py, T pz, T nx, T ny, T nz) : Normal(nx, ny, nz) { recalculateD(vector3d<T>(px, py, pz)); } plane3d(T px, T py, T pz, T nx, T ny, T nz) : Normal(nx, ny, nz) { recalculateD(vector3d<T>(px, py, pz)); }
plane3d(const vector3d<T>& point1, const vector3d<T>& point2, const vector3d<T>& point3) plane3d(const vector3d<T>& point1, const vector3d<T>& point2, const vector3d<T>& point3)
{ setPlane(point1, point2, point3); } { setPlane(point1, point2, point3); }
plane3d(const vector3d<T> & normal, const T d) : Normal(normal), D(d) { } plane3d(const vector3d<T> & normal, const T d) : Normal(normal), D(d) { }
// operators // operators
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "vector3d.h" #include "vector3d.h"
// Between Irrlicht 1.7 and Irrlicht 1.8 the quaternion-matrix conversions got fixed. // Between Irrlicht 1.7 and Irrlicht 1.8 the quaternion-matrix conversions got fixed.
// This define disables all involved functions completely to allow finding all places // This define disables all involved functions completely to allow finding all places
// where the wrong conversions had been in use. // where the wrong conversions had been in use.
#define IRR_TEST_BROKEN_QUATERNION_USE 0 #define IRR_TEST_BROKEN_QUATERNION_USE 0
...@@ -101,7 +101,7 @@ class quaternion ...@@ -101,7 +101,7 @@ class quaternion
#if !IRR_TEST_BROKEN_QUATERNION_USE #if !IRR_TEST_BROKEN_QUATERNION_USE
//! Creates a matrix from this quaternion //! Creates a matrix from this quaternion
matrix4 getMatrix() const; matrix4 getMatrix() const;
#endif #endif
//! Creates a matrix from this quaternion //! Creates a matrix from this quaternion
void getMatrix( matrix4 &dest, const core::vector3df &translation=core::vector3df() ) const; void getMatrix( matrix4 &dest, const core::vector3df &translation=core::vector3df() ) const;
......
...@@ -93,8 +93,8 @@ namespace core ...@@ -93,8 +93,8 @@ namespace core
vector3d<f64> cf64((f64)pointC.X, (f64)pointC.Y, (f64)pointC.Z); vector3d<f64> cf64((f64)pointC.X, (f64)pointC.Y, (f64)pointC.Z);
vector3d<f64> pf64((f64)p.X, (f64)p.Y, (f64)p.Z); vector3d<f64> pf64((f64)p.X, (f64)p.Y, (f64)p.Z);
return (isOnSameSide(pf64, af64, bf64, cf64) && return (isOnSameSide(pf64, af64, bf64, cf64) &&
isOnSameSide(pf64, bf64, af64, cf64) && isOnSameSide(pf64, bf64, af64, cf64) &&
isOnSameSide(pf64, cf64, af64, bf64)); isOnSameSide(pf64, cf64, af64, bf64));
} }
//! Check if a point is inside the triangle (border-points count also as inside) //! Check if a point is inside the triangle (border-points count also as inside)
...@@ -254,9 +254,9 @@ namespace core ...@@ -254,9 +254,9 @@ namespace core
// This catches some floating point troubles. // This catches some floating point troubles.
// Unfortunately slightly expensive and we don't really know the best epsilon for iszero. // Unfortunately slightly expensive and we don't really know the best epsilon for iszero.
vector3d<f64> cp1 = bminusa.normalize().crossProduct((p1 - a).normalize()); vector3d<f64> cp1 = bminusa.normalize().crossProduct((p1 - a).normalize());
if ( core::iszero(cp1.X, (f64)ROUNDING_ERROR_f32) if (core::iszero(cp1.X, (f64)ROUNDING_ERROR_f32)
&& core::iszero(cp1.Y, (f64)ROUNDING_ERROR_f32) && core::iszero(cp1.Y, (f64)ROUNDING_ERROR_f32)
&& core::iszero(cp1.Z, (f64)ROUNDING_ERROR_f32) ) && core::iszero(cp1.Z, (f64)ROUNDING_ERROR_f32) )
{ {
res = 0.f; res = 0.f;
} }
......
...@@ -67,28 +67,28 @@ public: ...@@ -67,28 +67,28 @@ public:
//! sort in order X, Y. Equality with rounding tolerance. //! sort in order X, Y. Equality with rounding tolerance.
bool operator<=(const vector2d<T>&other) const bool operator<=(const vector2d<T>&other) const
{ {
return (X<other.X || core::equals(X, other.X)) || return (X<other.X || core::equals(X, other.X)) ||
(core::equals(X, other.X) && (Y<other.Y || core::equals(Y, other.Y))); (core::equals(X, other.X) && (Y<other.Y || core::equals(Y, other.Y)));
} }
//! sort in order X, Y. Equality with rounding tolerance. //! sort in order X, Y. Equality with rounding tolerance.
bool operator>=(const vector2d<T>&other) const bool operator>=(const vector2d<T>&other) const
{ {
return (X>other.X || core::equals(X, other.X)) || return (X>other.X || core::equals(X, other.X)) ||
(core::equals(X, other.X) && (Y>other.Y || core::equals(Y, other.Y))); (core::equals(X, other.X) && (Y>other.Y || core::equals(Y, other.Y)));
} }
//! sort in order X, Y. Difference must be above rounding tolerance. //! sort in order X, Y. Difference must be above rounding tolerance.
bool operator<(const vector2d<T>&other) const bool operator<(const vector2d<T>&other) const
{ {
return (X<other.X && !core::equals(X, other.X)) || return (X<other.X && !core::equals(X, other.X)) ||
(core::equals(X, other.X) && Y<other.Y && !core::equals(Y, other.Y)); (core::equals(X, other.X) && Y<other.Y && !core::equals(Y, other.Y));
} }
//! sort in order X, Y. Difference must be above rounding tolerance. //! sort in order X, Y. Difference must be above rounding tolerance.
bool operator>(const vector2d<T>&other) const bool operator>(const vector2d<T>&other) const
{ {
return (X>other.X && !core::equals(X, other.X)) || return (X>other.X && !core::equals(X, other.X)) ||
(core::equals(X, other.X) && Y>other.Y && !core::equals(Y, other.Y)); (core::equals(X, other.X) && Y>other.Y && !core::equals(Y, other.Y));
} }
......
...@@ -60,7 +60,7 @@ namespace core ...@@ -60,7 +60,7 @@ namespace core
//! sort in order X, Y, Z. Equality with rounding tolerance. //! sort in order X, Y, Z. Equality with rounding tolerance.
bool operator<=(const vector3d<T>&other) const bool operator<=(const vector3d<T>&other) const
{ {
return (X<other.X || core::equals(X, other.X)) || return (X<other.X || core::equals(X, other.X)) ||
(core::equals(X, other.X) && (Y<other.Y || core::equals(Y, other.Y))) || (core::equals(X, other.X) && (Y<other.Y || core::equals(Y, other.Y))) ||
(core::equals(X, other.X) && core::equals(Y, other.Y) && (Z<other.Z || core::equals(Z, other.Z))); (core::equals(X, other.X) && core::equals(Y, other.Y) && (Z<other.Z || core::equals(Z, other.Z)));
} }
...@@ -68,7 +68,7 @@ namespace core ...@@ -68,7 +68,7 @@ namespace core
//! sort in order X, Y, Z. Equality with rounding tolerance. //! sort in order X, Y, Z. Equality with rounding tolerance.
bool operator>=(const vector3d<T>&other) const bool operator>=(const vector3d<T>&other) const
{ {
return (X>other.X || core::equals(X, other.X)) || return (X>other.X || core::equals(X, other.X)) ||
(core::equals(X, other.X) && (Y>other.Y || core::equals(Y, other.Y))) || (core::equals(X, other.X) && (Y>other.Y || core::equals(Y, other.Y))) ||
(core::equals(X, other.X) && core::equals(Y, other.Y) && (Z>other.Z || core::equals(Z, other.Z))); (core::equals(X, other.X) && core::equals(Y, other.Y) && (Z>other.Z || core::equals(Z, other.Z)));
} }
...@@ -76,7 +76,7 @@ namespace core ...@@ -76,7 +76,7 @@ namespace core
//! sort in order X, Y, Z. Difference must be above rounding tolerance. //! sort in order X, Y, Z. Difference must be above rounding tolerance.
bool operator<(const vector3d<T>&other) const bool operator<(const vector3d<T>&other) const
{ {
return (X<other.X && !core::equals(X, other.X)) || return (X<other.X && !core::equals(X, other.X)) ||
(core::equals(X, other.X) && Y<other.Y && !core::equals(Y, other.Y)) || (core::equals(X, other.X) && Y<other.Y && !core::equals(Y, other.Y)) ||
(core::equals(X, other.X) && core::equals(Y, other.Y) && Z<other.Z && !core::equals(Z, other.Z)); (core::equals(X, other.X) && core::equals(Y, other.Y) && Z<other.Z && !core::equals(Z, other.Z));
} }
...@@ -84,7 +84,7 @@ namespace core ...@@ -84,7 +84,7 @@ namespace core
//! sort in order X, Y, Z. Difference must be above rounding tolerance. //! sort in order X, Y, Z. Difference must be above rounding tolerance.
bool operator>(const vector3d<T>&other) const bool operator>(const vector3d<T>&other) const
{ {
return (X>other.X && !core::equals(X, other.X)) || return (X>other.X && !core::equals(X, other.X)) ||
(core::equals(X, other.X) && Y>other.Y && !core::equals(Y, other.Y)) || (core::equals(X, other.X) && Y>other.Y && !core::equals(Y, other.Y)) ||
(core::equals(X, other.X) && core::equals(Y, other.Y) && Z>other.Z && !core::equals(Z, other.Z)); (core::equals(X, other.X) && core::equals(Y, other.Y) && Z>other.Z && !core::equals(Z, other.Z));
} }
......
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