Merge revisions r5554 through r5566 from trunk to ogl-es

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@5567 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2017-11-06 14:27:34 +00:00
parent 56317e5278
commit 87db86ddfd
40 changed files with 310 additions and 105 deletions

View File

@ -9,7 +9,11 @@ Changes in ogl-es (not yet released - will be merged with trunk at some point)
--------------------------
Changes in 1.9 (not yet released)
- Add _IRR_COMPILE_WITH_PARTICLES_ to control compilation of particle system
- Add IGUIImage::setDrawBackground to allow disabling background drawing even when no texture is set.
- Add gui event EGET_ELEMENT_REMOVED.
- Fix: IGUIContextMenu now raises sub-menu when they would otherwise be displayed below bottom-border of root gui element.
- Prevent initializing/quitting SDL several times when using more than one Irrlicht device.
- Reduce log-messages for "loaded texture" and "loaded mesh" from ELL_INFORMATION to ELL_DEBUG.
- Add IGUIButton::setOverrideColor to allow overriding text-color (same function as statictexts and editboxes have).
- Add functions IGUIButton::getClickShiftState and IGUIButton::getClickControlState to get shift/ctrl key-state when a button was clicked. Thanks @StarSonata for patch.
@ -32,7 +36,7 @@ Changes in 1.9 (not yet released)
- Add access functions to ITextSceneNode (getText, getTextColor, setFont, getFont).
- Try harder to move Window to custom WindowPosition set in SIrrlichtCreationParameters on X11. Thx@ Hernan Ezequiel Di Giorgi for the patch (#304).
- Fix bug in virtual filessystem which prevented createFileList from working. Thx @Cube for reporting a problem.
- ITriangleSelector now can also return meshbuffer collision information.
- ITriangleSelector now can also return meshbuffer collision information.
- core::string::split now adds delimiter to token before delimiter when keepSeparators is true. That way we never end up with 2 tokens for an original string with a single character.
- Bugfix: SMesh::recalculateBoundingBox() does now ignore empty boundingboxes of meshbuffers instead of adding them.
- IIrrXMLReader::getAttributeValueAsInt and IIrrXMLReader::getAttributeValueAsFloat can now return a custom default-value when the attribute is not found.

View File

@ -330,6 +330,11 @@ namespace irr
//! may be removed by Irrlicht 1.9
EGET_TREEVIEW_NODE_COLLAPS = EGET_TREEVIEW_NODE_COLLAPSE,
//! Information that an element got removed from the gui-graph.
/** NOTE: This event is not passed on to all element parents, but only the
gui environment (and user receiver). */
EGET_ELEMENT_REMOVED,
//! No real event. Just for convenience to get number of events
EGET_COUNT
};

View File

