Fix prepended wooden supports

This commit is contained in:
Marijn van der Werf authored and Michael Steenbeek committed 2016-12-19 18:45:08 +01:00
1 parent 77eea325ae
commit 2fca2adbc1
13 files changed
+133 -81

No files matched your search

+4 -4
View File
@@ -222,7 +222,7 @@ typedef struct unk_supports_desc_bound_box {
uint8 x, y, z;
} offset;
struct {
uint8 y, x, z;
uint8 x, y, z;
} length;
} unk_supports_desc_bound_box;
@@ -436,7 +436,7 @@ bool wooden_a_supports_paint_setup(int supportType, int special, int height, uin
if ((z & 16) == 0 && height >= 2 && z + 16 != gUnk141E9DC) {
// Full support
int imageId = WoodenSupportImageIds[supportType].full | imageColourFlags;
uint8 ah = special == 2 ? 23 : 28;
uint8 ah = height == 2 ? 23 : 28;
sub_98196C(imageId, 0, 0, 32, 32, ah, z, rotation);
hasSupports = true;
z += 32;
@@ -444,7 +444,7 @@ bool wooden_a_supports_paint_setup(int supportType, int special, int height, uin
} else {
// Half support
int imageId = WoodenSupportImageIds[supportType].half | imageColourFlags;
uint8 ah = special == 1 ? 7 : 12;
uint8 ah = height == 1 ? 7 : 12;
sub_98196C(imageId, 0, 0, 32, 32, ah, z, rotation);
hasSupports = true;
z += 16;
@@ -651,7 +651,7 @@ bool wooden_b_supports_paint_setup(int supportType, int special, int height, uin
sub_98197C(
imageId | imageColourFlags,
0, 0,
boundBox.length.y, boundBox.length.x, boundBox.length.z,
boundBox.length.x, boundBox.length.y, boundBox.length.z,
baseHeight,
boundBox.offset.x, boundBox.offset.y, boundBox.offset.z + baseHeight,
get_current_rotation()
+3
View File
@@ -63,6 +63,9 @@ bool rct2_interop_setup_segment()
// in some configurations err and len may be unused
UNUSED(err);
UNUSED(len);
#if !defined(NO_RCT2)
UNUSED(segments);
#endif
#if defined(USE_MMAP) && (defined(__unix__) || defined(__MACOSX__)) && !defined(NO_RCT2)
#define RDATA_OFFSET 0x004A4000
#define DATASEG_OFFSET 0x005E2000
+12 -12
View File
@@ -161,12 +161,12 @@ static void heartline_twister_rc_track_60_deg_up(uint8 rideIndex, uint8 trackSeq
wooden_a_supports_paint_setup(6, 21, height, gTrackColours[SCHEME_SUPPORTS], NULL);
break;
case 1:
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21403, 0, 0, 32, 20, 2, height, 0, 6, height);
gWoodenSupportsPrependTo = sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21403, 0, 0, 32, 20, 2, height, 0, 6, height);
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21407, 0, 0, 32, 1, 98, height, 0, 27, height);
wooden_a_supports_paint_setup(7, 22, height, gTrackColours[SCHEME_SUPPORTS], NULL);
break;
case 2:
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21404, 0, 0, 32, 20, 2, height, 0, 6, height);
gWoodenSupportsPrependTo = sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21404, 0, 0, 32, 20, 2, height, 0, 6, height);
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21408, 0, 0, 32, 1, 98, height, 0, 27, height);
wooden_a_supports_paint_setup(6, 23, height, gTrackColours[SCHEME_SUPPORTS], NULL);
break;
@@ -184,12 +184,12 @@ static void heartline_twister_rc_track_60_deg_up(uint8 rideIndex, uint8 trackSeq
wooden_a_supports_paint_setup(6, 21, height, gTrackColours[SCHEME_SUPPORTS], NULL);
break;
case 1:
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21347, 0, 0, 32, 20, 2, height, 0, 6, height);
gWoodenSupportsPrependTo = sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21347, 0, 0, 32, 20, 2, height, 0, 6, height);
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21351, 0, 0, 32, 1, 98, height, 0, 27, height);
wooden_a_supports_paint_setup(7, 22, height, gTrackColours[SCHEME_SUPPORTS], NULL);
break;
case 2:
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21348, 0, 0, 32, 20, 2, height, 0, 6, height);
gWoodenSupportsPrependTo = sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21348, 0, 0, 32, 20, 2, height, 0, 6, height);
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21352, 0, 0, 32, 1, 98, height, 0, 27, height);
wooden_a_supports_paint_setup(6, 23, height, gTrackColours[SCHEME_SUPPORTS], NULL);
break;
@@ -279,12 +279,12 @@ static void heartline_twister_rc_track_25_deg_up_to_60_deg_up(uint8 rideIndex, u
wooden_a_supports_paint_setup(6, 13, height, gTrackColours[SCHEME_SUPPORTS], NULL);
break;
case 1:
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21387, 0, 0, 32, 20, 2, height, 0, 6, height);
gWoodenSupportsPrependTo = sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21387, 0, 0, 32, 20, 2, height, 0, 6, height);
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21391, 0, 0, 32, 1, 66, height, 0, 27, height);
wooden_a_supports_paint_setup(7, 14, height, gTrackColours[SCHEME_SUPPORTS], NULL);
break;
case 2:
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21388, 0, 0, 32, 20, 2, height, 0, 6, height);
gWoodenSupportsPrependTo = sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21388, 0, 0, 32, 20, 2, height, 0, 6, height);
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21392, 0, 0, 32, 1, 66, height, 0, 27, height);
wooden_a_supports_paint_setup(6, 15, height, gTrackColours[SCHEME_SUPPORTS], NULL);
break;
@@ -302,12 +302,12 @@ static void heartline_twister_rc_track_25_deg_up_to_60_deg_up(uint8 rideIndex, u
wooden_a_supports_paint_setup(6, 13, height, gTrackColours[SCHEME_SUPPORTS], NULL);
break;
case 1:
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21331, 0, 0, 32, 20, 2, height, 0, 6, height);
gWoodenSupportsPrependTo = sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21331, 0, 0, 32, 20, 2, height, 0, 6, height);
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21335, 0, 0, 32, 1, 66, height, 0, 27, height);
wooden_a_supports_paint_setup(7, 14, height, gTrackColours[SCHEME_SUPPORTS], NULL);
break;
case 2:
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21332, 0, 0, 32, 20, 2, height, 0, 6, height);
gWoodenSupportsPrependTo = sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21332, 0, 0, 32, 20, 2, height, 0, 6, height);
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21336, 0, 0, 32, 1, 66, height, 0, 27, height);
wooden_a_supports_paint_setup(6, 15, height, gTrackColours[SCHEME_SUPPORTS], NULL);
break;
@@ -338,12 +338,12 @@ static void heartline_twister_rc_track_60_deg_up_to_25_deg_up(uint8 rideIndex, u
wooden_a_supports_paint_setup(6, 17, height, gTrackColours[SCHEME_SUPPORTS], NULL);
break;
case 1:
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21395, 0, 0, 32, 20, 2, height, 0, 6, height);
gWoodenSupportsPrependTo = sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21395, 0, 0, 32, 20, 2, height, 0, 6, height);
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21399, 0, 0, 32, 1, 66, height, 0, 27, height);
wooden_a_supports_paint_setup(7, 18, height, gTrackColours[SCHEME_SUPPORTS], NULL);
break;
case 2:
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21396, 0, 0, 32, 20, 2, height, 0, 6, height);
gWoodenSupportsPrependTo = sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21396, 0, 0, 32, 20, 2, height, 0, 6, height);
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21400, 0, 0, 32, 1, 66, height, 0, 27, height);
wooden_a_supports_paint_setup(6, 19, height, gTrackColours[SCHEME_SUPPORTS], NULL);
break;
@@ -361,12 +361,12 @@ static void heartline_twister_rc_track_60_deg_up_to_25_deg_up(uint8 rideIndex, u
wooden_a_supports_paint_setup(6, 17, height, gTrackColours[SCHEME_SUPPORTS], NULL);
break;
case 1:
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21339, 0, 0, 32, 20, 2, height, 0, 6, height);
gWoodenSupportsPrependTo = sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21339, 0, 0, 32, 20, 2, height, 0, 6, height);
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21343, 0, 0, 32, 1, 66, height, 0, 27, height);
wooden_a_supports_paint_setup(7, 18, height, gTrackColours[SCHEME_SUPPORTS], NULL);
break;
case 2:
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21340, 0, 0, 32, 20, 2, height, 0, 6, height);
gWoodenSupportsPrependTo = sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21340, 0, 0, 32, 20, 2, height, 0, 6, height);
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21344, 0, 0, 32, 1, 66, height, 0, 27, height);
wooden_a_supports_paint_setup(6, 19, height, gTrackColours[SCHEME_SUPPORTS], NULL);
break;
+6 -6
View File
@@ -150,11 +150,11 @@ static void mine_train_rc_track_60_deg_up(uint8 rideIndex, uint8 trackSequence,
wooden_a_supports_paint_setup(6, 21, height, gTrackColours[SCHEME_SUPPORTS], NULL);
break;
case 1:
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20091, 0, 0, 1, 32, 98, height, 27, 0, height);
gWoodenSupportsPrependTo = sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20091, 0, 0, 1, 32, 98, height, 27, 0, height);
wooden_a_supports_paint_setup(7, 22, height, gTrackColours[SCHEME_SUPPORTS], NULL);
break;
case 2:
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20092, 0, 0, 1, 32, 98, height, 27, 0, height);
gWoodenSupportsPrependTo = sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20092, 0, 0, 1, 32, 98, height, 27, 0, height);
wooden_a_supports_paint_setup(6, 23, height, gTrackColours[SCHEME_SUPPORTS], NULL);
break;
case 3:
@@ -231,12 +231,12 @@ static void mine_train_rc_track_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 tr
wooden_a_supports_paint_setup(6, 13, height, gTrackColours[SCHEME_SUPPORTS], NULL);
break;
case 1:
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20079, 0, 0, 32, 20, 1, height, 0, 6, height);
gWoodenSupportsPrependTo = sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20079, 0, 0, 32, 20, 1, height, 0, 6, height);
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20082, 0, 0, 32, 1, 66, height, 0, 27, height);
wooden_a_supports_paint_setup(7, 14, height, gTrackColours[SCHEME_SUPPORTS], NULL);
break;
case 2:
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20080, 0, 0, 32, 20, 1, height, 0, 6, height);
gWoodenSupportsPrependTo = sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20080, 0, 0, 32, 20, 1, height, 0, 6, height);
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20083, 0, 0, 32, 1, 66, height, 0, 27, height);
wooden_a_supports_paint_setup(6, 15, height, gTrackColours[SCHEME_SUPPORTS], NULL);
break;
@@ -263,12 +263,12 @@ static void mine_train_rc_track_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 tr
wooden_a_supports_paint_setup(6, 17, height, gTrackColours[SCHEME_SUPPORTS], NULL);
break;
case 1:
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20085, 0, 0, 24, 1, 61, height, 4, 29, height - 16);
gWoodenSupportsPrependTo = sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20085, 0, 0, 24, 1, 61, height, 4, 29, height - 16);
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20088, 0, 0, 32, 2, 66, height, 0, 4, height);
wooden_a_supports_paint_setup(7, 18, height, gTrackColours[SCHEME_SUPPORTS], NULL);
break;
case 2:
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20086, 0, 0, 24, 1, 61, height, 4, 29, height - 16);
gWoodenSupportsPrependTo = sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20086, 0, 0, 24, 1, 61, height, 4, 29, height - 16);
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20089, 0, 0, 32, 2, 66, height, 0, 4, height);
wooden_a_supports_paint_setup(6, 19, height, gTrackColours[SCHEME_SUPPORTS], NULL);
break;
+5 -5
View File
@@ -405,7 +405,7 @@ static uint32 wooden_rc_get_rails_colour()
return gTrackColours[SCHEME_TRACK];
}
static void wooden_rc_track_paint(
static paint_struct * wooden_rc_track_paint(
uint32 imageIdTrack,
uint32 imageIdRails,
uint8 direction,
@@ -418,7 +418,7 @@ static void wooden_rc_track_paint(
uint32 railsImageId = imageIdRails | wooden_rc_get_rails_colour();
sub_98197C_rotated(direction, imageId, x_offset, y_offset, bound_box_length_x, bound_box_length_y, bound_box_length_z, z_offset, bound_box_offset_x, bound_box_offset_y, bound_box_offset_z);
sub_98199C_rotated(direction, railsImageId, x_offset, y_offset, bound_box_length_x, bound_box_length_y, bound_box_length_z, z_offset, bound_box_offset_x, bound_box_offset_y, bound_box_offset_z);
return sub_98199C_rotated(direction, railsImageId, x_offset, y_offset, bound_box_length_x, bound_box_length_y, bound_box_length_z, z_offset, bound_box_offset_x, bound_box_offset_y, bound_box_offset_z);
}
static void wooden_rc_track_paint_bb(const sprite_bb_2 *bb, sint16 height)
@@ -530,7 +530,7 @@ static void wooden_rc_track_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint
if (direction == 0 || direction == 3) {
wooden_rc_track_paint(imageIds[direction][0], imageIds[direction][1], direction, 0, 0, 32, 25, 2, height, 0, 3, height);
} else {
wooden_rc_track_paint(imageIds[direction][0], imageIds[direction][1], direction, 0, 0, 2, 24, 93, height, 28, 4, height - 16);
gWoodenSupportsPrependTo = wooden_rc_track_paint(imageIds[direction][0], imageIds[direction][1], direction, 0, 0, 2, 24, 93, height, 28, 4, height - 16);
}
wooden_a_supports_paint_setup(direction & 1, 21 + direction, height, gTrackColours[SCHEME_SUPPORTS], NULL);
@@ -592,7 +592,7 @@ static void wooden_rc_track_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackS
if (direction == 0 || direction == 3) {
wooden_rc_track_paint(imageIds[direction][0], imageIds[direction][1], direction, 0, 0, 32, 25, 2, height, 0, 3, height);
} else {
wooden_rc_track_paint(imageIds[direction][0], imageIds[direction][1], direction, 0, 0, 2, 24, 43, height, 28, 4, height + 2);
gWoodenSupportsPrependTo = wooden_rc_track_paint(imageIds[direction][0], imageIds[direction][1], direction, 0, 0, 2, 24, 43, height, 28, 4, height + 2);
wooden_rc_track_paint(imageIds[direction][2], imageIds[direction][3], direction, 0, 0, 32, 2, 43, height, 0, 4, height);
}
wooden_a_supports_paint_setup(direction & 1, 13 + direction, height, gTrackColours[SCHEME_SUPPORTS], NULL);
@@ -620,7 +620,7 @@ static void wooden_rc_track_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackS
if (direction == 0 || direction == 3) {
wooden_rc_track_paint(imageIds[direction][0], imageIds[direction][1], direction, 0, 0, 32, 25, 2, height, 0, 3, height);
} else {
wooden_rc_track_paint(imageIds[direction][0], imageIds[direction][1], direction, 0, 0, 24, 1, 61, height, 4, 28, height - 16);
gWoodenSupportsPrependTo = wooden_rc_track_paint(imageIds[direction][0], imageIds[direction][1], direction, 0, 0, 24, 1, 61, height, 4, 28, height - 16);
wooden_rc_track_paint(imageIds[direction][2], imageIds[direction][3], direction, 0, 0, 32, 2, 43, height, 0, 4, height);
}
wooden_a_supports_paint_setup(direction & 1, 17 + direction, height, gTrackColours[SCHEME_SUPPORTS], NULL);
+3 -3
View File
@@ -221,7 +221,7 @@ static void wooden_wild_mouse_track_60_deg_up(uint8 rideIndex, uint8 trackSequen
if (direction == 0 || direction == 3) {
sub_98197C_rotated(direction, imageId, 0, 2, 32, 25, 1, height, 0, 3, height);
} else {
sub_98197C_rotated(direction, imageId, 0, 6, 2, 24, 93, height, 28, 4, height - 16);
gWoodenSupportsPrependTo = sub_98197C_rotated(direction, imageId, 0, 6, 2, 24, 93, height, 28, 4, height - 16);
}
wooden_a_supports_paint_setup(direction & 1, 21 + direction, height, gTrackColours[SCHEME_SUPPORTS], NULL);
@@ -295,7 +295,7 @@ static void wooden_wild_mouse_track_25_deg_up_to_60_deg_up(uint8 rideIndex, uint
sub_98197C_rotated(direction, imageId, 0, 2, 32, 25, 1, height, 0, 3, height);
} else {
imageId = imageIds[isChained][direction][0] | gTrackColours[SCHEME_TRACK];
sub_98197C_rotated(direction, imageId, 0, 6, 2, 24, 43, height, 28, 4, height + 2);
gWoodenSupportsPrependTo = sub_98197C_rotated(direction, imageId, 0, 6, 2, 24, 43, height, 28, 4, height + 2);
imageId = imageIds[isChained][direction][1] | gTrackColours[SCHEME_TRACK];
sub_98197C_rotated(direction, imageId, 0, 6, 32, 2, 43, height, 0, 4, height);
}
@@ -336,7 +336,7 @@ static void wooden_wild_mouse_track_60_deg_to_25_deg_up(uint8 rideIndex, uint8 t
sub_98197C_rotated(direction, imageId, 0, 2, 32, 25, 1, height, 0, 3, height);
} else {
imageId = imageIds[isChained][direction][0] | gTrackColours[SCHEME_TRACK];
sub_98197C_rotated(direction, imageId, 0, 6, 2, 24, 43, height, 28, 4, height + 2);
gWoodenSupportsPrependTo = sub_98197C_rotated(direction, imageId, 0, 6, 2, 24, 43, height, 28, 4, height + 2);
imageId = imageIds[isChained][direction][1] | gTrackColours[SCHEME_TRACK];
sub_98197C_rotated(direction, imageId, 0, 6, 32, 2, 43, height, 0, 4, height);
}
+6 -12
View File
@@ -171,10 +171,6 @@ static void paint_go_karts_track_25_deg_up(uint8 rideIndex, uint8 trackSequence,
ps = sub_98197C(imageId, 0, 0, 28, 32, 1, height, 2, 0, height, get_current_rotation());
}
if (direction == 1 || direction == 2) {
gWoodenSupportsPrependTo = ps;
}
imageId = go_karts_track_pieces_25_deg_up[direction][1] | gTrackColours[SCHEME_TRACK];
if (direction == 0 || direction == 2) {
sub_98197C(imageId, 0, 0, 32, 1, 11, height, 0, 29, height + 2, get_current_rotation());
@@ -182,6 +178,8 @@ static void paint_go_karts_track_25_deg_up(uint8 rideIndex, uint8 trackSequence,
sub_98197C(imageId, 0, 0, 1, 32, 11, height, 29, 0, height + 2, get_current_rotation());
}
gWoodenSupportsPrependTo = ps;
switch (direction) {
case 0:
wooden_a_supports_paint_setup(0, 9, height, gTrackColours[SCHEME_SUPPORTS], NULL);
@@ -218,10 +216,6 @@ static void paint_go_karts_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackS
ps = sub_98197C(imageId, 0, 0, 28, 32, 1, height, 2, 0, height, get_current_rotation());
}
if (direction == 1 || direction == 2) {
gWoodenSupportsPrependTo = ps;
}
imageId = go_karts_track_pieces_flat_to_25_deg_up[direction][1] | gTrackColours[SCHEME_TRACK];
if (direction == 0 || direction == 2) {
sub_98197C(imageId, 0, 0, 32, 1, 11, height, 0, 29, height + 2, get_current_rotation());
@@ -229,6 +223,8 @@ static void paint_go_karts_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackS
sub_98197C(imageId, 0, 0, 1, 32, 11, height, 29, 0, height + 2, get_current_rotation());
}
gWoodenSupportsPrependTo = ps;
switch (direction) {
case 0:
wooden_a_supports_paint_setup(0, 1, height, gTrackColours[SCHEME_SUPPORTS], NULL);
@@ -265,10 +261,6 @@ static void paint_go_karts_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackS
ps = sub_98197C(imageId, 0, 0, 28, 32, 1, height, 2, 0, height, get_current_rotation());
}
if (direction == 1 || direction == 2) {
gWoodenSupportsPrependTo = ps;
}
imageId = go_karts_track_pieces_25_deg_up_to_flat[direction][1] | gTrackColours[SCHEME_TRACK];
if (direction == 0 || direction == 2) {
sub_98197C(imageId, 0, 0, 32, 1, 11, height, 0, 29, height + 2, get_current_rotation());
@@ -276,6 +268,8 @@ static void paint_go_karts_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackS
sub_98197C(imageId, 0, 0, 1, 32, 11, height, 29, 0, height + 2, get_current_rotation());
}
gWoodenSupportsPrependTo = ps;
switch (direction) {
case 0:
wooden_a_supports_paint_setup(0, 5, height, gTrackColours[SCHEME_SUPPORTS], NULL);
+3 -3
View File
@@ -254,7 +254,7 @@ static void paint_splash_boats_track_60_deg_up(uint8 rideIndex, uint8 trackSeque
uint32 imageId = SplashBoats60DegUpImageId[direction] | gTrackColours[SCHEME_TRACK];
uint32 frontImageId = SplashBoats60DegUpFrontImageId[direction] | gTrackColours[SCHEME_TRACK];
sub_98197C_rotated(direction, imageId, 0, 0, 32, 20, 2, height, 0, 6, height);
gWoodenSupportsPrependTo = sub_98197C_rotated(direction, imageId, 0, 0, 32, 20, 2, height, 0, 6, height);
sub_98197C_rotated(direction, frontImageId, 0, 0, 32, 1, 98, height, 0, 27, height);
wooden_a_supports_paint_setup((direction & 1), 21 + direction, height, gTrackColours[SCHEME_SUPPORTS], NULL);
@@ -311,7 +311,7 @@ static void paint_splash_boats_track_25_deg_up_to_60_deg_up(uint8 rideIndex, uin
uint32 imageId = SplashBoats25DegUpTo60DegUpImageId[direction] | gTrackColours[SCHEME_TRACK];
uint32 frontImageId = SplashBoats25DegUpTo60DegUpFrontImageId[direction] | gTrackColours[SCHEME_TRACK];
sub_98197C_rotated(direction, imageId, 0, 0, 32, 20, 2, height, 0, 6, height);
gWoodenSupportsPrependTo = sub_98197C_rotated(direction, imageId, 0, 0, 32, 20, 2, height, 0, 6, height);
sub_98197C_rotated(direction, frontImageId, 0, 0, 32, 1, 66, height, 0, 27, height);
wooden_a_supports_paint_setup((direction & 1), 13 + direction, height, gTrackColours[SCHEME_SUPPORTS], NULL);
@@ -330,7 +330,7 @@ static void paint_splash_boats_track_60_deg_up_to_25_deg_up(uint8 rideIndex, uin
uint32 imageId = SplashBoats60DegUpTo25DegUpImageId[direction] | gTrackColours[SCHEME_TRACK];
uint32 frontImageId = SplashBoats60DegUpTo25DegUpFrontImageId[direction] | gTrackColours[SCHEME_TRACK];
sub_98197C_rotated(direction, imageId, 0, 0, 32, 20, 2, height, 0, 6, height);
gWoodenSupportsPrependTo = sub_98197C_rotated(direction, imageId, 0, 0, 32, 20, 2, height, 0, 6, height);
sub_98197C_rotated(direction, frontImageId, 0, 0, 32, 1, 66, height, 0, 27, height);
wooden_a_supports_paint_setup((direction & 1), 17 + direction, height, gTrackColours[SCHEME_SUPPORTS], NULL);
+11
View File
@@ -16,6 +16,10 @@
#include "FunctionCall.hpp"
extern "C" {
#include "../../src/sprites.h"
}
enum SpriteGroup {
SPRITEGROUP_NONE,
@@ -62,6 +66,13 @@ bool FunctionCall::AssertsEquals(function_call expected, function_call actual) {
if (expected.supports.height != actual.supports.height) return false;
if (expected.supports.colour_flags != actual.supports.colour_flags) return false;
if (expected.supports.special == 14 || expected.supports.special == 15 ||
expected.supports.special == 18 || expected.supports.special == 19 ||
expected.supports.special == 22 || expected.supports.special == 23)
{
if (expected.supports.prepend_to != actual.supports.prepend_to) return false;
}
return true;
}
+2
View File
@@ -45,6 +45,7 @@ typedef struct
sint16 z_offset;
rct_xyz16 bound_box_offset;
uint32 rotation;
paint_struct output_struct;
} paint;
struct supports
{
@@ -53,6 +54,7 @@ typedef struct
int special;
int height;
uint32 colour_flags;
sint32 prepend_to;
} supports;
} function_call;
+47 -35
View File
@@ -16,17 +16,20 @@
#include "PaintIntercept.hpp"
#include "FunctionCall.hpp"
extern "C" {
#include "../../src/common.h"
#include "../../src/rct2/hook.h"
#include "../../src/interface/viewport.h"
#include "../../src/paint/supports.h"
#include "../../src/sprites.h"
}
static bool _woodenSupports = false;
static uint8 _callCount = 0;
static function_call _calls[256] = {0};
static paint_struct _paintStructs = {0};
namespace PaintIntercept {
static uint8 InterceptWoodenASupports(registers *regs);
@@ -72,14 +75,26 @@ namespace PaintIntercept {
}
bool PaintWoodenSupports(uint8 function, int supportType, int special, int height, uint32 imageColourFlags, bool *underground) {
function_call call = {0};
call.function = function;
call.supports.type = supportType;
call.supports.special = special;
call.supports.height = height;
call.supports.colour_flags = imageColourFlags;
function_call * call = &_calls[_callCount];
call->function = function;
call->supports.type = supportType;
call->supports.special = special;
call->supports.height = height;
call->supports.colour_flags = imageColourFlags;
call->supports.prepend_to = SPR_NONE;
if (gWoodenSupportsPrependTo != nullptr)
{
for (int i = 0; i < _callCount; i++)
{
if (&_calls[i].paint.output_struct == gWoodenSupportsPrependTo)
{
call->supports.prepend_to = _calls[i].paint.image_id;
break;
}
}
}
_calls[_callCount] = call;
_callCount++;
return _woodenSupports;
@@ -88,15 +103,14 @@ namespace PaintIntercept {
bool PaintMetalSupports(uint8 function, int supportType, uint8 segment, int special, int height, uint32 imageColourFlags) {
CheckSegmentSupportHeight();
function_call call = {0};
call.function = function;
call.supports.type = supportType;
call.supports.segment = segment;
call.supports.special = special;
call.supports.height = height;
call.supports.colour_flags = imageColourFlags;
function_call * call = &_calls[_callCount];
call->function = function;
call->supports.type = supportType;
call->supports.segment = segment;
call->supports.special = special;
call->supports.height = height;
call->supports.colour_flags = imageColourFlags;
_calls[_callCount] = call;
_callCount++;
return false;
@@ -109,18 +123,17 @@ namespace PaintIntercept {
sint16 zOffset,
uint32 rotation
) {
function_call call = _calls[_callCount];
call.function = PAINT_98196C;
call.paint.image_id = imageID;
call.paint.offset = {xOffset, yOffset};
call.paint.bound_box_length = {boundBoxLengthX, boundBoxLengthY, boundBoxLengthZ};
call.paint.z_offset = zOffset;
call.paint.rotation = rotation;
function_call * call = &_calls[_callCount];
call->function = PAINT_98196C;
call->paint.image_id = imageID;
call->paint.offset = {xOffset, yOffset};
call->paint.bound_box_length = {boundBoxLengthX, boundBoxLengthY, boundBoxLengthZ};
call->paint.z_offset = zOffset;
call->paint.rotation = rotation;
_calls[_callCount] = call;
_callCount++;
return nullptr;
return &call->paint.output_struct;
}
static paint_struct *PaintFull(
@@ -132,19 +145,18 @@ namespace PaintIntercept {
sint16 boundBoxOffsetX, sint16 boundBoxOffsetY, sint16 boundBoxOffsetZ,
uint32 rotation
) {
function_call call = _calls[_callCount];
call.function = function;
call.paint.image_id = imageID;
call.paint.offset = {xOffset, yOffset};
call.paint.bound_box_length = {boundBoxLengthX, boundBoxLengthY, boundBoxLengthZ};
call.paint.bound_box_offset = {boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ};
call.paint.z_offset = zOffset;
call.paint.rotation = rotation;
function_call * call = &_calls[_callCount];
call->function = function;
call->paint.image_id = imageID;
call->paint.offset = {xOffset, yOffset};
call->paint.bound_box_length = {boundBoxLengthX, boundBoxLengthY, boundBoxLengthZ};
call->paint.bound_box_offset = {boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ};
call->paint.z_offset = zOffset;
call->paint.rotation = rotation;
_calls[_callCount] = call;
_callCount++;
return nullptr;
return &call->paint.output_struct;
}
void ClearCalls() {
@@ -241,7 +253,7 @@ namespace PaintIntercept {
}
regs->ebp = (int) out;
regs->al = 1;
regs->al = 1;
return 0;
}
+28 -1
View File
@@ -17,6 +17,11 @@
#include "Printer.hpp"
#include "String.hpp"
#include "../../src/core/Util.hpp"
#include "FunctionCall.hpp"
extern "C" {
#include "../../src/sprites.h"
}
namespace Printer {
@@ -55,14 +60,36 @@ namespace Printer {
std::string imageId = GetImageIdString(call.supports.colour_flags);
assert(call.function < Util::CountOf(functionNames));
const char *functionName = functionNames[call.function];
std::string out = "";
switch (call.function) {
case SUPPORTS_WOOD_A:
case SUPPORTS_WOOD_B:
return String::Format(
out += String::Format(
"%s(%d, %d, %s, %s)", functionName, call.supports.type, call.supports.special,
PrintHeightOffset(call.supports.height, baseHeight).c_str(), imageId.c_str()
);
if (call.supports.special == 14 ||
call.supports.special == 15 ||
call.supports.special == 18 ||
call.supports.special == 19 ||
call.supports.special == 22 ||
call.supports.special == 23)
{
if (call.supports.prepend_to == SPR_NONE)
{
out += " [prependTo:SPR_NONE]";
} else {
std::string prependId = GetImageIdString(call.supports.prepend_to);
out += String::Format(" [prependTo:%s]", prependId.c_str());
}
}
else if (call.supports.prepend_to != SPR_NONE)
{
std::string prependId = GetImageIdString(call.supports.prepend_to);
out += String::Format(" [prependTo:%s]", prependId.c_str());
}
return out;
case SUPPORTS_METAL_A:
case SUPPORTS_METAL_B:
+3
View File
@@ -30,6 +30,7 @@
#include "VerticalTunnelCall.hpp"
extern "C" {
#include "../../src/paint/supports.h"
#include "../../src/ride/ride.h"
#include "../../src/ride/track.h"
#include "../../src/ride/track_data.h"
@@ -347,6 +348,7 @@ static uint8 TestTrackElementPaintCalls(uint8 rideType, uint8 trackType, uint8 t
PaintIntercept::ClearCalls();
TestPaint::ResetSupportHeights();
gWoodenSupportsPrependTo = nullptr;
CallOriginal(rideType, trackType, direction, trackSequence, height, &mapElement);
@@ -357,6 +359,7 @@ static uint8 TestTrackElementPaintCalls(uint8 rideType, uint8 trackType, uint8 t
PaintIntercept::ClearCalls();
testpaint_clear_ignore();
TestPaint::ResetSupportHeights();
gWoodenSupportsPrependTo = nullptr;
CallNew(rideType, trackType, direction, trackSequence, height, &mapElement);