mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 19:13:07 +01:00
Refactor code related to map flashing, removed a small mistake related with it
Removed code related to map flashing from title_update
This commit is contained in:
@@ -126,6 +126,8 @@
|
||||
|
||||
#define RCT2_ADDRESS_RUN_INTRO_TICK_PART 0x009AC319
|
||||
|
||||
#define RCT2_ADDRESS_WINDOW_MAP_FLASHING_FLAGS 0x009AC861
|
||||
|
||||
#define RCT2_ADDRESS_RIDE_ENTRIES 0x009ACFA4
|
||||
|
||||
#define RCT2_ADDRESS_INSTALLED_OBJECT_LIST 0x009ADAE8
|
||||
|
||||
27
src/game.c
27
src/game.c
@@ -201,7 +201,7 @@ void update_palette_effects()
|
||||
|
||||
void game_update()
|
||||
{
|
||||
int i, numUpdates, tmp;
|
||||
int i, numUpdates;
|
||||
|
||||
// Handles picked-up peep and rain redraw
|
||||
redraw_peep_and_rain();
|
||||
@@ -250,17 +250,20 @@ void game_update()
|
||||
RCT2_GLOBAL(0x009A8C28, uint8) = 0;
|
||||
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_INPUT_FLAGS, uint32) &= ~INPUT_FLAG_VIEWPORT_SCROLLING;
|
||||
RCT2_GLOBAL(0x009AC861, uint16) ^= (1 << 15);
|
||||
RCT2_GLOBAL(0x009AC861, uint16) &= ~(1 << 1);
|
||||
tmp = RCT2_GLOBAL(0x009AC861, uint16) & (1 << 0);
|
||||
RCT2_GLOBAL(0x009AC861, uint16) &= ~(1 << 0);
|
||||
if (!tmp)
|
||||
RCT2_GLOBAL(0x009AC861, uint16) |= (1 << 1);
|
||||
RCT2_GLOBAL(0x009AC861, uint16) &= ~(1 << 3);
|
||||
tmp = RCT2_GLOBAL(0x009AC861, uint16) & (1 << 2);
|
||||
RCT2_GLOBAL(0x009AC861, uint16) &= ~(1 << 2);
|
||||
if (!tmp)
|
||||
RCT2_GLOBAL(0x009AC861, uint16) |= (1 << 2);
|
||||
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_WINDOW_MAP_FLASHING_FLAGS, uint16) ^= (1 << 15);
|
||||
|
||||
// Handle guest map flashing
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_WINDOW_MAP_FLASHING_FLAGS, uint16) &= ~(1 << 1);
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_WINDOW_MAP_FLASHING_FLAGS, uint16) & (1 << 0))
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_WINDOW_MAP_FLASHING_FLAGS, uint16) |= (1 << 1);
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_WINDOW_MAP_FLASHING_FLAGS, uint16) &= ~(1 << 0);
|
||||
|
||||
// Handle staff map flashing
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_WINDOW_MAP_FLASHING_FLAGS, uint16) &= ~(1 << 3);
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_WINDOW_MAP_FLASHING_FLAGS, uint16) & (1 << 2))
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_WINDOW_MAP_FLASHING_FLAGS, uint16) |= (1 << 3);
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_WINDOW_MAP_FLASHING_FLAGS, uint16) &= ~(1 << 2);
|
||||
|
||||
window_map_tooltip_update_visibility();
|
||||
window_update_all();
|
||||
|
||||
11
src/title.c
11
src/title.c
@@ -277,17 +277,6 @@ void title_update()
|
||||
}
|
||||
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_INPUT_FLAGS, uint32) &= ~0x80;
|
||||
RCT2_GLOBAL(0x009AC861, uint16) &= ~0x8000;
|
||||
RCT2_GLOBAL(0x009AC861, uint16) &= ~0x02;
|
||||
tmp = RCT2_GLOBAL(0x009AC861, uint16) & 0x01;
|
||||
RCT2_GLOBAL(0x009AC861, uint16) &= ~0x01;
|
||||
if (!tmp)
|
||||
RCT2_GLOBAL(0x009AC861, uint16) |= 0x02;
|
||||
RCT2_GLOBAL(0x009AC861, uint16) &= ~0x08;
|
||||
tmp = RCT2_GLOBAL(0x009AC861, uint16) & 0x04;
|
||||
RCT2_GLOBAL(0x009AC861, uint16) &= ~0x04;
|
||||
if (!tmp)
|
||||
RCT2_GLOBAL(0x009AC861, uint16) |= 0x04;
|
||||
|
||||
window_map_tooltip_update_visibility();
|
||||
window_update_all();
|
||||
|
||||
@@ -598,7 +598,7 @@ static void window_guest_list_scrollpaint()
|
||||
if (_window_guest_list_selected_filter != -1) {
|
||||
if (window_guest_list_is_peep_in_filter(peep))
|
||||
continue;
|
||||
RCT2_GLOBAL(0x009AC861, uint16) |= 1;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_WINDOW_MAP_FLASHING_FLAGS, uint16) |= (1 << 0);
|
||||
peep->var_0C |= 0x200;
|
||||
}
|
||||
|
||||
|
||||
@@ -668,17 +668,17 @@ static void window_map_paint_peep_overlay(rct_drawpixelinfo *dpi)
|
||||
|
||||
if ((peep->var_0C & 0x200) != 0) {
|
||||
if (peep->type == PEEP_TYPE_STAFF) {
|
||||
if ((RCT2_GLOBAL(0x009AC861, uint16) & 8) != 0) {
|
||||
if ((RCT2_GLOBAL(RCT2_ADDRESS_WINDOW_MAP_FLASHING_FLAGS, uint16) & (1 << 3)) != 0) {
|
||||
color = 0x8A;
|
||||
left--;
|
||||
if ((RCT2_GLOBAL(0x009AC861, uint16) & 0x8000) == 0)
|
||||
if ((RCT2_GLOBAL(RCT2_ADDRESS_WINDOW_MAP_FLASHING_FLAGS, uint16) & (1 << 15)) == 0)
|
||||
color = 0xA;
|
||||
}
|
||||
} else {
|
||||
if ((RCT2_GLOBAL(0x009AC861, uint16) & 2) != 0) {
|
||||
if ((RCT2_GLOBAL(RCT2_ADDRESS_WINDOW_MAP_FLASHING_FLAGS, uint16) & (1 << 1)) != 0) {
|
||||
color = 0xAC;
|
||||
left--;
|
||||
if ((RCT2_GLOBAL(0x009AC861, uint16) & 0x8000) == 0)
|
||||
if ((RCT2_GLOBAL(RCT2_ADDRESS_WINDOW_MAP_FLASHING_FLAGS, uint16) & (1 << 15)) == 0)
|
||||
color = 0x15;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -315,10 +315,10 @@ void window_staff_list_update(rct_window *w)
|
||||
w->list_information_type = 0;
|
||||
} else {
|
||||
widget_invalidate(w, WIDX_STAFF_LIST_HANDYMEN_TAB + RCT2_GLOBAL(RCT2_ADDRESS_WINDOW_STAFF_LIST_SELECTED_TAB, uint8));
|
||||
RCT2_GLOBAL(0x009AC861, uint16) |= 2;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_WINDOW_MAP_FLASHING_FLAGS, uint16) |= (1 << 2);
|
||||
FOR_ALL_PEEPS(spriteIndex, peep) {
|
||||
if (peep->type == PEEP_TYPE_STAFF) {
|
||||
peep->var_0C &= 0xFDFF;
|
||||
peep->var_0C &= ~0x200;
|
||||
|
||||
if (peep->staff_type == RCT2_GLOBAL(RCT2_ADDRESS_WINDOW_STAFF_LIST_SELECTED_TAB, uint8)) {
|
||||
peep->var_0C |= 0x200;
|
||||
|
||||
Reference in New Issue
Block a user