aboutsummaryrefslogtreecommitdiff
path: root/gui/newgui.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2006-03-24 01:45:03 +0000
committerEugene Sandulenko2006-03-24 01:45:03 +0000
commitdabcc4cc9b17f1ba32818108720d62195ad647da (patch)
treede1dbe74ebaa07144e6e3b794b3dbfb1f26ae99d /gui/newgui.cpp
parenta9b174abb3a8236272ad7ba68c4364b85e0a8063 (diff)
downloadscummvm-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/newgui.cpp')
-rw-r--r--gui/newgui.cpp13
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;
}