[Scummvm-git-logs] scummvm master -> d450abb40bf63bdd78411167505fb7fbc070dcc6
dreammaster
dreammaster at scummvm.org
Sat Aug 21 03:37:10 UTC 2021
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
34f4cf5ffc AGS: Implement ags_file_exists for save files
d450abb40b AGS: Properly destroy platform driver on exit
Commit: 34f4cf5ffc5e70e15a0869b2a7cf77d19fcba357
https://github.com/scummvm/scummvm/commit/34f4cf5ffc5e70e15a0869b2a7cf77d19fcba357
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-08-20T19:44:55-07:00
Commit Message:
AGS: Implement ags_file_exists for save files
Changed paths:
engines/ags/shared/util/stdio_compat.cpp
diff --git a/engines/ags/shared/util/stdio_compat.cpp b/engines/ags/shared/util/stdio_compat.cpp
index 32e28fa3ee..9db0c0c297 100644
--- a/engines/ags/shared/util/stdio_compat.cpp
+++ b/engines/ags/shared/util/stdio_compat.cpp
@@ -102,8 +102,19 @@ Common::FSNode getFSNode(const char *path) {
}
int ags_file_exists(const char *path) {
- Common::FSNode node = getFSNode(path);
- return node.exists() && !node.isDirectory() ? 1 : 0;
+ Common::String sPath(path);
+
+ if (sPath.hasPrefix(AGS::Shared::SAVE_FOLDER_PREFIX)) {
+ sPath = path + strlen(AGS::Shared::SAVE_FOLDER_PREFIX);
+ Common::InSaveFile *saveFile = g_system->getSavefileManager()->openForLoading(sPath);
+ bool result = saveFile != nullptr;
+ delete saveFile;
+
+ return result ? 1 : 0;
+ } else {
+ Common::FSNode node = getFSNode(path);
+ return node.exists() && !node.isDirectory() ? 1 : 0;
+ }
}
int ags_directory_exists(const char *path) {
Commit: d450abb40bf63bdd78411167505fb7fbc070dcc6
https://github.com/scummvm/scummvm/commit/d450abb40bf63bdd78411167505fb7fbc070dcc6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-08-20T20:36:55-07:00
Commit Message:
AGS: Properly destroy platform driver on exit
Changed paths:
engines/ags/engine/platform/scummvm/scummvm_platform_driver.cpp
engines/ags/globals.cpp
diff --git a/engines/ags/engine/platform/scummvm/scummvm_platform_driver.cpp b/engines/ags/engine/platform/scummvm/scummvm_platform_driver.cpp
index 437788b8ed..d5cb554963 100644
--- a/engines/ags/engine/platform/scummvm/scummvm_platform_driver.cpp
+++ b/engines/ags/engine/platform/scummvm/scummvm_platform_driver.cpp
@@ -37,6 +37,8 @@ namespace AGS3 {
using AGS::Shared::String;
struct ScummVMPlatformDriver : AGSPlatformDriver {
+ virtual ~ScummVMPlatformDriver() {}
+
int CDPlayerCommand(int cmdd, int datt) override;
void DisplayAlert(const char *, ...) override;
const char *GetAllUsersDataDirectory() override;
diff --git a/engines/ags/globals.cpp b/engines/ags/globals.cpp
index 7c8e62725b..6ea6b299f6 100644
--- a/engines/ags/globals.cpp
+++ b/engines/ags/globals.cpp
@@ -87,6 +87,7 @@
#include "ags/engine/main/graphics_mode.h"
#include "ags/engine/media/audio/ambient_sound.h"
#include "ags/engine/media/audio/audio_defines.h"
+#include "ags/engine/platform/base/ags_platform_driver.h"
#include "ags/engine/script/cc_instance.h"
#include "ags/engine/script/executing_script.h"
#include "ags/engine/script/non_blocking_script_function.h"
@@ -359,6 +360,9 @@ Globals::Globals() {
Globals::~Globals() {
g_globals = nullptr;
+ // ags_platform_driver.cpp globals
+ delete _platform;
+
// ags_plugin.cpp globals
delete _glVirtualScreenWrap;
More information about the Scummvm-git-logs
mailing list