Suggested review changes

This commit is contained in:
zsilencer 2016-05-10 01:34:10 -06:00
parent 05213e4cfb
commit 6761751f3f
11 changed files with 305 additions and 278 deletions

View File

@ -27,13 +27,12 @@
*/
void vehicle_visual_reverser(int x, int imageDirection, int y, int z, rct_vehicle *vehicle, const rct_ride_entry_vehicle *vehicleEntry)
{
rct_vehicle *v1 = &g_sprite_list[vehicle->prev_vehicle_on_ride].vehicle;
rct_vehicle *v2 = &g_sprite_list[vehicle->next_vehicle_on_ride].vehicle;
rct_vehicle *v1 = GET_VEHICLE(vehicle->prev_vehicle_on_ride);
rct_vehicle *v2 = GET_VEHICLE(vehicle->next_vehicle_on_ride);
x = (v1->x + v2->x) / 2;
y = (v1->y + v2->y) / 2;
z = (v1->z + v2->z) / 2;
RCT2_GLOBAL(0x9DE568, sint16) = x;
RCT2_GLOBAL(0x9DE56C, sint16) = y;
uint32 rct2VehiclePtrFormat = ((uint32)vehicleEntry) - offsetof(rct_ride_entry, vehicles);
RCT2_CALLPROC_X(0x006D45F8, x, imageDirection, y, z, (int)vehicle, rct2VehiclePtrFormat, 0);
vehicle_visual_default(x, imageDirection, y, z, vehicle, vehicleEntry);
}

View File

@ -70,9 +70,9 @@ void vehicle_visual_virginia_reel(int x, int imageDirection, int y, int z, rct_v
}
baseImage_id += vehicleEntry->base_image_id;
vehicle_boundbox bb = _virginiaReelBoundbox[j];
const vehicle_boundbox *bb = &_virginiaReelBoundbox[j];
image_id = baseImage_id | (vehicle->colours.body_colour << 19) | (vehicle->colours.trim_colour << 24) | 0xA0000000;
sub_98197C(image_id, 0, 0, bb.length_x, bb.length_y, bb.length_z, z, bb.offset_x, bb.offset_y, bb.offset_z + z, get_current_rotation());
sub_98197C(image_id, 0, 0, bb->length_x, bb->length_y, bb->length_z, z, bb->offset_x, bb->offset_y, bb->offset_z + z, get_current_rotation());
if (RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*)->zoom_level < 2 && vehicle->num_peeps > 0) {
uint8 riding_peep_sprites[4] = {0xFF, 0xFF, 0xFF, 0xFF};
@ -83,10 +83,10 @@ void vehicle_visual_virginia_reel(int x, int imageDirection, int y, int z, rct_v
for (int i = 0; i < countof(draw_order); i++) {
if (riding_peep_sprites[draw_order[i]] != 0xFF) {
image_id = (baseImage_id + ((draw_order[i] + 1) * 72)) | (riding_peep_sprites[draw_order[i]] << 19) | 0x20000000;
sub_98199C(image_id, 0, 0, bb.length_x, bb.length_y, bb.length_z, z, bb.offset_x, bb.offset_y, bb.offset_z + z, get_current_rotation());
sub_98199C(image_id, 0, 0, bb->length_x, bb->length_y, bb->length_z, z, bb->offset_x, bb->offset_y, bb->offset_z + z, get_current_rotation());
}
}
}
assert(vehicleEntry->pad_5E == 1);
assert(vehicleEntry->effect_visual == 1);
}

View File

@ -54,5 +54,5 @@ void vehicle_visual_observation_tower(int x, int imageDirection, int y, int z, r
ps->tertiary_colour = vehicle->colours_extended;
}
assert(vehicleEntry->pad_5E == 1);
assert(vehicleEntry->effect_visual == 1);
}

View File

@ -1504,7 +1504,7 @@ const rct_ride_entry_vehicle CableLiftVehicle = {
.powered_acceleration = 0,
.powered_max_speed = 0,
.car_visual = 0,
.pad_5E = 1,
.effect_visual = 1,
.draw_order = 14,
.special_frames = 0,
.peep_loading_positions = NULL

View File

@ -61,5 +61,5 @@ void vehicle_visual_launched_freefall(int x, int imageDirection, int y, int z, r
}
}
assert(vehicleEntry->pad_5E == 1);
assert(vehicleEntry->effect_visual == 1);
}

View File

@ -66,7 +66,6 @@ void vehicle_visual_roto_drop(int x, int imageDirection, int y, int z, rct_vehic
}
};
assert(vehicleEntry->pad_5E == 1);
// 0x5E is treated as another car_visual paint setup jump table like in viewport_vehicle_paint_setup
// in the original code right here but appears to only ever be 1 which goes to a nullsub so it was taken out.
assert(vehicleEntry->effect_visual == 1);
// Although called in original code, effect_visual (splash effects) are not used for many rides and does not make sense so it was taken out
}

View File

