1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-23 15:52:55 +01:00

Create PaintAddImageAsParentRotated() function that takes a BoundBoxXYZ

This commit is contained in:
Gymnasiast
2023-02-13 19:59:30 +01:00
parent 0383875692
commit 04f2479c34
2 changed files with 20 additions and 22 deletions

View File

@@ -310,12 +310,24 @@ PaintStruct* PaintAddImageAsChild(
PaintStruct* PaintAddImageAsChildRotated(
PaintSession& session, const uint8_t direction, const ImageId image_id, const CoordsXYZ& offset,
const CoordsXYZ& boundBoxSize, const CoordsXYZ& boundBoxOffset);
PaintStruct* PaintAddImageAsParentRotated(
PaintSession& session, const uint8_t direction, const ImageId image_id, const CoordsXYZ& offset,
const CoordsXYZ& boundBoxSize);
PaintStruct* PaintAddImageAsParentRotated(
PaintSession& session, const uint8_t direction, const ImageId imageId, const CoordsXYZ& offset,
const CoordsXYZ& boundBoxSize, const CoordsXYZ& boundBoxOffset);
const BoundBoxXYZ& boundBox);
inline PaintStruct* PaintAddImageAsParentRotated(
PaintSession& session, const uint8_t direction, const ImageId imageId, const CoordsXYZ& offset,
const CoordsXYZ& boundBoxSize, const CoordsXYZ& boundBoxOffset)
{
return PaintAddImageAsParentRotated(session, direction, imageId, offset, { boundBoxOffset, boundBoxSize });
}
inline PaintStruct* PaintAddImageAsParentRotated(
PaintSession& session, const uint8_t direction, const ImageId imageId, const CoordsXYZ& offset,
const CoordsXYZ& boundBoxSize)
{
return PaintAddImageAsParentRotated(session, direction, imageId, offset, { offset, boundBoxSize });
}
void PaintUtilPushTunnelRotated(PaintSession& session, uint8_t direction, uint16_t height, uint8_t type);

View File

@@ -12,30 +12,16 @@
#include "Paint.h"
PaintStruct* PaintAddImageAsParentRotated(
PaintSession& session, const uint8_t direction, const ImageId imageId, const CoordsXYZ& offset,
const CoordsXYZ& boundBoxSize, const CoordsXYZ& boundBoxOffset)
PaintSession& session, const uint8_t direction, const ImageId imageId, const CoordsXYZ& offset, const BoundBoxXYZ& boundBox)
{
if (direction & 1)
{
return PaintAddImageAsParent(
session, imageId, { offset.y, offset.x, offset.z }, { boundBoxSize.y, boundBoxSize.x, boundBoxSize.z },
{ boundBoxOffset.y, boundBoxOffset.x, boundBoxOffset.z });
session, imageId, { offset.y, offset.x, offset.z }, { boundBox.length.y, boundBox.length.x, boundBox.length.z },
{ boundBox.offset.y, boundBox.offset.x, boundBox.offset.z });
}
return PaintAddImageAsParent(session, imageId, offset, boundBoxSize, boundBoxOffset);
}
PaintStruct* PaintAddImageAsParentRotated(
PaintSession& session, const uint8_t direction, const ImageId image_id, const CoordsXYZ& offset,
const CoordsXYZ& boundBoxSize)
{
if (direction & 1)
{
return PaintAddImageAsParent(
session, image_id, { offset.y, offset.x, offset.z }, { boundBoxSize.y, boundBoxSize.x, boundBoxSize.z });
}
return PaintAddImageAsParent(session, image_id, offset, boundBoxSize);
return PaintAddImageAsParent(session, imageId, offset, boundBox.length, boundBox.offset);
}
PaintStruct* PaintAddImageAsChildRotated(