mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-29 09:44:52 +01:00
Replace our own integer types with standard ones
This commit is contained in:
@@ -124,7 +124,7 @@ static rct_widget *window_editor_objective_options_widgets[] = {
|
||||
static void window_editor_objective_options_main_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_editor_objective_options_main_resize(rct_window *w);
|
||||
static void window_editor_objective_options_main_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget);
|
||||
static void window_editor_objective_options_main_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex);
|
||||
static void window_editor_objective_options_main_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_editor_objective_options_main_update(rct_window *w);
|
||||
static void window_editor_objective_options_main_textinput(rct_window *w, rct_widgetindex widgetIndex, char *text);
|
||||
static void window_editor_objective_options_main_invalidate(rct_window *w);
|
||||
@@ -133,12 +133,12 @@ static void window_editor_objective_options_main_paint(rct_window *w, rct_drawpi
|
||||
static void window_editor_objective_options_rides_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_editor_objective_options_rides_resize(rct_window *w);
|
||||
static void window_editor_objective_options_rides_update(rct_window *w);
|
||||
static void window_editor_objective_options_rides_scrollgetheight(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height);
|
||||
static void window_editor_objective_options_rides_scrollmousedown(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y);
|
||||
static void window_editor_objective_options_rides_scrollmouseover(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y);
|
||||
static void window_editor_objective_options_rides_scrollgetheight(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_editor_objective_options_rides_scrollmousedown(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y);
|
||||
static void window_editor_objective_options_rides_scrollmouseover(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y);
|
||||
static void window_editor_objective_options_rides_invalidate(rct_window *w);
|
||||
static void window_editor_objective_options_rides_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_editor_objective_options_rides_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex);
|
||||
static void window_editor_objective_options_rides_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex);
|
||||
|
||||
// 0x009A9DF4
|
||||
static rct_window_event_list window_objective_options_main_events = {
|
||||
@@ -213,7 +213,7 @@ static rct_window_event_list *window_editor_objective_options_page_events[] = {
|
||||
|
||||
#pragma region Enabled widgets
|
||||
|
||||
static uint64 window_editor_objective_options_page_enabled_widgets[] = {
|
||||
static uint64_t window_editor_objective_options_page_enabled_widgets[] = {
|
||||
(1 << WIDX_CLOSE) |
|
||||
(1 << WIDX_TAB_1) |
|
||||
(1 << WIDX_TAB_2) |
|
||||
@@ -236,7 +236,7 @@ static uint64 window_editor_objective_options_page_enabled_widgets[] = {
|
||||
(1 << WIDX_TAB_2)
|
||||
};
|
||||
|
||||
static uint64 window_editor_objective_options_page_hold_down_widgets[] = {
|
||||
static uint64_t window_editor_objective_options_page_hold_down_widgets[] = {
|
||||
(1 << WIDX_OBJECTIVE_ARG_1_INCREASE) |
|
||||
(1 << WIDX_OBJECTIVE_ARG_1_DECREASE) |
|
||||
(1 << WIDX_OBJECTIVE_ARG_2_INCREASE) |
|
||||
@@ -285,7 +285,7 @@ rct_window * window_editor_objective_options_open()
|
||||
|
||||
static void window_editor_objective_options_set_pressed_tab(rct_window *w)
|
||||
{
|
||||
sint32 i;
|
||||
int32_t i;
|
||||
for (i = 0; i < 2; i++)
|
||||
w->pressed_widgets &= ~(1 << (WIDX_TAB_1 + i));
|
||||
w->pressed_widgets |= 1LL << (WIDX_TAB_1 + w->page);
|
||||
@@ -305,7 +305,7 @@ static void window_editor_objective_options_anchor_border_widgets(rct_window *w)
|
||||
static void window_editor_objective_options_draw_tab_images(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
{
|
||||
rct_widget *widget;
|
||||
sint32 spriteIndex;
|
||||
int32_t spriteIndex;
|
||||
|
||||
// Tab 1
|
||||
widget = &w->widgets[WIDX_TAB_1];
|
||||
@@ -331,7 +331,7 @@ static void window_editor_objective_options_draw_tab_images(rct_window *w, rct_d
|
||||
*
|
||||
* rct2: 0x00668496
|
||||
*/
|
||||
static void window_editor_objective_options_set_page(rct_window *w, sint32 page)
|
||||
static void window_editor_objective_options_set_page(rct_window *w, int32_t page)
|
||||
{
|
||||
if (w->page == page)
|
||||
return;
|
||||
@@ -357,7 +357,7 @@ static void window_editor_objective_options_set_page(rct_window *w, sint32 page)
|
||||
*
|
||||
* rct2: 0x0067201D
|
||||
*/
|
||||
static void window_editor_objective_options_set_objective(rct_window *w, sint32 objective)
|
||||
static void window_editor_objective_options_set_objective(rct_window *w, int32_t objective)
|
||||
{
|
||||
gScenarioObjectiveType = objective;
|
||||
window_invalidate(w);
|
||||
@@ -413,7 +413,7 @@ static void window_editor_objective_options_main_mouseup(rct_window *w, rct_widg
|
||||
window_editor_objective_options_set_page(w, widgetIndex - WIDX_TAB_1);
|
||||
break;
|
||||
case WIDX_PARK_NAME:
|
||||
set_format_arg(16, uint32, gParkNameArgs);
|
||||
set_format_arg(16, uint32_t, gParkNameArgs);
|
||||
window_text_input_open(w, WIDX_PARK_NAME, STR_PARK_NAME, STR_ENTER_PARK_NAME, gParkName, 0, 32);
|
||||
break;
|
||||
case WIDX_SCENARIO_NAME:
|
||||
@@ -436,9 +436,9 @@ static void window_editor_objective_options_main_resize(rct_window *w)
|
||||
|
||||
static void window_editor_objective_options_show_objective_dropdown(rct_window *w)
|
||||
{
|
||||
sint32 numItems = 0, objectiveType;
|
||||
int32_t numItems = 0, objectiveType;
|
||||
rct_widget *dropdownWidget;
|
||||
uint32 parkFlags;
|
||||
uint32_t parkFlags;
|
||||
|
||||
dropdownWidget = &w->widgets[WIDX_OBJECTIVE];
|
||||
parkFlags = gParkFlags;
|
||||
@@ -501,7 +501,7 @@ static void window_editor_objective_options_show_objective_dropdown(rct_window *
|
||||
);
|
||||
|
||||
objectiveType = gScenarioObjectiveType;
|
||||
for (sint32 j = 0; j < numItems; j++)
|
||||
for (int32_t j = 0; j < numItems; j++)
|
||||
{
|
||||
if (gDropdownItemsArgs[j] - STR_OBJECTIVE_DROPDOWN_NONE == objectiveType)
|
||||
{
|
||||
@@ -513,7 +513,7 @@ static void window_editor_objective_options_show_objective_dropdown(rct_window *
|
||||
|
||||
static void window_editor_objective_options_show_climate_dropdown(rct_window *w)
|
||||
{
|
||||
sint32 i;
|
||||
int32_t i;
|
||||
rct_widget *dropdownWidget;
|
||||
|
||||
dropdownWidget = &w->widgets[WIDX_CLIMATE];
|
||||
@@ -537,7 +537,7 @@ static void window_editor_objective_options_show_climate_dropdown(rct_window *w)
|
||||
|
||||
static void window_editor_objective_options_show_category_dropdown(rct_window *w)
|
||||
{
|
||||
sint32 i;
|
||||
int32_t i;
|
||||
rct_widget *dropdownWidget;
|
||||
|
||||
dropdownWidget = &w->widgets[WIDX_CATEGORY];
|
||||
@@ -710,9 +710,9 @@ static void window_editor_objective_options_main_mousedown(rct_window *w, rct_wi
|
||||
*
|
||||
* rct2: 0x00671A54
|
||||
*/
|
||||
static void window_editor_objective_options_main_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex)
|
||||
static void window_editor_objective_options_main_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex)
|
||||
{
|
||||
uint8 newObjectiveType;
|
||||
uint8_t newObjectiveType;
|
||||
|
||||
if (dropdownIndex == -1)
|
||||
return;
|
||||
@@ -720,19 +720,19 @@ static void window_editor_objective_options_main_dropdown(rct_window *w, rct_wid
|
||||
switch (widgetIndex) {
|
||||
case WIDX_OBJECTIVE_DROPDOWN:
|
||||
// TODO: Don't rely on string ID order
|
||||
newObjectiveType = (uint8)(gDropdownItemsArgs[dropdownIndex] - STR_OBJECTIVE_DROPDOWN_NONE);
|
||||
newObjectiveType = (uint8_t)(gDropdownItemsArgs[dropdownIndex] - STR_OBJECTIVE_DROPDOWN_NONE);
|
||||
if (gScenarioObjectiveType != newObjectiveType)
|
||||
window_editor_objective_options_set_objective(w, newObjectiveType);
|
||||
break;
|
||||
case WIDX_CLIMATE_DROPDOWN:
|
||||
if (gClimate != (uint8)dropdownIndex) {
|
||||
gClimate = (uint8)dropdownIndex;
|
||||
if (gClimate != (uint8_t)dropdownIndex) {
|
||||
gClimate = (uint8_t)dropdownIndex;
|
||||
window_invalidate(w);
|
||||
}
|
||||
break;
|
||||
case WIDX_CATEGORY_DROPDOWN:
|
||||
if (gS6Info.category != (uint8)dropdownIndex) {
|
||||
gS6Info.category = (uint8)dropdownIndex;
|
||||
if (gS6Info.category != (uint8_t)dropdownIndex) {
|
||||
gS6Info.category = (uint8_t)dropdownIndex;
|
||||
window_invalidate(w);
|
||||
}
|
||||
break;
|
||||
@@ -745,8 +745,8 @@ static void window_editor_objective_options_main_dropdown(rct_window *w, rct_wid
|
||||
*/
|
||||
static void window_editor_objective_options_main_update(rct_window *w)
|
||||
{
|
||||
uint32 parkFlags;
|
||||
uint8 objectiveType;
|
||||
uint32_t parkFlags;
|
||||
uint8_t objectiveType;
|
||||
|
||||
w->frame_no++;
|
||||
window_event_invalidate_call(w);
|
||||
@@ -870,9 +870,9 @@ static void window_editor_objective_options_main_invalidate(rct_window *w)
|
||||
*/
|
||||
static void window_editor_objective_options_main_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
{
|
||||
sint32 x, y, width;
|
||||
int32_t x, y, width;
|
||||
rct_string_id stringId;
|
||||
uint32 arg;
|
||||
uint32_t arg;
|
||||
|
||||
window_draw_widgets(w, dpi);
|
||||
window_editor_objective_options_draw_tab_images(w, dpi);
|
||||
@@ -979,7 +979,7 @@ static void window_editor_objective_options_main_paint(rct_window *w, rct_drawpi
|
||||
} else {
|
||||
set_format_arg(0, rct_string_id, gParkName);
|
||||
}
|
||||
set_format_arg(2, uint32, gParkNameArgs);
|
||||
set_format_arg(2, uint32_t, gParkNameArgs);
|
||||
gfx_draw_string_left_clipped(dpi, STR_WINDOW_PARK_NAME, gCommonFormatArgs, COLOUR_BLACK, x, y, width);
|
||||
|
||||
// Scenario name
|
||||
@@ -989,7 +989,7 @@ static void window_editor_objective_options_main_paint(rct_window *w, rct_drawpi
|
||||
|
||||
if (stex != nullptr) {
|
||||
set_format_arg(0, rct_string_id, stex->scenario_name);
|
||||
set_format_arg(2, uint32, gParkNameArgs);
|
||||
set_format_arg(2, uint32_t, gParkNameArgs);
|
||||
} else {
|
||||
set_format_arg(0, rct_string_id, STR_STRING);
|
||||
set_format_arg(2, const char *, gS6Info.name);
|
||||
@@ -1009,7 +1009,7 @@ static void window_editor_objective_options_main_paint(rct_window *w, rct_drawpi
|
||||
|
||||
if (stex != nullptr) {
|
||||
set_format_arg(0, rct_string_id, stex->details);
|
||||
set_format_arg(2, uint32, gParkNameArgs);
|
||||
set_format_arg(2, uint32_t, gParkNameArgs);
|
||||
} else {
|
||||
set_format_arg(0, rct_string_id, STR_STRING);
|
||||
set_format_arg(2, const char *, gS6Info.details);
|
||||
@@ -1060,7 +1060,7 @@ static void window_editor_objective_options_rides_resize(rct_window *w)
|
||||
*/
|
||||
static void window_editor_objective_options_rides_update(rct_window *w)
|
||||
{
|
||||
sint32 i, numItems;
|
||||
int32_t i, numItems;
|
||||
Ride *ride;
|
||||
|
||||
w->frame_no++;
|
||||
@@ -1086,7 +1086,7 @@ static void window_editor_objective_options_rides_update(rct_window *w)
|
||||
*
|
||||
* rct2: 0x006724BF
|
||||
*/
|
||||
static void window_editor_objective_options_rides_scrollgetheight(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height)
|
||||
static void window_editor_objective_options_rides_scrollgetheight(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height)
|
||||
{
|
||||
*height = w->no_list_items * 12;
|
||||
}
|
||||
@@ -1095,10 +1095,10 @@ static void window_editor_objective_options_rides_scrollgetheight(rct_window *w,
|
||||
*
|
||||
* rct2: 0x006724FC
|
||||
*/
|
||||
static void window_editor_objective_options_rides_scrollmousedown(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y)
|
||||
static void window_editor_objective_options_rides_scrollmousedown(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y)
|
||||
{
|
||||
Ride *ride;
|
||||
sint32 i;
|
||||
int32_t i;
|
||||
|
||||
i = y / 12;
|
||||
if (i < 0 || i >= w->no_list_items)
|
||||
@@ -1113,9 +1113,9 @@ static void window_editor_objective_options_rides_scrollmousedown(rct_window *w,
|
||||
*
|
||||
* rct2: 0x006724CC
|
||||
*/
|
||||
static void window_editor_objective_options_rides_scrollmouseover(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y)
|
||||
static void window_editor_objective_options_rides_scrollmouseover(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y)
|
||||
{
|
||||
sint32 i;
|
||||
int32_t i;
|
||||
|
||||
i = y / 12;
|
||||
if (i < 0 || i >= w->no_list_items)
|
||||
@@ -1164,16 +1164,16 @@ static void window_editor_objective_options_rides_paint(rct_window *w, rct_drawp
|
||||
*
|
||||
* rct2: 0x0067236F
|
||||
*/
|
||||
static void window_editor_objective_options_rides_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex)
|
||||
static void window_editor_objective_options_rides_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex)
|
||||
{
|
||||
rct_string_id stringId;
|
||||
Ride *ride;
|
||||
|
||||
sint32 colour = ColourMapA[w->colours[1]].mid_light;
|
||||
int32_t colour = ColourMapA[w->colours[1]].mid_light;
|
||||
gfx_fill_rect(dpi, dpi->x, dpi->y, dpi->x + dpi->width - 1, dpi->y + dpi->height - 1, colour);
|
||||
|
||||
for (sint32 i = 0; i < w->no_list_items; i++) {
|
||||
sint32 y = i * 12;
|
||||
for (int32_t i = 0; i < w->no_list_items; i++) {
|
||||
int32_t y = i * 12;
|
||||
|
||||
if (y + 12 < dpi->y || y >= dpi->y + dpi->height)
|
||||
continue;
|
||||
@@ -1208,7 +1208,7 @@ static void window_editor_objective_options_rides_scrollpaint(rct_window *w, rct
|
||||
static void window_editor_objective_options_update_disabled_widgets(rct_window *w)
|
||||
{
|
||||
Ride *ride;
|
||||
sint32 i, numRides;
|
||||
int32_t i, numRides;
|
||||
|
||||
// Check if there are any rides (not shops or facilities)
|
||||
numRides = 0;
|
||||
|
||||
Reference in New Issue
Block a user