mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-05 00:36:57 +00:00
GUI: FIx dialog dumping to PNG
This commit is contained in:
parent
80df0fab4f
commit
3ff0d353be
@ -92,10 +92,10 @@ public:
|
||||
virtual void lostFocus();
|
||||
virtual void receivedFocus(int x = -1, int y = -1) { if (x >= 0 && y >= 0) handleMouseMoved(x, y, 0); }
|
||||
|
||||
protected:
|
||||
virtual void open();
|
||||
virtual void close();
|
||||
|
||||
protected:
|
||||
/** Recursively mark all the widgets in this dialog as dirty so they are redrawn */
|
||||
void markWidgetsAsDirty();
|
||||
|
||||
|
@ -44,6 +44,8 @@ void saveGUISnapshot(Graphics::Surface surf, const Common::String &filename) {
|
||||
Image::writePNG(outFile, surf);
|
||||
outFile.finalize();
|
||||
outFile.close();
|
||||
|
||||
warning("Dumped %s", filename.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@ -65,15 +67,16 @@ void dumpDialogs(const Common::String &message, int res, const Common::String &l
|
||||
|
||||
// MessageDialog
|
||||
GUI::MessageDialog messageDialog(message);
|
||||
messageDialog.runModal(); // For rendering
|
||||
messageDialog.open(); // For rendering
|
||||
messageDialog.reflowLayout(); // For updating surface
|
||||
g_gui.redrawFull();
|
||||
g_system->grabOverlay(surf);
|
||||
saveGUISnapshot(surf, "message-" + filename);
|
||||
messageDialog.close();
|
||||
|
||||
// AboutDialog
|
||||
GUI::AboutDialog aboutDialog;
|
||||
aboutDialog.runModal(); // For rendering
|
||||
aboutDialog.open(); // For rendering
|
||||
aboutDialog.reflowLayout(); // For updating surface
|
||||
g_gui.redrawFull();
|
||||
g_system->grabOverlay(surf);
|
||||
@ -81,11 +84,14 @@ void dumpDialogs(const Common::String &message, int res, const Common::String &l
|
||||
aboutDialog.close();
|
||||
|
||||
// LauncherDialog
|
||||
#if 0
|
||||
GUI::LauncherChooser chooser;
|
||||
chooser.selectLauncher();
|
||||
chooser.runModal();
|
||||
chooser.open();
|
||||
g_system->grabOverlay(surf);
|
||||
saveGUISnapshot(surf, "launcher-" + filename);
|
||||
chooser.close();
|
||||
#endif
|
||||
}
|
||||
|
||||
void dumpAllDialogs(const Common::String &message) {
|
||||
|
Loading…
Reference in New Issue
Block a user