Merge pull request #7 from IntelOrca/develop

Fast forward
This commit is contained in:
Michael Steenbeek 2015-03-28 19:26:34 +01:00
commit 022f0765b9
15 changed files with 209 additions and 93 deletions

View File

@ -2682,7 +2682,7 @@ STR_2676 :???
STR_2677 :???
STR_2678 :???
STR_2679 :???
STR_2680 :???
STR_2680 :All research complete
STR_2681 :{MEDIUMFONT}{BLACK}Increases your money by 5,000
STR_2682 :{MEDIUMFONT}{BLACK}Toggle between Free and Paid Entry
STR_2683 :{MEDIUMFONT}{BLACK}Increases every peeps happiness to max

View File

@ -193,13 +193,29 @@
#define RCT2_ADDRESS_PALETTE_EFFECT_FRAME_NO 0x009DE584
// Flags:
// 0x1 Enable selection
// 0x2 Enable construct selection, see CONSTRUCT_PATH_*
// 0x4 Show yellow arrow, see MAP_ARROW_*
// 0x8 ?
#define RCT2_ADDRESS_MAP_SELECTION_FLAGS 0x009DE58A
#define RCT2_ADDRESS_MAP_SELECTION_A_X 0x009DE58C
#define RCT2_ADDRESS_MAP_SELECTION_B_X 0x009DE58E
#define RCT2_ADDRESS_MAP_SELECTION_A_Y 0x009DE590
#define RCT2_ADDRESS_MAP_SELECTION_B_Y 0x009DE592
// Types:
// 0-3 Corners
// 4 Whole tile
// 5 ?
// 6-9 Quarters
// 10-13 Edges
#define RCT2_ADDRESS_MAP_SELECTION_TYPE 0x009DE594
#define RCT2_ADDRESS_MAP_ARROW_X 0x009DEA48
#define RCT2_ADDRESS_MAP_ARROW_Y 0x009DEA4A
#define RCT2_ADDRESS_MAP_ARROW_Z 0x009DEA4C
#define RCT2_ADDRESS_MAP_ARROW_DIRECTION 0x009DEA4E
#define RCT2_ADDRESS_SCREEN_FLAGS 0x009DEA68
#define RCT2_ADDRESS_SCREENSHOT_COUNTDOWN 0x009DEA6D
// Note: not only the zeroth bit can be set to control pause

View File

@ -1108,21 +1108,22 @@ void sub_68B35F(int ax, int cx)
break;
}
dx /= 2;
// Display little yellow arrow when building footpaths?
if ((RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, uint16_t) & 4) &&
RCT2_GLOBAL(0x9DE56A, uint16_t) == RCT2_GLOBAL(0x9DEA48, uint16_t) &&
RCT2_GLOBAL(0x9DE56E, uint16_t) == RCT2_GLOBAL(0x9DEA4A, uint16_t))
RCT2_GLOBAL(0x9DE56A, uint16_t) == RCT2_GLOBAL(RCT2_ADDRESS_MAP_ARROW_X, uint16_t) &&
RCT2_GLOBAL(0x9DE56E, uint16_t) == RCT2_GLOBAL(RCT2_ADDRESS_MAP_ARROW_Y, uint16_t))
{
int ebx = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_ROTATION, uint32_t);
RCT2_GLOBAL(0x9DE568, uint16_t) = ax;
RCT2_GLOBAL(0x9DE56C, uint16_t) = cx;
int dl = RCT2_GLOBAL(0x009DEA4E, uint8_t) & 3;
int dl = RCT2_GLOBAL(RCT2_ADDRESS_MAP_ARROW_DIRECTION, uint8_t) & 3;
ebx += dl;
ebx &= 3;
dl = RCT2_GLOBAL(0x009DEA4E, uint8_t) & 0xFC;
dl = RCT2_GLOBAL(RCT2_ADDRESS_MAP_ARROW_DIRECTION, uint8_t) & 0xFC;
ebx += dl;
ebx += 0x20900C27;
int d = RCT2_GLOBAL(0x009DEA4C, uint16_t);
int d = RCT2_GLOBAL(RCT2_ADDRESS_MAP_ARROW_Z, uint16_t);
RCT2_GLOBAL(0x9DE570, uint8_t) = 0;
RCT2_GLOBAL(0x9DEA52, uint16_t) = 0;
RCT2_GLOBAL(0x9DEA54, uint16_t) = 0;

