From bc4d4ccac7df1db52c4b62e701cc0416c948f3bf Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Fri, 29 Jul 2022 14:34:43 +0300 Subject: [PATCH] More fixes --- src/dictionary.cc | 7 +++---- src/mouse_manager.cc | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/dictionary.cc b/src/dictionary.cc index ba094fa..4801289 100644 --- a/src/dictionary.cc +++ b/src/dictionary.cc @@ -378,9 +378,8 @@ int dictionaryReadHeader(FILE* stream, Dictionary* dictionary) if (dictionaryReadInt(stream, &value) != 0) return -1; dictionary->valueSize = value; + // NOTE: Originally reads `values` pointer. if (dictionaryReadInt(stream, &value) != 0) return -1; - // FIXME: Reading pointer. - dictionary->entries = (DictionaryEntry*)value; return 0; } @@ -492,8 +491,8 @@ int dictionaryWriteHeader(FILE* stream, Dictionary* dictionary) if (dictionaryWriteInt(stream, dictionary->entriesLength) != 0) return -1; if (dictionaryWriteInt(stream, dictionary->entriesCapacity) != 0) return -1; if (dictionaryWriteInt(stream, dictionary->valueSize) != 0) return -1; - // FIXME: Writing pointer. - if (dictionaryWriteInt(stream, (int)dictionary->entries) != 0) return -1; + // NOTE: Originally writes `entries` pointer. + if (dictionaryWriteInt(stream, 0) != 0) return -1; return 0; } diff --git a/src/mouse_manager.cc b/src/mouse_manager.cc index 6709d10..092bf41 100644 --- a/src/mouse_manager.cc +++ b/src/mouse_manager.cc @@ -167,7 +167,7 @@ MouseManagerCacheEntry* mouseManagerFindCacheEntry(const char* fileName, unsigne { for (int index = 0; index < MOUSE_MGR_CACHE_CAPACITY; 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; *typePtr = cacheEntry->type; @@ -335,7 +335,7 @@ int mouseManagerSetFrame(char* fileName, int a2) char string[80]; fileReadString(string, sizeof(string), stream); - if (strnicmp(string, "anim", 4) != 0) { + if (compat_strnicmp(string, "anim", 4) != 0) { fileClose(stream); mouseManagerSetMousePointer(fileName); return true; @@ -542,7 +542,7 @@ bool mouseManagerSetMousePointer(char* fileName) } bool rc; - if (strnicmp(string, "anim", 4) == 0) { + if (compat_strnicmp(string, "anim", 4) == 0) { fileClose(stream); rc = mouseManagerSetFrame(fileName, 0); } else {