2017-06-01 21:55:10 +02:00
|
|
|
#pragma region Copyright (c) 2014-2017 OpenRCT2 Developers
|
2016-05-01 17:01:40 +02:00
|
|
|
/*****************************************************************************
|
2016-05-05 20:29:49 +02:00
|
|
|
* 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
|
2016-05-01 17:01:40 +02:00
|
|
|
|
2017-02-18 16:45:10 +01:00
|
|
|
#include "../../config/Config.h"
|
2017-11-30 18:17:06 +01:00
|
|
|
#include "../../Game.h"
|
2016-04-30 22:09:53 +02:00
|
|
|
#include "../../interface/viewport.h"
|
2016-09-15 00:51:19 +02:00
|
|
|
#include "../../localisation/localisation.h"
|
2018-01-02 20:36:42 +01:00
|
|
|
#include "../../object/ObjectList.h"
|
2017-10-13 10:06:36 +02:00
|
|
|
#include "../../peep/Staff.h"
|
2017-10-17 13:51:47 +02:00
|
|
|
#include "../../ride/Track.h"
|
2016-09-15 00:51:19 +02:00
|
|
|
#include "../../ride/track_paint.h"
|
2016-04-30 22:09:53 +02:00
|
|
|
#include "../../world/footpath.h"
|
2016-06-06 18:21:54 +02:00
|
|
|
#include "../../world/scenery.h"
|
2017-12-14 10:34:12 +01:00
|
|
|
#include "../Paint.h"
|
|
|
|
#include "../Supports.h"
|
|
|
|
#include "TileElement.h"
|
|
|
|
#include "Surface.h"
|
2018-01-03 14:56:08 +01:00
|
|
|
#include "../../world/Map.h"
|
2018-01-05 22:11:19 +01:00
|
|
|
#include "../../drawing/LightFX.h"
|
2016-05-01 17:01:40 +02:00
|
|
|
|
2016-04-30 22:09:53 +02:00
|
|
|
const uint8 byte_98D800[] = {
|
2017-06-06 23:24:18 +02:00
|
|
|
12, 9, 3, 6
|
2016-04-30 22:09:53 +02:00
|
|
|
};
|
|
|
|
|
2017-10-09 17:13:14 +02:00
|
|
|
static const uint8 byte_98D6E0[] = {
|
2017-06-06 23:24:18 +02:00
|
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
|
|
|
0, 1, 2, 20, 4, 5, 6, 22, 8, 9, 10, 26, 12, 13, 14, 36,
|
|
|
|
0, 1, 2, 3, 4, 5, 21, 23, 8, 9, 10, 11, 12, 13, 33, 37,
|
|
|
|
0, 1, 2, 3, 4, 5, 6, 24, 8, 9, 10, 11, 12, 13, 14, 38,
|
|
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 29, 30, 34, 39,
|
|
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 40,
|
|
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 35, 41,
|
|
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 42,
|
|
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 25, 10, 27, 12, 31, 14, 43,
|
|
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 28, 12, 13, 14, 44,
|
|
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 45,
|
|
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 46,
|
|
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 32, 14, 47,
|
|
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 48,
|
|
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 49,
|
|
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 50
|
2016-04-30 22:09:53 +02:00
|
|
|
};
|
|
|
|
|
2017-10-09 17:13:14 +02:00
|
|
|
static const sint16 stru_98D804[][4] = {
|
2017-06-06 23:24:18 +02:00
|
|
|
{3, 3, 26, 26},
|
|
|
|
{0, 3, 29, 26},
|
|
|
|
{3, 3, 26, 29},
|
|
|
|
{0, 3, 29, 29},
|
|
|
|
{3, 3, 29, 26},
|
|
|
|
{0, 3, 32, 26},
|
|
|
|
{3, 3, 29, 29},
|
|
|
|
{0, 3, 32, 29},
|
|
|
|
{3, 0, 26, 29},
|
|
|
|
{0, 0, 29, 29},
|
|
|
|
{3, 0, 26, 32},
|
|
|
|
{0, 0, 29, 32},
|
|
|
|
{3, 0, 29, 29},
|
|
|
|
{0, 0, 32, 29},
|
|
|
|
{3, 0, 29, 32},
|
|
|
|
{0, 0, 32, 32},
|
2016-04-30 22:09:53 +02:00
|
|
|
};
|
|
|
|
|
2017-10-09 17:13:14 +02:00
|
|
|
static const uint8 byte_98D8A4[] = {
|
2017-06-06 23:24:18 +02:00
|
|
|
0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0
|
2016-04-30 22:09:53 +02:00
|
|
|
};
|
|
|
|
|
2017-12-10 13:58:38 +01:00
|
|
|
void path_paint_box_support(paint_session * session, rct_tile_element * tileElement, sint32 height, rct_footpath_entry * footpathEntry, bool hasFences, uint32 imageFlags, uint32 sceneryImageFlags);
|
|
|
|
void path_paint_pole_support(paint_session * session, rct_tile_element* tileElement, sint16 height, rct_footpath_entry* footpathEntry, bool hasFences, uint32 imageFlags, uint32 sceneryImageFlags);
|
2016-04-30 22:09:53 +02:00
|
|
|
|
2017-12-08 16:47:54 +01:00
|
|
|
|
|
|
|
|
2016-06-08 20:53:55 +02:00
|
|
|
/* rct2: 0x006A5AE5 */
|
2017-10-31 14:03:45 +01:00
|
|
|
static void path_bit_lights_paint(paint_session * session, rct_scenery_entry* pathBitEntry, rct_tile_element* tileElement, sint32 height, uint8 edges, uint32 pathBitImageFlags) {
|
|
|
|
if (footpath_element_is_sloped(tileElement))
|
2017-06-06 23:24:18 +02:00
|
|
|
height += 8;
|
2016-06-08 20:53:55 +02:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
uint32 imageId;
|
2016-06-08 20:53:55 +02:00
|
|
|
|
2018-01-03 10:57:37 +01:00
|
|
|
if (!(edges & EDGE_NE)) {
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId = pathBitEntry->image + 1;
|
2016-06-08 20:53:55 +02:00
|
|
|
|
2017-10-31 14:03:45 +01:00
|
|
|
if (tileElement->flags & TILE_ELEMENT_FLAG_BROKEN)
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId += 4;
|
2016-06-08 20:53:55 +02:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId |= pathBitImageFlags;
|
2016-06-08 20:53:55 +02:00
|
|
|
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, imageId, 2, 16, 1, 1, 23, height, 3, 16, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2018-01-03 10:57:37 +01:00
|
|
|
if (!(edges & EDGE_SE)) {
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId = pathBitEntry->image + 2;
|
2016-06-08 20:53:55 +02:00
|
|
|
|
2017-10-31 14:03:45 +01:00
|
|
|
if (tileElement->flags & TILE_ELEMENT_FLAG_BROKEN)
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId += 4;
|
2016-06-08 20:53:55 +02:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId |= pathBitImageFlags;
|
2016-06-08 20:53:55 +02:00
|
|
|
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, imageId, 16, 30, 1, 0, 23, height, 16, 29, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2016-06-08 20:53:55 +02:00
|
|
|
|
2018-01-03 10:57:37 +01:00
|
|
|
if (!(edges & EDGE_SW)) {
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId = pathBitEntry->image + 3;
|
2016-06-08 20:53:55 +02:00
|
|
|
|
2017-10-31 14:03:45 +01:00
|
|
|
if (tileElement->flags & TILE_ELEMENT_FLAG_BROKEN)
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId += 4;
|
2016-06-08 20:53:55 +02:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId |= pathBitImageFlags;
|
2016-06-08 20:53:55 +02:00
|
|
|
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, imageId, 30, 16, 0, 1, 23, height, 29, 16, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2016-06-08 20:53:55 +02:00
|
|
|
|
2018-01-03 10:57:37 +01:00
|
|
|
if (!(edges & EDGE_NW)) {
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId = pathBitEntry->image + 4;
|
2016-06-08 20:53:55 +02:00
|
|
|
|
2017-10-31 14:03:45 +01:00
|
|
|
if (tileElement->flags & TILE_ELEMENT_FLAG_BROKEN)
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId += 4;
|
2016-06-08 20:53:55 +02:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId |= pathBitImageFlags;
|
2016-06-08 20:53:55 +02:00
|
|
|
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, imageId, 16, 2, 1, 1, 23, height, 16, 3, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2016-06-08 20:53:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* rct2: 0x006A5C94 */
|
2017-10-31 14:03:45 +01:00
|
|
|
static void path_bit_bins_paint(paint_session * session, rct_scenery_entry* pathBitEntry, rct_tile_element* tileElement, sint32 height, uint8 edges, uint32 pathBitImageFlags) {
|
|
|
|
if (footpath_element_is_sloped(tileElement))
|
2017-06-06 23:24:18 +02:00
|
|
|
height += 8;
|
2016-06-08 20:53:55 +02:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
uint32 imageId;
|
2016-06-08 20:53:55 +02:00
|
|
|
|
2018-01-03 10:57:37 +01:00
|
|
|
if (!(edges & EDGE_NE)) {
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId = pathBitEntry->image + 5;
|
2016-06-08 20:53:55 +02:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId |= pathBitImageFlags;
|
2016-06-08 20:53:55 +02:00
|
|
|
|
2017-10-31 14:03:45 +01:00
|
|
|
if (!(tileElement->flags & TILE_ELEMENT_FLAG_BROKEN)) {
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId -= 4;
|
2016-11-13 20:17:49 +01:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
// Edges have been rotated around the rotation to check addition status
|
|
|
|
// this will also need to be rotated.
|
2017-10-31 14:03:45 +01:00
|
|
|
if (!(tileElement->properties.path.addition_status & ror8(0x3,(2 * get_current_rotation()))))
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId += 8;
|
|
|
|
}
|
2016-11-13 20:17:49 +01:00
|
|
|
|
2016-06-08 20:53:55 +02:00
|
|
|
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, imageId, 7, 16, 1, 1, 7, height, 7, 16, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2018-01-03 10:57:37 +01:00
|
|
|
if (!(edges & EDGE_SE)) {
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId = pathBitEntry->image + 6;
|
2016-06-08 20:53:55 +02:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId |= pathBitImageFlags;
|
2016-06-08 20:53:55 +02:00
|
|
|
|
2017-10-31 14:03:45 +01:00
|
|
|
if (!(tileElement->flags & TILE_ELEMENT_FLAG_BROKEN)) {
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId -= 4;
|
2016-06-08 20:53:55 +02:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
// Edges have been rotated around the rotation to check addition status
|
|
|
|
// this will also need to be rotated.
|
2017-10-31 14:03:45 +01:00
|
|
|
if (!(tileElement->properties.path.addition_status & ror8(0xC, (2 * get_current_rotation()))))
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId += 8;
|
|
|
|
}
|
2016-11-13 20:17:49 +01:00
|
|
|
|
2016-06-08 20:53:55 +02:00
|
|
|
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, imageId, 16, 25, 1, 1, 7, height, 16, 25, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2016-06-08 20:53:55 +02:00
|
|
|
|
2018-01-03 10:57:37 +01:00
|
|
|
if (!(edges & EDGE_SW)) {
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId = pathBitEntry->image + 7;
|
2016-06-08 20:53:55 +02:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId |= pathBitImageFlags;
|
2016-06-08 20:53:55 +02:00
|
|
|
|
2017-10-31 14:03:45 +01:00
|
|
|
if (!(tileElement->flags & TILE_ELEMENT_FLAG_BROKEN)) {
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId -= 4;
|
2016-11-13 20:17:49 +01:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
// Edges have been rotated around the rotation to check addition status
|
|
|
|
// this will also need to be rotated.
|
2017-10-31 14:03:45 +01:00
|
|
|
if (!(tileElement->properties.path.addition_status & ror8(0x30, (2 * get_current_rotation()))))
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId += 8;
|
|
|
|
}
|
2016-11-13 20:17:49 +01:00
|
|
|
|
2016-06-08 20:53:55 +02:00
|
|
|
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, imageId, 25, 16, 1, 1, 7, height, 25, 16, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2016-06-08 20:53:55 +02:00
|
|
|
|
2018-01-03 10:57:37 +01:00
|
|
|
if (!(edges & EDGE_NW)) {
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId = pathBitEntry->image + 8;
|
2016-06-08 20:53:55 +02:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId |= pathBitImageFlags;
|
2016-06-08 20:53:55 +02:00
|
|
|
|
2017-10-31 14:03:45 +01:00
|
|
|
if (!(tileElement->flags & TILE_ELEMENT_FLAG_BROKEN)) {
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId -= 4;
|
2016-06-08 20:53:55 +02:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
// Edges have been rotated around the rotation to check addition status
|
|
|
|
// this will also need to be rotated.
|
2017-10-31 14:03:45 +01:00
|
|
|
if (!(tileElement->properties.path.addition_status & ror8(0xC0, (2 * get_current_rotation()))))
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId += 8;
|
|
|
|
}
|
2016-11-13 20:17:49 +01:00
|
|
|
|
2016-06-08 20:53:55 +02:00
|
|
|
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, imageId, 16, 7, 1, 1, 7, height, 16, 7, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2016-06-08 20:53:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* rct2: 0x006A5E81 */
|
2017-10-31 14:03:45 +01:00
|
|
|
static void path_bit_benches_paint(paint_session * session, rct_scenery_entry* pathBitEntry, rct_tile_element* tileElement, sint32 height, uint8 edges, uint32 pathBitImageFlags) {
|
2017-06-06 23:24:18 +02:00
|
|
|
uint32 imageId;
|
2016-06-09 20:47:36 +02:00
|
|
|
|
2018-01-03 10:57:37 +01:00
|
|
|
if (!(edges & EDGE_NE)) {
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId = pathBitEntry->image + 1;
|
2016-06-09 20:47:36 +02:00
|
|
|
|
2017-10-31 14:03:45 +01:00
|
|
|
if (tileElement->flags & TILE_ELEMENT_FLAG_BROKEN)
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId += 4;
|
2016-06-09 20:47:36 +02:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId |= pathBitImageFlags;
|
2016-06-09 20:47:36 +02:00
|
|
|
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, imageId, 7, 16, 0, 16, 7, height, 6, 8, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2018-01-03 10:57:37 +01:00
|
|
|
if (!(edges & EDGE_SE)) {
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId = pathBitEntry->image + 2;
|
2016-06-09 20:47:36 +02:00
|
|
|
|
2017-10-31 14:03:45 +01:00
|
|
|
if (tileElement->flags & TILE_ELEMENT_FLAG_BROKEN)
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId += 4;
|
2016-06-09 20:47:36 +02:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId |= pathBitImageFlags;
|
2016-06-09 20:47:36 +02:00
|
|
|
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, imageId, 16, 25, 16, 0, 7, height, 8, 23, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2016-06-09 20:47:36 +02:00
|
|
|
|
2018-01-03 10:57:37 +01:00
|
|
|
if (!(edges & EDGE_SW)) {
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId = pathBitEntry->image + 3;
|
2016-06-09 20:47:36 +02:00
|
|
|
|
2017-10-31 14:03:45 +01:00
|
|
|
if (tileElement->flags & TILE_ELEMENT_FLAG_BROKEN)
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId += 4;
|
2016-06-09 20:47:36 +02:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId |= pathBitImageFlags;
|
2016-06-09 20:47:36 +02:00
|
|
|
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, imageId, 25, 16, 0, 16, 7, height, 23, 8, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2016-06-09 20:47:36 +02:00
|
|
|
|
2018-01-03 10:57:37 +01:00
|
|
|
if (!(edges & EDGE_NW)) {
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId = pathBitEntry->image + 4;
|
2016-06-09 20:47:36 +02:00
|
|
|
|
2017-10-31 14:03:45 +01:00
|
|
|
if (tileElement->flags & TILE_ELEMENT_FLAG_BROKEN)
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId += 4;
|
2016-06-09 20:47:36 +02:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId |= pathBitImageFlags;
|
2016-06-09 20:47:36 +02:00
|
|
|
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, imageId, 16, 7, 16, 0, 7, height, 8, 6, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2016-06-08 20:53:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* rct2: 0x006A6008 */
|
2017-10-31 14:03:45 +01:00
|
|
|
static void path_bit_jumping_fountains_paint(paint_session * session, rct_scenery_entry* pathBitEntry, rct_tile_element* tileElement, sint32 height, uint8 edges, uint32 pathBitImageFlags, rct_drawpixelinfo* dpi) {
|
2017-06-06 23:24:18 +02:00
|
|
|
if (dpi->zoom_level != 0)
|
|
|
|
return;
|
2016-06-09 20:47:36 +02:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
uint32 imageId = pathBitEntry->image;
|
|
|
|
imageId |= pathBitImageFlags;
|
2016-06-09 20:47:36 +02:00
|
|
|
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, imageId + 1, 0, 0, 1, 1, 2, height, 3, 3, height + 2, get_current_rotation());
|
|
|
|
sub_98197C(session, imageId + 2, 0, 0, 1, 1, 2, height, 3, 29, height + 2, get_current_rotation());
|
|
|
|
sub_98197C(session, imageId + 3, 0, 0, 1, 1, 2, height, 29, 29, height + 2, get_current_rotation());
|
|
|
|
sub_98197C(session, imageId + 4, 0, 0, 1, 1, 2, height, 29, 3, height + 2, get_current_rotation());
|
2016-06-08 20:53:55 +02:00
|
|
|
}
|
|
|
|
|
2016-04-30 22:09:53 +02:00
|
|
|
/**
|
|
|
|
* rct2: 0x006A4101
|
2017-10-31 12:57:40 +01:00
|
|
|
* @param tile_element (esi)
|
2016-04-30 22:09:53 +02:00
|
|
|
* @param (ecx)
|
|
|
|
* @param ebp (ebp)
|
|
|
|
* @param base_image_id (0x00F3EF78)
|
|
|
|
*/
|
2017-10-31 12:57:40 +01:00
|
|
|
static void sub_6A4101(paint_session * session, rct_tile_element * tile_element, uint16 height, uint32 ebp, bool word_F3F038, rct_footpath_entry * footpathEntry, uint32 base_image_id, uint32 imageFlags)
|
2016-04-30 22:09:53 +02:00
|
|
|
{
|
2017-10-31 12:57:40 +01:00
|
|
|
if (footpath_element_is_queue(tile_element)) {
|
2017-06-06 23:24:18 +02:00
|
|
|
uint8 local_ebp = ebp & 0x0F;
|
2017-10-31 12:57:40 +01:00
|
|
|
if (footpath_element_is_sloped(tile_element)) {
|
2018-01-03 10:57:37 +01:00
|
|
|
switch ((footpath_element_get_slope_direction(tile_element) + get_current_rotation()) & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK)
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
case 0:
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 95 + base_image_id, 0, 4, 32, 1, 23, height, 0, 4, height + 2, get_current_rotation());
|
|
|
|
sub_98197C(session, 95 + base_image_id, 0, 28, 32, 1, 23, height, 0, 28, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
break;
|
|
|
|
case 1:
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 94 + base_image_id, 4, 0, 1, 32, 23, height, 4, 0, height + 2, get_current_rotation());
|
|
|
|
sub_98197C(session, 94 + base_image_id, 28, 0, 1, 32, 23, height, 28, 0, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
break;
|
|
|
|
case 2:
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 96 + base_image_id, 0, 4, 32, 1, 23, height, 0, 4, height + 2, get_current_rotation());
|
|
|
|
sub_98197C(session, 96 + base_image_id, 0, 28, 32, 1, 23, height, 0, 28, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
break;
|
|
|
|
case 3:
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 93 + base_image_id, 4, 0, 1, 32, 23, height, 4, 0, height + 2, get_current_rotation());
|
|
|
|
sub_98197C(session, 93 + base_image_id, 28, 0, 1, 32, 23, height, 28, 0, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
switch (local_ebp) {
|
|
|
|
case 1:
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 90 + base_image_id, 0, 4, 28, 1, 7, height, 0, 4, height + 2, get_current_rotation());
|
|
|
|
sub_98197C(session, 90 + base_image_id, 0, 28, 28, 1, 7, height, 0, 28, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
break;
|
|
|
|
case 2:
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 91 + base_image_id, 4, 0, 1, 28, 7, height, 4, 0, height + 2, get_current_rotation());
|
|
|
|
sub_98197C(session, 91 + base_image_id, 28, 0, 1, 28, 7, height, 28, 0, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
break;
|
|
|
|
case 3:
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 90 + base_image_id, 0, 4, 28, 1, 7, height, 0, 4, height + 2, get_current_rotation());
|
|
|
|
sub_98197C(session, 91 + base_image_id, 28, 0, 1, 28, 7, height, 28, 4, height + 2, get_current_rotation()); // bound_box_offset_y seems to be a bug
|
|
|
|
sub_98197C(session, 98 + base_image_id, 0, 0, 4, 4, 7, height, 0, 28, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
break;
|
|
|
|
case 4:
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 92 + base_image_id, 0, 4, 28, 1, 7, height, 0, 4, height + 2, get_current_rotation());
|
|
|
|
sub_98197C(session, 92 + base_image_id, 0, 28, 28, 1, 7, height, 0, 28, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
break;
|
|
|
|
case 5:
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 88 + base_image_id, 0, 4, 32, 1, 7, height, 0, 4, height + 2, get_current_rotation());
|
|
|
|
sub_98197C(session, 88 + base_image_id, 0, 28, 32, 1, 7, height, 0, 28, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
break;
|
|
|
|
case 6:
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 91 + base_image_id, 4, 0, 1, 28, 7, height, 4, 0, height + 2, get_current_rotation());
|
|
|
|
sub_98197C(session, 92 + base_image_id, 0, 4, 28, 1, 7, height, 0, 4, height + 2, get_current_rotation());
|
|
|
|
sub_98197C(session, 99 + base_image_id, 0, 0, 4, 4, 7, height, 28, 28, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
break;
|
|
|
|
case 8:
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 89 + base_image_id, 4, 0, 1, 28, 7, height, 4, 0, height + 2, get_current_rotation());
|
|
|
|
sub_98197C(session, 89 + base_image_id, 28, 0, 1, 28, 7, height, 28, 0, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
break;
|
|
|
|
case 9:
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 89 + base_image_id, 28, 0, 1, 28, 7, height, 28, 0, height + 2, get_current_rotation());
|
|
|
|
sub_98197C(session, 90 + base_image_id, 0, 28, 28, 1, 7, height, 0, 28, height + 2, get_current_rotation());
|
|
|
|
sub_98197C(session, 97 + base_image_id, 0, 0, 4, 4, 7, height, 0, 0, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
break;
|
|
|
|
case 10:
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 87 + base_image_id, 4, 0, 1, 32, 7, height, 4, 0, height + 2, get_current_rotation());
|
|
|
|
sub_98197C(session, 87 + base_image_id, 28, 0, 1, 32, 7, height, 28, 0, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
break;
|
|
|
|
case 12:
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 89 + base_image_id, 4, 0, 1, 28, 7, height, 4, 0, height + 2, get_current_rotation());
|
|
|
|
sub_98197C(session, 92 + base_image_id, 0, 28, 28, 1, 7, height, 4, 28, height + 2, get_current_rotation()); // bound_box_offset_x seems to be a bug
|
|
|
|
sub_98197C(session, 100 + base_image_id, 0, 0, 4, 4, 7, height, 28, 0, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
// purposely left empty
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-03 10:57:37 +01:00
|
|
|
if (!footpath_element_has_queue_banner(tile_element)) {
|
2017-06-06 23:24:18 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2017-12-08 16:47:54 +01:00
|
|
|
uint8 direction = footpath_element_get_direction(tile_element);
|
2017-06-06 23:24:18 +02:00
|
|
|
// Draw ride sign
|
2017-09-02 23:31:39 +02:00
|
|
|
session->InteractionType = VIEWPORT_INTERACTION_ITEM_RIDE;
|
2017-10-31 12:57:40 +01:00
|
|
|
if (footpath_element_is_sloped(tile_element)) {
|
|
|
|
if (footpath_element_get_slope_direction(tile_element) == direction)
|
2017-06-06 23:24:18 +02:00
|
|
|
height += 16;
|
|
|
|
}
|
|
|
|
direction += get_current_rotation();
|
|
|
|
direction &= 3;
|
|
|
|
|
2017-10-13 22:23:07 +02:00
|
|
|
LocationXYZ16 boundBoxOffsets = {
|
2017-12-14 10:34:12 +01:00
|
|
|
BannerBoundBoxes[direction][0].x,
|
|
|
|
BannerBoundBoxes[direction][0].y,
|
|
|
|
static_cast<sint16>(height + 2)
|
2017-06-06 23:24:18 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
uint32 imageId = (direction << 1) + base_image_id + 101;
|
|
|
|
|
2018-01-03 10:57:37 +01:00
|
|
|
// Draw pole in the back
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, imageId, 0, 0, 1, 1, 21, height, boundBoxOffsets.x, boundBoxOffsets.y, boundBoxOffsets.z, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
|
2018-01-03 10:57:37 +01:00
|
|
|
// Draw pole in the front and banner
|
2017-06-06 23:24:18 +02:00
|
|
|
boundBoxOffsets.x = BannerBoundBoxes[direction][1].x;
|
|
|
|
boundBoxOffsets.y = BannerBoundBoxes[direction][1].y;
|
|
|
|
imageId++;
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, imageId, 0, 0, 1, 1, 21, height, boundBoxOffsets.x, boundBoxOffsets.y, boundBoxOffsets.z, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
|
|
|
|
direction--;
|
|
|
|
// If text shown
|
2018-01-03 10:57:37 +01:00
|
|
|
if (direction < 2 && tile_element->properties.path.ride_index != RIDE_ID_NULL && imageFlags == 0) {
|
2017-06-06 23:24:18 +02:00
|
|
|
uint16 scrollingMode = footpathEntry->scrolling_mode;
|
|
|
|
scrollingMode += direction;
|
|
|
|
|
|
|
|
set_format_arg(0, uint32, 0);
|
|
|
|
set_format_arg(4, uint32, 0);
|
|
|
|
|
2017-10-31 12:57:40 +01:00
|
|
|
Ride* ride = get_ride(tile_element->properties.path.ride_index);
|
2017-06-06 23:24:18 +02:00
|
|
|
rct_string_id string_id = STR_RIDE_ENTRANCE_CLOSED;
|
|
|
|
if (ride->status == RIDE_STATUS_OPEN && !(ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN)){
|
|
|
|
set_format_arg(0, rct_string_id, ride->name);
|
|
|
|
set_format_arg(2, uint32, ride->name_arguments);
|
|
|
|
string_id = STR_RIDE_ENTRANCE_NAME;
|
|
|
|
}
|
|
|
|
if (gConfigGeneral.upper_case_banners) {
|
|
|
|
format_string_to_upper(gCommonStringFormatBuffer, 256, string_id, gCommonFormatArgs);
|
|
|
|
} else {
|
|
|
|
format_string(gCommonStringFormatBuffer, 256, string_id, gCommonFormatArgs);
|
|
|
|
}
|
|
|
|
|
|
|
|
gCurrentFontSpriteBase = FONT_SPRITE_BASE_TINY;
|
|
|
|
|
|
|
|
uint16 string_width = gfx_get_string_width(gCommonStringFormatBuffer);
|
|
|
|
uint16 scroll = (gCurrentTicks / 2) % string_width;
|
|
|
|
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98199C(session, scrolling_text_setup(session, string_id, scroll, scrollingMode), 0, 0, 1, 1, 21, height + 7, boundBoxOffsets.x, boundBoxOffsets.y, boundBoxOffsets.z, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
|
2017-09-02 23:31:39 +02:00
|
|
|
session->InteractionType = VIEWPORT_INTERACTION_ITEM_FOOTPATH;
|
2017-06-06 23:24:18 +02:00
|
|
|
if (imageFlags != 0) {
|
2017-09-02 23:31:39 +02:00
|
|
|
session->InteractionType = VIEWPORT_INTERACTION_ITEM_NONE;
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// save ecx, ebp, esi
|
|
|
|
uint32 dword_F3EF80 = ebp;
|
|
|
|
if (!(footpathEntry->flags & FOOTPATH_ENTRY_FLAG_HAS_PATH_BASE_SPRITE)) {
|
|
|
|
dword_F3EF80 &= 0x0F;
|
|
|
|
}
|
|
|
|
|
2017-10-31 12:57:40 +01:00
|
|
|
if (footpath_element_is_sloped(tile_element)) {
|
2018-01-03 10:57:37 +01:00
|
|
|
switch ((footpath_element_get_slope_direction(tile_element) + get_current_rotation()) & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK)
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
case 0:
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 81 + base_image_id, 0, 4, 32, 1, 23, height, 0, 4, height + 2, get_current_rotation());
|
|
|
|
sub_98197C(session, 81 + base_image_id, 0, 28, 32, 1, 23, height, 0, 28, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
break;
|
|
|
|
case 1:
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 80 + base_image_id, 4, 0, 1, 32, 23, height, 4, 0, height + 2, get_current_rotation());
|
|
|
|
sub_98197C(session, 80 + base_image_id, 28, 0, 1, 32, 23, height, 28, 0, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
break;
|
|
|
|
case 2:
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 82 + base_image_id, 0, 4, 32, 1, 23, height, 0, 4, height + 2, get_current_rotation());
|
|
|
|
sub_98197C(session, 82 + base_image_id, 0, 28, 32, 1, 23, height, 0, 28, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
break;
|
|
|
|
case 3:
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 79 + base_image_id, 4, 0, 1, 32, 23, height, 4, 0, height + 2, get_current_rotation());
|
|
|
|
sub_98197C(session, 79 + base_image_id, 28, 0, 1, 32, 23, height, 28, 0, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (!word_F3F038) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint8 local_ebp = ebp & 0x0F;
|
|
|
|
switch (local_ebp) {
|
|
|
|
case 0:
|
|
|
|
// purposely left empty
|
|
|
|
break;
|
|
|
|
case 1:
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 76 + base_image_id, 0, 4, 28, 1, 7, height, 0, 4, height + 2, get_current_rotation());
|
|
|
|
sub_98197C(session, 76 + base_image_id, 0, 28, 28, 1, 7, height, 0, 28, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
break;
|
|
|
|
case 2:
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 77 + base_image_id, 4, 0, 1, 28, 7, height, 4, 0, height + 2, get_current_rotation());
|
|
|
|
sub_98197C(session, 77 + base_image_id, 28, 0, 1, 28, 7, height, 28, 0, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
break;
|
|
|
|
case 4:
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 78 + base_image_id, 0, 4, 28, 1, 7, height, 0, 4, height + 2, get_current_rotation());
|
|
|
|
sub_98197C(session, 78 + base_image_id, 0, 28, 28, 1, 7, height, 0, 28, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
break;
|
|
|
|
case 5:
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 74 + base_image_id, 0, 4, 32, 1, 7, height, 0, 4, height + 2, get_current_rotation());
|
|
|
|
sub_98197C(session, 74 + base_image_id, 0, 28, 32, 1, 7, height, 0, 28, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
break;
|
|
|
|
case 8:
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 75 + base_image_id, 4, 0, 1, 28, 7, height, 4, 0, height + 2, get_current_rotation());
|
|
|
|
sub_98197C(session, 75 + base_image_id, 28, 0, 1, 28, 7, height, 28, 0, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
break;
|
|
|
|
case 10:
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 73 + base_image_id, 4, 0, 1, 32, 7, height, 4, 0, height + 2, get_current_rotation());
|
|
|
|
sub_98197C(session, 73 + base_image_id, 28, 0, 1, 32, 7, height, 28, 0, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 3:
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 76 + base_image_id, 0, 4, 28, 1, 7, height, 0, 4, height + 2, get_current_rotation());
|
|
|
|
sub_98197C(session, 77 + base_image_id, 28, 0, 1, 28, 7, height, 28, 4, height + 2, get_current_rotation()); // bound_box_offset_y seems to be a bug
|
2017-06-06 23:24:18 +02:00
|
|
|
if (!(dword_F3EF80 & 0x10)) {
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 84 + base_image_id, 0, 0, 4, 4, 7, height, 0, 28, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 6:
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 77 + base_image_id, 4, 0, 1, 28, 7, height, 4, 0, height + 2, get_current_rotation());
|
|
|
|
sub_98197C(session, 78 + base_image_id, 0, 4, 28, 1, 7, height, 0, 4, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
if (!(dword_F3EF80 & 0x20)) {
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 85 + base_image_id, 0, 0, 4, 4, 7, height, 28, 28, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 9:
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 75 + base_image_id, 28, 0, 1, 28, 7, height, 28, 0, height + 2, get_current_rotation());
|
|
|
|
sub_98197C(session, 76 + base_image_id, 0, 28, 28, 1, 7, height, 0, 28, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
if (!(dword_F3EF80 & 0x80)) {
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 83 + base_image_id, 0, 0, 4, 4, 7, height, 0, 0, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 12:
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 75 + base_image_id, 4, 0, 1, 28, 7, height, 4, 0, height + 2, get_current_rotation());
|
|
|
|
sub_98197C(session, 78 + base_image_id, 0, 28, 28, 1, 7, height, 4, 28, height + 2, get_current_rotation()); // bound_box_offset_x seems to be a bug
|
2017-06-06 23:24:18 +02:00
|
|
|
if (!(dword_F3EF80 & 0x40)) {
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 86 + base_image_id, 0, 0, 4, 4, 7, height, 28, 0, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 7:
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 74 + base_image_id, 0, 4, 32, 1, 7, height, 0, 4, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
if (!(dword_F3EF80 & 0x10)) {
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 84 + base_image_id, 0, 0, 4, 4, 7, height, 0, 28, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
if (!(dword_F3EF80 & 0x20)) {
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 85 + base_image_id, 0, 0, 4, 4, 7, height, 28, 28, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 13:
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 74 + base_image_id, 0, 28, 32, 1, 7, height, 0, 28, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
if (!(dword_F3EF80 & 0x40)) {
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 86 + base_image_id, 0, 0, 4, 4, 7, height, 28, 0, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
if (!(dword_F3EF80 & 0x80)) {
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 83 + base_image_id, 0, 0, 4, 4, 7, height, 0, 0, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 14:
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 73 + base_image_id, 4, 0, 1, 32, 7, height, 4, 0, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
if (!(dword_F3EF80 & 0x20)) {
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 85 + base_image_id, 0, 0, 4, 4, 7, height, 28, 28, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
if (!(dword_F3EF80 & 0x40)) {
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 86 + base_image_id, 0, 0, 4, 4, 7, height, 28, 0, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 11:
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 73 + base_image_id, 28, 0, 1, 32, 7, height, 28, 0, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
if (!(dword_F3EF80 & 0x10)) {
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 84 + base_image_id, 0, 0, 4, 4, 7, height, 0, 28, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
if (!(dword_F3EF80 & 0x80)) {
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 83 + base_image_id, 0, 0, 4, 4, 7, height, 0, 0, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 15:
|
|
|
|
if (!(dword_F3EF80 & 0x10)) {
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 84 + base_image_id, 0, 0, 4, 4, 7, height, 0, 28, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
if (!(dword_F3EF80 & 0x20)) {
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 85 + base_image_id, 0, 0, 4, 4, 7, height, 28, 28, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
if (!(dword_F3EF80 & 0x40)) {
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 86 + base_image_id, 0, 0, 4, 4, 7, height, 28, 0, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
if (!(dword_F3EF80 & 0x80)) {
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98197C(session, 83 + base_image_id, 0, 0, 4, 4, 7, height, 0, 0, height + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
2016-04-30 22:09:53 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* rct2: 0x006A3F61
|
2017-10-31 12:57:40 +01:00
|
|
|
* @param tile_element (esp[0])
|
2018-01-03 10:57:37 +01:00
|
|
|
* @param connectedEdges (bp) (relative to the camera's rotation)
|
2016-04-30 22:09:53 +02:00
|
|
|
* @param height (dx)
|
2016-06-14 21:33:56 +02:00
|
|
|
* @param footpathEntry (0x00F3EF6C)
|
|
|
|
* @param imageFlags (0x00F3EF70)
|
|
|
|
* @param sceneryImageFlags (0x00F3EF74)
|
2016-04-30 22:09:53 +02:00
|
|
|
*/
|
2018-01-03 10:57:37 +01:00
|
|
|
static void sub_6A3F61(paint_session * session, rct_tile_element * tile_element, uint16 connectedEdges, uint16 height, rct_footpath_entry * footpathEntry, uint32 imageFlags, uint32 sceneryImageFlags, bool word_F3F038)
|
2016-04-30 22:09:53 +02:00
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
// eax --
|
|
|
|
// ebx --
|
|
|
|
// ecx
|
|
|
|
// edx
|
|
|
|
// esi --
|
|
|
|
// edi --
|
|
|
|
// ebp
|
|
|
|
// esp: [ esi, ???, 000]
|
|
|
|
|
|
|
|
// Probably drawing benches etc.
|
|
|
|
|
2017-09-02 23:31:39 +02:00
|
|
|
rct_drawpixelinfo * dpi = session->Unk140E9A8;
|
2017-06-06 23:24:18 +02:00
|
|
|
|
|
|
|
if (dpi->zoom_level <= 1) {
|
|
|
|
if (!gTrackDesignSaveMode) {
|
2018-01-03 10:57:37 +01:00
|
|
|
if (footpath_element_has_path_scenery(tile_element)) {
|
2017-09-02 23:31:39 +02:00
|
|
|
session->InteractionType = VIEWPORT_INTERACTION_ITEM_FOOTPATH_ITEM;
|
2017-06-06 23:24:18 +02:00
|
|
|
if (sceneryImageFlags != 0) {
|
2017-09-02 23:31:39 +02:00
|
|
|
session->InteractionType = VIEWPORT_INTERACTION_ITEM_NONE;
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Draw additional path bits (bins, benches, lamps, queue screens)
|
2017-10-31 12:57:40 +01:00
|
|
|
rct_scenery_entry* sceneryEntry = get_footpath_item_entry(footpath_element_get_path_scenery_index(tile_element));
|
2017-06-06 23:24:18 +02:00
|
|
|
switch (sceneryEntry->path_bit.draw_type) {
|
|
|
|
case PATH_BIT_DRAW_TYPE_LIGHTS:
|
2018-01-03 10:57:37 +01:00
|
|
|
path_bit_lights_paint(session, sceneryEntry, tile_element, height, (uint8)connectedEdges, sceneryImageFlags);
|
2017-06-06 23:24:18 +02:00
|
|
|
break;
|
|
|
|
case PATH_BIT_DRAW_TYPE_BINS:
|
2018-01-03 10:57:37 +01:00
|
|
|
path_bit_bins_paint(session, sceneryEntry, tile_element, height, (uint8)connectedEdges, sceneryImageFlags);
|
2017-06-06 23:24:18 +02:00
|
|
|
break;
|
|
|
|
case PATH_BIT_DRAW_TYPE_BENCHES:
|
2018-01-03 10:57:37 +01:00
|
|
|
path_bit_benches_paint(session, sceneryEntry, tile_element, height, (uint8)connectedEdges, sceneryImageFlags);
|
2017-06-06 23:24:18 +02:00
|
|
|
break;
|
|
|
|
case PATH_BIT_DRAW_TYPE_JUMPING_FOUNTAINS:
|
2018-01-03 10:57:37 +01:00
|
|
|
path_bit_jumping_fountains_paint(session, sceneryEntry, tile_element, height, (uint8)connectedEdges, sceneryImageFlags, dpi);
|
2017-06-06 23:24:18 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2017-09-02 23:31:39 +02:00
|
|
|
session->InteractionType = VIEWPORT_INTERACTION_ITEM_FOOTPATH;
|
2017-06-06 23:24:18 +02:00
|
|
|
|
|
|
|
if (sceneryImageFlags != 0) {
|
2017-09-02 23:31:39 +02:00
|
|
|
session->InteractionType = VIEWPORT_INTERACTION_ITEM_NONE;
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Redundant zoom-level check removed
|
|
|
|
|
2018-01-03 10:57:37 +01:00
|
|
|
sub_6A4101(session, tile_element, height, connectedEdges, word_F3F038, footpathEntry, footpathEntry->image | imageFlags, imageFlags);
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// This is about tunnel drawing
|
2018-01-03 10:57:37 +01:00
|
|
|
uint8 direction = (footpath_element_get_slope_direction(tile_element) + get_current_rotation()) & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK;
|
|
|
|
bool sloped = footpath_element_is_sloped(tile_element);
|
2017-06-06 23:24:18 +02:00
|
|
|
|
2018-01-03 10:57:37 +01:00
|
|
|
if (connectedEdges & EDGE_SE) {
|
2017-06-06 23:24:18 +02:00
|
|
|
// Bottom right of tile is a tunnel
|
2018-01-03 10:57:37 +01:00
|
|
|
if (sloped && direction == EDGE_NE) {
|
|
|
|
// Path going down into the tunnel
|
2017-09-03 02:51:59 +02:00
|
|
|
paint_util_push_tunnel_right(session, height + 16, TUNNEL_10);
|
2018-01-03 10:57:37 +01:00
|
|
|
} else if (connectedEdges & EDGE_NE) {
|
|
|
|
// Flat path with edge to the right (north-east)
|
2017-09-03 02:51:59 +02:00
|
|
|
paint_util_push_tunnel_right(session, height, TUNNEL_11);
|
2017-06-06 23:24:18 +02:00
|
|
|
} else {
|
2018-01-03 10:57:37 +01:00
|
|
|
// Path going up, or flat and not connected to the right
|
2017-09-03 02:51:59 +02:00
|
|
|
paint_util_push_tunnel_right(session, height, TUNNEL_10);
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-03 10:57:37 +01:00
|
|
|
if (!(connectedEdges & EDGE_SW)) {
|
2017-06-06 23:24:18 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Bottom left of the tile is a tunnel
|
2018-01-03 10:57:37 +01:00
|
|
|
if (sloped && direction == EDGE_SE) {
|
|
|
|
// Path going down into the tunnel
|
2017-09-03 02:51:59 +02:00
|
|
|
paint_util_push_tunnel_left(session, height + 16, TUNNEL_10);
|
2018-01-03 10:57:37 +01:00
|
|
|
} else if (connectedEdges & EDGE_NW) {
|
|
|
|
// Flat path with edge to the left (north-west)
|
2017-09-03 02:51:59 +02:00
|
|
|
paint_util_push_tunnel_left(session, height , TUNNEL_11);
|
2017-06-06 23:24:18 +02:00
|
|
|
} else {
|
2018-01-03 10:57:37 +01:00
|
|
|
// Path going up, or flat and not connected to the left
|
2017-09-03 02:51:59 +02:00
|
|
|
paint_util_push_tunnel_left(session, height , TUNNEL_10);
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2016-04-30 22:09:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* rct2: 0x0006A3590
|
|
|
|
*/
|
2017-10-31 12:57:40 +01:00
|
|
|
void path_paint(paint_session * session, uint8 direction, uint16 height, rct_tile_element * tile_element)
|
2016-04-30 22:09:53 +02:00
|
|
|
{
|
2017-09-02 23:31:39 +02:00
|
|
|
session->InteractionType = VIEWPORT_INTERACTION_ITEM_FOOTPATH;
|
2017-06-06 23:24:18 +02:00
|
|
|
|
|
|
|
bool word_F3F038 = false;
|
|
|
|
|
|
|
|
uint32 sceneryImageFlags = 0;
|
|
|
|
uint32 imageFlags = 0;
|
|
|
|
|
|
|
|
if (gTrackDesignSaveMode) {
|
2017-10-31 12:57:40 +01:00
|
|
|
if (footpath_element_is_queue(tile_element)) {
|
|
|
|
if (tile_element->properties.path.ride_index != gTrackDesignSaveRideIndex) {
|
2017-06-06 23:24:18 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-10-31 12:57:40 +01:00
|
|
|
if (!track_design_save_contains_tile_element(tile_element)) {
|
2017-06-06 23:24:18 +02:00
|
|
|
imageFlags = 0x21700000;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-10-31 12:57:40 +01:00
|
|
|
if (footpath_element_path_scenery_is_ghost(tile_element)) {
|
2017-12-04 10:12:42 +01:00
|
|
|
sceneryImageFlags = CONSTRUCTION_MARKER;
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
|
2017-10-31 12:57:40 +01:00
|
|
|
if (tile_element->flags & TILE_ELEMENT_FLAG_GHOST) {
|
2017-09-02 23:31:39 +02:00
|
|
|
session->InteractionType = VIEWPORT_INTERACTION_ITEM_NONE;
|
2017-12-04 10:12:42 +01:00
|
|
|
imageFlags = CONSTRUCTION_MARKER;
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
|
2017-09-02 23:31:39 +02:00
|
|
|
sint16 x = session->MapPosition.x, y = session->MapPosition.y;
|
2017-06-06 23:24:18 +02:00
|
|
|
|
2017-10-31 12:57:40 +01:00
|
|
|
rct_tile_element * surface = map_get_surface_element_at(x / 32, y / 32);
|
2017-06-06 23:24:18 +02:00
|
|
|
|
|
|
|
uint16 bl = height / 8;
|
2018-01-04 06:58:44 +01:00
|
|
|
if (surface == nullptr) {
|
2017-06-06 23:24:18 +02:00
|
|
|
word_F3F038 = true;
|
|
|
|
} else if (surface->base_height != bl) {
|
|
|
|
word_F3F038 = true;
|
|
|
|
} else {
|
2017-10-31 12:57:40 +01:00
|
|
|
if (footpath_element_is_sloped(tile_element)) {
|
2017-06-06 23:24:18 +02:00
|
|
|
// Diagonal path
|
|
|
|
|
2018-01-03 10:57:37 +01:00
|
|
|
if ((surface->properties.surface.slope & TILE_ELEMENT_SURFACE_SLOPE_MASK) != byte_98D800[footpath_element_get_slope_direction(tile_element)]) {
|
2017-06-06 23:24:18 +02:00
|
|
|
word_F3F038 = true;
|
|
|
|
}
|
|
|
|
} else {
|
2018-01-03 10:57:37 +01:00
|
|
|
if (surface->properties.surface.slope & TILE_ELEMENT_SURFACE_SLOPE_MASK) {
|
2017-06-06 23:24:18 +02:00
|
|
|
word_F3F038 = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (gStaffDrawPatrolAreas != 0xFFFF) {
|
|
|
|
sint32 staffIndex = gStaffDrawPatrolAreas;
|
|
|
|
uint8 staffType = staffIndex & 0x7FFF;
|
|
|
|
bool is_staff_list = staffIndex & 0x8000;
|
2017-09-02 23:31:39 +02:00
|
|
|
x = session->MapPosition.x;
|
|
|
|
y = session->MapPosition.y;
|
2017-06-06 23:24:18 +02:00
|
|
|
|
|
|
|
uint8 patrolColour = COLOUR_LIGHT_BLUE;
|
|
|
|
|
|
|
|
if (!is_staff_list) {
|
|
|
|
rct_peep * staff = GET_PEEP(staffIndex);
|
|
|
|
if (!staff_is_patrol_area_set(staff->staff_id, x, y)) {
|
|
|
|
patrolColour = COLOUR_GREY;
|
|
|
|
}
|
|
|
|
staffType = staff->staff_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (staff_is_patrol_area_set(200 + staffType, x, y)) {
|
|
|
|
uint32 imageId = 2618;
|
2017-10-31 12:57:40 +01:00
|
|
|
sint32 height2 = tile_element->base_height * 8;
|
|
|
|
if (footpath_element_is_sloped(tile_element)) {
|
2018-01-03 10:57:37 +01:00
|
|
|
imageId = 2619 + ((footpath_element_get_slope_direction(tile_element) + get_current_rotation()) & 3);
|
2017-06-06 23:24:18 +02:00
|
|
|
height2 += 16;
|
|
|
|
}
|
|
|
|
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98196C(session, imageId | patrolColour << 19 | IMAGE_TYPE_REMAP, 16, 16, 1, 1, 0, height2 + 2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (gCurrentViewportFlags & VIEWPORT_FLAG_PATH_HEIGHTS) {
|
2017-10-31 12:57:40 +01:00
|
|
|
uint16 height2 = 3 + tile_element->base_height * 8;
|
|
|
|
if (footpath_element_is_sloped(tile_element)) {
|
2017-06-06 23:24:18 +02:00
|
|
|
height2 += 8;
|
|
|
|
}
|
2017-07-20 20:56:29 +02:00
|
|
|
uint32 imageId = (SPR_HEIGHT_MARKER_BASE + height2 / 16) | COLOUR_GREY << 19 | IMAGE_TYPE_REMAP;
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId += get_height_marker_offset();
|
|
|
|
imageId -= gMapBaseZ;
|
2017-09-03 03:27:07 +02:00
|
|
|
sub_98196C(session, imageId, 16, 16, 1, 1, 0, height2, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
|
2018-01-03 10:57:37 +01:00
|
|
|
uint8 pathType = footpath_element_get_type(tile_element);
|
2017-07-13 00:06:42 +02:00
|
|
|
rct_footpath_entry * footpathEntry = get_footpath_entry(pathType);
|
2017-06-06 23:24:18 +02:00
|
|
|
|
2018-01-04 06:58:44 +01:00
|
|
|
if (footpathEntry != nullptr) {
|
2017-07-13 00:06:42 +02:00
|
|
|
if (footpathEntry->support_type == FOOTPATH_ENTRY_SUPPORT_TYPE_POLE) {
|
2017-10-31 12:57:40 +01:00
|
|
|
path_paint_pole_support(session, tile_element, height, footpathEntry, word_F3F038, imageFlags, sceneryImageFlags);
|
2017-07-13 00:06:42 +02:00
|
|
|
}
|
|
|
|
else {
|
2017-10-31 12:57:40 +01:00
|
|
|
path_paint_box_support(session, tile_element, height, footpathEntry, word_F3F038, imageFlags, sceneryImageFlags);
|
2017-07-13 00:06:42 +02:00
|
|
|
}
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2016-10-17 23:51:18 +02:00
|
|
|
|
2016-10-24 14:06:44 +02:00
|
|
|
#ifdef __ENABLE_LIGHTFX__
|
2017-09-26 20:51:13 +02:00
|
|
|
if (lightfx_is_available()) {
|
2017-10-31 12:57:40 +01:00
|
|
|
if (footpath_element_has_path_scenery(tile_element) && !(tile_element->flags & TILE_ELEMENT_FLAG_BROKEN)) {
|
|
|
|
rct_scenery_entry *sceneryEntry = get_footpath_item_entry(footpath_element_get_path_scenery_index(tile_element));
|
2017-06-06 23:24:18 +02:00
|
|
|
if (sceneryEntry->path_bit.flags & PATH_BIT_FLAG_LAMP) {
|
2018-01-03 10:57:37 +01:00
|
|
|
if (!(tile_element->properties.path.edges & EDGE_NE)) {
|
2017-09-03 00:41:02 +02:00
|
|
|
lightfx_add_3d_light_magic_from_drawing_tile(session->MapPosition, -16, 0, height + 23, LIGHTFX_LIGHT_TYPE_LANTERN_3);
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2018-01-03 10:57:37 +01:00
|
|
|
if (!(tile_element->properties.path.edges & EDGE_SE)) {
|
2017-09-03 00:41:02 +02:00
|
|
|
lightfx_add_3d_light_magic_from_drawing_tile(session->MapPosition, 0, 16, height + 23, LIGHTFX_LIGHT_TYPE_LANTERN_3);
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2018-01-03 10:57:37 +01:00
|
|
|
if (!(tile_element->properties.path.edges & EDGE_SW)) {
|
2017-09-03 00:41:02 +02:00
|
|
|
lightfx_add_3d_light_magic_from_drawing_tile(session->MapPosition, 16, 0, height + 23, LIGHTFX_LIGHT_TYPE_LANTERN_3);
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2018-01-03 10:57:37 +01:00
|
|
|
if (!(tile_element->properties.path.edges & EDGE_NW)) {
|
2017-09-03 00:41:02 +02:00
|
|
|
lightfx_add_3d_light_magic_from_drawing_tile(session->MapPosition, 0, -16, height + 23, LIGHTFX_LIGHT_TYPE_LANTERN_3);
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-10-17 23:51:18 +02:00
|
|
|
#endif
|
2016-05-05 20:29:49 +02:00
|
|
|
}
|
2016-04-30 22:09:53 +02:00
|
|
|
|
2017-12-10 13:58:38 +01:00
|
|
|
void path_paint_box_support(paint_session * session, rct_tile_element * tileElement, sint32 height, rct_footpath_entry * footpathEntry, bool hasFences, uint32 imageFlags, uint32 sceneryImageFlags)
|
2016-04-30 22:09:53 +02:00
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
// Rol edges around rotation
|
2017-10-31 14:03:45 +01:00
|
|
|
uint8 edges = ((tileElement->properties.path.edges << get_current_rotation()) & 0xF) |
|
|
|
|
(((tileElement->properties.path.edges & 0xF) << get_current_rotation()) >> 4);
|
2017-06-06 23:24:18 +02:00
|
|
|
|
2017-10-31 14:03:45 +01:00
|
|
|
uint8 corners = (((tileElement->properties.path.edges >> 4) << get_current_rotation()) & 0xF) |
|
|
|
|
(((tileElement->properties.path.edges >> 4) << get_current_rotation()) >> 4);
|
2017-06-06 23:24:18 +02:00
|
|
|
|
|
|
|
|
2017-12-14 10:34:12 +01:00
|
|
|
LocationXY16 boundBoxOffset = {stru_98D804[edges][0], stru_98D804[edges][1]};
|
|
|
|
LocationXY16 boundBoxSize = {stru_98D804[edges][2], stru_98D804[edges][3]};
|
2017-06-06 23:24:18 +02:00
|
|
|
|
|
|
|
uint16 edi = edges | (corners << 4);
|
|
|
|
|
|
|
|
uint32 imageId;
|
2017-10-31 14:03:45 +01:00
|
|
|
if (footpath_element_is_sloped(tileElement)) {
|
2018-01-03 10:57:37 +01:00
|
|
|
imageId = ((footpath_element_get_slope_direction(tileElement) + get_current_rotation()) & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK) + 16;
|
2017-06-06 23:24:18 +02:00
|
|
|
} else {
|
|
|
|
imageId = byte_98D6E0[edi];
|
|
|
|
}
|
|
|
|
|
|
|
|
imageId += footpathEntry->image;
|
2017-10-31 14:03:45 +01:00
|
|
|
if (footpath_element_is_queue(tileElement)) {
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId += 51;
|
|
|
|
}
|
|
|
|
|
2017-09-02 23:31:39 +02:00
|
|
|
if (!session->DidPassSurface) {
|
2017-06-06 23:24:18 +02:00
|
|
|
boundBoxOffset.x = 3;
|
|
|
|
boundBoxOffset.y = 3;
|
|
|
|
boundBoxSize.x = 26;
|
|
|
|
boundBoxSize.y = 26;
|
|
|
|
}
|
|
|
|
|
2017-10-11 18:16:25 +02:00
|
|
|
// By default, add 1 to the z bounding box to always clip above the surface
|
|
|
|
uint8 boundingBoxZOffset = 1;
|
|
|
|
|
|
|
|
// If we are on the same tile as a straight track, add the offset 2 so we
|
|
|
|
// can clip above gravel part of the track sprite
|
|
|
|
if (session->TrackElementOnSameHeight)
|
|
|
|
{
|
|
|
|
if (session->TrackElementOnSameHeight->properties.track.type == TRACK_ELEM_FLAT)
|
|
|
|
{
|
|
|
|
boundingBoxZOffset = 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-09-02 23:31:39 +02:00
|
|
|
if (!hasFences || !session->DidPassSurface) {
|
2017-10-11 18:16:25 +02:00
|
|
|
sub_98197C(session, imageId | imageFlags, 0, 0, boundBoxSize.x, boundBoxSize.y, 0, height, boundBoxOffset.x, boundBoxOffset.y, height + boundingBoxZOffset, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
} else {
|
|
|
|
uint32 image_id;
|
2017-10-31 14:03:45 +01:00
|
|
|
if (footpath_element_is_sloped(tileElement)) {
|
2018-01-03 10:57:37 +01:00
|
|
|
image_id = ((footpath_element_get_slope_direction(tileElement) + get_current_rotation()) & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK) + footpathEntry->bridge_image + 51;
|
2017-06-06 23:24:18 +02:00
|
|
|
} else {
|
|
|
|
image_id = byte_98D8A4[edges] + footpathEntry->bridge_image + 49;
|
|
|
|
}
|
|
|
|
|
2017-10-11 18:16:25 +02:00
|
|
|
sub_98197C(session, image_id | imageFlags, 0, 0, boundBoxSize.x, boundBoxSize.y, 0, height, boundBoxOffset.x, boundBoxOffset.y, height + boundingBoxZOffset, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
|
2017-10-31 14:03:45 +01:00
|
|
|
if (!footpath_element_is_queue(tileElement) && !(footpathEntry->flags & FOOTPATH_ENTRY_FLAG_HAS_PATH_BASE_SPRITE)) {
|
2017-06-06 23:24:18 +02:00
|
|
|
// don't draw
|
|
|
|
} else {
|
2017-10-11 18:16:25 +02:00
|
|
|
sub_98199C(session, imageId | imageFlags, 0, 0, boundBoxSize.x, boundBoxSize.y, 0, height, boundBoxOffset.x, boundBoxOffset.y, height + boundingBoxZOffset, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-10-31 14:03:45 +01:00
|
|
|
sub_6A3F61(session, tileElement, edi, height, footpathEntry, imageFlags, sceneryImageFlags, hasFences);
|
2017-06-06 23:24:18 +02:00
|
|
|
|
|
|
|
uint16 ax = 0;
|
2017-10-31 14:03:45 +01:00
|
|
|
if (footpath_element_is_sloped(tileElement)) {
|
2018-01-03 10:57:37 +01:00
|
|
|
ax = ((footpath_element_get_slope_direction(tileElement) + get_current_rotation()) & 0x3) + 1;
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (byte_98D8A4[edges] == 0) {
|
2018-01-04 06:58:44 +01:00
|
|
|
path_a_supports_paint_setup(session, 0, ax, height, imageFlags, footpathEntry, nullptr);
|
2017-06-06 23:24:18 +02:00
|
|
|
} else {
|
2018-01-04 06:58:44 +01:00
|
|
|
path_a_supports_paint_setup(session, 1, ax, height, imageFlags, footpathEntry, nullptr);
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
height += 32;
|
2017-10-31 14:03:45 +01:00
|
|
|
if (footpath_element_is_sloped(tileElement)) {
|
2017-06-06 23:24:18 +02:00
|
|
|
height += 16;
|
|
|
|
}
|
|
|
|
|
2017-09-03 02:56:56 +02:00
|
|
|
paint_util_set_general_support_height(session, height, 0x20);
|
2017-06-06 23:24:18 +02:00
|
|
|
|
2017-10-31 14:03:45 +01:00
|
|
|
if (footpath_element_is_queue(tileElement)
|
|
|
|
|| (tileElement->properties.path.edges != 0xFF && hasFences)
|
2017-06-06 23:24:18 +02:00
|
|
|
) {
|
2017-09-03 02:56:56 +02:00
|
|
|
paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0);
|
2017-06-06 23:24:18 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2017-10-31 14:03:45 +01:00
|
|
|
if (tileElement->properties.path.edges == 0xFF) {
|
2017-09-03 02:56:56 +02:00
|
|
|
paint_util_set_segment_support_height(session, SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, 0xFFFF, 0);
|
2017-06-06 23:24:18 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2017-09-03 02:56:56 +02:00
|
|
|
paint_util_set_segment_support_height(session, SEGMENT_C4, 0xFFFF, 0);
|
2017-06-06 23:24:18 +02:00
|
|
|
|
|
|
|
if (edges & 1) {
|
2017-09-03 02:56:56 +02:00
|
|
|
paint_util_set_segment_support_height(session, SEGMENT_CC, 0xFFFF, 0);
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (edges & 2) {
|
2017-09-03 02:56:56 +02:00
|
|
|
paint_util_set_segment_support_height(session, SEGMENT_D4, 0xFFFF, 0);
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (edges & 4) {
|
2017-09-03 02:56:56 +02:00
|
|
|
paint_util_set_segment_support_height(session, SEGMENT_D0, 0xFFFF, 0);
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (edges & 8) {
|
2017-09-03 02:56:56 +02:00
|
|
|
paint_util_set_segment_support_height(session, SEGMENT_C8, 0xFFFF, 0);
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2016-04-30 22:09:53 +02:00
|
|
|
}
|
|
|
|
|
2017-12-10 13:58:38 +01:00
|
|
|
void path_paint_pole_support(paint_session * session, rct_tile_element* tileElement, sint16 height, rct_footpath_entry* footpathEntry, bool hasFences, uint32 imageFlags, uint32 sceneryImageFlags)
|
2016-04-30 22:09:53 +02:00
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
// Rol edges around rotation
|
2017-10-31 14:03:45 +01:00
|
|
|
uint8 edges = ((tileElement->properties.path.edges << get_current_rotation()) & 0xF) |
|
|
|
|
(((tileElement->properties.path.edges & 0xF) << get_current_rotation()) >> 4);
|
2017-06-06 23:24:18 +02:00
|
|
|
|
2017-10-13 22:23:07 +02:00
|
|
|
LocationXY16 boundBoxOffset = {
|
2017-12-14 10:34:12 +01:00
|
|
|
stru_98D804[edges][0],
|
|
|
|
stru_98D804[edges][1]
|
2017-06-06 23:24:18 +02:00
|
|
|
};
|
|
|
|
|
2017-10-13 22:23:07 +02:00
|
|
|
LocationXY16 boundBoxSize = {
|
2017-12-14 10:34:12 +01:00
|
|
|
stru_98D804[edges][2],
|
|
|
|
stru_98D804[edges][3]
|
2017-06-06 23:24:18 +02:00
|
|
|
};
|
|
|
|
|
2017-10-31 14:03:45 +01:00
|
|
|
uint8 corners = (((tileElement->properties.path.edges >> 4) << get_current_rotation()) & 0xF) |
|
|
|
|
(((tileElement->properties.path.edges >> 4) << get_current_rotation()) >> 4);
|
2017-06-06 23:24:18 +02:00
|
|
|
|
|
|
|
uint16 edi = edges | (corners << 4);
|
|
|
|
|
|
|
|
uint32 imageId;
|
2017-10-31 14:03:45 +01:00
|
|
|
if (footpath_element_is_sloped(tileElement)) {
|
2018-01-03 10:57:37 +01:00
|
|
|
imageId = ((footpath_element_get_slope_direction(tileElement) + get_current_rotation()) & 3) + 16;
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
imageId = byte_98D6E0[edi];
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
imageId += footpathEntry->image;
|
2017-10-31 14:03:45 +01:00
|
|
|
if (footpath_element_is_queue(tileElement)) {
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId += 51;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Below Surface
|
2017-09-02 23:31:39 +02:00
|
|
|
if (!session->DidPassSurface) {
|
2017-06-06 23:24:18 +02:00
|
|
|
boundBoxOffset.x = 3;
|
|
|
|
boundBoxOffset.y = 3;
|
|
|
|
boundBoxSize.x = 26;
|
|
|
|
boundBoxSize.y = 26;
|
|
|
|
}
|
|
|
|
|
2017-10-11 18:16:25 +02:00
|
|
|
// By default, add 1 to the z bounding box to always clip above the surface
|
|
|
|
uint8 boundingBoxZOffset = 1;
|
|
|
|
|
|
|
|
// If we are on the same tile as a straight track, add the offset 2 so we
|
|
|
|
// can clip above gravel part of the track sprite
|
|
|
|
if (session->TrackElementOnSameHeight)
|
|
|
|
{
|
|
|
|
if (session->TrackElementOnSameHeight->properties.track.type == TRACK_ELEM_FLAT)
|
|
|
|
{
|
|
|
|
boundingBoxZOffset = 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-09-02 23:31:39 +02:00
|
|
|
if (!hasFences || !session->DidPassSurface) {
|
2017-10-11 18:16:25 +02:00
|
|
|
sub_98197C(session, imageId | imageFlags, 0, 0, boundBoxSize.x, boundBoxSize.y, 0, height, boundBoxOffset.x, boundBoxOffset.y, height + boundingBoxZOffset, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
uint32 bridgeImage;
|
2017-10-31 14:03:45 +01:00
|
|
|
if (footpath_element_is_sloped(tileElement)) {
|
2018-01-03 10:57:37 +01:00
|
|
|
bridgeImage = ((footpath_element_get_slope_direction(tileElement) + get_current_rotation()) & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK) + footpathEntry->bridge_image + 16;
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
bridgeImage = edges + footpathEntry->bridge_image;
|
|
|
|
bridgeImage |= imageFlags;
|
|
|
|
}
|
|
|
|
|
2017-10-11 18:16:25 +02:00
|
|
|
sub_98197C(session, bridgeImage | imageFlags, 0, 0, boundBoxSize.x, boundBoxSize.y, 0, height, boundBoxOffset.x, boundBoxOffset.y, height + boundingBoxZOffset, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
|
2017-10-31 14:03:45 +01:00
|
|
|
if (footpath_element_is_queue(tileElement) || (footpathEntry->flags & FOOTPATH_ENTRY_FLAG_HAS_PATH_BASE_SPRITE)) {
|
2017-10-11 18:16:25 +02:00
|
|
|
sub_98199C(session, imageId | imageFlags, 0, 0, boundBoxSize.x, boundBoxSize.y, 0, height, boundBoxOffset.x, boundBoxOffset.y, height + boundingBoxZOffset, get_current_rotation());
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-10-31 14:03:45 +01:00
|
|
|
sub_6A3F61(session, tileElement, edi, height, footpathEntry, imageFlags, sceneryImageFlags, hasFences); // TODO: arguments
|
2017-06-06 23:24:18 +02:00
|
|
|
|
|
|
|
uint16 ax = 0;
|
2017-10-31 14:03:45 +01:00
|
|
|
if (footpath_element_is_sloped(tileElement)) {
|
2017-06-06 23:24:18 +02:00
|
|
|
ax = 8;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint8 supports[] = {
|
|
|
|
6,
|
|
|
|
8,
|
|
|
|
7,
|
|
|
|
5
|
|
|
|
};
|
|
|
|
|
|
|
|
for (sint8 i = 3; i > -1; --i) {
|
|
|
|
if (!(edges & (1 << i))) {
|
2017-09-03 02:04:23 +02:00
|
|
|
path_b_supports_paint_setup(session, supports[i], ax, height, imageFlags, footpathEntry);
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
height += 32;
|
2017-10-31 14:03:45 +01:00
|
|
|
if (footpath_element_is_sloped(tileElement)) {
|
2017-06-06 23:24:18 +02:00
|
|
|
height += 16;
|
|
|
|
}
|
|
|
|
|
2017-09-03 02:56:56 +02:00
|
|
|
paint_util_set_general_support_height(session, height, 0x20);
|
2017-06-06 23:24:18 +02:00
|
|
|
|
2017-10-31 14:03:45 +01:00
|
|
|
if (footpath_element_is_queue(tileElement)
|
|
|
|
|| (tileElement->properties.path.edges != 0xFF && hasFences)
|
2017-06-06 23:24:18 +02:00
|
|
|
) {
|
|
|
|
|
2017-09-03 02:56:56 +02:00
|
|
|
paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0);
|
2017-06-06 23:24:18 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2017-10-31 14:03:45 +01:00
|
|
|
if (tileElement->properties.path.edges == 0xFF) {
|
2017-09-03 02:56:56 +02:00
|
|
|
paint_util_set_segment_support_height(session, SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, 0xFFFF, 0);
|
2017-06-06 23:24:18 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2017-09-03 02:56:56 +02:00
|
|
|
paint_util_set_segment_support_height(session, SEGMENT_C4, 0xFFFF, 0);
|
2017-06-06 23:24:18 +02:00
|
|
|
|
2018-01-03 10:57:37 +01:00
|
|
|
if (edges & EDGE_NE) {
|
2017-09-03 02:56:56 +02:00
|
|
|
paint_util_set_segment_support_height(session, SEGMENT_CC, 0xFFFF, 0);
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
|
2018-01-03 10:57:37 +01:00
|
|
|
if (edges & EDGE_SE) {
|
2017-09-03 02:56:56 +02:00
|
|
|
paint_util_set_segment_support_height(session, SEGMENT_D4, 0xFFFF, 0);
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
|
2018-01-03 10:57:37 +01:00
|
|
|
if (edges & EDGE_SW) {
|
2017-09-03 02:56:56 +02:00
|
|
|
paint_util_set_segment_support_height(session, SEGMENT_D0, 0xFFFF, 0);
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
|
2018-01-03 10:57:37 +01:00
|
|
|
if (edges & EDGE_NW) {
|
2017-09-03 02:56:56 +02:00
|
|
|
paint_util_set_segment_support_height(session, SEGMENT_C8, 0xFFFF, 0);
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2016-06-15 23:31:13 +02:00
|
|
|
}
|