[Scummvm-devel] SaveLoadChooser.PageDisplay vs lowres themes
Johannes Schickel
lordhoto at gmail.com
Sat Jan 11 16:54:07 CET 2014
On 01/11/2014 04:40 PM, Marcus Comstedt wrote:
> Hi guys.
>
> There's some code in saveload-dialog.cpp which says
>
> | void SaveLoadChooserGrid::reflowLayout() {
> | // HACK: The page display is not available in low resolution layout. We
> | // remove and readd the widget here to avoid our GUI from erroring out.
> | removeWidget(_pageDisplay);
> | if (g_gui.xmlEval()->getVar("Globals.ShowChooserPageDisplay") == 1) {
> | _pageDisplay->init();
> | }
>
> Ok, fine, _except_ that the GUI will have already errored out in the
> constructor of SaveLoadChooserGrid, which (unconditionally) does
>
> | // Page display
> | _pageDisplay = new StaticTextWidget(this, "SaveLoadChooser.PageDisplay", Common::String());
>
> The constructor of GuiObject (which StaticTextWidget is a subclass of)
> calls reflowLayout(), which bombs:
>
> | Breakpoint 1, GUI::GuiObject::reflowLayout (this=0x10474978)
> | at ../gui/object.cpp:44
> | 44 error("Could not load widget position for '%s'", _name.c_str());
> | (gdb) bt
> | #0 GUI::GuiObject::reflowLayout (this=0x10474978) at ../gui/object.cpp:44
> | #1 0x10176164 in GUI::GuiObject::GuiObject (this=0x10474978, name=...)
> | at ../gui/object.cpp:33
> | #2 0x101ad8c8 in GUI::Widget::Widget (this=0x10474978, boss=0x1046dd08,
> | name=..., tooltip=0x0) at ../gui/widget.cpp:45
> | #3 0x101ae960 in GUI::StaticTextWidget::StaticTextWidget (this=0x10474978,
> | boss=0x1046dd08, name=..., text=..., tooltip=0x0) at ../gui/widget.cpp:239
> | #4 0x101870a0 in GUI::SaveLoadChooserGrid::SaveLoadChooserGrid (
> | this=0x1046dd08, title=..., saveMode=false)
> | at ../gui/saveload-dialog.cpp:554
> [...]
>
> So currently Load/Save does not work on any device with a lores
> overlay.
>
> Any takers for fixing this in a less hackish way (or at least as a
> hack that actually works :) ?
>
I think the issue is that it actually tries to construct the grid based
chooser which only works in non-lowres mode
(SaveLoadChooser::selectChooser and getRequestedSaveLoadDialog should
prevent that). The hack only makes sure that when you switch from hires
to lowres ScummVM does not crash.
I cannot reproduce how this chooser is opened in lowres mode for you (on
desktop with -g1x). Do you have any instructions for that?
// Johannes
More information about the Scummvm-devel
mailing list