More fixes

This commit is contained in:
Alexander Batalov 2022-07-29 14:34:43 +03:00
parent c2971e24e3
commit bc4d4ccac7
2 changed files with 6 additions and 7 deletions

View File

@ -378,9 +378,8 @@ int dictionaryReadHeader(FILE* stream, Dictionary* dictionary)
if (dictionaryReadInt(stream, &value) != 0) return -1; if (dictionaryReadInt(stream, &value) != 0) return -1;
dictionary->valueSize = value; dictionary->valueSize = value;
// NOTE: Originally reads `values` pointer.
if (dictionaryReadInt(stream, &value) != 0) return -1; if (dictionaryReadInt(stream, &value) != 0) return -1;
// FIXME: Reading pointer.
dictionary->entries = (DictionaryEntry*)value;
return 0; return 0;
} }
@ -492,8 +491,8 @@ int dictionaryWriteHeader(FILE* stream, Dictionary* dictionary)
if (dictionaryWriteInt(stream, dictionary->entriesLength) != 0) return -1; if (dictionaryWriteInt(stream, dictionary->entriesLength) != 0) return -1;
if (dictionaryWriteInt(stream, dictionary->entriesCapacity) != 0) return -1; if (dictionaryWriteInt(stream, dictionary->entriesCapacity) != 0) return -1;
if (dictionaryWriteInt(stream, dictionary->valueSize) != 0) return -1; if (dictionaryWriteInt(stream, dictionary->valueSize) != 0) return -1;
// FIXME: Writing pointer. // NOTE: Originally writes `entries` pointer.
if (dictionaryWriteInt(stream, (int)dictionary->entries) != 0) return -1; if (dictionaryWriteInt(stream, 0) != 0) return -1;
return 0; return 0;
} }

View File

@ -167,7 +167,7 @@ MouseManagerCacheEntry* mouseManagerFindCacheEntry(const char* fileName, unsigne
{ {
for (int index = 0; index < MOUSE_MGR_CACHE_CAPACITY; index++) { for (int index = 0; index < MOUSE_MGR_CACHE_CAPACITY; index++) {
MouseManagerCacheEntry* cacheEntry = &(gMouseManagerCache[index]); MouseManagerCacheEntry* cacheEntry = &(gMouseManagerCache[index]);
if (strnicmp(cacheEntry->fileName, fileName, 31) == 0 || strnicmp(cacheEntry->field_32C, fileName, 31) == 0) { if (compat_strnicmp(cacheEntry->fileName, fileName, 31) == 0 || compat_strnicmp(cacheEntry->field_32C, fileName, 31) == 0) {
*palettePtr = cacheEntry->palette; *palettePtr = cacheEntry->palette;
*typePtr = cacheEntry->type; *typePtr = cacheEntry->type;
@ -335,7 +335,7 @@ int mouseManagerSetFrame(char* fileName, int a2)
char string[80]; char string[80];
fileReadString(string, sizeof(string), stream); fileReadString(string, sizeof(string), stream);
if (strnicmp(string, "anim", 4) != 0) { if (compat_strnicmp(string, "anim", 4) != 0) {
fileClose(stream); fileClose(stream);
mouseManagerSetMousePointer(fileName); mouseManagerSetMousePointer(fileName);
return true; return true;
@ -542,7 +542,7 @@ bool mouseManagerSetMousePointer(char* fileName)
} }
bool rc; bool rc;
if (strnicmp(string, "anim", 4) == 0) { if (compat_strnicmp(string, "anim", 4) == 0) {
fileClose(stream); fileClose(stream);
rc = mouseManagerSetFrame(fileName, 0); rc = mouseManagerSetFrame(fileName, 0);
} else { } else {