@ -70,7 +70,7 @@ typedef struct {
uint8 powered_acceleration; // 0x5B , 0x75
uint8 powered_max_speed; // 0x5C , 0x76
uint8 car_visual; // 0x5D , 0x77
uint8 pad_5E;
uint8 effect_visual;
uint8 draw_order;
uint8 special_frames; // 0x60 , 0x7A
sint8* peep_loading_positions; // 0x61 , 0x7B

File diff suppressed because it is too large Load Diff

View File

@ -32,6 +32,7 @@ extern const vehicle_boundbox VehicleBoundboxes[16][224];
void vehicle_paint(rct_vehicle *vehicle, int imageDirection);
void vehicle_visual_default(int x, int imageDirection, int y, int z, rct_vehicle *vehicle, const rct_ride_entry_vehicle *vehicleEntry);
void vehicle_visual_roto_drop(int x, int imageDirection, int y, int z, rct_vehicle *vehicle, const rct_ride_entry_vehicle *vehicleEntry);
void vehicle_visual_observation_tower(int x, int imageDirection, int y, int z, rct_vehicle *vehicle, const rct_ride_entry_vehicle *vehicleEntry);
void vehicle_visual_river_rapids(int x, int imageDirection, int y, int z, rct_vehicle *vehicle, const rct_ride_entry_vehicle *vehicleEntry);

View File

@ -71,29 +71,29 @@ void vehicle_visual_river_rapids(int x, int imageDirection, int y, int z, rct_ve
}
baseImage_id += vehicleEntry->base_image_id;
vehicle_boundbox bb = _riverRapidsBoundbox[j];
const vehicle_boundbox *bb = &_riverRapidsBoundbox[j];
image_id = baseImage_id | (vehicle->colours.body_colour << 19) | (vehicle->colours.trim_colour << 24) | 0xA0000000;
sub_98197C(image_id, 0, 0, bb.length_x, bb.length_y, bb.length_z, z, bb.offset_x, bb.offset_y, bb.offset_z + z, get_current_rotation());
sub_98197C(image_id, 0, 0, bb->length_x, bb->length_y, bb->length_z, z, bb->offset_x, bb->offset_y, bb->offset_z + z, get_current_rotation());
if (RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*)->zoom_level < 2 && vehicle->num_peeps > 0) {
// Draw peeps: (this particular vehicle doesn't sort them back to front like others so the back ones sometimes clip, but thats how the original does it...)
int peeps = ((ecx / 8) + 0) & 3;
image_id = (baseImage_id + ((peeps + 1) * 72)) | (vehicle->peep_tshirt_colours[0] << 19) | (vehicle->peep_tshirt_colours[1] << 24) | 0xA0000000;
sub_98199C(image_id, 0, 0, bb.length_x, bb.length_y, bb.length_z, z, bb.offset_x, bb.offset_y, bb.offset_z + z, get_current_rotation());
sub_98199C(image_id, 0, 0, bb->length_x, bb->length_y, bb->length_z, z, bb->offset_x, bb->offset_y, bb->offset_z + z, get_current_rotation());
if (vehicle->num_peeps > 2) {
peeps = ((ecx / 8) + 2) & 3;
image_id = (baseImage_id + ((peeps + 1) * 72)) | (vehicle->peep_tshirt_colours[2] << 19) | (vehicle->peep_tshirt_colours[3] << 24) | 0xA0000000;
sub_98199C(image_id, 0, 0, bb.length_x, bb.length_y, bb.length_z, z, bb.offset_x, bb.offset_y, bb.offset_z + z, get_current_rotation());
sub_98199C(image_id, 0, 0, bb->length_x, bb->length_y, bb->length_z, z, bb->offset_x, bb->offset_y, bb->offset_z + z, get_current_rotation());
}
if (vehicle->num_peeps > 4) {
peeps = ((ecx / 8) + 1) & 3;
image_id = (baseImage_id + ((peeps + 1) * 72)) | (vehicle->peep_tshirt_colours[4] << 19) | (vehicle->peep_tshirt_colours[5] << 24) | 0xA0000000;
sub_98199C(image_id, 0, 0, bb.length_x, bb.length_y, bb.length_z, z, bb.offset_x, bb.offset_y, bb.offset_z + z, get_current_rotation());
sub_98199C(image_id, 0, 0, bb->length_x, bb->length_y, bb->length_z, z, bb->offset_x, bb->offset_y, bb->offset_z + z, get_current_rotation());
}
if (vehicle->num_peeps > 6) {
peeps = ((ecx / 8) + 3) & 3;
image_id = (baseImage_id + ((peeps + 1) * 72)) | (vehicle->peep_tshirt_colours[6] << 19) | (vehicle->peep_tshirt_colours[7] << 24) | 0xA0000000;
sub_98199C(image_id, 0, 0, bb.length_x, bb.length_y, bb.length_z, z, bb.offset_x, bb.offset_y, bb.offset_z + z, get_current_rotation());
sub_98199C(image_id, 0, 0, bb->length_x, bb->length_y, bb->length_z, z, bb->offset_x, bb->offset_y, bb->offset_z + z, get_current_rotation());
}
}

View File

@ -62,5 +62,5 @@ void vehicle_visual_submarine(int x, int imageDirection, int y, int z, rct_vehic
ps->tertiary_colour = vehicle->colours_extended;
}
assert(vehicleEntry->pad_5E == 1);
assert(vehicleEntry->effect_visual == 1);
}