From 9cf6f8f98a8c621470e7f8d0760c529ee8d30dcd Mon Sep 17 00:00:00 2001 From: ddevrien Date: Sat, 3 May 2014 13:39:36 +0200 Subject: [PATCH] Added some GAME_FLAGS Also renamed them to PARK_FLAGS and moved them to park.h, since they have to do with each park, and are probably saved somewhere in the sv6 file. --- src/addresses.h | 2 +- src/editor.c | 2 +- src/park.c | 4 ++-- src/park.h | 16 ++++++++++++++++ src/rct2.h | 8 -------- src/scenario.c | 12 ++++++------ src/window.h | 1 + src/window_footpath.c | 2 +- src/window_game_bottom_toolbar.c | 4 ++-- src/window_land.c | 2 +- src/window_park.c | 6 +++--- src/window_ride_list.c | 2 +- 12 files changed, 35 insertions(+), 26 deletions(-) diff --git a/src/addresses.h b/src/addresses.h index 01c86a5e15..d9c7a46036 100644 --- a/src/addresses.h +++ b/src/addresses.h @@ -141,7 +141,7 @@ #define RCT2_ADDRESS_SPRITES_START_LITTER 0x013573C4 #define RCT2_ADDRESS_CURRENT_LOAN 0x013573E0 -#define RCT2_ADDRESS_GAME_FLAGS 0x013573E4 +#define RCT2_ADDRESS_PARK_FLAGS 0x013573E4 #define RCT2_ADDRESS_PARK_ENTRANCE_FEE 0x013573E8 #define RCT2_ADDRESS_GUESTS_IN_PARK 0x01357844 #define RCT2_ADDRESS_MONTHLY_RIDE_INCOME 0x01357894 diff --git a/src/editor.c b/src/editor.c index c34485048d..109e947e36 100644 --- a/src/editor.c +++ b/src/editor.c @@ -58,7 +58,7 @@ void editor_load() RCT2_CALLPROC_EBPSAFE(0x006BD39C); RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) = SCREEN_FLAGS_SCENARIO_EDITOR; RCT2_GLOBAL(0x0141F570, uint8) = 0; - RCT2_GLOBAL(RCT2_ADDRESS_GAME_FLAGS, uint32) |= 16; + RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) |= 16; RCT2_CALLPROC_EBPSAFE(0x006ACA58); RCT2_GLOBAL(0x0141F571, uint8) = 4; viewport_init_all(); diff --git a/src/park.c b/src/park.c index 7a80e0356d..13f3728c2f 100644 --- a/src/park.c +++ b/src/park.c @@ -28,7 +28,7 @@ int park_is_open() { - return (RCT2_GLOBAL(RCT2_ADDRESS_GAME_FLAGS, uint32) & GAME_FLAGS_PARK_OPEN) != 0; + return (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_PARK_OPEN) != 0; } /** @@ -86,7 +86,7 @@ int calculate_park_rating() int result; result = 1150; - if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_FLAGS, uint32) & 0x4000) + if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & 0x4000) result = 1050; // Guests diff --git a/src/park.h b/src/park.h index 98b27d299f..287729ac6f 100644 --- a/src/park.h +++ b/src/park.h @@ -51,6 +51,22 @@ enum { PARK_AWARD_BEST_GENTLE_RIDES, }; +enum { + PARK_FLAGS_PARK_OPEN = (1 << 0), + PARK_FLAGS_FORBID_LANDSCAPE_CHANGES = (1 << 2), + PARK_FLAGS_FORBID_TREE_REMOVAL = (1 << 3), + PARK_FLAGS_SHOW_REAL_GUEST_NAMES = (1 << 4), + PARK_FLAGS_FORBID_HIGH_CONSTRUCTION = (1 << 5), // below tree height + PARK_FLAGS_PREF_LESS_INTENSE_RIDES = (1 << 6), + PARK_FLAGS_FORBID_MARKETING_CAMPAIGN = (1 << 7), + PARK_FLAGS_PREF_MORE_INTENSE_RIDES = (1 << 11), + PARK_FLAGS_DIFFICULT_GUEST_GENERATION = (1 << 12), + PARK_FLAGS_PARK_FREE_ENTRY = (1 << 13), + PARK_FLAGS_DIFFICULT_PARK_RATING = (1 << 14), + PARK_FLAGS_NO_MONEY = (1 << 17), + PARK_FLAGS_18 = (1 << 18) +}; + int park_is_open(); void park_init(); int park_calculate_size(); diff --git a/src/rct2.h b/src/rct2.h index c62e92e1d9..7239b89b7a 100644 --- a/src/rct2.h +++ b/src/rct2.h @@ -120,14 +120,6 @@ enum { }; -enum { - GAME_FLAGS_PARK_OPEN = (1 << 0), - GAME_FLAGS_BELOW_TREE_HEIGHT_ONLY = (1 << 5), - GAME_FLAGS_NO_MONEY = (1 << 11), - GAME_FLAGS_PARK_FREE_ENTRY = (1 << 13), - GAME_FLAGS_18 = (1 << 18) -}; - void rct2_endupdate(); char *get_file_path(int pathId); void get_system_info(); diff --git a/src/scenario.c b/src/scenario.c index c103d7a040..a4aa7f3510 100644 --- a/src/scenario.c +++ b/src/scenario.c @@ -446,9 +446,9 @@ void scenario_load_and_play(rct_scenario_basic *scenario) RCT2_GLOBAL(0x00F663B0, sint32) = RCT2_GLOBAL(0x009AA0F0, sint32); RCT2_GLOBAL(0x00F663B4, sint32) = RCT2_GLOBAL(0x009AA0F4, sint32); RCT2_GLOBAL(0x009DEB7C, sint16) = 0; - RCT2_GLOBAL(RCT2_ADDRESS_GAME_FLAGS, sint32) &= 0xFFFFF7FF; - if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_FLAGS, sint32) & 0x20000) - RCT2_GLOBAL(RCT2_ADDRESS_GAME_FLAGS, sint32) |= 0x800; + RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, sint32) &= 0xFFFFF7FF; + if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, sint32) & 0x20000) + RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, sint32) |= 0x800; RCT2_CALLPROC_EBPSAFE(0x00684AC3); RCT2_CALLPROC_EBPSAFE(0x006DFEE4); news_item_init_queue(); @@ -514,12 +514,12 @@ void scenario_load_and_play(rct_scenario_basic *scenario) RCT2_GLOBAL(0x00135882E, uint16) = 0; // Open park with free entry when there is no money - if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_FLAGS, uint32) & GAME_FLAGS_NO_MONEY) { - RCT2_GLOBAL(RCT2_ADDRESS_GAME_FLAGS, uint32) |= GAME_FLAGS_PARK_OPEN; + if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY) { + RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) |= PARK_FLAGS_PARK_OPEN; RCT2_GLOBAL(RCT2_ADDRESS_PARK_ENTRANCE_FEE, uint16) = 0; } - RCT2_GLOBAL(RCT2_ADDRESS_GAME_FLAGS, uint32) |= GAME_FLAGS_18; + RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) |= PARK_FLAGS_18; RCT2_CALLPROC_EBPSAFE(0x006837E3); // (palette related) diff --git a/src/window.h b/src/window.h index 8d1104e48c..9fab72b82c 100644 --- a/src/window.h +++ b/src/window.h @@ -22,6 +22,7 @@ #define _WINDOW_H_ #include "gfx.h" +#include "park.h" #include "rct2.h" struct rct_window; diff --git a/src/window_footpath.c b/src/window_footpath.c index 2ff607f8a9..de147ada3d 100644 --- a/src/window_footpath.c +++ b/src/window_footpath.c @@ -583,7 +583,7 @@ static void window_footpath_paint() x = w->x + (window_footpath_widgets[WIDX_CONSTRUCT].left + window_footpath_widgets[WIDX_CONSTRUCT].right) / 2; y = w->y + window_footpath_widgets[WIDX_CONSTRUCT].bottom - 12; if (_window_footpath_cost != 0x80000000) - if (!(RCT2_GLOBAL(RCT2_ADDRESS_GAME_FLAGS, uint32) & GAME_FLAGS_NO_MONEY)) + if (!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY)) gfx_draw_string_centred(dpi, STR_COST_LABEL, x, y, 0, &_window_footpath_cost); } diff --git a/src/window_game_bottom_toolbar.c b/src/window_game_bottom_toolbar.c index 19b4bfa581..53559bd86a 100644 --- a/src/window_game_bottom_toolbar.c +++ b/src/window_game_bottom_toolbar.c @@ -159,7 +159,7 @@ static void window_game_bottom_toolbar_mouseup() switch (widgetIndex) { case WIDX_LEFT_OUTSET: case WIDX_MONEY: - if (!(RCT2_GLOBAL(RCT2_ADDRESS_GAME_FLAGS, uint32) & 0x800)) + if (!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & 0x800)) RCT2_CALLPROC_EBPSAFE(0x0069DDF1); break; case WIDX_GUESTS: @@ -302,7 +302,7 @@ static void window_game_bottom_toolbar_invalidate() } // Hide money if there is no money - if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_FLAGS, uint32) & 0x800) { + if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & 0x800) { window_game_bottom_toolbar_widgets[WIDX_MONEY].type = WWT_EMPTY; window_game_bottom_toolbar_widgets[WIDX_GUESTS].top = 1; window_game_bottom_toolbar_widgets[WIDX_GUESTS].bottom = 17; diff --git a/src/window_land.c b/src/window_land.c index 3a47fa0937..ca9b9ea295 100644 --- a/src/window_land.c +++ b/src/window_land.c @@ -391,7 +391,7 @@ static void window_land_paint() if (RCT2_GLOBAL(RCT2_ADDRESS_SELECTED_TERRAIN_EDGE, uint8) != 255) price += numTiles * 100; - if (price != 0 && !(RCT2_GLOBAL(RCT2_ADDRESS_GAME_FLAGS, uint32) & GAME_FLAGS_NO_MONEY)) { + if (price != 0 && !(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY)) { RCT2_GLOBAL(0x013CE952, sint32) = price; gfx_draw_string_centred(dpi, 986, x, y, 0, 0x013CE952); } diff --git a/src/window_park.c b/src/window_park.c index e88059317b..8d2c3078f7 100644 --- a/src/window_park.c +++ b/src/window_park.c @@ -935,7 +935,7 @@ static void window_park_entrance_invalidate() } // Only allow closing of park and purchase of land when there is money - if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_FLAGS, uint32) & GAME_FLAGS_NO_MONEY) { + if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY) { window_park_entrance_widgets[WIDX_OPEN_OR_CLOSE].type = WWT_EMPTY; window_park_entrance_widgets[WIDX_BUY_LAND_RIGHTS].type = WWT_EMPTY; window_park_entrance_widgets[WIDX_BUY_CONSTRUCTION_RIGHTS].type = WWT_EMPTY; @@ -1417,7 +1417,7 @@ static void window_park_price_invalidate() RCT2_GLOBAL(0x013CE952, uint16) = RCT2_GLOBAL(0x013573D4, uint16); RCT2_GLOBAL(0x013CE952 + 2, uint32) = RCT2_GLOBAL(0x013573D8, uint32); - if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_FLAGS, uint32) & GAME_FLAGS_PARK_FREE_ENTRY) { + if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_PARK_FREE_ENTRY) { window_park_price_widgets[WIDX_PRICE].type = WWT_12; window_park_price_widgets[WIDX_INCREASE_PRICE].type = WWT_EMPTY; window_park_price_widgets[WIDX_DECREASE_PRICE].type = WWT_EMPTY; @@ -1711,7 +1711,7 @@ static void window_park_objective_invalidate() *((short*)0x013CE954) = RCT2_GLOBAL(0x013573D8, uint32); // - if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_FLAGS, uint32) & 0x02) + if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & 0x02) window_park_objective_widgets[WIDX_ENTER_NAME].type = WWT_DROPDOWN_BUTTON; else window_park_objective_widgets[WIDX_ENTER_NAME].type = WWT_EMPTY; diff --git a/src/window_ride_list.c b/src/window_ride_list.c index 1d0476640f..92d08a7918 100644 --- a/src/window_ride_list.c +++ b/src/window_ride_list.c @@ -255,7 +255,7 @@ static void window_ride_list_mousedown() numItems = 9; if (w->page != PAGE_RIDES) numItems -= 5; - if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_FLAGS, uint32) & GAME_FLAGS_NO_MONEY) + if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY) numItems--; for (i = 0; i < numItems; i++) {