mirror of https://github.com/OpenRCT2/OpenRCT2.git
Remove Paint.cpp assertions
Before the refactor, the assertion read like this: ``` assert(static_cast<uint16_t>(bound_box_length_x) == static_cast<int16_t>(bound_box_length_x)); ``` which meant that bound_box_length_x = 0 was valid. The refactor (likely accidentally) changed this, which causes assertions to get hit within 2 seconds after opening on my machine. According to Duncan, the asserts are no longer necessary at all, so remove them altogether.
This commit is contained in:
parent
c6a7829554
commit
a38ae68f09
|
@ -801,9 +801,6 @@ paint_struct* PaintAddImageAsParent(
|
||||||
int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset, int32_t bound_box_offset_x,
|
int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset, int32_t bound_box_offset_x,
|
||||||
int32_t bound_box_offset_y, int32_t bound_box_offset_z)
|
int32_t bound_box_offset_y, int32_t bound_box_offset_z)
|
||||||
{
|
{
|
||||||
assert(bound_box_length_x > 0);
|
|
||||||
assert(bound_box_length_y > 0);
|
|
||||||
|
|
||||||
session->LastPS = nullptr;
|
session->LastPS = nullptr;
|
||||||
session->LastAttachedPS = nullptr;
|
session->LastAttachedPS = nullptr;
|
||||||
|
|
||||||
|
@ -863,8 +860,6 @@ paint_struct* PaintAddImageAsChild(
|
||||||
int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset, int32_t bound_box_offset_x,
|
int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset, int32_t bound_box_offset_x,
|
||||||
int32_t bound_box_offset_y, int32_t bound_box_offset_z)
|
int32_t bound_box_offset_y, int32_t bound_box_offset_z)
|
||||||
{
|
{
|
||||||
assert(bound_box_length_x > 0);
|
|
||||||
assert(bound_box_length_y > 0);
|
|
||||||
return PaintAddImageAsChild(
|
return PaintAddImageAsChild(
|
||||||
session, image_id, { x_offset, y_offset, z_offset }, { bound_box_length_x, bound_box_length_y, bound_box_length_z },
|
session, image_id, { x_offset, y_offset, z_offset }, { bound_box_length_x, bound_box_length_y, bound_box_length_z },
|
||||||
{ bound_box_offset_x, bound_box_offset_y, bound_box_offset_z });
|
{ bound_box_offset_x, bound_box_offset_y, bound_box_offset_z });
|
||||||
|
|
Loading…
Reference in New Issue