Commit e7b200fe authored by hybrid's avatar hybrid

Merged revisions 2892:2947 from 1.6 branch. Mainly GUI fixes. Cylinder...

Merged revisions 2892:2947 from 1.6 branch. Mainly GUI fixes. Cylinder texturing enhanced. WIN64 defines everywhere also use _WIN64. Code layout and documentation updates.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2948 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 9e1eb1e6
...@@ -101,8 +101,33 @@ Changes in 1.7 ...@@ -101,8 +101,33 @@ Changes in 1.7
---------------- ----------------
Changes in 1.6.1 Changes in 1.6.1
- !!API change!! Disabled AntiAliasing of Lines in material default
Please enable this manually per material when sure that it won't lead to SW rendering.
- IGUIComboBox: clicking on the statictext displaying the active selection does now close and open listbox correctly. (Bug found by Reiko)
- Scrollbuttons in IGUITabControl adapt now to tab-height.
- Fix texturing of cylinder mesh
- Fix modal dialog position (found by LoneBoco: http://sourceforge.net/tracker/?func=detail&aid=2900266&group_id=74339&atid=540676)
- Fix DMF loading
- Fixing left+right special keys (ctrl, shift, alt) on Win32 (thanks to pc0de for good patch-ideas).
- Make stringarrays for enums in IGUISkin a little safer
- Add support for keys KEY_PRINT, KEY_HOME (on numpad) and KEY_NUMLOCK on Linux.
- Fix material handling in createMeshWith1TCoords
- Fix another (OldValue == NewValue) before drop()/grap(), this time in CTextureAttribute::setTexture. - Fix another (OldValue == NewValue) before drop()/grap(), this time in CTextureAttribute::setTexture.
- Fix LIGHTMAP_LIGHTING for D3D drivers.
- AntiAliasing disabled for debug render elements.
- Bugfix: CGUIToolBar::addButton does no longer mess up when no image is set and does now actually work with the text. - Bugfix: CGUIToolBar::addButton does no longer mess up when no image is set and does now actually work with the text.
- Fix ninja animation range which got messed up a little when b3d animations got fixed (thx gbox for finding) - Fix ninja animation range which got messed up a little when b3d animations got fixed (thx gbox for finding)
...@@ -761,6 +786,12 @@ Changes in 1.6 (23.09.2009) ...@@ -761,6 +786,12 @@ Changes in 1.6 (23.09.2009)
------------------------------------- -------------------------------------
Changes in version 1.5.2 (??.??.2009) Changes in version 1.5.2 (??.??.2009)
- Properly check boundaries in getFont and setFont.
- Reinit values in the driver when scene manager is cleared.
- Normals handling fixed in createMeshWithTangents, existing normals are not always destroyed now.
- Fix terrain smoothing, bug found by loverlinfish - Fix terrain smoothing, bug found by loverlinfish
- SOLARIS recognition removed. Please specify the platform define manually. This allows for compilation under sparc/Linux and sparc/Solaris - SOLARIS recognition removed. Please specify the platform define manually. This allows for compilation under sparc/Linux and sparc/Solaris
......
This diff is collapsed.
...@@ -348,7 +348,7 @@ public: ...@@ -348,7 +348,7 @@ public:
\param point: The point at which to find a GUI element. \param point: The point at which to find a GUI element.
\return The topmost GUI element at that point, or 0 if there are \return The topmost GUI element at that point, or 0 if there are
no candidate elements at this point. no candidate elements at this point.
*/ */
IGUIElement* getElementFromPoint(const core::position2d<s32>& point) IGUIElement* getElementFromPoint(const core::position2d<s32>& point)
{ {
IGUIElement* target = 0; IGUIElement* target = 0;
......
...@@ -26,8 +26,8 @@ public: ...@@ -26,8 +26,8 @@ public:
//! \param destPos: Position of the image to draw //! \param destPos: Position of the image to draw
//! \param clip: Optional pointer to a rectalgle against which the text will be clipped. //! \param clip: Optional pointer to a rectalgle against which the text will be clipped.
//! If the pointer is null, no clipping will be done. //! If the pointer is null, no clipping will be done.
virtual void draw( s32 index, const core::position2d<s32>& destPos, virtual void draw(s32 index, const core::position2d<s32>& destPos,
const core::rect<s32>* clip = 0 ) = 0; const core::rect<s32>* clip = 0) = 0;
//! Returns the count of Images in the list. //! Returns the count of Images in the list.
//! \return Returns the count of Images in the list. //! \return Returns the count of Images in the list.
......
...@@ -118,8 +118,8 @@ namespace gui ...@@ -118,8 +118,8 @@ namespace gui
//! set global itemHeight //! set global itemHeight
virtual void setItemHeight( s32 height ) = 0; virtual void setItemHeight( s32 height ) = 0;
//! Sets whether to draw the background //! Sets whether to draw the background
virtual void setDrawBackground(bool draw) = 0; virtual void setDrawBackground(bool draw) = 0;
}; };
......
...@@ -139,7 +139,7 @@ namespace gui ...@@ -139,7 +139,7 @@ namespace gui
will be placed after it. If the row is larger than the actual will be placed after it. If the row is larger than the actual
number of row by more than one, it won't be created. Note that number of row by more than one, it won't be created. Note that
if you create a row that's not at the end, there might be if you create a row that's not at the end, there might be
performance issues. performance issues.
\return index of inserted row. */ \return index of inserted row. */
virtual u32 addRow(u32 rowIndex) = 0; virtual u32 addRow(u32 rowIndex) = 0;
......
...@@ -20,16 +20,10 @@ namespace gui ...@@ -20,16 +20,10 @@ namespace gui
class IGUITreeViewNode : public IReferenceCounted class IGUITreeViewNode : public IReferenceCounted
{ {
public: public:
//! constructor
IGUITreeViewNode() {}
//! destructor
virtual ~IGUITreeViewNode() {}
//! returns the owner (tree view) of this node //! returns the owner (tree view) of this node
virtual IGUITreeView* getOwner() const = 0; virtual IGUITreeView* getOwner() const = 0;
//! Returns the parent node of this node. //! Returns the parent node of this node.
/** For the root node this will return 0. */ /** For the root node this will return 0. */
virtual IGUITreeViewNode* getParent() const = 0; virtual IGUITreeViewNode* getParent() const = 0;
...@@ -87,13 +81,10 @@ namespace gui ...@@ -87,13 +81,10 @@ namespace gui
\param data2 user data2 (IReferenceCounted*) of the new node \param data2 user data2 (IReferenceCounted*) of the new node
\return The new node \return The new node
*/ */
virtual IGUITreeViewNode* addChildBack( virtual IGUITreeViewNode* addChildBack(
const wchar_t* text, const wchar_t* text, const wchar_t* icon = 0,
const wchar_t* icon = 0, s32 imageIndex=-1, s32 selectedImageIndex=-1,
s32 imageIndex = -1, void* data=0, IReferenceCounted* data2=0) =0;
s32 selectedImageIndex = -1,
void* data = 0,
IReferenceCounted* data2 = 0 ) = 0;
//! Adds a new node before the first child node. //! Adds a new node before the first child node.
/** \param text text of the new node /** \param text text of the new node
...@@ -104,15 +95,12 @@ namespace gui ...@@ -104,15 +95,12 @@ namespace gui
\param data2 user data2 (IReferenceCounted*) of the new node \param data2 user data2 (IReferenceCounted*) of the new node
\return The new node \return The new node
*/ */
virtual IGUITreeViewNode* addChildFront( virtual IGUITreeViewNode* addChildFront(
const wchar_t* text, const wchar_t* text, const wchar_t* icon = 0,
const wchar_t* icon = 0, s32 imageIndex=-1, s32 selectedImageIndex=-1,
s32 imageIndex = -1, void* data=0, IReferenceCounted* data2=0 ) =0;
s32 selectedImageIndex = -1,
void* data = 0,
IReferenceCounted* data2 = 0 ) = 0;
//! Adds a new node behind the other node. //! Adds a new node behind the other node.
/** The other node has also te be a child node from this node. /** The other node has also te be a child node from this node.
\param other Node to insert after \param other Node to insert after
\param text text of the new node \param text text of the new node
...@@ -123,16 +111,13 @@ namespace gui ...@@ -123,16 +111,13 @@ namespace gui
\param data2 user data2 (IReferenceCounted*) of the new node \param data2 user data2 (IReferenceCounted*) of the new node
\return The new node or 0 if other is no child node from this \return The new node or 0 if other is no child node from this
*/ */
virtual IGUITreeViewNode* insertChildAfter( virtual IGUITreeViewNode* insertChildAfter(
IGUITreeViewNode* other, IGUITreeViewNode* other,
const wchar_t* text, const wchar_t* text, const wchar_t* icon = 0,
const wchar_t* icon = 0, s32 imageIndex=-1, s32 selectedImageIndex=-1,
s32 imageIndex = -1, void* data=0, IReferenceCounted* data2=0) =0;
s32 selectedImageIndex = -1,
void* data = 0,
IReferenceCounted* data2 = 0 ) = 0;
//! Adds a new node before the other node. //! Adds a new node before the other node.
/** The other node has also te be a child node from this node. /** The other node has also te be a child node from this node.
\param other Node to insert before \param other Node to insert before
\param text text of the new node \param text text of the new node
...@@ -143,14 +128,11 @@ namespace gui ...@@ -143,14 +128,11 @@ namespace gui
\param data2 user data2 (IReferenceCounted*) of the new node \param data2 user data2 (IReferenceCounted*) of the new node
\return The new node or 0 if other is no child node from this \return The new node or 0 if other is no child node from this
*/ */
virtual IGUITreeViewNode* insertChildBefore( virtual IGUITreeViewNode* insertChildBefore(
IGUITreeViewNode* other, IGUITreeViewNode* other,
const wchar_t* text, const wchar_t* text, const wchar_t* icon = 0,
const wchar_t* icon = 0, s32 imageIndex=-1, s32 selectedImageIndex=-1,
s32 imageIndex = -1, void* data=0, IReferenceCounted* data2=0) = 0;
s32 selectedImageIndex = -1,
void* data = 0,
IReferenceCounted* data2 = 0 ) = 0;
//! Return the first child node from this node. //! Return the first child node from this node.
/** \return The first child node or 0 if this node has no childs. */ /** \return The first child node or 0 if this node has no childs. */
...@@ -214,21 +196,17 @@ namespace gui ...@@ -214,21 +196,17 @@ namespace gui
//! Default tree view GUI element. //! Default tree view GUI element.
/** Displays a windows like tree buttons to expand/collaps the child nodes of an node /** Displays a windows like tree buttons to expand/collaps the child
and optional tree lines. nodes of an node and optional tree lines. Each node consits of an
Each node consits of an text, an icon text and a void pointer for user data. text, an icon text and a void pointer for user data. */
*/
class IGUITreeView : public IGUIElement class IGUITreeView : public IGUIElement
{ {
public: public:
//! constructor //! constructor
IGUITreeView( IGUIEnvironment* environment, IGUIElement* parent, s32 id, IGUITreeView(IGUIEnvironment* environment, IGUIElement* parent,
core::rect<s32> rectangle ) s32 id, core::rect<s32> rectangle)
: IGUIElement( EGUIET_TREE_VIEW, environment, parent, id, rectangle ) {} : IGUIElement( EGUIET_TREE_VIEW, environment, parent, id, rectangle ) {}
//! destructor
virtual ~IGUITreeView() {}
//! returns the root node (not visible) from the tree. //! returns the root node (not visible) from the tree.
virtual IGUITreeViewNode* getRoot() const = 0; virtual IGUITreeViewNode* getRoot() const = 0;
......
...@@ -38,18 +38,18 @@ namespace gui ...@@ -38,18 +38,18 @@ namespace gui
//! Sets whether the window can be dragged by the mouse //! Sets whether the window can be dragged by the mouse
virtual void setDraggable(bool draggable) = 0; virtual void setDraggable(bool draggable) = 0;
//! Set if the window background will be drawn //! Set if the window background will be drawn
virtual void setDrawBackground(bool draw) = 0; virtual void setDrawBackground(bool draw) = 0;
//! Get if the window background will be drawn //! Get if the window background will be drawn
virtual bool getDrawBackground() const = 0; virtual bool getDrawBackground() const = 0;
//! Set if the window titlebar will be drawn //! Set if the window titlebar will be drawn
//! Note: If the background is not drawn, then the titlebar is automatically also not drawn //! Note: If the background is not drawn, then the titlebar is automatically also not drawn
virtual void setDrawTitlebar(bool draw) = 0; virtual void setDrawTitlebar(bool draw) = 0;
//! Get if the window titlebar will be drawn //! Get if the window titlebar will be drawn
virtual bool getDrawTitlebar() const = 0; virtual bool getDrawTitlebar() const = 0;
}; };
......
...@@ -289,7 +289,9 @@ namespace scene ...@@ -289,7 +289,9 @@ namespace scene
//! Removes a child from this scene node. //! Removes a child from this scene node.
/** \param child A pointer to the new child. /** If found in the children list, the child pointer is also
dropped and might be deleted if no other grab exists.
\param child A pointer to the child which shall be removed.
\return True if the child was removed, and false if not, \return True if the child was removed, and false if not,
e.g. because it couldn't be found in the children list. */ e.g. because it couldn't be found in the children list. */
virtual bool removeChild(ISceneNode* child) virtual bool removeChild(ISceneNode* child)
...@@ -310,6 +312,9 @@ namespace scene ...@@ -310,6 +312,9 @@ namespace scene
//! Removes all children of this scene node //! Removes all children of this scene node
/** The scene nodes found in the children list are also dropped
and might be deleted if no other grab exists on them.
*/
virtual void removeAll() virtual void removeAll()
{ {
ISceneNodeList::Iterator it = Children.begin(); ISceneNodeList::Iterator it = Children.begin();
...@@ -323,7 +328,9 @@ namespace scene ...@@ -323,7 +328,9 @@ namespace scene
} }
//! Removes this scene node from the scene, deleting it. //! Removes this scene node from the scene
/** If no other grab exists for this node, it will be deleted.
*/
virtual void remove() virtual void remove()
{ {
if (Parent) if (Parent)
...@@ -352,21 +359,27 @@ namespace scene ...@@ -352,21 +359,27 @@ namespace scene
//! Removes an animator from this scene node. //! Removes an animator from this scene node.
/** \param animator A pointer to the animator to be deleted. */ /** If the animator is found, it is also dropped and might be
deleted if not other grab exists for it.
\param animator A pointer to the animator to be deleted. */
virtual void removeAnimator(ISceneNodeAnimator* animator) virtual void removeAnimator(ISceneNodeAnimator* animator)
{ {
ISceneNodeAnimatorList::Iterator it = Animators.begin(); ISceneNodeAnimatorList::Iterator it = Animators.begin();
for (; it != Animators.end(); ++it) for (; it != Animators.end(); ++it)
{
if ((*it) == animator) if ((*it) == animator)
{ {
(*it)->drop(); (*it)->drop();
Animators.erase(it); Animators.erase(it);
return; return;
} }
}
} }
//! Removes all animators from this scene node. //! Removes all animators from this scene node.
/** The animators might also be deleted if no other grab exists
for them. */
virtual void removeAnimators() virtual void removeAnimators()
{ {
ISceneNodeAnimatorList::Iterator it = Animators.begin(); ISceneNodeAnimatorList::Iterator it = Animators.begin();
......
...@@ -194,7 +194,7 @@ namespace video ...@@ -194,7 +194,7 @@ namespace video
: MaterialType(EMT_SOLID), AmbientColor(255,255,255,255), DiffuseColor(255,255,255,255), : MaterialType(EMT_SOLID), AmbientColor(255,255,255,255), DiffuseColor(255,255,255,255),
EmissiveColor(0,0,0,0), SpecularColor(255,255,255,255), EmissiveColor(0,0,0,0), SpecularColor(255,255,255,255),
Shininess(0.0f), MaterialTypeParam(0.0f), MaterialTypeParam2(0.0f), Thickness(1.0f), Shininess(0.0f), MaterialTypeParam(0.0f), MaterialTypeParam2(0.0f), Thickness(1.0f),
ZBuffer(ECFN_LESSEQUAL), AntiAliasing(EAAM_SIMPLE|EAAM_LINE_SMOOTH), ColorMask(ECP_ALL), ZBuffer(ECFN_LESSEQUAL), AntiAliasing(EAAM_SIMPLE), ColorMask(ECP_ALL),
ColorMaterial(ECM_DIFFUSE), ColorMaterial(ECM_DIFFUSE),
Wireframe(false), PointCloud(false), GouraudShading(true), Lighting(true), ZWriteEnable(true), Wireframe(false), PointCloud(false), GouraudShading(true), Lighting(true), ZWriteEnable(true),
BackfaceCulling(true), FrontfaceCulling(false), FogEnable(false), NormalizeNormals(false) BackfaceCulling(true), FrontfaceCulling(false), FogEnable(false), NormalizeNormals(false)
......
...@@ -78,10 +78,10 @@ namespace scene ...@@ -78,10 +78,10 @@ namespace scene
//! recalculates the bounding box member based on the planes //! recalculates the bounding box member based on the planes
inline void recalculateBoundingBox(); inline void recalculateBoundingBox();
//! update the given state's matrix based on video::E_TRANSFORMATION_STATE //! get the given state's matrix based on frustum E_TRANSFORMATION_STATE
core::matrix4& getTransform( video::E_TRANSFORMATION_STATE state); core::matrix4& getTransform( video::E_TRANSFORMATION_STATE state);
//! get the given state's matrix based on frustum E_TRANSFORMATION_STATE_FRUSTUM //! get the given state's matrix based on frustum E_TRANSFORMATION_STATE
const core::matrix4& getTransform( video::E_TRANSFORMATION_STATE state) const; const core::matrix4& getTransform( video::E_TRANSFORMATION_STATE state) const;
//! clips a line to the view frustum. //! clips a line to the view frustum.
......
...@@ -139,7 +139,7 @@ strings ...@@ -139,7 +139,7 @@ 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) // 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
......
...@@ -198,7 +198,9 @@ bool CGUIComboBox::OnEvent(const SEvent& event) ...@@ -198,7 +198,9 @@ bool CGUIComboBox::OnEvent(const SEvent& event)
if (event.KeyInput.Key == KEY_RETURN || event.KeyInput.Key == KEY_SPACE) if (event.KeyInput.Key == KEY_RETURN || event.KeyInput.Key == KEY_SPACE)
{ {
if (!event.KeyInput.PressedDown) if (!event.KeyInput.PressedDown)
{
openCloseMenu(); openCloseMenu();
}
ListButton->setPressed(ListBox == 0); ListButton->setPressed(ListBox == 0);
...@@ -251,8 +253,7 @@ bool CGUIComboBox::OnEvent(const SEvent& event) ...@@ -251,8 +253,7 @@ bool CGUIComboBox::OnEvent(const SEvent& event)
if (ListBox && if (ListBox &&
(Environment->hasFocus(ListBox) || ListBox->isMyChild(event.GUIEvent.Caller) ) && (Environment->hasFocus(ListBox) || ListBox->isMyChild(event.GUIEvent.Caller) ) &&
event.GUIEvent.Element != this && event.GUIEvent.Element != this &&
event.GUIEvent.Element != ListButton && !isMyChild(event.GUIEvent.Element) &&
event.GUIEvent.Element != ListBox &&
!ListBox->isMyChild(event.GUIEvent.Element)) !ListBox->isMyChild(event.GUIEvent.Element))
{ {
openCloseMenu(); openCloseMenu();
...@@ -303,7 +304,9 @@ bool CGUIComboBox::OnEvent(const SEvent& event) ...@@ -303,7 +304,9 @@ bool CGUIComboBox::OnEvent(const SEvent& event)
if (!(ListBox && if (!(ListBox &&
ListBox->getAbsolutePosition().isPointInside(p) && ListBox->getAbsolutePosition().isPointInside(p) &&
ListBox->OnEvent(event))) ListBox->OnEvent(event)))
{
openCloseMenu(); openCloseMenu();
}
return true; return true;
} }
case EMIE_MOUSE_WHEEL: case EMIE_MOUSE_WHEEL:
......
...@@ -17,7 +17,7 @@ namespace gui ...@@ -17,7 +17,7 @@ namespace gui
//! constructor //! constructor
CGUIModalScreen::CGUIModalScreen(IGUIEnvironment* environment, IGUIElement* parent, s32 id) CGUIModalScreen::CGUIModalScreen(IGUIEnvironment* environment, IGUIElement* parent, s32 id)
: IGUIElement(EGUIET_MODAL_SCREEN, environment, parent, id, parent->getAbsolutePosition()), : IGUIElement(EGUIET_MODAL_SCREEN, environment, parent, id, core::recti(0, 0, parent->getAbsolutePosition().getWidth(), parent->getAbsolutePosition().getHeight()) ),
MouseDownTime(0) MouseDownTime(0)
{ {
#ifdef _DEBUG #ifdef _DEBUG
......
...@@ -688,6 +688,7 @@ void CGUITabControl::setTabHeight( s32 height ) ...@@ -688,6 +688,7 @@ void CGUITabControl::setTabHeight( s32 height )
TabHeight = height; TabHeight = height;
recalculateScrollButtonPlacement();
recalculateScrollBar(); recalculateScrollBar();
} }
...@@ -758,8 +759,17 @@ void CGUITabControl::setTabVerticalAlignment( EGUI_ALIGNMENT alignment ) ...@@ -758,8 +759,17 @@ void CGUITabControl::setTabVerticalAlignment( EGUI_ALIGNMENT alignment )
{ {
VerticalAlignment = alignment; VerticalAlignment = alignment;
recalculateScrollButtonPlacement();
recalculateScrollBar();
}
void CGUITabControl::recalculateScrollButtonPlacement()
{
IGUISkin* skin = Environment->getSkin(); IGUISkin* skin = Environment->getSkin();
s32 ButtonSize = 16; s32 ButtonSize = 16;
s32 ButtonHeight = TabHeight - 2;
if ( ButtonHeight < 0 )
ButtonHeight = TabHeight;
if (skin) if (skin)
{ {
ButtonSize = skin->getSize(EGDS_WINDOW_BUTTON_WIDTH); ButtonSize = skin->getSize(EGDS_WINDOW_BUTTON_WIDTH);
...@@ -772,25 +782,22 @@ void CGUITabControl::setTabVerticalAlignment( EGUI_ALIGNMENT alignment ) ...@@ -772,25 +782,22 @@ void CGUITabControl::setTabVerticalAlignment( EGUI_ALIGNMENT alignment )
if (VerticalAlignment == EGUIA_UPPERLEFT) if (VerticalAlignment == EGUIA_UPPERLEFT)
{ {
ButtonY = (TabHeight / 2) - (ButtonSize / 2); ButtonY = 2 + (TabHeight / 2) - (ButtonHeight / 2);
UpButton->setAlignment(EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT); UpButton->setAlignment(EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
DownButton->setAlignment(EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT); DownButton->setAlignment(EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
} }
else else
{ {
ButtonY = RelativeRect.getHeight() - (TabHeight / 2) - (ButtonSize / 2); ButtonY = RelativeRect.getHeight() - (TabHeight / 2) - (ButtonHeight / 2) - 2;
UpButton->setAlignment(EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT); UpButton->setAlignment(EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT);
DownButton->setAlignment(EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT); DownButton->setAlignment(EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT);
} }
UpButton->setRelativePosition(core::rect<s32>(ButtonX, ButtonY, ButtonX+ButtonSize, ButtonY+ButtonSize)); UpButton->setRelativePosition(core::rect<s32>(ButtonX, ButtonY, ButtonX+ButtonSize, ButtonY+ButtonHeight));
ButtonX += ButtonSize + 1; ButtonX += ButtonSize + 1;
DownButton->setRelativePosition(core::rect<s32>(ButtonX, ButtonY, ButtonX+ButtonSize, ButtonY+ButtonSize)); DownButton->setRelativePosition(core::rect<s32>(ButtonX, ButtonY, ButtonX+ButtonSize, ButtonY+ButtonHeight));
recalculateScrollBar();
} }
//! Get the alignment of the tabs //! Get the alignment of the tabs
EGUI_ALIGNMENT CGUITabControl::getTabVerticalAlignment() const EGUI_ALIGNMENT CGUITabControl::getTabVerticalAlignment() const
{ {
......
...@@ -159,6 +159,7 @@ namespace gui ...@@ -159,6 +159,7 @@ namespace gui
bool needScrollControl( s32 startIndex=0, bool withScrollControl=false ); bool needScrollControl( s32 startIndex=0, bool withScrollControl=false );
s32 calcTabWidth(s32 pos, IGUIFont* font, const wchar_t* text, bool withScrollControl ); s32 calcTabWidth(s32 pos, IGUIFont* font, const wchar_t* text, bool withScrollControl );
void recalculateScrollButtonPlacement();
void recalculateScrollBar(); void recalculateScrollBar();
core::array<CGUITab*> Tabs; core::array<CGUITab*> Tabs;
......
...@@ -501,8 +501,8 @@ IMesh* CGeometryCreator::createSphereMesh(f32 radius, u32 polyCountX, u32 polyCo ...@@ -501,8 +501,8 @@ IMesh* CGeometryCreator::createSphereMesh(f32 radius, u32 polyCountX, u32 polyCo
/* A cylinder with proper normals and texture coords */ /* A cylinder with proper normals and texture coords */
IMesh* CGeometryCreator::createCylinderMesh(f32 radius, f32 length, IMesh* CGeometryCreator::createCylinderMesh(f32 radius, f32 length,
u32 tesselation, const video::SColor& color, u32 tesselation, const video::SColor& color,
bool closeTop, f32 oblique) const bool closeTop, f32 oblique) const
{ {
SMeshBuffer* buffer = new SMeshBuffer(); SMeshBuffer* buffer = new SMeshBuffer();
...@@ -514,10 +514,10 @@ IMesh* CGeometryCreator::createCylinderMesh(f32 radius, f32 length, ...@@ -514,10 +514,10 @@ IMesh* CGeometryCreator::createCylinderMesh(f32 radius, f32 length,
u32 i; u32 i;
video::S3DVertex v; video::S3DVertex v;
v.Color = color; v.Color = color;
buffer->Vertices.reallocate(tesselation*4+(closeTop?2:1)); buffer->Vertices.reallocate(tesselation*4+4+(closeTop?2:1));
buffer->Indices.reallocate((tesselation*2)*(closeTop?12:9)); buffer->Indices.reallocate((tesselation*2+1)*(closeTop?12:9));
f32 tcx = 0.f; f32 tcx = 0.f;
for ( i = 0; i != tesselation; ++i ) for ( i = 0; i <= tesselation; ++i )
{ {
const f32 angle = angleStep * i; const f32 angle = angleStep * i;
v.Pos.X = radius * cosf(angle); v.Pos.X = radius * cosf(angle);
...@@ -554,8 +554,9 @@ IMesh* CGeometryCreator::createCylinderMesh(f32 radius, f32 length, ...@@ -554,8 +554,9 @@ IMesh* CGeometryCreator::createCylinderMesh(f32 radius, f32 length,
tcx += recTesselation; tcx += recTesselation;
} }
const u32 nonWrappedSize = ( tesselation* 4 ) - 2; // indices for the main hull part
for ( i = 0; i != nonWrappedSize; i += 2 ) const u32 nonWrappedSize = tesselation* 4;
for (i=0; i != nonWrappedSize; i += 2)
{ {
buffer->Indices.push_back(i + 2); buffer->Indices.push_back(i + 2);
buffer->Indices.push_back(i + 0); buffer->Indices.push_back(i + 0);
...@@ -566,6 +567,7 @@ IMesh* CGeometryCreator::createCylinderMesh(f32 radius, f32 length, ...@@ -566,6 +567,7 @@ IMesh* CGeometryCreator::createCylinderMesh(f32 radius, f32 length,
buffer->Indices.push_back(i + 3); buffer->Indices.push_back(i + 3);
} }
// two closing quads between end and start
buffer->Indices.push_back(0); buffer->Indices.push_back(0);
buffer->Indices.push_back(i + 0); buffer->Indices.push_back(i + 0);
buffer->Indices.push_back(i + 1); buffer->Indices.push_back(i + 1);
...@@ -635,9 +637,10 @@ IMesh* CGeometryCreator::createCylinderMesh(f32 radius, f32 length, ...@@ -635,9 +637,10 @@ IMesh* CGeometryCreator::createCylinderMesh(f32 radius, f32 length,
/* A cone with proper normals and texture coords */ /* A cone with proper normals and texture coords */
IMesh* CGeometryCreator::createConeMesh(f32 radius, f32 length, u32 tesselation, IMesh* CGeometryCreator::createConeMesh(f32 radius, f32 length, u32 tesselation,
const video::SColor& colorTop, const video::SColor& colorTop,
const video::SColor& colorBottom, f32 oblique) const const video::SColor& colorBottom,
f32 oblique) const
{ {
SMeshBuffer* buffer = new SMeshBuffer(); SMeshBuffer* buffer = new SMeshBuffer();
......
...@@ -614,7 +614,7 @@ void CIrrDeviceWin32::setWindowCaption(const wchar_t* text) ...@@ -614,7 +614,7 @@ void CIrrDeviceWin32::setWindowCaption(const wchar_t* text)
if (IsNonNTWindows) if (IsNonNTWindows)
{ {
const core::stringc s = text; const core::stringc s = text;
#ifdef WIN64 #if defined(_WIN64) || defined(WIN64)
SetWindowTextA(HWnd, s.c_str()); SetWindowTextA(HWnd, s.c_str());
#else #else
SendMessageTimeout(HWnd, WM_SETTEXT, 0, SendMessageTimeout(HWnd, WM_SETTEXT, 0,
...@@ -624,7 +624,7 @@ void CIrrDeviceWin32::setWindowCaption(const wchar_t* text) ...@@ -624,7 +624,7 @@ void CIrrDeviceWin32::setWindowCaption(const wchar_t* text)
} }
else else
{ {
#ifdef WIN64 #if defined(_WIN64) || defined(WIN64)
SetWindowTextW(HWnd, text); SetWindowTextW(HWnd, text);
#else #else
SendMessageTimeoutW(HWnd, WM_SETTEXT, 0, SendMessageTimeoutW(HWnd, WM_SETTEXT, 0,
......
...@@ -292,6 +292,8 @@ bool COpenGLSLMaterialRenderer::linkProgram() ...@@ -292,6 +292,8 @@ bool COpenGLSLMaterialRenderer::linkProgram()
return false; return false;
} }
// seems that some implementations use an extra null terminator
++maxlen;
c8 *buf = new c8[maxlen]; c8 *buf = new c8[maxlen];
UniformInfo.clear(); UniformInfo.clear();
......
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