Reconcile worldmap.cc
This commit is contained in:
parent
d7bc8e4176
commit
e5992779f3
|
@ -4542,7 +4542,7 @@ static int characterPrintToFile(const char* fileName)
|
|||
// SFALL
|
||||
for (int index = 0; index < gCustomTownReputationEntries.size(); index++) {
|
||||
const TownReputationEntry* pair = &(gCustomTownReputationEntries[index]);
|
||||
if (_wmAreaIsKnown(pair->city)) {
|
||||
if (wmAreaIsKnown(pair->city)) {
|
||||
if (!hasTownReputationHeading) {
|
||||
fileWriteString("\n", stream);
|
||||
|
||||
|
@ -4552,7 +4552,7 @@ static int characterPrintToFile(const char* fileName)
|
|||
hasTownReputationHeading = true;
|
||||
}
|
||||
|
||||
_wmGetAreaIdxName(pair->city, title2);
|
||||
wmGetAreaIdxName(pair->city, title2);
|
||||
|
||||
int townReputation = gGameGlobalVars[pair->gvar];
|
||||
|
||||
|
@ -5531,7 +5531,7 @@ static void characterEditorDrawKarmaFolder()
|
|||
// SFALL
|
||||
for (int index = 0; index < gCustomTownReputationEntries.size(); index++) {
|
||||
const TownReputationEntry* pair = &(gCustomTownReputationEntries[index]);
|
||||
if (_wmAreaIsKnown(pair->city)) {
|
||||
if (wmAreaIsKnown(pair->city)) {
|
||||
if (!hasTownReputationHeading) {
|
||||
msg = getmsg(&gCharacterEditorMessageList, &gCharacterEditorMessageListItem, 4000);
|
||||
if (characterEditorFolderViewDrawHeading(msg)) {
|
||||
|
@ -5544,7 +5544,7 @@ static void characterEditorDrawKarmaFolder()
|
|||
}
|
||||
|
||||
char cityShortName[40];
|
||||
_wmGetAreaIdxName(pair->city, cityShortName);
|
||||
wmGetAreaIdxName(pair->city, cityShortName);
|
||||
|
||||
int townReputation = gGameGlobalVars[pair->gvar];
|
||||
|
||||
|
|
|
@ -1303,7 +1303,7 @@ int _critter_set_who_hit_me(Object* a1, Object* a2)
|
|||
bool _critter_can_obj_dude_rest()
|
||||
{
|
||||
bool v1 = false;
|
||||
if (!_wmMapCanRestHere(gElevation)) {
|
||||
if (!wmMapCanRestHere(gElevation)) {
|
||||
v1 = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1158,13 +1158,13 @@ static int endgameDeathEndingValidate(int* percentage)
|
|||
}
|
||||
|
||||
if (deathEnding->worldAreaKnown != -1) {
|
||||
if (!_wmAreaIsKnown(deathEnding->worldAreaKnown)) {
|
||||
if (!wmAreaIsKnown(deathEnding->worldAreaKnown)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (deathEnding->worldAreaNotKnown != -1) {
|
||||
if (_wmAreaIsKnown(deathEnding->worldAreaNotKnown)) {
|
||||
if (wmAreaIsKnown(deathEnding->worldAreaNotKnown)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -268,7 +268,7 @@ int gameInitWithOptions(const char* windowTitle, bool isMapper, int font, int a4
|
|||
|
||||
debugPrint(">scr_game_init\t");
|
||||
|
||||
if (worldmapInit() != 0) {
|
||||
if (wmWorldMap_init() != 0) {
|
||||
debugPrint("Failed on wmWorldMap_init\n");
|
||||
return -1;
|
||||
}
|
||||
|
@ -376,7 +376,7 @@ void gameReset()
|
|||
_scr_reset();
|
||||
gameLoadGlobalVars();
|
||||
scriptsReset();
|
||||
worldmapReset();
|
||||
wmWorldMap_reset();
|
||||
partyMembersReset();
|
||||
characterEditorInit();
|
||||
pipboyReset();
|
||||
|
@ -425,7 +425,7 @@ void gameExit()
|
|||
badwordsExit();
|
||||
automapExit();
|
||||
paletteExit();
|
||||
worldmapExit();
|
||||
wmWorldMap_exit();
|
||||
partyMembersExit();
|
||||
endgameDeathEndingExit();
|
||||
interfaceFontsExit();
|
||||
|
|
|
@ -2105,8 +2105,8 @@ int ambientSoundEffectEventProcess(Object* a1, void* data)
|
|||
if (soundEffectEvent != NULL) {
|
||||
ambientSoundEffectIndex = soundEffectEvent->ambientSoundEffectIndex;
|
||||
} else {
|
||||
if (ambientSoundEffectGetLength() > 0) {
|
||||
ambientSoundEffectIndex = ambientSoundEffectGetRandom();
|
||||
if (wmSfxMaxCount() > 0) {
|
||||
ambientSoundEffectIndex = wmSfxRollNextIdx();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2120,8 +2120,8 @@ int ambientSoundEffectEventProcess(Object* a1, void* data)
|
|||
}
|
||||
|
||||
int delay = 10 * randomBetween(15, 20);
|
||||
if (ambientSoundEffectGetLength() > 0) {
|
||||
nextSoundEffectEvent->ambientSoundEffectIndex = ambientSoundEffectGetRandom();
|
||||
if (wmSfxMaxCount() > 0) {
|
||||
nextSoundEffectEvent->ambientSoundEffectIndex = wmSfxRollNextIdx();
|
||||
if (queueAddEvent(delay, NULL, nextSoundEffectEvent, EVENT_TYPE_GSOUND_SFX_EVENT) == -1) {
|
||||
return -1;
|
||||
}
|
||||
|
@ -2133,7 +2133,7 @@ int ambientSoundEffectEventProcess(Object* a1, void* data)
|
|||
|
||||
if (ambientSoundEffectIndex != -1) {
|
||||
char* fileName;
|
||||
if (ambientSoundEffectGetName(ambientSoundEffectIndex, &fileName) == 0) {
|
||||
if (wmSfxIdxName(ambientSoundEffectIndex, &fileName) == 0) {
|
||||
int v7 = _get_bk_time();
|
||||
if (getTicksBetween(v7, _lastTime_1) >= 5000) {
|
||||
if (soundPlayFile(fileName) == -1) {
|
||||
|
|
|
@ -799,13 +799,13 @@ static void opMarkAreaKnown(Program* program)
|
|||
// TODO: Provide meaningful names.
|
||||
if (data[2] == 0) {
|
||||
if (data[0] == CITY_STATE_INVISIBLE) {
|
||||
_wmAreaSetVisibleState(data[1], 0, 1);
|
||||
wmAreaSetVisibleState(data[1], 0, 1);
|
||||
} else {
|
||||
_wmAreaSetVisibleState(data[1], 1, 1);
|
||||
_wmAreaMarkVisitedState(data[1], data[0]);
|
||||
wmAreaSetVisibleState(data[1], 1, 1);
|
||||
wmAreaMarkVisitedState(data[1], data[0]);
|
||||
}
|
||||
} else if (data[2] == 1) {
|
||||
_wmMapMarkVisited(data[1]);
|
||||
wmMapMarkVisited(data[1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2031,12 +2031,12 @@ static void opMetarule3(Program* program)
|
|||
result.integerValue = killsGetByType(param1.integerValue);
|
||||
break;
|
||||
case METARULE3_MARK_MAP_ENTRANCE:
|
||||
result.integerValue = _wmMapMarkMapEntranceState(param1.integerValue, param2.integerValue, param3.integerValue);
|
||||
result.integerValue = wmMapMarkMapEntranceState(param1.integerValue, param2.integerValue, param3.integerValue);
|
||||
break;
|
||||
case METARULE3_WM_SUBTILE_STATE:
|
||||
if (1) {
|
||||
int state;
|
||||
if (_wmSubTileGetVisitedState(param1.integerValue, param2.integerValue, &state) == 0) {
|
||||
if (wmSubTileGetVisitedState(param1.integerValue, param2.integerValue, &state) == 0) {
|
||||
result.integerValue = state;
|
||||
}
|
||||
}
|
||||
|
@ -2090,7 +2090,7 @@ static void opMetarule3(Program* program)
|
|||
result.integerValue = aiGetChemUse(static_cast<Object*>(param1.pointerValue));
|
||||
break;
|
||||
case METARULE3_110:
|
||||
result.integerValue = carIsEmpty() ? 1 : 0;
|
||||
result.integerValue = wmCarIsOutOfGas() ? 1 : 0;
|
||||
break;
|
||||
case METARULE3_111:
|
||||
result.integerValue = _map_target_load_area();
|
||||
|
@ -2108,7 +2108,7 @@ static void opSetMapMusic(Program* program)
|
|||
int mapIndex = programStackPopInteger(program);
|
||||
|
||||
debugPrint("\nset_map_music: %d, %s", mapIndex, string);
|
||||
worldmapSetMapMusic(mapIndex, string);
|
||||
wmSetMapMusic(mapIndex, string);
|
||||
}
|
||||
|
||||
// NOTE: Function name is a bit misleading. Last parameter is a boolean value
|
||||
|
@ -2184,7 +2184,7 @@ static void opLoadMap(Program* program)
|
|||
|
||||
if (mapName != NULL) {
|
||||
gGameGlobalVars[GVAR_LOAD_MAP_INDEX] = param;
|
||||
mapIndex = mapGetIndexByFileName(mapName);
|
||||
mapIndex = wmMapMatchNameToIdx(mapName);
|
||||
} else {
|
||||
if (mapIndexOrName.integerValue >= 0) {
|
||||
gGameGlobalVars[GVAR_LOAD_MAP_INDEX] = param;
|
||||
|
@ -2210,7 +2210,7 @@ static void opWorldmapCitySetPos(Program* program)
|
|||
int x = programStackPopInteger(program);
|
||||
int city = programStackPopInteger(program);
|
||||
|
||||
if (worldmapCitySetPos(city, x, y) == -1) {
|
||||
if (wmAreaSetWorldPos(city, x, y) == -1) {
|
||||
scriptPredefinedError(program, "wm_area_set_pos", SCRIPT_ERROR_FOLLOWS);
|
||||
debugPrint("Invalid Parameter!");
|
||||
}
|
||||
|
@ -3210,25 +3210,25 @@ static void opMetarule(Program* program)
|
|||
result = _getPartyMemberCount();
|
||||
break;
|
||||
case METARULE_AREA_KNOWN:
|
||||
result = _wmAreaVisitedState(param.integerValue);
|
||||
result = wmAreaVisitedState(param.integerValue);
|
||||
break;
|
||||
case METARULE_WHO_ON_DRUGS:
|
||||
result = queueHasEvent(static_cast<Object*>(param.pointerValue), EVENT_TYPE_DRUG);
|
||||
break;
|
||||
case METARULE_MAP_KNOWN:
|
||||
result = _wmMapIsKnown(param.integerValue);
|
||||
result = wmMapIsKnown(param.integerValue);
|
||||
break;
|
||||
case METARULE_IS_LOADGAME:
|
||||
result = _isLoadingGame();
|
||||
break;
|
||||
case METARULE_CAR_CURRENT_TOWN:
|
||||
result = carGetCity();
|
||||
result = wmCarCurrentArea();
|
||||
break;
|
||||
case METARULE_GIVE_CAR_TO_PARTY:
|
||||
result = _wmCarGiveToParty();
|
||||
result = wmCarGiveToParty();
|
||||
break;
|
||||
case METARULE_GIVE_CAR_GAS:
|
||||
result = carAddFuel(param.integerValue);
|
||||
result = wmCarFillGas(param.integerValue);
|
||||
break;
|
||||
case METARULE_SKILL_CHECK_TAG:
|
||||
result = skillIsTagged(param.integerValue);
|
||||
|
@ -3268,13 +3268,13 @@ static void opMetarule(Program* program)
|
|||
}
|
||||
break;
|
||||
case METARULE_GET_WORLDMAP_XPOS:
|
||||
_wmGetPartyWorldPos(&result, NULL);
|
||||
wmGetPartyWorldPos(&result, NULL);
|
||||
break;
|
||||
case METARULE_GET_WORLDMAP_YPOS:
|
||||
_wmGetPartyWorldPos(NULL, &result);
|
||||
wmGetPartyWorldPos(NULL, &result);
|
||||
break;
|
||||
case METARULE_CURRENT_TOWN:
|
||||
if (_wmGetPartyCurArea(&result) == -1) {
|
||||
if (wmGetPartyCurArea(&result) == -1) {
|
||||
debugPrint("\nIntextra: Error: metarule: current_town");
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -216,7 +216,7 @@ static SaveGameHandler* _master_save_list[LOAD_SAVE_HANDLER_COUNT] = {
|
|||
automapSave,
|
||||
preferencesSave,
|
||||
characterEditorSave,
|
||||
worldmapSave,
|
||||
wmWorldMap_save,
|
||||
pipboySave,
|
||||
gameMoviesSave,
|
||||
skillsUsageSave,
|
||||
|
@ -247,7 +247,7 @@ static LoadGameHandler* _master_load_list[LOAD_SAVE_HANDLER_COUNT] = {
|
|||
automapLoad,
|
||||
preferencesLoad,
|
||||
characterEditorLoad,
|
||||
worldmapLoad,
|
||||
wmWorldMap_load,
|
||||
pipboyLoad,
|
||||
gameMoviesLoad,
|
||||
skillsUsageLoad,
|
||||
|
@ -2217,7 +2217,7 @@ static int _PrepLoad(File* stream)
|
|||
// 0x47F4C8
|
||||
static int _EndLoad(File* stream)
|
||||
{
|
||||
worldmapStartMapMusic();
|
||||
wmMapMusicStart();
|
||||
dudeSetName(_LSData[_slot_cursor].character_name);
|
||||
interfaceBarRefresh();
|
||||
indicatorBarRefresh();
|
||||
|
|
|
@ -401,7 +401,7 @@ static int _main_load_new(char* mapFileName)
|
|||
gameMouseSetCursor(MOUSE_CURSOR_NONE);
|
||||
mouseShowCursor();
|
||||
mapLoadByName(mapFileName);
|
||||
worldmapStartMapMusic();
|
||||
wmMapMusicStart();
|
||||
paletteFadeTo(gPaletteWhite);
|
||||
windowDestroy(win);
|
||||
colorPaletteLoad("color.pal");
|
||||
|
|
58
src/map.cc
58
src/map.cc
|
@ -367,7 +367,7 @@ int mapSetElevation(int elevation)
|
|||
}
|
||||
|
||||
if (elevation != gElevation) {
|
||||
_wmMapMarkMapEntranceState(gMapHeader.field_34, elevation, 1);
|
||||
wmMapMarkMapEntranceState(gMapHeader.field_34, elevation, 1);
|
||||
}
|
||||
|
||||
gElevation = elevation;
|
||||
|
@ -465,7 +465,7 @@ void mapSetStart(int tile, int elevation, int rotation)
|
|||
// 0x4824CC
|
||||
char* mapGetName(int map, int elevation)
|
||||
{
|
||||
if (map < 0 || map >= mapGetCount()) {
|
||||
if (map < 0 || map >= wmMapMaxCount()) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -482,29 +482,29 @@ char* mapGetName(int map, int elevation)
|
|||
// 0x482528
|
||||
bool _is_map_idx_same(int map1, int map2)
|
||||
{
|
||||
if (map1 < 0 || map1 >= mapGetCount()) {
|
||||
if (map1 < 0 || map1 >= wmMapMaxCount()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (map2 < 0 || map2 >= mapGetCount()) {
|
||||
if (map2 < 0 || map2 >= wmMapMaxCount()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!_wmMapIdxIsSaveable(map1)) {
|
||||
if (!wmMapIdxIsSaveable(map1)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!_wmMapIdxIsSaveable(map2)) {
|
||||
if (!wmMapIdxIsSaveable(map2)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int city1;
|
||||
if (_wmMatchAreaContainingMapIdx(map1, &city1) == -1) {
|
||||
if (wmMatchAreaContainingMapIdx(map1, &city1) == -1) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int city2;
|
||||
if (_wmMatchAreaContainingMapIdx(map2, &city2) == -1) {
|
||||
if (wmMatchAreaContainingMapIdx(map2, &city2) == -1) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -515,12 +515,12 @@ bool _is_map_idx_same(int map1, int map2)
|
|||
int _get_map_idx_same(int map1, int map2)
|
||||
{
|
||||
int city1 = -1;
|
||||
if (_wmMatchAreaContainingMapIdx(map1, &city1) == -1) {
|
||||
if (wmMatchAreaContainingMapIdx(map1, &city1) == -1) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
int city2 = -2;
|
||||
if (_wmMatchAreaContainingMapIdx(map2, &city2) == -1) {
|
||||
if (wmMatchAreaContainingMapIdx(map2, &city2) == -1) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -535,7 +535,7 @@ int _get_map_idx_same(int map1, int map2)
|
|||
char* mapGetCityName(int map)
|
||||
{
|
||||
int city;
|
||||
if (_wmMatchAreaContainingMapIdx(map, &city) == -1) {
|
||||
if (wmMatchAreaContainingMapIdx(map, &city) == -1) {
|
||||
return _aErrorF2;
|
||||
}
|
||||
|
||||
|
@ -548,8 +548,8 @@ char* mapGetCityName(int map)
|
|||
char* _map_get_description_idx_(int map)
|
||||
{
|
||||
int city;
|
||||
if (_wmMatchAreaContainingMapIdx(map, &city) == 0) {
|
||||
_wmGetAreaIdxName(city, _scratchStr);
|
||||
if (wmMatchAreaContainingMapIdx(map, &city) == 0) {
|
||||
wmGetAreaIdxName(city, _scratchStr);
|
||||
} else {
|
||||
strcpy(_scratchStr, _errMapName);
|
||||
}
|
||||
|
@ -739,7 +739,7 @@ int mapLoadByName(char* fileName)
|
|||
if (stream != NULL) {
|
||||
fileClose(stream);
|
||||
rc = mapLoadSaved(fileName);
|
||||
worldmapStartMapMusic();
|
||||
wmMapMusicStart();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -766,7 +766,7 @@ int mapLoadById(int map)
|
|||
scriptSetFixedParam(gMapSid, map);
|
||||
|
||||
char name[16];
|
||||
if (mapGetFileName(map, name) == -1) {
|
||||
if (wmMapIdxToName(map, name) == -1) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -774,7 +774,7 @@ int mapLoadById(int map)
|
|||
|
||||
int rc = mapLoadByName(name);
|
||||
|
||||
worldmapStartMapMusic();
|
||||
wmMapMusicStart();
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
@ -898,7 +898,7 @@ static int mapLoad(File* stream)
|
|||
lightSetLightLevel(LIGHT_LEVEL_MAX, false);
|
||||
objectSetLocation(gDude, gCenterTile, gElevation, NULL);
|
||||
objectSetRotation(gDude, gEnteringRotation, NULL);
|
||||
gMapHeader.field_34 = mapGetIndexByFileName(gMapHeader.name);
|
||||
gMapHeader.field_34 = wmMapMatchNameToIdx(gMapHeader.name);
|
||||
|
||||
if ((gMapHeader.flags & 1) == 0) {
|
||||
char path[COMPAT_MAX_PATH];
|
||||
|
@ -946,7 +946,7 @@ static int mapLoad(File* stream)
|
|||
_scr_spatials_enable();
|
||||
|
||||
error = "Error Setting up random encounter";
|
||||
if (worldmapSetupRandomEncounter() == -1) {
|
||||
if (wmSetupRandomEncounter() == -1) {
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
@ -996,10 +996,10 @@ err:
|
|||
rc = -1;
|
||||
}
|
||||
|
||||
_wmMapMarkVisited(gMapHeader.field_34);
|
||||
_wmMapMarkMapEntranceState(gMapHeader.field_34, gElevation, 1);
|
||||
wmMapMarkVisited(gMapHeader.field_34);
|
||||
wmMapMarkMapEntranceState(gMapHeader.field_34, gElevation, 1);
|
||||
|
||||
if (_wmCheckGameAreaEvents() != 0) {
|
||||
if (wmCheckGameAreaEvents() != 0) {
|
||||
rc = -1;
|
||||
}
|
||||
|
||||
|
@ -1043,7 +1043,7 @@ int mapLoadSaved(char* fileName)
|
|||
}
|
||||
}
|
||||
|
||||
if (!_wmMapIsSaveable()) {
|
||||
if (!wmMapIsSaveable()) {
|
||||
debugPrint("\nDestroying RANDOM encounter map.");
|
||||
|
||||
char v15[16];
|
||||
|
@ -1062,7 +1062,7 @@ int mapLoadSaved(char* fileName)
|
|||
// 0x48328C
|
||||
static int _map_age_dead_critters()
|
||||
{
|
||||
if (!_wmMapDeadBodiesAge()) {
|
||||
if (!wmMapDeadBodiesAge()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1175,7 +1175,7 @@ static int _map_age_dead_critters()
|
|||
int _map_target_load_area()
|
||||
{
|
||||
int city = -1;
|
||||
if (_wmMatchAreaContainingMapIdx(gMapHeader.field_34, &city) == -1) {
|
||||
if (wmMatchAreaContainingMapIdx(gMapHeader.field_34, &city) == -1) {
|
||||
city = -1;
|
||||
}
|
||||
return city;
|
||||
|
@ -1215,13 +1215,13 @@ int mapHandleTransition()
|
|||
if (gMapTransition.map == -1) {
|
||||
if (!isInCombat()) {
|
||||
animationStop();
|
||||
_wmTownMap();
|
||||
wmTownMap();
|
||||
memset(&gMapTransition, 0, sizeof(gMapTransition));
|
||||
}
|
||||
} else if (gMapTransition.map == -2) {
|
||||
if (!isInCombat()) {
|
||||
animationStop();
|
||||
_wmWorldMap();
|
||||
wmWorldMap();
|
||||
memset(&gMapTransition, 0, sizeof(gMapTransition));
|
||||
}
|
||||
} else {
|
||||
|
@ -1245,8 +1245,8 @@ int mapHandleTransition()
|
|||
memset(&gMapTransition, 0, sizeof(gMapTransition));
|
||||
|
||||
int city;
|
||||
_wmMatchAreaContainingMapIdx(gMapHeader.field_34, &city);
|
||||
if (_wmTeleportToArea(city) == -1) {
|
||||
wmMatchAreaContainingMapIdx(gMapHeader.field_34, &city);
|
||||
if (wmTeleportToArea(city) == -1) {
|
||||
debugPrint("\nError: couldn't make jump on worldmap for map jump!");
|
||||
}
|
||||
}
|
||||
|
@ -1425,7 +1425,7 @@ int _map_save_in_game(bool a1)
|
|||
|
||||
char name[16];
|
||||
|
||||
if (a1 && !_wmMapIsSaveable()) {
|
||||
if (a1 && !wmMapIsSaveable()) {
|
||||
debugPrint("\nNot saving RANDOM encounter map.");
|
||||
|
||||
strcpy(name, gMapHeader.name);
|
||||
|
|
|
@ -1484,7 +1484,7 @@ int objectSetLocation(Object* obj, int tile, int elevation, Rect* rect)
|
|||
transition.rotation = data->misc.rotation;
|
||||
mapSetTransition(&transition);
|
||||
|
||||
_wmMapMarkMapEntranceState(transition.map, transition.elevation, 1);
|
||||
wmMapMarkMapEntranceState(transition.map, transition.elevation, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -401,7 +401,7 @@ static int gPipboyPrevTab;
|
|||
// 0x497004
|
||||
int pipboyOpen(int intent)
|
||||
{
|
||||
if (!_wmMapPipboyActive()) {
|
||||
if (!wmMapPipboyActive()) {
|
||||
// You aren't wearing the pipboy!
|
||||
const char* text = getmsg(&gMiscMessageList, &gPipboyMessageListItem, 7000);
|
||||
showDialogBox(text, NULL, 0, 192, 135, _colorTable[32328], NULL, _colorTable[32328], 1);
|
||||
|
@ -1504,7 +1504,7 @@ static int _PrintAMelevList(int a1)
|
|||
}
|
||||
}
|
||||
|
||||
int mapCount = mapGetCount();
|
||||
int mapCount = wmMapMaxCount();
|
||||
for (int map = 0; map < mapCount; map++) {
|
||||
if (map == _amcty_indx) {
|
||||
continue;
|
||||
|
@ -1579,7 +1579,7 @@ static int _PrintAMList(int a1)
|
|||
int count = 0;
|
||||
int index = 0;
|
||||
|
||||
int mapCount = mapGetCount();
|
||||
int mapCount = wmMapMaxCount();
|
||||
for (int map = 0; map < mapCount; map++) {
|
||||
int elevation;
|
||||
for (elevation = 0; elevation < ELEVATION_COUNT; elevation++) {
|
||||
|
|
|
@ -473,7 +473,7 @@ int _obj_examine_func(Object* critter, Object* target, void (*fn)(char* string))
|
|||
}
|
||||
|
||||
if (car != 0) {
|
||||
sprintf(formattedText, carMessageListItem.text, 100 * carGetFuel() / 80000);
|
||||
sprintf(formattedText, carMessageListItem.text, 100 * wmCarGasAmount() / 80000);
|
||||
} else {
|
||||
strcpy(formattedText, carMessageListItem.text);
|
||||
}
|
||||
|
@ -954,12 +954,12 @@ static int _obj_use_power_on_car(Object* item)
|
|||
// SFALL: Fix for cells getting consumed even when the car is already fully
|
||||
// charged.
|
||||
int rc;
|
||||
if (carGetFuel() < CAR_FUEL_MAX) {
|
||||
if (wmCarGasAmount() < CAR_FUEL_MAX) {
|
||||
int energy = ammoGetQuantity(item) * energyDensity;
|
||||
int capacity = ammoGetCapacity(item);
|
||||
|
||||
// NOTE: that function will never return -1
|
||||
if (carAddFuel(energy / capacity) == -1) {
|
||||
if (wmCarFillGas(energy / capacity) == -1) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -1520,7 +1520,7 @@ static int useLadderDown(Object* a1, Object* ladder, int a3)
|
|||
|
||||
mapSetTransition(&transition);
|
||||
|
||||
_wmMapMarkMapEntranceState(transition.map, elevation, 1);
|
||||
wmMapMarkMapEntranceState(transition.map, elevation, 1);
|
||||
} else {
|
||||
Rect updatedRect;
|
||||
if (objectSetLocation(a1, tile, elevation, &updatedRect) == -1) {
|
||||
|
@ -1554,7 +1554,7 @@ static int useLadderUp(Object* a1, Object* ladder, int a3)
|
|||
|
||||
mapSetTransition(&transition);
|
||||
|
||||
_wmMapMarkMapEntranceState(transition.map, elevation, 1);
|
||||
wmMapMarkMapEntranceState(transition.map, elevation, 1);
|
||||
} else {
|
||||
Rect updatedRect;
|
||||
if (objectSetLocation(a1, tile, elevation, &updatedRect) == -1) {
|
||||
|
@ -1588,7 +1588,7 @@ static int useStairs(Object* a1, Object* stairs, int a3)
|
|||
|
||||
mapSetTransition(&transition);
|
||||
|
||||
_wmMapMarkMapEntranceState(transition.map, elevation, 1);
|
||||
wmMapMarkMapEntranceState(transition.map, elevation, 1);
|
||||
} else {
|
||||
Rect updatedRect;
|
||||
if (objectSetLocation(a1, tile, elevation, &updatedRect) == -1) {
|
||||
|
@ -2241,13 +2241,13 @@ int _objPMAttemptPlacement(Object* obj, int tile, int elevation)
|
|||
|
||||
int v9 = tile;
|
||||
int v7 = 0;
|
||||
if (!_wmEvalTileNumForPlacement(tile)) {
|
||||
if (!wmEvalTileNumForPlacement(tile)) {
|
||||
v9 = gDude->tile;
|
||||
for (int v4 = 1; v4 <= 100; v4++) {
|
||||
// TODO: Check.
|
||||
v7++;
|
||||
v9 = tileGetTileInDirection(v9, v7 % ROTATION_COUNT, 1);
|
||||
if (_wmEvalTileNumForPlacement(v9) != 0) {
|
||||
if (wmEvalTileNumForPlacement(v9) != 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -443,9 +443,9 @@ int _scriptsCheckGameEvents(int* moviePtr, int window)
|
|||
movie = MOVIE_ARTIMER4;
|
||||
if (!gameMovieIsSeen(MOVIE_ARTIMER4)) {
|
||||
adjustRep = true;
|
||||
_wmAreaSetVisibleState(CITY_ARROYO, 0, 1);
|
||||
_wmAreaSetVisibleState(CITY_DESTROYED_ARROYO, 1, 1);
|
||||
_wmAreaMarkVisitedState(CITY_DESTROYED_ARROYO, 2);
|
||||
wmAreaSetVisibleState(CITY_ARROYO, 0, 1);
|
||||
wmAreaSetVisibleState(CITY_DESTROYED_ARROYO, 1, 1);
|
||||
wmAreaMarkVisitedState(CITY_DESTROYED_ARROYO, 2);
|
||||
}
|
||||
} else if (day >= 270 && gameGetGlobalVar(GVAR_FALLOUT_2) != 3) {
|
||||
adjustRep = true;
|
||||
|
@ -907,12 +907,12 @@ int scriptsHandleRequests()
|
|||
|
||||
if ((gScriptsRequests & SCRIPT_REQUEST_0x02) != 0) {
|
||||
gScriptsRequests &= ~SCRIPT_REQUEST_0x02;
|
||||
_wmTownMap();
|
||||
wmTownMap();
|
||||
}
|
||||
|
||||
if ((gScriptsRequests & SCRIPT_REQUEST_WORLD_MAP) != 0) {
|
||||
gScriptsRequests &= ~SCRIPT_REQUEST_WORLD_MAP;
|
||||
_wmWorldMap();
|
||||
wmWorldMap();
|
||||
}
|
||||
|
||||
if ((gScriptsRequests & SCRIPT_REQUEST_ELEVATOR) != 0) {
|
||||
|
|
3545
src/worldmap.cc
3545
src/worldmap.cc
File diff suppressed because it is too large
Load Diff
|
@ -227,48 +227,52 @@ typedef enum Map {
|
|||
MAP_IN_GAME_MOVIE1 = 149,
|
||||
} Map;
|
||||
|
||||
int worldmapInit();
|
||||
void worldmapExit();
|
||||
int worldmapReset();
|
||||
int worldmapSave(File* stream);
|
||||
int worldmapLoad(File* stream);
|
||||
int mapGetCount();
|
||||
int mapGetFileName(int map_index, char* dest);
|
||||
int mapGetIndexByFileName(char* name);
|
||||
bool _wmMapIdxIsSaveable(int map_index);
|
||||
bool _wmMapIsSaveable();
|
||||
bool _wmMapDeadBodiesAge();
|
||||
bool _wmMapCanRestHere(int elevation);
|
||||
bool _wmMapPipboyActive();
|
||||
int _wmMapMarkVisited(int map_index);
|
||||
int _wmMapMarkMapEntranceState(int a1, int a2, int a3);
|
||||
void _wmWorldMap();
|
||||
int _wmCheckGameAreaEvents();
|
||||
int worldmapSetupRandomEncounter();
|
||||
bool _wmEvalTileNumForPlacement(int tile);
|
||||
extern unsigned char* circleBlendTable;
|
||||
|
||||
int wmWorldMap_init();
|
||||
void wmWorldMap_exit();
|
||||
int wmWorldMap_reset();
|
||||
int wmWorldMap_save(File* stream);
|
||||
int wmWorldMap_load(File* stream);
|
||||
int wmMapMaxCount();
|
||||
int wmMapIdxToName(int mapIdx, char* dest);
|
||||
int wmMapMatchNameToIdx(char* name);
|
||||
bool wmMapIdxIsSaveable(int mapIdx);
|
||||
bool wmMapIsSaveable();
|
||||
bool wmMapDeadBodiesAge();
|
||||
bool wmMapCanRestHere(int elevation);
|
||||
bool wmMapPipboyActive();
|
||||
int wmMapMarkVisited(int mapIdx);
|
||||
int wmMapMarkMapEntranceState(int mapIdx, int elevation, int state);
|
||||
void wmWorldMap();
|
||||
int wmCheckGameAreaEvents();
|
||||
int wmSetupRandomEncounter();
|
||||
bool wmEvalTileNumForPlacement(int tile);
|
||||
int wmSubTileMarkRadiusVisited(int x, int y, int radius);
|
||||
int _wmSubTileGetVisitedState(int a1, int a2, int* a3);
|
||||
int _wmGetAreaIdxName(int index, char* name);
|
||||
bool _wmAreaIsKnown(int city_index);
|
||||
int _wmAreaVisitedState(int a1);
|
||||
bool _wmMapIsKnown(int map_index);
|
||||
bool _wmAreaMarkVisitedState(int a1, int a2);
|
||||
bool _wmAreaSetVisibleState(int a1, int a2, int a3);
|
||||
int worldmapCitySetPos(int index, int x, int y);
|
||||
int _wmGetPartyWorldPos(int* out_x, int* out_y);
|
||||
int _wmGetPartyCurArea(int* a1);
|
||||
void _wmTownMap();
|
||||
int carAddFuel(int a1);
|
||||
int carGetFuel();
|
||||
bool carIsEmpty();
|
||||
int carGetCity();
|
||||
int _wmCarGiveToParty();
|
||||
int ambientSoundEffectGetLength();
|
||||
int ambientSoundEffectGetRandom();
|
||||
int ambientSoundEffectGetName(int ambientSoundEffectIndex, char** namePtr);
|
||||
int worldmapStartMapMusic();
|
||||
int worldmapSetMapMusic(int a1, const char* name);
|
||||
int _wmMatchAreaContainingMapIdx(int map_index, int* out_city_index);
|
||||
int _wmTeleportToArea(int a1);
|
||||
int wmSubTileGetVisitedState(int x, int y, int* statePtr);
|
||||
int wmGetAreaIdxName(int areaIdx, char* name);
|
||||
bool wmAreaIsKnown(int areaIdx);
|
||||
int wmAreaVisitedState(int areaIdx);
|
||||
bool wmMapIsKnown(int mapIdx);
|
||||
int wmAreaMarkVisited(int areaIdx);
|
||||
bool wmAreaMarkVisitedState(int areaIdx, int state);
|
||||
bool wmAreaSetVisibleState(int areaIdx, int state, bool force);
|
||||
int wmAreaSetWorldPos(int areaIdx, int x, int y);
|
||||
int wmGetPartyWorldPos(int* xPtr, int* yPtr);
|
||||
int wmGetPartyCurArea(int* areaIdxPtr);
|
||||
void wmTownMap();
|
||||
int wmCarUseGas(int amount);
|
||||
int wmCarFillGas(int amount);
|
||||
int wmCarGasAmount();
|
||||
bool wmCarIsOutOfGas();
|
||||
int wmCarCurrentArea();
|
||||
int wmCarGiveToParty();
|
||||
int wmSfxMaxCount();
|
||||
int wmSfxRollNextIdx();
|
||||
int wmSfxIdxName(int sfxIdx, char** namePtr);
|
||||
int wmMapMusicStart();
|
||||
int wmSetMapMusic(int mapIdx, const char* name);
|
||||
int wmMatchAreaContainingMapIdx(int mapIdx, int* areaIdxPtr);
|
||||
int wmTeleportToArea(int areaIdx);
|
||||
|
||||
#endif /* WORLD_MAP_H */
|
||||
|
|
Loading…
Reference in New Issue