mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge pull request #3548 from zsilencer/paint-setup/river-rapids
Remaining vehicle paint setups
This commit is contained in:
commit
04b3103fa9
|
@ -13,3 +13,26 @@
|
|||
* A full copy of the GNU General Public License can be found in licence.txt
|
||||
*****************************************************************************/
|
||||
#pragma endregion
|
||||
|
||||
#include "../../addresses.h"
|
||||
#include "../../config.h"
|
||||
#include "../../interface/viewport.h"
|
||||
#include "../../world/sprite.h"
|
||||
#include "../../paint/paint.h"
|
||||
#include "../vehicle_paint.h"
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006D4453
|
||||
*/
|
||||
void vehicle_visual_reverser(int x, int imageDirection, int y, int z, rct_vehicle *vehicle, const rct_ride_entry_vehicle *vehicleEntry)
|
||||
{
|
||||
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;
|
||||
vehicle_visual_default(x, imageDirection, y, z, vehicle, vehicleEntry);
|
||||
}
|
||||
|
|
|
@ -19,6 +19,20 @@
|
|||
#include "../../interface/viewport.h"
|
||||
#include "../../world/sprite.h"
|
||||
#include "../../paint/paint.h"
|
||||
#include "../vehicle_paint.h"
|
||||
|
||||
// 0x009927E6:
|
||||
static const vehicle_boundbox _virginiaReelBoundbox[] = {
|
||||
{ -11, -11, 1, 22, 22, 13 },
|
||||
{ -11, -11, 1, 22, 22, 13 },
|
||||
{ -11, -11, 1, 22, 22, 13 },
|
||||
{ -11, -11, 1, 22, 22, 13 },
|
||||
{ -11, -11, 1, 22, 22, 13 },
|
||||
{ -11, -11, 1, 22, 22, 13 },
|
||||
{ -11, -11, 1, 22, 22, 13 },
|
||||
{ -11, -11, 1, 22, 22, 13 },
|
||||
{ -11, -11, 1, 22, 22, 13 },
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -56,14 +70,9 @@ void vehicle_visual_virginia_reel(int x, int imageDirection, int y, int z, rct_v
|
|||
}
|
||||
baseImage_id += vehicleEntry->base_image_id;
|
||||
|
||||
sint16 bbo_x = RCT2_ADDRESS(0x009927E6, sint8)[j * 8];
|
||||
sint16 bbo_y = RCT2_ADDRESS(0x009927E7, sint8)[j * 8];
|
||||
sint16 bbo_z = RCT2_ADDRESS(0x009927E8, sint8)[j * 8] + z;
|
||||
uint16 bbl_x = RCT2_ADDRESS(0x009927E9, uint8)[j * 8];
|
||||
uint16 bbl_y = RCT2_ADDRESS(0x009927EA, uint8)[j * 8];
|
||||
uint8 bbl_z = RCT2_ADDRESS(0x009927EB, uint8)[j * 8];
|
||||
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, bbl_x, bbl_y, bbl_z, z, bbo_x, bbo_y, bbo_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};
|
||||
|
@ -74,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, bbl_x, bbl_y, bbl_z, z, bbo_x, bbo_y, bbo_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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
@ -330,7 +330,12 @@ enum {
|
|||
VEHICLE_VISUAL_REVERSER,
|
||||
VEHICLE_VISUAL_SPLASH_BOATS_OR_WATER_COASTER,
|
||||
VEHICLE_VISUAL_ROTO_DROP,
|
||||
VEHICLE_VISUAL_VIRGINIA_REEL = 15,
|
||||
VEHICLE_VISUAL_SPLASH1_EFFECT,
|
||||
VEHICLE_VISUAL_SPLASH2_EFFECT,
|
||||
VEHICLE_VISUAL_SPLASH3_EFFECT,
|
||||
VEHICLE_VISUAL_SPLASH4_EFFECT,
|
||||
VEHICLE_VISUAL_SPLASH5_EFFECT,
|
||||
VEHICLE_VISUAL_VIRGINIA_REEL,
|
||||
VEHICLE_VISUAL_SUBMARINE
|
||||
};
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -32,9 +32,14 @@ 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);
|
||||
void vehicle_visual_reverser(int x, int imageDirection, int y, int z, rct_vehicle *vehicle, const rct_ride_entry_vehicle *vehicleEntry);
|
||||
void vehicle_visual_splash_boats_or_water_coaster(int x, int imageDirection, int y, int z, rct_vehicle *vehicle, const rct_ride_entry_vehicle *vehicleEntry);
|
||||
void vehicle_visual_launched_freefall(int x, int imageDirection, int y, int z, rct_vehicle *vehicle, const rct_ride_entry_vehicle *vehicleEntry);
|
||||
void vehicle_visual_splash_effect(int z, rct_vehicle *vehicle, const rct_ride_entry_vehicle *vehicleEntry);
|
||||
void vehicle_visual_virginia_reel(int x, int imageDirection, int y, int z, rct_vehicle *vehicle, const rct_ride_entry_vehicle *vehicleEntry);
|
||||
void vehicle_visual_submarine(int x, int imageDirection, int y, int z, rct_vehicle *vehicle, const rct_ride_entry_vehicle *vehicleEntry);
|
||||
|
||||
|
|
|
@ -13,3 +13,89 @@
|
|||
* A full copy of the GNU General Public License can be found in licence.txt
|
||||
*****************************************************************************/
|
||||
#pragma endregion
|
||||
|
||||
#include "../../addresses.h"
|
||||
#include "../../config.h"
|
||||
#include "../../interface/viewport.h"
|
||||
#include "../../world/sprite.h"
|
||||
#include "../../paint/paint.h"
|
||||
#include "../vehicle_paint.h"
|
||||
#include "../../game.h"
|
||||
|
||||
// 0x0099279E:
|
||||
static const vehicle_boundbox _riverRapidsBoundbox[] = {
|
||||
{ -13, -13, 1, 26, 26, 13 },
|
||||
{ -13, -13, 1, 26, 26, 13 },
|
||||
{ -13, -13, 1, 26, 26, 13 },
|
||||
{ -13, -13, 1, 26, 26, 13 },
|
||||
{ -13, -13, 1, 26, 26, 13 },
|
||||
{ -13, -13, 1, 26, 26, 13 },
|
||||
{ -13, -13, 1, 26, 26, 13 },
|
||||
{ -13, -13, 1, 26, 26, 13 },
|
||||
{ -13, -13, 1, 26, 26, 13 }
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006D5889
|
||||
*/
|
||||
void vehicle_visual_river_rapids(int x, int imageDirection, int y, int z, rct_vehicle *vehicle, const rct_ride_entry_vehicle *vehicleEntry)
|
||||
{
|
||||
int image_id;
|
||||
int baseImage_id = imageDirection;
|
||||
int ecx = ((vehicle->var_BA / 8) + (get_current_rotation() * 8)) & 31;
|
||||
int j = 0;
|
||||
if (vehicle->vehicle_sprite_type == 0) {
|
||||
baseImage_id = ecx & 7;
|
||||
} else {
|
||||
if (vehicle->vehicle_sprite_type == 1 || vehicle->vehicle_sprite_type == 5) {
|
||||
if (vehicle->vehicle_sprite_type == 5){
|
||||
baseImage_id = imageDirection ^ 16;
|
||||
}
|
||||
baseImage_id &= 24;
|
||||
j = (baseImage_id / 8) + 1;
|
||||
baseImage_id += (ecx & 7);
|
||||
baseImage_id += 8;
|
||||
} else
|
||||
if (vehicle->vehicle_sprite_type == 2 || vehicle->vehicle_sprite_type == 6) {
|
||||
if (vehicle->vehicle_sprite_type == 6){
|
||||
baseImage_id = imageDirection ^ 16;
|
||||
}
|
||||
baseImage_id &= 24;
|
||||
j = (baseImage_id / 8) + 5;
|
||||
baseImage_id += (ecx & 7);
|
||||
baseImage_id += 40;
|
||||
} else {
|
||||
baseImage_id = ecx & 7;
|
||||
}
|
||||
}
|
||||
baseImage_id += vehicleEntry->base_image_id;
|
||||
|
||||
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());
|
||||
|
||||
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());
|
||||
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());
|
||||
}
|
||||
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());
|
||||
}
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
vehicle_visual_splash_effect(z, vehicle, vehicleEntry);
|
||||
}
|
||||
|
|
|
@ -13,3 +13,28 @@
|
|||
* A full copy of the GNU General Public License can be found in licence.txt
|
||||
*****************************************************************************/
|
||||
#pragma endregion
|
||||
|
||||
#include "../../addresses.h"
|
||||
#include "../../config.h"
|
||||
#include "../../interface/viewport.h"
|
||||
#include "../../world/sprite.h"
|
||||
#include "../../paint/paint.h"
|
||||
#include "../vehicle_paint.h"
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006D4295
|
||||
*/
|
||||
void vehicle_visual_splash_boats_or_water_coaster(int x, int imageDirection, int y, int z, rct_vehicle *vehicle, const rct_ride_entry_vehicle *vehicleEntry)
|
||||
{
|
||||
if (vehicle->is_child) {
|
||||
vehicle = GET_VEHICLE(vehicle->prev_vehicle_on_ride);
|
||||
} else {
|
||||
vehicle = GET_VEHICLE(vehicle->next_vehicle_on_ride);
|
||||
}
|
||||
RCT2_GLOBAL(0x009DE578, rct_vehicle*) = vehicle;
|
||||
imageDirection = ((get_current_rotation() * 8) + vehicle->sprite_direction) & 0x1F;
|
||||
RCT2_GLOBAL(0x9DE568, sint16) = vehicle->x;
|
||||
RCT2_GLOBAL(0x9DE56C, sint16) = vehicle->y;
|
||||
vehicle_paint(vehicle, imageDirection);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue