[Scummvm-cvs-logs] SF.net SVN: scummvm:[48248] scummvm/trunk/gui
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Sat Mar 13 00:02:40 CET 2010
Revision: 48248
http://scummvm.svn.sourceforge.net/scummvm/?rev=48248&view=rev
Author: fingolfin
Date: 2010-03-12 23:02:24 +0000 (Fri, 12 Mar 2010)
Log Message:
-----------
Fix from LordHoto for bug #2859401: GUI: GMM crashes when running in 320x200 and 320x240
Modified Paths:
--------------
scummvm/trunk/gui/GuiManager.cpp
scummvm/trunk/gui/GuiManager.h
scummvm/trunk/gui/object.cpp
Modified: scummvm/trunk/gui/GuiManager.cpp
===================================================================
--- scummvm/trunk/gui/GuiManager.cpp 2010-03-12 22:37:08 UTC (rev 48247)
+++ scummvm/trunk/gui/GuiManager.cpp 2010-03-12 23:02:24 UTC (rev 48248)
@@ -54,6 +54,8 @@
_system = g_system;
_lastScreenChangeID = _system->getScreenChangeID();
+ _width = _system->getOverlayWidth();
+ _height = _system->getOverlayHeight();
// Clear the cursor
memset(_cursor, 0xFF, sizeof(_cursor));
@@ -448,6 +450,8 @@
void GuiManager::screenChange() {
_lastScreenChangeID = _system->getScreenChangeID();
+ _width = _system->getOverlayWidth();
+ _height = _system->getOverlayHeight();
// reinit the whole theme
_theme->refresh();
Modified: scummvm/trunk/gui/GuiManager.h
===================================================================
--- scummvm/trunk/gui/GuiManager.h 2010-03-12 22:37:08 UTC (rev 48247)
+++ scummvm/trunk/gui/GuiManager.h 2010-03-12 23:02:24 UTC (rev 48248)
@@ -76,6 +76,9 @@
ThemeEval *xmlEval() { return _theme->getEvaluator(); }
+ int getWidth() const { return _width; }
+ int getHeight() const { return _height; }
+
const Graphics::Font &getFont(ThemeEngine::FontStyle style = ThemeEngine::kFontStyleBold) const { return *(_theme->getFont(style)); }
int getFontHeight(ThemeEngine::FontStyle style = ThemeEngine::kFontStyleBold) const { return _theme->getFontHeight(style); }
int getStringWidth(const Common::String &str, ThemeEngine::FontStyle style = ThemeEngine::kFontStyleBold) const { return _theme->getStringWidth(str, style); }
@@ -104,6 +107,7 @@
// bool _needRedraw;
RedrawStatus _redrawStatus;
int _lastScreenChangeID;
+ int _width, _height;
DialogStack _dialogStack;
bool _stateIsSaved;
Modified: scummvm/trunk/gui/object.cpp
===================================================================
--- scummvm/trunk/gui/object.cpp 2010-03-12 22:37:08 UTC (rev 48247)
+++ scummvm/trunk/gui/object.cpp 2010-03-12 23:02:24 UTC (rev 48248)
@@ -48,16 +48,16 @@
if (_x < 0)
error("Widget <%s> has x < 0 (%d)", _name.c_str(), _x);
- if (_x >= g_system->getOverlayWidth())
- error("Widget <%s> has x > %d (%d)", _name.c_str(), g_system->getOverlayWidth(), _x);
- if (_x + _w > g_system->getOverlayWidth())
- error("Widget <%s> has x + w > %d (%d)", _name.c_str(), g_system->getOverlayWidth(), _x + _w);
+ if (_x >= g_gui.getWidth())
+ error("Widget <%s> has x > %d (%d)", _name.c_str(), g_gui.getWidth(), _x);
+ if (_x + _w > g_gui.getWidth())
+ error("Widget <%s> has x + w > %d (%d)", _name.c_str(), g_gui.getWidth(), _x + _w);
if (_y < 0)
error("Widget <%s> has y < 0 (%d)", _name.c_str(), _y);
- if (_y >= g_system->getOverlayHeight())
- error("Widget <%s> has y > %d (%d)", _name.c_str(), g_system->getOverlayHeight(), _y);
- if (_y + _h > g_system->getOverlayHeight())
- error("Widget <%s> has y + h > %d (%d)", _name.c_str(), g_system->getOverlayHeight(), _y + _h);
+ if (_y >= g_gui.getHeight())
+ error("Widget <%s> has y > %d (%d)", _name.c_str(), g_gui.getHeight(), _y);
+ if (_y + _h > g_gui.getHeight())
+ error("Widget <%s> has y + h > %d (%d)", _name.c_str(), g_gui.getHeight(), _y + _h);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list