mirror of https://github.com/OpenRCT2/OpenRCT2.git
remove unread RCT2_GLOBALs
This commit is contained in:
parent
51f01c3341
commit
8d4e4ed0e9
|
@ -498,7 +498,6 @@ void redraw_rain()
|
|||
}
|
||||
screenPixels[pixelIndex] = pixel & 0xFF;
|
||||
}
|
||||
RCT2_GLOBAL(0x009E2C78, uint32) = 1;
|
||||
_numRainPixels = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -247,9 +247,6 @@ void update_palette_effects()
|
|||
gClimateLightningFlash = 0;
|
||||
}
|
||||
}
|
||||
if (RCT2_GLOBAL(0x009E2C4C, uint32) == 2 || RCT2_GLOBAL(0x009E2C4C, uint32) == 1) {
|
||||
RCT2_GLOBAL(0x009E2C78, int) = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void game_update()
|
||||
|
|
53
src/input.c
53
src/input.c
|
@ -1174,9 +1174,6 @@ void process_mouse_tool(int x, int y)
|
|||
*/
|
||||
void input_state_widget_pressed(int x, int y, int state, int widgetIndex, rct_window *w, rct_widget *widget)
|
||||
{
|
||||
RCT2_GLOBAL(0x1420054, uint16) = x;
|
||||
RCT2_GLOBAL(0x1420056, uint16) = y;
|
||||
|
||||
rct_windowclass cursor_w_class;
|
||||
rct_windownumber cursor_w_number;
|
||||
cursor_w_class = gPressedWidget.window_classification;
|
||||
|
@ -1400,19 +1397,17 @@ void title_handle_keyboard_input()
|
|||
if (!gConsoleOpen) {
|
||||
// Handle modifier keys and key scrolling
|
||||
gInputPlaceObjectModifier = PLACE_OBJECT_MODIFIER_NONE;
|
||||
if (RCT2_GLOBAL(0x009E2B64, uint32) != 1) {
|
||||
if (gKeysState[SDL_SCANCODE_LSHIFT] || gKeysState[SDL_SCANCODE_RSHIFT])
|
||||
gInputPlaceObjectModifier |= PLACE_OBJECT_MODIFIER_SHIFT_Z;
|
||||
if (gKeysState[SDL_SCANCODE_LCTRL] || gKeysState[SDL_SCANCODE_RCTRL])
|
||||
gInputPlaceObjectModifier |= PLACE_OBJECT_MODIFIER_COPY_Z;
|
||||
if (gKeysState[SDL_SCANCODE_LALT] || gKeysState[SDL_SCANCODE_RALT])
|
||||
gInputPlaceObjectModifier |= 4;
|
||||
if (gKeysState[SDL_SCANCODE_LSHIFT] || gKeysState[SDL_SCANCODE_RSHIFT])
|
||||
gInputPlaceObjectModifier |= PLACE_OBJECT_MODIFIER_SHIFT_Z;
|
||||
if (gKeysState[SDL_SCANCODE_LCTRL] || gKeysState[SDL_SCANCODE_RCTRL])
|
||||
gInputPlaceObjectModifier |= PLACE_OBJECT_MODIFIER_COPY_Z;
|
||||
if (gKeysState[SDL_SCANCODE_LALT] || gKeysState[SDL_SCANCODE_RALT])
|
||||
gInputPlaceObjectModifier |= 4;
|
||||
#ifdef __MACOSX__
|
||||
if (gKeysState[SDL_SCANCODE_LGUI] || gKeysState[SDL_SCANCODE_RGUI]) {
|
||||
gInputPlaceObjectModifier |= 8;
|
||||
}
|
||||
#endif
|
||||
if (gKeysState[SDL_SCANCODE_LGUI] || gKeysState[SDL_SCANCODE_RGUI]) {
|
||||
gInputPlaceObjectModifier |= 8;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
while ((key = get_next_key()) != 0) {
|
||||
|
@ -1468,23 +1463,21 @@ void game_handle_keyboard_input()
|
|||
|
||||
// Handle modifier keys and key scrolling
|
||||
gInputPlaceObjectModifier = PLACE_OBJECT_MODIFIER_NONE;
|
||||
if (RCT2_GLOBAL(0x009E2B64, uint32) != 1) {
|
||||
if (gKeysState[SDL_SCANCODE_LSHIFT] || gKeysState[SDL_SCANCODE_RSHIFT]) {
|
||||
gInputPlaceObjectModifier |= PLACE_OBJECT_MODIFIER_SHIFT_Z;
|
||||
}
|
||||
if (gKeysState[SDL_SCANCODE_LCTRL] || gKeysState[SDL_SCANCODE_RCTRL]) {
|
||||
gInputPlaceObjectModifier |= PLACE_OBJECT_MODIFIER_COPY_Z;
|
||||
}
|
||||
if (gKeysState[SDL_SCANCODE_LALT] || gKeysState[SDL_SCANCODE_RALT]) {
|
||||
gInputPlaceObjectModifier |= 4;
|
||||
}
|
||||
#ifdef __MACOSX__
|
||||
if (gKeysState[SDL_SCANCODE_LGUI] || gKeysState[SDL_SCANCODE_RGUI]) {
|
||||
gInputPlaceObjectModifier |= 8;
|
||||
}
|
||||
#endif
|
||||
game_handle_key_scroll();
|
||||
if (gKeysState[SDL_SCANCODE_LSHIFT] || gKeysState[SDL_SCANCODE_RSHIFT]) {
|
||||
gInputPlaceObjectModifier |= PLACE_OBJECT_MODIFIER_SHIFT_Z;
|
||||
}
|
||||
if (gKeysState[SDL_SCANCODE_LCTRL] || gKeysState[SDL_SCANCODE_RCTRL]) {
|
||||
gInputPlaceObjectModifier |= PLACE_OBJECT_MODIFIER_COPY_Z;
|
||||
}
|
||||
if (gKeysState[SDL_SCANCODE_LALT] || gKeysState[SDL_SCANCODE_RALT]) {
|
||||
gInputPlaceObjectModifier |= 4;
|
||||
}
|
||||
#ifdef __MACOSX__
|
||||
if (gKeysState[SDL_SCANCODE_LGUI] || gKeysState[SDL_SCANCODE_RGUI]) {
|
||||
gInputPlaceObjectModifier |= 8;
|
||||
}
|
||||
#endif
|
||||
game_handle_key_scroll();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -51,7 +51,6 @@ void viewport_init_all()
|
|||
|
||||
// Setting up windows
|
||||
gWindowNextSlot = g_window_list;
|
||||
RCT2_GLOBAL(0x01423604, sint32) = 0;
|
||||
|
||||
// Setting up viewports
|
||||
for (int i = 0; i < MAX_VIEWPORT_COUNT; i++) {
|
||||
|
|
|
@ -136,7 +136,6 @@ rct_widget *window_get_scroll_widget(rct_window *w, int scrollIndex)
|
|||
*/
|
||||
void window_dispatch_update_all()
|
||||
{
|
||||
RCT2_GLOBAL(0x01423604, sint32)++;
|
||||
// gTooltipNotShownTicks++;
|
||||
for (rct_window *w = RCT2_LAST_WINDOW; w >= g_window_list; w--)
|
||||
window_event_update_call(w);
|
||||
|
@ -2182,12 +2181,7 @@ void window_invalidate_pressed_image_buttons(rct_window *w)
|
|||
*/
|
||||
void sub_6EA73F()
|
||||
{
|
||||
rct_window *w;
|
||||
|
||||
if (game_is_paused())
|
||||
RCT2_GLOBAL(0x01423604, uint32)++;
|
||||
|
||||
for (w = RCT2_LAST_WINDOW; w >= g_window_list; w--) {
|
||||
for (rct_window *w = RCT2_LAST_WINDOW; w >= g_window_list; w--) {
|
||||
window_update_scroll_widgets(w);
|
||||
window_invalidate_pressed_image_buttons(w);
|
||||
window_event_resize_call(w);
|
||||
|
|
|
@ -98,7 +98,6 @@ int object_load_file(int groupIndex, const rct_object_entry *entry, int* chunkSi
|
|||
// Calculate and check checksum
|
||||
if (calculatedChecksum != openedEntry.checksum && !gConfigGeneral.allow_loading_with_incorrect_checksum) {
|
||||
log_error("Object Load failed due to checksum failure: calculated checksum %d, object says %d.", calculatedChecksum, (int)openedEntry.checksum);
|
||||
RCT2_GLOBAL(0x00F42BD9, uint8) = 2;
|
||||
free(chunk);
|
||||
return 0;
|
||||
|
||||
|
@ -108,14 +107,12 @@ int object_load_file(int groupIndex, const rct_object_entry *entry, int* chunkSi
|
|||
|
||||
if (!object_test(objectType, chunk)) {
|
||||
log_error("Object Load failed due to paint failure.");
|
||||
RCT2_GLOBAL(0x00F42BD9, uint8) = 3;
|
||||
free(chunk);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_TOTAL_NO_IMAGES, uint32) >= 0x4726E){
|
||||
log_error("Object Load failed due to too many images loaded.");
|
||||
RCT2_GLOBAL(0x00F42BD9, uint8) = 4;
|
||||
free(chunk);
|
||||
return 0;
|
||||
}
|
||||
|
@ -125,7 +122,6 @@ int object_load_file(int groupIndex, const rct_object_entry *entry, int* chunkSi
|
|||
for (groupIndex = 0; chunk_list[groupIndex] != (uint8*)-1; groupIndex++) {
|
||||
if (groupIndex + 1 >= object_entry_group_counts[objectType]) {
|
||||
log_error("Object Load failed due to too many objects of a certain type.");
|
||||
RCT2_GLOBAL(0x00F42BD9, uint8) = 5;
|
||||
free(chunk);
|
||||
return 0;
|
||||
}
|
||||
|
@ -160,7 +156,6 @@ int object_load_chunk(int groupIndex, rct_object_entry *entry, int* chunkSize)
|
|||
RCT2_GLOBAL(0xF42B64, uint32) = groupIndex;
|
||||
|
||||
if (gInstalledObjectsCount == 0) {
|
||||
RCT2_GLOBAL(0xF42BD9, uint8) = 0;
|
||||
log_error("Object Load failed due to no items installed check.");
|
||||
return 1;
|
||||
}
|
||||
|
@ -1657,7 +1652,6 @@ int object_get_scenario_text(rct_object_entry *entry)
|
|||
|
||||
if (installedObject == NULL){
|
||||
log_error("Object not found: %.8s", entry->name);
|
||||
RCT2_GLOBAL(0x00F42BD9, uint8) = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1694,7 +1688,6 @@ int object_get_scenario_text(rct_object_entry *entry)
|
|||
// Calculate and check checksum
|
||||
if (object_calculate_checksum(&openedEntry, chunk, chunkSize) != openedEntry.checksum) {
|
||||
log_error("Opened object failed calculated checksum.");
|
||||
RCT2_GLOBAL(0x00F42BD9, uint8) = 2;
|
||||
free(chunk);
|
||||
return 0;
|
||||
}
|
||||
|
@ -1702,7 +1695,6 @@ int object_get_scenario_text(rct_object_entry *entry)
|
|||
if (!object_test(openedEntry.flags & 0x0F, chunk)) {
|
||||
// This is impossible for STEX entries to fail.
|
||||
log_error("Opened object failed paint test.");
|
||||
RCT2_GLOBAL(0x00F42BD9, uint8) = 3;
|
||||
free(chunk);
|
||||
return 0;
|
||||
}
|
||||
|
@ -1735,7 +1727,6 @@ int object_get_scenario_text(rct_object_entry *entry)
|
|||
return 0;
|
||||
}
|
||||
log_error("File failed to open.");
|
||||
RCT2_GLOBAL(0x00F42BD9, uint8) = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -137,8 +137,6 @@ size_t sawyercoding_read_chunk(SDL_RWops* rw, uint8 *buffer)
|
|||
break;
|
||||
}
|
||||
free(src_buffer);
|
||||
// Set length
|
||||
RCT2_GLOBAL(0x009E3828, uint32) = chunkHeader.length;
|
||||
return chunkHeader.length;
|
||||
}
|
||||
|
||||
|
|
|
@ -490,8 +490,6 @@ static void setup_track_manager_objects(){
|
|||
installedObject = object_get_next(installedObject);
|
||||
selection_flags++;
|
||||
}
|
||||
|
||||
RCT2_GLOBAL(0x00F43412, uint16) = num_objects;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -547,8 +545,6 @@ static void setup_track_designer_objects(){
|
|||
installedObject = object_get_next(installedObject);
|
||||
selection_flags++;
|
||||
}
|
||||
|
||||
RCT2_GLOBAL(0x00F43412, uint16) = num_objects;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue