[Scummvm-git-logs] scummvm master -> 307900289f2f486dd1adb0888e06429b1e1a830d
sdelamarre
noreply at scummvm.org
Thu Jun 19 20:56:31 UTC 2025
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
f4b73f85a8 GOB: Add another English variant of Adibou2 ("Adiboo")
307900289f GOB: Fix adding new Adibou2 applications in-game using original CD layout
Commit: f4b73f85a8085b15b9adf52a8fecccd07c3a6b5f
https://github.com/scummvm/scummvm/commit/f4b73f85a8085b15b9adf52a8fecccd07c3a6b5f
Author: Simon Delamarre (simon.delamarre14 at gmail.com)
Date: 2025-06-19T22:50:04+02:00
Commit Message:
GOB: Add another English variant of Adibou2 ("Adiboo")
Changed paths:
engines/gob/detection/tables_adibou2.h
diff --git a/engines/gob/detection/tables_adibou2.h b/engines/gob/detection/tables_adibou2.h
index 707b2185dbc..8042c99ff42 100644
--- a/engines/gob/detection/tables_adibou2.h
+++ b/engines/gob/detection/tables_adibou2.h
@@ -263,6 +263,20 @@
kFeatures640x480,
0, 0, 0
},
+{
+ {
+ "adibou2",
+ "ADIBOO 2.13 Environment",
+ AD_ENTRY2s("intro.stk", "092707829555f27706920e4cacf1fada", 8737958,
+ "BECBA213.CD1","bc828c320908a5eaa349956d396bd8e1", 8),
+ EN_GRB,
+ kPlatformWindows,
+ ADGF_NO_FLAGS,
+ GUIO0()
+ },
+ kFeatures640x480,
+ 0, 0, 0
+},
// -- Demos --
Commit: 307900289f2f486dd1adb0888e06429b1e1a830d
https://github.com/scummvm/scummvm/commit/307900289f2f486dd1adb0888e06429b1e1a830d
Author: Simon Delamarre (simon.delamarre14 at gmail.com)
Date: 2025-06-19T22:50:04+02:00
Commit Message:
GOB: Fix adding new Adibou2 applications in-game using original CD layout
The original game registered a new application by copying some assets
(app INI file, app icon, app diploma icon etc.) from the CD or from an
"envir" directory into an "applis" directory in the game installation
dir, and setting the "Installed" key value to "1" that copied app INI file.
Previously some of these files copies and modifications had to be done
manually. We now fully emulate this by creating proper save game file
replacing the files in the "applis" directory.
Changed paths:
engines/gob/inter.h
engines/gob/inter_v7.cpp
engines/gob/save/saveload.cpp
engines/gob/save/saveload.h
engines/gob/save/saveload_v7.cpp
diff --git a/engines/gob/inter.h b/engines/gob/inter.h
index 7d9cbd06fe4..f640439e6fd 100644
--- a/engines/gob/inter.h
+++ b/engines/gob/inter.h
@@ -796,8 +796,8 @@ private:
TranslationDatabases _translationDatabases;
Common::HashMap<Common::String, Database, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> _databases;
- Common::ArchiveMemberList _remainingFilesFromPreviousSearch;
- Common::String _currentCDPath;
+ Common::List<Common::Path> _findFileMatches;
+ Common::Path _currentCDPath;
Common::String _currentHtmlFile;
HtmlContext *_currentHtmlContext;
diff --git a/engines/gob/inter_v7.cpp b/engines/gob/inter_v7.cpp
index 793555bb490..bdcb3ee98fa 100644
--- a/engines/gob/inter_v7.cpp
+++ b/engines/gob/inter_v7.cpp
@@ -457,45 +457,45 @@ void Inter_v7::o7_copyFile() {
}
void Inter_v7::o7_deleteFile() {
- Common::String file =_vm->_game->_script->evalString();
+ Common::Path file(_vm->_game->_script->evalString(), '\\');
- debugC(2, kDebugFileIO, "Delete file \"%s\"", file.c_str());
+ debugC(2, kDebugFileIO, "Delete file \"%s\"", file.toString().c_str());
- bool isPattern = file.contains('*') || file.contains('?');
- Common::List<Common::String> files;
+ bool isPattern = file.toString().contains('*') || file.toString().contains('?');
+ Common::List<Common::Path> files;
if (isPattern) {
- files = _vm->_saveLoad->getFilesMatchingPattern(file.c_str());
- debugC(2, kDebugFileIO, "Delete file matching pattern \"%s\" (%d matching file(s))", file.c_str(), files.size());
- for (const Common::String &matchingFile : files)
- debugC(5, kDebugFileIO, "Matching file: %s", matchingFile.c_str());
+ files = _vm->_saveLoad->getFilesMatchingPattern(file);
+ debugC(2, kDebugFileIO, "Delete file matching pattern \"%s\" (%d matching file(s))", file.toString().c_str(), files.size());
+ for (const Common::Path &matchingFile : files)
+ debugC(5, kDebugFileIO, "Matching file: %s", matchingFile.toString().c_str());
} else {
files.push_back(file);
- debugC(2, kDebugFileIO, "Delete file \"%s\"", file.c_str());
+ debugC(2, kDebugFileIO, "Delete file \"%s\"", file.toString().c_str());
}
if (_vm->getGameType() == kGameTypeAdibou2
&& isPattern
- && file.hasPrefix("DATA\\??????")) {
+ && file.toString().hasPrefix("DATA/??????")) {
// WORKAROUND a bug in original game: files APPLI_<N>.INF and CRITE_<N>.INF should not be deleted when removing character <N>
// Those files contain *application <N>* data, not "character <N>" data
- for (Common::List<Common::String>::iterator it = files.begin(); it != files.end(); ++it) {
- if (it->matchString("DATA\\\\appli_??.inf", true) || it->matchString("DATA\\\\crite_??.inf", true)) {
+ for (Common::List<Common::Path>::iterator it = files.begin(); it != files.end(); ++it) {
+ if (it->toString().matchString("DATA/appli_??.inf", true) || it->toString().matchString("DATA/crite_??.inf", true)) {
debugC(2, kDebugFileIO, "o7_deleteFile: ignoring deletion of file \"%s\" when processing pattern %s (delete character bug workaround)",
- it->c_str(),
- file.c_str());
+ it->toString().c_str(),
+ file.toString().c_str());
it = files.reverse_erase(it);
}
}
}
- for (const Common::String &fileToDelete : files) {
- SaveLoad::SaveMode mode = _vm->_saveLoad->getSaveMode(fileToDelete.c_str());
+ for (const Common::Path &fileToDelete : files) {
+ SaveLoad::SaveMode mode = _vm->_saveLoad->getSaveMode(fileToDelete.toString().c_str());
if (mode == SaveLoad::kSaveModeSave) {
- if (!_vm->_saveLoad->deleteFile(fileToDelete.c_str())) {
- warning("Cannot delete file \"%s\"", fileToDelete.c_str());
+ if (!_vm->_saveLoad->deleteFile(fileToDelete.toString().c_str())) {
+ warning("Cannot delete file \"%s\"", fileToDelete.toString().c_str());
}
} else if (mode == SaveLoad::kSaveModeNone)
- warning("Attempted to delete file \"%s\"", fileToDelete.c_str());
+ warning("Attempted to delete file \"%s\"", fileToDelete.toString().c_str());
}
}
@@ -803,11 +803,11 @@ void Inter_v7::o7_setActiveCD() {
Common::ArchiveMemberDetailsList files;
SearchMan.listMatchingMembers(files, Common::Path(str0, '\\'));
- Common::String savedCDpath = _currentCDPath;
+ Common::Path savedCDpath = _currentCDPath;
for (Common::ArchiveMemberDetails file : files) {
if (setCurrentCDPath(file.arcName)) {
- debugC(5, kDebugFileIO, "o7_setActiveCD: %s -> %s", savedCDpath.c_str(), _currentCDPath.c_str());
+ debugC(5, kDebugFileIO, "o7_setActiveCD: %s -> %s", savedCDpath.toString().c_str(), _currentCDPath.toString().c_str());
storeValue(1);
return;
}
@@ -833,56 +833,67 @@ void Inter_v7::o7_findFile() {
Common::ArchiveMemberList files;
SearchMan.listMatchingMembers(files, filePattern);
- Common::ArchiveMemberList filesWithoutDuplicates;
+ Common::List<Common::Path> filePaths;
for (Common::ArchiveMemberPtr file : files) {
+ filePaths.push_back(file->getPathInArchive());
+ }
+
+ Common::List<Common::Path> matchingSaveFiles = _vm->_saveLoad->getFilesMatchingPattern(filePattern.toString().c_str());
+ for (Common::Path &filename : matchingSaveFiles) {
+ if (_vm->_saveLoad->getSize(filename.toString().c_str()) >= 0) {
+ filePaths.push_back(filename);
+ }
+ }
+
+ Common::List<Common::Path> filenamesWithoutDuplicates;
+ for (Common::Path &filename : filePaths) {
bool found = false;
- for (Common::ArchiveMemberPtr fileWithoutDuplicates : filesWithoutDuplicates) {
- if (file->getName() == fileWithoutDuplicates->getName()) {
+ for (Common::Path &filename2 : filenamesWithoutDuplicates) {
+ if (filename == filename2) {
found = true;
break;
}
}
if (!found)
- filesWithoutDuplicates.push_back(file);
+ filenamesWithoutDuplicates.push_back(filename);
}
- debugC(5, kDebugFileIO, "o7_findFile(%s): %d matches (%d including duplicates)",
+ debugC(5, kDebugFileIO, "o7_findFile(%s): %d matches after discarding duplicates",
filePattern.toString().c_str(),
- filesWithoutDuplicates.size(),
- files.size());
+ filenamesWithoutDuplicates.size());
- if (filesWithoutDuplicates.empty()) {
+ if (filenamesWithoutDuplicates.empty()) {
storeString("");
storeValue(0);
} else {
- Common::String file = files.front()->getName();
- filesWithoutDuplicates.pop_front();
+ Common::Path file = filenamesWithoutDuplicates.front();
+ filenamesWithoutDuplicates.pop_front();
debugC(5, kDebugFileIO, "o7_findFile(%s): first match = %s",
filePattern.toString().c_str(),
- file.c_str());
+ file.toString().c_str());
- storeString(file.c_str());
+ storeString(file.getLastComponent().toString().c_str());
storeValue(1);
}
- _remainingFilesFromPreviousSearch = filesWithoutDuplicates;
+ _findFileMatches = filenamesWithoutDuplicates;
}
void Inter_v7::o7_findNextFile() {
uint16 type;
uint16 varIndex = _vm->_game->_script->readVarIndex(0, &type);
- Common::String file;
- if (!_remainingFilesFromPreviousSearch.empty()) {
- file = _remainingFilesFromPreviousSearch.front()->getName();
- _remainingFilesFromPreviousSearch.pop_front();
+ Common::Path file;
+ if (!_findFileMatches.empty()) {
+ file = _findFileMatches.front();
+ _findFileMatches.pop_front();
}
debugC(5, kDebugFileIO, "o7_findNextFile: new match = %s",
- file.c_str());
+ file.toString().c_str());
- storeString(varIndex, type, file.c_str());
+ storeString(varIndex, type, file.getLastComponent().toString().c_str());
storeValue(file.empty() ? 0 : 1);
}
@@ -1671,7 +1682,7 @@ bool Inter_v7::setCurrentCDPath(const Common::String &newDirName) {
return false;
if (!_currentCDPath.empty())
- SearchMan.setPriority(_currentCDPath, 0);
+ SearchMan.setPriority(_currentCDPath.toString(), 0);
_currentCDPath = newDirName;
if (!_currentCDPath.empty())
diff --git a/engines/gob/save/saveload.cpp b/engines/gob/save/saveload.cpp
index d5219d50a30..c16843a5f77 100644
--- a/engines/gob/save/saveload.cpp
+++ b/engines/gob/save/saveload.cpp
@@ -58,9 +58,9 @@ Common::String SaveLoad::replacePathSeparators(const char *path, char newSeparat
return result;
}
-Common::List<Common::String> SaveLoad::getFilesMatchingPattern(const char *pattern) const {
+Common::List<Common::Path> SaveLoad::getFilesMatchingPattern(const Common::Path &pattern) const {
warning("SaveLoad::getFilesMatchingPattern not implemented");
- return Common::List<Common::String>();
+ return Common::List<Common::Path>();
}
int32 SaveLoad::getSize(const char *fileName) {
diff --git a/engines/gob/save/saveload.h b/engines/gob/save/saveload.h
index 2cf378bb0bc..477978cd646 100644
--- a/engines/gob/save/saveload.h
+++ b/engines/gob/save/saveload.h
@@ -63,7 +63,7 @@ public:
virtual SaveMode getSaveMode(const char *fileName) const;
/** Returns all files known by the saving system matching a pattern. */
- virtual Common::List<Common::String> getFilesMatchingPattern(const char *pattern) const;
+ virtual Common::List<Common::Path> getFilesMatchingPattern(const Common::Path &pattern) const;
/** Returns the file's (virtual) size. */
int32 getSize(const char *fileName);
@@ -985,7 +985,7 @@ public:
~SaveLoad_v7() override;
SaveMode getSaveMode(const char *fileName) const override;
- Common::List<Common::String> getFilesMatchingPattern(const char *pattern) const override;
+ Common::List<Common::Path> getFilesMatchingPattern(const Common::Path &pattern) const override;
protected:
struct SaveFile {
@@ -1108,7 +1108,7 @@ protected:
FakeFileHandler *_adibou2RelanceHandler;
FakeFileHandler *_adibou2MemHandler;
GameFileHandler *_adibou2AppProgressExtHandler[kAdibou2NbrOfApplications - 4][kChildrenCount];
- GameFileHandler *_adibou2AppliIniHandler[kAdibou2NbrOfApplications - 4];
+ GameFileHandler *_adibou2AppliIniHandler[kAdibou2NbrOfApplications];
FakeFileHandler *_addy4BaseHandler[2];
FakeFileHandler *_addy4GrundschuleHandler[11];
diff --git a/engines/gob/save/saveload_v7.cpp b/engines/gob/save/saveload_v7.cpp
index 64ab611a42b..18f21ec444f 100644
--- a/engines/gob/save/saveload_v7.cpp
+++ b/engines/gob/save/saveload_v7.cpp
@@ -929,6 +929,10 @@ SaveLoad_v7::SaveFile SaveLoad_v7::_saveFiles[] = {
{"DATA/GIE06_16.pho", kSaveModeSave, nullptr, "app progress" },
{"DATA/GIE07_16.pho", kSaveModeSave, nullptr, "app progress" },
+ {"APPLIS/appli_01.ini", kSaveModeSave, nullptr, "app info" },
+ {"APPLIS/appli_02.ini", kSaveModeSave, nullptr, "app info" },
+ {"APPLIS/appli_03.ini", kSaveModeSave, nullptr, "app info" },
+ {"APPLIS/appli_04.ini", kSaveModeSave, nullptr, "app info" },
{"APPLIS/appli_05.ini", kSaveModeSave, nullptr, "app info" },
{"APPLIS/appli_06.ini", kSaveModeSave, nullptr, "app info" },
{"APPLIS/appli_07.ini", kSaveModeSave, nullptr, "app info" },
@@ -1468,10 +1472,10 @@ SaveLoad_v7::SaveLoad_v7(GobEngine *vm, const char *targetName) :
}
}
- for (uint32 i = 4; i < kAdibou2NbrOfApplications; i++) {
- _saveFiles[index++].handler = _adibou2AppliIniHandler[i - 4] = new GameFileHandler(_vm,
- targetName,
- Common::String::format("appli_%02d_ini", i + 1));
+ for (uint32 i = 0; i < kAdibou2NbrOfApplications; i++) {
+ _saveFiles[index++].handler = _adibou2AppliIniHandler[i] = new GameFileHandler(_vm,
+ targetName,
+ Common::String::format("appli_%02d_ini", i + 1));
}
for (int i = 0; i < 2; i++)
@@ -1555,9 +1559,10 @@ SaveLoad_v7::~SaveLoad_v7() {
for (uint32 j = 0; j < kChildrenCount; j++) {
delete _adibou2AppProgressExtHandler[i - 4][j];
}
+ }
-
- delete _adibou2AppliIniHandler[i - 4];
+ for (uint32 i = 0; i < kAdibou2NbrOfApplications; i++) {
+ delete _adibou2AppliIniHandler[i];
}
}
@@ -1605,13 +1610,12 @@ SaveLoad::SaveMode SaveLoad_v7::getSaveMode(const char *fileName) const {
return kSaveModeNone;
}
-Common::List<Common::String> SaveLoad_v7::getFilesMatchingPattern(const char *pattern) const {
- Common::List<Common::String> files;
- Common::String patternNormalized = replacePathSeparators(pattern, '/');
+Common::List<Common::Path> SaveLoad_v7::getFilesMatchingPattern(const Common::Path &pattern) const {
+ Common::List<Common::Path> files;
for (const SaveFile &saveFile : _saveFiles) {
// Full path match only
- if (Common::matchString(saveFile.sourceName, patternNormalized.c_str(), true))
+ if (Common::matchString(saveFile.sourceName, pattern.toString().c_str(), true))
files.push_back(saveFile.sourceName);
}
More information about the Scummvm-git-logs
mailing list