SWORD1: Fix detection code for Mac demo

It was using the wrong file count define when iterating on the files.
Fortunately the one being used has currently the same value as the
one that should have been used. So it was working correctly despite
the bug.

Also reorder the defines to match the order of the files in the
g_filesToCheck array.
This commit is contained in:
Thierry Crozat 2020-08-26 21:32:27 +01:00
parent 581b4ca594
commit d07c009d7e

View File

@ -54,10 +54,10 @@ static const char *const g_dirNames[] = { "clusters", "speech", "english", "ital
#define NUM_COMMON_FILES_TO_CHECK 1
#define NUM_PC_FILES_TO_CHECK 3
#define NUM_MAC_FILES_TO_CHECK 4
#define NUM_PSX_FILES_TO_CHECK 1
#define NUM_PSX_DEMO_FILES_TO_CHECK 2
#define NUM_DEMO_FILES_TO_CHECK 1
#define NUM_MAC_DEMO_FILES_TO_CHECK 1
#define NUM_PSX_FILES_TO_CHECK 1
#define NUM_PSX_DEMO_FILES_TO_CHECK 2
#define NUM_FILES_TO_CHECK NUM_COMMON_FILES_TO_CHECK + NUM_PC_FILES_TO_CHECK + NUM_MAC_FILES_TO_CHECK + NUM_PSX_FILES_TO_CHECK + NUM_DEMO_FILES_TO_CHECK + NUM_MAC_DEMO_FILES_TO_CHECK + NUM_PSX_DEMO_FILES_TO_CHECK
static const char *const g_filesToCheck[NUM_FILES_TO_CHECK] = { // these files have to be found
@ -206,7 +206,7 @@ DetectedGames SwordMetaEngine::detectGames(const Common::FSList &fslist) const {
for (j = 0; j < NUM_DEMO_FILES_TO_CHECK; i++, j++)
if (!filesFound[i])
demoFilesFound = false;
for (j = 0; j < NUM_DEMO_FILES_TO_CHECK; i++, j++)
for (j = 0; j < NUM_MAC_DEMO_FILES_TO_CHECK; i++, j++)
if (!filesFound[i])
macDemoFilesFound = false;
for (j = 0; j < NUM_PSX_FILES_TO_CHECK; i++, j++)