1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-23 06:44:38 +01:00

Whitespace fixes.

This is just whitespace fixup for all files affected in vehcile-update
branch.
This commit is contained in:
Michał Janiszewski
2016-01-02 15:52:37 +01:00
parent 797a2cc75d
commit 2b1b0f76f3
11 changed files with 82 additions and 82 deletions

View File

@@ -8,4 +8,4 @@ rct_vehicle *cable_lift_segment_create(int rideIndex, int x, int y, int z, int d
void cable_lift_update(rct_vehicle *vehicle);
int cable_lift_update_track_motion(rct_vehicle *cableLift);
#endif
#endif

View File

@@ -6027,7 +6027,7 @@ int get_turn_count_3_elements(rct_ride* ride, uint8 type) {
break;
case 1:
turn_count = &ride->turn_count_banked;
break;
break;
case 2:
turn_count = &ride->turn_count_sloped;
break;
@@ -6044,7 +6044,7 @@ int get_turn_count_4_plus_elements(rct_ride* ride, uint8 type) {
case 0:
case 1:
return 0;
case 2:
case 2:
turn_count = &ride->turn_count_sloped;
break;
default:

View File

@@ -82,13 +82,13 @@ typedef struct {
uint8 ride_type[3]; // 0x00C
uint8 min_cars_in_train; // 0x00F
uint8 max_cars_in_train; // 0x010
uint8 cars_per_flat_ride; // 0x011
uint8 cars_per_flat_ride; // 0x011
// Number of cars that can't hold passengers
uint8 zero_cars; // 0x012
uint8 zero_cars; // 0x012
// The index to the vehicle type displayed in
// the vehicle tab.
uint8 tab_vehicle; // 0x013
uint8 default_vehicle; // 0x014
uint8 default_vehicle; // 0x014
// Convert from first - fourth vehicle to
// vehicle structure
uint8 front_vehicle; // 0x015
@@ -200,7 +200,7 @@ typedef struct {
uint16 var_10C;
// Next 3 variables are related (XXXX XYYY ZZZa aaaa)
uint16 turn_count_default; // 0x10E X = current turn count
uint16 turn_count_banked; // 0x110
uint16 turn_count_banked; // 0x110
uint16 turn_count_sloped; // 0x112 X = number turns > 3 elements
union {
uint8 inversions; // 0x114 (???X XXXX)
@@ -410,8 +410,8 @@ enum {
RIDE_ENTRY_FLAG_16 = 1 << 16, // 0x10000
RIDE_ENTRY_DISABLE_FIRST_TWO_OPERATING_MODES = 1 << 17, // 0x20000
RIDE_ENTRY_FLAG_18 = 1 << 18, // 0x40000
RIDE_ENTRY_FLAG_19 = 1 << 19, // 0x80000
// Must be set with swing mode 1 as well.
RIDE_ENTRY_FLAG_19 = 1 << 19, // 0x80000
// Must be set with swing mode 1 as well.
RIDE_ENTRY_FLAG_ALTERNATIVE_SWING_MODE_2 = 1 << 20, // 0x100000
RIDE_ENTRY_FLAG_21 = 1 << 21, // 0x200000
RIDE_ENTRY_FLAG_22 = 1 << 22, // 0x400000

View File

@@ -1316,7 +1316,7 @@ const uint16 RideCrookedHouseLength[1] = {
};
/* rct2: 0x0097D7C8, 0x0097D7C9, 0x0097D7CA */
const rct_ride_lift_data RideLiftData[] = {
const rct_ride_lift_data RideLiftData[] = {
{ SOUND_LIFT_3, 7, 7 }, // Spiral Roller coaster
{ SOUND_LIFT_1, 4, 6 }, // Stand Up Coaster
{ SOUND_LIFT_1, 4, 6 }, // Suspended Swinging
@@ -1408,4 +1408,4 @@ const rct_ride_lift_data RideLiftData[] = {
{ 255, 5, 5 }, // Mine Ride
{ SOUND_LIFT_6, 4, 6 }, // (none)
{ 255, 4, 6 } // LIM Launched Roller Coaster
};
};

View File

@@ -981,7 +981,7 @@ static rating_tuple get_banked_turns_rating(rct_ride* ride) {
*/
static rating_tuple get_sloped_turns_rating(rct_ride* ride) {
rating_tuple rating;
int no_4_plus_turns = get_turn_count_4_plus_elements(ride, 2);
int no_3_turns = get_turn_count_3_elements(ride, 2);
int no_2_turns = get_turn_count_2_elements(ride, 2);

View File

@@ -82,7 +82,7 @@ static rct_xy16 loc_7667AC[] = {
/**
*
* rct2: 0x0142811C
* rct2: 0x0142811C
* Can be calculated as Rounddown(34*sin(x)+0.5)
* where x is in 7.5 deg segments.
*/
@@ -1028,7 +1028,7 @@ static void shop_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 directi
RCT2_GLOBAL(0x009DEA52, uint16) = 2;
RCT2_GLOBAL(0x009DEA54, uint16) = 2;
RCT2_GLOBAL(0x009DEA56, sint16) = height16;
sub_98199C(0, 45, imageId, 0, height, 28, 28, rotation);
sub_98199C(0, 45, imageId, 0, height, 28, 28, rotation);
} else {
RCT2_GLOBAL(0x009DEA52, uint16) = 2;
RCT2_GLOBAL(0x009DEA54, uint16) = 2;
@@ -1099,7 +1099,7 @@ static void facility_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 dir
RCT2_GLOBAL(0x009DEA52, uint16) = direction == 3 ? 28 : 2;
RCT2_GLOBAL(0x009DEA54, uint16) = direction == 0 ? 28 : 2;
RCT2_GLOBAL(0x009DEA56, sint16) = height16;
sub_98199C(0, 29, imageId, 0, height, lengthY, lengthX, rotation);
sub_98199C(0, 29, imageId, 0, height, lengthY, lengthX, rotation);
} else {
// Door image or base
RCT2_GLOBAL(0x009DEA52, uint16) = direction == 3 ? 28 : 2;

View File

@@ -6426,37 +6426,37 @@ static bool vehicle_update_motion_collision_detection(
rct_vehicle *vehicle, sint16 x, sint16 y, sint16 z, uint16* otherVehicleIndex
) {
if (vehicle->update_flags & VEHICLE_UPDATE_FLAG_1) return false;
rct_ride_type_vehicle *vehicleEntry = vehicle_get_vehicle_entry(vehicle);
if (!(vehicleEntry->flags_b & VEHICLE_ENTRY_FLAG_B_6)){
vehicle->var_C4 = 0;
rct_vehicle* collideVehicle = GET_VEHICLE(*otherVehicleIndex);
if (vehicle == collideVehicle) return false;
sint32 x_diff = abs(x - collideVehicle->x);
if (x_diff > 0x7FFF) return false;
sint32 y_diff = abs(y - collideVehicle->y);
if (y_diff > 0x7FFF) return false;
if (x_diff + y_diff > 0xFFFF) return false;
sint32 z_diff = abs(z - collideVehicle->z);
if (x_diff + y_diff + z_diff > 0xFFFF) return false;
uint16 ecx = min(vehicle->var_44 + collideVehicle->var_44, 560);
ecx = ((ecx >> 1) * 30) >> 8;
if (x_diff + y_diff + z_diff >= ecx) return false;
uint8 direction = (vehicle->sprite_direction - collideVehicle->sprite_direction + 7) & 0x1F;
if (direction >= 0xF) return false;
return true;
}
uint16 eax = ((x / 32) << 8) + (y / 32);
// TODO change to using a better technique
uint32* ebp = RCT2_ADDRESS(0x009A37C4, uint32);
@@ -6468,53 +6468,53 @@ static bool vehicle_update_motion_collision_detection(
for(; collideId != 0xFFFF; collideId = collideVehicle->next_in_quadrant){
collideVehicle = GET_VEHICLE(collideId);
if (collideVehicle == vehicle) continue;
if (collideVehicle->sprite_identifier != SPRITE_IDENTIFIER_VEHICLE) continue;
sint32 z_diff = abs(collideVehicle->z - z);
if (z_diff > 16) continue;
rct_ride_type_vehicle* collideType = vehicle_get_vehicle_entry(collideVehicle);
if (!(collideType->flags_b & VEHICLE_ENTRY_FLAG_B_6)) continue;
sint32 x_diff = abs(collideVehicle->x - x);
if (x_diff > 0x7FFF) continue;
sint32 y_diff = abs(collideVehicle->y - y);
if (y_diff > 0x7FFF) continue;
if (x_diff + y_diff > 0xFFFF) continue;
uint8 cl = min(vehicle->var_CD, collideVehicle->var_CD);
uint8 ch = max(vehicle->var_CD, collideVehicle->var_CD);
if (cl != ch){
if (cl == 5 && ch == 6) continue;
}
uint32 ecx = vehicle->var_44 + collideVehicle->var_44;
ecx = ((ecx >> 1) * 30) >> 8;
if (x_diff + y_diff >= ecx) continue;
if (!(collideType->flags_b & VEHICLE_ENTRY_FLAG_B_14)){
mayCollide = true;
break;
}
uint8 direction = (vehicle->sprite_direction - collideVehicle->sprite_direction - 6) & 0x1F;
if (direction < 0x14) continue;
sint16 next_x_diff = abs(x + RCT2_ADDRESS(0x009A3B04, sint16)[vehicle->sprite_direction*2]-collideVehicle->x);
sint16 next_y_diff = abs(y + RCT2_ADDRESS(0x009A3B06, sint16)[vehicle->sprite_direction*2]-collideVehicle->y);
if (next_x_diff + next_y_diff < x_diff + y_diff){
mayCollide = true;
break;
}
}
if (mayCollide == true) {
break;
@@ -6523,12 +6523,12 @@ static bool vehicle_update_motion_collision_detection(
// TODO change this
eax += *ebp;
}
if (mayCollide == false) {
vehicle->var_C4 = 0;
return false;
}
vehicle->var_C4++;
if (vehicle->var_C4 < 200) {
vehicle->update_flags |= VEHICLE_UPDATE_FLAG_6;
@@ -6538,7 +6538,7 @@ static bool vehicle_update_motion_collision_detection(
}
// TODO Is it possible for collideVehicle to be NULL?
if (vehicle->status == VEHICLE_STATUS_MOVING_TO_END_OF_STATION){
if (vehicle->sprite_direction == 0) {
if (vehicle->x <= collideVehicle->x) {
@@ -6561,14 +6561,14 @@ static bool vehicle_update_motion_collision_detection(
}
}
}
if (collideVehicle->status == VEHICLE_STATUS_TRAVELLING_BOAT &&
vehicle->status != VEHICLE_STATUS_ARRIVING &&
vehicle->status != VEHICLE_STATUS_TRAVELLING
) {
return false;
}
vehicle->update_flags |= VEHICLE_UPDATE_FLAG_6;
if (otherVehicleIndex != NULL)
*otherVehicleIndex = collideId;