diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index 558c86d748..b2c58def40 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -4219,6 +4219,8 @@ STR_5907 :{SMALLFONT}{BLACK}When enabled, zooming in will centre around the c STR_5908 :Allow arbitrary ride type changes STR_5909 :{SMALLFONT}{BLACK}Allows changing ride type freely. May cause crashes. STR_5910 :Apply +STR_5911 :See-Through Paths +STR_5912 :See-through paths toggle ############# # Scenarios # diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 0a4e9fff49..ee0398e4f0 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,5 +1,6 @@ 0.0.5 (in development) ------------------------------------------------------------------------ +- Feature: New view option: "See-Through Paths" - Feature: Add cheat to reset date. - Feature: Add OpenGL drawing engine. - Feature: Implementation of the user-defined currency diff --git a/src/config.c b/src/config.c index c85c76d76d..09ab9ff4c8 100644 --- a/src/config.c +++ b/src/config.c @@ -1060,7 +1060,10 @@ static const uint16 _defaultShortcutKeys[SHORTCUT_COUNT] = { SHORTCUT_UNDEFINED, // SHORTCUT_SHOW_OPTIONS SHORTCUT_UNDEFINED, // SHORTCUT_MUTE_SOUND ALT | SDL_SCANCODE_RETURN, // SHORTCUT_WINDOWED_MODE_TOGGLE + SHORTCUT_UNDEFINED, // SHORTCUT_SHOW_MULTIPLAYER SHORTCUT_UNDEFINED, // SHORTCUT_PAINT_ORIGINAL_TOGGLE + SHORTCUT_UNDEFINED, // SHORTCUT_DEBUG_PAINT_TOGGLE + SHORTCUT_UNDEFINED, // SHORTCUT_SEE_THROUGH_PATHS_TOGGLE }; #define SHORTCUT_FILE_VERSION 1 diff --git a/src/config.h b/src/config.h index ffc28ba085..1b8ebf2f22 100644 --- a/src/config.h +++ b/src/config.h @@ -80,6 +80,7 @@ enum { SHORTCUT_SHOW_MULTIPLAYER, SHORTCUT_PAINT_ORIGINAL_TOGGLE, SHORTCUT_DEBUG_PAINT_TOGGLE, + SHORTCUT_SEE_THROUGH_PATHS_TOGGLE, SHORTCUT_COUNT }; diff --git a/src/interface/keyboard_shortcut.c b/src/interface/keyboard_shortcut.c index 641df08845..1a169f5709 100644 --- a/src/interface/keyboard_shortcut.c +++ b/src/interface/keyboard_shortcut.c @@ -291,6 +291,11 @@ static void shortcut_see_through_scenery_toggle() toggle_view_flag(VIEWPORT_FLAG_SEETHROUGH_SCENERY); } +static void shortcut_see_through_paths_toggle() +{ + toggle_view_flag(VIEWPORT_FLAG_SEETHROUGH_PATHS); +} + static void shortcut_invisible_supports_toggle() { toggle_view_flag(VIEWPORT_FLAG_INVISIBLE_SUPPORTS); @@ -613,6 +618,7 @@ static const shortcut_action shortcut_table[SHORTCUT_COUNT] = { shortcut_show_multiplayer, shortcut_orginal_painting_toggle, shortcut_debug_paint_toggle, + shortcut_see_through_paths_toggle, }; #pragma endregion diff --git a/src/interface/viewport.c b/src/interface/viewport.c index f70c25f8b1..4fa7de4f4e 100644 --- a/src/interface/viewport.c +++ b/src/interface/viewport.c @@ -38,7 +38,7 @@ #include "window.h" //#define DEBUG_SHOW_DIRTY_BOX -uint16 gCurrentViewportFlags = 0; +uint32 gCurrentViewportFlags = 0; rct_viewport g_viewport_list[MAX_VIEWPORT_COUNT]; rct_viewport *g_music_tracking_viewport; @@ -679,7 +679,7 @@ void viewport_paint(rct_viewport* viewport, rct_drawpixelinfo* dpi, int left, in //This should still be updated until the rest of supports, etc, is reverse-engineered. Otherwise // Wooden Coaster supports (and a few other coaster supports) will still appear even if "invisible supports" // are enabled. - RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_VIEWPORT_FLAGS, uint16) = viewport->flags; + RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_VIEWPORT_FLAGS, uint16) = (uint16)viewport->flags; RCT2_GLOBAL(RCT2_ADDRESS_VIEWPORT_ZOOM, uint16) = viewport->zoom; uint16 width = right - left; @@ -960,8 +960,8 @@ void viewport_set_visibility(uint8 mode) 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 | + uint32 mask = VIEWPORT_FLAG_UNDERGROUND_INSIDE | VIEWPORT_FLAG_SEETHROUGH_RIDES | + VIEWPORT_FLAG_SEETHROUGH_SCENERY | VIEWPORT_FLAG_SEETHROUGH_PATHS | 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; diff --git a/src/interface/viewport.h b/src/interface/viewport.h index cff8d352fd..11d9997af4 100644 --- a/src/interface/viewport.h +++ b/src/interface/viewport.h @@ -38,23 +38,24 @@ enum { VIEWPORT_FLAG_HIDE_BASE = (1 << 12), VIEWPORT_FLAG_HIDE_VERTICAL = (1 << 13), VIEWPORT_FLAG_INVISIBLE_SPRITES = (1 << 14), - VIEWPORT_FLAG_15 = (1 << 15) + VIEWPORT_FLAG_15 = (1 << 15), + VIEWPORT_FLAG_SEETHROUGH_PATHS = (1 << 16) }; enum { - VIEWPORT_INTERACTION_ITEM_NONE, - VIEWPORT_INTERACTION_ITEM_TERRAIN, - VIEWPORT_INTERACTION_ITEM_SPRITE, - VIEWPORT_INTERACTION_ITEM_RIDE, - VIEWPORT_INTERACTION_ITEM_WATER, - VIEWPORT_INTERACTION_ITEM_SCENERY, - VIEWPORT_INTERACTION_ITEM_FOOTPATH, - VIEWPORT_INTERACTION_ITEM_FOOTPATH_ITEM, - VIEWPORT_INTERACTION_ITEM_PARK, - VIEWPORT_INTERACTION_ITEM_WALL, - VIEWPORT_INTERACTION_ITEM_LARGE_SCENERY, - VIEWPORT_INTERACTION_ITEM_LABEL, - VIEWPORT_INTERACTION_ITEM_BANNER, + VIEWPORT_INTERACTION_ITEM_NONE = 0, + VIEWPORT_INTERACTION_ITEM_TERRAIN = 1, + VIEWPORT_INTERACTION_ITEM_SPRITE = 2, + VIEWPORT_INTERACTION_ITEM_RIDE = 3, + VIEWPORT_INTERACTION_ITEM_WATER = 4, + VIEWPORT_INTERACTION_ITEM_SCENERY = 5, + VIEWPORT_INTERACTION_ITEM_FOOTPATH = 6, + VIEWPORT_INTERACTION_ITEM_FOOTPATH_ITEM = 7, + VIEWPORT_INTERACTION_ITEM_PARK = 8, + VIEWPORT_INTERACTION_ITEM_WALL = 9, + VIEWPORT_INTERACTION_ITEM_LARGE_SCENERY = 10, + VIEWPORT_INTERACTION_ITEM_LABEL = 11, + VIEWPORT_INTERACTION_ITEM_BANNER = 12, }; @@ -92,7 +93,7 @@ typedef struct viewport_interaction_info { #define gSavedViewZoom RCT2_GLOBAL(RCT2_ADDRESS_SAVED_VIEW_ZOOM, uint8) #define gSavedViewRotation RCT2_GLOBAL(RCT2_ADDRESS_SAVED_VIEW_ROTATION, uint8) #define gCurrentRotation RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_ROTATION, uint8) -extern uint16 gCurrentViewportFlags; +extern uint32 gCurrentViewportFlags; // rct2: 0x014234BC extern rct_viewport g_viewport_list[MAX_VIEWPORT_COUNT]; diff --git a/src/interface/window.h b/src/interface/window.h index 7876fa5507..7b27a4f4b6 100644 --- a/src/interface/window.h +++ b/src/interface/window.h @@ -89,7 +89,7 @@ typedef struct rct_viewport { sint16 view_height; // 0x0E uint8 zoom; // 0x10 uint8 var_11; - uint16 flags; // 0x12 + uint32 flags; // 0x12 uint8 visibility; // VISIBILITY_CACHE } rct_viewport; diff --git a/src/localisation/string_ids.h b/src/localisation/string_ids.h index d48ac9d3e0..8f417e5074 100644 --- a/src/localisation/string_ids.h +++ b/src/localisation/string_ids.h @@ -3343,6 +3343,8 @@ enum { STR_CHEAT_ALLOW_ARBITRARY_RIDE_TYPE_CHANGES = 5908, STR_CHEAT_ALLOW_ARBITRARY_RIDE_TYPE_CHANGES_TIP = 5909, STR_APPLY = 5910, + STR_SEE_THROUGH_PATHS = 5911, + STR_SHORTCUT_SEE_THROUGH_PATHS_TOGGLE = 5912, // Have to include resource strings (from scenarios and objects) for the time being now that language is partially working STR_COUNT = 32768 diff --git a/src/paint/paint.c b/src/paint/paint.c index dcf6b47228..2c1bbeda20 100644 --- a/src/paint/paint.c +++ b/src/paint/paint.c @@ -907,7 +907,7 @@ static void paint_attached_ps(paint_struct* ps, attached_paint_struct* attached_ int image_id = attached_ps->image_id; if (gCurrentViewportFlags & VIEWPORT_FLAG_SEETHROUGH_RIDES) { - if (ps->sprite_type == 3) { + if (ps->sprite_type == VIEWPORT_INTERACTION_ITEM_RIDE) { if (image_id & 0x40000000) { image_id &= 0x7FFFF; image_id |= 0x41880000; @@ -916,13 +916,22 @@ static void paint_attached_ps(paint_struct* ps, attached_paint_struct* attached_ } if (gCurrentViewportFlags & VIEWPORT_FLAG_SEETHROUGH_SCENERY) { - if (ps->sprite_type == 5) { + if (ps->sprite_type == VIEWPORT_INTERACTION_ITEM_SCENERY) { if (image_id & 0x40000000) { image_id &= 0x7FFFF; image_id |= 0x41880000; } } } + + if (gCurrentViewportFlags & VIEWPORT_FLAG_SEETHROUGH_PATHS) { + if (ps->sprite_type == VIEWPORT_INTERACTION_ITEM_FOOTPATH) { + if (!(image_id & 0x40000000)) { + image_id &= 0x7FFFF; + image_id |= 0x41880000; + } + } + } if (attached_ps->flags & PAINT_STRUCT_FLAG_IS_MASKED) { gfx_draw_sprite_raw_masked(dpi, x, y, image_id, attached_ps->colour_image_id); @@ -942,7 +951,7 @@ void paint_quadrant_ps() { for (ps = ps->next_quadrant_ps; ps;) { sint16 x = ps->x; sint16 y = ps->y; - if (ps->sprite_type == 2) { + if (ps->sprite_type == VIEWPORT_INTERACTION_ITEM_SPRITE) { if (dpi->zoom_level >= 1) { x &= 0xFFFE; y &= 0xFFFE; @@ -954,7 +963,7 @@ void paint_quadrant_ps() { } int image_id = ps->image_id; if (gCurrentViewportFlags & VIEWPORT_FLAG_SEETHROUGH_RIDES) { - if (ps->sprite_type == 3) { + if (ps->sprite_type == VIEWPORT_INTERACTION_ITEM_RIDE) { if (!(image_id & 0x40000000)) { image_id &= 0x7FFFF; image_id |= 0x41880000; @@ -962,7 +971,17 @@ void paint_quadrant_ps() { } } if (gCurrentViewportFlags & VIEWPORT_FLAG_UNDERGROUND_INSIDE) { - if (ps->sprite_type == 9) { + if (ps->sprite_type == VIEWPORT_INTERACTION_ITEM_WALL) { + if (!(image_id & 0x40000000)) { + image_id &= 0x7FFFF; + image_id |= 0x41880000; + } + } + } + if (gCurrentViewportFlags & VIEWPORT_FLAG_SEETHROUGH_PATHS) { + if (ps->sprite_type == VIEWPORT_INTERACTION_ITEM_FOOTPATH || + ps->sprite_type == VIEWPORT_INTERACTION_ITEM_FOOTPATH_ITEM || + ps->sprite_type == VIEWPORT_INTERACTION_ITEM_BANNER) { if (!(image_id & 0x40000000)) { image_id &= 0x7FFFF; image_id |= 0x41880000; @@ -970,7 +989,9 @@ void paint_quadrant_ps() { } } if (gCurrentViewportFlags & VIEWPORT_FLAG_SEETHROUGH_SCENERY) { - if (ps->sprite_type == 10 || ps->sprite_type == 12 || ps->sprite_type == 9 || ps->sprite_type == 5) { + if (ps->sprite_type == VIEWPORT_INTERACTION_ITEM_LARGE_SCENERY || + ps->sprite_type == VIEWPORT_INTERACTION_ITEM_WALL || + ps->sprite_type == VIEWPORT_INTERACTION_ITEM_SCENERY) { if (!(image_id & 0x40000000)) { image_id &= 0x7FFFF; image_id |= 0x41880000; diff --git a/src/windows/shortcut_keys.c b/src/windows/shortcut_keys.c index 48b5581144..2fa5ce0d10 100644 --- a/src/windows/shortcut_keys.c +++ b/src/windows/shortcut_keys.c @@ -134,6 +134,7 @@ const rct_string_id ShortcutStringIds[] = { STR_SHORTCUT_SHOW_MULTIPLAYER, STR_SHORTCUT_PAINT_ORIGINAL, STR_SHORTCUT_DEBUG_PAINT_TOGGLE, + STR_SHORTCUT_SEE_THROUGH_PATHS_TOGGLE, }; /** diff --git a/src/windows/top_toolbar.c b/src/windows/top_toolbar.c index 53f26ac7b6..f444ff541d 100644 --- a/src/windows/top_toolbar.c +++ b/src/windows/top_toolbar.c @@ -93,11 +93,12 @@ typedef enum { DDIDX_HIDE_VERTICAL = 2, DDIDX_SEETHROUGH_RIDES = 4, DDIDX_SEETHROUGH_SCENARY = 5, - DDIDX_INVISIBLE_SUPPORTS = 6, - DDIDX_INVISIBLE_PEEPS = 7, - DDIDX_LAND_HEIGHTS = 9, - DDIDX_TRACK_HEIGHTS = 10, - DDIDX_PATH_HEIGHTS = 11, + DDIDX_SEETHROUGH_PATHS = 6, + DDIDX_INVISIBLE_SUPPORTS = 7, + DDIDX_INVISIBLE_PEEPS = 8, + DDIDX_LAND_HEIGHTS = 10, + DDIDX_TRACK_HEIGHTS = 11, + DDIDX_PATH_HEIGHTS = 12, } TOP_TOOLBAR_VIEW_MENU_DDIDX; typedef enum { @@ -3036,21 +3037,23 @@ void top_toolbar_init_view_menu(rct_window* w, rct_widget* widget) { gDropdownItemsFormat[5] = STR_TOGGLE_OPTION; gDropdownItemsFormat[6] = STR_TOGGLE_OPTION; gDropdownItemsFormat[7] = STR_TOGGLE_OPTION; - gDropdownItemsFormat[8] = STR_EMPTY; - gDropdownItemsFormat[9] = STR_TOGGLE_OPTION; + gDropdownItemsFormat[8] = STR_TOGGLE_OPTION; + gDropdownItemsFormat[9] = STR_EMPTY; gDropdownItemsFormat[10] = STR_TOGGLE_OPTION; gDropdownItemsFormat[11] = STR_TOGGLE_OPTION; + gDropdownItemsFormat[12] = STR_TOGGLE_OPTION; gDropdownItemsArgs[0] = STR_UNDERGROUND_VIEW; gDropdownItemsArgs[1] = STR_REMOVE_BASE_LAND; gDropdownItemsArgs[2] = STR_REMOVE_VERTICAL_FACES; gDropdownItemsArgs[4] = STR_SEE_THROUGH_RIDES; gDropdownItemsArgs[5] = STR_SEE_THROUGH_SCENERY; - gDropdownItemsArgs[6] = STR_INVISIBLE_SUPPORTS; - gDropdownItemsArgs[7] = STR_INVISIBLE_PEOPLE; - gDropdownItemsArgs[9] = STR_HEIGHT_MARKS_ON_LAND; - gDropdownItemsArgs[10] = STR_HEIGHT_MARKS_ON_RIDE_TRACKS; - gDropdownItemsArgs[11] = STR_HEIGHT_MARKS_ON_PATHS; + gDropdownItemsArgs[6] = STR_SEE_THROUGH_PATHS; + gDropdownItemsArgs[7] = STR_INVISIBLE_SUPPORTS; + gDropdownItemsArgs[8] = STR_INVISIBLE_PEOPLE; + gDropdownItemsArgs[10] = STR_HEIGHT_MARKS_ON_LAND; + gDropdownItemsArgs[11] = STR_HEIGHT_MARKS_ON_RIDE_TRACKS; + gDropdownItemsArgs[12] = STR_HEIGHT_MARKS_ON_PATHS; window_dropdown_show_text( w->x + widget->left, @@ -3058,7 +3061,7 @@ void top_toolbar_init_view_menu(rct_window* w, rct_widget* widget) { widget->bottom - widget->top + 1, w->colours[1] | 0x80, 0, - 12 + 13 ); // Set checkmarks @@ -3073,16 +3076,18 @@ void top_toolbar_init_view_menu(rct_window* w, rct_widget* widget) { dropdown_set_checked(4, true); if (mainViewport->flags & VIEWPORT_FLAG_SEETHROUGH_SCENERY) dropdown_set_checked(5, true); - if (mainViewport->flags & VIEWPORT_FLAG_INVISIBLE_SUPPORTS) + if (mainViewport->flags & VIEWPORT_FLAG_SEETHROUGH_PATHS) dropdown_set_checked(6, true); - if (mainViewport->flags & VIEWPORT_FLAG_INVISIBLE_PEEPS) + if (mainViewport->flags & VIEWPORT_FLAG_INVISIBLE_SUPPORTS) dropdown_set_checked(7, true); + if (mainViewport->flags & VIEWPORT_FLAG_INVISIBLE_PEEPS) + dropdown_set_checked(8, true); if (mainViewport->flags & VIEWPORT_FLAG_LAND_HEIGHTS) - dropdown_set_checked(9, true); - if (mainViewport->flags & VIEWPORT_FLAG_TRACK_HEIGHTS) dropdown_set_checked(10, true); - if (mainViewport->flags & VIEWPORT_FLAG_PATH_HEIGHTS) + if (mainViewport->flags & VIEWPORT_FLAG_TRACK_HEIGHTS) dropdown_set_checked(11, true); + if (mainViewport->flags & VIEWPORT_FLAG_PATH_HEIGHTS) + dropdown_set_checked(12, true); gDropdownDefaultIndex = DDIDX_UNDERGROUND_INSIDE; } @@ -3111,6 +3116,9 @@ void top_toolbar_view_menu_dropdown(short dropdownIndex) case DDIDX_SEETHROUGH_SCENARY: w->viewport->flags ^= VIEWPORT_FLAG_SEETHROUGH_SCENERY; break; + case DDIDX_SEETHROUGH_PATHS: + w->viewport->flags ^= VIEWPORT_FLAG_SEETHROUGH_PATHS; + break; case DDIDX_INVISIBLE_SUPPORTS: w->viewport->flags ^= VIEWPORT_FLAG_INVISIBLE_SUPPORTS; break;