2014-11-15 19:22:06 +01:00
|
|
|
/*****************************************************************************
|
2018-06-15 14:07:34 +02:00
|
|
|
* Copyright (c) 2014-2018 OpenRCT2 developers
|
2014-11-15 19:22:06 +01:00
|
|
|
*
|
2018-06-15 14:07:34 +02:00
|
|
|
* For a complete list of all authors, please refer to contributors.md
|
|
|
|
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
2014-11-15 19:22:06 +01:00
|
|
|
*
|
2018-06-15 14:07:34 +02:00
|
|
|
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
2014-11-15 19:22:06 +01:00
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef _WORLD_FOOTPATH_H_
|
|
|
|
#define _WORLD_FOOTPATH_H_
|
|
|
|
|
|
|
|
#include "../common.h"
|
2018-01-06 00:45:53 +01:00
|
|
|
#include "../interface/Viewport.h"
|
2018-01-02 20:36:42 +01:00
|
|
|
#include "../object/Object.h"
|
2014-11-15 19:22:06 +01:00
|
|
|
|
2018-01-03 10:57:37 +01:00
|
|
|
enum
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
PROVISIONAL_PATH_FLAG_SHOW_ARROW = (1 << 0),
|
2018-01-03 10:57:37 +01:00
|
|
|
PROVISIONAL_PATH_FLAG_1 = (1 << 1),
|
|
|
|
PROVISIONAL_PATH_FLAG_2 = (1 << 2),
|
2014-12-17 21:45:27 +01:00
|
|
|
};
|
|
|
|
|
2018-03-08 14:14:44 +01:00
|
|
|
#define FOOTPATH_ELEMENT_INSERT_QUEUE 0x80
|
|
|
|
|
2016-06-02 23:22:08 +02:00
|
|
|
#pragma pack(push, 1)
|
2018-02-14 09:42:26 +01:00
|
|
|
struct rct_footpath_entry {
|
2017-06-06 23:24:18 +02:00
|
|
|
rct_string_id string_idx; // 0x00
|
2018-06-20 17:28:51 +02:00
|
|
|
uint32_t image; // 0x02
|
|
|
|
uint32_t bridge_image; // 0x06
|
|
|
|
uint8_t support_type; // 0x0A
|
|
|
|
uint8_t flags; // 0x0B
|
|
|
|
uint8_t scrolling_mode; // 0x0C
|
2018-02-14 09:42:26 +01:00
|
|
|
};
|
2016-06-09 21:10:50 +02:00
|
|
|
assert_struct_size(rct_footpath_entry, 13);
|
2016-06-02 23:22:08 +02:00
|
|
|
#pragma pack(pop)
|
2014-11-15 19:22:06 +01:00
|
|
|
|
2018-01-03 10:57:37 +01:00
|
|
|
// Masks for values stored in rct_tile_element.type
|
2017-12-08 16:47:54 +01:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
FOOTPATH_ELEMENT_TYPE_FLAG_IS_QUEUE = (1 << 0),
|
|
|
|
FOOTPATH_ELEMENT_TYPE_FLAG_IS_WIDE = (1 << 1),
|
|
|
|
FOOTPATH_ELEMENT_TYPE_DIRECTION_MASK = (1 << 6) | (1 << 7),
|
|
|
|
};
|
|
|
|
|
2018-01-03 10:57:37 +01:00
|
|
|
// Masks and flags for values stored in rct_tile_element.properties.path.type
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK = (1 << 0) | (1 << 1),
|
|
|
|
FOOTPATH_PROPERTIES_FLAG_IS_SLOPED = (1 << 2),
|
|
|
|
FOOTPATH_PROPERTIES_FLAG_HAS_QUEUE_BANNER = (1 << 3),
|
|
|
|
FOOTPATH_PROPERTIES_TYPE_MASK = (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7),
|
|
|
|
};
|
|
|
|
|
|
|
|
// Masks and flags for values stored in in rct_tile_element.properties.path.edges
|
2017-12-08 16:47:54 +01:00
|
|
|
enum
|
|
|
|
{
|
2018-01-03 10:57:37 +01:00
|
|
|
FOOTPATH_PROPERTIES_EDGES_EDGES_MASK = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3),
|
|
|
|
FOOTPATH_PROPERTIES_EDGES_CORNERS_MASK = (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7),
|
|
|
|
};
|
2017-12-08 16:47:54 +01:00
|
|
|
|
2018-01-03 10:57:37 +01:00
|
|
|
// Masks and flags for values stored in in rct_tile_element.properties.path.additions
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
FOOTPATH_PROPERTIES_ADDITIONS_TYPE_MASK = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3),
|
|
|
|
// The most significant bit in this mask will always be zero, since rides can only have 4 stations
|
|
|
|
FOOTPATH_PROPERTIES_ADDITIONS_STATION_INDEX_MASK = (1 << 4) | (1 << 5) | (1 << 6),
|
|
|
|
FOOTPATH_PROPERTIES_ADDITIONS_FLAG_GHOST = (1 << 7),
|
2017-12-08 16:47:54 +01:00
|
|
|
};
|
|
|
|
|
2018-01-03 10:57:37 +01:00
|
|
|
enum
|
|
|
|
{
|
2017-12-10 13:58:38 +01:00
|
|
|
FOOTPATH_ENTRY_SUPPORT_TYPE_BOX = 0,
|
|
|
|
FOOTPATH_ENTRY_SUPPORT_TYPE_POLE = 1,
|
2017-06-06 23:24:18 +02:00
|
|
|
FOOTPATH_ENTRY_SUPPORT_TYPE_COUNT
|
2017-01-29 11:15:29 +01:00
|
|
|
};
|
|
|
|
|
2018-01-03 10:57:37 +01:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
FOOTPATH_ENTRY_FLAG_HAS_SUPPORT_BASE_SPRITE = (1 << 0),
|
|
|
|
FOOTPATH_ENTRY_FLAG_HAS_PATH_BASE_SPRITE = (1 << 1), // When elevated
|
2017-06-06 23:24:18 +02:00
|
|
|
FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR = (1 << 2),
|
2016-07-31 13:02:38 +02:00
|
|
|
};
|
|
|
|
|
2018-01-03 10:57:37 +01:00
|
|
|
enum
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
FOOTPATH_SEARCH_SUCCESS,
|
|
|
|
FOOTPATH_SEARCH_NOT_FOUND,
|
|
|
|
FOOTPATH_SEARCH_INCOMPLETE,
|
|
|
|
FOOTPATH_SEARCH_TOO_COMPLEX
|
2015-07-06 15:40:37 +02:00
|
|
|
};
|
|
|
|
|
2017-12-08 16:47:54 +01:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
FOOTPATH_ADDITION_FLAG_IS_GHOST = (1 << 7),
|
|
|
|
};
|
|
|
|
|
2017-08-05 18:59:11 +02:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
FOOTPATH_CLEAR_DIRECTIONAL = (1 << 8), // Flag set when direction is used.
|
|
|
|
};
|
|
|
|
|
2018-01-03 10:57:37 +01:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
SLOPE_IS_IRREGULAR_FLAG = (1 << 3), // Flag set in `defaultPathSlope[]` and checked in `footpath_place_real`
|
|
|
|
};
|
|
|
|
|
2018-06-20 17:28:51 +02:00
|
|
|
extern uint8_t gFootpathProvisionalFlags;
|
2017-10-13 22:23:07 +02:00
|
|
|
extern LocationXYZ16 gFootpathProvisionalPosition;
|
2018-06-20 17:28:51 +02:00
|
|
|
extern uint8_t gFootpathProvisionalType;
|
|
|
|
extern uint8_t gFootpathProvisionalSlope;
|
|
|
|
extern uint8_t gFootpathConstructionMode;
|
|
|
|
extern uint16_t gFootpathSelectedId;
|
|
|
|
extern uint8_t gFootpathSelectedType;
|
2017-10-13 22:23:07 +02:00
|
|
|
extern LocationXYZ16 gFootpathConstructFromPosition;
|
2018-06-20 17:28:51 +02:00
|
|
|
extern uint8_t gFootpathConstructDirection;
|
|
|
|
extern uint8_t gFootpathConstructSlope;
|
|
|
|
extern uint8_t gFootpathConstructValidDirections;
|
2016-05-16 20:05:37 +02:00
|
|
|
extern money32 gFootpathPrice;
|
2018-06-20 17:28:51 +02:00
|
|
|
extern uint8_t gFootpathGroundFlags;
|
2016-04-15 20:16:48 +02:00
|
|
|
|
2017-10-13 22:23:07 +02:00
|
|
|
extern const LocationXY16 word_981D6C[4];
|
2018-04-02 19:00:36 +02:00
|
|
|
extern const LocationXY16 BinUseOffsets[4];
|
2018-04-04 21:22:23 +02:00
|
|
|
extern const LocationXY16 BenchUseOffsets[8];
|
2015-07-01 16:17:25 +02:00
|
|
|
|
2018-06-20 17:28:51 +02:00
|
|
|
rct_tile_element *map_get_footpath_element(int32_t x, int32_t y, int32_t z);
|
|
|
|
money32 footpath_remove_real(int32_t x, int32_t y, int32_t z, int32_t flags);
|
|
|
|
void game_command_place_footpath(int32_t * eax, int32_t * ebx, int32_t * ecx, int32_t * edx, int32_t * esi, int32_t * edi, int32_t * ebp);
|
|
|
|
void game_command_place_footpath_from_track(int32_t * eax, int32_t * ebx, int32_t * ecx, int32_t * edx, int32_t * esi, int32_t * edi, int32_t * ebp);
|
|
|
|
void game_command_remove_footpath(int32_t * eax, int32_t * ebx, int32_t * ecx, int32_t * edx, int32_t * esi, int32_t * edi, int32_t * ebp);
|
|
|
|
money32 footpath_place(int32_t type, int32_t x, int32_t y, int32_t z, int32_t slope, int32_t flags);
|
|
|
|
money32 footpath_place_remove_intersecting(int32_t type, int32_t x, int32_t y, int32_t z, int32_t slope, int32_t flags, int32_t direction);
|
|
|
|
void footpath_remove(int32_t x, int32_t y, int32_t z, int32_t flags);
|
|
|
|
money32 footpath_provisional_set(int32_t type, int32_t x, int32_t y, int32_t z, int32_t slope);
|
2014-12-16 23:03:56 +01:00
|
|
|
void footpath_provisional_remove();
|
2015-03-22 22:18:36 +01:00
|
|
|
void footpath_provisional_update();
|
2018-06-20 17:28:51 +02:00
|
|
|
void footpath_get_coordinates_from_pos(int32_t screenX, int32_t screenY, int32_t * x, int32_t * y, int32_t * direction, rct_tile_element ** tileElement);
|
|
|
|
void footpath_bridge_get_info_from_pos(int32_t screenX, int32_t screenY, int32_t * x, int32_t * y, int32_t * direction, rct_tile_element ** tileElement);
|
|
|
|
void footpath_remove_litter(int32_t x, int32_t y, int32_t z);
|
|
|
|
void footpath_connect_edges(int32_t x, int32_t y, rct_tile_element * tileElement, int32_t flags);
|
2017-06-02 01:29:50 +02:00
|
|
|
void footpath_update_queue_chains();
|
2018-06-20 17:28:51 +02:00
|
|
|
bool fence_in_the_way(int32_t x, int32_t y, int32_t z0, int32_t z1, int32_t direction);
|
|
|
|
void footpath_chain_ride_queue(int32_t rideIndex, int32_t entranceIndex, int32_t x, int32_t y, rct_tile_element * tileElement, int32_t direction);
|
|
|
|
void footpath_update_path_wide_flags(int32_t x, int32_t y);
|
2018-06-07 19:42:56 +02:00
|
|
|
bool footpath_is_blocked_by_vehicle(const TileCoordsXYZ& position);
|
2014-11-15 19:22:06 +01:00
|
|
|
|
2018-06-20 17:28:51 +02:00
|
|
|
int32_t footpath_is_connected_to_map_edge(int32_t x, int32_t y, int32_t z, int32_t direction, int32_t flags);
|
2017-12-08 16:47:54 +01:00
|
|
|
bool footpath_element_is_sloped(const rct_tile_element * tileElement);
|
2017-12-13 12:06:51 +01:00
|
|
|
void footpath_element_set_sloped(rct_tile_element * tileElement, bool isSloped);
|
2018-06-20 17:28:51 +02:00
|
|
|
uint8_t footpath_element_get_slope_direction(const rct_tile_element * tileElement);
|
2017-12-08 16:47:54 +01:00
|
|
|
bool footpath_element_is_queue(const rct_tile_element * tileElement);
|
2018-03-08 14:14:44 +01:00
|
|
|
void footpath_element_set_queue(rct_tile_element * tileElement);
|
|
|
|
void footpath_element_clear_queue(rct_tile_element * tileElement);
|
2018-01-03 10:57:37 +01:00
|
|
|
bool footpath_element_has_queue_banner(const rct_tile_element * tileElement);
|
2017-12-08 16:47:54 +01:00
|
|
|
bool footpath_element_is_wide(const rct_tile_element * tileElement);
|
2018-06-20 17:28:51 +02:00
|
|
|
uint8_t footpath_element_get_type(const rct_tile_element * tileElement);
|
|
|
|
void footpath_element_set_type(rct_tile_element * tileElement, uint8_t type);
|
|
|
|
uint8_t footpath_element_get_direction(const rct_tile_element * tileElement);
|
|
|
|
void footpath_element_set_direction(rct_tile_element * tileElement, uint8_t direction);
|
2017-12-13 12:06:51 +01:00
|
|
|
void footpath_element_set_wide(rct_tile_element * tileElement, bool isWide);
|
2017-12-08 16:47:54 +01:00
|
|
|
bool footpath_element_has_path_scenery(const rct_tile_element * tileElement);
|
2018-06-20 17:28:51 +02:00
|
|
|
uint8_t footpath_element_get_path_scenery(const rct_tile_element * tileElement);
|
|
|
|
void footpath_element_set_path_scenery(rct_tile_element * tileElement, uint8_t pathSceneryType);
|
|
|
|
uint8_t footpath_element_get_path_scenery_index(const rct_tile_element * tileElement);
|
2017-12-08 16:47:54 +01:00
|
|
|
bool footpath_element_path_scenery_is_ghost(const rct_tile_element * tileElement);
|
|
|
|
void footpath_scenery_set_is_ghost(rct_tile_element * tileElement, bool isGhost);
|
2018-06-20 17:28:51 +02:00
|
|
|
void footpath_remove_edges_at(int32_t x, int32_t y, rct_tile_element * tileElement);
|
|
|
|
int32_t entrance_get_directions(const rct_tile_element * tileElement);
|
2017-12-08 16:47:54 +01:00
|
|
|
|
2018-06-20 17:28:51 +02:00
|
|
|
rct_footpath_entry * get_footpath_entry(int32_t entryIndex);
|
2016-05-15 17:07:19 +02:00
|
|
|
|
2016-05-17 22:29:05 +02:00
|
|
|
void footpath_queue_chain_reset();
|
2018-06-20 17:28:51 +02:00
|
|
|
void footpath_queue_chain_push(uint8_t rideIndex);
|
2016-05-17 22:29:05 +02:00
|
|
|
|
2018-06-20 17:28:51 +02:00
|
|
|
uint8_t footpath_get_edges(const rct_tile_element * element);
|
2018-02-06 10:05:48 +01:00
|
|
|
|
2014-11-15 19:22:06 +01:00
|
|
|
#endif
|