mirror of https://github.com/OpenRCT2/OpenRCT2.git
Integrate g_currently_drawn_item
This commit is contained in:
parent
d9dcf86bd7
commit
9ac3b78530
|
@ -42,6 +42,8 @@
|
||||||
rct_viewport g_viewport_list[MAX_VIEWPORT_COUNT];
|
rct_viewport g_viewport_list[MAX_VIEWPORT_COUNT];
|
||||||
rct_viewport *g_music_tracking_viewport;
|
rct_viewport *g_music_tracking_viewport;
|
||||||
|
|
||||||
|
rct_map_element *_interaction_element = NULL;
|
||||||
|
|
||||||
#ifdef NO_RCT2
|
#ifdef NO_RCT2
|
||||||
paint_struct *unk_EE7884;
|
paint_struct *unk_EE7884;
|
||||||
paint_struct *unk_EE7888;
|
paint_struct *unk_EE7888;
|
||||||
|
@ -1010,7 +1012,7 @@ static void store_interaction_info(paint_struct *ps)
|
||||||
RCT2_GLOBAL(0x009AC149, uint8) = ps->var_29;
|
RCT2_GLOBAL(0x009AC149, uint8) = ps->var_29;
|
||||||
RCT2_GLOBAL(0x009AC14C, uint32) = ps->map_x;
|
RCT2_GLOBAL(0x009AC14C, uint32) = ps->map_x;
|
||||||
RCT2_GLOBAL(0x009AC14E, uint32) = ps->map_y;
|
RCT2_GLOBAL(0x009AC14E, uint32) = ps->map_y;
|
||||||
RCT2_GLOBAL(0x009AC150, rct_map_element*) = ps->mapElement;
|
_interaction_element = ps->mapElement;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1389,7 +1391,7 @@ void get_map_coordinates_from_pos(int screenX, int screenY, int flags, sint16 *x
|
||||||
if (interactionType != NULL) *interactionType = RCT2_GLOBAL(0x9AC148, uint8_t);
|
if (interactionType != NULL) *interactionType = RCT2_GLOBAL(0x9AC148, uint8_t);
|
||||||
if (x != NULL) *x = RCT2_GLOBAL(0x9AC14C, int16_t);
|
if (x != NULL) *x = RCT2_GLOBAL(0x9AC14C, int16_t);
|
||||||
if (y != NULL) *y = RCT2_GLOBAL(0x9AC14E, int16_t);
|
if (y != NULL) *y = RCT2_GLOBAL(0x9AC14E, int16_t);
|
||||||
if (mapElement != NULL) *mapElement = RCT2_GLOBAL(0x9AC150, rct_map_element*);
|
if (mapElement != NULL) *mapElement = _interaction_element;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -223,7 +223,7 @@ static void sub_68B3FB(int x, int y)
|
||||||
int height = map_element->base_height * 8;
|
int height = map_element->base_height * 8;
|
||||||
|
|
||||||
uint32_t dword_9DE574 = RCT2_GLOBAL(0x9DE574, uint32_t);
|
uint32_t dword_9DE574 = RCT2_GLOBAL(0x9DE574, uint32_t);
|
||||||
RCT2_GLOBAL(0x9DE578, rct_map_element*) = map_element;
|
g_currently_drawn_item = map_element;
|
||||||
//setup the painting of for example: the underground, signs, rides, scenery, etc.
|
//setup the painting of for example: the underground, signs, rides, scenery, etc.
|
||||||
switch (map_element_get_type(map_element))
|
switch (map_element_get_type(map_element))
|
||||||
{
|
{
|
||||||
|
|
|
@ -35,6 +35,7 @@ paint_string_struct *pss2;
|
||||||
|
|
||||||
#ifdef NO_RCT2
|
#ifdef NO_RCT2
|
||||||
paint_struct *g_paint_structs[512];
|
paint_struct *g_paint_structs[512];
|
||||||
|
void *g_currently_drawn_item;
|
||||||
#else
|
#else
|
||||||
#define g_paint_structs (RCT2_ADDRESS(0x00F1A50C, paint_struct*))
|
#define g_paint_structs (RCT2_ADDRESS(0x00F1A50C, paint_struct*))
|
||||||
#endif
|
#endif
|
||||||
|
@ -164,7 +165,7 @@ static paint_struct * sub_9819_c(uint32 image_id, rct_xyz16 offset, rct_xyz16 bo
|
||||||
ps->var_29 = RCT2_GLOBAL(0x9DE571, uint8);
|
ps->var_29 = RCT2_GLOBAL(0x9DE571, uint8);
|
||||||
ps->map_x = RCT2_GLOBAL(0x9DE574, uint16);
|
ps->map_x = RCT2_GLOBAL(0x9DE574, uint16);
|
||||||
ps->map_y = RCT2_GLOBAL(0x9DE576, uint16);
|
ps->map_y = RCT2_GLOBAL(0x9DE576, uint16);
|
||||||
ps->mapElement = RCT2_GLOBAL(0x9DE578, rct_map_element*);
|
ps->mapElement = g_currently_drawn_item;
|
||||||
|
|
||||||
return ps;
|
return ps;
|
||||||
}
|
}
|
||||||
|
@ -288,7 +289,7 @@ paint_struct * sub_98196C(
|
||||||
ps->var_29 = RCT2_GLOBAL(0x9DE571, uint8);
|
ps->var_29 = RCT2_GLOBAL(0x9DE571, uint8);
|
||||||
ps->map_x = RCT2_GLOBAL(0x9DE574, uint16);
|
ps->map_x = RCT2_GLOBAL(0x9DE574, uint16);
|
||||||
ps->map_y = RCT2_GLOBAL(0x9DE576, uint16);
|
ps->map_y = RCT2_GLOBAL(0x9DE576, uint16);
|
||||||
ps->mapElement = RCT2_GLOBAL(0x9DE578, rct_map_element*);
|
ps->mapElement = g_currently_drawn_item;
|
||||||
|
|
||||||
g_ps_F1AD28 = ps;
|
g_ps_F1AD28 = ps;
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,12 @@
|
||||||
|
|
||||||
typedef struct attached_paint_struct attached_paint_struct;
|
typedef struct attached_paint_struct attached_paint_struct;
|
||||||
|
|
||||||
|
#ifdef NO_RCT2
|
||||||
|
extern void *g_currently_drawn_item;
|
||||||
|
#else
|
||||||
|
#define g_currently_drawn_item RCT2_GLOBAL(0x9DE578, void*)
|
||||||
|
#endif
|
||||||
|
|
||||||
#pragma pack(push, 1)
|
#pragma pack(push, 1)
|
||||||
/* size 0x12 */
|
/* size 0x12 */
|
||||||
struct attached_paint_struct {
|
struct attached_paint_struct {
|
||||||
|
|
|
@ -57,7 +57,7 @@ void sprite_paint_setup(const uint16 eax, const uint16 ecx) {
|
||||||
image_direction += spr->unknown.sprite_direction;
|
image_direction += spr->unknown.sprite_direction;
|
||||||
image_direction &= 0x1F;
|
image_direction &= 0x1F;
|
||||||
|
|
||||||
RCT2_GLOBAL(0x9DE578, uint32) = (uint32)spr;
|
g_currently_drawn_item = spr;
|
||||||
|
|
||||||
RCT2_GLOBAL(0x9DE568, sint16) = spr->unknown.x;
|
RCT2_GLOBAL(0x9DE568, sint16) = spr->unknown.x;
|
||||||
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_SPRITE;
|
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_SPRITE;
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
*/
|
*/
|
||||||
static void paint_circus_show_tent(uint8 rideIndex, uint8 direction, sint8 al, sint8 cl, uint16 height)
|
static void paint_circus_show_tent(uint8 rideIndex, uint8 direction, sint8 al, sint8 cl, uint16 height)
|
||||||
{
|
{
|
||||||
rct_map_element * savedMapElement = RCT2_GLOBAL(0x009DE578, rct_map_element*);
|
rct_map_element * savedMapElement = g_currently_drawn_item;
|
||||||
|
|
||||||
rct_ride * ride = get_ride(rideIndex);
|
rct_ride * ride = get_ride(rideIndex);
|
||||||
rct_ride_entry * ride_type = get_ride_entry(ride->subtype);
|
rct_ride_entry * ride_type = get_ride_entry(ride->subtype);
|
||||||
|
@ -33,7 +33,7 @@ static void paint_circus_show_tent(uint8 rideIndex, uint8 direction, sint8 al, s
|
||||||
if (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK
|
if (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK
|
||||||
&& ride->vehicles[0] != SPRITE_INDEX_NULL) {
|
&& ride->vehicles[0] != SPRITE_INDEX_NULL) {
|
||||||
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_SPRITE;
|
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_SPRITE;
|
||||||
RCT2_GLOBAL(0x009DE578, rct_vehicle*) = GET_VEHICLE(ride->vehicles[0]);
|
g_currently_drawn_item = GET_VEHICLE(ride->vehicles[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 imageColourFlags = RCT2_GLOBAL(0x00F441A0, uint32);
|
uint32 imageColourFlags = RCT2_GLOBAL(0x00F441A0, uint32);
|
||||||
|
@ -44,7 +44,7 @@ static void paint_circus_show_tent(uint8 rideIndex, uint8 direction, sint8 al, s
|
||||||
uint32 imageId = (ride_type->vehicles[0].base_image_id + direction) | imageColourFlags;
|
uint32 imageId = (ride_type->vehicles[0].base_image_id + direction) | imageColourFlags;
|
||||||
sub_98197C(imageId, al, cl, 24, 24, 47, height + 3, al + 16, cl + 16, height + 3, get_current_rotation());
|
sub_98197C(imageId, al, cl, 24, 24, 47, height + 3, al + 16, cl + 16, height + 3, get_current_rotation());
|
||||||
|
|
||||||
RCT2_GLOBAL(0x009DE578, rct_map_element*) = savedMapElement;
|
g_currently_drawn_item = savedMapElement;
|
||||||
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_RIDE;
|
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_RIDE;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -48,7 +48,7 @@ static void sub_88ABA4(uint8 direction, uint8 x_offset, uint8 y_offset, uint32 s
|
||||||
//return;
|
//return;
|
||||||
|
|
||||||
// push dword_9DE578
|
// push dword_9DE578
|
||||||
rct_map_element *original_map_element = RCT2_GLOBAL(0x9DE578, rct_map_element*);
|
rct_map_element *original_map_element = g_currently_drawn_item;
|
||||||
// push edx
|
// push edx
|
||||||
RCT2_GLOBAL(0x14281B0, uint32) = segment;
|
RCT2_GLOBAL(0x14281B0, uint32) = segment;
|
||||||
RCT2_GLOBAL(0x14281B4, uint32) = direction;
|
RCT2_GLOBAL(0x14281B4, uint32) = direction;
|
||||||
|
@ -63,7 +63,7 @@ static void sub_88ABA4(uint8 direction, uint8 x_offset, uint8 y_offset, uint32 s
|
||||||
if (ride->vehicles[0] != (uint16)-1) {
|
if (ride->vehicles[0] != (uint16)-1) {
|
||||||
rct_sprite *sprite = get_sprite(ride->vehicles[0]);
|
rct_sprite *sprite = get_sprite(ride->vehicles[0]);
|
||||||
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_SPRITE;
|
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_SPRITE;
|
||||||
RCT2_GLOBAL(0x9DE578, rct_sprite *) = sprite;
|
g_currently_drawn_item = sprite;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ static void paint_ferris_wheel_structure(uint8 rideIndex, uint8 direction, sint8
|
||||||
{
|
{
|
||||||
uint32 imageId, baseImageId;
|
uint32 imageId, baseImageId;
|
||||||
|
|
||||||
rct_map_element * savedMapElement = RCT2_GLOBAL(0x009DE578, rct_map_element*);
|
rct_map_element * savedMapElement = g_currently_drawn_item;
|
||||||
|
|
||||||
rct_ride * ride = get_ride(rideIndex);
|
rct_ride * ride = get_ride(rideIndex);
|
||||||
rct_ride_entry * rideType = get_ride_entry(ride->subtype);
|
rct_ride_entry * rideType = get_ride_entry(ride->subtype);
|
||||||
|
@ -76,7 +76,7 @@ static void paint_ferris_wheel_structure(uint8 rideIndex, uint8 direction, sint8
|
||||||
vehicle = GET_VEHICLE(ride->vehicles[0]);
|
vehicle = GET_VEHICLE(ride->vehicles[0]);
|
||||||
|
|
||||||
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_SPRITE;
|
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_SPRITE;
|
||||||
RCT2_GLOBAL(0x009DE578, rct_vehicle*) = vehicle;
|
g_currently_drawn_item = vehicle;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 imageOffset = 0;
|
uint32 imageOffset = 0;
|
||||||
|
@ -120,7 +120,7 @@ static void paint_ferris_wheel_structure(uint8 rideIndex, uint8 direction, sint8
|
||||||
imageId = (22150 + (direction & 1) * 2 + 1) | RCT2_GLOBAL(0x00F44198, uint32);
|
imageId = (22150 + (direction & 1) * 2 + 1) | RCT2_GLOBAL(0x00F44198, uint32);
|
||||||
sub_98199C(imageId, xOffset, yOffset, boundBox.length_x, boundBox.length_y, 127, height, boundBox.offset_x, boundBox.offset_y, height, get_current_rotation());
|
sub_98199C(imageId, xOffset, yOffset, boundBox.length_x, boundBox.length_y, 127, height, boundBox.offset_x, boundBox.offset_y, height, get_current_rotation());
|
||||||
|
|
||||||
RCT2_GLOBAL(0x009DE578, rct_map_element*) = savedMapElement;
|
g_currently_drawn_item = savedMapElement;
|
||||||
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_RIDE;
|
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_RIDE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ static haunted_house_bound_box haunted_house_data[] = {
|
||||||
*/
|
*/
|
||||||
static void paint_haunted_house_structure(uint8 rideIndex, uint8 direction, sint8 xOffset, sint8 yOffset, uint8 part, uint16 height)
|
static void paint_haunted_house_structure(uint8 rideIndex, uint8 direction, sint8 xOffset, sint8 yOffset, uint8 part, uint16 height)
|
||||||
{
|
{
|
||||||
rct_map_element * savedMapElement = RCT2_GLOBAL(0x009DE578, rct_map_element*);
|
rct_map_element * savedMapElement = g_currently_drawn_item;
|
||||||
|
|
||||||
uint8 frameNum = 0;
|
uint8 frameNum = 0;
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ static void paint_haunted_house_structure(uint8 rideIndex, uint8 direction, sint
|
||||||
&& ride->vehicles[0] != SPRITE_INDEX_NULL) {
|
&& ride->vehicles[0] != SPRITE_INDEX_NULL) {
|
||||||
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_SPRITE;
|
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_SPRITE;
|
||||||
rct_vehicle * vehicle = GET_VEHICLE(ride->vehicles[0]);
|
rct_vehicle * vehicle = GET_VEHICLE(ride->vehicles[0]);
|
||||||
RCT2_GLOBAL(0x009DE578, rct_vehicle*) = vehicle;
|
g_currently_drawn_item = vehicle;
|
||||||
frameNum = vehicle->vehicle_sprite_type;
|
frameNum = vehicle->vehicle_sprite_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ static void paint_haunted_house_structure(uint8 rideIndex, uint8 direction, sint
|
||||||
sub_98199C(imageId, xOffset, yOffset, boundBox.length_x, boundBox.length_y, 127, height, boundBox.offset_x, boundBox.offset_y, height, get_current_rotation());
|
sub_98199C(imageId, xOffset, yOffset, boundBox.length_x, boundBox.length_y, 127, height, boundBox.offset_x, boundBox.offset_y, height, get_current_rotation());
|
||||||
}
|
}
|
||||||
|
|
||||||
RCT2_GLOBAL(0x009DE578, rct_map_element*) = savedMapElement;
|
g_currently_drawn_item = savedMapElement;
|
||||||
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_RIDE;
|
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_RIDE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ static const uint16 merry_go_round_breakdown_vibration[] = {
|
||||||
*/
|
*/
|
||||||
static void paint_merry_go_round_structure(uint8 rideIndex, uint8 direction, sint8 xOffset, sint8 yOffset, uint16 height)
|
static void paint_merry_go_round_structure(uint8 rideIndex, uint8 direction, sint8 xOffset, sint8 yOffset, uint16 height)
|
||||||
{
|
{
|
||||||
rct_map_element * savedMapElement = RCT2_GLOBAL(0x009DE578, rct_map_element*);
|
rct_map_element * savedMapElement = g_currently_drawn_item;
|
||||||
height += 7;
|
height += 7;
|
||||||
|
|
||||||
rct_ride * ride = get_ride(rideIndex);
|
rct_ride * ride = get_ride(rideIndex);
|
||||||
|
@ -48,7 +48,7 @@ static void paint_merry_go_round_structure(uint8 rideIndex, uint8 direction, sin
|
||||||
&& ride->vehicles[0] != SPRITE_INDEX_NULL) {
|
&& ride->vehicles[0] != SPRITE_INDEX_NULL) {
|
||||||
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_SPRITE;
|
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_SPRITE;
|
||||||
vehicle = GET_VEHICLE(ride->vehicles[0]);
|
vehicle = GET_VEHICLE(ride->vehicles[0]);
|
||||||
RCT2_GLOBAL(0x009DE578, rct_vehicle*) = vehicle;
|
g_currently_drawn_item = vehicle;
|
||||||
|
|
||||||
if (ride->lifecycle_flags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN)
|
if (ride->lifecycle_flags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN)
|
||||||
&& ride->breakdown_reason_pending == BREAKDOWN_CONTROL_FAILURE
|
&& ride->breakdown_reason_pending == BREAKDOWN_CONTROL_FAILURE
|
||||||
|
@ -96,7 +96,7 @@ static void paint_merry_go_round_structure(uint8 rideIndex, uint8 direction, sin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RCT2_GLOBAL(0x009DE578, rct_map_element*) = savedMapElement;
|
g_currently_drawn_item = savedMapElement;
|
||||||
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_RIDE;
|
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_RIDE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ static const uint32 space_rings_fence_sprites[] = {
|
||||||
/** rct2: 0x00768A3B */
|
/** rct2: 0x00768A3B */
|
||||||
static void paint_space_rings_structure(rct_ride * ride, uint8 direction, uint32 segment, int height)
|
static void paint_space_rings_structure(rct_ride * ride, uint8 direction, uint32 segment, int height)
|
||||||
{
|
{
|
||||||
rct_map_element * savedMapElement = RCT2_GLOBAL(0x009DE578, rct_map_element*);
|
rct_map_element * savedMapElement = g_currently_drawn_item;
|
||||||
|
|
||||||
uint32 vehicleIndex = (segment - direction) & 0x3;
|
uint32 vehicleIndex = (segment - direction) & 0x3;
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ static void paint_space_rings_structure(rct_ride * ride, uint8 direction, uint3
|
||||||
&& ride->vehicles[0] != SPRITE_INDEX_NULL) {
|
&& ride->vehicles[0] != SPRITE_INDEX_NULL) {
|
||||||
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_SPRITE;
|
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_SPRITE;
|
||||||
vehicle = GET_VEHICLE(ride->vehicles[vehicleIndex]);
|
vehicle = GET_VEHICLE(ride->vehicles[vehicleIndex]);
|
||||||
RCT2_GLOBAL(0x009DE578, rct_vehicle*) = vehicle;
|
g_currently_drawn_item = vehicle;
|
||||||
frameNum += (sint8) vehicle->vehicle_sprite_type * 4;
|
frameNum += (sint8) vehicle->vehicle_sprite_type * 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ static void paint_space_rings_structure(rct_ride * ride, uint8 direction, uint3
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RCT2_GLOBAL(0x009DE578, rct_map_element*) = savedMapElement;
|
g_currently_drawn_item = savedMapElement;
|
||||||
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_RIDE;
|
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_RIDE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
*/
|
*/
|
||||||
static void paint_3d_cinema_structure(uint8 rideIndex, uint8 direction, sint8 xOffset, sint8 yOffset, uint16 height)
|
static void paint_3d_cinema_structure(uint8 rideIndex, uint8 direction, sint8 xOffset, sint8 yOffset, uint16 height)
|
||||||
{
|
{
|
||||||
rct_map_element * savedMapElement = RCT2_GLOBAL(0x009DE578, rct_map_element*);
|
rct_map_element * savedMapElement = g_currently_drawn_item;
|
||||||
|
|
||||||
rct_ride * ride = get_ride(rideIndex);
|
rct_ride * ride = get_ride(rideIndex);
|
||||||
rct_ride_entry * ride_type = get_ride_entry(ride->subtype);
|
rct_ride_entry * ride_type = get_ride_entry(ride->subtype);
|
||||||
|
@ -33,7 +33,7 @@ static void paint_3d_cinema_structure(uint8 rideIndex, uint8 direction, sint8 xO
|
||||||
if (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK
|
if (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK
|
||||||
&& ride->vehicles[0] != SPRITE_INDEX_NULL) {
|
&& ride->vehicles[0] != SPRITE_INDEX_NULL) {
|
||||||
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_SPRITE;
|
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_SPRITE;
|
||||||
RCT2_GLOBAL(0x009DE578, rct_vehicle*) = GET_VEHICLE(ride->vehicles[0]);
|
g_currently_drawn_item = GET_VEHICLE(ride->vehicles[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 imageColourFlags = RCT2_GLOBAL(0x00F441A0, uint32);
|
uint32 imageColourFlags = RCT2_GLOBAL(0x00F441A0, uint32);
|
||||||
|
@ -44,7 +44,7 @@ static void paint_3d_cinema_structure(uint8 rideIndex, uint8 direction, sint8 xO
|
||||||
uint32 imageId = (ride_type->vehicles[0].base_image_id + direction) | imageColourFlags;
|
uint32 imageId = (ride_type->vehicles[0].base_image_id + direction) | imageColourFlags;
|
||||||
sub_98197C(imageId, xOffset, yOffset, 24, 24, 47, height + 3, xOffset + 16, yOffset + 16, height + 3, get_current_rotation());
|
sub_98197C(imageId, xOffset, yOffset, 24, 24, 47, height + 3, xOffset + 16, yOffset + 16, height + 3, get_current_rotation());
|
||||||
|
|
||||||
RCT2_GLOBAL(0x009DE578, rct_map_element*) = savedMapElement;
|
g_currently_drawn_item = savedMapElement;
|
||||||
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_RIDE;
|
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_RIDE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ static void paint_enterprise_structure(rct_ride * ride, sint8 xOffset, sint8 yOf
|
||||||
{
|
{
|
||||||
height += 7;
|
height += 7;
|
||||||
|
|
||||||
rct_map_element * savedMapElement = RCT2_GLOBAL(0x009DE578, rct_map_element*);
|
rct_map_element * savedMapElement = g_currently_drawn_item;
|
||||||
rct_ride_entry * rideType = get_ride_entry(ride->subtype);
|
rct_ride_entry * rideType = get_ride_entry(ride->subtype);
|
||||||
rct_vehicle * vehicle = NULL;
|
rct_vehicle * vehicle = NULL;
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ static void paint_enterprise_structure(rct_ride * ride, sint8 xOffset, sint8 yOf
|
||||||
&& ride->vehicles[0] != SPRITE_INDEX_NULL) {
|
&& ride->vehicles[0] != SPRITE_INDEX_NULL) {
|
||||||
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_SPRITE;
|
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_SPRITE;
|
||||||
vehicle = GET_VEHICLE(ride->vehicles[0]);
|
vehicle = GET_VEHICLE(ride->vehicles[0]);
|
||||||
RCT2_GLOBAL(0x009DE578, rct_vehicle*) = vehicle;
|
g_currently_drawn_item = vehicle;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 imageOffset = (get_current_rotation() + map_element_get_direction(mapElement)) % 4;
|
uint32 imageOffset = (get_current_rotation() + map_element_get_direction(mapElement)) % 4;
|
||||||
|
@ -70,7 +70,7 @@ static void paint_enterprise_structure(rct_ride * ride, sint8 xOffset, sint8 yOf
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RCT2_GLOBAL(0x009DE578, rct_map_element*) = savedMapElement;
|
g_currently_drawn_item = savedMapElement;
|
||||||
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_RIDE;
|
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_RIDE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ static void paint_motionsimulator_vehicle(sint8 offsetX, sint8 offsetY, uint8 di
|
||||||
rct_ride *ride = get_ride(mapElement->properties.track.ride_index);
|
rct_ride *ride = get_ride(mapElement->properties.track.ride_index);
|
||||||
rct_ride_entry *rideEntry = get_ride_entry_by_ride(ride);
|
rct_ride_entry *rideEntry = get_ride_entry_by_ride(ride);
|
||||||
|
|
||||||
rct_map_element * savedMapElement = RCT2_GLOBAL(0x009DE578, rct_map_element*);
|
rct_map_element * savedMapElement = g_currently_drawn_item;
|
||||||
|
|
||||||
rct_vehicle *vehicle = NULL;
|
rct_vehicle *vehicle = NULL;
|
||||||
if (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK) {
|
if (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK) {
|
||||||
|
@ -48,7 +48,7 @@ static void paint_motionsimulator_vehicle(sint8 offsetX, sint8 offsetY, uint8 di
|
||||||
if (spriteIndex != SPRITE_INDEX_NULL) {
|
if (spriteIndex != SPRITE_INDEX_NULL) {
|
||||||
vehicle = GET_VEHICLE(spriteIndex);
|
vehicle = GET_VEHICLE(spriteIndex);
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = 2;
|
RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = 2;
|
||||||
RCT2_GLOBAL(0x009DE578, rct_vehicle*) = vehicle;
|
g_currently_drawn_item = vehicle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ static void paint_motionsimulator_vehicle(sint8 offsetX, sint8 offsetY, uint8 di
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
RCT2_GLOBAL(0x009DE578, rct_map_element*) = savedMapElement;
|
g_currently_drawn_item = savedMapElement;
|
||||||
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_RIDE;
|
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_RIDE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@ static void paint_pirate_ship_structure(rct_ride * ride, uint8 direction, sint8
|
||||||
{
|
{
|
||||||
uint32 imageId, baseImageId;
|
uint32 imageId, baseImageId;
|
||||||
|
|
||||||
rct_map_element * savedMapElement = RCT2_GLOBAL(0x009DE578, rct_map_element*);
|
rct_map_element * savedMapElement = g_currently_drawn_item;
|
||||||
|
|
||||||
rct_ride_entry * rideType = get_ride_entry(ride->subtype);
|
rct_ride_entry * rideType = get_ride_entry(ride->subtype);
|
||||||
rct_vehicle * vehicle = NULL;
|
rct_vehicle * vehicle = NULL;
|
||||||
|
@ -85,7 +85,7 @@ static void paint_pirate_ship_structure(rct_ride * ride, uint8 direction, sint8
|
||||||
vehicle = GET_VEHICLE(ride->vehicles[0]);
|
vehicle = GET_VEHICLE(ride->vehicles[0]);
|
||||||
|
|
||||||
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_SPRITE;
|
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_SPRITE;
|
||||||
RCT2_GLOBAL(0x009DE578, rct_vehicle*) = vehicle;
|
g_currently_drawn_item = vehicle;
|
||||||
}
|
}
|
||||||
|
|
||||||
baseImageId = rideType->vehicles[0].base_image_id + pirate_ship_base_sprite_offset[direction];
|
baseImageId = rideType->vehicles[0].base_image_id + pirate_ship_base_sprite_offset[direction];
|
||||||
|
@ -153,7 +153,7 @@ static void paint_pirate_ship_structure(rct_ride * ride, uint8 direction, sint8
|
||||||
imageId = pirate_ship_frame_sprites[(direction & 1)][1] | RCT2_GLOBAL(0x00F44198, uint32);
|
imageId = pirate_ship_frame_sprites[(direction & 1)][1] | RCT2_GLOBAL(0x00F44198, uint32);
|
||||||
sub_98199C(imageId, xOffset, yOffset, bounds.length_x, bounds.length_y, 80, height, bounds.offset_x, bounds.offset_y, height, get_current_rotation());
|
sub_98199C(imageId, xOffset, yOffset, bounds.length_x, bounds.length_y, 80, height, bounds.offset_x, bounds.offset_y, height, get_current_rotation());
|
||||||
|
|
||||||
RCT2_GLOBAL(0x009DE578, rct_map_element*) = savedMapElement;
|
g_currently_drawn_item = savedMapElement;
|
||||||
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_RIDE;
|
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_RIDE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ static const uint32 swinging_inverter_ship_frame_sprites[] = {
|
||||||
|
|
||||||
static void paint_swinging_inverter_ship_structure(rct_ride * ride, uint8 direction, sint8 axisOffset, uint16 height)
|
static void paint_swinging_inverter_ship_structure(rct_ride * ride, uint8 direction, sint8 axisOffset, uint16 height)
|
||||||
{
|
{
|
||||||
rct_map_element * savedMapElement = RCT2_GLOBAL(0x009DE578, rct_map_element*);
|
rct_map_element * savedMapElement = g_currently_drawn_item;
|
||||||
|
|
||||||
rct_ride_entry * rideType = get_ride_entry(ride->subtype);
|
rct_ride_entry * rideType = get_ride_entry(ride->subtype);
|
||||||
rct_vehicle * vehicle = NULL;
|
rct_vehicle * vehicle = NULL;
|
||||||
|
@ -75,7 +75,7 @@ static void paint_swinging_inverter_ship_structure(rct_ride * ride, uint8 direct
|
||||||
vehicle = GET_VEHICLE(ride->vehicles[0]);
|
vehicle = GET_VEHICLE(ride->vehicles[0]);
|
||||||
|
|
||||||
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_SPRITE;
|
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_SPRITE;
|
||||||
RCT2_GLOBAL(0x009DE578, rct_vehicle*) = vehicle;
|
g_currently_drawn_item = vehicle;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 vehicleImageId = rideType->vehicles[0].base_image_id + swinging_inverter_ship_base_sprite_offset[direction];
|
uint32 vehicleImageId = rideType->vehicles[0].base_image_id + swinging_inverter_ship_base_sprite_offset[direction];
|
||||||
|
@ -112,7 +112,7 @@ static void paint_swinging_inverter_ship_structure(rct_ride * ride, uint8 direct
|
||||||
sub_98199C(vehicleImageId, xOffset, yOffset, boundBox.length_x, boundBox.length_y, 127, height, boundBox.offset_x, boundBox.offset_y, height, get_current_rotation());
|
sub_98199C(vehicleImageId, xOffset, yOffset, boundBox.length_x, boundBox.length_y, 127, height, boundBox.offset_x, boundBox.offset_y, height, get_current_rotation());
|
||||||
}
|
}
|
||||||
|
|
||||||
RCT2_GLOBAL(0x009DE578, rct_map_element*) = savedMapElement;
|
g_currently_drawn_item = savedMapElement;
|
||||||
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_RIDE;
|
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_RIDE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ static void top_spin_paint_vehicle(sint8 al, sint8 cl, uint8 rideIndex, uint8 di
|
||||||
uint16 boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ;
|
uint16 boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ;
|
||||||
// As we will be drawing a vehicle we need to backup the mapElement that
|
// As we will be drawing a vehicle we need to backup the mapElement that
|
||||||
// is assigned to the drawings.
|
// is assigned to the drawings.
|
||||||
rct_map_element* curMapElement = RCT2_GLOBAL(0x009DE578, rct_map_element*);
|
rct_map_element* curMapElement = g_currently_drawn_item;
|
||||||
|
|
||||||
height += 3;
|
height += 3;
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ static void top_spin_paint_vehicle(sint8 al, sint8 cl, uint8 rideIndex, uint8 di
|
||||||
vehicle = GET_VEHICLE(ride->vehicles[0]);
|
vehicle = GET_VEHICLE(ride->vehicles[0]);
|
||||||
|
|
||||||
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_SPRITE;
|
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_SPRITE;
|
||||||
RCT2_GLOBAL(0x009DE578, rct_vehicle*) = vehicle;
|
g_currently_drawn_item = vehicle;
|
||||||
|
|
||||||
armRotation = vehicle->vehicle_sprite_type;
|
armRotation = vehicle->vehicle_sprite_type;
|
||||||
seatRotation = vehicle->bank_rotation;
|
seatRotation = vehicle->bank_rotation;
|
||||||
|
@ -247,7 +247,7 @@ static void top_spin_paint_vehicle(sint8 al, sint8 cl, uint8 rideIndex, uint8 di
|
||||||
|
|
||||||
sub_98199C(image_id, al, cl, lengthX, lengthY, 90, height, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, rotation);
|
sub_98199C(image_id, al, cl, lengthX, lengthY, 90, height, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, rotation);
|
||||||
|
|
||||||
RCT2_GLOBAL(0x009DE578, rct_map_element*) = curMapElement;
|
g_currently_drawn_item = curMapElement;
|
||||||
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_RIDE;
|
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_RIDE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
/** rct2: 0x0076E5C9 */
|
/** rct2: 0x0076E5C9 */
|
||||||
static void paint_twist_structure(rct_ride * ride, uint8 direction, sint8 xOffset, sint8 yOffset, uint16 height)
|
static void paint_twist_structure(rct_ride * ride, uint8 direction, sint8 xOffset, sint8 yOffset, uint16 height)
|
||||||
{
|
{
|
||||||
rct_map_element * savedMapElement = RCT2_GLOBAL(0x009DE578, rct_map_element*);
|
rct_map_element * savedMapElement = g_currently_drawn_item;
|
||||||
|
|
||||||
rct_ride_entry * rideType = get_ride_entry(ride->subtype);
|
rct_ride_entry * rideType = get_ride_entry(ride->subtype);
|
||||||
rct_vehicle * vehicle = NULL;
|
rct_vehicle * vehicle = NULL;
|
||||||
|
@ -37,7 +37,7 @@ static void paint_twist_structure(rct_ride * ride, uint8 direction, sint8 xOffse
|
||||||
vehicle = GET_VEHICLE(ride->vehicles[0]);
|
vehicle = GET_VEHICLE(ride->vehicles[0]);
|
||||||
|
|
||||||
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_SPRITE;
|
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_SPRITE;
|
||||||
RCT2_GLOBAL(0x009DE578, rct_vehicle*) = vehicle;
|
g_currently_drawn_item = vehicle;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 frameNum = (direction * 88) % 216;
|
uint32 frameNum = (direction * 88) % 216;
|
||||||
|
@ -72,7 +72,7 @@ static void paint_twist_structure(rct_ride * ride, uint8 direction, sint8 xOffse
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RCT2_GLOBAL(0x009DE578, rct_map_element*) = savedMapElement;
|
g_currently_drawn_item = savedMapElement;
|
||||||
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_RIDE;
|
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_RIDE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ void vehicle_visual_splash_boats_or_water_coaster(int x, int imageDirection, int
|
||||||
} else {
|
} else {
|
||||||
vehicle = GET_VEHICLE(vehicle->next_vehicle_on_ride);
|
vehicle = GET_VEHICLE(vehicle->next_vehicle_on_ride);
|
||||||
}
|
}
|
||||||
RCT2_GLOBAL(0x009DE578, rct_vehicle*) = vehicle;
|
g_currently_drawn_item = vehicle;
|
||||||
imageDirection = ((get_current_rotation() * 8) + vehicle->sprite_direction) & 0x1F;
|
imageDirection = ((get_current_rotation() * 8) + vehicle->sprite_direction) & 0x1F;
|
||||||
RCT2_GLOBAL(0x9DE568, sint16) = vehicle->x;
|
RCT2_GLOBAL(0x9DE568, sint16) = vehicle->x;
|
||||||
RCT2_GLOBAL(0x9DE56C, sint16) = vehicle->y;
|
RCT2_GLOBAL(0x9DE56C, sint16) = vehicle->y;
|
||||||
|
|
Loading…
Reference in New Issue