Merging r6145 through r6171 from trunk to ogl-es branch

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@6172 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
cutealien
2020-12-19 15:03:11 +00:00
parent 01920bf808
commit fa0b1cb509
117 changed files with 8063 additions and 6758 deletions

View File

@ -26,23 +26,23 @@ namespace scene
//! Get the material of this meshbuffer
/** \return Material of this buffer. */
virtual video::SMaterial& getMaterial() =0;
virtual video::SMaterial& getMaterial() _IRR_OVERRIDE_ =0;
//! Get the material of this meshbuffer
/** \return Material of this buffer. */
virtual const video::SMaterial& getMaterial() const =0;
virtual const video::SMaterial& getMaterial() const _IRR_OVERRIDE_ =0;
//! Get the axis aligned bounding box of this meshbuffer.
/** \return Axis aligned bounding box of this buffer. */
virtual const core::aabbox3df& getBoundingBox() const =0;
virtual const core::aabbox3df& getBoundingBox() const _IRR_OVERRIDE_ =0;
//! Set axis aligned bounding box
/** \param box User defined axis aligned bounding box to use
for this buffer. */
virtual void setBoundingBox(const core::aabbox3df& box) =0;
virtual void setBoundingBox(const core::aabbox3df& box) _IRR_OVERRIDE_ =0;
//! Recalculates the bounding box. Should be called if the mesh changed.
virtual void recalculateBoundingBox() =0;
virtual void recalculateBoundingBox() _IRR_OVERRIDE_ =0;
//! Append the vertices and indices to the current buffer
/** Only works for compatible vertex types.

View File

@ -139,6 +139,10 @@ namespace gui
/** \return: The override color */
virtual video::SColor getOverrideColor(void) const = 0;
//! Gets the currently used text color
/** Either a skin-color for the current state or the override color */
virtual video::SColor getActiveColor() const = 0;
//! Sets if the button text should use the override color or the color in the gui skin.
/** \param enable: If set to true, the override color, which can be set
with IGUIStaticText::setOverrideColor is used, otherwise the

View File

@ -74,7 +74,9 @@ class IGUIEnvironment : public virtual IReferenceCounted
public:
//! Draws all gui elements by traversing the GUI environment starting at the root node.
virtual void drawAll() = 0;
/** \param When true ensure the GuiEnvironment (aka the RootGUIElement) has the same size as the current driver screensize.
Can be set to false to control that size yourself, p.E when not the full size should be used for UI. */
virtual void drawAll(bool useScreenSize=true) = 0;
//! Sets the focus to an element.
/** Causes a EGET_ELEMENT_FOCUS_LOST event followed by a
@ -621,10 +623,10 @@ public:
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0)=0;
//! writes an element
virtual void writeGUIElement(io::IXMLWriter* writer, IGUIElement* node) =0;
virtual void writeGUIElement(io::IXMLWriter* writer, IGUIElement* element) =0;
//! reads an element
virtual void readGUIElement(io::IXMLReader* reader, IGUIElement* node) =0;
virtual void readGUIElement(io::IXMLReader* reader, IGUIElement* element) =0;
//! Find the next element which would be selected when pressing the tab-key
/** If you set the focus for the result you can manually force focus-changes like they
@ -644,6 +646,17 @@ public:
//! Get the way the gui does handle focus changes
/** \returns A bitmask which is a combination of ::EFOCUS_FLAG flags.*/
virtual u32 getFocusBehavior() const = 0;
//! Adds a IGUIElement to deletion queue.
/** Queued elements will be removed at the end of each drawAll call.
Or latest in the destructor of the GUIEnvironment.
This can be used to allow an element removing itself safely in a function
iterating over gui elements, like an overloaded IGUIElement::draw or
IGUIElement::OnPostRender function.
Note that in general just calling IGUIElement::remove() is enough.
Unless you create your own GUI elements removing themselves you won't need it.
\param element: Element to remove */
virtual void addToDeletionQueue(IGUIElement* element) = 0;
};

View File

@ -51,6 +51,10 @@ namespace gui
/** \return: The override color */
virtual video::SColor getOverrideColor(void) const = 0;
//! Gets the currently used text color
/** Either a skin-color for the current state or the override color */
virtual video::SColor getActiveColor() const = 0;
//! Sets if the static text should use the override color or the color in the gui skin.
/** \param enable: If set to true, the override color, which can be set
with IGUIStaticText::setOverrideColor is used, otherwise the

View File

@ -29,6 +29,9 @@ public:
//! constructor
IImage(ECOLOR_FORMAT format, const core::dimension2d<u32>& size, bool deleteMemory) :
Format(format), Size(size), Data(0), MipMapsData(0), BytesPerPixel(0), Pitch(0), DeleteMemory(deleteMemory), DeleteMipMapsMemory(false)
#if defined(IRRLICHT_sRGB)
,Format_sRGB(1)
#endif
{
BytesPerPixel = getBitsPerPixelFromFormat(Format) / 8;
Pitch = BytesPerPixel * Size.Width;
@ -50,6 +53,18 @@ public:
return Format;
}
#if defined(IRRLICHT_sRGB)
//! Texture is linear/sRGB (should be part of ColorFormat: default yes)
int get_sRGB() const
{
return Format_sRGB;
}
void set_sRGB(int val)
{
Format_sRGB = val;
}
#endif
//! Returns width and height of image data.
const core::dimension2d<u32>& getDimension() const
{
@ -534,6 +549,22 @@ public:
return false;
}
#if defined(PATCH_SUPERTUX_8_0_1_with_1_9_0)
static bool isRenderTargetOnlyFormat(const ECOLOR_FORMAT format)
{
switch (format)
{
case ECF_A1R5G5B5:
case ECF_R5G6B5:
case ECF_R8G8B8:
case ECF_A8R8G8B8:
return false;
default:
return true;
}
}
#endif
protected:
ECOLOR_FORMAT Format;
core::dimension2d<u32> Size;
@ -548,8 +579,12 @@ protected:
bool DeleteMipMapsMemory;
core::irrAllocator<u8> Allocator;
#if defined(IRRLICHT_sRGB)
int Format_sRGB;
#endif
};
} // end namespace video
} // end namespace irr