diff options
Diffstat (limited to 'engines/cruise/dataLoader.cpp')
-rw-r--r-- | engines/cruise/dataLoader.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/engines/cruise/dataLoader.cpp b/engines/cruise/dataLoader.cpp index 55ed2c4e68..8532d3074e 100644 --- a/engines/cruise/dataLoader.cpp +++ b/engines/cruise/dataLoader.cpp @@ -170,11 +170,11 @@ int createResFileEntry(int width, int height, int size, int resType) { return 0; // for compilers that don't support NORETURN #if 0 - int i; int entryNumber; int div = 0; - for (i = 0; i < NUM_FILE_ENTRIES; i++) { + int i = 0; + for (; i < NUM_FILE_ENTRIES; i++) { if (!filesDatabase[i].subData.ptr) break; } @@ -280,10 +280,9 @@ int loadFileRange(const char *name, int startIdx, int currentEntryIdx, int numId switch (fileType) { case type_SET: { - int i; int numMaxEntriesInSet = getNumMaxEntiresInSet(ptr); - for (i = 0; i < numIdx; i++) { + for (int i = 0; i < numIdx; i++) { if ((startIdx + i) > numMaxEntriesInSet) { MemFree(ptr); return 0; // exit if limit is reached @@ -325,12 +324,9 @@ int loadFullBundle(const char *name, int startIdx) { switch (fileType) { case type_SET: { // Sprite set - int i; - int numMaxEntriesInSet; + int numMaxEntriesInSet = getNumMaxEntiresInSet(ptr); // get maximum number of sprites/animations in SET file - numMaxEntriesInSet = getNumMaxEntiresInSet(ptr); // get maximum number of sprites/animations in SET file - - for (i = 0; i < numMaxEntriesInSet; i++) { + for (int i = 0; i < numMaxEntriesInSet; i++) { loadSetEntry(name, ptr, i, startIdx + i); } |