|
|
|
|
@@ -447,6 +447,18 @@ static constexpr const uint16_t word_97B3C4[] = {
|
|
|
|
|
};
|
|
|
|
|
// clang-format on
|
|
|
|
|
|
|
|
|
|
bool wooden_a_supports_paint_setup(
|
|
|
|
|
paint_session* session, int32_t supportType, int32_t special, int32_t height, uint32_t imageColourFlags)
|
|
|
|
|
{
|
|
|
|
|
return wooden_a_supports_paint_setup(session, supportType, special, height, ImageId::FromUInt32(imageColourFlags));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool wooden_b_supports_paint_setup(
|
|
|
|
|
paint_session* session, int32_t supportType, int32_t special, int32_t height, uint32_t imageColourFlags)
|
|
|
|
|
{
|
|
|
|
|
return wooden_a_supports_paint_setup(session, supportType, special, height, ImageId::FromUInt32(imageColourFlags));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Adds paint structs for wooden supports.
|
|
|
|
|
* rct2: 0x006629BC
|
|
|
|
|
@@ -458,7 +470,7 @@ static constexpr const uint16_t word_97B3C4[] = {
|
|
|
|
|
* @returns (al) true if any supports have been drawn, otherwise false.
|
|
|
|
|
*/
|
|
|
|
|
bool wooden_a_supports_paint_setup(
|
|
|
|
|
paint_session* session, int32_t supportType, int32_t special, int32_t height, uint32_t imageColourFlags)
|
|
|
|
|
paint_session* session, int32_t supportType, int32_t special, int32_t height, ImageId imageTemplate)
|
|
|
|
|
{
|
|
|
|
|
if (session->ViewFlags & VIEWPORT_FLAG_INVISIBLE_SUPPORTS)
|
|
|
|
|
{
|
|
|
|
|
@@ -497,18 +509,16 @@ bool wooden_a_supports_paint_setup(
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int32_t imageId = WoodenSupportImageIds[supportType].slope;
|
|
|
|
|
if (imageId == 0)
|
|
|
|
|
auto imageIndex = WoodenSupportImageIds[supportType].slope;
|
|
|
|
|
if (imageIndex == 0)
|
|
|
|
|
{
|
|
|
|
|
drawFlatPiece = true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
imageId += word_97B3C4[slope & TILE_ELEMENT_SURFACE_SLOPE_MASK];
|
|
|
|
|
imageId |= imageColourFlags;
|
|
|
|
|
auto imageId = imageTemplate.WithIndex(imageIndex + word_97B3C4[slope & TILE_ELEMENT_SURFACE_SLOPE_MASK]);
|
|
|
|
|
PaintAddImageAsParent(session, imageId, { 0, 0, z }, { 32, 32, 11 }, { 0, 0, z + 2 });
|
|
|
|
|
|
|
|
|
|
PaintAddImageAsParent(session, imageId + 4, { 0, 0, z + 16 }, { 32, 32, 11 }, { 0, 0, z + 16 + 2 });
|
|
|
|
|
PaintAddImageAsParent(session, imageId.WithIndexOffset(4), { 0, 0, z + 16 }, { 32, 32, 11 }, { 0, 0, z + 16 + 2 });
|
|
|
|
|
|
|
|
|
|
hasSupports = true;
|
|
|
|
|
}
|
|
|
|
|
@@ -523,16 +533,14 @@ bool wooden_a_supports_paint_setup(
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int32_t imageId = WoodenSupportImageIds[supportType].slope;
|
|
|
|
|
if (imageId == 0)
|
|
|
|
|
int32_t imageIndex = WoodenSupportImageIds[supportType].slope;
|
|
|
|
|
if (imageIndex == 0)
|
|
|
|
|
{
|
|
|
|
|
drawFlatPiece = true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
imageId += word_97B3C4[slope & TILE_ELEMENT_SURFACE_SLOPE_MASK];
|
|
|
|
|
imageId |= imageColourFlags;
|
|
|
|
|
|
|
|
|
|
auto imageId = imageTemplate.WithIndex(imageIndex + word_97B3C4[slope & TILE_ELEMENT_SURFACE_SLOPE_MASK]);
|
|
|
|
|
PaintAddImageAsParent(session, imageId, { 0, 0, z }, { 32, 32, 11 }, { 0, 0, z + 2 });
|
|
|
|
|
hasSupports = true;
|
|
|
|
|
}
|
|
|
|
|
@@ -542,7 +550,7 @@ bool wooden_a_supports_paint_setup(
|
|
|
|
|
// Draw flat base support
|
|
|
|
|
if (drawFlatPiece)
|
|
|
|
|
{
|
|
|
|
|
int32_t imageId = WoodenSupportImageIds[supportType].flat | imageColourFlags;
|
|
|
|
|
auto imageId = imageTemplate.WithIndex(WoodenSupportImageIds[supportType].flat);
|
|
|
|
|
PaintAddImageAsParent(session, imageId, { 0, 0, z - 2 }, { 32, 32, 0 });
|
|
|
|
|
hasSupports = true;
|
|
|
|
|
}
|
|
|
|
|
@@ -553,7 +561,7 @@ bool wooden_a_supports_paint_setup(
|
|
|
|
|
if ((z & 16) == 0 && height >= 2 && z + 16 != session->WaterHeight)
|
|
|
|
|
{
|
|
|
|
|
// Full support
|
|
|
|
|
int32_t imageId = WoodenSupportImageIds[supportType].full | imageColourFlags;
|
|
|
|
|
auto imageId = imageTemplate.WithIndex(WoodenSupportImageIds[supportType].full);
|
|
|
|
|
uint8_t ah = height == 2 ? 23 : 28;
|
|
|
|
|
PaintAddImageAsParent(session, imageId, { 0, 0, z }, { 32, 32, ah });
|
|
|
|
|
hasSupports = true;
|
|
|
|
|
@@ -563,7 +571,7 @@ bool wooden_a_supports_paint_setup(
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Half support
|
|
|
|
|
int32_t imageId = WoodenSupportImageIds[supportType].half | imageColourFlags;
|
|
|
|
|
auto imageId = imageTemplate.WithIndex(WoodenSupportImageIds[supportType].half);
|
|
|
|
|
uint8_t ah = height == 1 ? 7 : 12;
|
|
|
|
|
PaintAddImageAsParent(session, imageId, { 0, 0, z }, { 32, 32, ah });
|
|
|
|
|
hasSupports = true;
|
|
|
|
|
@@ -580,8 +588,7 @@ bool wooden_a_supports_paint_setup(
|
|
|
|
|
if (WoodenCurveSupportImageIds[supportType] != nullptr && WoodenCurveSupportImageIds[supportType][special] != 0
|
|
|
|
|
&& byte_97B23C[special].var_7 != 0)
|
|
|
|
|
{
|
|
|
|
|
uint32_t imageId = WoodenCurveSupportImageIds[supportType][special];
|
|
|
|
|
imageId |= imageColourFlags;
|
|
|
|
|
auto imageId = imageTemplate.WithIndex(WoodenCurveSupportImageIds[supportType][special]);
|
|
|
|
|
|
|
|
|
|
unk_supports_desc_bound_box bBox = byte_97B23C[special].bounding_box;
|
|
|
|
|
|
|
|
|
|
@@ -594,9 +601,8 @@ bool wooden_a_supports_paint_setup(
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
hasSupports = true;
|
|
|
|
|
paint_struct* ps = PaintAddImageAsOrphan(
|
|
|
|
|
session, ImageId::FromUInt32(imageId), { 0, 0, z }, bBox.length,
|
|
|
|
|
{ bBox.offset.x, bBox.offset.y, bBox.offset.z + z });
|
|
|
|
|
auto* ps = PaintAddImageAsOrphan(
|
|
|
|
|
session, imageId, { 0, 0, z }, bBox.length, { bBox.offset.x, bBox.offset.y, bBox.offset.z + z });
|
|
|
|
|
if (ps != nullptr)
|
|
|
|
|
{
|
|
|
|
|
session->WoodenSupportsPrependTo->children = ps;
|
|
|
|
|
@@ -621,7 +627,7 @@ bool wooden_a_supports_paint_setup(
|
|
|
|
|
* @return (al) whether supports have been drawn
|
|
|
|
|
*/
|
|
|
|
|
bool wooden_b_supports_paint_setup(
|
|
|
|
|
paint_session* session, int32_t supportType, int32_t special, int32_t height, uint32_t imageColourFlags)
|
|
|
|
|
paint_session* session, int32_t supportType, int32_t special, int32_t height, ImageId imageTemplate)
|
|
|
|
|
{
|
|
|
|
|
bool _9E32B1 = false;
|
|
|
|
|
|
|
|
|
|
@@ -659,22 +665,22 @@ bool wooden_b_supports_paint_setup(
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t imageId = WoodenSupportImageIds[supportType].slope;
|
|
|
|
|
if (imageId == 0)
|
|
|
|
|
uint32_t imageIndex = WoodenSupportImageIds[supportType].slope;
|
|
|
|
|
if (imageIndex == 0)
|
|
|
|
|
{
|
|
|
|
|
baseHeight += 32;
|
|
|
|
|
goTo662E8B = true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
imageId += word_97B3C4[session->Support.slope & TILE_ELEMENT_SURFACE_SLOPE_MASK];
|
|
|
|
|
auto imageid = imageTemplate.WithIndex(
|
|
|
|
|
imageIndex + word_97B3C4[session->Support.slope & TILE_ELEMENT_SURFACE_SLOPE_MASK]);
|
|
|
|
|
|
|
|
|
|
PaintAddImageAsParent(
|
|
|
|
|
session, imageId | imageColourFlags, { 0, 0, baseHeight }, { 32, 32, 11 }, { 0, 0, baseHeight + 2 });
|
|
|
|
|
PaintAddImageAsParent(session, imageid, { 0, 0, baseHeight }, { 32, 32, 11 }, { 0, 0, baseHeight + 2 });
|
|
|
|
|
baseHeight += 16;
|
|
|
|
|
|
|
|
|
|
PaintAddImageAsParent(
|
|
|
|
|
session, (imageId + 4) | imageColourFlags, { 0, 0, baseHeight }, { 32, 32, 3 }, { 0, 0, baseHeight + 2 });
|
|
|
|
|
session, imageid.WithIndexOffset(4), { 0, 0, baseHeight }, { 32, 32, 3 }, { 0, 0, baseHeight + 2 });
|
|
|
|
|
baseHeight += 16;
|
|
|
|
|
|
|
|
|
|
_9E32B1 = true;
|
|
|
|
|
@@ -688,18 +694,18 @@ bool wooden_b_supports_paint_setup(
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t imageId = WoodenSupportImageIds[supportType].slope;
|
|
|
|
|
if (imageId == 0)
|
|
|
|
|
auto imageIndex = WoodenSupportImageIds[supportType].slope;
|
|
|
|
|
if (imageIndex == 0)
|
|
|
|
|
{
|
|
|
|
|
baseHeight += 16;
|
|
|
|
|
goTo662E8B = true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
imageId += word_97B3C4[session->Support.slope & TILE_ELEMENT_SURFACE_SLOPE_MASK];
|
|
|
|
|
auto imageId = imageTemplate.WithIndex(
|
|
|
|
|
imageIndex + word_97B3C4[session->Support.slope & TILE_ELEMENT_SURFACE_SLOPE_MASK]);
|
|
|
|
|
|
|
|
|
|
PaintAddImageAsParent(
|
|
|
|
|
session, imageId | imageColourFlags, { 0, 0, baseHeight }, { 32, 32, 3 }, { 0, 0, baseHeight + 2 });
|
|
|
|
|
PaintAddImageAsParent(session, imageId, { 0, 0, baseHeight }, { 32, 32, 3 }, { 0, 0, baseHeight + 2 });
|
|
|
|
|
baseHeight += 16;
|
|
|
|
|
|
|
|
|
|
_9E32B1 = true;
|
|
|
|
|
@@ -715,8 +721,8 @@ bool wooden_b_supports_paint_setup(
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
PaintAddImageAsParent(
|
|
|
|
|
session, WoodenSupportImageIds[supportType].flat | imageColourFlags, { 0, 0, baseHeight - 2 }, { 32, 32, 0 });
|
|
|
|
|
auto imageId = imageTemplate.WithIndex(WoodenSupportImageIds[supportType].flat);
|
|
|
|
|
PaintAddImageAsParent(session, imageId, { 0, 0, baseHeight - 2 }, { 32, 32, 0 });
|
|
|
|
|
_9E32B1 = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -727,18 +733,16 @@ bool wooden_b_supports_paint_setup(
|
|
|
|
|
{
|
|
|
|
|
if (baseHeight & 0x10 || heightSteps == 1 || baseHeight + 16 == session->WaterHeight)
|
|
|
|
|
{
|
|
|
|
|
PaintAddImageAsParent(
|
|
|
|
|
session, WoodenSupportImageIds[supportType].half | imageColourFlags, { 0, 0, baseHeight },
|
|
|
|
|
{ 32, 32, ((heightSteps == 1) ? 7 : 12) });
|
|
|
|
|
auto imageId = imageTemplate.WithIndex(WoodenSupportImageIds[supportType].half);
|
|
|
|
|
PaintAddImageAsParent(session, imageId, { 0, 0, baseHeight }, { 32, 32, ((heightSteps == 1) ? 7 : 12) });
|
|
|
|
|
heightSteps -= 1;
|
|
|
|
|
baseHeight += 16;
|
|
|
|
|
_9E32B1 = true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
PaintAddImageAsParent(
|
|
|
|
|
session, WoodenSupportImageIds[supportType].full | imageColourFlags, { 0, 0, baseHeight },
|
|
|
|
|
{ 32, 32, ((heightSteps == 2) ? 23 : 28) });
|
|
|
|
|
auto imageId = imageTemplate.WithIndex(WoodenSupportImageIds[supportType].full);
|
|
|
|
|
PaintAddImageAsParent(session, imageId, { 0, 0, baseHeight }, { 32, 32, ((heightSteps == 2) ? 23 : 28) });
|
|
|
|
|
heightSteps -= 2;
|
|
|
|
|
baseHeight += 32;
|
|
|
|
|
_9E32B1 = true;
|
|
|
|
|
@@ -755,22 +759,21 @@ bool wooden_b_supports_paint_setup(
|
|
|
|
|
if (WoodenCurveSupportImageIds[supportType] != nullptr && WoodenCurveSupportImageIds[supportType][specialIndex] != 0
|
|
|
|
|
&& supportsDesc.var_7 != 0)
|
|
|
|
|
{ // byte_97B23C[special].var_7 is never 0
|
|
|
|
|
uint32_t imageId = WoodenCurveSupportImageIds[supportType][specialIndex];
|
|
|
|
|
imageId |= imageColourFlags;
|
|
|
|
|
auto imageId = imageTemplate.WithIndex(WoodenCurveSupportImageIds[supportType][specialIndex]);
|
|
|
|
|
|
|
|
|
|
const unk_supports_desc_bound_box& boundBox = supportsDesc.bounding_box;
|
|
|
|
|
|
|
|
|
|
if (supportsDesc.var_6 == 0 || session->WoodenSupportsPrependTo == nullptr)
|
|
|
|
|
{
|
|
|
|
|
PaintAddImageAsParent(
|
|
|
|
|
session, imageId | imageColourFlags, { 0, 0, baseHeight }, boundBox.length,
|
|
|
|
|
session, imageId, { 0, 0, baseHeight }, boundBox.length,
|
|
|
|
|
{ boundBox.offset.x, boundBox.offset.y, boundBox.offset.z + baseHeight });
|
|
|
|
|
_9E32B1 = true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
paint_struct* paintStruct = PaintAddImageAsOrphan(
|
|
|
|
|
session, ImageId::FromUInt32(imageId | imageColourFlags), { 0, 0, baseHeight }, boundBox.length,
|
|
|
|
|
auto* paintStruct = PaintAddImageAsOrphan(
|
|
|
|
|
session, imageId, { 0, 0, baseHeight }, boundBox.length,
|
|
|
|
|
{ boundBox.offset.x, boundBox.offset.y, boundBox.offset.z + baseHeight });
|
|
|
|
|
_9E32B1 = true;
|
|
|
|
|
if (paintStruct != nullptr)
|
|
|
|
|
|