mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-13 21:31:53 +00:00
AGS: Implement ags_file_exists for save files
This commit is contained in:
parent
321d4aa705
commit
34f4cf5ffc
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user