[Scummvm-devel] SaveLoadChooser.PageDisplay vs lowres themes

Marcus Comstedt marcus at mc.pp.se
Sat Jan 11 16:40:35 CET 2014


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 :) ?


  // Marcus






More information about the Scummvm-devel mailing list