Merge branch 'ddevrien-master'

This commit is contained in:
IntelOrca 2014-05-03 12:44:37 +01:00
commit b52797cc79
12 changed files with 35 additions and 26 deletions

View File

@ -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

View File

@ -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();

View File

@ -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

View File

@ -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();

View File

@ -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();

View File

@ -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)

View File

@ -22,6 +22,7 @@
#define _WINDOW_H_
#include "gfx.h"
#include "park.h"
#include "rct2.h"
struct rct_window;

View File

@ -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);
}

View File

@ -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;

View File

@ -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);
}

View File

@ -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;

View File

@ -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++) {