Make more data and functions static

This commit is contained in:
Marijn van der Werf 2017-09-06 20:53:30 +02:00
parent ac910a5979
commit 700a82e200
10 changed files with 20 additions and 31 deletions

View File

@ -1439,8 +1439,7 @@ void game_init_all(sint32 mapSize)
gInMapInitCode = false;
window_new_ride_init_vars();
window_guest_list_init_vars_a();
window_guest_list_init_vars_b();
window_guest_list_init_vars();
scenery_set_default_placement_configuration();
window_tile_inspector_clear_clipboard();
load_palette();

View File

@ -761,8 +761,7 @@ rct_window * window_editor_main_open();
void window_editor_bottom_toolbar_open();
void window_editor_object_selection_open();
void window_guest_list_init_vars_a();
void window_guest_list_init_vars_b();
void window_guest_list_init_vars();
void window_bubble_list_item(rct_window* w, sint32 item_position);
void window_align_tabs( rct_window *w, rct_widgetindex start_tab_id, rct_widgetindex end_tab_id );

View File

@ -242,7 +242,7 @@ static bool filter_source(const ObjectRepositoryItem * item);
static bool filter_chunks(const ObjectRepositoryItem * item);
static void filter_update_counts();
void reset_selected_object_count_and_size();
static void reset_selected_object_count_and_size();
static sint32 sub_6AB211();
@ -1495,7 +1495,7 @@ static void window_editor_object_selection_select_required_objects()
*
* rct2: 0x006AA770
*/
void reset_selected_object_count_and_size()
static void reset_selected_object_count_and_size()
{
for (uint8 objectType = 0; objectType < 11; objectType++) {
_numSelectedObjectsForType[objectType] = 0;

View File

@ -413,7 +413,7 @@ static rct_window_event_list *window_guest_page_events[] = {
void window_guest_set_colours();
// 0x981D3C
uint32 window_guest_page_enabled_widgets[] = {
static const uint32 window_guest_page_enabled_widgets[] = {
(1 << WIDX_CLOSE) |
(1 << WIDX_TAB_1) |
(1 << WIDX_TAB_2) |

View File

@ -154,23 +154,14 @@ static void window_guest_list_find_groups();
static void get_arguments_from_peep(rct_peep *peep, uint32 *argument_1, uint32* argument_2);
/**
*
* rct2: 0x0068F083
*/
void window_guest_list_init_vars_a()
void window_guest_list_init_vars()
{
// rct2: 0x0068F083
gNextGuestNumber = 1;
_window_guest_list_last_find_groups_tick = 0xFFFFFFFF;
_window_guest_list_selected_filter = 0xFF;
}
/**
*
* rct2: 0x0068F050
*/
void window_guest_list_init_vars_b()
{
// rct2: 0x0068F050
_window_guest_list_selected_tab = 0;
_window_guest_list_selected_view = 0;
_window_guest_list_last_find_groups_tick = 0xFFFFFFFF;

View File

@ -41,7 +41,7 @@ enum WINDOW_OBJECT_LOAD_ERROR_WIDGET_IDX {
#define TYPE_COL_LEFT (5 * WW_LESS_PADDING / 8 + 1)
#define LIST_ITEM_HEIGHT 10
rct_widget window_object_load_error_widgets[] = {
static rct_widget window_object_load_error_widgets[] = {
{ WWT_FRAME, 0, 0, WW - 1, 0, WH - 1, STR_NONE, STR_NONE }, // Background
{ WWT_CAPTION, 0, 1, WW - 2, 1, 14, STR_OBJECT_LOAD_ERROR_TITLE, STR_WINDOW_TITLE_TIP }, // Title bar
{ WWT_CLOSEBOX, 0, WW - 13, WW - 3, 2, 13, STR_CLOSE_X, STR_CLOSE_WINDOW_TIP }, // Close button
@ -95,9 +95,9 @@ static rct_window_event_list window_object_load_error_events = {
window_object_load_error_scrollpaint
};
rct_object_entry * invalid_entries = nullptr;
sint32 highlighted_index = -1;
utf8* file_path = nullptr;
static rct_object_entry * invalid_entries = nullptr;
static sint32 highlighted_index = -1;
static utf8* file_path = nullptr;
/**
* Returns an rct_string_id that represents an rct_object_entry's type.

View File

@ -964,7 +964,7 @@ typedef struct ride_overall_view_t {
uint8 zoom;
} ride_overall_view;
ride_overall_view ride_overall_views[MAX_RIDES] = {0};
static ride_overall_view ride_overall_views[MAX_RIDES] = {0};
const sint32 window_ride_tab_animation_divisor[] = { 0, 0, 2, 2, 4, 2, 8, 8, 2, 0 };
const sint32 window_ride_tab_animation_frames[] = { 0, 0, 4, 16, 8, 16, 8, 8, 8, 0 };

View File

@ -259,7 +259,7 @@ static rct_window_event_list *window_staff_page_events[] = {
&window_staff_stats_events
};
uint32 window_staff_page_enabled_widgets[] = {
static const uint32 window_staff_page_enabled_widgets[] = {
(1 << WIDX_CLOSE) |
(1 << WIDX_TAB_1) |
(1 << WIDX_TAB_2) |

View File

@ -89,11 +89,11 @@ static rct_window_event_list window_text_input_events = {
nullptr
};
rct_string_id input_text_description;
char text_input[TEXT_INPUT_SIZE] = { 0 };
rct_windowclass calling_class = 0;
rct_windownumber calling_number = 0;
sint32 calling_widget = 0;
static rct_string_id input_text_description;
static char text_input[TEXT_INPUT_SIZE] = { 0 };
static rct_windowclass calling_class = 0;
static rct_windownumber calling_number = 0;
static sint32 calling_widget = 0;
static sint32 _maxInputLength;
void window_text_input_open(rct_window* call_w, rct_widgetindex call_widget, rct_string_id title, rct_string_id description, rct_string_id existing_text, uintptr_t existing_args, sint32 maxLength)

View File

@ -34,7 +34,7 @@ typedef struct TITLE_COMMAND_ORDER {
rct_string_id descStringId;
} TITLE_COMMAND_ORDER;
TITLE_COMMAND_ORDER window_title_command_editor_orders[] = {
static TITLE_COMMAND_ORDER window_title_command_editor_orders[] = {
{ TITLE_SCRIPT_LOAD, STR_TITLE_EDITOR_ACTION_LOAD, STR_TITLE_EDITOR_ARGUMENT_SAVEFILE },
{ TITLE_SCRIPT_LOCATION, STR_TITLE_EDITOR_COMMAND_TYPE_LOCATION, STR_TITLE_EDITOR_ARGUMENT_COORDINATES },
{ TITLE_SCRIPT_ROTATE, STR_TITLE_EDITOR_COMMAND_TYPE_ROTATE, STR_TITLE_EDITOR_ARGUMENT_ROTATIONS },