2016-05-04 19:24:41 +02:00
|
|
|
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
|
|
|
|
/*****************************************************************************
|
|
|
|
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
|
|
|
*
|
|
|
|
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
|
|
|
|
* For more information, visit https://github.com/OpenRCT2/OpenRCT2
|
|
|
|
*
|
|
|
|
* OpenRCT2 is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* A full copy of the GNU General Public License can be found in licence.txt
|
|
|
|
*****************************************************************************/
|
|
|
|
#pragma endregion
|
|
|
|
|
2015-10-18 20:03:51 +02:00
|
|
|
#ifndef _TRACK_PAINT_H
|
|
|
|
#define _TRACK_PAINT_H
|
|
|
|
|
|
|
|
#include "../common.h"
|
2016-05-17 19:10:25 +02:00
|
|
|
#include "../world/map.h"
|
|
|
|
#include "../paint/map_element/map_element.h"
|
|
|
|
|
2016-05-17 20:29:45 +02:00
|
|
|
static const uint8 track_map_2x2[][4] = {
|
|
|
|
{0, 1, 2, 3},
|
|
|
|
{1, 3, 0, 2},
|
|
|
|
{3, 2, 1, 0},
|
|
|
|
{2, 0, 3, 1}
|
|
|
|
};
|
|
|
|
|
|
|
|
static const uint8 edges_2x2[] = {
|
|
|
|
EDGE_NE | EDGE_NW,
|
|
|
|
EDGE_NE | EDGE_SE,
|
|
|
|
EDGE_SW | EDGE_NW,
|
|
|
|
EDGE_SW | EDGE_SE,
|
|
|
|
};
|
|
|
|
|
2016-05-17 19:48:28 +02:00
|
|
|
static const uint8 track_map_3x3[][9] = {
|
|
|
|
{0, 1, 2, 3, 4, 5, 6, 7, 8},
|
|
|
|
{0, 3, 5, 7, 2, 8, 1, 6, 4},
|
|
|
|
{0, 7, 8, 6, 5, 4, 3, 1, 2},
|
|
|
|
{0, 6, 4, 1, 8, 2, 7, 3, 5}
|
|
|
|
};
|
|
|
|
|
|
|
|
static const uint8 edges_3x3[] = {
|
|
|
|
0,
|
|
|
|
EDGE_NE | EDGE_NW,
|
|
|
|
EDGE_NE,
|
|
|
|
EDGE_NE | EDGE_SE,
|
|
|
|
EDGE_NW,
|
|
|
|
EDGE_SE,
|
|
|
|
EDGE_SW | EDGE_NW,
|
|
|
|
EDGE_SW | EDGE_SE,
|
|
|
|
EDGE_SW,
|
|
|
|
};
|
|
|
|
|
2016-05-17 20:50:29 +02:00
|
|
|
static const uint16 track_map_4x4[][16] = {
|
|
|
|
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15},
|
|
|
|
{3, 7, 11, 15, 2, 6, 10, 14, 1, 5, 9, 13, 0, 4, 8, 12},
|
|
|
|
{15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0},
|
|
|
|
{12, 8, 4, 0, 13, 9, 5, 1, 14, 10, 6, 2, 15, 11, 7, 3},
|
|
|
|
};
|
|
|
|
|
|
|
|
static const uint8 edges_4x4[] = {
|
|
|
|
EDGE_NE | EDGE_NW,
|
|
|
|
EDGE_NE,
|
|
|
|
EDGE_NE,
|
|
|
|
EDGE_NE | EDGE_SE,
|
|
|
|
EDGE_NW,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
EDGE_SE,
|
|
|
|
EDGE_NW,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
EDGE_SE,
|
|
|
|
EDGE_NW | EDGE_SW,
|
|
|
|
EDGE_SW,
|
|
|
|
EDGE_SW,
|
|
|
|
EDGE_SW | EDGE_SE
|
|
|
|
};
|
|
|
|
|
2016-05-17 19:48:28 +02:00
|
|
|
enum {
|
|
|
|
SPR_FLOOR_CORK_SE_SW = 22134,
|
|
|
|
SPR_FLOOR_CORK_SW = 22135,
|
|
|
|
SPR_FLOOR_CORK_SE = 22136,
|
|
|
|
SPR_FLOOR_CORK = 22137,
|
|
|
|
SPR_FENCE_ROPE_NE = 22138,
|
|
|
|
SPR_FENCE_ROPE_SE = 22139,
|
|
|
|
SPR_FENCE_ROPE_SW = 22140,
|
|
|
|
SPR_FENCE_ROPE_NW = 22141,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const uint floorSpritesCork[] = {
|
|
|
|
SPR_FLOOR_CORK_SE_SW,
|
|
|
|
SPR_FLOOR_CORK_SW,
|
|
|
|
SPR_FLOOR_CORK_SE,
|
|
|
|
SPR_FLOOR_CORK
|
|
|
|
};
|
|
|
|
|
|
|
|
static const uint fenceSpritesRope[] = {
|
|
|
|
SPR_FENCE_ROPE_NE,
|
|
|
|
SPR_FENCE_ROPE_SE,
|
|
|
|
SPR_FENCE_ROPE_SW,
|
|
|
|
SPR_FENCE_ROPE_NW
|
|
|
|
};
|
|
|
|
|
2016-05-17 19:10:25 +02:00
|
|
|
bool track_paint_util_has_fence(enum edge edge, rct_xy16 position, rct_map_element * mapElement, rct_ride * ride, uint8 rotation);
|
2016-05-17 19:48:28 +02:00
|
|
|
void track_paint_util_paint_floor(uint edges, uint32 colourFlags, uint16 height, const uint floorSprites[4], uint8 rotation);
|
|
|
|
void track_paint_util_paint_fences(uint edges, rct_xy16 position, rct_map_element * mapElement, rct_ride * ride, uint32 colourFlags, uint16 height, const uint fenceSprites[4], uint8 rotation);
|
2015-10-18 20:03:51 +02:00
|
|
|
|
2015-10-28 20:57:02 +01:00
|
|
|
typedef void (*TRACK_PAINT_FUNCTION)(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement);
|
2015-12-19 13:39:07 +01:00
|
|
|
typedef TRACK_PAINT_FUNCTION (*TRACK_PAINT_FUNCTION_GETTER)(int trackType, int direction);
|
2015-10-18 20:03:51 +02:00
|
|
|
|
2016-03-25 14:54:28 +01:00
|
|
|
TRACK_PAINT_FUNCTION get_track_paint_function_maze(int trackType, int direction);
|
2016-03-24 21:52:32 +01:00
|
|
|
TRACK_PAINT_FUNCTION get_track_paint_function_spiral_slide(int trackType, int direction);
|
2016-03-25 15:43:03 +01:00
|
|
|
TRACK_PAINT_FUNCTION get_track_paint_function_dodgems(int trackType, int direction);
|
2015-12-19 13:39:07 +01:00
|
|
|
TRACK_PAINT_FUNCTION get_track_paint_function_topspin(int trackType, int direction);
|
|
|
|
TRACK_PAINT_FUNCTION get_track_paint_function_shop(int trackType, int direction);
|
|
|
|
TRACK_PAINT_FUNCTION get_track_paint_function_facility(int trackType, int direction);
|
2016-04-11 15:21:13 +02:00
|
|
|
TRACK_PAINT_FUNCTION get_track_paint_function_crooked_house(int trackType, int direction);
|
2015-10-18 20:03:51 +02:00
|
|
|
|
2015-12-21 05:03:37 +01:00
|
|
|
#endif
|