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
----------------
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 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.
- 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)
-------------------------------------
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
- SOLARIS recognition removed. Please specify the platform define manually. This allows for compilation under sparc/Linux and sparc/Solaris
......
This diff is collapsed.
......@@ -26,8 +26,8 @@ public:
//! \param destPos: Position of the image to draw
//! \param clip: Optional pointer to a rectalgle against which the text will be clipped.
//! If the pointer is null, no clipping will be done.
virtual void draw( s32 index, const core::position2d<s32>& destPos,
const core::rect<s32>* clip = 0 ) = 0;
virtual void draw(s32 index, const core::position2d<s32>& destPos,
const core::rect<s32>* clip = 0) = 0;
//! Returns the count of Images in the list.
//! \return Returns the count of Images in the list.
......
......@@ -20,12 +20,6 @@ namespace gui
class IGUITreeViewNode : public IReferenceCounted
{
public:
//! constructor
IGUITreeViewNode() {}
//! destructor
virtual ~IGUITreeViewNode() {}
//! returns the owner (tree view) of this node
virtual IGUITreeView* getOwner() const = 0;
......@@ -88,12 +82,9 @@ namespace gui
\return The new node
*/
virtual IGUITreeViewNode* addChildBack(
const wchar_t* text,
const wchar_t* icon = 0,
s32 imageIndex = -1,
s32 selectedImageIndex = -1,
void* data = 0,
IReferenceCounted* data2 = 0 ) = 0;
const wchar_t* text, const wchar_t* icon = 0,
s32 imageIndex=-1, s32 selectedImageIndex=-1,
void* data=0, IReferenceCounted* data2=0) =0;
//! Adds a new node before the first child node.
/** \param text text of the new node
......@@ -105,12 +96,9 @@ namespace gui
\return The new node
*/
virtual IGUITreeViewNode* addChildFront(
const wchar_t* text,
const wchar_t* icon = 0,
s32 imageIndex = -1,
s32 selectedImageIndex = -1,
void* data = 0,
IReferenceCounted* data2 = 0 ) = 0;
const wchar_t* text, const wchar_t* icon = 0,
s32 imageIndex=-1, s32 selectedImageIndex=-1,
void* data=0, IReferenceCounted* data2=0 ) =0;
//! Adds a new node behind the other node.
/** The other node has also te be a child node from this node.
......@@ -125,12 +113,9 @@ namespace gui
*/
virtual IGUITreeViewNode* insertChildAfter(
IGUITreeViewNode* other,
const wchar_t* text,
const wchar_t* icon = 0,
s32 imageIndex = -1,
s32 selectedImageIndex = -1,
void* data = 0,
IReferenceCounted* data2 = 0 ) = 0;
const wchar_t* text, const wchar_t* icon = 0,
s32 imageIndex=-1, s32 selectedImageIndex=-1,
void* data=0, IReferenceCounted* data2=0) =0;
//! Adds a new node before the other node.
/** The other node has also te be a child node from this node.
......@@ -145,12 +130,9 @@ namespace gui
*/
virtual IGUITreeViewNode* insertChildBefore(
IGUITreeViewNode* other,
const wchar_t* text,
const wchar_t* icon = 0,
s32 imageIndex = -1,
s32 selectedImageIndex = -1,
void* data = 0,
IReferenceCounted* data2 = 0 ) = 0;
const wchar_t* text, const wchar_t* icon = 0,
s32 imageIndex=-1, s32 selectedImageIndex=-1,
void* data=0, IReferenceCounted* data2=0) = 0;
//! Return the first child node from this node.
/** \return The first child node or 0 if this node has no childs. */
......@@ -214,21 +196,17 @@ namespace gui
//! Default tree view GUI element.
/** Displays a windows like tree buttons to expand/collaps the child nodes of an node
and optional tree lines.
Each node consits of an text, an icon text and a void pointer for user data.
*/
/** Displays a windows like tree buttons to expand/collaps the child
nodes of an node and optional tree lines. Each node consits of an
text, an icon text and a void pointer for user data. */
class IGUITreeView : public IGUIElement
{
public:
//! constructor
IGUITreeView( IGUIEnvironment* environment, IGUIElement* parent, s32 id,
core::rect<s32> rectangle )
IGUITreeView(IGUIEnvironment* environment, IGUIElement* parent,
s32 id, core::rect<s32> rectangle)
: IGUIElement( EGUIET_TREE_VIEW, environment, parent, id, rectangle ) {}
//! destructor
virtual ~IGUITreeView() {}
//! returns the root node (not visible) from the tree.
virtual IGUITreeViewNode* getRoot() const = 0;
......
......@@ -289,7 +289,9 @@ namespace scene
//! 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,
e.g. because it couldn't be found in the children list. */
virtual bool removeChild(ISceneNode* child)
......@@ -310,6 +312,9 @@ namespace scene
//! 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()
{
ISceneNodeList::Iterator it = Children.begin();
......@@ -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()
{
if (Parent)
......@@ -352,11 +359,14 @@ namespace scene
//! 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)
{
ISceneNodeAnimatorList::Iterator it = Animators.begin();
for (; it != Animators.end(); ++it)
{
if ((*it) == animator)
{
(*it)->drop();
......@@ -364,9 +374,12 @@ namespace scene
return;
}
}
}
//! Removes all animators from this scene node.
/** The animators might also be deleted if no other grab exists
for them. */
virtual void removeAnimators()
{
ISceneNodeAnimatorList::Iterator it = Animators.begin();
......
......@@ -194,7 +194,7 @@ namespace video
: MaterialType(EMT_SOLID), AmbientColor(255,255,255,255), DiffuseColor(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),
ZBuffer(ECFN_LESSEQUAL), AntiAliasing(EAAM_SIMPLE|EAAM_LINE_SMOOTH), ColorMask(ECP_ALL),
ZBuffer(ECFN_LESSEQUAL), AntiAliasing(EAAM_SIMPLE), ColorMask(ECP_ALL),
ColorMaterial(ECM_DIFFUSE),
Wireframe(false), PointCloud(false), GouraudShading(true), Lighting(true), ZWriteEnable(true),
BackfaceCulling(true), FrontfaceCulling(false), FogEnable(false), NormalizeNormals(false)
......
......@@ -78,10 +78,10 @@ namespace scene
//! recalculates the bounding box member based on the planes
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);
//! 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;
//! clips a line to the view frustum.
......
......@@ -139,7 +139,7 @@ strings
//! define a break macro for debugging.
#if defined(_DEBUG)
#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>
#define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) if (_CONDITION_) {_CrtDbgBreak();}
#else
......
......@@ -198,7 +198,9 @@ bool CGUIComboBox::OnEvent(const SEvent& event)
if (event.KeyInput.Key == KEY_RETURN || event.KeyInput.Key == KEY_SPACE)
{
if (!event.KeyInput.PressedDown)
{
openCloseMenu();
}
ListButton->setPressed(ListBox == 0);
......@@ -251,8 +253,7 @@ bool CGUIComboBox::OnEvent(const SEvent& event)
if (ListBox &&
(Environment->hasFocus(ListBox) || ListBox->isMyChild(event.GUIEvent.Caller) ) &&
event.GUIEvent.Element != this &&
event.GUIEvent.Element != ListButton &&
event.GUIEvent.Element != ListBox &&
!isMyChild(event.GUIEvent.Element) &&
!ListBox->isMyChild(event.GUIEvent.Element))
{
openCloseMenu();
......@@ -303,7 +304,9 @@ bool CGUIComboBox::OnEvent(const SEvent& event)
if (!(ListBox &&
ListBox->getAbsolutePosition().isPointInside(p) &&
ListBox->OnEvent(event)))
{
openCloseMenu();
}
return true;
}
case EMIE_MOUSE_WHEEL:
......
......@@ -17,7 +17,7 @@ namespace gui
//! constructor
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)
{
#ifdef _DEBUG
......
......@@ -688,6 +688,7 @@ void CGUITabControl::setTabHeight( s32 height )
TabHeight = height;
recalculateScrollButtonPlacement();
recalculateScrollBar();
}
......@@ -758,8 +759,17 @@ void CGUITabControl::setTabVerticalAlignment( EGUI_ALIGNMENT alignment )
{
VerticalAlignment = alignment;
recalculateScrollButtonPlacement();
recalculateScrollBar();
}
void CGUITabControl::recalculateScrollButtonPlacement()
{
IGUISkin* skin = Environment->getSkin();
s32 ButtonSize = 16;
s32 ButtonHeight = TabHeight - 2;
if ( ButtonHeight < 0 )
ButtonHeight = TabHeight;
if (skin)
{
ButtonSize = skin->getSize(EGDS_WINDOW_BUTTON_WIDTH);
......@@ -772,25 +782,22 @@ void CGUITabControl::setTabVerticalAlignment( EGUI_ALIGNMENT alignment )
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);
DownButton->setAlignment(EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
}
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);
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;
DownButton->setRelativePosition(core::rect<s32>(ButtonX, ButtonY, ButtonX+ButtonSize, ButtonY+ButtonSize));
recalculateScrollBar();
DownButton->setRelativePosition(core::rect<s32>(ButtonX, ButtonY, ButtonX+ButtonSize, ButtonY+ButtonHeight));
}
//! Get the alignment of the tabs
EGUI_ALIGNMENT CGUITabControl::getTabVerticalAlignment() const
{
......
......@@ -159,6 +159,7 @@ namespace gui
bool needScrollControl( s32 startIndex=0, bool withScrollControl=false );
s32 calcTabWidth(s32 pos, IGUIFont* font, const wchar_t* text, bool withScrollControl );
void recalculateScrollButtonPlacement();
void recalculateScrollBar();
core::array<CGUITab*> Tabs;
......
......@@ -514,10 +514,10 @@ IMesh* CGeometryCreator::createCylinderMesh(f32 radius, f32 length,
u32 i;
video::S3DVertex v;
v.Color = color;
buffer->Vertices.reallocate(tesselation*4+(closeTop?2:1));
buffer->Indices.reallocate((tesselation*2)*(closeTop?12:9));
buffer->Vertices.reallocate(tesselation*4+4+(closeTop?2:1));
buffer->Indices.reallocate((tesselation*2+1)*(closeTop?12:9));
f32 tcx = 0.f;
for ( i = 0; i != tesselation; ++i )
for ( i = 0; i <= tesselation; ++i )
{
const f32 angle = angleStep * i;
v.Pos.X = radius * cosf(angle);
......@@ -554,8 +554,9 @@ IMesh* CGeometryCreator::createCylinderMesh(f32 radius, f32 length,
tcx += recTesselation;
}
const u32 nonWrappedSize = ( tesselation* 4 ) - 2;
for ( i = 0; i != nonWrappedSize; i += 2 )
// indices for the main hull part
const u32 nonWrappedSize = tesselation* 4;
for (i=0; i != nonWrappedSize; i += 2)
{
buffer->Indices.push_back(i + 2);
buffer->Indices.push_back(i + 0);
......@@ -566,6 +567,7 @@ IMesh* CGeometryCreator::createCylinderMesh(f32 radius, f32 length,
buffer->Indices.push_back(i + 3);
}
// two closing quads between end and start
buffer->Indices.push_back(0);
buffer->Indices.push_back(i + 0);
buffer->Indices.push_back(i + 1);
......@@ -637,7 +639,8 @@ IMesh* CGeometryCreator::createCylinderMesh(f32 radius, f32 length,
/* A cone with proper normals and texture coords */
IMesh* CGeometryCreator::createConeMesh(f32 radius, f32 length, u32 tesselation,
const video::SColor& colorTop,
const video::SColor& colorBottom, f32 oblique) const
const video::SColor& colorBottom,
f32 oblique) const
{
SMeshBuffer* buffer = new SMeshBuffer();
......
......@@ -614,7 +614,7 @@ void CIrrDeviceWin32::setWindowCaption(const wchar_t* text)
if (IsNonNTWindows)
{
const core::stringc s = text;
#ifdef WIN64
#if defined(_WIN64) || defined(WIN64)
SetWindowTextA(HWnd, s.c_str());
#else
SendMessageTimeout(HWnd, WM_SETTEXT, 0,
......@@ -624,7 +624,7 @@ void CIrrDeviceWin32::setWindowCaption(const wchar_t* text)
}
else
{
#ifdef WIN64
#if defined(_WIN64) || defined(WIN64)
SetWindowTextW(HWnd, text);
#else
SendMessageTimeoutW(HWnd, WM_SETTEXT, 0,
......
......@@ -292,6 +292,8 @@ bool COpenGLSLMaterialRenderer::linkProgram()
return false;
}
// seems that some implementations use an extra null terminator
++maxlen;
c8 *buf = new c8[maxlen];
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