diff options
author | Eugene Sandulenko | 2006-03-24 01:45:03 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2006-03-24 01:45:03 +0000 |
commit | dabcc4cc9b17f1ba32818108720d62195ad647da (patch) | |
tree | de1dbe74ebaa07144e6e3b794b3dbfb1f26ae99d /gui | |
parent | a9b174abb3a8236272ad7ba68c4364b85e0a8063 (diff) | |
download | scummvm-rg350-dabcc4cc9b17f1ba32818108720d62195ad647da.tar.gz scummvm-rg350-dabcc4cc9b17f1ba32818108720d62195ad647da.tar.bz2 scummvm-rg350-dabcc4cc9b17f1ba32818108720d62195ad647da.zip |
Check values loaded from theme INI and give meaningful errors instead of
bad crashes on blitting stage.
svn-id: r21422
Diffstat (limited to 'gui')
-rw-r--r-- | gui/newgui.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gui/newgui.cpp b/gui/newgui.cpp index 67cffab6df..d1000a20d5 100644 --- a/gui/newgui.cpp +++ b/gui/newgui.cpp @@ -65,6 +65,19 @@ GuiObject::GuiObject(Common::String name) : _firstWidget(0) { _w = g_gui.evaluator()->getVar(name + ".w"); _h = g_gui.evaluator()->getVar(name + ".h"); + if(_x < 0) + error("Widget <%s> has x < 0", name.c_str()); + if(_x >= g_system->getOverlayWidth()) + error("Widget <%s> has x > %d", name.c_str(), g_system->getOverlayWidth()); + if(_x + _w >= g_system->getOverlayWidth()) + error("Widget <%s> has x + w > %d", name.c_str(), g_system->getOverlayWidth()); + if(_y < 0) + error("Widget <%s> has y < 0", name.c_str()); + if(_y >= g_system->getOverlayWidth()) + error("Widget <%s> has y > %d", name.c_str(), g_system->getOverlayHeight()); + if(_y + _h >= g_system->getOverlayWidth()) + error("Widget <%s> has y + h > %d", name.c_str(), g_system->getOverlayHeight()); + _name = name; } |