mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-22 01:57:16 +00:00
640x480 toolbar fixes, don't draw an invisible toolbar
svn-id: r12644
This commit is contained in:
parent
4793b48326
commit
2ff396d7e8
@ -43,7 +43,7 @@ namespace CEGUI {
|
||||
|
||||
bool Panel::draw(SDL_Surface *surface) {
|
||||
ItemMap::ConstIterator iterator;
|
||||
if (!_drawn) {
|
||||
if (!_drawn && _visible) {
|
||||
GUIElement::draw(surface);
|
||||
for (iterator = _itemsMap.begin(); iterator != _itemsMap.end(); ++iterator) {
|
||||
((GUIElement*)(iterator->_value))->draw(surface);
|
||||
|
@ -24,12 +24,12 @@
|
||||
|
||||
namespace CEGUI {
|
||||
|
||||
// FIXME (could be game dependant)
|
||||
Toolbar::Toolbar() : GUIElement(0, 200, 320, 40)
|
||||
// Not to be drawn on game screen !
|
||||
Toolbar::Toolbar() : GUIElement(0, 0, 320, 40)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Toolbar::~Toolbar() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -58,8 +58,13 @@ namespace CEGUI {
|
||||
}
|
||||
|
||||
bool ToolbarHandler::action(int x, int y, bool pushed) {
|
||||
if (_active)
|
||||
return _active->action(x, y, pushed);
|
||||
if (_active) {
|
||||
// FIXME !
|
||||
if (_offset > 240)
|
||||
return _active->action(x / 2, (y - _offset) / 2, pushed);
|
||||
else
|
||||
return _active->action(x, y - _offset, pushed);
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
@ -103,6 +108,14 @@ namespace CEGUI {
|
||||
return false;
|
||||
}
|
||||
|
||||
void ToolbarHandler::setOffset(int offset) {
|
||||
_offset = offset;
|
||||
}
|
||||
|
||||
int ToolbarHandler::getOffset() {
|
||||
return _offset;
|
||||
}
|
||||
|
||||
Toolbar* ToolbarHandler::active() {
|
||||
return _active;
|
||||
}
|
||||
|
@ -45,6 +45,8 @@ namespace CEGUI {
|
||||
bool visible();
|
||||
String activeName();
|
||||
void forceRedraw();
|
||||
void setOffset(int offset);
|
||||
int getOffset();
|
||||
bool draw(SDL_Surface *surface, SDL_Rect *rect);
|
||||
bool drawn();
|
||||
Toolbar *active();
|
||||
@ -59,6 +61,7 @@ namespace CEGUI {
|
||||
Map<String, Toolbar*, IgnoreCaseComparator> _toolbarMap;
|
||||
String _current;
|
||||
Toolbar *_active;
|
||||
int _offset;
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user