Fix stricmp
This commit is contained in:
parent
7fc25b975f
commit
c2971e24e3
|
@ -6,6 +6,7 @@
|
||||||
#include "db.h"
|
#include "db.h"
|
||||||
#include "memory_manager.h"
|
#include "memory_manager.h"
|
||||||
#include "pcx.h"
|
#include "pcx.h"
|
||||||
|
#include "platform_compat.h"
|
||||||
|
|
||||||
// 0x5184AC
|
// 0x5184AC
|
||||||
DatafileLoader* gDatafileLoader = NULL;
|
DatafileLoader* gDatafileLoader = NULL;
|
||||||
|
@ -88,7 +89,7 @@ unsigned char* datafileReadRaw(char* path, int* widthPtr, int* heightPtr)
|
||||||
char* mangledPath = gDatafileNameMangler(path);
|
char* mangledPath = gDatafileNameMangler(path);
|
||||||
char* dot = strrchr(mangledPath, '.');
|
char* dot = strrchr(mangledPath, '.');
|
||||||
if (dot != NULL) {
|
if (dot != NULL) {
|
||||||
if (stricmp(dot + 1, "pcx")) {
|
if (compat_stricmp(dot + 1, "pcx")) {
|
||||||
return pcxRead(mangledPath, widthPtr, heightPtr, gDatafilePalette);
|
return pcxRead(mangledPath, widthPtr, heightPtr, gDatafilePalette);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include "db.h"
|
#include "db.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "memory_manager.h"
|
#include "memory_manager.h"
|
||||||
|
#include "platform_compat.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
@ -109,7 +110,7 @@ int mouseManagerInsertCacheEntry(void** data, int type, unsigned char* palette,
|
||||||
foundIndex = index;
|
foundIndex = index;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stricmp(fileName, cacheEntry->fileName) == 0) {
|
if (compat_stricmp(fileName, cacheEntry->fileName) == 0) {
|
||||||
mouseManagerFreeCacheEntry(cacheEntry);
|
mouseManagerFreeCacheEntry(cacheEntry);
|
||||||
foundIndex = index;
|
foundIndex = index;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include "memory_manager.h"
|
#include "memory_manager.h"
|
||||||
#include "mouse_manager.h"
|
#include "mouse_manager.h"
|
||||||
#include "movie.h"
|
#include "movie.h"
|
||||||
|
#include "platform_compat.h"
|
||||||
#include "text_font.h"
|
#include "text_font.h"
|
||||||
#include "widget.h"
|
#include "widget.h"
|
||||||
#include "window_manager.h"
|
#include "window_manager.h"
|
||||||
|
@ -398,7 +399,7 @@ bool _windowActivateRegion(const char* regionName, int a2)
|
||||||
if (a2 <= 4) {
|
if (a2 <= 4) {
|
||||||
for (int index = 0; index < managedWindow->regionsLength; index++) {
|
for (int index = 0; index < managedWindow->regionsLength; index++) {
|
||||||
Region* region = managedWindow->regions[index];
|
Region* region = managedWindow->regions[index];
|
||||||
if (stricmp(regionGetName(region), regionName) == 0) {
|
if (compat_stricmp(regionGetName(region), regionName) == 0) {
|
||||||
_doRegionFunc(region, a2);
|
_doRegionFunc(region, a2);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -406,7 +407,7 @@ bool _windowActivateRegion(const char* regionName, int a2)
|
||||||
} else {
|
} else {
|
||||||
for (int index = 0; index < managedWindow->regionsLength; index++) {
|
for (int index = 0; index < managedWindow->regionsLength; index++) {
|
||||||
Region* region = managedWindow->regions[index];
|
Region* region = managedWindow->regions[index];
|
||||||
if (stricmp(regionGetName(region), regionName) == 0) {
|
if (compat_stricmp(regionGetName(region), regionName) == 0) {
|
||||||
_doRegionRightFunc(region, a2 - 5);
|
_doRegionRightFunc(region, a2 - 5);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -621,7 +622,7 @@ bool _deleteWindow(const char* windowName)
|
||||||
int index;
|
int index;
|
||||||
for (index = 0; index < MANAGED_WINDOW_COUNT; index++) {
|
for (index = 0; index < MANAGED_WINDOW_COUNT; index++) {
|
||||||
ManagedWindow* managedWindow = &(gManagedWindows[index]);
|
ManagedWindow* managedWindow = &(gManagedWindows[index]);
|
||||||
if (stricmp(managedWindow->name, windowName) == 0) {
|
if (compat_stricmp(managedWindow->name, windowName) == 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -704,7 +705,7 @@ int _createWindow(const char* windowName, int x, int y, int width, int height, i
|
||||||
windowIndex = index;
|
windowIndex = index;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
if (stricmp(managedWindow->name, windowName) == 0) {
|
if (compat_stricmp(managedWindow->name, windowName) == 0) {
|
||||||
_deleteWindow(windowName);
|
_deleteWindow(windowName);
|
||||||
windowIndex = index;
|
windowIndex = index;
|
||||||
break;
|
break;
|
||||||
|
@ -1496,7 +1497,7 @@ bool _windowAddButton(const char* buttonName, int x, int y, int width, int heigh
|
||||||
int index;
|
int index;
|
||||||
for (index = 0; index < managedWindow->buttonsLength; index++) {
|
for (index = 0; index < managedWindow->buttonsLength; index++) {
|
||||||
ManagedButton* managedButton = &(managedWindow->buttons[index]);
|
ManagedButton* managedButton = &(managedWindow->buttons[index]);
|
||||||
if (stricmp(managedButton->name, buttonName) == 0) {
|
if (compat_stricmp(managedButton->name, buttonName) == 0) {
|
||||||
buttonDestroy(managedButton->btn);
|
buttonDestroy(managedButton->btn);
|
||||||
|
|
||||||
if (managedButton->hover != NULL) {
|
if (managedButton->hover != NULL) {
|
||||||
|
@ -1605,7 +1606,7 @@ bool _windowAddButtonGfx(const char* buttonName, char* pressedFileName, char* no
|
||||||
ManagedWindow* managedWindow = &(gManagedWindows[gCurrentManagedWindowIndex]);
|
ManagedWindow* managedWindow = &(gManagedWindows[gCurrentManagedWindowIndex]);
|
||||||
for (int index = 0; index < managedWindow->buttonsLength; index++) {
|
for (int index = 0; index < managedWindow->buttonsLength; index++) {
|
||||||
ManagedButton* managedButton = &(managedWindow->buttons[index]);
|
ManagedButton* managedButton = &(managedWindow->buttons[index]);
|
||||||
if (stricmp(managedButton->name, buttonName) == 0) {
|
if (compat_stricmp(managedButton->name, buttonName) == 0) {
|
||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
|
|
||||||
|
@ -1664,7 +1665,7 @@ bool _windowAddButtonProc(const char* buttonName, Program* program, int mouseEnt
|
||||||
|
|
||||||
for (int index = 0; index < managedWindow->buttonsLength; index++) {
|
for (int index = 0; index < managedWindow->buttonsLength; index++) {
|
||||||
ManagedButton* managedButton = &(managedWindow->buttons[index]);
|
ManagedButton* managedButton = &(managedWindow->buttons[index]);
|
||||||
if (stricmp(managedButton->name, buttonName) == 0) {
|
if (compat_stricmp(managedButton->name, buttonName) == 0) {
|
||||||
managedButton->procs[MANAGED_BUTTON_MOUSE_EVENT_ENTER] = mouseEnterProc;
|
managedButton->procs[MANAGED_BUTTON_MOUSE_EVENT_ENTER] = mouseEnterProc;
|
||||||
managedButton->procs[MANAGED_BUTTON_MOUSE_EVENT_EXIT] = mouseExitProc;
|
managedButton->procs[MANAGED_BUTTON_MOUSE_EVENT_EXIT] = mouseExitProc;
|
||||||
managedButton->procs[MANAGED_BUTTON_MOUSE_EVENT_BUTTON_DOWN] = mouseDownProc;
|
managedButton->procs[MANAGED_BUTTON_MOUSE_EVENT_BUTTON_DOWN] = mouseDownProc;
|
||||||
|
@ -1691,7 +1692,7 @@ bool _windowAddButtonRightProc(const char* buttonName, Program* program, int rig
|
||||||
|
|
||||||
for (int index = 0; index < managedWindow->buttonsLength; index++) {
|
for (int index = 0; index < managedWindow->buttonsLength; index++) {
|
||||||
ManagedButton* managedButton = &(managedWindow->buttons[index]);
|
ManagedButton* managedButton = &(managedWindow->buttons[index]);
|
||||||
if (stricmp(managedButton->name, buttonName) == 0) {
|
if (compat_stricmp(managedButton->name, buttonName) == 0) {
|
||||||
managedButton->rightProcs[MANAGED_BUTTON_RIGHT_MOUSE_EVENT_BUTTON_UP] = rightMouseUpProc;
|
managedButton->rightProcs[MANAGED_BUTTON_RIGHT_MOUSE_EVENT_BUTTON_UP] = rightMouseUpProc;
|
||||||
managedButton->rightProcs[MANAGED_BUTTON_RIGHT_MOUSE_EVENT_BUTTON_DOWN] = rightMouseDownProc;
|
managedButton->rightProcs[MANAGED_BUTTON_RIGHT_MOUSE_EVENT_BUTTON_DOWN] = rightMouseDownProc;
|
||||||
managedButton->program = program;
|
managedButton->program = program;
|
||||||
|
@ -1718,7 +1719,7 @@ bool _windowAddButtonCfunc(const char* buttonName, ManagedButtonMouseEventCallba
|
||||||
|
|
||||||
for (int index = 0; index < managedWindow->buttonsLength; index++) {
|
for (int index = 0; index < managedWindow->buttonsLength; index++) {
|
||||||
ManagedButton* managedButton = &(managedWindow->buttons[index]);
|
ManagedButton* managedButton = &(managedWindow->buttons[index]);
|
||||||
if (stricmp(managedButton->name, buttonName) == 0) {
|
if (compat_stricmp(managedButton->name, buttonName) == 0) {
|
||||||
managedButton->mouseEventCallbackUserData = userData;
|
managedButton->mouseEventCallbackUserData = userData;
|
||||||
managedButton->mouseEventCallback = callback;
|
managedButton->mouseEventCallback = callback;
|
||||||
return true;
|
return true;
|
||||||
|
@ -1744,7 +1745,7 @@ bool _windowAddButtonRightCfunc(const char* buttonName, ManagedButtonMouseEventC
|
||||||
|
|
||||||
for (int index = 0; index < managedWindow->buttonsLength; index++) {
|
for (int index = 0; index < managedWindow->buttonsLength; index++) {
|
||||||
ManagedButton* managedButton = &(managedWindow->buttons[index]);
|
ManagedButton* managedButton = &(managedWindow->buttons[index]);
|
||||||
if (stricmp(managedButton->name, buttonName) == 0) {
|
if (compat_stricmp(managedButton->name, buttonName) == 0) {
|
||||||
managedButton->rightMouseEventCallback = callback;
|
managedButton->rightMouseEventCallback = callback;
|
||||||
managedButton->rightMouseEventCallbackUserData = userData;
|
managedButton->rightMouseEventCallbackUserData = userData;
|
||||||
buttonSetRightMouseCallbacks(managedButton->btn, -1, -1, _doRightButtonPress, _doRightButtonRelease);
|
buttonSetRightMouseCallbacks(managedButton->btn, -1, -1, _doRightButtonPress, _doRightButtonRelease);
|
||||||
|
@ -1775,7 +1776,7 @@ bool _windowAddButtonTextWithOffsets(const char* buttonName, const char* text, i
|
||||||
|
|
||||||
for (int index = 0; index < managedWindow->buttonsLength; index++) {
|
for (int index = 0; index < managedWindow->buttonsLength; index++) {
|
||||||
ManagedButton* managedButton = &(managedWindow->buttons[index]);
|
ManagedButton* managedButton = &(managedWindow->buttons[index]);
|
||||||
if (stricmp(managedButton->name, buttonName) == 0) {
|
if (compat_stricmp(managedButton->name, buttonName) == 0) {
|
||||||
int normalImageHeight = fontGetLineHeight() + 1;
|
int normalImageHeight = fontGetLineHeight() + 1;
|
||||||
int normalImageWidth = fontGetStringWidth(text) + 1;
|
int normalImageWidth = fontGetStringWidth(text) + 1;
|
||||||
unsigned char* buffer = (unsigned char*)internal_malloc_safe(normalImageHeight * normalImageWidth, __FILE__, __LINE__); // "..\\int\\WINDOW.C", 2010
|
unsigned char* buffer = (unsigned char*)internal_malloc_safe(normalImageHeight * normalImageWidth, __FILE__, __LINE__); // "..\\int\\WINDOW.C", 2010
|
||||||
|
|
Loading…
Reference in New Issue