mirror of
https://github.com/OpenRCT2/OpenRCT2.git
synced 2025-01-22 10:21:57 -05:00
See-through paths, Convert gCurrentViewportFlags to uint32
This commit is contained in:
parent
92e875e007
commit
791733a571
12 changed files with 90 additions and 44 deletions
|
@ -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 #
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -80,6 +80,7 @@ enum {
|
|||
SHORTCUT_SHOW_MULTIPLAYER,
|
||||
SHORTCUT_PAINT_ORIGINAL_TOGGLE,
|
||||
SHORTCUT_DEBUG_PAINT_TOGGLE,
|
||||
SHORTCUT_SEE_THROUGH_PATHS_TOGGLE,
|
||||
|
||||
SHORTCUT_COUNT
|
||||
};
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue