Replace MAX_PATH with COMPAT_MAX_PATH
This commit is contained in:
parent
4bac829739
commit
b1216967c0
|
@ -6,7 +6,6 @@
|
||||||
#include "game_config.h"
|
#include "game_config.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "object.h"
|
#include "object.h"
|
||||||
#include "platform_compat.h"
|
|
||||||
#include "proto.h"
|
#include "proto.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -75,7 +74,7 @@ char gArtLanguage[32];
|
||||||
Cache gArtCache;
|
Cache gArtCache;
|
||||||
|
|
||||||
// 0x56C9E4
|
// 0x56C9E4
|
||||||
char _art_name[MAX_PATH];
|
char _art_name[COMPAT_MAX_PATH];
|
||||||
|
|
||||||
// head_info
|
// head_info
|
||||||
// 0x56CAE8
|
// 0x56CAE8
|
||||||
|
@ -92,7 +91,7 @@ int* gArtCritterFidShoudRunData;
|
||||||
// 0x418840
|
// 0x418840
|
||||||
int artInit()
|
int artInit()
|
||||||
{
|
{
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
int i;
|
int i;
|
||||||
File* stream;
|
File* stream;
|
||||||
char str[200];
|
char str[200];
|
||||||
|
@ -897,7 +896,7 @@ int artCacheGetFileSizeImpl(int fid, int* sizePtr)
|
||||||
char* str;
|
char* str;
|
||||||
char* ptr;
|
char* ptr;
|
||||||
int result;
|
int result;
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
bool loaded;
|
bool loaded;
|
||||||
int fileSize;
|
int fileSize;
|
||||||
|
|
||||||
|
@ -955,7 +954,7 @@ int artCacheReadDataImpl(int fid, int* sizePtr, unsigned char* data)
|
||||||
char* str;
|
char* str;
|
||||||
char* ptr;
|
char* ptr;
|
||||||
int result;
|
int result;
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
bool loaded;
|
bool loaded;
|
||||||
|
|
||||||
v4 = -1;
|
v4 = -1;
|
||||||
|
|
|
@ -5,11 +5,9 @@
|
||||||
#include "db.h"
|
#include "db.h"
|
||||||
#include "heap.h"
|
#include "heap.h"
|
||||||
#include "obj_types.h"
|
#include "obj_types.h"
|
||||||
|
#include "platform_compat.h"
|
||||||
#include "proto_types.h"
|
#include "proto_types.h"
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
typedef enum Head {
|
typedef enum Head {
|
||||||
HEAD_INVALID,
|
HEAD_INVALID,
|
||||||
HEAD_MARCUS,
|
HEAD_MARCUS,
|
||||||
|
@ -136,7 +134,7 @@ extern int _art_mapper_blank_tile;
|
||||||
|
|
||||||
extern char gArtLanguage[32];
|
extern char gArtLanguage[32];
|
||||||
extern Cache gArtCache;
|
extern Cache gArtCache;
|
||||||
extern char _art_name[MAX_PATH];
|
extern char _art_name[COMPAT_MAX_PATH];
|
||||||
extern HeadDescription* gHeadDescriptions;
|
extern HeadDescription* gHeadDescriptions;
|
||||||
extern int* _anon_alias;
|
extern int* _anon_alias;
|
||||||
extern int* gArtCritterFidShoudRunData;
|
extern int* gArtCritterFidShoudRunData;
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "memory_manager.h"
|
#include "memory_manager.h"
|
||||||
|
#include "platform_compat.h"
|
||||||
#include "sound.h"
|
#include "sound.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
@ -9,9 +10,6 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
// 0x5108C0
|
// 0x5108C0
|
||||||
AudioFileIsCompressedProc* _queryCompressedFunc_2 = _defaultCompressionFunc__;
|
AudioFileIsCompressedProc* _queryCompressedFunc_2 = _defaultCompressionFunc__;
|
||||||
|
|
||||||
|
@ -41,7 +39,7 @@ int audioFileSoundDecoderReadHandler(int fileHandle, void* buffer, unsigned int
|
||||||
// 0x41A88C
|
// 0x41A88C
|
||||||
int audioFileOpen(const char* fname, int flags, ...)
|
int audioFileOpen(const char* fname, int flags, ...)
|
||||||
{
|
{
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
strcpy(path, fname);
|
strcpy(path, fname);
|
||||||
|
|
||||||
int compression;
|
int compression;
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include "map.h"
|
#include "map.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "object.h"
|
#include "object.h"
|
||||||
|
#include "platform_compat.h"
|
||||||
#include "text_font.h"
|
#include "text_font.h"
|
||||||
#include "window_manager.h"
|
#include "window_manager.h"
|
||||||
|
|
||||||
|
@ -232,7 +233,7 @@ void automapExit()
|
||||||
{
|
{
|
||||||
char* masterPatchesPath;
|
char* masterPatchesPath;
|
||||||
if (configGetString(&gGameConfig, GAME_CONFIG_SYSTEM_KEY, GAME_CONFIG_MASTER_PATCHES_KEY, &masterPatchesPath)) {
|
if (configGetString(&gGameConfig, GAME_CONFIG_SYSTEM_KEY, GAME_CONFIG_MASTER_PATCHES_KEY, &masterPatchesPath)) {
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "%s\\%s\\%s", masterPatchesPath, "MAPS", AUTOMAP_DB);
|
sprintf(path, "%s\\%s\\%s", masterPatchesPath, "MAPS", AUTOMAP_DB);
|
||||||
remove(path);
|
remove(path);
|
||||||
}
|
}
|
||||||
|
@ -864,7 +865,7 @@ int automapLoadEntry(int map, int elevation)
|
||||||
{
|
{
|
||||||
gAutomapEntry.compressedData = NULL;
|
gAutomapEntry.compressedData = NULL;
|
||||||
|
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "%s\\%s", "MAPS", AUTOMAP_DB);
|
sprintf(path, "%s\\%s", "MAPS", AUTOMAP_DB);
|
||||||
|
|
||||||
bool success = true;
|
bool success = true;
|
||||||
|
@ -1039,7 +1040,7 @@ int automapCreate()
|
||||||
gAutomapHeader.dataSize = 1925;
|
gAutomapHeader.dataSize = 1925;
|
||||||
memcpy(gAutomapHeader.offsets, _defam, sizeof(_defam));
|
memcpy(gAutomapHeader.offsets, _defam, sizeof(_defam));
|
||||||
|
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "%s\\%s", "MAPS", AUTOMAP_DB);
|
sprintf(path, "%s\\%s", "MAPS", AUTOMAP_DB);
|
||||||
|
|
||||||
File* stream = fileOpen(path, "wb");
|
File* stream = fileOpen(path, "wb");
|
||||||
|
@ -1094,7 +1095,7 @@ int _copy_file_data(File* stream1, File* stream2, int length)
|
||||||
// 0x41CE74
|
// 0x41CE74
|
||||||
int automapGetHeader(AutomapHeader** automapHeaderPtr)
|
int automapGetHeader(AutomapHeader** automapHeaderPtr)
|
||||||
{
|
{
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "%s\\%s", "MAPS", AUTOMAP_DB);
|
sprintf(path, "%s\\%s", "MAPS", AUTOMAP_DB);
|
||||||
|
|
||||||
File* stream = fileOpen(path, "rb");
|
File* stream = fileOpen(path, "rb");
|
||||||
|
|
|
@ -988,7 +988,7 @@ int characterEditorWindowInit()
|
||||||
int i;
|
int i;
|
||||||
int v1;
|
int v1;
|
||||||
int v3;
|
int v3;
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
int fid;
|
int fid;
|
||||||
char* str;
|
char* str;
|
||||||
int len;
|
int len;
|
||||||
|
@ -3745,7 +3745,7 @@ int _OptionWindow()
|
||||||
}
|
}
|
||||||
} else if (keyCode == 501 || keyCode == KEY_UPPERCASE_L || keyCode == KEY_LOWERCASE_L) {
|
} else if (keyCode == 501 || keyCode == KEY_UPPERCASE_L || keyCode == KEY_LOWERCASE_L) {
|
||||||
// LOAD
|
// LOAD
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
path[0] = '\0';
|
path[0] = '\0';
|
||||||
strcat(path, "*.");
|
strcat(path, "*.");
|
||||||
strcat(path, "GCD");
|
strcat(path, "GCD");
|
||||||
|
|
|
@ -11,7 +11,8 @@
|
||||||
#include "stat_defs.h"
|
#include "stat_defs.h"
|
||||||
#include "trait_defs.h"
|
#include "trait_defs.h"
|
||||||
|
|
||||||
#define DIALOG_PICKER_NUM_OPTIONS max(PERK_COUNT, TRAIT_COUNT)
|
// TODO: Should be MAX(PERK_COUNT, TRAIT_COUNT).
|
||||||
|
#define DIALOG_PICKER_NUM_OPTIONS PERK_COUNT
|
||||||
#define TOWN_REPUTATION_COUNT 19
|
#define TOWN_REPUTATION_COUNT 19
|
||||||
#define ADDICTION_REPUTATION_COUNT 8
|
#define ADDICTION_REPUTATION_COUNT 8
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include "object.h"
|
#include "object.h"
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
#include "palette.h"
|
#include "palette.h"
|
||||||
|
#include "platform_compat.h"
|
||||||
#include "proto.h"
|
#include "proto.h"
|
||||||
#include "skill.h"
|
#include "skill.h"
|
||||||
#include "stat.h"
|
#include "stat.h"
|
||||||
|
@ -613,7 +614,7 @@ void characterSelectorWindowFree()
|
||||||
// 0x4A7D58
|
// 0x4A7D58
|
||||||
bool characterSelectorWindowRefresh()
|
bool characterSelectorWindowRefresh()
|
||||||
{
|
{
|
||||||
char path[FILENAME_MAX];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "%s.gcd", gPremadeCharacterDescriptions[gCurrentPremadeCharacter].fileName);
|
sprintf(path, "%s.gcd", gPremadeCharacterDescriptions[gCurrentPremadeCharacter].fileName);
|
||||||
if (_proto_dude_init(path) == -1) {
|
if (_proto_dude_init(path) == -1) {
|
||||||
debugPrint("\n ** Error in dude init! **\n");
|
debugPrint("\n ** Error in dude init! **\n");
|
||||||
|
@ -919,7 +920,7 @@ bool characterSelectorWindowRenderBio()
|
||||||
int oldFont = fontGetCurrent();
|
int oldFont = fontGetCurrent();
|
||||||
fontSetCurrent(101);
|
fontSetCurrent(101);
|
||||||
|
|
||||||
char path[FILENAME_MAX];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "%s.bio", gPremadeCharacterDescriptions[gCurrentPremadeCharacter].fileName);
|
sprintf(path, "%s.bio", gPremadeCharacterDescriptions[gCurrentPremadeCharacter].fileName);
|
||||||
|
|
||||||
File* stream = fileOpen(path, "rt");
|
File* stream = fileOpen(path, "rt");
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include "object.h"
|
#include "object.h"
|
||||||
#include "perk.h"
|
#include "perk.h"
|
||||||
#include "pipboy.h"
|
#include "pipboy.h"
|
||||||
|
#include "platform_compat.h"
|
||||||
#include "proto.h"
|
#include "proto.h"
|
||||||
#include "queue.h"
|
#include "queue.h"
|
||||||
#include "random.h"
|
#include "random.h"
|
||||||
|
@ -1864,7 +1865,7 @@ Attack _explosion_ctd;
|
||||||
int combatInit()
|
int combatInit()
|
||||||
{
|
{
|
||||||
int max_action_points;
|
int max_action_points;
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
|
|
||||||
_combat_turn_running = 0;
|
_combat_turn_running = 0;
|
||||||
_combatNumTurns = 0;
|
_combatNumTurns = 0;
|
||||||
|
|
|
@ -3252,7 +3252,7 @@ int aiMessageListInit()
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "%s%s", asc_5186C8, "combatai.msg");
|
sprintf(path, "%s%s", asc_5186C8, "combatai.msg");
|
||||||
|
|
||||||
if (!messageListLoad(&gCombatAiMessageList, path)) {
|
if (!messageListLoad(&gCombatAiMessageList, path)) {
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "message.h"
|
#include "message.h"
|
||||||
#include "palette.h"
|
#include "palette.h"
|
||||||
|
#include "platform_compat.h"
|
||||||
#include "sound.h"
|
#include "sound.h"
|
||||||
#include "text_font.h"
|
#include "text_font.h"
|
||||||
#include "window_manager.h"
|
#include "window_manager.h"
|
||||||
|
@ -52,7 +53,7 @@ void creditsOpen(const char* filePath, int backgroundFid, bool useReversedStyle)
|
||||||
|
|
||||||
soundContinueAll();
|
soundContinueAll();
|
||||||
|
|
||||||
char localizedPath[MAX_PATH];
|
char localizedPath[COMPAT_MAX_PATH];
|
||||||
if (_message_make_path(localizedPath, filePath)) {
|
if (_message_make_path(localizedPath, filePath)) {
|
||||||
gCreditsFile = fileOpen(localizedPath, "rt");
|
gCreditsFile = fileOpen(localizedPath, "rt");
|
||||||
if (gCreditsFile != NULL) {
|
if (gCreditsFile != NULL) {
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "object.h"
|
#include "object.h"
|
||||||
#include "party_member.h"
|
#include "party_member.h"
|
||||||
|
#include "platform_compat.h"
|
||||||
#include "proto.h"
|
#include "proto.h"
|
||||||
#include "queue.h"
|
#include "queue.h"
|
||||||
#include "random.h"
|
#include "random.h"
|
||||||
|
@ -124,7 +125,7 @@ int critterInit()
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "%sscrname.msg", asc_5186C8);
|
sprintf(path, "%sscrname.msg", asc_5186C8);
|
||||||
|
|
||||||
if (!messageListLoad(&gCritterMessageList, path)) {
|
if (!messageListLoad(&gCritterMessageList, path)) {
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include "game.h"
|
#include "game.h"
|
||||||
#include "game_sound.h"
|
#include "game_sound.h"
|
||||||
#include "message.h"
|
#include "message.h"
|
||||||
|
#include "platform_compat.h"
|
||||||
#include "text_font.h"
|
#include "text_font.h"
|
||||||
#include "window_manager.h"
|
#include "window_manager.h"
|
||||||
#include "word_wrap.h"
|
#include "word_wrap.h"
|
||||||
|
@ -205,7 +206,7 @@ int showDialogBox(const char* title, const char** body, int bodyLength, int x, i
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "%s%s", asc_5186C8, "DBOX.MSG");
|
sprintf(path, "%s%s", asc_5186C8, "DBOX.MSG");
|
||||||
|
|
||||||
if (!messageListLoad(&messageList, path)) {
|
if (!messageListLoad(&messageList, path)) {
|
||||||
|
@ -303,7 +304,7 @@ int showDialogBox(const char* title, const char** body, int bodyLength, int x, i
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "%s%s", asc_5186C8, "DBOX.MSG");
|
sprintf(path, "%s%s", asc_5186C8, "DBOX.MSG");
|
||||||
|
|
||||||
if (!messageListLoad(&messageList, path)) {
|
if (!messageListLoad(&messageList, path)) {
|
||||||
|
@ -492,7 +493,7 @@ int _save_file_dialog(char* a1, char** fileList, char* fileName, int fileListLen
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "%s%s", asc_5186C8, "DBOX.MSG");
|
sprintf(path, "%s%s", asc_5186C8, "DBOX.MSG");
|
||||||
|
|
||||||
if (!messageListLoad(&messageList, path)) {
|
if (!messageListLoad(&messageList, path)) {
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
#ifndef DFILE_H
|
#ifndef DFILE_H
|
||||||
#define DFILE_H
|
#define DFILE_H
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#include "platform_compat.h"
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
|
@ -116,13 +115,13 @@ typedef struct DFile {
|
||||||
|
|
||||||
typedef struct DFileFindData {
|
typedef struct DFileFindData {
|
||||||
// The name of file that was found during previous search.
|
// The name of file that was found during previous search.
|
||||||
char fileName[MAX_PATH];
|
char fileName[COMPAT_MAX_PATH];
|
||||||
|
|
||||||
// The pattern to search.
|
// The pattern to search.
|
||||||
//
|
//
|
||||||
// This value is set automatically when [dbaseFindFirstEntry] succeeds so
|
// This value is set automatically when [dbaseFindFirstEntry] succeeds so
|
||||||
// that subsequent calls to [dbaseFindNextEntry] know what to look for.
|
// that subsequent calls to [dbaseFindNextEntry] know what to look for.
|
||||||
char pattern[MAX_PATH];
|
char pattern[COMPAT_MAX_PATH];
|
||||||
|
|
||||||
// The index of entry that was found during previous search.
|
// The index of entry that was found during previous search.
|
||||||
//
|
//
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include "electronic_registration.h"
|
#include "electronic_registration.h"
|
||||||
|
|
||||||
#include "game_config.h"
|
#include "game_config.h"
|
||||||
|
#include "platform_compat.h"
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
@ -11,7 +12,7 @@ void runElectronicRegistration()
|
||||||
int timesRun = 0;
|
int timesRun = 0;
|
||||||
configGetInt(&gGameConfig, GAME_CONFIG_SYSTEM_KEY, GAME_CONFIG_TIMES_RUN_KEY, ×Run);
|
configGetInt(&gGameConfig, GAME_CONFIG_SYSTEM_KEY, GAME_CONFIG_TIMES_RUN_KEY, ×Run);
|
||||||
if (timesRun > 0 && timesRun < 5) {
|
if (timesRun > 0 && timesRun < 5) {
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
if (GetModuleFileNameA(NULL, path, sizeof(path)) != 0) {
|
if (GetModuleFileNameA(NULL, path, sizeof(path)) != 0) {
|
||||||
char* pch = strrchr(path, '\\');
|
char* pch = strrchr(path, '\\');
|
||||||
if (pch == NULL) {
|
if (pch == NULL) {
|
||||||
|
|
|
@ -87,7 +87,7 @@ char gEndgameDeathEndingFileName[40];
|
||||||
bool gEndgameEndingVoiceOverSpeechLoaded;
|
bool gEndgameEndingVoiceOverSpeechLoaded;
|
||||||
|
|
||||||
// 0x570ABC
|
// 0x570ABC
|
||||||
char gEndgameEndingSubtitlesLocalizedPath[MAX_PATH];
|
char gEndgameEndingSubtitlesLocalizedPath[COMPAT_MAX_PATH];
|
||||||
|
|
||||||
// The flag used to denote voice over speech for current slide has ended.
|
// The flag used to denote voice over speech for current slide has ended.
|
||||||
//
|
//
|
||||||
|
@ -580,7 +580,7 @@ void endgameEndingSlideshowWindowFree()
|
||||||
// 0x4401A0
|
// 0x4401A0
|
||||||
void endgameEndingVoiceOverInit(const char* fileBaseName)
|
void endgameEndingVoiceOverInit(const char* fileBaseName)
|
||||||
{
|
{
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
|
|
||||||
// NOTE: Uninline.
|
// NOTE: Uninline.
|
||||||
endgameEndingVoiceOverFree();
|
endgameEndingVoiceOverFree();
|
||||||
|
@ -666,7 +666,7 @@ void endgameEndingLoadPalette(int type, int id)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strlen(fileName) <= 8) {
|
if (strlen(fileName) <= 8) {
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "%s\\%s.pal", "art\\intrface", fileName);
|
sprintf(path, "%s\\%s.pal", "art\\intrface", fileName);
|
||||||
colorPaletteLoad(path);
|
colorPaletteLoad(path);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
#ifndef ENDGAME_H
|
#ifndef ENDGAME_H
|
||||||
#define ENDGAME_H
|
#define ENDGAME_H
|
||||||
|
|
||||||
// Provides [MAX_PATH].
|
#include "platform_compat.h"
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
typedef enum EndgameDeathEndingReason {
|
typedef enum EndgameDeathEndingReason {
|
||||||
// Dude died.
|
// Dude died.
|
||||||
|
@ -46,7 +44,7 @@ extern int gEndgameDeathEndingsLength;
|
||||||
|
|
||||||
extern char gEndgameDeathEndingFileName[40];
|
extern char gEndgameDeathEndingFileName[40];
|
||||||
extern bool gEndgameEndingVoiceOverSpeechLoaded;
|
extern bool gEndgameEndingVoiceOverSpeechLoaded;
|
||||||
extern char gEndgameEndingSubtitlesLocalizedPath[MAX_PATH];
|
extern char gEndgameEndingSubtitlesLocalizedPath[COMPAT_MAX_PATH];
|
||||||
extern bool gEndgameEndingSpeechEnded;
|
extern bool gEndgameEndingSpeechEnded;
|
||||||
extern EndgameEnding* gEndgameEndings;
|
extern EndgameEnding* gEndgameEndings;
|
||||||
extern char** gEndgameEndingSubtitles;
|
extern char** gEndgameEndingSubtitles;
|
||||||
|
|
|
@ -111,7 +111,7 @@ int _critter_db_handle;
|
||||||
// 0x442580
|
// 0x442580
|
||||||
int gameInitWithOptions(const char* windowTitle, bool isMapper, int font, int a4, int argc, char** argv)
|
int gameInitWithOptions(const char* windowTitle, bool isMapper, int font, int a4, int argc, char** argv)
|
||||||
{
|
{
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
|
|
||||||
if (gameMemoryInit() == -1) {
|
if (gameMemoryInit() == -1) {
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -725,7 +725,7 @@ int gameHandleKey(int eventCode, bool isInCombatMode)
|
||||||
|
|
||||||
MessageList messageList;
|
MessageList messageList;
|
||||||
if (messageListInit(&messageList)) {
|
if (messageListInit(&messageList)) {
|
||||||
char path[FILENAME_MAX];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "%s%s", asc_5186C8, "editor.msg");
|
sprintf(path, "%s%s", asc_5186C8, "editor.msg");
|
||||||
|
|
||||||
if (messageListLoad(&messageList, path)) {
|
if (messageListLoad(&messageList, path)) {
|
||||||
|
@ -1162,7 +1162,7 @@ int gameDbInit()
|
||||||
char* main_file_name;
|
char* main_file_name;
|
||||||
char* patch_file_name;
|
char* patch_file_name;
|
||||||
int patch_index;
|
int patch_index;
|
||||||
char filename[MAX_PATH];
|
char filename[COMPAT_MAX_PATH];
|
||||||
|
|
||||||
hashing = 0;
|
hashing = 0;
|
||||||
main_file_name = NULL;
|
main_file_name = NULL;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include "game_config.h"
|
#include "game_config.h"
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
#include "platform_compat.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -19,7 +20,7 @@ Config gGameConfig;
|
||||||
// probably means it's size is 264 bytes.
|
// probably means it's size is 264 bytes.
|
||||||
//
|
//
|
||||||
// 0x58E978
|
// 0x58E978
|
||||||
char gGameConfigFilePath[FILENAME_MAX];
|
char gGameConfigFilePath[COMPAT_MAX_PATH];
|
||||||
|
|
||||||
// Inits main game config.
|
// Inits main game config.
|
||||||
//
|
//
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
#include "movie.h"
|
#include "movie.h"
|
||||||
#include "movie_effect.h"
|
#include "movie_effect.h"
|
||||||
#include "palette.h"
|
#include "palette.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"
|
||||||
|
@ -77,7 +76,7 @@ bool gGameMovieFaded = false;
|
||||||
unsigned char gGameMoviesSeen[MOVIE_COUNT];
|
unsigned char gGameMoviesSeen[MOVIE_COUNT];
|
||||||
|
|
||||||
// 0x596C89
|
// 0x596C89
|
||||||
char gGameMovieSubtitlesFilePath[MAX_PATH];
|
char gGameMovieSubtitlesFilePath[COMPAT_MAX_PATH];
|
||||||
|
|
||||||
// gmovie_init
|
// gmovie_init
|
||||||
// 0x44E5C0
|
// 0x44E5C0
|
||||||
|
@ -145,7 +144,7 @@ int gameMoviePlay(int movie, int flags)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char movieFilePath[MAX_PATH];
|
char movieFilePath[COMPAT_MAX_PATH];
|
||||||
int movieFileSize;
|
int movieFileSize;
|
||||||
bool movieFound = false;
|
bool movieFound = false;
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,7 @@
|
||||||
#define GAME_MOVIE_H
|
#define GAME_MOVIE_H
|
||||||
|
|
||||||
#include "db.h"
|
#include "db.h"
|
||||||
|
#include "platform_compat.h"
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
typedef enum GameMovieFlags {
|
typedef enum GameMovieFlags {
|
||||||
GAME_MOVIE_FADE_IN = 0x01,
|
GAME_MOVIE_FADE_IN = 0x01,
|
||||||
|
@ -41,7 +39,7 @@ extern char* gMoviePaletteFilePaths[MOVIE_COUNT];
|
||||||
extern bool gGameMovieIsPlaying;
|
extern bool gGameMovieIsPlaying;
|
||||||
extern bool gGameMovieFaded;
|
extern bool gGameMovieFaded;
|
||||||
|
|
||||||
extern char gGameMovieSubtitlesFilePath[MAX_PATH];
|
extern char gGameMovieSubtitlesFilePath[COMPAT_MAX_PATH];
|
||||||
extern unsigned char gGameMoviesSeen[MOVIE_COUNT];
|
extern unsigned char gGameMoviesSeen[MOVIE_COUNT];
|
||||||
|
|
||||||
int gameMoviesInit();
|
int gameMoviesInit();
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "movie.h"
|
#include "movie.h"
|
||||||
#include "object.h"
|
#include "object.h"
|
||||||
#include "platform_compat.h"
|
|
||||||
#include "proto.h"
|
#include "proto.h"
|
||||||
#include "queue.h"
|
#include "queue.h"
|
||||||
#include "random.h"
|
#include "random.h"
|
||||||
|
@ -125,7 +124,7 @@ int _detectDevices = -1;
|
||||||
int _lastTime_1 = 0;
|
int _lastTime_1 = 0;
|
||||||
|
|
||||||
// 0x596EB0
|
// 0x596EB0
|
||||||
char _background_fname_copied[MAX_PATH];
|
char _background_fname_copied[COMPAT_MAX_PATH];
|
||||||
|
|
||||||
// 0x596FB5
|
// 0x596FB5
|
||||||
char _sfx_file_name[13];
|
char _sfx_file_name[13];
|
||||||
|
@ -614,7 +613,7 @@ int backgroundSoundLoad(const char* fileName, int a2, int a3, int a4)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char path[MAX_PATH + 1];
|
char path[COMPAT_MAX_PATH + 1];
|
||||||
if (a3 == 13) {
|
if (a3 == 13) {
|
||||||
rc = gameSoundFindBackgroundSoundPath(path, fileName);
|
rc = gameSoundFindBackgroundSoundPath(path, fileName);
|
||||||
} else if (a3 == 14) {
|
} else if (a3 == 14) {
|
||||||
|
@ -838,7 +837,7 @@ int speechGetDuration()
|
||||||
// 0x450CA0
|
// 0x450CA0
|
||||||
int speechLoad(const char* fname, int a2, int a3, int a4)
|
int speechLoad(const char* fname, int a2, int a3, int a4)
|
||||||
{
|
{
|
||||||
char path[MAX_PATH + 1];
|
char path[COMPAT_MAX_PATH + 1];
|
||||||
|
|
||||||
if (!gGameSoundInitialized) {
|
if (!gGameSoundInitialized) {
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -1064,7 +1063,7 @@ Sound* soundEffectLoad(const char* name, Object* object)
|
||||||
|
|
||||||
++_gsound_active_effect_counter;
|
++_gsound_active_effect_counter;
|
||||||
|
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "%s%s%s", _sound_sfx_path, name, ".ACM");
|
sprintf(path, "%s%s%s", _sound_sfx_path, name, ".ACM");
|
||||||
|
|
||||||
if (soundLoad(sound, path) == 0) {
|
if (soundLoad(sound, path) == 0) {
|
||||||
|
@ -1675,7 +1674,7 @@ int _gsound_background_allocate(Sound** soundPtr, int a2, int a3)
|
||||||
int gameSoundFindBackgroundSoundPathWithCopy(char* dest, const char* src)
|
int gameSoundFindBackgroundSoundPathWithCopy(char* dest, const char* src)
|
||||||
{
|
{
|
||||||
size_t len = strlen(src) + strlen(".ACM");
|
size_t len = strlen(src) + strlen(".ACM");
|
||||||
if (strlen(_sound_music_path1) + len > MAX_PATH || strlen(_sound_music_path2) + len > MAX_PATH) {
|
if (strlen(_sound_music_path1) + len > COMPAT_MAX_PATH || strlen(_sound_music_path2) + len > COMPAT_MAX_PATH) {
|
||||||
if (gGameSoundDebugEnabled) {
|
if (gGameSoundDebugEnabled) {
|
||||||
debugPrint("Full background path too long.\n");
|
debugPrint("Full background path too long.\n");
|
||||||
}
|
}
|
||||||
|
@ -1687,11 +1686,11 @@ int gameSoundFindBackgroundSoundPathWithCopy(char* dest, const char* src)
|
||||||
debugPrint(" finding background sound ");
|
debugPrint(" finding background sound ");
|
||||||
}
|
}
|
||||||
|
|
||||||
char outPath[MAX_PATH];
|
char outPath[COMPAT_MAX_PATH];
|
||||||
sprintf(outPath, "%s%s%s", _sound_music_path1, src, ".ACM");
|
sprintf(outPath, "%s%s%s", _sound_music_path1, src, ".ACM");
|
||||||
if (_gsound_file_exists_f(outPath)) {
|
if (_gsound_file_exists_f(outPath)) {
|
||||||
strncpy(dest, outPath, MAX_PATH);
|
strncpy(dest, outPath, COMPAT_MAX_PATH);
|
||||||
dest[MAX_PATH] = '\0';
|
dest[COMPAT_MAX_PATH] = '\0';
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1701,7 +1700,7 @@ int gameSoundFindBackgroundSoundPathWithCopy(char* dest, const char* src)
|
||||||
|
|
||||||
gameSoundDeleteOldMusicFile();
|
gameSoundDeleteOldMusicFile();
|
||||||
|
|
||||||
char inPath[MAX_PATH];
|
char inPath[COMPAT_MAX_PATH];
|
||||||
sprintf(inPath, "%s%s%s", _sound_music_path2, src, ".ACM");
|
sprintf(inPath, "%s%s%s", _sound_music_path2, src, ".ACM");
|
||||||
|
|
||||||
FILE* inStream = fopen(inPath, "rb");
|
FILE* inStream = fopen(inPath, "rb");
|
||||||
|
@ -1764,8 +1763,8 @@ int gameSoundFindBackgroundSoundPathWithCopy(char* dest, const char* src)
|
||||||
|
|
||||||
strcpy(_background_fname_copied, src);
|
strcpy(_background_fname_copied, src);
|
||||||
|
|
||||||
strncpy(dest, outPath, MAX_PATH);
|
strncpy(dest, outPath, COMPAT_MAX_PATH);
|
||||||
dest[MAX_PATH] = '\0';
|
dest[COMPAT_MAX_PATH] = '\0';
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1773,11 +1772,11 @@ int gameSoundFindBackgroundSoundPathWithCopy(char* dest, const char* src)
|
||||||
// 0x451E2C
|
// 0x451E2C
|
||||||
int gameSoundFindBackgroundSoundPath(char* dest, const char* src)
|
int gameSoundFindBackgroundSoundPath(char* dest, const char* src)
|
||||||
{
|
{
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
len = strlen(src) + strlen(".ACM");
|
len = strlen(src) + strlen(".ACM");
|
||||||
if (strlen(_sound_music_path1) + len > MAX_PATH || strlen(_sound_music_path2) + len > MAX_PATH) {
|
if (strlen(_sound_music_path1) + len > COMPAT_MAX_PATH || strlen(_sound_music_path2) + len > COMPAT_MAX_PATH) {
|
||||||
if (gGameSoundDebugEnabled) {
|
if (gGameSoundDebugEnabled) {
|
||||||
debugPrint("Full background path too long.\n");
|
debugPrint("Full background path too long.\n");
|
||||||
}
|
}
|
||||||
|
@ -1791,8 +1790,8 @@ int gameSoundFindBackgroundSoundPath(char* dest, const char* src)
|
||||||
|
|
||||||
sprintf(path, "%s%s%s", _sound_music_path1, src, ".ACM");
|
sprintf(path, "%s%s%s", _sound_music_path1, src, ".ACM");
|
||||||
if (_gsound_file_exists_f(path)) {
|
if (_gsound_file_exists_f(path)) {
|
||||||
strncpy(dest, path, MAX_PATH);
|
strncpy(dest, path, COMPAT_MAX_PATH);
|
||||||
dest[MAX_PATH] = '\0';
|
dest[COMPAT_MAX_PATH] = '\0';
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1802,8 +1801,8 @@ int gameSoundFindBackgroundSoundPath(char* dest, const char* src)
|
||||||
|
|
||||||
sprintf(path, "%s%s%s", _sound_music_path2, src, ".ACM");
|
sprintf(path, "%s%s%s", _sound_music_path2, src, ".ACM");
|
||||||
if (_gsound_file_exists_f(path)) {
|
if (_gsound_file_exists_f(path)) {
|
||||||
strncpy(dest, path, MAX_PATH);
|
strncpy(dest, path, COMPAT_MAX_PATH);
|
||||||
dest[MAX_PATH] = '\0';
|
dest[COMPAT_MAX_PATH] = '\0';
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1817,9 +1816,9 @@ int gameSoundFindBackgroundSoundPath(char* dest, const char* src)
|
||||||
// 0x451F94
|
// 0x451F94
|
||||||
int gameSoundFindSpeechSoundPath(char* dest, const char* src)
|
int gameSoundFindSpeechSoundPath(char* dest, const char* src)
|
||||||
{
|
{
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
|
|
||||||
if (strlen(_sound_speech_path) + strlen(".acm") > MAX_PATH) {
|
if (strlen(_sound_speech_path) + strlen(".acm") > COMPAT_MAX_PATH) {
|
||||||
if (gGameSoundDebugEnabled) {
|
if (gGameSoundDebugEnabled) {
|
||||||
// FIXME: The message is wrong (notes background path, but here
|
// FIXME: The message is wrong (notes background path, but here
|
||||||
// we're dealing with speech path).
|
// we're dealing with speech path).
|
||||||
|
@ -1845,8 +1844,8 @@ int gameSoundFindSpeechSoundPath(char* dest, const char* src)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
strncpy(dest, path, MAX_PATH);
|
strncpy(dest, path, COMPAT_MAX_PATH);
|
||||||
dest[MAX_PATH] = '\0';
|
dest[COMPAT_MAX_PATH] = '\0';
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1856,7 +1855,7 @@ int gameSoundFindSpeechSoundPath(char* dest, const char* src)
|
||||||
void gameSoundDeleteOldMusicFile()
|
void gameSoundDeleteOldMusicFile()
|
||||||
{
|
{
|
||||||
if (_background_fname_copied[0] != '\0') {
|
if (_background_fname_copied[0] != '\0') {
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "%s%s%s", "sound\\music\\", _background_fname_copied, ".ACM");
|
sprintf(path, "%s%s%s", "sound\\music\\", _background_fname_copied, ".ACM");
|
||||||
if (remove(path)) {
|
if (remove(path)) {
|
||||||
if (gGameSoundDebugEnabled) {
|
if (gGameSoundDebugEnabled) {
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#define GAME_SOUND_H
|
#define GAME_SOUND_H
|
||||||
|
|
||||||
#include "obj_types.h"
|
#include "obj_types.h"
|
||||||
|
#include "platform_compat.h"
|
||||||
#include "sound.h"
|
#include "sound.h"
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
@ -71,7 +72,7 @@ extern int gSoundEffectsVolume;
|
||||||
extern int _detectDevices;
|
extern int _detectDevices;
|
||||||
extern int _lastTime_1;
|
extern int _lastTime_1;
|
||||||
|
|
||||||
extern char _background_fname_copied[MAX_PATH];
|
extern char _background_fname_copied[COMPAT_MAX_PATH];
|
||||||
extern char _sfx_file_name[13];
|
extern char _sfx_file_name[13];
|
||||||
extern char gBackgroundSoundFileName[270];
|
extern char gBackgroundSoundFileName[270];
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#include "item.h"
|
#include "item.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "object.h"
|
#include "object.h"
|
||||||
|
#include "platform_compat.h"
|
||||||
#include "proto.h"
|
#include "proto.h"
|
||||||
#include "proto_instance.h"
|
#include "proto_instance.h"
|
||||||
#include "proto_types.h"
|
#include "proto_types.h"
|
||||||
|
@ -2318,7 +2319,7 @@ int indicatorBarInit()
|
||||||
rc = -1;
|
rc = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "%s%s", asc_5186C8, "intrface.msg");
|
sprintf(path, "%s%s", asc_5186C8, "intrface.msg");
|
||||||
|
|
||||||
if (rc != -1) {
|
if (rc != -1) {
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include "map.h"
|
#include "map.h"
|
||||||
#include "object.h"
|
#include "object.h"
|
||||||
#include "perk.h"
|
#include "perk.h"
|
||||||
|
#include "platform_compat.h"
|
||||||
#include "proto.h"
|
#include "proto.h"
|
||||||
#include "proto_instance.h"
|
#include "proto_instance.h"
|
||||||
#include "random.h"
|
#include "random.h"
|
||||||
|
@ -356,7 +357,7 @@ void _inven_reset_dude()
|
||||||
// 0x46E73C
|
// 0x46E73C
|
||||||
int inventoryMessageListInit()
|
int inventoryMessageListInit()
|
||||||
{
|
{
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
|
|
||||||
if (!messageListInit(&gInventoryMessageList))
|
if (!messageListInit(&gInventoryMessageList))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "object.h"
|
#include "object.h"
|
||||||
#include "perk.h"
|
#include "perk.h"
|
||||||
|
#include "platform_compat.h"
|
||||||
#include "proto.h"
|
#include "proto.h"
|
||||||
#include "proto_instance.h"
|
#include "proto_instance.h"
|
||||||
#include "queue.h"
|
#include "queue.h"
|
||||||
|
@ -110,7 +111,7 @@ int itemsInit()
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "%s%s", asc_5186C8, "item.msg");
|
sprintf(path, "%s%s", asc_5186C8, "item.msg");
|
||||||
|
|
||||||
if (!messageListLoad(&gItemsMessageList, path)) {
|
if (!messageListLoad(&gItemsMessageList, path)) {
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "game_sound.h"
|
#include "game_sound.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
#include "platform_compat.h"
|
||||||
#include "sound.h"
|
#include "sound.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -393,7 +394,7 @@ int _lips_make_speech()
|
||||||
gLipsData.field_14 = NULL;
|
gLipsData.field_14 = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
char* v1 = _lips_fix_string(gLipsData.field_50, sizeof(gLipsData.field_50));
|
char* v1 = _lips_fix_string(gLipsData.field_50, sizeof(gLipsData.field_50));
|
||||||
sprintf(path, "%s%s\\%s.%s", "SOUND\\SPEECH\\", _lips_subdir_name, v1, "ACM");
|
sprintf(path, "%s%s\\%s.%s", "SOUND\\SPEECH\\", _lips_subdir_name, v1, "ACM");
|
||||||
|
|
||||||
|
|
|
@ -190,22 +190,22 @@ unsigned char* gLoadSaveFrmData[LOAD_SAVE_FRM_COUNT];
|
||||||
unsigned char* _snapshot;
|
unsigned char* _snapshot;
|
||||||
|
|
||||||
// 0x6142F0
|
// 0x6142F0
|
||||||
char _str2[MAX_PATH];
|
char _str2[COMPAT_MAX_PATH];
|
||||||
|
|
||||||
// 0x6143F4
|
// 0x6143F4
|
||||||
char _str0[MAX_PATH];
|
char _str0[COMPAT_MAX_PATH];
|
||||||
|
|
||||||
// 0x6144F8
|
// 0x6144F8
|
||||||
char _str1[MAX_PATH];
|
char _str1[COMPAT_MAX_PATH];
|
||||||
|
|
||||||
// 0x6145FC
|
// 0x6145FC
|
||||||
char _str[MAX_PATH];
|
char _str[COMPAT_MAX_PATH];
|
||||||
|
|
||||||
// 0x614700
|
// 0x614700
|
||||||
unsigned char* gLoadSaveWindowBuffer;
|
unsigned char* gLoadSaveWindowBuffer;
|
||||||
|
|
||||||
// 0x614704
|
// 0x614704
|
||||||
char _gmpath[MAX_PATH];
|
char _gmpath[COMPAT_MAX_PATH];
|
||||||
|
|
||||||
// 0x614808
|
// 0x614808
|
||||||
File* _flptr;
|
File* _flptr;
|
||||||
|
@ -289,7 +289,7 @@ int lsgSaveGame(int mode)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "%s%s", asc_5186C8, "LSGAME.MSG");
|
sprintf(path, "%s%s", asc_5186C8, "LSGAME.MSG");
|
||||||
if (!messageListLoad(&gLoadSaveMessageList, path)) {
|
if (!messageListLoad(&gLoadSaveMessageList, path)) {
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -687,7 +687,7 @@ int lsgLoadGame(int mode)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "%s\\%s", asc_5186C8, "LSGAME.MSG");
|
sprintf(path, "%s\\%s", asc_5186C8, "LSGAME.MSG");
|
||||||
if (!messageListLoad(&gLoadSaveMessageList, path)) {
|
if (!messageListLoad(&gLoadSaveMessageList, path)) {
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -2132,7 +2132,7 @@ int _GameMap2Slot(File* stream)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
if (_proto_list_str(pid, path) != 0) {
|
if (_proto_list_str(pid, path) != 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -2268,7 +2268,7 @@ int _SlotMap2Game(File* stream)
|
||||||
for (int index = 1; index < gPartyMemberDescriptionsLength; index += 1) {
|
for (int index = 1; index < gPartyMemberDescriptionsLength; index += 1) {
|
||||||
int pid = gPartyMemberPids[index];
|
int pid = gPartyMemberPids[index];
|
||||||
if (pid != -2) {
|
if (pid != -2) {
|
||||||
char protoPath[MAX_PATH];
|
char protoPath[COMPAT_MAX_PATH];
|
||||||
if (_proto_list_str(pid, protoPath) == 0) {
|
if (_proto_list_str(pid, protoPath) == 0) {
|
||||||
const char* basePath = pid >> 24 == OBJ_TYPE_CRITTER
|
const char* basePath = pid >> 24 == OBJ_TYPE_CRITTER
|
||||||
? "PROTO\\CRITTERS"
|
? "PROTO\\CRITTERS"
|
||||||
|
@ -2429,7 +2429,7 @@ out:
|
||||||
// 0x48000C
|
// 0x48000C
|
||||||
void lsgInit()
|
void lsgInit()
|
||||||
{
|
{
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "%s\\", "MAPS");
|
sprintf(path, "%s\\", "MAPS");
|
||||||
_MapDirErase(path, "SAV");
|
_MapDirErase(path, "SAV");
|
||||||
}
|
}
|
||||||
|
@ -2437,7 +2437,7 @@ void lsgInit()
|
||||||
// 0x480040
|
// 0x480040
|
||||||
int _MapDirErase(const char* relativePath, const char* extension)
|
int _MapDirErase(const char* relativePath, const char* extension)
|
||||||
{
|
{
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "%s*.%s", relativePath, extension);
|
sprintf(path, "%s*.%s", relativePath, extension);
|
||||||
|
|
||||||
char** fileList;
|
char** fileList;
|
||||||
|
@ -2454,7 +2454,7 @@ int _MapDirErase(const char* relativePath, const char* extension)
|
||||||
// 0x4800C8
|
// 0x4800C8
|
||||||
int _MapDirEraseFile_(const char* a1, const char* a2)
|
int _MapDirEraseFile_(const char* a1, const char* a2)
|
||||||
{
|
{
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
|
|
||||||
sprintf(path, "%s\\%s%s", _patches, a1, a2);
|
sprintf(path, "%s\\%s%s", _patches, a1, a2);
|
||||||
if (remove(path) != 0) {
|
if (remove(path) != 0) {
|
||||||
|
|
|
@ -5,9 +5,7 @@
|
||||||
#include "db.h"
|
#include "db.h"
|
||||||
#include "geometry.h"
|
#include "geometry.h"
|
||||||
#include "message.h"
|
#include "message.h"
|
||||||
|
#include "platform_compat.h"
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
#define LOAD_SAVE_DESCRIPTION_LENGTH (30)
|
#define LOAD_SAVE_DESCRIPTION_LENGTH (30)
|
||||||
#define LOAD_SAVE_HANDLER_COUNT (27)
|
#define LOAD_SAVE_HANDLER_COUNT (27)
|
||||||
|
@ -103,12 +101,12 @@ extern int _dbleclkcntr;
|
||||||
extern int gLoadSaveWindow;
|
extern int gLoadSaveWindow;
|
||||||
extern unsigned char* gLoadSaveFrmData[LOAD_SAVE_FRM_COUNT];
|
extern unsigned char* gLoadSaveFrmData[LOAD_SAVE_FRM_COUNT];
|
||||||
extern unsigned char* _snapshot;
|
extern unsigned char* _snapshot;
|
||||||
extern char _str2[MAX_PATH];
|
extern char _str2[COMPAT_MAX_PATH];
|
||||||
extern char _str0[MAX_PATH];
|
extern char _str0[COMPAT_MAX_PATH];
|
||||||
extern char _str1[MAX_PATH];
|
extern char _str1[COMPAT_MAX_PATH];
|
||||||
extern char _str[MAX_PATH];
|
extern char _str[COMPAT_MAX_PATH];
|
||||||
extern unsigned char* gLoadSaveWindowBuffer;
|
extern unsigned char* gLoadSaveWindowBuffer;
|
||||||
extern char _gmpath[MAX_PATH];
|
extern char _gmpath[COMPAT_MAX_PATH];
|
||||||
extern File* _flptr;
|
extern File* _flptr;
|
||||||
extern int _ls_error_code;
|
extern int _ls_error_code;
|
||||||
extern int gLoadSaveWindowOldFont;
|
extern int gLoadSaveWindowOldFont;
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#include "object.h"
|
#include "object.h"
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
#include "palette.h"
|
#include "palette.h"
|
||||||
|
#include "platform_compat.h"
|
||||||
#include "random.h"
|
#include "random.h"
|
||||||
#include "scripts.h"
|
#include "scripts.h"
|
||||||
#include "sfall_config.h"
|
#include "sfall_config.h"
|
||||||
|
@ -510,7 +511,7 @@ int _mainDeathGrabTextFile(const char* fileName, char* dest)
|
||||||
language = _aEnglish_2;
|
language = _aEnglish_2;
|
||||||
}
|
}
|
||||||
|
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "text\\%s\\cuts\\%s%s", language, p + 1, ".TXT");
|
sprintf(path, "text\\%s\\cuts\\%s%s", language, p + 1, ".TXT");
|
||||||
|
|
||||||
File* stream = fileOpen(path, "rt");
|
File* stream = fileOpen(path, "rt");
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
#include "object.h"
|
#include "object.h"
|
||||||
#include "palette.h"
|
#include "palette.h"
|
||||||
#include "pipboy.h"
|
#include "pipboy.h"
|
||||||
#include "platform_compat.h"
|
|
||||||
#include "proto.h"
|
#include "proto.h"
|
||||||
#include "proto_instance.h"
|
#include "proto_instance.h"
|
||||||
#include "queue.h"
|
#include "queue.h"
|
||||||
|
@ -131,7 +130,7 @@ char _scratchStr[40];
|
||||||
// Last map file name.
|
// Last map file name.
|
||||||
//
|
//
|
||||||
// 0x631E78
|
// 0x631E78
|
||||||
char _map_path[MAX_PATH];
|
char _map_path[COMPAT_MAX_PATH];
|
||||||
|
|
||||||
// iso_init
|
// iso_init
|
||||||
// 0x481CA0
|
// 0x481CA0
|
||||||
|
@ -261,7 +260,7 @@ void _map_init()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (messageListInit(&gMapMessageList)) {
|
if (messageListInit(&gMapMessageList)) {
|
||||||
char path[FILENAME_MAX];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "%smap.msg", asc_5186C8);
|
sprintf(path, "%smap.msg", asc_5186C8);
|
||||||
|
|
||||||
if (!messageListLoad(&gMapMessageList, path)) {
|
if (!messageListLoad(&gMapMessageList, path)) {
|
||||||
|
@ -876,7 +875,7 @@ int mapLoad(File* stream)
|
||||||
gMapHeader.field_34 = mapGetIndexByFileName(gMapHeader.name);
|
gMapHeader.field_34 = mapGetIndexByFileName(gMapHeader.name);
|
||||||
|
|
||||||
if ((gMapHeader.flags & 1) == 0) {
|
if ((gMapHeader.flags & 1) == 0) {
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "maps\\%s", gMapHeader.name);
|
sprintf(path, "maps\\%s", gMapHeader.name);
|
||||||
|
|
||||||
char* extension = strstr(path, ".MAP");
|
char* extension = strstr(path, ".MAP");
|
||||||
|
@ -1443,7 +1442,7 @@ int _map_save_in_game(bool a1)
|
||||||
// 0x483E28
|
// 0x483E28
|
||||||
void mapMakeMapsDirectory()
|
void mapMakeMapsDirectory()
|
||||||
{
|
{
|
||||||
char path[FILENAME_MAX];
|
char path[COMPAT_MAX_PATH];
|
||||||
|
|
||||||
char* masterPatchesPath;
|
char* masterPatchesPath;
|
||||||
if (configGetString(&gGameConfig, GAME_CONFIG_SYSTEM_KEY, GAME_CONFIG_MASTER_PATCHES_KEY, &masterPatchesPath)) {
|
if (configGetString(&gGameConfig, GAME_CONFIG_SYSTEM_KEY, GAME_CONFIG_MASTER_PATCHES_KEY, &masterPatchesPath)) {
|
||||||
|
|
|
@ -6,9 +6,7 @@
|
||||||
#include "geometry.h"
|
#include "geometry.h"
|
||||||
#include "map_defs.h"
|
#include "map_defs.h"
|
||||||
#include "message.h"
|
#include "message.h"
|
||||||
|
#include "platform_compat.h"
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
#define ORIGINAL_ISO_WINDOW_WIDTH 640
|
#define ORIGINAL_ISO_WINDOW_WIDTH 640
|
||||||
#define ORIGINAL_ISO_WINDOW_HEIGHT 380
|
#define ORIGINAL_ISO_WINDOW_HEIGHT 380
|
||||||
|
@ -91,7 +89,7 @@ extern MapHeader gMapHeader;
|
||||||
extern TileData* _square[ELEVATION_COUNT];
|
extern TileData* _square[ELEVATION_COUNT];
|
||||||
extern int gIsoWindow;
|
extern int gIsoWindow;
|
||||||
extern char _scratchStr[40];
|
extern char _scratchStr[40];
|
||||||
extern char _map_path[MAX_PATH];
|
extern char _map_path[COMPAT_MAX_PATH];
|
||||||
|
|
||||||
int isoInit();
|
int isoInit();
|
||||||
void isoReset();
|
void isoReset();
|
||||||
|
|
|
@ -167,7 +167,7 @@ bool messageListFree(MessageList* messageList)
|
||||||
bool messageListLoad(MessageList* messageList, const char* path)
|
bool messageListLoad(MessageList* messageList, const char* path)
|
||||||
{
|
{
|
||||||
char* language;
|
char* language;
|
||||||
char localized_path[FILENAME_MAX];
|
char localized_path[COMPAT_MAX_PATH];
|
||||||
File* file_ptr;
|
File* file_ptr;
|
||||||
char num[1024];
|
char num[1024];
|
||||||
char audio[1024];
|
char audio[1024];
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include "memory_manager.h"
|
#include "memory_manager.h"
|
||||||
#include "movie_effect.h"
|
#include "movie_effect.h"
|
||||||
#include "movie_lib.h"
|
#include "movie_lib.h"
|
||||||
|
#include "platform_compat.h"
|
||||||
#include "sound.h"
|
#include "sound.h"
|
||||||
#include "text_font.h"
|
#include "text_font.h"
|
||||||
#include "window_manager.h"
|
#include "window_manager.h"
|
||||||
|
@ -521,7 +522,7 @@ void movieLoadSubtitles(char* filePath)
|
||||||
filePath = gMovieBuildSubtitleFilePathProc(filePath);
|
filePath = gMovieBuildSubtitleFilePathProc(filePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
strcpy(path, filePath);
|
strcpy(path, filePath);
|
||||||
|
|
||||||
debugPrint("Opening subtitle file %s\n", path);
|
debugPrint("Opening subtitle file %s\n", path);
|
||||||
|
|
|
@ -93,7 +93,7 @@ int movieEffectsLoad(const char* filePath)
|
||||||
|
|
||||||
int rc = -1;
|
int rc = -1;
|
||||||
|
|
||||||
char path[FILENAME_MAX];
|
char path[COMPAT_MAX_PATH];
|
||||||
strcpy(path, filePath);
|
strcpy(path, filePath);
|
||||||
|
|
||||||
char* pch = strrchr(path, '.');
|
char* pch = strrchr(path, '.');
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include "grayscale.h"
|
#include "grayscale.h"
|
||||||
#include "loadsave.h"
|
#include "loadsave.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
#include "platform_compat.h"
|
||||||
#include "scripts.h"
|
#include "scripts.h"
|
||||||
#include "text_font.h"
|
#include "text_font.h"
|
||||||
#include "text_object.h"
|
#include "text_object.h"
|
||||||
|
@ -453,7 +454,7 @@ int optionsWindowInit()
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "%s%s", asc_5186C8, "options.msg");
|
sprintf(path, "%s%s", asc_5186C8, "options.msg");
|
||||||
if (!messageListLoad(&gOptionsMessageList, path)) {
|
if (!messageListLoad(&gOptionsMessageList, path)) {
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -633,7 +634,7 @@ int showPause(bool a1)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "%s%s", asc_5186C8, "options.msg");
|
sprintf(path, "%s%s", asc_5186C8, "options.msg");
|
||||||
if (!messageListLoad(&gOptionsMessageList, path)) {
|
if (!messageListLoad(&gOptionsMessageList, path)) {
|
||||||
// FIXME: Leaking graphics.
|
// FIXME: Leaking graphics.
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "object.h"
|
#include "object.h"
|
||||||
#include "party_member.h"
|
#include "party_member.h"
|
||||||
|
#include "platform_compat.h"
|
||||||
#include "skill.h"
|
#include "skill.h"
|
||||||
#include "stat.h"
|
#include "stat.h"
|
||||||
|
|
||||||
|
@ -164,7 +165,7 @@ int perksInit()
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "%s%s", asc_5186C8, "perk.msg");
|
sprintf(path, "%s%s", asc_5186C8, "perk.msg");
|
||||||
|
|
||||||
if (!messageListLoad(&gPerksMessageList, path)) {
|
if (!messageListLoad(&gPerksMessageList, path)) {
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include "map.h"
|
#include "map.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "object.h"
|
#include "object.h"
|
||||||
|
#include "platform_compat.h"
|
||||||
#include "queue.h"
|
#include "queue.h"
|
||||||
#include "random.h"
|
#include "random.h"
|
||||||
#include "scripts.h"
|
#include "scripts.h"
|
||||||
|
@ -315,7 +316,7 @@ int pipboyWindowInit(bool forceRest)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "%s%s", asc_5186C8, "pipboy.msg");
|
sprintf(path, "%s%s", asc_5186C8, "pipboy.msg");
|
||||||
|
|
||||||
if (!(messageListLoad(&gPipboyMessageList, path))) {
|
if (!(messageListLoad(&gPipboyMessageList, path))) {
|
||||||
|
|
|
@ -4,6 +4,12 @@
|
||||||
// TODO: This is compatibility cross-platform layer. Designed to have minimal
|
// TODO: This is compatibility cross-platform layer. Designed to have minimal
|
||||||
// impact on the codebase. Remove once it's no longer needed.
|
// impact on the codebase. Remove once it's no longer needed.
|
||||||
|
|
||||||
|
// A naive cross-platform MAX_PATH/PATH_MAX/MAX_PATH drop-in replacement.
|
||||||
|
//
|
||||||
|
// TODO: Remove when we migrate to use std::filesystem::path or std::string to
|
||||||
|
// represent paths across the codebase.
|
||||||
|
#define COMPAT_MAX_PATH 260
|
||||||
|
|
||||||
int compat_stricmp(const char* string1, const char* string2);
|
int compat_stricmp(const char* string1, const char* string2);
|
||||||
int compat_strnicmp(const char* string1, const char* string2, size_t size);
|
int compat_strnicmp(const char* string1, const char* string2, size_t size);
|
||||||
char* compat_strupr(char* string);
|
char* compat_strupr(char* string);
|
||||||
|
|
12
src/proto.cc
12
src/proto.cc
|
@ -33,7 +33,7 @@ char _aDrugStatSpecia[] = "Drug Stat (Special)";
|
||||||
char _aNone_1[] = "None";
|
char _aNone_1[] = "None";
|
||||||
|
|
||||||
// 0x51C18C
|
// 0x51C18C
|
||||||
char _cd_path_base[MAX_PATH];
|
char _cd_path_base[COMPAT_MAX_PATH];
|
||||||
|
|
||||||
// 0x51C290
|
// 0x51C290
|
||||||
ProtoList _protoLists[11] = {
|
ProtoList _protoLists[11] = {
|
||||||
|
@ -173,8 +173,8 @@ char** _critter_stats_list;
|
||||||
// 0x49E758
|
// 0x49E758
|
||||||
int _proto_list_str(int pid, char* proto_path)
|
int _proto_list_str(int pid, char* proto_path)
|
||||||
{
|
{
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
char str[MAX_PATH];
|
char str[COMPAT_MAX_PATH];
|
||||||
char* pch;
|
char* pch;
|
||||||
File* stream;
|
File* stream;
|
||||||
int i;
|
int i;
|
||||||
|
@ -1037,7 +1037,7 @@ int protoInit()
|
||||||
char* master_patches;
|
char* master_patches;
|
||||||
int len;
|
int len;
|
||||||
MessageListItem messageListItem;
|
MessageListItem messageListItem;
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (!configGetString(&gGameConfig, GAME_CONFIG_SYSTEM_KEY, GAME_CONFIG_MASTER_PATCHES_KEY, &master_patches)) {
|
if (!configGetString(&gGameConfig, GAME_CONFIG_SYSTEM_KEY, GAME_CONFIG_MASTER_PATCHES_KEY, &master_patches)) {
|
||||||
|
@ -1215,7 +1215,7 @@ int _proto_header_load()
|
||||||
ptr->length = 0;
|
ptr->length = 0;
|
||||||
ptr->max_entries_num = 1;
|
ptr->max_entries_num = 1;
|
||||||
|
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
strcpy(path, _cd_path_base);
|
strcpy(path, _cd_path_base);
|
||||||
strcat(path, _proto_path_base);
|
strcat(path, _proto_path_base);
|
||||||
strcat(path, artGetObjectTypeName(index));
|
strcat(path, artGetObjectTypeName(index));
|
||||||
|
@ -1654,7 +1654,7 @@ int _proto_save_pid(int pid)
|
||||||
// 0x4A1C3C
|
// 0x4A1C3C
|
||||||
int _proto_load_pid(int pid, Proto** protoPtr)
|
int _proto_load_pid(int pid, Proto** protoPtr)
|
||||||
{
|
{
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
strcpy(path, _cd_path_base);
|
strcpy(path, _cd_path_base);
|
||||||
|
|
||||||
strcat(path, "proto\\");
|
strcat(path, "proto\\");
|
||||||
|
|
|
@ -5,13 +5,11 @@
|
||||||
#include "message.h"
|
#include "message.h"
|
||||||
#include "obj_types.h"
|
#include "obj_types.h"
|
||||||
#include "perk_defs.h"
|
#include "perk_defs.h"
|
||||||
|
#include "platform_compat.h"
|
||||||
#include "proto_types.h"
|
#include "proto_types.h"
|
||||||
#include "skill_defs.h"
|
#include "skill_defs.h"
|
||||||
#include "stat_defs.h"
|
#include "stat_defs.h"
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
typedef enum ItemDataMember {
|
typedef enum ItemDataMember {
|
||||||
ITEM_DATA_MEMBER_PID = 0,
|
ITEM_DATA_MEMBER_PID = 0,
|
||||||
ITEM_DATA_MEMBER_NAME = 1,
|
ITEM_DATA_MEMBER_NAME = 1,
|
||||||
|
@ -97,7 +95,7 @@ typedef enum PrototypeMessage {
|
||||||
|
|
||||||
extern char _aProto_0[];
|
extern char _aProto_0[];
|
||||||
|
|
||||||
extern char _cd_path_base[MAX_PATH];
|
extern char _cd_path_base[COMPAT_MAX_PATH];
|
||||||
extern ProtoList _protoLists[11];
|
extern ProtoList _protoLists[11];
|
||||||
extern const size_t _proto_sizes[11];
|
extern const size_t _proto_sizes[11];
|
||||||
extern int _protos_been_initialized;
|
extern int _protos_been_initialized;
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include "game_movie.h"
|
#include "game_movie.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "object.h"
|
#include "object.h"
|
||||||
|
#include "platform_compat.h"
|
||||||
#include "proto.h"
|
#include "proto.h"
|
||||||
#include "proto_instance.h"
|
#include "proto_instance.h"
|
||||||
#include "queue.h"
|
#include "queue.h"
|
||||||
|
@ -596,7 +597,7 @@ int scriptSetActionBeingUsed(int sid, int value)
|
||||||
// 0x4A3B74
|
// 0x4A3B74
|
||||||
Program* scriptsCreateProgramByName(const char* name)
|
Program* scriptsCreateProgramByName(const char* name)
|
||||||
{
|
{
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
|
|
||||||
strcpy(path, _cd_path_base);
|
strcpy(path, _cd_path_base);
|
||||||
strcat(path, gScriptsBasePath);
|
strcat(path, gScriptsBasePath);
|
||||||
|
@ -1291,7 +1292,7 @@ bool scriptHasProc(int sid, int proc)
|
||||||
// 0x4A4D50
|
// 0x4A4D50
|
||||||
int scriptsLoadScriptsList()
|
int scriptsLoadScriptsList()
|
||||||
{
|
{
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "%s%s", "scripts\\", "scripts.lst");
|
sprintf(path, "%s%s", "scripts\\", "scripts.lst");
|
||||||
|
|
||||||
File* stream = fileOpen(path, "rt");
|
File* stream = fileOpen(path, "rt");
|
||||||
|
@ -1477,7 +1478,7 @@ int _scr_reset()
|
||||||
int _scr_game_init()
|
int _scr_game_init()
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
|
|
||||||
if (!messageListInit(&gScrMessageList)) {
|
if (!messageListInit(&gScrMessageList)) {
|
||||||
debugPrint("\nError initing script message file!");
|
debugPrint("\nError initing script message file!");
|
||||||
|
@ -1666,7 +1667,7 @@ int _scr_header_load()
|
||||||
{
|
{
|
||||||
_num_script_indexes = 0;
|
_num_script_indexes = 0;
|
||||||
|
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
strcpy(path, _cd_path_base);
|
strcpy(path, _cd_path_base);
|
||||||
strcat(path, gScriptsBasePath);
|
strcat(path, gScriptsBasePath);
|
||||||
strcat(path, "scripts.lst");
|
strcat(path, "scripts.lst");
|
||||||
|
@ -2590,7 +2591,7 @@ int scriptsGetMessageList(int a1, MessageList** messageListPtr)
|
||||||
*pch = '\0';
|
*pch = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "dialog\\%s.msg", scriptName);
|
sprintf(path, "dialog\\%s.msg", scriptName);
|
||||||
|
|
||||||
if (!messageListLoad(messageList, path)) {
|
if (!messageListLoad(messageList, path)) {
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#include "sfall_config.h"
|
#include "sfall_config.h"
|
||||||
|
|
||||||
|
#include "platform_compat.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
@ -21,7 +23,7 @@ bool sfallConfigInit(int argc, char** argv)
|
||||||
// Initialize defaults.
|
// Initialize defaults.
|
||||||
configSetString(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_STARTING_MAP_KEY, "");
|
configSetString(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_STARTING_MAP_KEY, "");
|
||||||
|
|
||||||
char path[FILENAME_MAX];
|
char path[COMPAT_MAX_PATH];
|
||||||
char* executable = argv[0];
|
char* executable = argv[0];
|
||||||
char* ch = strrchr(executable, '\\');
|
char* ch = strrchr(executable, '\\');
|
||||||
if (ch != NULL) {
|
if (ch != NULL) {
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include "party_member.h"
|
#include "party_member.h"
|
||||||
#include "perk.h"
|
#include "perk.h"
|
||||||
#include "pipboy.h"
|
#include "pipboy.h"
|
||||||
|
#include "platform_compat.h"
|
||||||
#include "proto.h"
|
#include "proto.h"
|
||||||
#include "random.h"
|
#include "random.h"
|
||||||
#include "scripts.h"
|
#include "scripts.h"
|
||||||
|
@ -96,7 +97,7 @@ int skillsInit()
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "%s%s", asc_5186C8, "skill.msg");
|
sprintf(path, "%s%s", asc_5186C8, "skill.msg");
|
||||||
|
|
||||||
if (!messageListLoad(&gSkillsMessageList, path)) {
|
if (!messageListLoad(&gSkillsMessageList, path)) {
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include "map.h"
|
#include "map.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "object.h"
|
#include "object.h"
|
||||||
|
#include "platform_compat.h"
|
||||||
#include "skill.h"
|
#include "skill.h"
|
||||||
#include "text_font.h"
|
#include "text_font.h"
|
||||||
#include "window_manager.h"
|
#include "window_manager.h"
|
||||||
|
@ -122,7 +123,7 @@ int skilldexWindowInit()
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char path[FILENAME_MAX];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "%s%s", asc_5186C8, "skilldex.msg");
|
sprintf(path, "%s%s", asc_5186C8, "skilldex.msg");
|
||||||
|
|
||||||
if (!messageListLoad(&gSkilldexMessageList, path)) {
|
if (!messageListLoad(&gSkilldexMessageList, path)) {
|
||||||
|
|
|
@ -50,7 +50,7 @@ bool soundEffectsListIsValidTag(int a1)
|
||||||
// 0x4A98F4
|
// 0x4A98F4
|
||||||
int soundEffectsListInit(const char* soundEffectsPath, int a2, int debugLevel)
|
int soundEffectsListInit(const char* soundEffectsPath, int a2, int debugLevel)
|
||||||
{
|
{
|
||||||
char path[FILENAME_MAX];
|
char path[COMPAT_MAX_PATH];
|
||||||
|
|
||||||
// TODO: What for?
|
// TODO: What for?
|
||||||
// memcpy(path, byte_4A97E0, 0xFF);
|
// memcpy(path, byte_4A97E0, 0xFF);
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "object.h"
|
#include "object.h"
|
||||||
#include "perk.h"
|
#include "perk.h"
|
||||||
|
#include "platform_compat.h"
|
||||||
#include "proto.h"
|
#include "proto.h"
|
||||||
#include "random.h"
|
#include "random.h"
|
||||||
#include "scripts.h"
|
#include "scripts.h"
|
||||||
|
@ -92,7 +93,7 @@ int statsInit()
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "%s%s", asc_5186C8, "stat.msg");
|
sprintf(path, "%s%s", asc_5186C8, "stat.msg");
|
||||||
|
|
||||||
if (!messageListLoad(&gStatsMessageList, path)) {
|
if (!messageListLoad(&gStatsMessageList, path)) {
|
||||||
|
|
|
@ -3,13 +3,11 @@
|
||||||
#include "color.h"
|
#include "color.h"
|
||||||
#include "db.h"
|
#include "db.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
#include "platform_compat.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
// 0x4D5530
|
// 0x4D5530
|
||||||
FontManager gTextFontManager = {
|
FontManager gTextFontManager = {
|
||||||
0,
|
0,
|
||||||
|
@ -112,7 +110,7 @@ int textFontLoad(int font)
|
||||||
{
|
{
|
||||||
int rc = -1;
|
int rc = -1;
|
||||||
|
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "font%d.fon", font);
|
sprintf(path, "font%d.fon", font);
|
||||||
|
|
||||||
// NOTE: Original code is slightly different. It uses deep nesting and
|
// NOTE: Original code is slightly different. It uses deep nesting and
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include "game.h"
|
#include "game.h"
|
||||||
#include "object.h"
|
#include "object.h"
|
||||||
|
#include "platform_compat.h"
|
||||||
#include "skill.h"
|
#include "skill.h"
|
||||||
#include "stat.h"
|
#include "stat.h"
|
||||||
|
|
||||||
|
@ -42,7 +43,7 @@ int traitsInit()
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char path[FILENAME_MAX];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "%s%s", asc_5186C8, "trait.msg");
|
sprintf(path, "%s%s", asc_5186C8, "trait.msg");
|
||||||
|
|
||||||
if (!messageListLoad(&gTraitsMessageList, path)) {
|
if (!messageListLoad(&gTraitsMessageList, path)) {
|
||||||
|
|
|
@ -498,7 +498,7 @@ void _removeProgramReferences_3(Program* program)
|
||||||
// 0x4B9190
|
// 0x4B9190
|
||||||
void _initWindow(int resolution, int a2)
|
void _initWindow(int resolution, int a2)
|
||||||
{
|
{
|
||||||
char err[MAX_PATH];
|
char err[COMPAT_MAX_PATH];
|
||||||
int rc;
|
int rc;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
|
|
|
@ -612,7 +612,7 @@ int gEncounterTablesLength;
|
||||||
// 0x4BC89C
|
// 0x4BC89C
|
||||||
int worldmapInit()
|
int worldmapInit()
|
||||||
{
|
{
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
|
|
||||||
if (_wmGenDataInit() == -1) {
|
if (_wmGenDataInit() == -1) {
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -4028,7 +4028,7 @@ int _wmGrabTileWalkMask(int tile)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char path[MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "data\\%s.msk", tileInfo->walkMaskName);
|
sprintf(path, "data\\%s.msk", tileInfo->walkMaskName);
|
||||||
|
|
||||||
File* stream = fileOpen(path, "rb");
|
File* stream = fileOpen(path, "rb");
|
||||||
|
|
15
src/xfile.cc
15
src/xfile.cc
|
@ -1,7 +1,6 @@
|
||||||
#include "xfile.h"
|
#include "xfile.h"
|
||||||
|
|
||||||
#include "file_find.h"
|
#include "file_find.h"
|
||||||
#include "platform_compat.h"
|
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <direct.h>
|
#include <direct.h>
|
||||||
|
@ -60,7 +59,7 @@ XFile* xfileOpen(const char* filePath, const char* mode)
|
||||||
char dir[_MAX_DIR];
|
char dir[_MAX_DIR];
|
||||||
_splitpath(filePath, drive, dir, NULL, NULL);
|
_splitpath(filePath, drive, dir, NULL, NULL);
|
||||||
|
|
||||||
char path[FILENAME_MAX];
|
char path[COMPAT_MAX_PATH];
|
||||||
if (drive[0] != '\0' || dir[0] == '\\' || dir[0] == '/' || dir[0] == '.') {
|
if (drive[0] != '\0' || dir[0] == '\\' || dir[0] == '/' || dir[0] == '.') {
|
||||||
// [filePath] is an absolute path. Attempt to open as plain stream.
|
// [filePath] is an absolute path. Attempt to open as plain stream.
|
||||||
stream->file = fopen(filePath, mode);
|
stream->file = fopen(filePath, mode);
|
||||||
|
@ -505,8 +504,8 @@ bool xbaseOpen(const char* path)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
char workingDirectory[FILENAME_MAX];
|
char workingDirectory[COMPAT_MAX_PATH];
|
||||||
if (getcwd(workingDirectory, FILENAME_MAX) == NULL) {
|
if (getcwd(workingDirectory, COMPAT_MAX_PATH) == NULL) {
|
||||||
// FIXME: Leaking xbase and path.
|
// FIXME: Leaking xbase and path.
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -600,7 +599,7 @@ bool xlistEnumerate(const char* pattern, XListEnumerationHandler* handler, XList
|
||||||
dbaseFindClose(xbase->dbase, &dbaseFindData);
|
dbaseFindClose(xbase->dbase, &dbaseFindData);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
char path[FILENAME_MAX];
|
char path[COMPAT_MAX_PATH];
|
||||||
sprintf(path, "%s\\%s", xbase->path, pattern);
|
sprintf(path, "%s\\%s", xbase->path, pattern);
|
||||||
|
|
||||||
if (fileFindFirst(path, &directoryFileFindData)) {
|
if (fileFindFirst(path, &directoryFileFindData)) {
|
||||||
|
@ -704,8 +703,8 @@ void xlistFree(XList* xlist)
|
||||||
// 0x4DFFAC
|
// 0x4DFFAC
|
||||||
int xbaseMakeDirectory(const char* filePath)
|
int xbaseMakeDirectory(const char* filePath)
|
||||||
{
|
{
|
||||||
char workingDirectory[FILENAME_MAX];
|
char workingDirectory[COMPAT_MAX_PATH];
|
||||||
if (getcwd(workingDirectory, FILENAME_MAX) == NULL) {
|
if (getcwd(workingDirectory, COMPAT_MAX_PATH) == NULL) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -713,7 +712,7 @@ int xbaseMakeDirectory(const char* filePath)
|
||||||
char dir[_MAX_DIR];
|
char dir[_MAX_DIR];
|
||||||
_splitpath(filePath, drive, dir, NULL, NULL);
|
_splitpath(filePath, drive, dir, NULL, NULL);
|
||||||
|
|
||||||
char path[FILENAME_MAX];
|
char path[COMPAT_MAX_PATH];
|
||||||
if (drive[0] != '\0' || dir[0] == '\\' || dir[0] == '/' || dir[0] == '.') {
|
if (drive[0] != '\0' || dir[0] == '\\' || dir[0] == '/' || dir[0] == '.') {
|
||||||
// [filePath] is an absolute path.
|
// [filePath] is an absolute path.
|
||||||
strcpy(path, filePath);
|
strcpy(path, filePath);
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
|
|
||||||
#include "dfile.h"
|
#include "dfile.h"
|
||||||
|
|
||||||
|
#include "platform_compat.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
|
|
||||||
|
@ -51,7 +53,7 @@ typedef enum XFileEnumerationEntryType {
|
||||||
} XFileEnumerationEntryType;
|
} XFileEnumerationEntryType;
|
||||||
|
|
||||||
typedef struct XListEnumerationContext {
|
typedef struct XListEnumerationContext {
|
||||||
char name[FILENAME_MAX];
|
char name[COMPAT_MAX_PATH];
|
||||||
unsigned char type;
|
unsigned char type;
|
||||||
XList* xlist;
|
XList* xlist;
|
||||||
} XListEnumerationContext;
|
} XListEnumerationContext;
|
||||||
|
|
Loading…
Reference in New Issue