View File

@ -128,8 +128,10 @@ static void research_next_design()
continue;
} else {
RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS, uint16) = 0;
RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS_STAGE, uint8) = RESEARCH_STAGE_INITIAL_RESEARCH;
RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS_STAGE, uint8) = RESEARCH_STAGE_FINISHED_ALL;
research_invalidate_related_windows();
// Reset funding to 0 if no more rides.
research_set_funding(0);
return;
}
} else if (ignoreActiveResearchTypes || (activeResearchTypes & (1 << researchItem->category))) {

View File

@ -44,7 +44,8 @@ enum {
RESEARCH_STAGE_INITIAL_RESEARCH,
RESEARCH_STAGE_DESIGNING,
RESEARCH_STAGE_COMPLETING_DESIGN,
RESEARCH_STAGE_UNKNOWN
RESEARCH_STAGE_UNKNOWN,
RESEARCH_STAGE_FINISHED_ALL
};
extern rct_research_item *gResearchItems;

View File

@ -1083,9 +1083,8 @@ void ride_update_all()
rct_ride *ride;
int i;
// Remove all rides if certain flags are set (possible scenario editor?)
int *esi = (int*)0x9DCE9E;
if (esi[0x1BCA] & 2) {
// Remove all rides if scenario editor
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) {
if (s6Info->var_000 <= 2)
FOR_ALL_RIDES(i, ride)
ride->type = RIDE_TYPE_NULL;

View File

@ -89,7 +89,8 @@ static void ride_update_station_bumpercar(rct_ride *ride, int stationIndex)
{
int i, dx, dl, dh;
rct_vehicle *vehicle;
// Change of station depart flag should really call invalidate_station_start
// but since bumpercars do not have station lights there is no point.
if (
ride->status == RIDE_STATUS_CLOSED ||
(ride->lifecycle_flags & (RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED))
@ -142,21 +143,24 @@ static void ride_update_station_normal(rct_ride *ride, int stationIndex)
time = ride->station_depart[stationIndex] & STATION_DEPART_MASK;
if (
(ride->lifecycle_flags & (RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED)) &&
(ride->lifecycle_flags & (RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED)) ||
(ride->status == RIDE_STATUS_CLOSED && ride->num_riders == 0)
) {
if (time != 0 && time != 127 && !(RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TICKS, uint32) & 7))
time--;
ride->station_depart[stationIndex] = time;
ride_invalidate_station_start(ride, stationIndex, 0);
} else {
if (time == 0) {
ride->station_depart[stationIndex] |= STATION_DEPART_FLAG;
ride_invalidate_station_start(ride, stationIndex, 1);
} else {
if (time != 127 && !(RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TICKS, uint32) & 31))
time--;
ride->station_depart[stationIndex] = time;
ride_invalidate_station_start(ride, stationIndex, 0);
}
}
}
@ -175,7 +179,10 @@ static void ride_update_station_race(rct_ride *ride, int stationIndex)
ride->status == RIDE_STATUS_CLOSED ||
(ride->lifecycle_flags & (RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED))
) {
ride->station_depart[stationIndex] &= ~STATION_DEPART_FLAG;
if (ride->station_depart[stationIndex] & STATION_DEPART_FLAG){
ride->station_depart[stationIndex] &= ~STATION_DEPART_FLAG;
ride_invalidate_station_start(ride, stationIndex, 0);
}
return;
}
@ -193,7 +200,10 @@ static void ride_update_station_race(rct_ride *ride, int stationIndex)
// Race is over
ride->lifecycle_flags &= ~RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING;
ride->station_depart[stationIndex] &= ~STATION_DEPART_FLAG;
if (ride->station_depart[stationIndex] & STATION_DEPART_FLAG){
ride->station_depart[stationIndex] &= ~STATION_DEPART_FLAG;
ride_invalidate_station_start(ride, stationIndex, 0);
}
return;
}
}
@ -205,7 +215,10 @@ static void ride_update_station_race(rct_ride *ride, int stationIndex)
for (i = 0; i < ride->num_vehicles; i++) {
vehicle = &(g_sprite_list[ride->vehicles[i]].vehicle);
if (vehicle->status != VEHICLE_STATUS_WAITING_TO_DEPART && vehicle->status != VEHICLE_STATUS_DEPARTING) {
ride->station_depart[stationIndex] &= ~STATION_DEPART_FLAG;
if (ride->station_depart[stationIndex] & STATION_DEPART_FLAG){
ride->station_depart[stationIndex] &= ~STATION_DEPART_FLAG;
ride_invalidate_station_start(ride, stationIndex, 0);
}
return;
}
}
@ -213,7 +226,10 @@ static void ride_update_station_race(rct_ride *ride, int stationIndex)
// Begin the race
ride_race_init_vehicle_speeds(ride);
ride->lifecycle_flags |= RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING;
ride->station_depart[stationIndex] |= STATION_DEPART_FLAG;
if (!(ride->station_depart[stationIndex] & STATION_DEPART_FLAG)){
ride->station_depart[stationIndex] |= STATION_DEPART_FLAG;
ride_invalidate_station_start(ride, stationIndex, 1);
}
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST;
}
}

