mirror of https://github.com/OpenRCT2/OpenRCT2.git
remove some small callprocs
This commit is contained in:
parent
2e1c449e91
commit
63698761fd
|
@ -131,6 +131,7 @@ void draw_string_centred_raw(rct_drawpixelinfo *dpi, int x, int y, int numLines,
|
|||
void gfx_draw_string_right(rct_drawpixelinfo *dpi, int format, void *args, int colour, int x, int y);
|
||||
void draw_string_right_underline(rct_drawpixelinfo *dpi, int format, void *args, int colour, int x, int y);
|
||||
int string_get_height_raw(char *buffer);
|
||||
void sub_6C1F57(rct_drawpixelinfo *dpi, int x, int y, int width, int colour, rct_string_id format, void *args, int ticks);
|
||||
|
||||
// rain
|
||||
void update_rain_animation();
|
||||
|
|
|
@ -1218,4 +1218,31 @@ int string_get_height_raw(char *buffer)
|
|||
}
|
||||
|
||||
return height;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006C1F57
|
||||
*
|
||||
* colour : al
|
||||
* format : bx
|
||||
* x : cx
|
||||
* y : dx
|
||||
* text : esi
|
||||
* dpi : edi
|
||||
* width : bp
|
||||
* ticks : ebp >> 16
|
||||
*/
|
||||
void sub_6C1F57(rct_drawpixelinfo *dpi, int x, int y, int width, int colour, rct_string_id format, void *args, int ticks)
|
||||
{
|
||||
RCT2_CALLPROC_X(
|
||||
0x006C1F57,
|
||||
colour,
|
||||
format,
|
||||
x,
|
||||
y,
|
||||
(int)args,
|
||||
(int)dpi,
|
||||
(width & 0xFFFF) | (ticks << 16)
|
||||
);
|
||||
}
|
|
@ -243,6 +243,8 @@ static uint64 window_editor_objective_options_page_hold_down_widgets[] = {
|
|||
|
||||
#pragma endregion
|
||||
|
||||
static void window_editor_objective_options_update_disabled_widgets(rct_window *w);
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x0067137D
|
||||
|
@ -271,7 +273,7 @@ void window_editor_objective_options_open()
|
|||
w->selected_tab = WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_MAIN;
|
||||
w->no_list_items = 0;
|
||||
w->selected_list_item = -1;
|
||||
RCT2_CALLPROC_X(0x00672609, 0, 0, 0, 0, (int)w, 0, 0);
|
||||
window_editor_objective_options_update_disabled_widgets(w);
|
||||
}
|
||||
|
||||
static void window_editor_objective_options_set_pressed_tab(rct_window *w)
|
||||
|
@ -337,7 +339,7 @@ static void window_editor_objective_options_set_page(rct_window *w, int page)
|
|||
w->event_handlers = window_editor_objective_options_page_events[page];
|
||||
w->widgets = window_editor_objective_options_widgets[page];
|
||||
window_invalidate(w);
|
||||
RCT2_CALLPROC_X(0x00672609, 0, 0, 0, 0, (int)w, 0, 0);
|
||||
window_editor_objective_options_update_disabled_widgets(w);
|
||||
window_event_resize_call(w);
|
||||
window_event_invalidate_call(w);
|
||||
window_init_scroll_widgets(w);
|
||||
|
@ -1284,4 +1286,28 @@ static void window_editor_objective_options_rides_scrollpaint()
|
|||
// Ride name
|
||||
gfx_draw_string_left(dpi, stringId, &ride->name, 0, 15, y);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x00672609
|
||||
*/
|
||||
static void window_editor_objective_options_update_disabled_widgets(rct_window *w)
|
||||
{
|
||||
rct_ride *ride;
|
||||
int i, numRides;
|
||||
|
||||
// Check if there are any rides (not shops or facilities)
|
||||
numRides = 0;
|
||||
FOR_ALL_RIDES(i, ride) {
|
||||
if (gRideClassifications[ride->type] == RIDE_CLASS_RIDE) {
|
||||
numRides++;
|
||||
}
|
||||
}
|
||||
|
||||
if (numRides == 0) {
|
||||
w->disabled_widgets &= ~(1 << WIDX_TAB_2);
|
||||
} else {
|
||||
w->disabled_widgets |= (1 << WIDX_TAB_2);
|
||||
}
|
||||
}
|
|
@ -120,6 +120,8 @@ static void* window_game_bottom_toolbar_events[] = {
|
|||
window_game_bottom_toolbar_emptysub
|
||||
};
|
||||
|
||||
static void window_game_bottom_toolbar_invalidate_dirty_widgets(rct_window *w);
|
||||
|
||||
/**
|
||||
* Creates the main game bottom toolbar window.
|
||||
* rct2: 0x0066B52F (part of 0x0066B3E8)
|
||||
|
@ -521,34 +523,32 @@ static void window_game_bottom_toolbar_draw_right_panel(rct_drawpixelinfo *dpi,
|
|||
*/
|
||||
static void window_game_bottom_toolbar_draw_news_item(rct_drawpixelinfo *dpi, rct_window *w)
|
||||
{
|
||||
int x, y;
|
||||
int x, y, width;
|
||||
rct_string_id stringId;
|
||||
rct_news_item *newsItem;
|
||||
rct_widget *middleOutsetWidget;
|
||||
|
||||
middleOutsetWidget = &window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET];
|
||||
newsItem = &(RCT2_ADDRESS(RCT2_ADDRESS_NEWS_ITEM_LIST, rct_news_item)[0]);
|
||||
|
||||
// Current news item
|
||||
gfx_fill_rect_inset(
|
||||
dpi,
|
||||
w->x + window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].left + 1,
|
||||
w->y + window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].top + 1,
|
||||
w->x + window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].right - 1,
|
||||
w->y + window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].bottom - 1,
|
||||
w->x + middleOutsetWidget->left + 1,
|
||||
w->y + middleOutsetWidget->top + 1,
|
||||
w->x + middleOutsetWidget->right - 1,
|
||||
w->y + middleOutsetWidget->bottom - 1,
|
||||
w->colours[2],
|
||||
48
|
||||
);
|
||||
|
||||
// Text
|
||||
stringId = 1926;
|
||||
// memcpy((char*)language_get_string(1926), &newsItem->colour, 256);
|
||||
memcpy((void*)0x009B5F2C, &newsItem->colour, 256);
|
||||
RCT2_CALLPROC_X(
|
||||
0x006C1F57,
|
||||
14,
|
||||
1926,
|
||||
(window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].left + window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].right) / 2 + w->x,
|
||||
w->y + window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].top + 11,
|
||||
0,
|
||||
(int)dpi,
|
||||
(newsItem->ticks << 16) | (window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].right - window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].left - 62)
|
||||
);
|
||||
x = w->x + (middleOutsetWidget->left + middleOutsetWidget->right) / 2;
|
||||
y = w->y + middleOutsetWidget->top + 11;
|
||||
sub_6C1F57(dpi, x, y, width, 14, stringId, NULL, newsItem->ticks);
|
||||
|
||||
x = w->x + window_game_bottom_toolbar_widgets[WIDX_NEWS_SUBJECT].left;
|
||||
y = w->y + window_game_bottom_toolbar_widgets[WIDX_NEWS_SUBJECT].top;
|
||||
|
@ -635,10 +635,10 @@ static void window_game_bottom_toolbar_draw_tutorial_text(rct_drawpixelinfo *dpi
|
|||
static void window_game_bottom_toolbar_update(rct_window* w){
|
||||
|
||||
w->frame_no++;
|
||||
if (w->frame_no >= 24)w->frame_no = 0;
|
||||
if (w->frame_no >= 24)
|
||||
w->frame_no = 0;
|
||||
|
||||
// Due to windows not fully finished use callproc to save on duplicate code.
|
||||
RCT2_CALLPROC_X((int)window_game_bottom_toolbar_unknown05, 0, 0, 0, 0, (int)w, 0, 0);
|
||||
window_game_bottom_toolbar_invalidate_dirty_widgets(w);
|
||||
}
|
||||
|
||||
/* rct2: 0x006C644 */
|
||||
|
@ -664,6 +664,12 @@ static void window_game_bottom_toolbar_unknown05(){
|
|||
|
||||
window_get_register(w);
|
||||
|
||||
window_game_bottom_toolbar_invalidate_dirty_widgets(w);
|
||||
}
|
||||
|
||||
/* rct2: 0x0066C6F2 */
|
||||
static void window_game_bottom_toolbar_invalidate_dirty_widgets(rct_window *w)
|
||||
{
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_BTM_TOOLBAR_DIRTY_FLAGS, uint16) & BTM_TB_DIRTY_FLAG_MONEY){
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_BTM_TOOLBAR_DIRTY_FLAGS, uint16) &= ~BTM_TB_DIRTY_FLAG_MONEY;
|
||||
widget_invalidate(w, WIDX_LEFT_INSET);
|
||||
|
|
Loading…
Reference in New Issue