mirror of
https://github.com/minetest/irrlicht.git
synced 2025-07-01 15:50:27 +02:00
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:
@ -101,6 +101,8 @@ CGUIEnvironment::CGUIEnvironment(io::IFileSystem* fs, video::IVideoDriver* drive
|
||||
//! destructor
|
||||
CGUIEnvironment::~CGUIEnvironment()
|
||||
{
|
||||
clearDeletionQueue();
|
||||
|
||||
if ( HoveredNoSubelement && HoveredNoSubelement != this )
|
||||
{
|
||||
HoveredNoSubelement->drop();
|
||||
@ -191,19 +193,18 @@ void CGUIEnvironment::loadBuiltInFont()
|
||||
|
||||
|
||||
//! draws all gui elements
|
||||
void CGUIEnvironment::drawAll()
|
||||
void CGUIEnvironment::drawAll(bool useScreenSize)
|
||||
{
|
||||
if (Driver)
|
||||
if (useScreenSize && Driver)
|
||||
{
|
||||
core::dimension2d<s32> dim(Driver->getScreenSize());
|
||||
if (AbsoluteRect.LowerRightCorner.X != dim.Width ||
|
||||
AbsoluteRect.LowerRightCorner.Y != dim.Height)
|
||||
AbsoluteRect.UpperLeftCorner.X != 0 ||
|
||||
AbsoluteRect.LowerRightCorner.Y != dim.Height ||
|
||||
AbsoluteRect.UpperLeftCorner.Y != 0
|
||||
)
|
||||
{
|
||||
// resize gui environment
|
||||
DesiredRect.LowerRightCorner = dim;
|
||||
AbsoluteClippingRect = DesiredRect;
|
||||
AbsoluteRect = DesiredRect;
|
||||
updateAbsolutePosition();
|
||||
setRelativePosition(core::recti(0,0,dim.Width, dim.Height));
|
||||
}
|
||||
}
|
||||
|
||||
@ -213,6 +214,8 @@ void CGUIEnvironment::drawAll()
|
||||
|
||||
draw();
|
||||
OnPostRender ( os::Timer::getTime () );
|
||||
|
||||
clearDeletionQueue();
|
||||
}
|
||||
|
||||
|
||||
@ -471,6 +474,28 @@ void CGUIEnvironment::OnPostRender( u32 time )
|
||||
IGUIElement::OnPostRender ( time );
|
||||
}
|
||||
|
||||
void CGUIEnvironment::addToDeletionQueue(IGUIElement* element)
|
||||
{
|
||||
if (!element)
|
||||
return;
|
||||
|
||||
element->grab();
|
||||
DeletionQueue.push_back(element);
|
||||
}
|
||||
|
||||
void CGUIEnvironment::clearDeletionQueue()
|
||||
{
|
||||
if (DeletionQueue.empty())
|
||||
return;
|
||||
|
||||
for (u32 i=0; i<DeletionQueue.size(); ++i)
|
||||
{
|
||||
DeletionQueue[i]->remove();
|
||||
DeletionQueue[i]->drop();
|
||||
}
|
||||
|
||||
DeletionQueue.clear();
|
||||
}
|
||||
|
||||
//
|
||||
void CGUIEnvironment::updateHoveredElement(core::position2d<s32> mousePos)
|
||||
|
Reference in New Issue
Block a user