aboutsummaryrefslogtreecommitdiff
path: root/gui/saveload.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/saveload.cpp')
-rw-r--r--gui/saveload.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/gui/saveload.cpp b/gui/saveload.cpp
index e0e6d6187e..becc3f6b4f 100644
--- a/gui/saveload.cpp
+++ b/gui/saveload.cpp
@@ -24,13 +24,14 @@
#include "gui/saveload.h"
#include "gui/saveload-dialog.h"
+#include "gui/gui-manager.h"
#include "engines/metaengine.h"
namespace GUI {
-SaveLoadChooser::SaveLoadChooser(const String &title, const String &buttonLabel, bool saveMode) {
- _impl = new SaveLoadChooserSimple(title, buttonLabel, saveMode);
+SaveLoadChooser::SaveLoadChooser(const String &title, const String &buttonLabel, bool saveMode)
+ : _impl(0), _title(title), _buttonLabel(buttonLabel), _saveMode(saveMode) {
}
SaveLoadChooser::~SaveLoadChooser() {
@@ -38,6 +39,19 @@ SaveLoadChooser::~SaveLoadChooser() {
_impl = 0;
}
+void SaveLoadChooser::selectChooser(const MetaEngine &engine) {
+ delete _impl;
+ _impl = 0;
+
+ if (!_saveMode && g_gui.getWidth() > 320 && g_gui.getHeight() > 200
+ && engine.hasFeature(MetaEngine::kSavesSupportMetaInfo)
+ && engine.hasFeature(MetaEngine::kSavesSupportThumbnail)) {
+ _impl = new LoadChooserThumbnailed(_title);
+ } else {
+ _impl = new SaveLoadChooserSimple(_title, _buttonLabel, _saveMode);
+ }
+}
+
Common::String SaveLoadChooser::createDefaultSaveDescription(const int slot) const {
#if defined(USE_SAVEGAME_TIMESTAMP)
TimeDate curTime;
@@ -51,9 +65,6 @@ Common::String SaveLoadChooser::createDefaultSaveDescription(const int slot) con
}
int SaveLoadChooser::runModalWithCurrentTarget() {
- if (!_impl)
- return -1;
-
const Common::String gameId = ConfMan.get("gameid");
const EnginePlugin *plugin = 0;
@@ -63,6 +74,7 @@ int SaveLoadChooser::runModalWithCurrentTarget() {
}
int SaveLoadChooser::runModalWithPluginAndTarget(const EnginePlugin *plugin, const String &target) {
+ selectChooser(**plugin);
if (!_impl)
return -1;