From 13921111f319a32bce3412bbe70713e8bb67f8a4 Mon Sep 17 00:00:00 2001 From: IntelOrca Date: Tue, 16 Feb 2016 20:30:43 +0000 Subject: [PATCH] remove old RCT2 cursor code and RCT2 error location variable --- src/audio/audio.c | 1 - src/game.c | 8 -------- src/input.c | 2 -- src/object_list.c | 1 - src/platform/shared.c | 35 ----------------------------------- 5 files changed, 47 deletions(-) diff --git a/src/audio/audio.c b/src/audio/audio.c index 14332cf484..7a8fb5a918 100644 --- a/src/audio/audio.c +++ b/src/audio/audio.c @@ -270,7 +270,6 @@ void audio_init_ride_sounds_and_info() uint32 head; SDL_RWread(file, &head, sizeof(head), 1); SDL_RWclose(file); - RCT2_GLOBAL(0x014241BC, uint32) = 0; if (head == 0x78787878) rideMusicInfo->length = 0; } diff --git a/src/game.c b/src/game.c index 43f9bed012..6003ef3bb5 100644 --- a/src/game.c +++ b/src/game.c @@ -147,9 +147,7 @@ void update_palette_effects() RCT2_ADDRESS(RCT2_ADDRESS_PALETTE + xoffset, uint8)[(i * 4) + 1] = -((0xFF - g1_element.offset[(i * 3) + 1]) / 2) - 1; RCT2_ADDRESS(RCT2_ADDRESS_PALETTE + xoffset, uint8)[(i * 4) + 2] = -((0xFF - g1_element.offset[(i * 3) + 2]) / 2) - 1; } - RCT2_GLOBAL(0x014241BC, uint32) = 2; platform_update_palette(RCT2_ADDRESS(RCT2_ADDRESS_PALETTE, uint8), 10, 236); - RCT2_GLOBAL(0x014241BC, uint32) = 0; RCT2_GLOBAL(RCT2_ADDRESS_LIGHTNING_ACTIVE, uint8)++; } else { if (RCT2_GLOBAL(RCT2_ADDRESS_LIGHTNING_ACTIVE, uint8) == 2) { @@ -235,13 +233,9 @@ void update_palette_effects() vd += 4; } - RCT2_GLOBAL(0x014241BC, uint32) = 2; platform_update_palette(RCT2_ADDRESS(RCT2_ADDRESS_PALETTE, uint8), 230, 16); - RCT2_GLOBAL(0x014241BC, uint32) = 0; if (RCT2_GLOBAL(RCT2_ADDRESS_LIGHTNING_ACTIVE, uint8) == 2) { - RCT2_GLOBAL(0x014241BC, uint32) = 2; platform_update_palette(RCT2_ADDRESS(RCT2_ADDRESS_PALETTE, uint8), 10, 236); - RCT2_GLOBAL(0x014241BC, uint32) = 0; RCT2_GLOBAL(RCT2_ADDRESS_LIGHTNING_ACTIVE, uint8) = 0; } } @@ -763,7 +757,6 @@ int game_load_sv6(SDL_RWops* rw) set_load_objects_fail_reason(); if (gInputFlags & INPUT_FLAG_5){ //call 0x0040705E Sets cursor position and something else. Calls maybe wind func 8 probably pointless - RCT2_GLOBAL(0x14241BC, uint32) = 0; gInputFlags &= ~INPUT_FLAG_5; } @@ -871,7 +864,6 @@ int game_load_network(SDL_RWops* rw) set_load_objects_fail_reason(); if (gInputFlags & INPUT_FLAG_5){ //call 0x0040705E Sets cursor position and something else. Calls maybe wind func 8 probably pointless - RCT2_GLOBAL(0x14241BC, uint32) = 0; gInputFlags &= ~INPUT_FLAG_5; } diff --git a/src/input.c b/src/input.c index ece377dc42..23d1b46485 100644 --- a/src/input.c +++ b/src/input.c @@ -1559,9 +1559,7 @@ void sub_6ED990(char cursor_id){ return; } RCT2_GLOBAL(RCT2_ADDRESS_CURENT_CURSOR, uint8) = cursor_id; - RCT2_GLOBAL(0x14241BC, uint32) = 2; platform_set_cursor(cursor_id); - RCT2_GLOBAL(0x14241BC, uint32) = 0; } diff --git a/src/object_list.c b/src/object_list.c index d7677e2198..631a6f17ec 100644 --- a/src/object_list.c +++ b/src/object_list.c @@ -568,7 +568,6 @@ int object_read_and_load_entries(SDL_RWops* rw) free(entries); if (load_fail){ object_unload_all(); - RCT2_GLOBAL(0x14241BC, uint32) = 0; return 0; } diff --git a/src/platform/shared.c b/src/platform/shared.c index 6a8a45338f..7b95cc41b7 100644 --- a/src/platform/shared.c +++ b/src/platform/shared.c @@ -920,40 +920,6 @@ void platform_set_cursor(char cursor) */ static void platform_load_cursors() { - RCT2_GLOBAL(0x14241BC, uint32) = 2; -#ifdef __WINDOWS__ - HINSTANCE hInst = RCT2_GLOBAL(RCT2_ADDRESS_HINSTANCE, HINSTANCE); - RCT2_GLOBAL(RCT2_ADDRESS_HCURSOR_ARROW, HCURSOR) = LoadCursor(hInst, MAKEINTRESOURCE(0x74)); - RCT2_GLOBAL(RCT2_ADDRESS_HCURSOR_BLANK, HCURSOR) = LoadCursor(hInst, MAKEINTRESOURCE(0xA1)); - RCT2_GLOBAL(RCT2_ADDRESS_HCURSOR_UP_ARROW, HCURSOR) = LoadCursor(hInst, MAKEINTRESOURCE(0x6D)); - RCT2_GLOBAL(RCT2_ADDRESS_HCURSOR_UP_DOWN_ARROW, HCURSOR) = LoadCursor(hInst, MAKEINTRESOURCE(0x6E)); - RCT2_GLOBAL(RCT2_ADDRESS_HCURSOR_HAND_POINT, HCURSOR) = LoadCursor(hInst, MAKEINTRESOURCE(0x70)); - RCT2_GLOBAL(RCT2_ADDRESS_HCURSOR_ZZZ, HCURSOR) = LoadCursor(hInst, MAKEINTRESOURCE(0x78)); - RCT2_GLOBAL(RCT2_ADDRESS_HCURSOR_DIAGONAL_ARROWS, HCURSOR) = LoadCursor(hInst, MAKEINTRESOURCE(0x77)); - RCT2_GLOBAL(RCT2_ADDRESS_HCURSOR_PICKER, HCURSOR) = LoadCursor(hInst, MAKEINTRESOURCE(0x7C)); - RCT2_GLOBAL(RCT2_ADDRESS_HCURSOR_TREE_DOWN, HCURSOR) = LoadCursor(hInst, MAKEINTRESOURCE(0x83)); - RCT2_GLOBAL(RCT2_ADDRESS_HCURSOR_FOUNTAIN_DOWN, HCURSOR) = LoadCursor(hInst, MAKEINTRESOURCE(0x7F)); - RCT2_GLOBAL(RCT2_ADDRESS_HCURSOR_STATUE_DOWN, HCURSOR) = LoadCursor(hInst, MAKEINTRESOURCE(0x80)); - RCT2_GLOBAL(RCT2_ADDRESS_HCURSOR_BENCH_DOWN, HCURSOR) = LoadCursor(hInst, MAKEINTRESOURCE(0x81)); - RCT2_GLOBAL(RCT2_ADDRESS_HCURSOR_CROSS_HAIR, HCURSOR) = LoadCursor(hInst, MAKEINTRESOURCE(0x82)); - RCT2_GLOBAL(RCT2_ADDRESS_HCURSOR_BIN_DOWN, HCURSOR) = LoadCursor(hInst, MAKEINTRESOURCE(0x84)); - RCT2_GLOBAL(RCT2_ADDRESS_HCURSOR_LAMPPOST_DOWN, HCURSOR) = LoadCursor(hInst, MAKEINTRESOURCE(0x85)); - RCT2_GLOBAL(RCT2_ADDRESS_HCURSOR_FENCE_DOWN, HCURSOR) = LoadCursor(hInst, MAKEINTRESOURCE(0x8A)); - RCT2_GLOBAL(RCT2_ADDRESS_HCURSOR_FLOWER_DOWN, HCURSOR) = LoadCursor(hInst, MAKEINTRESOURCE(0x89)); - RCT2_GLOBAL(RCT2_ADDRESS_HCURSOR_PATH_DOWN, HCURSOR) = LoadCursor(hInst, MAKEINTRESOURCE(0x8B)); - RCT2_GLOBAL(RCT2_ADDRESS_HCURSOR_DIG_DOWN, HCURSOR) = LoadCursor(hInst, MAKEINTRESOURCE(0x8D)); - RCT2_GLOBAL(RCT2_ADDRESS_HCURSOR_WATER_DOWN, HCURSOR) = LoadCursor(hInst, MAKEINTRESOURCE(0x8E)); - RCT2_GLOBAL(RCT2_ADDRESS_HCURSOR_HOUSE_DOWN, HCURSOR) = LoadCursor(hInst, MAKEINTRESOURCE(0x8F)); - RCT2_GLOBAL(RCT2_ADDRESS_HCURSOR_VOLCANO_DOWN, HCURSOR) = LoadCursor(hInst, MAKEINTRESOURCE(0x90)); - RCT2_GLOBAL(RCT2_ADDRESS_HCURSOR_WALK_DOWN, HCURSOR) = LoadCursor(hInst, MAKEINTRESOURCE(0x91)); - RCT2_GLOBAL(RCT2_ADDRESS_HCURSOR_PAINT_DOWN, HCURSOR) = LoadCursor(hInst, MAKEINTRESOURCE(0x9E)); - RCT2_GLOBAL(RCT2_ADDRESS_HCURSOR_ENTRANCE_DOWN, HCURSOR) = LoadCursor(hInst, MAKEINTRESOURCE(0x9F)); - RCT2_GLOBAL(RCT2_ADDRESS_HCURSOR_HAND_OPEN, HCURSOR) = LoadCursor(hInst, MAKEINTRESOURCE(0xA6)); - RCT2_GLOBAL(RCT2_ADDRESS_HCURSOR_HAND_CLOSED, HCURSOR) = LoadCursor(hInst, MAKEINTRESOURCE(0xA5)); -#else - STUB(); -#endif // __WINDOWS__ - _cursors[0] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_ARROW); _cursors[1] = SDL_CreateCursor(blank_cursor_data, blank_cursor_mask, 32, 32, BLANK_CURSOR_HOTX, BLANK_CURSOR_HOTY); _cursors[2] = SDL_CreateCursor(up_arrow_cursor_data, up_arrow_cursor_mask, 32, 32, UP_ARROW_CURSOR_HOTX, UP_ARROW_CURSOR_HOTY); @@ -982,7 +948,6 @@ static void platform_load_cursors() _cursors[25] = SDL_CreateCursor(hand_open_cursor_data, hand_open_cursor_mask, 32, 32, HAND_OPEN_CURSOR_HOTX, HAND_OPEN_CURSOR_HOTY); _cursors[26] = SDL_CreateCursor(hand_closed_cursor_data, hand_closed_cursor_mask, 32, 32, HAND_CLOSED_CURSOR_HOTX, HAND_CLOSED_CURSOR_HOTY); platform_set_cursor(CURSOR_ARROW); - RCT2_GLOBAL(0x14241BC, uint32) = 0; } void platform_refresh_video()