@ -13,14 +13,12 @@
#include "EGUIElementTypes.h"
#include "EGUIAlignment.h"
#include "IAttributes.h"
#include "IGUIEnvironment.h"
namespace irr
{
namespace gui
{
class IGUIEnvironment;
//! Base class of all GUI elements.
class IGUIElement : public virtual io::IAttributeExchangingObject, public IEventReceiver
{
@ -56,6 +54,7 @@ public:
core::list<IGUIElement*>::Iterator it = Children.begin();
for (; it != Children.end(); ++it)
{
(*it)->sendRemoveEvent();
(*it)->Parent = 0;
(*it)->drop();
}
@ -68,7 +67,6 @@ public:
return Parent;
}
//! Returns the relative rectangle of this element.
core::rect<s32> getRelativePosition() const
{
@ -292,6 +290,7 @@ public:
for (; it != Children.end(); ++it)
if ((*it) == child)
{
(*it)->sendRemoveEvent();
(*it)->Parent = 0;
(*it)->drop();
Children.erase(it);
@ -966,6 +965,21 @@ protected:
}
}
// Inform gui-environment that an element got removed from the gui-graph
void sendRemoveEvent()
{
if ( Environment )
{
SEvent removeEvent;
removeEvent.EventType = EET_GUI_EVENT;
removeEvent.GUIEvent.Caller = this;
removeEvent.GUIEvent.Element = 0;
removeEvent.GUIEvent.EventType = EGET_ELEMENT_REMOVED;
Environment->postEventFromUser(removeEvent);
}
}
protected:
//! List of all children of this element

View File

@ -295,7 +295,7 @@ public:
of the texture to draw itself.
\param parent Parent gui element of the image.
\param id Id to identify the gui element.
\param text Title text of the image.
\param text Title text of the image (not displayed).
\return Pointer to the created image element. Returns 0 if an error
occurred. This pointer should not be dropped. See
IReferenceCounted::drop() for more information. */
@ -307,7 +307,7 @@ public:
\param rectangle Rectangle specifying the borders of the image.
\param parent Parent gui element of the image.
\param id Id to identify the gui element.
\param text Title text of the image.
\param text Title text of the image (not displayed).
\param useAlphaChannel Sets if the image should use the alpha channel
of the texture to draw itself.
\return Pointer to the created image element. Returns 0 if an error

View File

@ -15,7 +15,6 @@ namespace video
}
namespace gui
{
//! GUI element displaying an image.
class IGUIImage : public IGUIElement
{
@ -32,6 +31,8 @@ namespace gui
virtual video::ITexture* getImage() const = 0;
//! Sets the color of the image
/** \param color Color with which the image is drawn. If the color
equals Color(255,255,255,255) it is ignored. */
virtual void setColor(video::SColor color) = 0;
//! Sets if the image should scale to fit the element
@ -69,6 +70,14 @@ namespace gui
//! Get drawing-area restrictions.
virtual core::rect<f32> getDrawBounds() const = 0;
//! Sets whether to draw a background color (EGDC_3D_DARK_SHADOW) when no texture is set
/** By default it's enabled */
virtual void setDrawBackground(bool draw) = 0;
//! Checks if a background is drawn when no texture is set
/** \return true if background drawing is enabled, false otherwise */
virtual bool isDrawBackgroundEnabled() const = 0;
};

View File

@ -334,6 +334,13 @@ you will not be able to use anything provided by the GUI Environment, including
#undef _IRR_COMPILE_WITH_GUI_
#endif
//! Define _IRR_COMPILE_WITH_PARTICLES to compile the engine the withe build-in particle system
/** You can disable this if you don't need particles or use an external particle system. */
#define _IRR_COMPILE_WITH_PARTICLES_
#ifdef NO_IRR_COMPILE_WITH_PARTICLES_
#undef _IRR_COMPILE_WITH_PARTICLES_
#endif
//! Define _IRR_WCHAR_FILESYSTEM to enable unicode filesystem support for the engine.
/** This enables the engine to read/write from unicode filesystem. If you
disable this feature, the engine behave as before (ansi). This is currently only supported

View File

@ -27,22 +27,22 @@ public:
setBool(value);
}
virtual s32 getInt() _IRR_OVERRIDE_
virtual s32 getInt() const _IRR_OVERRIDE_
{
return BoolValue ? 1 : 0;
}
virtual f32 getFloat() _IRR_OVERRIDE_
virtual f32 getFloat() const _IRR_OVERRIDE_
{
return BoolValue ? 1.0f : 0.0f;
}
virtual bool getBool() _IRR_OVERRIDE_
virtual bool getBool() const _IRR_OVERRIDE_
{
return BoolValue;
}
virtual core::stringw getStringW() _IRR_OVERRIDE_
virtual core::stringw getStringW() const _IRR_OVERRIDE_
{
return core::stringw( BoolValue ? L"true" : L"false" );
}
@ -91,22 +91,22 @@ public:
setInt(value);
}
virtual s32 getInt() _IRR_OVERRIDE_
virtual s32 getInt() const _IRR_OVERRIDE_
{
return Value;
}
virtual f32 getFloat() _IRR_OVERRIDE_
virtual f32 getFloat() const _IRR_OVERRIDE_
{
return (f32)Value;
}
virtual bool getBool() _IRR_OVERRIDE_
virtual bool getBool() const _IRR_OVERRIDE_
{
return (Value != 0);
}
virtual core::stringw getStringW() _IRR_OVERRIDE_
virtual core::stringw getStringW() const _IRR_OVERRIDE_
{
return core::stringw(Value);
}
@ -151,22 +151,22 @@ public:
setFloat(value);
}
virtual s32 getInt() _IRR_OVERRIDE_
virtual s32 getInt() const _IRR_OVERRIDE_
{
return (s32)Value;
}
virtual f32 getFloat() _IRR_OVERRIDE_
virtual f32 getFloat() const _IRR_OVERRIDE_
{
return Value;
}
virtual bool getBool() _IRR_OVERRIDE_
virtual bool getBool() const _IRR_OVERRIDE_
{
return (Value != 0);
}
virtual core::stringw getStringW() _IRR_OVERRIDE_
virtual core::stringw getStringW() const _IRR_OVERRIDE_
{
return core::stringw((double)Value);
}
@ -384,7 +384,7 @@ public:
}
// getting values
virtual s32 getInt() _IRR_OVERRIDE_
virtual s32 getInt() const _IRR_OVERRIDE_
{
if (Count==0)
return 0;
@ -395,7 +395,7 @@ public:
return ValueI[0];
}
virtual f32 getFloat() _IRR_OVERRIDE_
virtual f32 getFloat() const _IRR_OVERRIDE_
{
if (Count==0)
return 0.0f;
@ -406,7 +406,7 @@ public:
return (f32)ValueI[0];
}
virtual bool getBool() _IRR_OVERRIDE_
virtual bool getBool() const _IRR_OVERRIDE_
{
// return true if any number is nonzero
bool ret=false;
@ -422,7 +422,7 @@ public:
}
virtual core::stringc getString() _IRR_OVERRIDE_
virtual core::stringc getString() const _IRR_OVERRIDE_
{
core::stringc outstr;
@ -439,7 +439,7 @@ public:
return outstr;
}
virtual core::stringw getStringW() _IRR_OVERRIDE_
virtual core::stringw getStringW() const _IRR_OVERRIDE_
{
core::stringw outstr;
@ -456,7 +456,7 @@ public:
return outstr;
}
virtual core::position2di getPosition() _IRR_OVERRIDE_
virtual core::position2di getPosition() const _IRR_OVERRIDE_
{
core::position2di p;
@ -474,7 +474,7 @@ public:
return p;
}
virtual core::vector3df getVector() _IRR_OVERRIDE_
virtual core::vector3df getVector() const _IRR_OVERRIDE_
{
core::vector3df v;
@ -494,7 +494,7 @@ public:
return v;
}
virtual core::vector2df getVector2d() _IRR_OVERRIDE_
virtual core::vector2df getVector2d() const _IRR_OVERRIDE_
{
core::vector2df v;
@ -512,7 +512,7 @@ public:
return v;
}
virtual video::SColorf getColorf() _IRR_OVERRIDE_
virtual video::SColorf getColorf() const _IRR_OVERRIDE_
{
video::SColorf c;
if (IsFloat)
@ -533,13 +533,13 @@ public:
return c;
}
virtual video::SColor getColor() _IRR_OVERRIDE_
virtual video::SColor getColor() const _IRR_OVERRIDE_
{
return getColorf().toSColor();
}
virtual core::rect<s32> getRect() _IRR_OVERRIDE_
virtual core::rect<s32> getRect() const _IRR_OVERRIDE_
{
core::rect<s32> r;
@ -560,7 +560,7 @@ public:
return r;
}
virtual core::dimension2du getDimension2d() _IRR_OVERRIDE_
virtual core::dimension2du getDimension2d() const _IRR_OVERRIDE_
{
core::dimension2d<u32> dim;
@ -577,7 +577,7 @@ public:
return dim;
}
virtual core::matrix4 getMatrix() _IRR_OVERRIDE_
virtual core::matrix4 getMatrix() const _IRR_OVERRIDE_
{
core::matrix4 ret;
if (IsFloat)
@ -597,7 +597,7 @@ public:
return ret;
}
virtual core::quaternion getQuaternion() _IRR_OVERRIDE_
virtual core::quaternion getQuaternion() const _IRR_OVERRIDE_
{
core::quaternion ret;
if (IsFloat)
@ -617,7 +617,7 @@ public:
return ret;
}
virtual core::triangle3df getTriangle() _IRR_OVERRIDE_
virtual core::triangle3df getTriangle() const _IRR_OVERRIDE_
{
core::triangle3df ret;
@ -649,7 +649,7 @@ public:
return ret;
}
virtual core::plane3df getPlane() _IRR_OVERRIDE_
virtual core::plane3df getPlane() const _IRR_OVERRIDE_
{
core::plane3df ret;
@ -671,7 +671,7 @@ public:
return ret;
}
virtual core::aabbox3df getBBox() _IRR_OVERRIDE_
virtual core::aabbox3df getBBox() const _IRR_OVERRIDE_
{
core::aabbox3df ret;
if (IsFloat)
@ -696,7 +696,7 @@ public:
}
virtual core::line2df getLine2d() _IRR_OVERRIDE_
virtual core::line2df getLine2d() const _IRR_OVERRIDE_
{
core::line2df ret;
if (IsFloat)
@ -716,7 +716,7 @@ public:
return ret;
}
virtual core::line3df getLine3d() _IRR_OVERRIDE_
virtual core::line3df getLine3d() const _IRR_OVERRIDE_
{
core::line3df ret;
if (IsFloat)
@ -1198,12 +1198,12 @@ public:
CColorfAttribute(const char* name, video::SColorf value) : CNumbersAttribute(name, value) {}
virtual s32 getInt() _IRR_OVERRIDE_
virtual s32 getInt() const _IRR_OVERRIDE_
{
return getColor().color;
}
virtual f32 getFloat() _IRR_OVERRIDE_
virtual f32 getFloat() const _IRR_OVERRIDE_
{
return (f32)getColor().color;
}
@ -1244,12 +1244,12 @@ public:
CColorAttribute(const char* name, const video::SColor& value) : CNumbersAttribute(name, value) {}
virtual s32 getInt() _IRR_OVERRIDE_
virtual s32 getInt() const _IRR_OVERRIDE_
{
return getColor().color;
}
virtual f32 getFloat() _IRR_OVERRIDE_
virtual f32 getFloat() const _IRR_OVERRIDE_
{
return (f32)getColor().color;
}
@ -1268,7 +1268,7 @@ public:
setInt((s32)floatValue);
}
virtual core::stringc getString() _IRR_OVERRIDE_
virtual core::stringc getString() const _IRR_OVERRIDE_
{
char tmp[10];
const video::SColor c = getColor();
@ -1276,7 +1276,7 @@ public:
return core::stringc(tmp);
}
virtual core::stringw getStringW() _IRR_OVERRIDE_
virtual core::stringw getStringW() const _IRR_OVERRIDE_
{
char tmp[10];
const video::SColor c = getColor();
@ -1323,7 +1323,7 @@ public:
return EAT_VECTOR3D;
}
virtual core::matrix4 getMatrix() _IRR_OVERRIDE_
virtual core::matrix4 getMatrix() const _IRR_OVERRIDE_
{
core::matrix4 ret;
ret.makeIdentity();
@ -1424,7 +1424,7 @@ public:
return EAT_MATRIX;
}
virtual core::quaternion getQuaternion() _IRR_OVERRIDE_
virtual core::quaternion getQuaternion() const _IRR_OVERRIDE_
{
return core::quaternion(getMatrix());
}
@ -1507,7 +1507,7 @@ public:
return EAT_TRIANGLE3D;
}
virtual core::plane3df getPlane() _IRR_OVERRIDE_
virtual core::plane3df getPlane() const _IRR_OVERRIDE_
{
return getTriangle().getPlane();
}
@ -1592,7 +1592,7 @@ public:
setString(enumValue);
}
virtual s32 getInt() _IRR_OVERRIDE_
virtual s32 getInt() const _IRR_OVERRIDE_
{
for (u32 i=0; i < EnumLiterals.size(); ++i)
{
@ -1605,22 +1605,22 @@ public:
return -1;
}
virtual f32 getFloat() _IRR_OVERRIDE_
virtual f32 getFloat() const _IRR_OVERRIDE_
{
return (f32)getInt();
}
virtual bool getBool() _IRR_OVERRIDE_
virtual bool getBool() const _IRR_OVERRIDE_
{
return (getInt() != 0); // does not make a lot of sense, I know
}
virtual core::stringc getString() _IRR_OVERRIDE_
virtual core::stringc getString() const _IRR_OVERRIDE_
{
return Value;
}
virtual core::stringw getStringW() _IRR_OVERRIDE_
virtual core::stringw getStringW() const _IRR_OVERRIDE_
{
return core::stringw(Value.c_str());
}
@ -1643,7 +1643,7 @@ public:
Value = text;
}
virtual const char* getEnum() _IRR_OVERRIDE_
virtual const char* getEnum() const _IRR_OVERRIDE_
{
return Value.c_str();
}
@ -1693,7 +1693,7 @@ public:
setBinary(binaryData, lengthInBytes);
}
virtual s32 getInt() _IRR_OVERRIDE_
virtual s32 getInt() const _IRR_OVERRIDE_
{
if (IsStringW)
return atoi(core::stringc(ValueW.c_str()).c_str());
@ -1701,7 +1701,7 @@ public:
return atoi(Value.c_str());
}
virtual f32 getFloat() _IRR_OVERRIDE_
virtual f32 getFloat() const _IRR_OVERRIDE_
{
if (IsStringW)
return core::fast_atof(core::stringc(ValueW.c_str()).c_str());
@ -1709,7 +1709,7 @@ public:
return core::fast_atof(Value.c_str());
}
virtual bool getBool() _IRR_OVERRIDE_
virtual bool getBool() const _IRR_OVERRIDE_
{
if (IsStringW)
return ValueW.equals_ignore_case(L"true");
@ -1717,14 +1717,14 @@ public:
return Value.equals_ignore_case("true");
}
virtual core::stringc getString() _IRR_OVERRIDE_
virtual core::stringc getString() const _IRR_OVERRIDE_
{
if (IsStringW)
return core::stringc(ValueW.c_str());
else
return Value;
}
virtual core::stringw getStringW() _IRR_OVERRIDE_
virtual core::stringw getStringW() const _IRR_OVERRIDE_
{
if (IsStringW)
return ValueW;
@ -1779,7 +1779,7 @@ public:
return L"string";
}
virtual void getBinary(void* outdata, s32 maxLength) _IRR_OVERRIDE_
virtual void getBinary(void* outdata, s32 maxLength) const _IRR_OVERRIDE_
{
s32 dataSize = maxLength;
c8* datac8 = (c8*)(outdata);
@ -1908,7 +1908,7 @@ public:
return (Value != 0);
}
virtual core::stringw getStringW() _IRR_OVERRIDE_
virtual core::stringw getStringW() const _IRR_OVERRIDE_
{
// (note: don't try to put all this in some ?: operators, or c++ builder will choke)
if ( OverrideName.size() )
@ -1920,7 +1920,7 @@ public:
return core::stringw();
}
virtual core::stringc getString() _IRR_OVERRIDE_
virtual core::stringc getString() const _IRR_OVERRIDE_
{
// since texture names can be stringw we are careful with the types
if ( OverrideName.size() )
@ -1995,7 +1995,7 @@ public:
setArray(value);
}
virtual core::array<core::stringw> getArray() _IRR_OVERRIDE_
virtual core::array<core::stringw> getArray() const _IRR_OVERRIDE_
{
return Value;
}
@ -2030,17 +2030,17 @@ public:
Value = value;
}
virtual s32 getInt() _IRR_OVERRIDE_
virtual s32 getInt() const _IRR_OVERRIDE_
{
return *static_cast<s32*>(Value);
}
virtual bool getBool() _IRR_OVERRIDE_
virtual bool getBool() const _IRR_OVERRIDE_
{
return (Value != 0);
}
virtual core::stringw getStringW() _IRR_OVERRIDE_
virtual core::stringw getStringW() const _IRR_OVERRIDE_
{
wchar_t buf[32];
swprintf_irr(buf, 32, L"%p", Value);
@ -2084,7 +2084,7 @@ public:
Value = v;
}
virtual void* getUserPointer() _IRR_OVERRIDE_
virtual void* getUserPointer() const _IRR_OVERRIDE_
{
return Value;
}

View File

@ -668,16 +668,27 @@ void CGUIContextMenu::recalculateSize()
core::rect<s32> subRect(width-5, Items[i].PosY, width+w-5, Items[i].PosY+h);
// if it would be drawn beyond the right border, then add it to the left side
gui::IGUIElement * root = Environment->getRootGUIElement();
if ( root )
{
core::rect<s32> rectRoot( root->getAbsolutePosition() );
// if it would be drawn beyond the right border, then add it to the left side
if ( getAbsolutePosition().UpperLeftCorner.X+subRect.LowerRightCorner.X > rectRoot.LowerRightCorner.X )
{
subRect.UpperLeftCorner.X = -w;
subRect.LowerRightCorner.X = 0;
}
// if it would be drawn below bottom border, move it up, but not further than to top.
irr::s32 belowBottom = getAbsolutePosition().UpperLeftCorner.Y+subRect.LowerRightCorner.Y - rectRoot.LowerRightCorner.Y;
if ( belowBottom > 0 )
{
irr::s32 belowTop = getAbsolutePosition().UpperLeftCorner.Y+subRect.UpperLeftCorner.Y;
irr::s32 moveUp = belowBottom < belowTop ? belowBottom : belowTop;
subRect.UpperLeftCorner.Y -= moveUp;
subRect.LowerRightCorner.Y -= moveUp;
}
}
Items[i].SubMenu->setRelativePosition(subRect);

View File

@ -400,6 +400,7 @@ void CGUIEnvironment::clear()
//! called by ui if an event happened.
bool CGUIEnvironment::OnEvent(const SEvent& event)
{
bool ret = false;
if (UserReceiver
&& (event.EventType != EET_MOUSE_INPUT_EVENT)
@ -563,7 +564,21 @@ bool CGUIEnvironment::postEventFromUser(const SEvent& event)
switch(event.EventType)
{
case EET_GUI_EVENT:
// hey, why is the user sending gui events..?
if ( event.EventType == EET_GUI_EVENT
&& event.GUIEvent.EventType == EGET_ELEMENT_REMOVED )
{
// TODO: In theory we could also check Focus, Hovered and ToolTip.Element here.
// But not trivial (aka - test *a lot* when you try to change, especially GUI editor).
// Focus might still be the easiest to get working (and most important, it was one of the reasons I added EGET_ELEMENT_REMOVED ...)
if ( UserReceiver )
UserReceiver->OnEvent(event);
}
else
{
// hey, why is the user sending gui events..?
}
break;
case EET_MOUSE_INPUT_EVENT:

View File

@ -18,7 +18,7 @@ namespace gui
//! constructor
CGUIImage::CGUIImage(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
: IGUIImage(environment, parent, id, rectangle), Texture(0), Color(255,255,255,255),
UseAlphaChannel(false), ScaleImage(false), DrawBounds(0.f, 0.f, 1.f, 1.f)
UseAlphaChannel(false), ScaleImage(false), DrawBounds(0.f, 0.f, 1.f, 1.f), DrawBackground(true)
{
#ifdef _DEBUG
setDebugName("CGUIImage");
@ -104,7 +104,7 @@ void CGUIImage::draw()
&clippingRect, Color, UseAlphaChannel);
}
}
else
else if ( DrawBackground )
{
core::rect<s32> clippingRect(AbsoluteClippingRect);
checkBounds(clippingRect);
@ -188,6 +188,7 @@ void CGUIImage::serializeAttributes(io::IAttributes* out, io::SAttributeReadWrit
out->addFloat ("DrawBoundsY1", DrawBounds.UpperLeftCorner.Y);
out->addFloat ("DrawBoundsX2", DrawBounds.LowerRightCorner.X);
out->addFloat ("DrawBoundsY2", DrawBounds.LowerRightCorner.Y);
out->addBool ("DrawBackground", DrawBackground);
}
@ -207,6 +208,8 @@ void CGUIImage::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWri
DrawBounds.LowerRightCorner.X = in->getAttributeAsFloat("DrawBoundsX2", DrawBounds.LowerRightCorner.X);
DrawBounds.LowerRightCorner.Y = in->getAttributeAsFloat("DrawBoundsY2", DrawBounds.LowerRightCorner.Y);
setDrawBounds(DrawBounds);
setDrawBackground(in->getAttributeAsBool("DrawBackground", DrawBackground));
}

View File

@ -64,6 +64,18 @@ namespace gui
//! Get drawing-area restrictions.
virtual core::rect<f32> getDrawBounds() const _IRR_OVERRIDE_;
//! Sets whether to draw a background color (EGDC_3D_DARK_SHADOW) when no texture is set
virtual void setDrawBackground(bool draw) _IRR_OVERRIDE_
{
DrawBackground = draw;
}
//! Checks if a background is drawn when no texture is set
virtual bool isDrawBackgroundEnabled() const _IRR_OVERRIDE_
{
return DrawBackground;
}
//! Writes attributes of the element.
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const _IRR_OVERRIDE_;
@ -89,6 +101,7 @@ namespace gui
bool ScaleImage;
core::rect<s32> SourceRect;
core::rect<f32> DrawBounds;
bool DrawBackground;
};

View File

@ -2,6 +2,9 @@
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_LWO_LOADER_
#include "CLWOMeshFileLoader.h"
#include "CMeshTextureLoader.h"
#include "os.h"
@ -2110,3 +2113,4 @@ video::ITexture* CLWOMeshFileLoader::loadTexture(const core::stringc& file)
} // end namespace scene
} // end namespace irr
#endif // _IRR_COMPILE_WITH_LWO_LOADER_

View File

@ -3,6 +3,9 @@
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CParticleAttractionAffector.h"
#ifdef _IRR_COMPILE_WITH_PARTICLES_
#include "IAttributes.h"
namespace irr
@ -82,3 +85,4 @@ void CParticleAttractionAffector::deserializeAttributes(io::IAttributes* in, io:
} // end namespace scene
} // end namespace irr
#endif // _IRR_COMPILE_WITH_PARTICLES_

View File

@ -5,6 +5,9 @@
#ifndef __C_PARTICLE_ATTRACTION_AFFECTOR_H_INCLUDED__
#define __C_PARTICLE_ATTRACTION_AFFECTOR_H_INCLUDED__
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_PARTICLES_
#include "IParticleAttractionAffector.h"
namespace irr
@ -81,6 +84,7 @@ private:
} // end namespace scene
} // end namespace irr
#endif // _IRR_COMPILE_WITH_PARTICLES_
#endif // __C_PARTICLE_ATTRACTION_AFFECTOR_H_INCLUDED__

View File

@ -3,6 +3,9 @@
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CParticleBoxEmitter.h"
#ifdef _IRR_COMPILE_WITH_PARTICLES_
#include "os.h"
#include "IAttributes.h"
#include "irrMath.h"
@ -186,3 +189,4 @@ void CParticleBoxEmitter::deserializeAttributes(io::IAttributes* in, io::SAttrib
} // end namespace scene
} // end namespace irr
#endif // _IRR_COMPILE_WITH_PARTICLES_

View File

@ -5,6 +5,9 @@
#ifndef __C_PARTICLE_BOX_EMITTER_H_INCLUDED__
#define __C_PARTICLE_BOX_EMITTER_H_INCLUDED__
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_PARTICLES_
#include "IParticleBoxEmitter.h"
#include "irrArray.h"
#include "aabbox3d.h"
@ -127,6 +130,7 @@ private:
} // end namespace scene
} // end namespace irr
#endif // _IRR_COMPILE_WITH_PARTICLES_
#endif

View File

@ -3,6 +3,10 @@
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CParticleCylinderEmitter.h"
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_PARTICLES_
#include "os.h"
#include "IAttributes.h"
@ -185,3 +189,5 @@ void CParticleCylinderEmitter::deserializeAttributes(io::IAttributes* in, io::SA
} // end namespace scene
} // end namespace irr
#endif // _IRR_COMPILE_WITH_PARTICLES_

View File

@ -5,6 +5,9 @@
#ifndef __C_PARTICLE_CYLINDER_EMITTER_H_INCLUDED__
#define __C_PARTICLE_CYLINDER_EMITTER_H_INCLUDED__
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_PARTICLES_
#include "IParticleCylinderEmitter.h"
#include "irrArray.h"
@ -158,6 +161,7 @@ private:
} // end namespace scene
} // end namespace irr
#endif // _IRR_COMPILE_WITH_PARTICLES_
#endif

View File

@ -3,6 +3,9 @@
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CParticleFadeOutAffector.h"
#ifdef _IRR_COMPILE_WITH_PARTICLES_
#include "IAttributes.h"
#include "os.h"
@ -68,3 +71,4 @@ void CParticleFadeOutAffector::deserializeAttributes(io::IAttributes* in, io::SA
} // end namespace scene
} // end namespace irr
#endif // _IRR_COMPILE_WITH_PARTICLES_

View File

@ -5,6 +5,9 @@
#ifndef __C_PARTICLE_FADE_OUT_AFFECTOR_H_INCLUDED__
#define __C_PARTICLE_FADE_OUT_AFFECTOR_H_INCLUDED__
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_PARTICLES_
#include "IParticleFadeOutAffector.h"
#include "SColor.h"
@ -59,5 +62,7 @@ private:
} // end namespace irr
#endif // _IRR_COMPILE_WITH_PARTICLES_
#endif

View File

@ -3,6 +3,9 @@
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CParticleGravityAffector.h"
#ifdef _IRR_COMPILE_WITH_PARTICLES_
#include "os.h"
#include "IAttributes.h"
@ -62,3 +65,4 @@ void CParticleGravityAffector::deserializeAttributes(io::IAttributes* in, io::SA
} // end namespace scene
} // end namespace irr
#endif // _IRR_COMPILE_WITH_PARTICLES_

View File

@ -5,6 +5,9 @@
#ifndef __C_PARTICLE_GRAVITY_AFFECTOR_H_INCLUDED__
#define __C_PARTICLE_GRAVITY_AFFECTOR_H_INCLUDED__
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_PARTICLES_
#include "IParticleGravityAffector.h"
#include "SColor.h"
@ -59,6 +62,7 @@ private:
} // end namespace scene
} // end namespace irr
#endif // _IRR_COMPILE_WITH_PARTICLES_
#endif

View File

@ -2,8 +2,11 @@
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include "IrrCompileConfig.h"
#include "CParticleMeshEmitter.h"
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_PARTICLES_
#include "os.h"
namespace irr
@ -188,3 +191,4 @@ void CParticleMeshEmitter::setMesh(IMesh* mesh)
} // end namespace scene
} // end namespace irr
#endif // _IRR_COMPILE_WITH_PARTICLES_

View File

@ -5,6 +5,9 @@
#ifndef __C_PARTICLE_MESH_EMITTER_H_INCLUDED__
#define __C_PARTICLE_MESH_EMITTER_H_INCLUDED__
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_PARTICLES_
#include "IParticleMeshEmitter.h"
#include "irrArray.h"
#include "aabbox3d.h"
@ -154,6 +157,7 @@ private:
} // end namespace scene
} // end namespace irr
#endif // _IRR_COMPILE_WITH_PARTICLES_
#endif // __C_PARTICLE_MESH_EMITTER_H_INCLUDED__

View File

@ -3,6 +3,9 @@
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CParticlePointEmitter.h"
#ifdef _IRR_COMPILE_WITH_PARTICLES_
#include "os.h"
#include "IAttributes.h"
@ -145,3 +148,4 @@ void CParticlePointEmitter::deserializeAttributes(io::IAttributes* in, io::SAttr
} // end namespace scene
} // end namespace irr
#endif // _IRR_COMPILE_WITH_PARTICLES_

View File

@ -5,6 +5,9 @@
#ifndef __C_PARTICLE_POINT_EMITTER_H_INCLUDED__
#define __C_PARTICLE_POINT_EMITTER_H_INCLUDED__
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_PARTICLES_
#include "IParticleEmitter.h"
#include "irrArray.h"
@ -117,6 +120,6 @@ private:
} // end namespace scene
} // end namespace irr
#endif // _IRR_COMPILE_WITH_PARTICLES_
#endif

View File

@ -3,6 +3,9 @@
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CParticleRingEmitter.h"
#ifdef _IRR_COMPILE_WITH_PARTICLES_
#include "os.h"
#include "IAttributes.h"
@ -175,3 +178,4 @@ void CParticleRingEmitter::deserializeAttributes(io::IAttributes* in, io::SAttri
} // end namespace scene
} // end namespace irr
#endif // _IRR_COMPILE_WITH_PARTICLES_

View File

@ -5,6 +5,9 @@
#ifndef __C_PARTICLE_RING_EMITTER_H_INCLUDED__
#define __C_PARTICLE_RING_EMITTER_H_INCLUDED__
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_PARTICLES_
#include "IParticleRingEmitter.h"
#include "irrArray.h"
@ -142,6 +145,7 @@ private:
} // end namespace scene
} // end namespace irr
#endif // _IRR_COMPILE_WITH_PARTICLES_
#endif

View File

@ -3,6 +3,10 @@
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CParticleRotationAffector.h"
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_PARTICLES_
#include "IAttributes.h"
namespace irr
@ -65,3 +69,4 @@ void CParticleRotationAffector::deserializeAttributes(io::IAttributes* in, io::S
} // end namespace scene
} // end namespace irr
#endif // _IRR_COMPILE_WITH_PARTICLES_

View File

@ -5,6 +5,9 @@
#ifndef __C_PARTICLE_ROTATION_AFFECTOR_H_INCLUDED__
#define __C_PARTICLE_ROTATION_AFFECTOR_H_INCLUDED__
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_PARTICLES_
#include "IParticleRotationAffector.h"
namespace irr
@ -51,6 +54,6 @@ private:
} // end namespace scene
} // end namespace irr
#endif // _IRR_COMPILE_WITH_PARTICLES_
#endif // __C_PARTICLE_ROTATION_AFFECTOR_H_INCLUDED__

View File

@ -3,6 +3,9 @@
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CParticleScaleAffector.h"
#ifdef _IRR_COMPILE_WITH_PARTICLES_
#include "IAttributes.h"
namespace irr
@ -51,3 +54,4 @@ namespace irr
}
}
#endif // _IRR_COMPILE_WITH_PARTICLES_

View File

@ -5,6 +5,9 @@
#ifndef C_PARTICLE_SCALE_AFFECTOR_H
#define C_PARTICLE_SCALE_AFFECTOR_H
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_PARTICLES_
#include "IParticleAffector.h"
namespace irr
@ -39,6 +42,7 @@ namespace irr
}
}
#endif // _IRR_COMPILE_WITH_PARTICLES_
#endif // C_PARTICLE_SCALE_AFFECTOR_H

View File

@ -2,8 +2,10 @@
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include "IrrCompileConfig.h"
#include "CParticleSphereEmitter.h"
#ifdef _IRR_COMPILE_WITH_PARTICLES_
#include "os.h"
#include "IAttributes.h"
@ -173,3 +175,4 @@ void CParticleSphereEmitter::deserializeAttributes(io::IAttributes* in, io::SAtt
} // end namespace scene
} // end namespace irr
#endif // _IRR_COMPILE_WITH_PARTICLES_

View File

@ -5,6 +5,9 @@
#ifndef __C_PARTICLE_SPHERE_EMITTER_H_INCLUDED__
#define __C_PARTICLE_SPHERE_EMITTER_H_INCLUDED__
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_PARTICLES_
#include "IParticleSphereEmitter.h"
#include "irrArray.h"
#include "aabbox3d.h"
@ -135,6 +138,7 @@ private:
} // end namespace scene
} // end namespace irr
#endif // _IRR_COMPILE_WITH_PARTICLES_
#endif

View File

@ -3,6 +3,9 @@
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CParticleSystemSceneNode.h"
#ifdef _IRR_COMPILE_WITH_PARTICLES_
#include "os.h"
#include "ISceneManager.h"
#include "ICameraSceneNode.h"
@ -780,4 +783,4 @@ void CParticleSystemSceneNode::deserializeAttributes(io::IAttributes* in, io::SA
} // end namespace scene
} // end namespace irr
#endif // _IRR_COMPILE_WITH_PARTICLES_

View File

@ -5,6 +5,9 @@
#ifndef __C_PARTICLE_SYSTEM_SCENE_NODE_H_INCLUDED__
#define __C_PARTICLE_SYSTEM_SCENE_NODE_H_INCLUDED__
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_PARTICLES_
#include "IParticleSystemSceneNode.h"
#include "irrArray.h"
#include "irrList.h"
@ -240,6 +243,7 @@ private:
} // end namespace scene
} // end namespace irr
#endif // _IRR_COMPILE_WITH_PARTICLES_
#endif

View File

@ -148,7 +148,11 @@
#include "CMeshSceneNode.h"
#include "CSkyBoxSceneNode.h"
#include "CSkyDomeSceneNode.h"
#ifdef _IRR_COMPILE_WITH_PARTICLES_
#include "CParticleSystemSceneNode.h"
#endif // _IRR_COMPILE_WITH_PARTICLES_
#include "CDummyTransformationSceneNode.h"
#include "CWaterSurfaceSceneNode.h"
#include "CTerrainSceneNode.h"
@ -848,6 +852,7 @@ IParticleSystemSceneNode* CSceneManager::addParticleSystemSceneNode(
const core::vector3df& position, const core::vector3df& rotation,
const core::vector3df& scale)
{
#ifdef _IRR_COMPILE_WITH_PARTICLES_
if (!parent)
parent = this;
@ -856,6 +861,9 @@ IParticleSystemSceneNode* CSceneManager::addParticleSystemSceneNode(
node->drop();
return node;
#else
return 0;
#endif // _IRR_COMPILE_WITH_PARTICLES_
}

View File

@ -37,34 +37,34 @@ public:
virtual ~IAttribute() {};
virtual s32 getInt() { return 0; }
virtual f32 getFloat() { return 0; }
virtual video::SColorf getColorf() { return video::SColorf(1.0f,1.0f,1.0f,1.0f); }
virtual video::SColor getColor() { return video::SColor(255,255,255,255); }
virtual core::stringc getString() { return core::stringc(getStringW().c_str()); }
virtual core::stringw getStringW() { return core::stringw(); }
virtual core::array<core::stringw> getArray() { return core::array<core::stringw>(); };
virtual bool getBool() { return false; }
virtual void getBinary(void* outdata, s32 maxLength) {};
virtual core::vector3df getVector() { return core::vector3df(); }
virtual core::position2di getPosition() { return core::position2di(); }
virtual core::rect<s32> getRect() { return core::rect<s32>(); }
virtual core::quaternion getQuaternion(){ return core::quaternion(); }
virtual core::matrix4 getMatrix() { return core::matrix4(); }
virtual core::triangle3df getTriangle() { return core::triangle3df(); }
virtual core::vector2df getVector2d() { return core::vector2df(); }
virtual core::vector2di getVector2di() { return core::vector2di(); }
virtual core::line2df getLine2d() { return core::line2df(); }
virtual core::line2di getLine2di() { return core::line2di(); }
virtual core::line3df getLine3d() { return core::line3df(); }
virtual core::line3di getLine3di() { return core::line3di(); }
virtual core::dimension2du getDimension2d() { return core::dimension2du(); }
virtual core::aabbox3d<f32> getBBox() { return core::aabbox3d<f32>(); }
virtual core::plane3df getPlane() { return core::plane3df(); }
virtual s32 getInt() const { return 0; }
virtual f32 getFloat() const { return 0; }
virtual video::SColorf getColorf() const { return video::SColorf(1.0f,1.0f,1.0f,1.0f); }
virtual video::SColor getColor() const { return video::SColor(255,255,255,255); }
virtual core::stringc getString() const { return core::stringc(getStringW().c_str()); }
virtual core::stringw getStringW() const { return core::stringw(); }
virtual core::array<core::stringw> getArray() const { return core::array<core::stringw>(); };
virtual bool getBool() const { return false; }
virtual void getBinary(void* outdata, s32 maxLength) const {};
virtual core::vector3df getVector() const { return core::vector3df(); }
virtual core::position2di getPosition() const { return core::position2di(); }
virtual core::rect<s32> getRect() const { return core::rect<s32>(); }
virtual core::quaternion getQuaternion() const { return core::quaternion(); }
virtual core::matrix4 getMatrix() const { return core::matrix4(); }
virtual core::triangle3df getTriangle() const { return core::triangle3df(); }
virtual core::vector2df getVector2d() const { return core::vector2df(); }
virtual core::vector2di getVector2di() const { return core::vector2di(); }
virtual core::line2df getLine2d() const { return core::line2df(); }
virtual core::line2di getLine2di() const { return core::line2di(); }
virtual core::line3df getLine3d() const { return core::line3df(); }
virtual core::line3di getLine3di() const { return core::line3di(); }
virtual core::dimension2du getDimension2d() const { return core::dimension2du(); }
virtual core::aabbox3d<f32> getBBox() const { return core::aabbox3d<f32>(); }
virtual core::plane3df getPlane() const { return core::plane3df(); }
virtual video::ITexture* getTexture() { return 0; }
virtual const char* getEnum() { return 0; }
virtual void* getUserPointer() { return 0; }
virtual video::ITexture* getTexture() const { return 0; }
virtual const char* getEnum() const { return 0; }
virtual void* getUserPointer() const { return 0; }
virtual void setInt(s32 intValue) {};
virtual void setFloat(f32 floatValue) {};

View File

@ -42,6 +42,17 @@ CGUIEditWorkspace::CGUIEditWorkspace(IGUIEnvironment* environment, s32 id, IGUIE
// it resizes to fit a resizing window
setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT);
// Types which we currently can't handle in editor
// Most of them also just don't make sense in here (like Dialogs)
// TODO: We should have a way to create context-menus
UnusableElementTypeFilter.push_back(EGUIET_CONTEXT_MENU);
UnusableElementTypeFilter.push_back(EGUIET_FILE_OPEN_DIALOG);
UnusableElementTypeFilter.push_back(EGUIET_COLOR_SELECT_DIALOG);
UnusableElementTypeFilter.push_back(EGUIET_MESSAGE_BOX);
UnusableElementTypeFilter.push_back(EGUIET_MODAL_SCREEN);
UnusableElementTypeFilter.push_back(EGUIET_ELEMENT); // wouldn't do anything, so don't show in menu
UnusableElementTypeFilter.push_back(EGUIET_ROOT); // wouldn't do anything, so don't show in menu
EditorWindow = (CGUIEditWindow*) Environment->addGUIElement("GUIEditWindow", this);
if (EditorWindow)
{
@ -422,7 +433,9 @@ bool CGUIEditWorkspace::OnEvent(const SEvent &e)
for (j=0; j< f->getCreatableGUIElementTypeCount(); ++j)
{
sub2->addItem(core::stringw(f->getCreateableGUIElementTypeName(j)).c_str(), MenuCommandStart + EGUIEDMC_COUNT + c);
EGUI_ELEMENT_TYPE type = f->getCreateableGUIElementType(j);
if ( UnusableElementTypeFilter.linear_search(type) < 0 )
sub2->addItem(core::stringw(f->getCreateableGUIElementTypeName(j)).c_str(), MenuCommandStart + EGUIEDMC_COUNT + c);
c++;
}

View File

@ -158,6 +158,9 @@ namespace gui
core::rect<s32> RRect;
core::rect<s32> BRRect;
core::rect<s32> BRect;
//! Some gui-elements can't be created in this editor
core::array<EGUI_ELEMENT_TYPE> UnusableElementTypeFilter;
};