mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
fb9819f9c6
|
@ -1039,3 +1039,50 @@ void hide_construction_rights()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* rct2: 0x006CB70A
|
||||||
|
*/
|
||||||
|
void viewport_set_visibility(uint8 mode)
|
||||||
|
{
|
||||||
|
rct_window* window = window_get_main();
|
||||||
|
|
||||||
|
if(window != NULL) {
|
||||||
|
rct_viewport* edi = window->viewport;
|
||||||
|
uint32 invalidate = 0;
|
||||||
|
|
||||||
|
switch(mode) {
|
||||||
|
case 0: { //Set all these flags to 0, and invalidate if any were active
|
||||||
|
uint16 mask = VIEWPORT_FLAG_UNDERGROUND_INSIDE | VIEWPORT_FLAG_SEETHROUGH_RIDES |
|
||||||
|
VIEWPORT_FLAG_SEETHROUGH_SCENERY | VIEWPORT_FLAG_INVISIBLE_SUPPORTS |
|
||||||
|
VIEWPORT_FLAG_LAND_HEIGHTS | VIEWPORT_FLAG_TRACK_HEIGHTS |
|
||||||
|
VIEWPORT_FLAG_PATH_HEIGHTS | VIEWPORT_FLAG_INVISIBLE_PEEPS |
|
||||||
|
VIEWPORT_FLAG_HIDE_BASE | VIEWPORT_FLAG_HIDE_VERTICAL;
|
||||||
|
|
||||||
|
invalidate += edi->flags & mask;
|
||||||
|
edi->flags &= ~mask;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1: //6CB79D
|
||||||
|
case 4: //6CB7C4
|
||||||
|
//Set underground on, invalidate if it was off
|
||||||
|
invalidate += !(edi->flags & VIEWPORT_FLAG_UNDERGROUND_INSIDE);
|
||||||
|
edi->flags |= VIEWPORT_FLAG_UNDERGROUND_INSIDE;
|
||||||
|
break;
|
||||||
|
case 2: //6CB7EB
|
||||||
|
//Set track heights on, invalidate if off
|
||||||
|
invalidate += !(edi->flags & VIEWPORT_FLAG_TRACK_HEIGHTS);
|
||||||
|
edi->flags |= VIEWPORT_FLAG_TRACK_HEIGHTS;
|
||||||
|
break;
|
||||||
|
case 3: //6CB7B1
|
||||||
|
case 5: //6CB7D8
|
||||||
|
//Set underground off, invalidate if it was on
|
||||||
|
invalidate += edi->flags & VIEWPORT_FLAG_UNDERGROUND_INSIDE;
|
||||||
|
edi->flags &= ~((uint16)VIEWPORT_FLAG_UNDERGROUND_INSIDE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (invalidate != 0)
|
||||||
|
window_invalidate(window);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -60,5 +60,6 @@ void show_land_rights();
|
||||||
void hide_land_rights();
|
void hide_land_rights();
|
||||||
void show_construction_rights();
|
void show_construction_rights();
|
||||||
void hide_construction_rights();
|
void hide_construction_rights();
|
||||||
|
void viewport_set_visibility(uint8 mode);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -226,7 +226,7 @@ static void window_footpath_close()
|
||||||
window_get_register(w);
|
window_get_register(w);
|
||||||
|
|
||||||
RCT2_CALLPROC_EBPSAFE(0x006A7831);
|
RCT2_CALLPROC_EBPSAFE(0x006A7831);
|
||||||
RCT2_CALLPROC_X(0x006CB70A, 0, 0, 0, 0, 0, 0, 0);
|
viewport_set_visibility(0);
|
||||||
RCT2_CALLPROC_EBPSAFE(0x0068AB1B);
|
RCT2_CALLPROC_EBPSAFE(0x0068AB1B);
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, uint16) &= ~2;
|
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, uint16) &= ~2;
|
||||||
window_invalidate_by_id(WC_TOP_TOOLBAR, 0);
|
window_invalidate_by_id(WC_TOP_TOOLBAR, 0);
|
||||||
|
@ -677,7 +677,7 @@ static int window_footpath_set_provisional_path(int type, int x, int y, int z, i
|
||||||
eax = 3;
|
eax = 3;
|
||||||
if (RCT2_GLOBAL(0x00F3EFA4, uint8) & 2)
|
if (RCT2_GLOBAL(0x00F3EFA4, uint8) & 2)
|
||||||
eax = 1;
|
eax = 1;
|
||||||
RCT2_CALLPROC_X(0x006CB70A, eax, 0, 0, 0, 0, 0, 0);
|
viewport_set_visibility((uint8)eax);
|
||||||
}
|
}
|
||||||
|
|
||||||
return cost;
|
return cost;
|
||||||
|
|
Loading…
Reference in New Issue