View File

@ -35,7 +35,7 @@ static void vehicle_update(rct_vehicle *vehicle);
*/
void vehicle_update_sound_params(rct_vehicle* vehicle)
{
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 2) && (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 4) || RCT2_GLOBAL(0x0141F570, uint8) == 6)) {
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) && (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_TRACK_DESIGNER) || RCT2_GLOBAL(0x0141F570, uint8) == 6)) {
if (vehicle->sound1_id != (uint8)-1 || vehicle->sound2_id != (uint8)-1) {
if (vehicle->sprite_left != 0x8000) {
RCT2_GLOBAL(0x009AF5A0, sint16) = vehicle->sprite_left;
@ -549,10 +549,10 @@ void vehicle_update_all()
uint16 sprite_index;
rct_vehicle *vehicle;
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 2)
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR)
return;
if ((RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 4) && RCT2_GLOBAL(0x0141F570, uint8) != 6)
if ((RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_TRACK_DESIGNER) && RCT2_GLOBAL(0x0141F570, uint8) != 6)
return;

View File

@ -715,13 +715,15 @@ static void window_cheats_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w)
// Misc tab
if (!(w->disabled_widgets & (1 << WIDX_TAB_3))) {
sprite_idx = SPR_TAB_QUESTION;
sprite_idx = STR_TAB_PARK;
gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_3].left, w->y + w->widgets[WIDX_TAB_3].top, 0);
}
// Rides tab
if (!(w->disabled_widgets & (1 << WIDX_TAB_4))) {
sprite_idx = SPR_RIDE;
sprite_idx = SPR_TAB_RIDE_0;
if (w->page == WINDOW_CHEATS_PAGE_RIDES)
sprite_idx += (w->frame_no / 4) % 16;
gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_4].left, w->y + w->widgets[WIDX_TAB_4].top, 0);
}
}
@ -729,6 +731,7 @@ static void window_cheats_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w)
static void window_cheats_set_page(rct_window *w, int page)
{
w->page = page;
w->frame_no = 0;
w->enabled_widgets = window_cheats_page_enabled_widgets[page];

View File

@ -1430,7 +1430,10 @@ static void window_finances_research_invalidate()
}
window_finances_set_pressed_tab(w);
if (RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS_STAGE, uint8) == RESEARCH_STAGE_FINISHED_ALL) {
window_finances_research_widgets[WIDX_RESEARCH_FUNDING].type = WWT_EMPTY;
window_finances_research_widgets[WIDX_RESEARCH_FUNDING_DROPDOWN_BUTTON].type = WWT_EMPTY;
}
int currentResearchLevel = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_RESEARCH_LEVEL, uint8);
// Current funding

View File

