int ride_reliability_compare(const void *a, const void *b) { rct_ride *rideA, *rideB; rideA = GET_RIDE(*((uint8*)a)); rideB = GET_RIDE(*((uint8*)b)); return rideB->reliability - rideA->reliability; }
int ride_name_compare(const void *a, const void *b) { char rideAName[256], rideBName[256]; rct_ride *rideA, *rideB; rideA = GET_RIDE(*((uint8*)a)); rideB = GET_RIDE(*((uint8*)b)); format_string(rideAName, rideA->name, &rideA->name_arguments); format_string(rideBName, rideB->name, &rideB->name_arguments); return _strcmpi(rideAName, rideBName); }
void window_construction_maze_close(){ rct_window *w; window_get_register(w); sub_6C9627(); viewport_set_visibility(0); map_invalidate_map_selection_tiles(); RCT2_GLOBAL(0x9DE58A, uint16) &= 0xFFFD; hide_gridlines(); uint8 ride_id = RCT2_GLOBAL(0xF440A7, uint8); rct_ride* ride = GET_RIDE(ride_id); if (ride->overall_view == 0xFFFF){ int eax = RCT2_GLOBAL(0x009DEA6E, uint8); RCT2_GLOBAL(0x009DEA6E, uint8) = 0; game_do_command(0, 9, 0, ride_id, GAME_COMMAND_7, 0, 0); RCT2_GLOBAL(0x009DEA6E, uint8) = eax; return; } window_ride_main_open(ride_id); }
/** * * rct2: 0x006B7A38 */ void reset_all_ride_build_dates() { int i; rct_ride *ride; for (i = 0; i < MAX_RIDES; i++) { ride = GET_RIDE(i); if (ride->type != RIDE_TYPE_NULL) { //mov ax, current_month_year //sub [esi + 180h], ax ride->build_date -= RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_YEAR, uint16); } } }
int ride_get_count() { rct_ride *ride; int i, count = 0; for (i = 0; i < MAX_RIDES; i++) { ride = GET_RIDE(i); if (ride->type != RIDE_TYPE_NULL) count++; } return count; }
/** * * rct2: 0x006B48E5 */ static void window_ride_demolish_paint(rct_window *w, rct_drawpixelinfo *dpi) { window_draw_widgets(w, dpi); rct_ride* ride = GET_RIDE(w->number); RCT2_GLOBAL(0x13CE952, uint16) = ride->name; RCT2_GLOBAL(0x13CE954, uint32) = ride->name_arguments; int x = w->x + WW / 2; int y = w->y + (WH / 2) - 3; gfx_draw_string_centred_wrapped(dpi, (void*)0x13CE952, x, y, WW - 4, STR_DEMOLISH_RIDE_ID, 0); }
/** * * rct2: 0x006ACA89 */ void ride_init_all() { int i; rct_ride *ride; rct_ride_measurement *ride_measurement; for (i = 0; i < MAX_RIDES; i++) { ride = GET_RIDE(i); ride->type = RIDE_TYPE_NULL; } RCT2_GLOBAL(0x0138B590, sint8) = 0; RCT2_GLOBAL(0x0138B591, sint8) = 0; for (i = 0; i < MAX_RIDE_MEASUREMENTS; i++) { ride_measurement = GET_RIDE_MEASUREMENT(i); ride_measurement->var_00 = 0xFF; } }
/** * type == 0 -> guests on ride * type == 1 -> guests in queue * type == 2 -> guests thinking about ride * type == 3 -> guests thinking X, opened from news item * index is number of the ride or index of the thought * values of eax and edx probably determine the filter name string * * rct2: 0x006993BA */ void window_guest_list_open_with_filter(int type, int index) { uint32 eax, edx; window_guest_list_open(); _window_guest_list_selected_page = 0; _window_guest_list_num_pages = 1; _window_guest_list_tracking_only = false; RCT2_GLOBAL(0x009AC7E0, uint8) = 0; RCT2_GLOBAL(0x009AC7F0, uint8) = 0; rct_ride *ride = NULL; if (type != 3) { // common for cases 0, 1, 2 ride = GET_RIDE(index & 0x000000FF); eax = ride->name; edx = ride->name_arguments; } switch(type) { case 0: _window_guest_list_selected_filter = 0; eax = (eax << 16) + 1435; if ((RCT2_GLOBAL(0x97CF40 + ride->type * 8, uint32) & 0x400000) != 0) eax++; RCT2_GLOBAL(0x00F1EDF6, uint32) = eax; RCT2_GLOBAL(0x00F1EDFA, uint32) = edx; _window_guest_list_highlighted_index = 0xFFFF; _window_guest_list_selected_tab = 0; _window_guest_list_selected_view = 0; break; case 1: _window_guest_list_selected_filter = 0; eax = (eax << 16) + 1433; RCT2_GLOBAL(0x00F1EDF6, uint32) = eax; RCT2_GLOBAL(0x00F1EDFA, uint32) = edx; _window_guest_list_highlighted_index = 0xFFFF; _window_guest_list_selected_tab = 0; _window_guest_list_selected_view = 0; break; case 2: _window_guest_list_selected_filter = 1; eax = (eax << 16) + 0xFFFF; RCT2_GLOBAL(0x00F1EDF6, uint32) = eax; RCT2_GLOBAL(0x00F1EDFA, uint32) = edx; _window_guest_list_highlighted_index = 0xFFFF; _window_guest_list_selected_tab = 0; _window_guest_list_selected_view = 1; break; case 3: _window_guest_list_selected_filter = 1; index = (index & 0x000000FF) + 1480; RCT2_GLOBAL(0x00F1EDF6, uint32) = index; RCT2_GLOBAL(0x00F1EDFA, uint32) = 0; _window_guest_list_highlighted_index = 0xFFFF; _window_guest_list_selected_tab = 0; _window_guest_list_selected_view = 1; break; } }
/** * * rct2: 0x006CB481 */ rct_window *window_construction_open() { //int eax, ebx, ecx, edx, esi, edi, ebp; //RCT2_CALLFUNC_X(0x006CB481, &eax, &ebx, &ecx, &edx, &esi, &edi, &ebp); //return (rct_window*)esi; int ride_id = RCT2_GLOBAL(0xF440A7, uint8); sub_6b2fa9(ride_id); rct_window *w; rct_ride* ride = GET_RIDE(ride_id); if (ride->type == RIDE_TYPE_MAZE){ w = window_create(0, 29, 166, 200, (uint32*)window_construction_maze_events, WC_RIDE_CONSTRUCTION, WF_9); w->widgets = (rct_widget*)0x9D7D04; w->enabled_widgets = 0x6F0001C4; window_init_scroll_widgets(w); w->colours[0] = 24; w->colours[1] = 24; w->colours[2] = 24; w->number = ride_id; window_push_others_right(w); show_gridlines(); return w; } w = window_create(0, 29, 166, 394, (uint32*)window_construction_events, WC_RIDE_CONSTRUCTION, WF_9); w->widgets = (rct_widget*)0x9D7A90; w->enabled_widgets = 0x67EFFFFFC4; window_init_scroll_widgets(w); w->colours[0] = 24; w->colours[1] = 24; w->colours[2] = 24; w->number = ride_id; window_push_others_right(w); show_gridlines(); RCT2_GLOBAL(0xF44070, uint32) = 0x80000000; RCT2_GLOBAL(0xF440CD, uint8) = 8; RCT2_GLOBAL(0xF440CE, uint8) = 18; RCT2_GLOBAL(0xF440CF, uint8) = 4; if (ride->type == RIDE_TYPE_REVERSE_FREEFALL_COASTER){ RCT2_GLOBAL(0xF440CE, uint8) = 30; } if (ride->type == RIDE_TYPE_AIR_POWERED_VERTICAL_COASTER){ RCT2_GLOBAL(0xF440CE, uint8) = 30; } RCT2_GLOBAL(0xF440A0,uint16) = RCT2_ADDRESS(0x0097CC68, uint8)[ride->type * 2] | 0x100; RCT2_GLOBAL(0x00F440B2, uint8) = 0; RCT2_GLOBAL(0x00F440B3, uint8) = 0; RCT2_GLOBAL(0x00F440B4, uint8) = 0; RCT2_GLOBAL(0x00F440B5, uint8) = 0; if (RCT2_ADDRESS(0x0097D4F2, uint16)[ride->type * 4] & 0x8000) RCT2_GLOBAL(0x00F440B5, uint8) |= 2; RCT2_GLOBAL(0x00F440B6, uint8) = 0; RCT2_GLOBAL(0x00F440B7, uint8) = 0; RCT2_GLOBAL(0x00F440AE, uint8) = 0; RCT2_GLOBAL(0x00F440A6, uint8) = 4; RCT2_GLOBAL(0x00F440B0, uint8) = 0; RCT2_GLOBAL(0x00F440B1, uint8) = 0; RCT2_GLOBAL(0x00F44159, uint8) = 0; RCT2_GLOBAL(0x00F4415C, uint8) = 0; return w; }