1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-19 04:53:12 +01:00

integrate screen variables

This commit is contained in:
Ted John
2016-04-23 11:16:46 +01:00
parent 1950fad315
commit 4cdb2df9dc
43 changed files with 261 additions and 249 deletions

View File

@@ -903,7 +903,7 @@ static int cc_fix_banner_count(const utf8 **argv, int argc)
static int cc_open(const utf8 **argv, int argc) {
if (argc > 0) {
bool title = (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_TITLE_DEMO) != 0;
bool title = (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) != 0;
bool invalidTitle = false;
if (strcmp(argv[0], "object_selection") == 0 && invalidArguments(&invalidTitle, !title)) {
// Only this window should be open for safety reasons

View File

@@ -132,7 +132,7 @@ static void shortcut_close_top_most_window()
static void shortcut_close_all_floating_windows()
{
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR))
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR))
window_close_all();
else if (RCT2_GLOBAL(0x0141F570, uint8) == 1)
window_close_top();
@@ -153,7 +153,7 @@ static void shortcut_pause_game()
{
rct_window *window;
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & (SCREEN_FLAGS_SCENARIO_EDITOR | SCREEN_FLAGS_TRACK_MANAGER))) {
if (!(gScreenFlags & (SCREEN_FLAGS_SCENARIO_EDITOR | SCREEN_FLAGS_TRACK_MANAGER))) {
window = window_find_by_class(WC_TOP_TOOLBAR);
if (window != NULL) {
window_invalidate(window);
@@ -166,8 +166,8 @@ static void shortcut_zoom_view_out()
{
rct_window *window;
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) || RCT2_GLOBAL(0x0141F570, uint8) == 1) {
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_TRACK_MANAGER)) {
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || RCT2_GLOBAL(0x0141F570, uint8) == 1) {
if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) {
window = window_find_by_class(WC_TOP_TOOLBAR);
if (window != NULL) {
window_invalidate(window);
@@ -181,8 +181,8 @@ static void shortcut_zoom_view_in()
{
rct_window *window;
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) || RCT2_GLOBAL(0x0141F570, uint8) == 1) {
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_TRACK_MANAGER)) {
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || RCT2_GLOBAL(0x0141F570, uint8) == 1) {
if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) {
window = window_find_by_class(WC_TOP_TOOLBAR);
if (window != NULL) {
window_invalidate(window);
@@ -264,7 +264,7 @@ static void shortcut_remove_vertical_land_toggle()
static void shortcut_remove_top_bottom_toolbar_toggle()
{
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_TITLE_DEMO)
if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)
return;
if (window_find_by_class(WC_TOP_TOOLBAR) != NULL) {
@@ -272,7 +272,7 @@ static void shortcut_remove_top_bottom_toolbar_toggle()
window_close(window_find_by_class(WC_TOP_TOOLBAR));
window_close(window_find_by_class(WC_BOTTOM_TOOLBAR));
} else {
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) == 0) {
if (gScreenFlags == 0) {
window_top_toolbar_open();
window_game_bottom_toolbar_open();
} else {
@@ -321,8 +321,8 @@ static void shortcut_adjust_land()
{
rct_window *window;
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) || RCT2_GLOBAL(0x0141F570, uint8) == 1) {
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) {
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || RCT2_GLOBAL(0x0141F570, uint8) == 1) {
if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) {
window = window_find_by_class(WC_TOP_TOOLBAR);
if (window != NULL) {
window_invalidate(window);
@@ -336,8 +336,8 @@ static void shortcut_adjust_water()
{
rct_window *window;
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) || RCT2_GLOBAL(0x0141F570, uint8) == 1) {
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) {
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || RCT2_GLOBAL(0x0141F570, uint8) == 1) {
if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) {
window = window_find_by_class(WC_TOP_TOOLBAR);
if (window != NULL) {
window_invalidate(window);
@@ -351,8 +351,8 @@ static void shortcut_build_scenery()
{
rct_window *window;
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) || RCT2_GLOBAL(0x0141F570, uint8) == 1) {
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) {
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || RCT2_GLOBAL(0x0141F570, uint8) == 1) {
if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) {
window = window_find_by_class(WC_TOP_TOOLBAR);
if (window != NULL) {
window_invalidate(window);
@@ -366,8 +366,8 @@ static void shortcut_build_paths()
{
rct_window *window;
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) || RCT2_GLOBAL(0x0141F570, uint8) == 1) {
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) {
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || RCT2_GLOBAL(0x0141F570, uint8) == 1) {
if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) {
window = window_find_by_class(WC_TOP_TOOLBAR);
if (window != NULL) {
window_invalidate(window);
@@ -381,8 +381,8 @@ static void shortcut_build_new_ride()
{
rct_window *window;
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR)) {
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) {
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR)) {
if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) {
window = window_find_by_class(WC_TOP_TOOLBAR);
if (window != NULL) {
window_invalidate(window);
@@ -394,14 +394,14 @@ static void shortcut_build_new_ride()
static void shortcut_show_financial_information()
{
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)))
if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)))
if (!(gParkFlags & PARK_FLAGS_NO_MONEY))
window_finances_open();
}
static void shortcut_show_research_information()
{
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & (SCREEN_FLAGS_SCENARIO_EDITOR | SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) {
if (!(gScreenFlags & (SCREEN_FLAGS_SCENARIO_EDITOR | SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) {
if (gConfigInterface.toolbar_show_research)
window_research_open();
else
@@ -413,7 +413,7 @@ static void shortcut_show_rides_list()
{
rct_window *window;
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & (SCREEN_FLAGS_SCENARIO_EDITOR | SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) {
if (!(gScreenFlags & (SCREEN_FLAGS_SCENARIO_EDITOR | SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) {
window = window_find_by_class(WC_TOP_TOOLBAR);
if (window != NULL) {
window_invalidate(window);
@@ -426,7 +426,7 @@ static void shortcut_show_park_information()
{
rct_window *window;
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & (SCREEN_FLAGS_SCENARIO_EDITOR | SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) {
if (!(gScreenFlags & (SCREEN_FLAGS_SCENARIO_EDITOR | SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) {
window = window_find_by_class(WC_TOP_TOOLBAR);
if (window != NULL) {
window_invalidate(window);
@@ -439,7 +439,7 @@ static void shortcut_show_guest_list()
{
rct_window *window;
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & (SCREEN_FLAGS_SCENARIO_EDITOR | SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) {
if (!(gScreenFlags & (SCREEN_FLAGS_SCENARIO_EDITOR | SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) {
window = window_find_by_class(WC_TOP_TOOLBAR);
if (window != NULL) {
window_invalidate(window);
@@ -452,7 +452,7 @@ static void shortcut_show_staff_list()
{
rct_window *window;
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & (SCREEN_FLAGS_SCENARIO_EDITOR | SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) {
if (!(gScreenFlags & (SCREEN_FLAGS_SCENARIO_EDITOR | SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) {
window = window_find_by_class(WC_TOP_TOOLBAR);
if (window != NULL) {
window_invalidate(window);
@@ -463,14 +463,14 @@ static void shortcut_show_staff_list()
static void shortcut_show_recent_messages()
{
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & (SCREEN_FLAGS_SCENARIO_EDITOR | SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)))
if (!(gScreenFlags & (SCREEN_FLAGS_SCENARIO_EDITOR | SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)))
window_news_open();
}
static void shortcut_show_map()
{
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) || RCT2_GLOBAL(0x0141F570, uint8) == 1)
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)))
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || RCT2_GLOBAL(0x0141F570, uint8) == 1)
if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)))
window_map_open();
}
@@ -495,7 +495,7 @@ static void shortcut_open_cheat_window()
{
rct_window *window;
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) != SCREEN_FLAGS_PLAYING)
if (gScreenFlags != SCREEN_FLAGS_PLAYING)
return;
// Check if window is already open
@@ -515,11 +515,11 @@ static void shortcut_open_chat_window()
static void shortcut_quick_save_game()
{
// Do a quick save in playing mode and a regular save in Scenario Editor mode. In other cases, don't do anything.
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) == SCREEN_FLAGS_PLAYING) {
if (gScreenFlags == SCREEN_FLAGS_PLAYING) {
tool_cancel();
save_game();
}
else if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) {
else if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) {
rct_s6_info *s6Info = (rct_s6_info*)0x0141F570;
window_loadsave_open(LOADSAVETYPE_SAVE | LOADSAVETYPE_LANDSCAPE, s6Info->name);
}

View File

@@ -307,7 +307,7 @@ int cmdline_for_screenshot(const char **argv, int argc)
rct2_open_file(inputPath);
RCT2_GLOBAL(RCT2_ADDRESS_RUN_INTRO_TICK_PART, uint8) = 0;
RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) = SCREEN_FLAGS_PLAYING;
gScreenFlags = SCREEN_FLAGS_PLAYING;
int mapSize = RCT2_GLOBAL(RCT2_ADDRESS_MAP_SIZE, uint16);
if (resolutionWidth == 0 || resolutionHeight == 0) {

View File

@@ -53,11 +53,11 @@ int viewport_interaction_get_item_left(int x, int y, viewport_interaction_info *
rct_vehicle *vehicle;
// No click input for title screen or scenario editor or track manager
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & (SCREEN_FLAGS_TITLE_DEMO | SCREEN_FLAGS_SCENARIO_EDITOR | SCREEN_FLAGS_TRACK_MANAGER))
if (gScreenFlags & (SCREEN_FLAGS_TITLE_DEMO | SCREEN_FLAGS_SCENARIO_EDITOR | SCREEN_FLAGS_TRACK_MANAGER))
return info->type = VIEWPORT_INTERACTION_ITEM_NONE;
//
if ((RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_TRACK_DESIGNER) && s6Info->editor_step != EDITOR_STEP_ROLLERCOASTER_DESIGNER)
if ((gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) && s6Info->editor_step != EDITOR_STEP_ROLLERCOASTER_DESIGNER)
return info->type = VIEWPORT_INTERACTION_ITEM_NONE;
rct_xy16 mapCoord = { 0 };
@@ -176,11 +176,11 @@ int viewport_interaction_get_item_right(int x, int y, viewport_interaction_info
int i, stationIndex;
// No click input for title screen or track manager
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & (SCREEN_FLAGS_TITLE_DEMO | SCREEN_FLAGS_TRACK_MANAGER))
if (gScreenFlags & (SCREEN_FLAGS_TITLE_DEMO | SCREEN_FLAGS_TRACK_MANAGER))
return info->type = VIEWPORT_INTERACTION_ITEM_NONE;
//
if ((RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_TRACK_DESIGNER) && s6Info->editor_step != EDITOR_STEP_ROLLERCOASTER_DESIGNER)
if ((gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) && s6Info->editor_step != EDITOR_STEP_ROLLERCOASTER_DESIGNER)
return info->type = VIEWPORT_INTERACTION_ITEM_NONE;
rct_xy16 mapCoord = { 0 };
@@ -192,7 +192,7 @@ int viewport_interaction_get_item_right(int x, int y, viewport_interaction_info
switch (info->type) {
case VIEWPORT_INTERACTION_ITEM_SPRITE:
if ((RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) || mapElement->type != 0)
if ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || mapElement->type != 0)
return info->type = VIEWPORT_INTERACTION_ITEM_NONE;
mapElement += 6;
@@ -205,7 +205,7 @@ int viewport_interaction_get_item_right(int x, int y, viewport_interaction_info
return info->type;
case VIEWPORT_INTERACTION_ITEM_RIDE:
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR)
if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR)
return info->type = VIEWPORT_INTERACTION_ITEM_NONE;
if (map_element_get_type(mapElement) == MAP_ELEMENT_TYPE_PATH)
return info->type = VIEWPORT_INTERACTION_ITEM_NONE;
@@ -304,7 +304,7 @@ int viewport_interaction_get_item_right(int x, int y, viewport_interaction_info
return info->type;
case VIEWPORT_INTERACTION_ITEM_PARK:
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode)
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode)
break;
if (map_element_get_type(mapElement) != MAP_ELEMENT_TYPE_ENTRANCE)

View File

@@ -263,7 +263,7 @@ static int window_wheel_input(rct_window *w, int wheel)
*/
static void window_viewport_wheel_input(rct_window *w, int wheel)
{
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 9)
if (gScreenFlags & 9)
return;
if (wheel < 0)
@@ -798,7 +798,7 @@ void window_close_top()
window_close_by_class(WC_DROPDOWN);
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 2)
if (gScreenFlags & 2)
if (RCT2_GLOBAL(0x0141F570, uint8) != 1)
return;
@@ -1343,7 +1343,7 @@ void window_scroll_to_location(rct_window *w, int x, int y, int z)
rct_xy16 map_coordinate = coordinate_3d_to_2d(&location_3d, get_current_rotation());
int i = 0;
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_TITLE_DEMO)) {
if (!(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)) {
int found = 0;
while (!found) {
sint16 x2 = w->viewport->x + (sint16)(w->viewport->width * window_scroll_locations[i][0]);
@@ -2075,7 +2075,7 @@ void window_relocate_windows(int width, int height){
*/
void window_resize_gui(int width, int height)
{
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 0xE){
if (gScreenFlags & 0xE){
window_resize_gui_scenario_editor(width, height);
return;
}