@ -152,6 +152,7 @@ static void window_footpath_mousedown_direction(int direction);
static void window_footpath_mousedown_slope(int slope);
static void window_footpath_show_footpath_types_dialog(rct_window *w, rct_widget *widget, int showQueues);
static void window_footpath_set_provisional_path_at_point(int x, int y);
static void window_footpath_set_selection_start_bridge_at_point(int screenX, int screenY);
static void window_footpath_place_path_at_point(int x, int y);
static void window_footpath_start_bridge_at_point(int screenX, int screenY);
static void window_footpath_construct();
@ -389,7 +390,7 @@ static void window_footpath_toolupdate()
if (widgetIndex == WIDX_CONSTRUCT_ON_LAND) {
window_footpath_set_provisional_path_at_point(x, y);
} else if (widgetIndex == WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL) {
RCT2_CALLPROC_X(0x006A8388, x, y, 0, 0, (int)w, 0, 0);
window_footpath_set_selection_start_bridge_at_point(x, y);
}
}
@ -469,10 +470,10 @@ static void window_footpath_update_provisional_path_for_bridge_mode(rct_window *
_window_footpath_provisional_path_arrow_timer = 5;
RCT2_GLOBAL(RCT2_ADDRESS_PROVISIONAL_PATH_FLAGS, uint8) ^= PROVISIONAL_PATH_FLAG_SHOW_ARROW;
footpath_get_next_path_info(&type, &x, &y, &z, &slope);
RCT2_GLOBAL(0x009DEA48, uint16) = x;
RCT2_GLOBAL(0x009DEA4A, uint16) = y;
RCT2_GLOBAL(0x009DEA4C, uint16) = z * 8;
RCT2_GLOBAL(0x009DEA4E, uint8) = RCT2_GLOBAL(RCT2_ADDRESS_CONSTRUCT_PATH_DIRECTION, uint8);
RCT2_GLOBAL(RCT2_ADDRESS_MAP_ARROW_X, uint16) = x;
RCT2_GLOBAL(RCT2_ADDRESS_MAP_ARROW_Y, uint16) = y;
RCT2_GLOBAL(RCT2_ADDRESS_MAP_ARROW_Z, uint16) = z * 8;
RCT2_GLOBAL(RCT2_ADDRESS_MAP_ARROW_DIRECTION, uint8) = RCT2_GLOBAL(RCT2_ADDRESS_CONSTRUCT_PATH_DIRECTION, uint8);
if (RCT2_GLOBAL(RCT2_ADDRESS_PROVISIONAL_PATH_FLAGS, uint8) & PROVISIONAL_PATH_FLAG_SHOW_ARROW)
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, uint16) |= (1 << 2);
else
@ -703,6 +704,48 @@ static void window_footpath_set_provisional_path_at_point(int x, int y)
}
}
/**
*
* rct2: 0x006A8388
*/
static void window_footpath_set_selection_start_bridge_at_point(int screenX, int screenY)
{
int x, y, direction;
rct_map_element *mapElement;
map_invalidate_selection_rect();
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, uint16) &= ~(1 << 0) & ~(1 << 2);
sub_68A0C9(screenX, screenY, &x, &y, &direction, &mapElement);
if (x == 0x8000)
return;
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, uint16) |= (1 << 0) | (1 << 2);
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_TYPE, uint16) = 4;
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_A_X, uint16) = x;
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_B_X, uint16) = x;
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_A_Y, uint16) = y;
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_B_Y, uint16) = y;
RCT2_GLOBAL(RCT2_ADDRESS_MAP_ARROW_DIRECTION, uint8) = direction;
RCT2_GLOBAL(RCT2_ADDRESS_MAP_ARROW_X, uint16) = x;
RCT2_GLOBAL(RCT2_ADDRESS_MAP_ARROW_Y, uint16) = y;
int z = mapElement->base_height;
if (map_element_get_type(mapElement) == MAP_ELEMENT_TYPE_SURFACE) {
uint8 slope = mapElement->properties.surface.slope;
if (slope & 0xf)
z += 2; // Add 2 for a slope
if (slope & 0x10)
z += 2; // Add another 2 for a steep slope
}
RCT2_GLOBAL(RCT2_ADDRESS_MAP_ARROW_Z, uint16) = z << 3;
map_invalidate_selection_rect();
}
/**
*
* rct2: 0x006A82C5

View File

@ -22,6 +22,7 @@
#include "../audio/audio.h"
#include "../game.h"
#include "../management/news_item.h"
#include "../management/research.h"
#include "../ride/ride.h"
#include "../localisation/localisation.h"
#include "../world/scenery.h"
@ -759,43 +760,58 @@ static void window_new_ride_paint()
int x = w->x + 10;
int y = w->y + window_new_ride_widgets[WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP].top + 12;
rct_string_id stringId;
// Research type
rct_string_id stringId = STR_RESEARCH_UNKNOWN;
if (RCT2_GLOBAL(0x01357CF3, uint8) != 0) {
stringId = STR_TRANSPORT_RIDE + RCT2_GLOBAL(RCT2_ADDRESS_NEXT_RESEARCH_CATEGORY, uint8);
if (RCT2_GLOBAL(0x01357CF3, uint8) != 1) {
uint32 typeId = RCT2_GLOBAL(RCT2_ADDRESS_NEXT_RESEARCH_ITEM, uint32);
if (typeId >= 0x10000) {
rct_ride_type *rideEntry = RCT2_GLOBAL(0x009ACFA4 + (typeId & 0xFF) * 4, rct_ride_type*);
stringId = rideEntry->var_008 & 0x1000 ?
rideEntry->name :
(typeId & 0xFF00) + 2;
} else {
stringId = g_scenerySetEntries[typeId]->name;
if (RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS_STAGE, uint8) == RESEARCH_STAGE_FINISHED_ALL){
stringId = STR_RESEARCH_UNKNOWN;
gfx_draw_string_left_wrapped(dpi, &stringId, x, y, 296, STR_RESEARCH_TYPE_LABEL, 0);
y += 25;
// Progress
stringId = 2680;
gfx_draw_string_left_wrapped(dpi, &stringId, x, y, 296, STR_RESEARCH_PROGRESS_LABEL, 0);
y += 15;
RCT2_GLOBAL(0x013CE952, uint16) = STR_UNKNOWN;
gfx_draw_string_left(dpi, STR_RESEARCH_EXPECTED_LABEL, (void*)0x013CE952, 0, x, y);
}
else{
// Research type
stringId = STR_RESEARCH_UNKNOWN;
if (RCT2_GLOBAL(0x01357CF3, uint8) != 0) {
stringId = STR_TRANSPORT_RIDE + RCT2_GLOBAL(RCT2_ADDRESS_NEXT_RESEARCH_CATEGORY, uint8);
if (RCT2_GLOBAL(0x01357CF3, uint8) != 1) {
uint32 typeId = RCT2_GLOBAL(RCT2_ADDRESS_NEXT_RESEARCH_ITEM, uint32);
if (typeId >= 0x10000) {
rct_ride_type *rideEntry = RCT2_GLOBAL(0x009ACFA4 + (typeId & 0xFF) * 4, rct_ride_type*);
stringId = rideEntry->var_008 & 0x1000 ?
rideEntry->name :
(typeId & 0xFF00) + 2;
}
else {
stringId = g_scenerySetEntries[typeId]->name;
}
}
}
}
gfx_draw_string_left_wrapped(dpi, &stringId, x, y, 296, STR_RESEARCH_TYPE_LABEL, 0);
y += 25;
gfx_draw_string_left_wrapped(dpi, &stringId, x, y, 296, STR_RESEARCH_TYPE_LABEL, 0);
y += 25;
// Progress
stringId = 2285 + RCT2_GLOBAL(0x01357CF3, uint8);
gfx_draw_string_left_wrapped(dpi, &stringId, x, y, 296, STR_RESEARCH_PROGRESS_LABEL, 0);
y += 15;
// Progress
stringId = 2285 + RCT2_GLOBAL(0x01357CF3, uint8);
gfx_draw_string_left_wrapped(dpi, &stringId, x, y, 296, STR_RESEARCH_PROGRESS_LABEL, 0);
y += 15;
// Expected
RCT2_GLOBAL(0x013CE952, uint16) = STR_UNKNOWN;
if (RCT2_GLOBAL(0x01357CF3, uint8) != 0) {
uint16 expectedDay = RCT2_GLOBAL(RCT2_ADDRESS_NEXT_RESEARCH_EXPECTED_DAY, uint8);
if (expectedDay != 255) {
RCT2_GLOBAL(0x013CE952 + 2, uint16) = STR_DATE_DAY_1 + expectedDay;
RCT2_GLOBAL(0x013CE952 + 4, uint16) = STR_MONTH_MARCH + RCT2_GLOBAL(RCT2_ADDRESS_NEXT_RESEARCH_EXPECTED_MONTH, uint8);
RCT2_GLOBAL(0x013CE952, uint16) = 2289;
// Expected
RCT2_GLOBAL(0x013CE952, uint16) = STR_UNKNOWN;
if (RCT2_GLOBAL(0x01357CF3, uint8) != 0) {
uint16 expectedDay = RCT2_GLOBAL(RCT2_ADDRESS_NEXT_RESEARCH_EXPECTED_DAY, uint8);
if (expectedDay != 255) {
RCT2_GLOBAL(0x013CE952 + 2, uint16) = STR_DATE_DAY_1 + expectedDay;
RCT2_GLOBAL(0x013CE952 + 4, uint16) = STR_MONTH_MARCH + RCT2_GLOBAL(RCT2_ADDRESS_NEXT_RESEARCH_EXPECTED_MONTH, uint8);
RCT2_GLOBAL(0x013CE952, uint16) = 2289;
}
}
gfx_draw_string_left(dpi, STR_RESEARCH_EXPECTED_LABEL, (void*)0x013CE952, 0, x, y);
}
gfx_draw_string_left(dpi, STR_RESEARCH_EXPECTED_LABEL, (void*)0x013CE952, 0, x, y);
// Last development
x = w->x + 10;
y = w->y + window_new_ride_widgets[WIDX_LAST_DEVELOPMENT_GROUP].top + 12;

View File

@ -339,42 +339,56 @@ static void window_research_development_paint()
x = w->x + 10;
y = w->y + window_research_development_widgets[WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP].top + 12;
// Research type
stringId = STR_RESEARCH_UNKNOWN;
if (RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS_STAGE, uint8) != 0) {
stringId = STR_TRANSPORT_RIDE + RCT2_GLOBAL(RCT2_ADDRESS_NEXT_RESEARCH_CATEGORY, uint8);
if (RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS_STAGE, uint8) != 1) {
uint32 typeId = RCT2_GLOBAL(RCT2_ADDRESS_NEXT_RESEARCH_ITEM, uint32);
if (typeId >= 0x10000) {
rct_ride_type *rideEntry = RCT2_GLOBAL(0x009ACFA4 + (typeId & 0xFF) * 4, rct_ride_type*);
stringId = rideEntry->var_008 & 0x1000 ?
rideEntry->name :
((typeId >> 8) & 0xFF) + 2;
} else {
stringId = g_scenerySetEntries[typeId]->name;
if (RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS_STAGE, uint8) == RESEARCH_STAGE_FINISHED_ALL){
stringId = STR_RESEARCH_UNKNOWN;
gfx_draw_string_left_wrapped(dpi, &stringId, x, y, 296, STR_RESEARCH_TYPE_LABEL, 0);
y += 25;
// Progress
stringId = 2680;
gfx_draw_string_left_wrapped(dpi, &stringId, x, y, 296, STR_RESEARCH_PROGRESS_LABEL, 0);
y += 15;
RCT2_GLOBAL(0x013CE952, uint16) = STR_UNKNOWN;
gfx_draw_string_left(dpi, STR_RESEARCH_EXPECTED_LABEL, (void*)0x013CE952, 0, x, y);
}
else{
// Research type
stringId = STR_RESEARCH_UNKNOWN;
if (RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS_STAGE, uint8) != 0) {
stringId = STR_TRANSPORT_RIDE + RCT2_GLOBAL(RCT2_ADDRESS_NEXT_RESEARCH_CATEGORY, uint8);
if (RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS_STAGE, uint8) != 1) {
uint32 typeId = RCT2_GLOBAL(RCT2_ADDRESS_NEXT_RESEARCH_ITEM, uint32);
if (typeId >= 0x10000) {
rct_ride_type *rideEntry = RCT2_GLOBAL(0x009ACFA4 + (typeId & 0xFF) * 4, rct_ride_type*);
stringId = rideEntry->var_008 & 0x1000 ?
rideEntry->name :
((typeId >> 8) & 0xFF) + 2;
}
else {
stringId = g_scenerySetEntries[typeId]->name;
}
}
}
}
gfx_draw_string_left_wrapped(dpi, &stringId, x, y, 296, STR_RESEARCH_TYPE_LABEL, 0);
y += 25;
gfx_draw_string_left_wrapped(dpi, &stringId, x, y, 296, STR_RESEARCH_TYPE_LABEL, 0);
y += 25;
// Progress
stringId = 2285 + RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS_STAGE, uint8);
gfx_draw_string_left_wrapped(dpi, &stringId, x, y, 296, STR_RESEARCH_PROGRESS_LABEL, 0);
y += 15;
// Progress
stringId = 2285 + RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS_STAGE, uint8);
gfx_draw_string_left_wrapped(dpi, &stringId, x, y, 296, STR_RESEARCH_PROGRESS_LABEL, 0);
y += 15;
// Expected
RCT2_GLOBAL(0x013CE952, uint16) = STR_UNKNOWN;
if (RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS_STAGE, uint8) != 0) {
uint16 expectedDay = RCT2_GLOBAL(RCT2_ADDRESS_NEXT_RESEARCH_EXPECTED_DAY, uint8);
if (expectedDay != 255) {
RCT2_GLOBAL(0x013CE952 + 2, uint16) = STR_DATE_DAY_1 + expectedDay;
RCT2_GLOBAL(0x013CE952 + 4, uint16) = STR_MONTH_MARCH + RCT2_GLOBAL(RCT2_ADDRESS_NEXT_RESEARCH_EXPECTED_MONTH, uint8);
RCT2_GLOBAL(0x013CE952, uint16) = 2289;
// Expected
RCT2_GLOBAL(0x013CE952, uint16) = STR_UNKNOWN;
if (RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS_STAGE, uint8) != 0) {
uint16 expectedDay = RCT2_GLOBAL(RCT2_ADDRESS_NEXT_RESEARCH_EXPECTED_DAY, uint8);
if (expectedDay != 255) {
RCT2_GLOBAL(0x013CE952 + 2, uint16) = STR_DATE_DAY_1 + expectedDay;
RCT2_GLOBAL(0x013CE952 + 4, uint16) = STR_MONTH_MARCH + RCT2_GLOBAL(RCT2_ADDRESS_NEXT_RESEARCH_EXPECTED_MONTH, uint8);
RCT2_GLOBAL(0x013CE952, uint16) = 2289;
}
}
gfx_draw_string_left(dpi, STR_RESEARCH_EXPECTED_LABEL, (void*)0x013CE952, 0, x, y);
}
gfx_draw_string_left(dpi, STR_RESEARCH_EXPECTED_LABEL, (void*)0x013CE952, 0, x, y);
// Last development
x = w->x + 10;
y = w->y + window_research_development_widgets[WIDX_LAST_DEVELOPMENT_GROUP].top + 12;
@ -515,8 +529,9 @@ static void window_research_funding_invalidate()
window_research_set_pressed_tab(w);
if ((RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY)) {
window_research_funding_widgets[WIDX_FUNDING_GROUP].type = WWT_EMPTY;
if ((RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY) ||
(RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS_STAGE, uint8) == RESEARCH_STAGE_FINISHED_ALL)) {
//window_research_funding_widgets[WIDX_FUNDING_GROUP].type = WWT_EMPTY;
window_research_funding_widgets[WIDX_RESEARCH_FUNDING].type = WWT_EMPTY;
window_research_funding_widgets[WIDX_RESEARCH_FUNDING_DROPDOWN_BUTTON].type = WWT_EMPTY;
} else {

View File

@ -395,7 +395,7 @@ void window_track_place_open()
w->colours[1] = 24;
w->colours[2] = 24;
tool_set(w, 6, 12);
RCT2_GLOBAL(RCT2_ADDRESS_INPUT_FLAGS, uint32) |= 6;
RCT2_GLOBAL(RCT2_ADDRESS_INPUT_FLAGS, uint32) |= INPUT_FLAG_6;
window_push_others_right(w);
show_gridlines();
_window_track_place_last_cost = MONEY32_UNDEFINED;

View File

@ -55,7 +55,8 @@ void map_animation_create(int type, int x, int y, int z)
continue;
if (aobj->baseZ != z)
continue;
if (aobj->type != type)
continue;
// Animation already exists
return;
}
@ -82,7 +83,7 @@ void map_animation_invalidate_all()
RCT2_GLOBAL(0x0138B580, uint16)--;
numAnimatedObjects--;
if (numAnimatedObjects > 0)
memmove(aobj, aobj + 1, numAnimatedObjects);
memmove(aobj, aobj + 1, numAnimatedObjects * sizeof(rct_map_animation));
} else {
numAnimatedObjects--;
aobj++;