From 51277227ebd5234099925d0a0cfee2b051bb8b1d Mon Sep 17 00:00:00 2001 From: Ted John Date: Sat, 10 Sep 2016 21:57:43 +0100 Subject: [PATCH] Remove unused globals --- src/localisation/localisation.c | 21 --------------------- src/localisation/localisation.h | 1 - src/platform/shared.c | 5 ----- src/world/map.c | 4 ++-- 4 files changed, 2 insertions(+), 29 deletions(-) diff --git a/src/localisation/localisation.c b/src/localisation/localisation.c index 2d3cf91b8c..898915d4c8 100644 --- a/src/localisation/localisation.c +++ b/src/localisation/localisation.c @@ -1161,27 +1161,6 @@ void format_string_to_upper(utf8 *dest, rct_string_id format, void *args) } } -/** - * - * rct2: 0x006E37F7 - * error (eax) - * format (bx) - */ -void error_string_quit(int error, rct_string_id format) -{ - RCT2_GLOBAL(0x14241A0, uint32) = error; - RCT2_GLOBAL(0x9E2DA0, uint32) = 1; - - char* error_string = RCT2_ADDRESS(0x1424080, char); - *error_string = 0; - - if (format != 0xFFFF){ - format_string(error_string, format, gCommonFormatArgs); - } - RCT2_GLOBAL(0x9E2D9C, uint32) = 1; - rct2_exit(); -} - void generate_string_file() { FILE* f; diff --git a/src/localisation/localisation.h b/src/localisation/localisation.h index 1c3fde9371..216ffd357b 100644 --- a/src/localisation/localisation.h +++ b/src/localisation/localisation.h @@ -35,7 +35,6 @@ void format_string(char *dest, rct_string_id format, void *args); void format_string_raw(char *dest, char *src, void *args); void format_string_to_upper(char *dest, rct_string_id format, void *args); void generate_string_file(); -void error_string_quit(int error, rct_string_id format); utf8 *get_string_end(const utf8 *text); size_t get_string_size(const utf8 *text); int get_string_length(const utf8 *text); diff --git a/src/platform/shared.c b/src/platform/shared.c index 8fceffe51c..1c95e09c2a 100644 --- a/src/platform/shared.c +++ b/src/platform/shared.c @@ -599,8 +599,6 @@ static void platform_create_window() if (width == -1) width = 640; if (height == -1) height = 480; - RCT2_GLOBAL(0x009E2D8C, sint32) = 0; - // Create window in window first rather than fullscreen so we have the display the window is on first gWindow = SDL_CreateWindow( "OpenRCT2", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, width, height, SDL_WINDOW_RESIZABLE | SDL_WINDOW_OPENGL @@ -615,9 +613,6 @@ static void platform_create_window() SDL_SetWindowMinimumSize(gWindow, 720, 480); platform_init_window_icon(); - // Set the update palette function pointer - RCT2_GLOBAL(0x009E2BE4, update_palette_func) = platform_update_palette; - // Initialise the surface, palette and draw buffer platform_resize(width, height); diff --git a/src/world/map.c b/src/world/map.c index 23d3a78708..b00c589708 100644 --- a/src/world/map.c +++ b/src/world/map.c @@ -4017,8 +4017,8 @@ void map_reorganise_elements() rct_map_element* new_map_elements = malloc(0x30000 * sizeof(rct_map_element)); rct_map_element* new_elements_pointer = new_map_elements; - if (new_map_elements == NULL || new_map_elements == (rct_map_element*)-1){ - error_string_quit(4370, 0xFFFF); + if (new_map_elements == NULL) { + log_fatal("Unable to allocate memory for map elements."); return; }