mirror of
https://github.com/izzy2lost/Diddy-Kong-Racing.git
synced 2026-06-19 01:16:26 -07:00
Refactored Object structure (#650)
* remove ObjectSegment from Object * remove some unused structs * remove SegmentPropertiesObject from Object * object types * remove unneeded structs * save * fix build * remove unneeded unk64 union fields * get rid of unk64 * update score * Apply suggestions from code review Co-authored-by: Ryan Myers <ryan.p.myers@gmail.com> --------- Co-authored-by: Ryan Myers <ryan.p.myers@gmail.com>
This commit is contained in:
+151
-86
@@ -6,9 +6,9 @@
|
||||
#include "level_object_entries.h"
|
||||
|
||||
/**
|
||||
* Objects have a union at offset 0x78, that's 8 bytes large.
|
||||
* Objects have a union at offset 0x78, that's 8 bytes large.
|
||||
* Here's a collection of unions to help improve readability for them.
|
||||
*/
|
||||
*/
|
||||
|
||||
typedef struct ObjPropertyCommon {
|
||||
s32 unk0;
|
||||
@@ -20,10 +20,9 @@ typedef struct ObjPropertyDistance {
|
||||
s32 unk4;
|
||||
} ObjPropertyDistance;
|
||||
|
||||
typedef struct ObjPropertySpeed {
|
||||
typedef struct ObjPropertyTorchMist {
|
||||
s32 speed;
|
||||
s32 unk4;
|
||||
} ObjPropertySpeed;
|
||||
} ObjPropertyTorchMist;
|
||||
|
||||
typedef struct ObjPropertyBanana {
|
||||
s32 status;
|
||||
@@ -48,110 +47,152 @@ typedef struct ObjPropertyLog {
|
||||
} ObjPropertyLog;
|
||||
|
||||
typedef struct ObjPropertyScenery {
|
||||
struct Object *interactObj;
|
||||
s16 hitTimer;
|
||||
s16 angleVel;
|
||||
struct Object *interactObj;
|
||||
s16 hitTimer;
|
||||
s16 angleVel;
|
||||
} ObjPropertyScenery;
|
||||
|
||||
typedef struct ObjPropertyFireball {
|
||||
struct Object *obj;
|
||||
s32 timer;
|
||||
struct Object *obj;
|
||||
s32 timer;
|
||||
} ObjPropertyFireball;
|
||||
|
||||
typedef struct ObjPropertyLasergun {
|
||||
s32 timer;
|
||||
struct Object_LaserGun *obj;
|
||||
} ObjPropertyLasergun;
|
||||
typedef struct ObjPropertyWizPigShip {
|
||||
s32 unk0;
|
||||
s32 timer;
|
||||
} ObjPropertyWizPigShip;
|
||||
|
||||
typedef struct ObjPropertyLaserbolt {
|
||||
s32 timer;
|
||||
struct Object_LaserGun *obj;
|
||||
} ObjPropertyLaserbolt;
|
||||
|
||||
typedef struct ObjPropertyTrophyCabinet {
|
||||
s32 action;
|
||||
s32 trophy;
|
||||
s32 action;
|
||||
s32 trophy;
|
||||
} ObjPropertyTrophyCabinet;
|
||||
|
||||
typedef struct ObjPropertyEggSpawner {
|
||||
struct Object *egg;
|
||||
struct Object *egg;
|
||||
} ObjPropertyEggSpawner;
|
||||
|
||||
typedef struct ObjPropertyZipper {
|
||||
s32 radius;
|
||||
s32 radius;
|
||||
} ObjPropertyZipper;
|
||||
|
||||
typedef struct ObjPropertyCharacterFlag {
|
||||
s32 playerID;
|
||||
s32 characterID;
|
||||
s32 playerID;
|
||||
s32 characterID;
|
||||
} ObjPropertyCharacterFlag;
|
||||
|
||||
typedef struct ObjPropertyNPC {
|
||||
s32 action;
|
||||
s32 timer;
|
||||
} ObjPropertyNPC;
|
||||
typedef struct ObjPropertyGoldenBalloon {
|
||||
s32 action;
|
||||
s32 timer;
|
||||
} ObjPropertyGoldenBalloon;
|
||||
|
||||
typedef struct ObjPropertySilverCoin {
|
||||
s32 action;
|
||||
s32 timer;
|
||||
} ObjPropertySilverCoin;
|
||||
|
||||
typedef struct ObjPropertyTT {
|
||||
s32 action;
|
||||
s32 timer;
|
||||
} ObjPropertyTT;
|
||||
|
||||
typedef struct ObjPropertyTaj {
|
||||
s32 action;
|
||||
s32 timer;
|
||||
} ObjPropertyTaj;
|
||||
|
||||
typedef struct ObjPropertyLavaSpurt {
|
||||
s32 actionTimer;
|
||||
s32 delayTimer;
|
||||
s32 actionTimer;
|
||||
s32 delayTimer;
|
||||
} ObjPropertyLavaSpurt;
|
||||
|
||||
typedef struct ObjPropertyPosArrow {
|
||||
s32 playerID;
|
||||
} ObjPropertyPosArrow;
|
||||
|
||||
typedef struct ObjPropertyAnimation {
|
||||
s32 action;
|
||||
s32 behaviourID;
|
||||
s32 action;
|
||||
s32 behaviourID;
|
||||
} ObjPropertyAnimation;
|
||||
|
||||
typedef struct ObjPropertyAnimatedObject {
|
||||
s32 unk0;
|
||||
s32 unk4;
|
||||
} ObjPropertyAnimatedObject;
|
||||
|
||||
typedef struct ObjPropertyInfoPoint {
|
||||
s32 radius;
|
||||
s32 visible;
|
||||
s32 radius;
|
||||
s32 visible;
|
||||
} ObjPropertyInfoPoint;
|
||||
|
||||
typedef struct ObjPropertyBombExplosion {
|
||||
s32 timer;
|
||||
s32 unk4;
|
||||
s32 timer;
|
||||
s32 unk4;
|
||||
} ObjPropertyBombExplosion;
|
||||
|
||||
typedef struct ObjPropertyLighthouse {
|
||||
s32 active;
|
||||
s32 active;
|
||||
} ObjPropertyLighthouse;
|
||||
|
||||
typedef struct ObjPropertyDoor {
|
||||
s32 closeAngle;
|
||||
s32 openAngle;
|
||||
s32 closeAngle;
|
||||
s32 openAngle;
|
||||
} ObjPropertyDoor;
|
||||
|
||||
typedef struct ObjPropertyBridgeWhaleRamp {
|
||||
s32 unk0;
|
||||
} ObjPropertyBridgeWhaleRamp;
|
||||
|
||||
typedef struct ObjPropertyRampSwitch {
|
||||
s32 unk0;
|
||||
} ObjPropertyRampSwitch;
|
||||
|
||||
typedef struct ObjPropertySkyControl {
|
||||
s32 setting;
|
||||
s32 radius;
|
||||
s32 setting;
|
||||
s32 radius;
|
||||
} ObjPropertySkyControl;
|
||||
|
||||
typedef struct ObjPropertyTreasureSucker {
|
||||
s32 playerID;
|
||||
s32 spawnTimer;
|
||||
s32 playerID;
|
||||
s32 spawnTimer;
|
||||
} ObjPropertyTreasureSucker;
|
||||
|
||||
typedef struct ObjPropertyTreasureBanana {
|
||||
s32 diff;
|
||||
struct Object_Racer *racer;
|
||||
s32 diff;
|
||||
struct Object_Racer *racer;
|
||||
} ObjPropertyTreasureBanana;
|
||||
|
||||
typedef struct ObjPropertyFlyCoin {
|
||||
s32 diff;
|
||||
struct Object_Racer *racer;
|
||||
} ObjPropertyFlyCoin;
|
||||
|
||||
typedef struct ObjPropertyBananaSpawner {
|
||||
s32 timer;
|
||||
s32 spawn;
|
||||
s32 timer;
|
||||
s32 spawn;
|
||||
} ObjPropertyBananaSpawner;
|
||||
|
||||
typedef struct ObjPropertyWorldKey {
|
||||
s32 keyID;
|
||||
s32 keyID;
|
||||
} ObjPropertyWorldKey;
|
||||
|
||||
typedef struct ObjPropertyWeaponBalloon {
|
||||
s32 balloonID;
|
||||
s32 balloonID;
|
||||
s32 particleTimer;
|
||||
} ObjPropertyWeaponBalloon;
|
||||
|
||||
typedef struct ObjPropertyRacer {
|
||||
struct Object *unk0;
|
||||
struct Object *unk0;
|
||||
s32 unk4;
|
||||
} ObjPropertyRacer;
|
||||
|
||||
typedef struct ObjPropertySetupPoint {
|
||||
s32 racerIndex;
|
||||
s32 entranceID;
|
||||
s32 racerIndex;
|
||||
s32 entranceID;
|
||||
} ObjPropertySetupPoint;
|
||||
|
||||
typedef struct ObjPropertyWeapon {
|
||||
@@ -162,24 +203,32 @@ typedef struct ObjPropertyWeapon {
|
||||
} ObjPropertyWeapon;
|
||||
|
||||
typedef struct ObjPropertyCamControl {
|
||||
s32 cameraID;
|
||||
s32 cameraID;
|
||||
} ObjPropertyCamControl;
|
||||
|
||||
typedef struct ObjPropertyTimeTrial {
|
||||
s32 timestamp;
|
||||
struct ObjectHeader *header;
|
||||
s32 timestamp;
|
||||
struct ObjectHeader *header;
|
||||
} ObjPropertyTimeTrial;
|
||||
|
||||
typedef struct ObjPropertyDinoWhale {
|
||||
s32 unk0;
|
||||
} ObjPropertyDinoWhale;
|
||||
|
||||
typedef struct ObjPropertyBubbler {
|
||||
s32 unk0;
|
||||
} ObjPropertyBubbler;
|
||||
|
||||
typedef struct ObjPropertyBoost {
|
||||
struct Object *obj;
|
||||
union {
|
||||
s32 indexes; // Keep this for compatibility
|
||||
s32 indexes; // Keep this for compatibility
|
||||
// This is a bitfield definition for the bits in indexes.
|
||||
// It won't match when used, but it's useful for understanding the structure.
|
||||
struct {
|
||||
s32 racerIndex : 4; // bits 28-31 ((indexes >> 28) & 0xF)
|
||||
s32 vertIndex : 14; // bits 14-27 ((indexes >> 14) & 0x3FFF)
|
||||
s32 trisIndex : 14; // bits 0-13 (indexes & 0x3FFF)
|
||||
s32 racerIndex : 4; // bits 28-31 ((indexes >> 28) & 0xF)
|
||||
s32 vertIndex : 14; // bits 14-27 ((indexes >> 14) & 0x3FFF)
|
||||
s32 trisIndex : 14; // bits 0-13 (indexes & 0x3FFF)
|
||||
};
|
||||
};
|
||||
} ObjPropertyBoost;
|
||||
@@ -187,37 +236,53 @@ typedef struct ObjPropertyBoost {
|
||||
typedef struct ObjProperties {
|
||||
union {
|
||||
ObjPropertyCommon common;
|
||||
ObjPropertyDistance distance;
|
||||
ObjPropertySpeed speed;
|
||||
ObjPropertyBanana banana;
|
||||
ObjPropertyName levelName;
|
||||
ObjPropertyProjectile projectile;
|
||||
ObjPropertyLog log;
|
||||
ObjPropertyScenery scenery;
|
||||
ObjPropertyFireball fireball;
|
||||
ObjPropertyLasergun lasergun;
|
||||
ObjPropertyTrophyCabinet trophyCabinet;
|
||||
ObjPropertyEggSpawner eggSpawner;
|
||||
ObjPropertyZipper zipper;
|
||||
ObjPropertyCharacterFlag characterFlag;
|
||||
ObjPropertyNPC npc;
|
||||
ObjPropertyLavaSpurt lavaSpurt;
|
||||
ObjPropertyAnimation animatedObj;
|
||||
ObjPropertyInfoPoint infoPoint;
|
||||
ObjPropertyBombExplosion bombExplosion;
|
||||
ObjPropertyLighthouse lighthouse;
|
||||
ObjPropertyDoor door;
|
||||
ObjPropertySkyControl skyControl;
|
||||
ObjPropertyTreasureSucker treasureSucker;
|
||||
ObjPropertyTreasureBanana treasureBanana;
|
||||
ObjPropertyBananaSpawner bananaSpawner;
|
||||
ObjPropertyWorldKey worldKey;
|
||||
ObjPropertyWeaponBalloon weaponBalloon;
|
||||
ObjPropertyRacer racer;
|
||||
ObjPropertySetupPoint setupPoint;
|
||||
ObjPropertyWeapon weapon;
|
||||
ObjPropertyCamControl camControl;
|
||||
ObjPropertyTimeTrial timeTrial;
|
||||
ObjPropertyDistance distance; // BHV_FOG_CHANGER, BHV_WEATHER
|
||||
ObjPropertyTorchMist torchMist; // BHV_TORCH_MIST
|
||||
ObjPropertyBanana banana; // BHV_BANANA
|
||||
ObjPropertyName levelName; // BHV_LEVEL_NAME
|
||||
ObjPropertyProjectile projectile; // BHV_WEAPON_2
|
||||
ObjPropertyLog log; // BHV_LOG
|
||||
ObjPropertyScenery scenery; // BHV_SCENERY
|
||||
ObjPropertyFireball fireball; // BHV_FIREBALL_OCTOWEAPON, BHV_FIREBALL_OCTOWEAPON_2
|
||||
ObjPropertyLaserbolt laserbolt; // BHV_LASER_BOLT
|
||||
ObjPropertyTrophyCabinet trophyCabinet; // BHV_TROPHY_CABINET
|
||||
ObjPropertyEggSpawner eggSpawner; // BHV_EGG_CREATOR
|
||||
ObjPropertyZipper zipper; // BHV_ZIPPER_GROUND
|
||||
ObjPropertyCharacterFlag characterFlag; // BHV_CHARACTER_FLAG
|
||||
ObjPropertyGoldenBalloon goldenBalloon; // BHV_GOLDEN_BALLOON
|
||||
ObjPropertySilverCoin silverCoin; // BHV_SILVER_COIN_2, BHV_SILVER_COIN
|
||||
ObjPropertyTT tt; // BHV_STOPWATCH_MAN
|
||||
ObjPropertyTaj taj; // BHV_PARK_WARDEN
|
||||
ObjPropertyLavaSpurt lavaSpurt; // BHV_LAVA_SPURT
|
||||
ObjPropertyPosArrow posArrow; // BHV_POS_ARROW
|
||||
ObjPropertyAnimation animation; // BHV_ANIMATION
|
||||
ObjPropertyWizPigShip wizpigship; // BHV_WIZPIG_SHIP
|
||||
ObjPropertyAnimatedObject animatedObj; // BHV_DINO_WHALE, BHV_ANIMATED_OBJECT, BHV_CAMERA_ANIMATION
|
||||
// BHV_CAR_ANIMATION, BHV_CHARACTER_SELECT, BHV_VEHICLE_ANIMATION
|
||||
// BHV_HIT_TESTER, BHV_HIT_TESTER_2, BHV_PARK_WARDEN_2
|
||||
// BHV_ANIMATED_OBJECT_2, BHV_WIZPIG_SHIP, BHV_ANIMATED_OBJECT_3
|
||||
// BHV_ANIMATED_OBJECT_4, BHV_SNOWBALL, BHV_SNOWBALL_2
|
||||
// BHV_SNOWBALL_3, BHV_SNOWBALL_4, BHV_HIT_TESTER_3
|
||||
// BHV_HIT_TESTER_4, BHV_DOOR_OPENER, BHV_PIG_ROCKETEER
|
||||
// BHV_WIZPIG_GHOSTS
|
||||
ObjPropertyInfoPoint infoPoint; // BHV_INFO_POINT
|
||||
ObjPropertyBombExplosion bombExplosion; // BHV_BOMB_EXPLOSION
|
||||
ObjPropertyLighthouse lighthouse; // BHV_TELEPORT
|
||||
ObjPropertyDoor door; // BHV_DOOR, BHV_TT_DOOR
|
||||
ObjPropertyBridgeWhaleRamp bridgeWhaleRamp; // BHV_BRIDGE_WHALE_RAMP
|
||||
ObjPropertyRampSwitch rampSwitch; // BHV_RAMP_SWITCH
|
||||
ObjPropertySkyControl skyControl; // BHV_SKY_CONTROL
|
||||
ObjPropertyTreasureSucker treasureSucker; // BHV_TREASURE_SUCKER
|
||||
ObjPropertyFlyCoin flyCoin; // BHV_FLY_COIN
|
||||
ObjPropertyBananaSpawner bananaSpawner; // BHV_BANANA_SPAWNER
|
||||
ObjPropertyWorldKey worldKey; // BHV_WORLD_KEY
|
||||
ObjPropertyWeaponBalloon weaponBalloon; // BHV_WEAPON_BALLOON
|
||||
ObjPropertySetupPoint setupPoint; // BHV_SETUP_POINT
|
||||
ObjPropertyWeapon weapon; // BHV_WEAPON
|
||||
ObjPropertyCamControl camControl; // BHV_CAMERA_CONTROL
|
||||
ObjPropertyTimeTrial timeTrial; // BHV_TIMETRIAL_GHOST
|
||||
ObjPropertyDinoWhale dinoWhale; // BHV_DINO_WHALE
|
||||
ObjPropertyBubbler bubbler; // BHV_BUBBLER
|
||||
ObjPropertyBoost boost;
|
||||
};
|
||||
} ObjProperties;
|
||||
|
||||
+1206
-1358
File diff suppressed because it is too large
Load Diff
+46
-50
@@ -143,7 +143,7 @@ VehicleSoundData *racer_sound_init(s32 characterId, s32 vehicleId) {
|
||||
*/
|
||||
void racer_sound_update(Object *obj, u32 buttonsPressed, u32 buttonsHeld, s32 ticksDelta) {
|
||||
if (gVehicleSounds) {
|
||||
gSoundRacerObj = &obj->unk64->racer;
|
||||
gSoundRacerObj = obj->racer;
|
||||
gRacerSound = gSoundRacerObj->vehicleSound;
|
||||
if (gRacerSound != NULL) {
|
||||
if (get_race_countdown() != 0) {
|
||||
@@ -157,9 +157,9 @@ void racer_sound_update(Object *obj, u32 buttonsPressed, u32 buttonsHeld, s32 ti
|
||||
gRacerSound->racerPos.y = -32000.0f;
|
||||
gRacerSound->racerPos.z = -32000.0f;
|
||||
} else {
|
||||
gRacerSound->racerPos.x = obj->segment.trans.x_position;
|
||||
gRacerSound->racerPos.y = obj->segment.trans.y_position;
|
||||
gRacerSound->racerPos.z = obj->segment.trans.z_position;
|
||||
gRacerSound->racerPos.x = obj->trans.x_position;
|
||||
gRacerSound->racerPos.y = obj->trans.y_position;
|
||||
gRacerSound->racerPos.z = obj->trans.z_position;
|
||||
switch (gSoundRacerObj->vehicleIDPrev) {
|
||||
case VEHICLE_HOVERCRAFT:
|
||||
racer_sound_hovercraft(obj, buttonsPressed, buttonsHeld, ticksDelta);
|
||||
@@ -357,8 +357,8 @@ void racer_sound_car(Object *obj, u32 buttonsPressed, u32 buttonsHeld, s32 ticks
|
||||
sndp_set_param(gRacerSound->brakeSound, AL_SNDP_VOL_EVT, 0);
|
||||
} else {
|
||||
sndp_set_param(gRacerSound->brakeSound, AL_SNDP_VOL_EVT, gRacerSound->brakeSoundVolume << 8);
|
||||
audspat_calculate_echo(gRacerSound->brakeSound, obj->segment.trans.x_position,
|
||||
obj->segment.trans.y_position, obj->segment.trans.z_position);
|
||||
audspat_calculate_echo(gRacerSound->brakeSound, obj->trans.x_position, obj->trans.y_position,
|
||||
obj->trans.z_position);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -389,8 +389,7 @@ void racer_sound_hovercraft(Object *obj, UNUSED u32 buttonsPressed, u32 buttonsH
|
||||
u8 i;
|
||||
|
||||
if (get_race_countdown() == 0) {
|
||||
speed = sqrtf((obj->segment.x_velocity * obj->segment.x_velocity) +
|
||||
(obj->segment.z_velocity * obj->segment.z_velocity));
|
||||
speed = sqrtf((obj->x_velocity * obj->x_velocity) + (obj->z_velocity * obj->z_velocity));
|
||||
} else {
|
||||
speed = 0.0f;
|
||||
}
|
||||
@@ -507,9 +506,8 @@ void racer_sound_plane(Object *obj, UNUSED u32 buttonsPressed, u32 buttonsHeld,
|
||||
f32 temp2;
|
||||
|
||||
if (get_race_countdown() == 0) {
|
||||
speed = sqrtf((obj->segment.x_velocity * obj->segment.x_velocity) +
|
||||
(obj->segment.z_velocity * obj->segment.z_velocity) +
|
||||
(obj->segment.y_velocity * obj->segment.y_velocity));
|
||||
speed = sqrtf((obj->x_velocity * obj->x_velocity) + (obj->z_velocity * obj->z_velocity) +
|
||||
(obj->y_velocity * obj->y_velocity));
|
||||
} else {
|
||||
speed = 0.0f;
|
||||
}
|
||||
@@ -557,8 +555,8 @@ void racer_sound_plane(Object *obj, UNUSED u32 buttonsPressed, u32 buttonsHeld,
|
||||
targetPitch += gRacerSound->thrustPitch;
|
||||
|
||||
// Add pitch modifiers based on pitch and roll angles of the plane.
|
||||
xSine = sins_f(obj->segment.trans.rotation.x_rotation);
|
||||
zSine = sins_f(obj->segment.trans.rotation.z_rotation);
|
||||
xSine = sins_f(obj->trans.rotation.x_rotation);
|
||||
zSine = sins_f(obj->trans.rotation.z_rotation);
|
||||
temp = gRacerSound->pitchAnglePitchScale * xSine;
|
||||
temp2 = gRacerSound->rollAnglePitchScale * zSine;
|
||||
temp2 = ABSF(temp2);
|
||||
@@ -618,7 +616,7 @@ void racer_sound_plane(Object *obj, UNUSED u32 buttonsPressed, u32 buttonsHeld,
|
||||
void racer_sound_free(Object *obj) {
|
||||
s32 i;
|
||||
|
||||
gRacerSound = obj->unk64->racer.vehicleSound;
|
||||
gRacerSound = obj->racer->vehicleSound;
|
||||
if (gRacerSound != NULL) {
|
||||
for (i = 0; i != 2; i++) {
|
||||
if (gRacerSound->soundHandle[i] != NULL) {
|
||||
@@ -640,7 +638,7 @@ void racer_sound_free(Object *obj) {
|
||||
}
|
||||
}
|
||||
mempool_free(gRacerSound);
|
||||
obj->unk64->racer.vehicleSound = NULL;
|
||||
obj->racer->vehicleSound = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -681,8 +679,8 @@ void racer_sound_doppler_effect(Object *observerObj, Camera *camera, Object *sou
|
||||
questionable logic deserves to be pointed out.
|
||||
*/
|
||||
|
||||
observerRacer = &observerObj->unk64->racer;
|
||||
sourceRacer = &sourceObj->unk64->racer;
|
||||
observerRacer = observerObj->racer;
|
||||
sourceRacer = sourceObj->racer;
|
||||
gRacerSound = sourceRacer->vehicleSound;
|
||||
if (gRacerSound != NULL) {
|
||||
if (camera != NULL) {
|
||||
@@ -695,9 +693,9 @@ void racer_sound_doppler_effect(Object *observerObj, Camera *camera, Object *sou
|
||||
} else {
|
||||
// If the observer is a player, things get unnecessarily complex.
|
||||
// First, fetch the observer's position.
|
||||
xObs = observerObj->segment.trans.x_position;
|
||||
yObs = observerObj->segment.trans.y_position;
|
||||
zObs = observerObj->segment.trans.z_position;
|
||||
xObs = observerObj->trans.x_position;
|
||||
yObs = observerObj->trans.y_position;
|
||||
zObs = observerObj->trans.z_position;
|
||||
|
||||
// Then compute the observer's speed.
|
||||
switch (observerRacer->vehicleID) {
|
||||
@@ -711,14 +709,14 @@ void racer_sound_doppler_effect(Object *observerObj, Camera *camera, Object *sou
|
||||
break;
|
||||
case VEHICLE_HOVERCRAFT:
|
||||
// 2D ground speed
|
||||
obsSpeed = sqrtf(observerObj->segment.x_velocity * observerObj->segment.x_velocity +
|
||||
observerObj->segment.z_velocity * observerObj->segment.z_velocity);
|
||||
obsSpeed = sqrtf(observerObj->x_velocity * observerObj->x_velocity +
|
||||
observerObj->z_velocity * observerObj->z_velocity);
|
||||
break;
|
||||
default:
|
||||
// Full 3D velocity
|
||||
obsSpeed = sqrtf(observerObj->segment.x_velocity * observerObj->segment.x_velocity +
|
||||
observerObj->segment.z_velocity * observerObj->segment.z_velocity +
|
||||
observerObj->segment.y_velocity * observerObj->segment.y_velocity);
|
||||
obsSpeed = sqrtf(observerObj->x_velocity * observerObj->x_velocity +
|
||||
observerObj->z_velocity * observerObj->z_velocity +
|
||||
observerObj->y_velocity * observerObj->y_velocity);
|
||||
break;
|
||||
}
|
||||
// For some reason, speed is capped at 15, and a velocity factor is derived from that.
|
||||
@@ -730,9 +728,9 @@ void racer_sound_doppler_effect(Object *observerObj, Camera *camera, Object *sou
|
||||
}
|
||||
|
||||
// Calculate the distance between source and observer
|
||||
deltaX = sourceObj->segment.trans.x_position - xObs;
|
||||
deltaY = sourceObj->segment.trans.y_position - yObs;
|
||||
deltaZ = sourceObj->segment.trans.z_position - zObs;
|
||||
deltaX = sourceObj->trans.x_position - xObs;
|
||||
deltaY = sourceObj->trans.y_position - yObs;
|
||||
deltaZ = sourceObj->trans.z_position - zObs;
|
||||
distance = sqrtf(((deltaX * deltaX) + (deltaY * deltaY)) + (deltaZ * deltaZ));
|
||||
|
||||
// Compute relative velocity — this is actually all that's needed for the Doppler effect!
|
||||
@@ -795,7 +793,7 @@ void racer_sound_update_all(Object **racerObjs, s32 numRacers, Camera *cameras,
|
||||
|
||||
// First, calculate engine and idle sound parameters for each player.
|
||||
for (i = 0; i < numCameras; i++) {
|
||||
racer = &racerObjs[i]->unk64->racer;
|
||||
racer = racerObjs[i]->racer;
|
||||
if (racer != NULL) {
|
||||
gRacerSound = racer->vehicleSound;
|
||||
} else {
|
||||
@@ -806,9 +804,9 @@ void racer_sound_update_all(Object **racerObjs, s32 numRacers, Camera *cameras,
|
||||
if (racer->raceFinished || check_if_showing_cutscene_camera()) {
|
||||
// If the race is finished or a cutscene is playing, the vehicle is considered to move relative to the
|
||||
// camera, so we calculate the engine sound's pitch, volume, and stereo pan accordingly.
|
||||
deltaX = racerObjs[i]->segment.trans.x_position - cameras[i].trans.x_position;
|
||||
deltaY = racerObjs[i]->segment.trans.y_position - cameras[i].trans.y_position;
|
||||
deltaZ = racerObjs[i]->segment.trans.z_position - cameras[i].trans.z_position;
|
||||
deltaX = racerObjs[i]->trans.x_position - cameras[i].trans.x_position;
|
||||
deltaY = racerObjs[i]->trans.y_position - cameras[i].trans.y_position;
|
||||
deltaZ = racerObjs[i]->trans.z_position - cameras[i].trans.z_position;
|
||||
racer_sound_doppler_effect(racerObjs[i], cameras, racerObjs[i], tickDelta);
|
||||
gRacerSound->distToCamera = sqrtf((deltaX * deltaX) + (deltaY * deltaY) + (deltaZ * deltaZ));
|
||||
|
||||
@@ -851,9 +849,8 @@ void racer_sound_update_all(Object **racerObjs, s32 numRacers, Camera *cameras,
|
||||
gRacerSound->engineIdleMaxPitch / 100.0f) *
|
||||
idle_intensity;
|
||||
if (gRacerSound->engineIdleSoundHandle != NULL) {
|
||||
audspat_calculate_echo(
|
||||
gRacerSound->engineIdleSoundHandle, racerObjs[i]->segment.trans.x_position,
|
||||
racerObjs[i]->segment.trans.y_position, racerObjs[i]->segment.trans.z_position);
|
||||
audspat_calculate_echo(gRacerSound->engineIdleSoundHandle, racerObjs[i]->trans.x_position,
|
||||
racerObjs[i]->trans.y_position, racerObjs[i]->trans.z_position);
|
||||
sndp_set_param(gRacerSound->engineIdleSoundHandle, AL_SNDP_VOL_EVT, volume << 8);
|
||||
sndp_set_param(gRacerSound->engineIdleSoundHandle, AL_SNDP_PITCH_EVT, *((u32 *) &pitch));
|
||||
sndp_set_priority(gRacerSound->engineIdleSoundHandle, 80);
|
||||
@@ -897,9 +894,8 @@ void racer_sound_update_all(Object **racerObjs, s32 numRacers, Camera *cameras,
|
||||
func_80001F14(gRacerSound->soundId[j], &gRacerSound->soundHandle[j]);
|
||||
}
|
||||
if (gRacerSound->soundHandle[j] != NULL) {
|
||||
audspat_calculate_echo(gRacerSound->soundHandle[j], racerObjs[i]->segment.trans.x_position,
|
||||
racerObjs[i]->segment.trans.y_position,
|
||||
racerObjs[i]->segment.trans.z_position);
|
||||
audspat_calculate_echo(gRacerSound->soundHandle[j], racerObjs[i]->trans.x_position,
|
||||
racerObjs[i]->trans.y_position, racerObjs[i]->trans.z_position);
|
||||
sndp_set_param(gRacerSound->soundHandle[j], AL_SNDP_VOL_EVT, volume << 8);
|
||||
sndp_set_param(gRacerSound->soundHandle[j], AL_SNDP_PITCH_EVT, *((u32 *) &pitch));
|
||||
sndp_set_priority(gRacerSound->soundHandle[j], 80);
|
||||
@@ -925,7 +921,7 @@ void racer_sound_update_all(Object **racerObjs, s32 numRacers, Camera *cameras,
|
||||
|
||||
// First, reset background volume for each AI vehicle.
|
||||
for (j = numCameras; j < numRacers; j++) {
|
||||
racer = &racerObjs[j]->unk64->racer;
|
||||
racer = racerObjs[j]->racer;
|
||||
if (racer != NULL) {
|
||||
gRacerSound = racer->vehicleSound;
|
||||
if (gRacerSound != NULL) {
|
||||
@@ -940,19 +936,19 @@ void racer_sound_update_all(Object **racerObjs, s32 numRacers, Camera *cameras,
|
||||
// Doppler effect is the only pitch modifier applied here.
|
||||
|
||||
for (i = 0; i < numCameras; i++) {
|
||||
racer = &racerObjs[i]->unk64->racer;
|
||||
racer = racerObjs[i]->racer;
|
||||
for (j = numCameras; j < numRacers; j++) {
|
||||
if (racerObjs[j]->unk64 != NULL) {
|
||||
gRacerSound = racerObjs[j]->unk64->racer.vehicleSound;
|
||||
if (racerObjs[j]->racer != NULL) {
|
||||
gRacerSound = racerObjs[j]->racer->vehicleSound;
|
||||
if (gRacerSound != NULL) {
|
||||
if (racer->raceFinished) {
|
||||
deltaX = racerObjs[j]->segment.trans.x_position - cameras[i].trans.x_position;
|
||||
deltaY = racerObjs[j]->segment.trans.y_position - cameras[i].trans.y_position;
|
||||
deltaZ = racerObjs[j]->segment.trans.z_position - cameras[i].trans.z_position;
|
||||
deltaX = racerObjs[j]->trans.x_position - cameras[i].trans.x_position;
|
||||
deltaY = racerObjs[j]->trans.y_position - cameras[i].trans.y_position;
|
||||
deltaZ = racerObjs[j]->trans.z_position - cameras[i].trans.z_position;
|
||||
} else {
|
||||
deltaX = racerObjs[j]->segment.trans.x_position - racerObjs[i]->segment.trans.x_position;
|
||||
deltaY = racerObjs[j]->segment.trans.y_position - racerObjs[i]->segment.trans.y_position;
|
||||
deltaZ = racerObjs[j]->segment.trans.z_position - racerObjs[i]->segment.trans.z_position;
|
||||
deltaX = racerObjs[j]->trans.x_position - racerObjs[i]->trans.x_position;
|
||||
deltaY = racerObjs[j]->trans.y_position - racerObjs[i]->trans.y_position;
|
||||
deltaZ = racerObjs[j]->trans.z_position - racerObjs[i]->trans.z_position;
|
||||
}
|
||||
gRacerSound->distToCamera = sqrtf((deltaX * deltaX) + (deltaY * deltaY) + (deltaZ * deltaZ));
|
||||
if (gRacerSound->distToCamera < 1500.0f) {
|
||||
@@ -1012,8 +1008,8 @@ void racer_sound_update_all(Object **racerObjs, s32 numRacers, Camera *cameras,
|
||||
// Replace background sounds based on volume priority.
|
||||
//!@bug: loop starts from 1 instead of numCameras — possibly unintended.
|
||||
for (j = 1; j < numRacers; j++) {
|
||||
racer = &racerObjs[j]->unk64->racer;
|
||||
if (racerObjs[j]->unk64 != NULL) {
|
||||
racer = racerObjs[j]->racer;
|
||||
if (racerObjs[j]->racer != NULL) {
|
||||
gRacerSound = racer->vehicleSound;
|
||||
if (gRacerSound != NULL) {
|
||||
// If a sound is currently stopped, check whether it should be restarted and find a suitable slot.
|
||||
|
||||
+36
-37
@@ -1073,15 +1073,15 @@ s32 render_sprite_billboard(Gfx **dList, Mtx **mtx, Vertex **vtx, Object *obj, S
|
||||
// between the object and the camera, as well as properly orienting the sprite in 3D space.
|
||||
|
||||
// Calculate camera position relative to the object's position
|
||||
diffX = gCameraRelPosStackX[gCameraMatrixPos] - obj->segment.trans.x_position;
|
||||
diffY = gCameraRelPosStackY[gCameraMatrixPos] - obj->segment.trans.y_position;
|
||||
diffZ = gCameraRelPosStackZ[gCameraMatrixPos] - obj->segment.trans.z_position;
|
||||
diffX = gCameraRelPosStackX[gCameraMatrixPos] - obj->trans.x_position;
|
||||
diffY = gCameraRelPosStackY[gCameraMatrixPos] - obj->trans.y_position;
|
||||
diffZ = gCameraRelPosStackZ[gCameraMatrixPos] - obj->trans.z_position;
|
||||
|
||||
// Rotate camera coordinates by the object's yaw rotation
|
||||
// to get the camera orientation relative to the vehicle,
|
||||
// e.g., to determine if we view the wheel from the side.
|
||||
sineY = sins_f(obj->segment.trans.rotation.y_rotation);
|
||||
cosY = coss_f(obj->segment.trans.rotation.y_rotation);
|
||||
sineY = sins_f(obj->trans.rotation.y_rotation);
|
||||
cosY = coss_f(obj->trans.rotation.y_rotation);
|
||||
|
||||
temp = (diffX * cosY) + (diffZ * sineY);
|
||||
diffZ = (diffZ * cosY) - (diffX * sineY);
|
||||
@@ -1113,17 +1113,17 @@ s32 render_sprite_billboard(Gfx **dList, Mtx **mtx, Vertex **vtx, Object *obj, S
|
||||
|
||||
// Construct the model matrix for the sprite,
|
||||
// orienting it perpendicular to the camera and applying the calculated tilt angle.
|
||||
diffX = gCameraRelPosStackX[gCameraMatrixPos] - obj->segment.trans.x_position;
|
||||
diffY = gCameraRelPosStackY[gCameraMatrixPos] - obj->segment.trans.y_position;
|
||||
diffZ = gCameraRelPosStackZ[gCameraMatrixPos] - obj->segment.trans.z_position;
|
||||
diffX = gCameraRelPosStackX[gCameraMatrixPos] - obj->trans.x_position;
|
||||
diffY = gCameraRelPosStackY[gCameraMatrixPos] - obj->trans.y_position;
|
||||
diffZ = gCameraRelPosStackZ[gCameraMatrixPos] - obj->trans.z_position;
|
||||
lateralDist = sqrtf((diffX * diffX) + (diffZ * diffZ));
|
||||
gCameraTransform.rotation.y_rotation = arctan2_f(diffX, diffZ);
|
||||
gCameraTransform.rotation.x_rotation = -arctan2_f(diffY, lateralDist);
|
||||
gCameraTransform.rotation.z_rotation = tiltAngle;
|
||||
gCameraTransform.scale = obj->segment.trans.scale;
|
||||
gCameraTransform.x_position = obj->segment.trans.x_position;
|
||||
gCameraTransform.y_position = obj->segment.trans.y_position;
|
||||
gCameraTransform.z_position = obj->segment.trans.z_position;
|
||||
gCameraTransform.scale = obj->trans.scale;
|
||||
gCameraTransform.x_position = obj->trans.x_position;
|
||||
gCameraTransform.y_position = obj->trans.y_position;
|
||||
gCameraTransform.z_position = obj->trans.z_position;
|
||||
mtxf_from_transform(&gCurrentModelMatrixF, &gCameraTransform);
|
||||
gModelMatrixStackPos++;
|
||||
mtxf_mul(&gCurrentModelMatrixF, gModelMatrixF[gModelMatrixStackPos - 1], gModelMatrixF[gModelMatrixStackPos]);
|
||||
@@ -1139,9 +1139,9 @@ s32 render_sprite_billboard(Gfx **dList, Mtx **mtx, Vertex **vtx, Object *obj, S
|
||||
|
||||
// Push the anchor vertex at the object's position
|
||||
v = *vtx;
|
||||
v->x = obj->segment.trans.x_position;
|
||||
v->y = obj->segment.trans.y_position;
|
||||
v->z = obj->segment.trans.z_position;
|
||||
v->x = obj->trans.x_position;
|
||||
v->y = obj->trans.y_position;
|
||||
v->z = obj->trans.z_position;
|
||||
v->r = 255; // These don't actually do anything since vertex colours are disabled anyway.
|
||||
v->g = 255;
|
||||
v->b = 255;
|
||||
@@ -1153,14 +1153,13 @@ s32 render_sprite_billboard(Gfx **dList, Mtx **mtx, Vertex **vtx, Object *obj, S
|
||||
// so the sprite tilts consistently with other objects relative to the camera.
|
||||
// Aspect ratio compensation is applied to maintain proper sprite proportions on screen.
|
||||
if (!gCutsceneCameraActive) {
|
||||
tiltAngle = gCameras[gActiveCameraID].trans.rotation.z_rotation + obj->segment.trans.rotation.z_rotation;
|
||||
tiltAngle = gCameras[gActiveCameraID].trans.rotation.z_rotation + obj->trans.rotation.z_rotation;
|
||||
} else {
|
||||
tiltAngle =
|
||||
gCameras[gActiveCameraID + 4].trans.rotation.z_rotation + obj->segment.trans.rotation.z_rotation;
|
||||
tiltAngle = gCameras[gActiveCameraID + 4].trans.rotation.z_rotation + obj->trans.rotation.z_rotation;
|
||||
}
|
||||
frameID = obj->segment.animFrame;
|
||||
frameID = obj->animFrame;
|
||||
gModelMatrixStackPos++;
|
||||
mtxf_billboard(gModelMatrixF[gModelMatrixStackPos], tiltAngle, obj->segment.trans.scale, gVideoAspectRatio);
|
||||
mtxf_billboard(gModelMatrixF[gModelMatrixStackPos], tiltAngle, obj->trans.scale, gVideoAspectRatio);
|
||||
mtxf_to_mtx(gModelMatrixF[gModelMatrixStackPos], *mtx);
|
||||
gModelMatrix[gModelMatrixStackPos] = *mtx;
|
||||
gSPMatrixDKR((*dList)++, OS_K0_TO_PHYSICAL((*mtx)++), G_MTX_DKR_INDEX_2);
|
||||
@@ -1299,23 +1298,23 @@ void mtx_shear_push(Gfx **dList, Mtx **mtx, Object *obj, Object *objBase, f32 sh
|
||||
f32 arg3_zPos;
|
||||
MtxF matrix_mult;
|
||||
|
||||
cossf_x_arg2 = coss_f(obj->segment.trans.rotation.x_rotation);
|
||||
sinsf_x_arg2 = sins_f(obj->segment.trans.rotation.x_rotation);
|
||||
cossf_y_arg2 = coss_f(obj->segment.trans.rotation.y_rotation);
|
||||
sinsf_y_arg2 = sins_f(obj->segment.trans.rotation.y_rotation);
|
||||
arg2_xPos = obj->segment.trans.x_position;
|
||||
arg2_yPos = obj->segment.trans.y_position;
|
||||
arg2_zPos = obj->segment.trans.z_position;
|
||||
cossf_z_arg3 = coss_f(objBase->segment.trans.rotation.z_rotation);
|
||||
sinsf_z_arg3 = sins_f(objBase->segment.trans.rotation.z_rotation);
|
||||
cossf_x_arg3 = coss_f(objBase->segment.trans.rotation.x_rotation);
|
||||
sinsf_x_arg3 = sins_f(objBase->segment.trans.rotation.x_rotation);
|
||||
cossf_y_arg3 = coss_f(objBase->segment.trans.rotation.y_rotation);
|
||||
sinsf_y_arg3 = sins_f(objBase->segment.trans.rotation.y_rotation);
|
||||
arg3_xPos = objBase->segment.trans.x_position;
|
||||
arg3_yPos = objBase->segment.trans.y_position;
|
||||
arg3_zPos = objBase->segment.trans.z_position;
|
||||
arg2_scale = obj->segment.trans.scale;
|
||||
cossf_x_arg2 = coss_f(obj->trans.rotation.x_rotation);
|
||||
sinsf_x_arg2 = sins_f(obj->trans.rotation.x_rotation);
|
||||
cossf_y_arg2 = coss_f(obj->trans.rotation.y_rotation);
|
||||
sinsf_y_arg2 = sins_f(obj->trans.rotation.y_rotation);
|
||||
arg2_xPos = obj->trans.x_position;
|
||||
arg2_yPos = obj->trans.y_position;
|
||||
arg2_zPos = obj->trans.z_position;
|
||||
cossf_z_arg3 = coss_f(objBase->trans.rotation.z_rotation);
|
||||
sinsf_z_arg3 = sins_f(objBase->trans.rotation.z_rotation);
|
||||
cossf_x_arg3 = coss_f(objBase->trans.rotation.x_rotation);
|
||||
sinsf_x_arg3 = sins_f(objBase->trans.rotation.x_rotation);
|
||||
cossf_y_arg3 = coss_f(objBase->trans.rotation.y_rotation);
|
||||
sinsf_y_arg3 = sins_f(objBase->trans.rotation.y_rotation);
|
||||
arg3_xPos = objBase->trans.x_position;
|
||||
arg3_yPos = objBase->trans.y_position;
|
||||
arg3_zPos = objBase->trans.z_position;
|
||||
arg2_scale = obj->trans.scale;
|
||||
shear *= arg2_scale;
|
||||
matrix_mult[0][0] =
|
||||
((((cossf_z_arg3 * cossf_y_arg3) + (sinsf_z_arg3 * (sinsf_x_arg3 * sinsf_y_arg3))) * cossf_y_arg2) +
|
||||
|
||||
+74
-81
@@ -704,7 +704,7 @@ void hud_render_player(Gfx **dList, Mtx **mtx, Vertex **vertexList, Object *obj,
|
||||
}
|
||||
}
|
||||
if (gShowHUD == FALSE) {
|
||||
racer = &obj->unk64->racer;
|
||||
racer = obj->racer;
|
||||
if (D_8012718A) {
|
||||
gHudController = 1 - racer->playerIndex;
|
||||
} else {
|
||||
@@ -947,7 +947,7 @@ void hud_audio_update(s32 updateRate) {
|
||||
* In a race, render all of the race related HUD.
|
||||
*/
|
||||
void hud_main_race(s32 countdown, Object *obj, s32 updateRate) {
|
||||
Object_Racer *racer = &obj->unk64->racer;
|
||||
Object_Racer *racer = obj->racer;
|
||||
|
||||
cam_set_sprite_anim_mode(SPRITE_ANIM_FRAME_INDEX);
|
||||
hud_course_arrows(racer, updateRate);
|
||||
@@ -1078,14 +1078,14 @@ void hud_main_treasure(s32 countdown, Object *obj, s32 updateRate) {
|
||||
s32 numRacers;
|
||||
s32 i;
|
||||
|
||||
racer = &obj->unk64->racer;
|
||||
racer = obj->racer;
|
||||
racers = get_racer_objects(&numRacers);
|
||||
cam_set_sprite_anim_mode(SPRITE_ANIM_FRAME_INDEX);
|
||||
hud_race_start(countdown, updateRate);
|
||||
switch (gNumActivePlayers) {
|
||||
case 1:
|
||||
for (i = 0; i < numRacers; i++) {
|
||||
racer = &racers[i]->unk64->racer;
|
||||
racer = racers[i]->racer;
|
||||
hud_treasure(racer);
|
||||
if (i == 1) {
|
||||
gCurrentHud->entry[HUD_CHALLENGE_PORTRAIT].pos.x += 55.0f;
|
||||
@@ -1103,7 +1103,7 @@ void hud_main_treasure(s32 countdown, Object *obj, s32 updateRate) {
|
||||
hud_treasure(racer);
|
||||
break;
|
||||
}
|
||||
racer = &obj->unk64->racer;
|
||||
racer = obj->racer;
|
||||
rendermode_reset(&gHudDL);
|
||||
hud_bananas(racer, updateRate);
|
||||
hud_weapon(obj, updateRate);
|
||||
@@ -1114,7 +1114,7 @@ void hud_main_treasure(s32 countdown, Object *obj, s32 updateRate) {
|
||||
* The Egg Collector challenge mode displays the icons of each player and their score.
|
||||
*/
|
||||
void hud_main_eggs(s32 countdown, Object *obj, s32 updateRate) {
|
||||
Object_Racer *racer = &obj->unk64->racer;
|
||||
Object_Racer *racer = obj->racer;
|
||||
if (racer->raceFinished == FALSE) {
|
||||
cam_set_sprite_anim_mode(SPRITE_ANIM_FRAME_INDEX);
|
||||
hud_race_start(countdown, updateRate);
|
||||
@@ -1152,7 +1152,7 @@ void hud_draw_eggs(Object *racerObj, s32 updateRate) {
|
||||
if (gNumActivePlayers == 2) {
|
||||
finishedPlayers = 0;
|
||||
for (i = 0; i < numRacers; i++) {
|
||||
curRacer = &racers[i]->unk64->racer;
|
||||
curRacer = racers[i]->racer;
|
||||
if (curRacer->playerIndex != PLAYER_COMPUTER && curRacer->raceFinished) {
|
||||
finishedPlayers++;
|
||||
}
|
||||
@@ -1162,9 +1162,9 @@ void hud_draw_eggs(Object *racerObj, s32 updateRate) {
|
||||
}
|
||||
}
|
||||
if (racerObj != NULL) {
|
||||
racer = &racerObj->unk64->racer;
|
||||
racer = racerObj->racer;
|
||||
} else {
|
||||
racer = &racers[0]->unk64->racer;
|
||||
racer = racers[0]->racer;
|
||||
}
|
||||
if (numRacers == MAXCONTROLLERS) {
|
||||
cam_set_sprite_anim_mode(SPRITE_ANIM_FRAME_INDEX);
|
||||
@@ -1173,7 +1173,7 @@ void hud_draw_eggs(Object *racerObj, s32 updateRate) {
|
||||
diffX = (gCurrentHud->entry[HUD_EGG_CHALLENGE_ICON].pos.x - portraitX);
|
||||
diffY = (gCurrentHud->entry[HUD_EGG_CHALLENGE_ICON].pos.y - portraitY);
|
||||
for (i = 0; i < MAXCONTROLLERS; i++) {
|
||||
curRacer = &racers[i]->unk64->racer;
|
||||
curRacer = racers[i]->racer;
|
||||
if (gNumActivePlayers < 3 || racer->playerIndex == curRacer->playerIndex) {
|
||||
hud_eggs_portrait(curRacer, updateRate);
|
||||
}
|
||||
@@ -1251,7 +1251,7 @@ void hud_main_battle(s32 countdown, Object *obj, s32 updateRate) {
|
||||
s32 racersFinished;
|
||||
s32 i;
|
||||
|
||||
racer = &obj->unk64->racer;
|
||||
racer = obj->racer;
|
||||
if (gNumActivePlayers != 1 || racer->raceFinished == FALSE) {
|
||||
cam_set_sprite_anim_mode(SPRITE_ANIM_FRAME_INDEX);
|
||||
hud_race_start(countdown, updateRate);
|
||||
@@ -1264,7 +1264,7 @@ void hud_main_battle(s32 countdown, Object *obj, s32 updateRate) {
|
||||
case 2:
|
||||
racersFinished = 0;
|
||||
for (i = 0; i < numRacers; i++) {
|
||||
racer = &racerObjs[i]->unk64->racer;
|
||||
racer = racerObjs[i]->racer;
|
||||
if (racer->playerIndex != PLAYER_COMPUTER && racer->raceFinished) {
|
||||
racersFinished++;
|
||||
}
|
||||
@@ -1297,9 +1297,9 @@ void func_800A1E48(Object *racerObj, s32 updateRate) {
|
||||
|
||||
racers = get_racer_objects(&numRacers);
|
||||
if (racerObj != NULL) {
|
||||
racer = &racerObj->unk64->racer;
|
||||
racer = racerObj->racer;
|
||||
} else {
|
||||
racer = &racers[PLAYER_ONE]->unk64->racer;
|
||||
racer = racers[PLAYER_ONE]->racer;
|
||||
}
|
||||
|
||||
cam_set_sprite_anim_mode(SPRITE_ANIM_FRAME_INDEX);
|
||||
@@ -1309,7 +1309,7 @@ void func_800A1E48(Object *racerObj, s32 updateRate) {
|
||||
prevChallengerPortraitX = gCurrentHud->entry[HUD_CHALLENGE_PORTRAIT].pos.x;
|
||||
prevChallengerPortraitY = gCurrentHud->entry[HUD_CHALLENGE_PORTRAIT].pos.y;
|
||||
for (i = 0; i < 4; i++) {
|
||||
curRacer = &racers[i]->unk64->racer;
|
||||
curRacer = racers[i]->racer;
|
||||
tempX = (offsetX + prevChallengerPortraitX) - gCurrentHud->entry[HUD_CHALLENGE_PORTRAIT].pos.x;
|
||||
tempY = (offsetY + prevChallengerPortraitY) - gCurrentHud->entry[HUD_CHALLENGE_PORTRAIT].pos.y;
|
||||
gCurrentHud->entry[HUD_CHALLENGE_PORTRAIT].pos.x += tempX;
|
||||
@@ -1395,7 +1395,7 @@ void hud_lives_render(Object_Racer *racer, UNUSED s32 updateRate) {
|
||||
*/
|
||||
void hud_main_boss(s32 countdown, Object *obj, s32 updateRate) {
|
||||
LevelHeader *level;
|
||||
Object_Racer *racer = &obj->unk64->racer;
|
||||
Object_Racer *racer = obj->racer;
|
||||
|
||||
cam_set_sprite_anim_mode(SPRITE_ANIM_FRAME_INDEX);
|
||||
hud_wrong_way(racer, updateRate);
|
||||
@@ -1417,7 +1417,7 @@ void hud_main_boss(s32 countdown, Object *obj, s32 updateRate) {
|
||||
* When racing Taj in the overworld, render most of the basic race hud.
|
||||
*/
|
||||
void hud_main_taj(s32 countdown, Object *obj, s32 updateRate) {
|
||||
Object_Racer *racer = &obj->unk64->racer;
|
||||
Object_Racer *racer = obj->racer;
|
||||
|
||||
cam_set_sprite_anim_mode(SPRITE_ANIM_FRAME_INDEX);
|
||||
hud_wrong_way(racer, updateRate);
|
||||
@@ -1438,7 +1438,7 @@ void hud_main_hub(Object *obj, s32 updateRate) {
|
||||
HudElement *portrait;
|
||||
|
||||
if (cam_get_viewport_layout() == PLAYER_ONE) {
|
||||
racer = &obj->unk64->racer;
|
||||
racer = obj->racer;
|
||||
cam_set_sprite_anim_mode(SPRITE_ANIM_FRAME_INDEX);
|
||||
hud_balloons(racer);
|
||||
hud_speedometre(obj, updateRate);
|
||||
@@ -1473,7 +1473,7 @@ void hud_main_time_trial(s32 arg0, Object *playerRacerObj, s32 updateRate) {
|
||||
f32 posZ;
|
||||
u16 soundID;
|
||||
|
||||
curRacer = &playerRacerObj->unk64->racer;
|
||||
curRacer = playerRacerObj->racer;
|
||||
stopwatchTimer = 0;
|
||||
if (gAssetHudElements->entry[HUD_BALLOON_COUNT_X] == NULL) {
|
||||
ttSWBody.objectID = gAssetHudElementIds[HUD_BALLOON_COUNT_X] & 0xFFFF;
|
||||
@@ -1484,7 +1484,7 @@ void hud_main_time_trial(s32 arg0, Object *playerRacerObj, s32 updateRate) {
|
||||
gAssetHudElements->entry[HUD_BALLOON_COUNT_X] = spawn_object(&ttSWBody, OBJECT_SPAWN_NONE);
|
||||
gCurrentHud->entry[HUD_STOPWATCH_HANDS].rotation.y_rotation = -0x8000;
|
||||
if (gAssetHudElements->entry[HUD_BALLOON_COUNT_X] != NULL) {
|
||||
((Object *) gAssetHudElements->entry[HUD_BALLOON_COUNT_X])->segment.animFrame = 0;
|
||||
((Object *) gAssetHudElements->entry[HUD_BALLOON_COUNT_X])->animFrame = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1503,42 +1503,42 @@ void hud_main_time_trial(s32 arg0, Object *playerRacerObj, s32 updateRate) {
|
||||
return;
|
||||
}
|
||||
|
||||
ttSWBodyObject->segment.object.animationID = gStopwatchAnimID;
|
||||
ttSWBodyObject->animationID = gStopwatchAnimID;
|
||||
modInst = ttSWBodyObject->modelInstances[0];
|
||||
modInst->objModel->texOffsetUpdateRate = updateRate;
|
||||
if (gStopwatchAnimID != 0xFF) {
|
||||
if (gStopwatchAnimID == 4 && (get_race_countdown() || !music_is_playing())) {
|
||||
ttSWBodyObject->segment.animFrame = 16;
|
||||
ttSWBodyObject->animFrame = 16;
|
||||
} else if (gStopwatchAnimID == 4) {
|
||||
animcationFraction = music_animation_fraction();
|
||||
temp_t6 = (modInst->objModel->animations[gStopwatchAnimID].animLength - 1) << 4;
|
||||
if (animcationFraction == -1.0) {
|
||||
ttSWBodyObject->segment.animFrame = 0.0;
|
||||
ttSWBodyObject->animFrame = 0.0;
|
||||
} else if (animcationFraction > 0.5) {
|
||||
animcationFraction -= 0.5;
|
||||
animcationFraction *= 2.0;
|
||||
ttSWBodyObject->segment.animFrame = temp_t6 - (animcationFraction * temp_t6);
|
||||
ttSWBodyObject->animFrame = temp_t6 - (animcationFraction * temp_t6);
|
||||
} else {
|
||||
animcationFraction *= 2;
|
||||
ttSWBodyObject->segment.animFrame = temp_t6 * animcationFraction;
|
||||
ttSWBodyObject->animFrame = temp_t6 * animcationFraction;
|
||||
}
|
||||
} else if (is_game_paused() == FALSE) {
|
||||
if (D_80126D69 < 0) {
|
||||
if (ttSWBodyObject->segment.animFrame > -(updateRate * D_80126D69)) {
|
||||
ttSWBodyObject->segment.animFrame += (updateRate * D_80126D69);
|
||||
if (ttSWBodyObject->animFrame > -(updateRate * D_80126D69)) {
|
||||
ttSWBodyObject->animFrame += (updateRate * D_80126D69);
|
||||
} else {
|
||||
ttSWBodyObject->segment.animFrame = 1;
|
||||
ttSWBodyObject->animFrame = 1;
|
||||
D_80126D69 = -D_80126D69;
|
||||
}
|
||||
} else {
|
||||
ttSWBodyObject->segment.animFrame += (updateRate * D_80126D69);
|
||||
ttSWBodyObject->animFrame += (updateRate * D_80126D69);
|
||||
temp_lo = (modInst->objModel->animations[gStopwatchAnimID].animLength - 1) << 4;
|
||||
if (ttSWBodyObject->segment.animFrame >= temp_lo) {
|
||||
if (ttSWBodyObject->animFrame >= temp_lo) {
|
||||
if (D_80126D68 != 0) {
|
||||
D_80126D69 = -D_80126D69;
|
||||
ttSWBodyObject->segment.animFrame = temp_lo - 1;
|
||||
ttSWBodyObject->animFrame = temp_lo - 1;
|
||||
} else {
|
||||
ttSWBodyObject->segment.animFrame = 0;
|
||||
ttSWBodyObject->animFrame = 0;
|
||||
if (curRacer->wrongWayCounter == 0 && curRacer->raceFinished == FALSE) {
|
||||
hud_stopwatch_face(4, 0, 4, 1, 1);
|
||||
}
|
||||
@@ -1644,9 +1644,9 @@ void hud_main_time_trial(s32 arg0, Object *playerRacerObj, s32 updateRate) {
|
||||
ttSWBodyObject = timetrial_player_ghost();
|
||||
if (ttSWBodyObject != NULL) {
|
||||
if (get_race_countdown() == 0 && curRacer->raceFinished == FALSE) {
|
||||
posX = ttSWBodyObject->segment.trans.x_position - playerRacerObj->segment.trans.x_position;
|
||||
posY = ttSWBodyObject->segment.trans.y_position - playerRacerObj->segment.trans.y_position;
|
||||
posZ = ttSWBodyObject->segment.trans.z_position - playerRacerObj->segment.trans.z_position;
|
||||
posX = ttSWBodyObject->trans.x_position - playerRacerObj->trans.x_position;
|
||||
posY = ttSWBodyObject->trans.y_position - playerRacerObj->trans.y_position;
|
||||
posZ = ttSWBodyObject->trans.z_position - playerRacerObj->trans.z_position;
|
||||
if ((sqrtf((posX * posX) + (posY * posY) + (posZ * posZ)) < 600.0f) && (gHUDVoiceSoundMask == 0) &&
|
||||
(D_80126D50 == 0)) {
|
||||
soundID = SOUND_VOICE_TT_GO_FOR_IT + rand_range(0, 2);
|
||||
@@ -1819,15 +1819,13 @@ void hud_speedometre(Object *obj, UNUSED s32 updateRate) {
|
||||
|
||||
if (gNumActivePlayers == 1) {
|
||||
if (!check_if_showing_cutscene_camera()) {
|
||||
racer = &obj->unk64->racer;
|
||||
racer = obj->racer;
|
||||
if (racer->raceFinished == FALSE) {
|
||||
if (racer->vehicleID == VEHICLE_PLANE) {
|
||||
vel = sqrtf((obj->segment.x_velocity * obj->segment.x_velocity) +
|
||||
(obj->segment.y_velocity * obj->segment.y_velocity) +
|
||||
(obj->segment.z_velocity * obj->segment.z_velocity));
|
||||
vel = sqrtf((obj->x_velocity * obj->x_velocity) + (obj->y_velocity * obj->y_velocity) +
|
||||
(obj->z_velocity * obj->z_velocity));
|
||||
} else {
|
||||
vel = sqrtf((obj->segment.x_velocity * obj->segment.x_velocity) +
|
||||
(obj->segment.z_velocity * obj->segment.z_velocity));
|
||||
vel = sqrtf((obj->x_velocity * obj->x_velocity) + (obj->z_velocity * obj->z_velocity));
|
||||
}
|
||||
if (sRecordVel < vel) {
|
||||
sRecordVel = vel;
|
||||
@@ -1914,14 +1912,14 @@ void hud_race_start(s32 countdown, s32 updateRate) {
|
||||
s32 numRacerObjects;
|
||||
racerGroup = get_racer_objects(&numRacerObjects);
|
||||
randomRacer = racerGroup[rand_range(1, numRacerObjects) - 1];
|
||||
racer = &randomRacer->unk64->racer;
|
||||
racer = randomRacer->racer;
|
||||
if (racer->vehicleID == VEHICLE_CAR) {
|
||||
if (rand_range(0, 100) >= 96) {
|
||||
frequency = 1.25 - ((rand_range(0, 7) * 0.5) / 7.0);
|
||||
audspat_play_sound_direct(
|
||||
76, randomRacer->segment.trans.x_position, randomRacer->segment.trans.y_position,
|
||||
randomRacer->segment.trans.z_position, AUDIO_POINT_FLAG_ONE_TIME_TRIGGER,
|
||||
((rand_range(0, 7) * 63) / 7) + 24, frequency * 100.0f, &gRaceStartSoundMask);
|
||||
audspat_play_sound_direct(76, randomRacer->trans.x_position, randomRacer->trans.y_position,
|
||||
randomRacer->trans.z_position, AUDIO_POINT_FLAG_ONE_TIME_TRIGGER,
|
||||
((rand_range(0, 7) * 63) / 7) + 24, frequency * 100.0f,
|
||||
&gRaceStartSoundMask);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3029,7 +3027,7 @@ void hud_weapon(Object *obj, s32 updateRate) {
|
||||
Object_Racer *racer;
|
||||
s32 temp_a0;
|
||||
|
||||
racer = &obj->unk64->racer;
|
||||
racer = obj->racer;
|
||||
if (racer->raceFinished == FALSE) {
|
||||
enable_pal_viewport_height_adjust(TRUE);
|
||||
temp_a0 = (racer->balloon_type * 3) + (racer->balloon_level);
|
||||
@@ -3119,12 +3117,12 @@ void hud_magnet_reticle(Object *racerObj) {
|
||||
Object_Racer *racer;
|
||||
|
||||
if (entry) {} // Fakematch
|
||||
racer = &racerObj->unk64->racer;
|
||||
racer = racerObj->racer;
|
||||
if (racer->magnetTargetObj != NULL && get_current_viewport() == racer->playerIndex) {
|
||||
hud = &gCurrentHud->entry[HUD_MAGNET_RETICLE];
|
||||
hud->pos.x = racer->magnetTargetObj->segment.trans.x_position;
|
||||
hud->pos.y = racer->magnetTargetObj->segment.trans.y_position;
|
||||
hud->pos.z = racer->magnetTargetObj->segment.trans.z_position;
|
||||
hud->pos.x = racer->magnetTargetObj->trans.x_position;
|
||||
hud->pos.y = racer->magnetTargetObj->trans.y_position;
|
||||
hud->pos.z = racer->magnetTargetObj->trans.z_position;
|
||||
entry = gAssetHudElements->entry[hud->spriteID];
|
||||
if (entry == NULL) {
|
||||
return;
|
||||
@@ -3402,8 +3400,8 @@ void hud_render_general(Gfx **dList, Mtx **mtx, Vertex **vtx, s32 updateRate) {
|
||||
if (gNumActivePlayers == 3) {
|
||||
tempVar4 = NULL;
|
||||
for (tempVar2 = 0; tempVar2 < objectCount; tempVar2++) {
|
||||
if (objectGroup[tempVar2]->unk64->racer.playerIndex == PLAYER_COMPUTER) {
|
||||
tempVar4 = &objectGroup[tempVar2]->unk64->racer;
|
||||
if (objectGroup[tempVar2]->racer->playerIndex == PLAYER_COMPUTER) {
|
||||
tempVar4 = objectGroup[tempVar2]->racer;
|
||||
}
|
||||
}
|
||||
if (tempVar4 != NULL) {
|
||||
@@ -3445,8 +3443,8 @@ void hud_render_general(Gfx **dList, Mtx **mtx, Vertex **vtx, s32 updateRate) {
|
||||
if (gNumActivePlayers == 3) {
|
||||
curRacerObj = NULL;
|
||||
for (tempVar2 = 0; tempVar2 < objectCount; tempVar2++) {
|
||||
if (objectGroup[tempVar2]->unk64->racer.playerIndex == PLAYER_COMPUTER) {
|
||||
curRacerObj = &objectGroup[tempVar2]->unk64->racer;
|
||||
if (objectGroup[tempVar2]->racer->playerIndex == PLAYER_COMPUTER) {
|
||||
curRacerObj = objectGroup[tempVar2]->racer;
|
||||
}
|
||||
}
|
||||
if (curRacerObj != NULL) {
|
||||
@@ -3524,7 +3522,7 @@ void hud_render_general(Gfx **dList, Mtx **mtx, Vertex **vtx, s32 updateRate) {
|
||||
spBC = gCurrentHud->entry[HUD_TREASURE_METRE].pos.y;
|
||||
racerGroup = get_racer_objects(&racerCount);
|
||||
for (sp144 = 0; sp144 < racerCount; sp144++) {
|
||||
someRacer = &racerGroup[sp144]->unk64->racer;
|
||||
someRacer = racerGroup[sp144]->racer;
|
||||
hud_treasure(someRacer);
|
||||
if (osTvType == OS_TV_TYPE_PAL) {
|
||||
gCurrentHud->entry[HUD_CHALLENGE_PORTRAIT].pos.y += 66.0;
|
||||
@@ -3541,8 +3539,8 @@ void hud_render_general(Gfx **dList, Mtx **mtx, Vertex **vtx, s32 updateRate) {
|
||||
} else if (gNumActivePlayers == 3) {
|
||||
tempVar4 = NULL;
|
||||
for (tempVar2 = 0; tempVar2 < objectCount; tempVar2++) {
|
||||
if (objectGroup[tempVar2]->unk64->racer.playerIndex == PLAYER_COMPUTER) {
|
||||
tempVar4 = &objectGroup[tempVar2]->unk64->racer;
|
||||
if (objectGroup[tempVar2]->racer->playerIndex == PLAYER_COMPUTER) {
|
||||
tempVar4 = objectGroup[tempVar2]->racer;
|
||||
}
|
||||
}
|
||||
if (tempVar4 != NULL) {
|
||||
@@ -3584,7 +3582,7 @@ void hud_render_general(Gfx **dList, Mtx **mtx, Vertex **vtx, s32 updateRate) {
|
||||
|
||||
sp113 = TRUE;
|
||||
for (i = 0; i < objectCount; i++) {
|
||||
someRacer = &objectGroup[i]->unk64->racer;
|
||||
someRacer = objectGroup[i]->racer;
|
||||
if (someRacer != NULL && someRacer->playerIndex != PLAYER_COMPUTER && someRacer->raceFinished == FALSE) {
|
||||
sp113 = FALSE;
|
||||
}
|
||||
@@ -3667,22 +3665,20 @@ void hud_render_general(Gfx **dList, Mtx **mtx, Vertex **vtx, s32 updateRate) {
|
||||
if (is_in_time_trial() && timetrial_valid_player_ghost()) {
|
||||
temp_v0_8 = timetrial_player_ghost();
|
||||
if (temp_v0_8 != NULL) {
|
||||
minimap_marker_pos(temp_v0_8->segment.trans.x_position, temp_v0_8->segment.trans.z_position, sp114, sp118,
|
||||
sp11C);
|
||||
minimap_marker_pos(temp_v0_8->trans.x_position, temp_v0_8->trans.z_position, sp114, sp118, sp11C);
|
||||
gCurrentHud->entry[HUD_MINIMAP_MARKER].spriteID = HUD_SPRITE_MAP_DOT;
|
||||
gCurrentHud->entry[HUD_MINIMAP_MARKER].rotation.z_rotation = 0;
|
||||
gCurrentHud->entry[HUD_MINIMAP_MARKER].scale = 1.0f;
|
||||
tempVar1 = (opacity * (f32) temp_v0_8->segment.object.opacity) * (1.0 / 128.0);
|
||||
tempVar1 = (opacity * (f32) temp_v0_8->opacity) * (1.0 / 128.0);
|
||||
gDPSetPrimColor(gHudDL++, 0, 0, 60, 60, 60, tempVar1);
|
||||
hud_element_render(&gHudDL, &gHudMtx, &gHudVtx, &gCurrentHud->entry[HUD_MINIMAP_MARKER]);
|
||||
}
|
||||
}
|
||||
temp_v0_8 = timetrial_ghost_staff();
|
||||
if (temp_v0_8 != NULL) {
|
||||
minimap_marker_pos(temp_v0_8->segment.trans.x_position, temp_v0_8->segment.trans.z_position, sp114, sp118,
|
||||
sp11C);
|
||||
minimap_marker_pos(temp_v0_8->trans.x_position, temp_v0_8->trans.z_position, sp114, sp118, sp11C);
|
||||
gCurrentHud->entry[HUD_MINIMAP_MARKER].rotation.z_rotation = 0;
|
||||
tempVar1 = (opacity * (f32) temp_v0_8->segment.object.opacity) * (1.0 / 128.0);
|
||||
tempVar1 = (opacity * (f32) temp_v0_8->opacity) * (1.0 / 128.0);
|
||||
gDPSetPrimColor(gHudDL++, 0, 0, gHudMinimapColours[8].red, gHudMinimapColours[8].green,
|
||||
gHudMinimapColours[8].blue, tempVar1);
|
||||
gCurrentHud->entry[HUD_MINIMAP_MARKER].scale = 1.0f;
|
||||
@@ -3694,8 +3690,7 @@ void hud_render_general(Gfx **dList, Mtx **mtx, Vertex **vtx, s32 updateRate) {
|
||||
temp_v0_8 = find_taj_object();
|
||||
if (temp_v0_8 != NULL) {
|
||||
gCurrentHud->entry[HUD_MINIMAP_MARKER].spriteID = HUD_SPRITE_MAP_DOT;
|
||||
minimap_marker_pos(temp_v0_8->segment.trans.x_position, temp_v0_8->segment.trans.z_position, sp114, sp118,
|
||||
sp11C);
|
||||
minimap_marker_pos(temp_v0_8->trans.x_position, temp_v0_8->trans.z_position, sp114, sp118, sp11C);
|
||||
gCurrentHud->entry[HUD_MINIMAP_MARKER].rotation.z_rotation = 0;
|
||||
gDPSetPrimColor(gHudDL++, 0, 0, 255, 0, 255, opacity);
|
||||
gCurrentHud->entry[HUD_MINIMAP_MARKER].scale = 1.0f;
|
||||
@@ -3706,16 +3701,14 @@ void hud_render_general(Gfx **dList, Mtx **mtx, Vertex **vtx, s32 updateRate) {
|
||||
// Non AI players get an arrow instead of a blob that rotates.
|
||||
for (i = objectCount - 1; i >= 0; i--) {
|
||||
temp_v0_8 = objectGroup[i];
|
||||
someRacer = &objectGroup[i]->unk64->racer;
|
||||
someRacer = objectGroup[i]->racer;
|
||||
if (someRacer != NULL) {
|
||||
minimap_marker_pos(objectGroup[i]->segment.trans.x_position, objectGroup[i]->segment.trans.z_position,
|
||||
sp114, sp118, sp11C);
|
||||
minimap_marker_pos(objectGroup[i]->trans.x_position, objectGroup[i]->trans.z_position, sp114, sp118, sp11C);
|
||||
if (someRacer->playerIndex != PLAYER_COMPUTER) {
|
||||
gCurrentHud->entry[HUD_MINIMAP_MARKER].pos.y -= 1.0f;
|
||||
gCurrentHud->entry[HUD_MINIMAP_MARKER].spriteID = HUD_SPRITE_MAP_ARROW;
|
||||
gCurrentHud->entry[HUD_MINIMAP_MARKER].rotation.z_rotation =
|
||||
(objectGroup[i]->segment.trans.rotation.y_rotation - ((lvlMdl->minimapRotation * 0xFFFF) / 360)) &
|
||||
0xFFFF;
|
||||
(objectGroup[i]->trans.rotation.y_rotation - ((lvlMdl->minimapRotation * 0xFFFF) / 360)) & 0xFFFF;
|
||||
|
||||
if (get_filtered_cheats() & CHEAT_MIRRORED_TRACKS) {
|
||||
gCurrentHud->entry[HUD_MINIMAP_MARKER].rotation.z_rotation =
|
||||
@@ -3959,15 +3952,15 @@ void hud_element_render(Gfx **dList, Mtx **mtx, Vertex **vtxList, HudElement *hu
|
||||
hud->rotation.z += camera->trans.rotation.z;
|
||||
} else if (gAssetHudElementIds[spriteID] & ASSET_MASK_OBJECT) {
|
||||
tempObject = gAssetHudElements->entry[spriteID];
|
||||
tempObject->segment.trans.rotation.x = hud->rotation.x;
|
||||
tempObject->segment.trans.rotation.y = hud->rotation.y;
|
||||
tempObject->segment.trans.rotation.z = hud->rotation.z;
|
||||
tempObject->segment.trans.x_position = hud->pos.x;
|
||||
tempObject->segment.trans.y_position = hud->pos.y;
|
||||
tempObject->segment.trans.z_position = hud->pos.z;
|
||||
tempObject->segment.trans.scale = hud->scale;
|
||||
tempObject->segment.object.modelIndex = 0;
|
||||
tempObject->segment.object.opacity = 0xFF;
|
||||
tempObject->trans.rotation.x = hud->rotation.x;
|
||||
tempObject->trans.rotation.y = hud->rotation.y;
|
||||
tempObject->trans.rotation.z = hud->rotation.z;
|
||||
tempObject->trans.x_position = hud->pos.x;
|
||||
tempObject->trans.y_position = hud->pos.y;
|
||||
tempObject->trans.z_position = hud->pos.z;
|
||||
tempObject->trans.scale = hud->scale;
|
||||
tempObject->modelIndex = 0;
|
||||
tempObject->opacity = 0xFF;
|
||||
render_object(&gHudDL, &gHudMtx, &gHudVtx, tempObject);
|
||||
} else {
|
||||
mtx_cam_push(&gHudDL, &gHudMtx, (ObjectTransform *) hud, 1.0f, 0.0f);
|
||||
|
||||
+18
-18
@@ -87,9 +87,9 @@ ObjectLight *func_80031CAC(Object *obj, LevelObjectEntry_RgbaLight *lightEntry)
|
||||
light->homeY = 0;
|
||||
light->homeZ = 0;
|
||||
if (obj != NULL) {
|
||||
light->pos.x = obj->segment.trans.x_position;
|
||||
light->pos.y = obj->segment.trans.y_position;
|
||||
light->pos.z = obj->segment.trans.z_position;
|
||||
light->pos.x = obj->trans.x_position;
|
||||
light->pos.y = obj->trans.y_position;
|
||||
light->pos.z = obj->trans.z_position;
|
||||
} else {
|
||||
light->pos.x = lightEntry->common.x;
|
||||
light->pos.y = lightEntry->common.y;
|
||||
@@ -273,10 +273,10 @@ void func_80032424(ObjectLight *light, s32 updateRate) {
|
||||
light->pos.x = light->homeX;
|
||||
light->pos.y = light->homeY;
|
||||
light->pos.z = light->homeZ;
|
||||
vec3f_rotate(&light->owner->segment.trans.rotation, &light->pos);
|
||||
light->pos.x += light->owner->segment.trans.x_position;
|
||||
light->pos.y += light->owner->segment.trans.y_position;
|
||||
light->pos.z += light->owner->segment.trans.z_position;
|
||||
vec3f_rotate(&light->owner->trans.rotation, &light->pos);
|
||||
light->pos.x += light->owner->trans.x_position;
|
||||
light->pos.y += light->owner->trans.y_position;
|
||||
light->pos.z += light->owner->trans.z_position;
|
||||
light->unk5 = 1;
|
||||
}
|
||||
if (light->unk44 != NULL) {
|
||||
@@ -391,7 +391,7 @@ void func_80032424(ObjectLight *light, s32 updateRate) {
|
||||
rotation.z_rotation = 0;
|
||||
vec3f_rotate_py(&rotation, &light->direction);
|
||||
if (light->owner != NULL) {
|
||||
vec3f_rotate(&light->owner->segment.trans.rotation, &light->direction);
|
||||
vec3f_rotate(&light->owner->trans.rotation, &light->direction);
|
||||
}
|
||||
light->direction.x = -light->direction.x;
|
||||
light->direction.y = -light->direction.y;
|
||||
@@ -439,8 +439,8 @@ void func_80032C7C(Object *object) {
|
||||
u8 sp64;
|
||||
s32 i;
|
||||
|
||||
if (object->segment.header->unk3D == 0) {
|
||||
switch (object->segment.header->modelType) {
|
||||
if (object->header->unk3D == 0) {
|
||||
switch (object->header->modelType) {
|
||||
case OBJECT_MODEL_TYPE_3D_MODEL:
|
||||
sp64 = 2;
|
||||
break;
|
||||
@@ -458,9 +458,9 @@ void func_80032C7C(Object *object) {
|
||||
break;
|
||||
}
|
||||
|
||||
objX = object->segment.trans.x_position;
|
||||
objY = object->segment.trans.y_position;
|
||||
objZ = object->segment.trans.z_position;
|
||||
objX = object->trans.x_position;
|
||||
objY = object->trans.y_position;
|
||||
objZ = object->trans.z_position;
|
||||
|
||||
numLights = 0;
|
||||
|
||||
@@ -478,9 +478,9 @@ void func_80032C7C(Object *object) {
|
||||
numLights++;
|
||||
}
|
||||
} else {
|
||||
gLightDiffX = light->pos.x - object->segment.trans.x_position;
|
||||
gLightDiffY = light->pos.y - object->segment.trans.y_position;
|
||||
gLightDiffZ = light->pos.z - object->segment.trans.z_position;
|
||||
gLightDiffX = light->pos.x - object->trans.x_position;
|
||||
gLightDiffY = light->pos.y - object->trans.y_position;
|
||||
gLightDiffZ = light->pos.z - object->trans.z_position;
|
||||
if (light->unk0 == 2) {
|
||||
gLightDiffY = 0.0f;
|
||||
}
|
||||
@@ -495,7 +495,7 @@ void func_80032C7C(Object *object) {
|
||||
if (intensity > 0.0f) {
|
||||
intensity *= light_distance_calc(light);
|
||||
if (intensity > 0.0f) {
|
||||
if (object->segment.header->directionalPointLighting) {
|
||||
if (object->header->directionalPointLighting) {
|
||||
if (gLightDistance > 0.0f) {
|
||||
f32 temp = 1.0f / sqrtf(gLightDistance);
|
||||
gLightDiffX *= temp;
|
||||
@@ -523,7 +523,7 @@ void func_80032C7C(Object *object) {
|
||||
}
|
||||
}
|
||||
|
||||
if (object->segment.header->directionalPointLighting) {
|
||||
if (object->header->directionalPointLighting) {
|
||||
// find two brightest light sources
|
||||
if (numLights == 0) {
|
||||
object->shading->lightIntensity = 0;
|
||||
|
||||
+10
-10
@@ -13844,18 +13844,18 @@ void menu_element_render(s32 elementID) {
|
||||
if (0) {} // Fakematch
|
||||
object = (Object *) gMenuAssets[gMenuImages[elementID].trans.spriteID];
|
||||
asset = (MenuAsset *) &gMenuImages[elementID];
|
||||
object->segment.trans.rotation.y_rotation = asset->trans.rotation.y_rotation;
|
||||
object->segment.trans.rotation.x_rotation = asset->trans.rotation.x_rotation;
|
||||
object->segment.trans.rotation.z_rotation = asset->trans.rotation.z_rotation;
|
||||
object->segment.trans.x_position = asset->trans.x_position;
|
||||
object->segment.trans.y_position = asset->trans.y_position;
|
||||
object->segment.trans.z_position = asset->trans.z_position;
|
||||
object->segment.trans.scale = asset->trans.scale;
|
||||
object->trans.rotation.y_rotation = asset->trans.rotation.y_rotation;
|
||||
object->trans.rotation.x_rotation = asset->trans.rotation.x_rotation;
|
||||
object->trans.rotation.z_rotation = asset->trans.rotation.z_rotation;
|
||||
object->trans.x_position = asset->trans.x_position;
|
||||
object->trans.y_position = asset->trans.y_position;
|
||||
object->trans.z_position = asset->trans.z_position;
|
||||
object->trans.scale = asset->trans.scale;
|
||||
if (gMenuDisableObjAnim == FALSE) {
|
||||
object->segment.animFrame = asset->unk1D;
|
||||
object->segment.object.modelIndex = asset->spriteOffset;
|
||||
object->animFrame = asset->unk1D;
|
||||
object->modelIndex = asset->spriteOffset;
|
||||
}
|
||||
object->segment.object.opacity = sMenuGuiOpacity;
|
||||
object->opacity = sMenuGuiOpacity;
|
||||
render_object(&sMenuCurrDisplayList, &sMenuCurrHudMat, &sMenuCurrHudVerts, object);
|
||||
} else {
|
||||
if ((*gAssetsMenuElementIds)[gMenuImages[elementID].trans.spriteID] & ASSET_MASK_SPRITE) {
|
||||
|
||||
+1195
-1250
File diff suppressed because it is too large
Load Diff
+11
-194
@@ -10,15 +10,11 @@
|
||||
#define WORLD_KEY_GRAB_CHECK_RADIUS 50
|
||||
|
||||
#define TIME_JIFFIES_PER_SECOND 60
|
||||
#define TIME_SECONDS(sec) sec * TIME_JIFFIES_PER_SECOND
|
||||
#define TIME_SECONDS(sec) sec *TIME_JIFFIES_PER_SECOND
|
||||
#define U8_ANGLE_TO_U16(x) (x << 6 << 4)
|
||||
#define TEX_INDEX_NO_TEXTURE 0xFF
|
||||
|
||||
enum BananaBehaviour {
|
||||
BANANA_COLLECTED = -1,
|
||||
BANANA_IDLE,
|
||||
BANANA_DROPPED
|
||||
};
|
||||
enum BananaBehaviour { BANANA_COLLECTED = -1, BANANA_IDLE, BANANA_DROPPED };
|
||||
|
||||
enum WeaponBehaviour {
|
||||
WEAPON_DROPPED,
|
||||
@@ -29,11 +25,7 @@ enum WeaponBehaviour {
|
||||
WEAPON_STATUS_5
|
||||
};
|
||||
|
||||
enum DoorStatus {
|
||||
DOOR_CLOSING = -1,
|
||||
DOOR_CLOSED,
|
||||
DOOR_OPENING
|
||||
};
|
||||
enum DoorStatus { DOOR_CLOSING = -1, DOOR_CLOSED, DOOR_OPENING };
|
||||
|
||||
enum BossRaceWarps {
|
||||
WARP_STANDARD = -1,
|
||||
@@ -75,188 +67,14 @@ enum SilvereCoinBehaviours {
|
||||
SILVER_COIN_INACTIVE
|
||||
};
|
||||
|
||||
enum EggPickupStatus {
|
||||
EGG_SPAWNED,
|
||||
EGG_COLLECTED,
|
||||
EGG_MOVING,
|
||||
EGG_IN_BASE,
|
||||
EGG_HATCHED
|
||||
};
|
||||
enum EggPickupStatus { EGG_SPAWNED, EGG_COLLECTED, EGG_MOVING, EGG_IN_BASE, EGG_HATCHED };
|
||||
|
||||
enum FrogActions {
|
||||
FROG_IDLE,
|
||||
FROG_HOP,
|
||||
FROG_SQUISH,
|
||||
FROG_FLAT,
|
||||
FROG_UNSQUISH
|
||||
};
|
||||
|
||||
typedef struct unk80034B4C {
|
||||
u8 pad0[0x18];
|
||||
s16 unk18;
|
||||
u8 pad1A[0x5E];
|
||||
s32 unk78;
|
||||
} unk80034B4C;
|
||||
|
||||
typedef struct unk80035E20 {
|
||||
u8 pad0[0x40];
|
||||
s32 unk40;
|
||||
u8 pad44[0x34];
|
||||
s32 unk78;
|
||||
s32 unk7C;
|
||||
} unk80035E20;
|
||||
|
||||
typedef struct unk80037578 {
|
||||
u8 pad0[0x78];
|
||||
s32 unk78;
|
||||
s32 unk7C;
|
||||
} unk80037578;
|
||||
|
||||
typedef struct unk80037624 {
|
||||
u8 pad0[6];
|
||||
s16 unk6;
|
||||
} unk80037624;
|
||||
|
||||
/* Size: 12 bytes */
|
||||
typedef struct LevelObjectEntry800376E0 {
|
||||
LevelObjectEntryCommon common;
|
||||
s8 unk8;
|
||||
s8 unk9;
|
||||
s8 unkA;
|
||||
} LevelObjectEntry800376E0;
|
||||
|
||||
typedef struct unk80037D08_arg0_64 {
|
||||
u8 pad0[0x2A];
|
||||
s16 unk2A;
|
||||
} unk80037D08_arg0_64;
|
||||
|
||||
typedef struct unk80037D08_arg0 {
|
||||
u8 pad0[0x64];
|
||||
unk80037D08_arg0_64 *unk64;
|
||||
} unk80037D08_arg0;
|
||||
|
||||
typedef struct unk80038B74 {
|
||||
u8 pad0[8];
|
||||
s8 unk8;
|
||||
} unk80038B74;
|
||||
|
||||
typedef struct unk80039160 {
|
||||
u8 pad0[0x78];
|
||||
s32 unk78;
|
||||
} unk80039160;
|
||||
|
||||
typedef struct unk80039190 {
|
||||
u16 unk0;
|
||||
u8 pad2[0x76];
|
||||
s32 unk78;
|
||||
s32 unk7C;
|
||||
} unk80039190;
|
||||
|
||||
typedef struct unk8003CF18 {
|
||||
u8 pad1A[0x78];
|
||||
f32 unk78;
|
||||
} unk8003CF18;
|
||||
|
||||
typedef struct unk8003D038 {
|
||||
u8 pad0[0x18];
|
||||
s16 unk18;
|
||||
u8 pad1A[0x5E];
|
||||
s32 unk78;
|
||||
} unk8003D038;
|
||||
|
||||
typedef struct unk8003D3EC {
|
||||
u8 pad0[0x18];
|
||||
u16 unk18;
|
||||
} unk8003D3EC;
|
||||
|
||||
typedef struct unk8003FC44 {
|
||||
s8 unk0;
|
||||
s8 unk1;
|
||||
s16 unk2;
|
||||
s16 unk4;
|
||||
s16 unk6;
|
||||
s8 unk7;
|
||||
} unk8003FC44;
|
||||
|
||||
typedef struct LevelObjectEntry8003FEF4 {
|
||||
LevelObjectEntryCommon common;
|
||||
u8 unk8;
|
||||
u8 unk9;
|
||||
u16 unkA;
|
||||
u8 unkC;
|
||||
u8 unkD;
|
||||
u16 unkE;
|
||||
u8 unk10;
|
||||
u8 unk11;
|
||||
u8 unk12;
|
||||
u8 unk13;
|
||||
} LevelObjectEntry8003FEF4;
|
||||
|
||||
typedef struct LevelObjectEntry8004001C {
|
||||
LevelObjectEntryCommon common;
|
||||
u8 unk8;
|
||||
u8 unk9;
|
||||
u8 unkA;
|
||||
} LevelObjectEntry8004001C;
|
||||
|
||||
typedef struct unk80040800 {
|
||||
u8 pad0[0x78];
|
||||
f32 unk78;
|
||||
} unk80040800;
|
||||
|
||||
typedef struct unk80042014_arg0_64 {
|
||||
u16 unk0;
|
||||
u8 unk2;
|
||||
u8 unk3;
|
||||
} unk80042014_arg0_64;
|
||||
|
||||
typedef struct unk80042014_arg0 {
|
||||
u8 pad0[0x64];
|
||||
unk80042014_arg0_64 *unk64;
|
||||
} unk80042014_arg0;
|
||||
|
||||
typedef struct unk80042014_arg1 {
|
||||
u8 pad0[8];
|
||||
u16 unk8;
|
||||
u8 unkA;
|
||||
u8 unkB;
|
||||
} unk80042014_arg1;
|
||||
|
||||
typedef struct unk8004210C {
|
||||
u8 pad0[0x3C];
|
||||
s32 unk3C;
|
||||
u8 pad40[0x24];
|
||||
s32 unk64;
|
||||
} unk8004210C;
|
||||
|
||||
typedef struct unk80042A1C {
|
||||
u8 pad0[0x78];
|
||||
f32 unk78;
|
||||
s16 unk7C;
|
||||
s16 unk7E;
|
||||
} unk80042A1C;
|
||||
|
||||
typedef struct unk80042CD0 {
|
||||
u8 pad0[0x18];
|
||||
s16 unk18;
|
||||
} unk80042CD0;
|
||||
|
||||
//void rumble_set(s16 obj, u8 arg1);
|
||||
|
||||
typedef struct unk80041A90_MidiFade {
|
||||
s16 unk0; // Y rotation
|
||||
s16 unk2; // X rotation
|
||||
s16 unk4; // Z rotation
|
||||
f32 unk8;
|
||||
f32 unkC;
|
||||
f32 unk10;
|
||||
f32 unk14;
|
||||
} unk80041A90_MidiFade;
|
||||
enum FrogActions { FROG_IDLE, FROG_HOP, FROG_SQUISH, FROG_FLAT, FROG_UNSQUISH };
|
||||
|
||||
typedef struct VertexPosition {
|
||||
/* 0x00 */ s16 x;
|
||||
/* 0x02 */ s16 y;
|
||||
/* 0x04 */ s16 z;
|
||||
/* 0x00 */ s16 x;
|
||||
/* 0x02 */ s16 y;
|
||||
/* 0x04 */ s16 z;
|
||||
} VertexPosition;
|
||||
|
||||
extern Triangle D_800DCAA8[8];
|
||||
@@ -371,7 +189,7 @@ void obj_init_levelname(Object *obj, LevelObjectEntry_LevelName *entry);
|
||||
void obj_loop_wizghosts(Object *obj, s32 updateRate);
|
||||
void obj_loop_ttdoor(Object *obj, s32 updateRate);
|
||||
void obj_loop_trophycab(Object *obj, s32 updateRate);
|
||||
void obj_loop_wizpigship(Object* wizShipObj, s32 updateRate);
|
||||
void obj_loop_wizpigship(Object *wizShipObj, s32 updateRate);
|
||||
void obj_loop_silvercoin(Object *obj, s32 updateRate);
|
||||
void obj_loop_bombexplosion(Object *obj, s32 updateRate);
|
||||
void obj_loop_flycoin(Object *obj, s32 updateRate);
|
||||
@@ -435,9 +253,8 @@ void obj_init_fish(Object *fishObj, LevelObjectEntry_Fish *fishEntry, s32 param)
|
||||
void obj_init_midifade(Object *obj, LevelObjectEntry_MidiFade *entry);
|
||||
void obj_loop_butterfly(Object *butterflyObj, s32 updateRate);
|
||||
s32 ainode_find_nearest(f32 diffX, f32 diffY, f32 diffZ, s32 useElevation);
|
||||
void func_8000CBF0(Object*, s32);
|
||||
void try_to_collect_egg(Object *, Object_CollectEgg*);
|
||||
|
||||
void func_8000CBF0(Object *, s32);
|
||||
void try_to_collect_egg(Object *, Object_CollectEgg *);
|
||||
|
||||
s32 func_8001F3EC(s32);
|
||||
s32 func_80021600(s32);
|
||||
|
||||
+15
-15
@@ -952,32 +952,32 @@ void func_80061C0C(Object *obj) {
|
||||
ModelInstance *modInst;
|
||||
s32 var_v1;
|
||||
|
||||
if (obj->segment.object.modelIndex < 0) {
|
||||
obj->segment.object.modelIndex = 0;
|
||||
if (obj->modelIndex < 0) {
|
||||
obj->modelIndex = 0;
|
||||
}
|
||||
var_v1 = obj->segment.header->numberOfModelIds - 1;
|
||||
if (var_v1 < obj->segment.object.modelIndex) {
|
||||
obj->segment.object.modelIndex = var_v1;
|
||||
var_v1 = obj->header->numberOfModelIds - 1;
|
||||
if (var_v1 < obj->modelIndex) {
|
||||
obj->modelIndex = var_v1;
|
||||
}
|
||||
modInst = obj->modelInstances[obj->segment.object.modelIndex];
|
||||
modInst = obj->modelInstances[obj->modelIndex];
|
||||
mdl = modInst->objModel;
|
||||
if (modInst->objModel->animations != NULL) {
|
||||
if (obj->segment.object.animationID < 0) {
|
||||
obj->segment.object.animationID = 0;
|
||||
if (obj->animationID < 0) {
|
||||
obj->animationID = 0;
|
||||
}
|
||||
if (obj->segment.object.animationID >= mdl->numberOfAnimations) {
|
||||
obj->segment.object.animationID = mdl->numberOfAnimations - 1;
|
||||
if (obj->animationID >= mdl->numberOfAnimations) {
|
||||
obj->animationID = mdl->numberOfAnimations - 1;
|
||||
}
|
||||
if (mdl->numberOfAnimations > 0) {
|
||||
var_v1 = mdl->animations[obj->segment.object.animationID].animLength - 2;
|
||||
var_v1 = mdl->animations[obj->animationID].animLength - 2;
|
||||
} else {
|
||||
var_v1 = 0;
|
||||
}
|
||||
if (obj->segment.animFrame >> 4 < 0) {
|
||||
obj->segment.animFrame = var_v1;
|
||||
if (obj->animFrame >> 4 < 0) {
|
||||
obj->animFrame = var_v1;
|
||||
}
|
||||
if (var_v1 < obj->segment.animFrame >> 4) {
|
||||
obj->segment.animFrame = 0;
|
||||
if (var_v1 < obj->animFrame >> 4) {
|
||||
obj->animFrame = 0;
|
||||
modInst->animationID = -1;
|
||||
}
|
||||
}
|
||||
|
||||
+1442
-1843
File diff suppressed because it is too large
Load Diff
+59
-132
@@ -8,14 +8,14 @@
|
||||
#include "camera.h"
|
||||
#include "particles.h"
|
||||
|
||||
|
||||
#define NEW_OBJECT_ENTRY(entryVar, entryId, entrySize, xPos, yPos, zPos) { \
|
||||
entryVar.x = (xPos); \
|
||||
entryVar.y = (yPos); \
|
||||
entryVar.z = (zPos); \
|
||||
entryVar.size = ((((entryId) >> 1) & 0x80) | (entrySize)); \
|
||||
entryVar.objectID = (s8)(entryId); \
|
||||
}
|
||||
#define NEW_OBJECT_ENTRY(entryVar, entryId, entrySize, xPos, yPos, zPos) \
|
||||
{ \
|
||||
entryVar.x = (xPos); \
|
||||
entryVar.y = (yPos); \
|
||||
entryVar.z = (zPos); \
|
||||
entryVar.size = ((((entryId) >> 1) & 0x80) | (entrySize)); \
|
||||
entryVar.objectID = (s8) (entryId); \
|
||||
}
|
||||
|
||||
#define NODE_NONE 255
|
||||
|
||||
@@ -174,27 +174,27 @@ enum ObjectInteractionFlags {
|
||||
|
||||
enum ObjectSpawnFlags {
|
||||
OBJECT_SPAWN_NONE,
|
||||
OBJECT_SPAWN_UNK01 = (1 << 0),
|
||||
OBJECT_SPAWN_UNK02 = (1 << 1),
|
||||
OBJECT_SPAWN_UNK04 = (1 << 2),
|
||||
OBJECT_SPAWN_UNK08 = (1 << 3),
|
||||
OBJECT_SPAWN_UNK10 = (1 << 4)
|
||||
OBJECT_SPAWN_UNK01 = (1 << 0),
|
||||
OBJECT_SPAWN_UNK02 = (1 << 1),
|
||||
OBJECT_SPAWN_UNK04 = (1 << 2),
|
||||
OBJECT_SPAWN_UNK08 = (1 << 3),
|
||||
OBJECT_SPAWN_UNK10 = (1 << 4)
|
||||
};
|
||||
|
||||
enum ObjectBehaviourFlags {
|
||||
OBJECT_BEHAVIOUR_NONE,
|
||||
OBJECT_BEHAVIOUR_SHADED = (1 << 0),
|
||||
OBJECT_BEHAVIOUR_SHADOW = (1 << 1),
|
||||
OBJECT_BEHAVIOUR_WATER_EFFECT = (1 << 2),
|
||||
OBJECT_BEHAVIOUR_ANIMATION = (1 << 3),
|
||||
OBJECT_BEHAVIOUR_INTERACTIVE = (1 << 4),
|
||||
OBJECT_BEHAVIOUR_UNK20 = (1 << 5)
|
||||
OBJECT_BEHAVIOUR_SHADED = (1 << 0),
|
||||
OBJECT_BEHAVIOUR_SHADOW = (1 << 1),
|
||||
OBJECT_BEHAVIOUR_WATER_EFFECT = (1 << 2),
|
||||
OBJECT_BEHAVIOUR_ANIMATION = (1 << 3),
|
||||
OBJECT_BEHAVIOUR_INTERACTIVE = (1 << 4),
|
||||
OBJECT_BEHAVIOUR_UNK20 = (1 << 5)
|
||||
};
|
||||
|
||||
enum ContPakErrors {
|
||||
CONTPAK_ERROR_MISSING = -1,
|
||||
CONTPAK_ERROR_NONE,
|
||||
CONTPAK_ERROR_UNKNOWN, //Time trial ghost has reached its size limit?
|
||||
CONTPAK_ERROR_UNKNOWN, // Time trial ghost has reached its size limit?
|
||||
CONTPAK_ERROR_FULL,
|
||||
CONTPAK_ERROR_DAMAGED
|
||||
};
|
||||
@@ -219,38 +219,25 @@ typedef struct BossRaceVehicles {
|
||||
s8 bossVehicle;
|
||||
} BossRaceVehicles;
|
||||
|
||||
typedef struct AssetObjectHeaders {
|
||||
s32 unk0;
|
||||
s32 unk4;
|
||||
s32 unk8;
|
||||
s32 unkC;
|
||||
s32 unk10;
|
||||
s32 unk14;
|
||||
s32 unk18;
|
||||
s32 unk1C;
|
||||
s32 unk20;
|
||||
s32 unk24;
|
||||
} AssetObjectHeaders;
|
||||
|
||||
/* Size: 0x3C bytes */
|
||||
typedef struct CheckpointNode {
|
||||
/* 0x00 */ f32 rotationXFrac;
|
||||
/* 0x04 */ f32 rotationYFrac;
|
||||
/* 0x08 */ f32 rotationZFrac;
|
||||
/* 0x0C */ f32 unkC;
|
||||
/* 0x10 */ f32 x;
|
||||
/* 0x14 */ f32 y;
|
||||
/* 0x18 */ f32 z;
|
||||
/* 0x1C */ f32 scale;
|
||||
/* 0x20 */ f32 distance;
|
||||
/* 0x24 */ f32 unk24; // Appears to be exactly the same as distance?
|
||||
/* 0x28 */ Object *obj;
|
||||
/* 0x2C */ s16 unk2C;
|
||||
/* 0x2E */ s8 unk2E[4];
|
||||
/* 0x32 */ s8 unk32[4];
|
||||
/* 0x36 */ s8 unk36[4]; // Appear to be flags of some sort?
|
||||
/* 0x3A */ s8 altRouteID; // -1 if there's none to be found.
|
||||
/* 0x3B */ u8 unk3B;
|
||||
/* 0x00 */ f32 rotationXFrac;
|
||||
/* 0x04 */ f32 rotationYFrac;
|
||||
/* 0x08 */ f32 rotationZFrac;
|
||||
/* 0x0C */ f32 unkC;
|
||||
/* 0x10 */ f32 x;
|
||||
/* 0x14 */ f32 y;
|
||||
/* 0x18 */ f32 z;
|
||||
/* 0x1C */ f32 scale;
|
||||
/* 0x20 */ f32 distance;
|
||||
/* 0x24 */ f32 unk24; // Appears to be exactly the same as distance?
|
||||
/* 0x28 */ Object *obj;
|
||||
/* 0x2C */ s16 unk2C;
|
||||
/* 0x2E */ s8 unk2E[4];
|
||||
/* 0x32 */ s8 unk32[4];
|
||||
/* 0x36 */ s8 unk36[4]; // Appear to be flags of some sort?
|
||||
/* 0x3A */ s8 altRouteID; // -1 if there's none to be found.
|
||||
/* 0x3B */ u8 unk3B;
|
||||
} CheckpointNode;
|
||||
|
||||
/* Size: 0x40 bytes */
|
||||
@@ -262,25 +249,6 @@ typedef struct unk800179D0 {
|
||||
u32 unk3C;
|
||||
} unk800179D0;
|
||||
|
||||
typedef struct struct_8000FC6C {
|
||||
f32 unk0;
|
||||
TextureHeader *unk4;
|
||||
s16 unk8;
|
||||
s16 unkA;
|
||||
s16 unkC;
|
||||
s16 unkE;
|
||||
} struct_8000FC6C;
|
||||
|
||||
typedef struct struct_8000FC6C_2 {
|
||||
s32 unk0;
|
||||
s32 unk4;
|
||||
f32 unk8;
|
||||
s32 unkC;
|
||||
u8 unk10[0x26];
|
||||
s16 unk36;
|
||||
s16 unk38;
|
||||
} struct_8000FC6C_2;
|
||||
|
||||
typedef struct TTGhostTable {
|
||||
u8 mapId;
|
||||
u8 defaultVehicleId;
|
||||
@@ -293,41 +261,12 @@ typedef struct ObjectTransformExt {
|
||||
s16 unk1A;
|
||||
} ObjectTransformExt;
|
||||
|
||||
typedef struct unk80022CFC_2 {
|
||||
u8 pad[0xA];
|
||||
s8 unkA;
|
||||
} unk80022CFC_2;
|
||||
|
||||
typedef struct unk80022CFC_1 {
|
||||
u8 pad[0xC];
|
||||
f32 unkC;
|
||||
f32 unk10;
|
||||
f32 unk14;
|
||||
u8 pad18[0x16];
|
||||
s16 unk2E;
|
||||
u8 pad30[0x9];
|
||||
s8 unk39;
|
||||
u8 pad3A[0x2];
|
||||
unk80022CFC_2* unk3C;
|
||||
s32 pad40[2];
|
||||
s16 unk48;
|
||||
u16 pad4A[0x16];
|
||||
s32 unk78;
|
||||
} unk80022CFC_1;
|
||||
|
||||
/* Size: 0x1A bytes */
|
||||
typedef struct ObjectTransform_800135B8 {
|
||||
ObjectTransform trans;
|
||||
s16 unk18;
|
||||
} ObjectTransform_800135B8;
|
||||
|
||||
typedef struct unk8001A7D8_arg0 {
|
||||
u8 pad0[4];
|
||||
s32 *unk4;
|
||||
u8 pad8[0x41];
|
||||
u8 unk49;
|
||||
} unk8001A7D8_arg0;
|
||||
|
||||
typedef struct unk800149C0 {
|
||||
u8 pad0[4];
|
||||
u8 unk4;
|
||||
@@ -342,21 +281,6 @@ typedef struct RacerFXData {
|
||||
u8 unk3;
|
||||
} RacerFXData;
|
||||
|
||||
typedef struct unk80017A18_10 {
|
||||
f32 unk0;
|
||||
f32 unk4;
|
||||
f32 unk8;
|
||||
f32 unkC;
|
||||
} unk80017A18_10;
|
||||
|
||||
typedef struct unk80017A18 {
|
||||
u8 pad0[0xC];
|
||||
u16 *unkC;
|
||||
unk80017A18_10 *unk10;
|
||||
u8 pad14[0x1E];
|
||||
s16 unk32;
|
||||
} unk80017A18;
|
||||
|
||||
extern s32 osCicId; // Used for an Anti-Piracy check in render_3d_model
|
||||
|
||||
Object *racerfx_get_boost(s32 boostID);
|
||||
@@ -410,7 +334,7 @@ s16 race_finish_timer(void);
|
||||
u32 get_balloon_cutscene_timer(void);
|
||||
s32 timetrial_valid_player_ghost(void);
|
||||
Object *timetrial_player_ghost(void);
|
||||
s32 timetrial_staff_ghost_check(Object* obj);
|
||||
s32 timetrial_staff_ghost_check(Object *obj);
|
||||
Object *timetrial_ghost_staff(void);
|
||||
s32 timetrial_staff_unbeaten(void);
|
||||
SIDeviceStatus timetrial_save_player_ghost(s32 controllerIndex);
|
||||
@@ -424,7 +348,7 @@ Object **get_racer_objects(s32 *numRacers);
|
||||
Object **get_racer_objects_by_port(s32 *numRacers);
|
||||
Object **get_racer_objects_by_position(s32 *numRacers);
|
||||
Object *get_racer_object(s32 index);
|
||||
void debug_render_checkpoint_node(s32 checkpointID, s32 pathID, Gfx** dList, Mtx **mtx, Vertex **vtx);
|
||||
void debug_render_checkpoint_node(s32 checkpointID, s32 pathID, Gfx **dList, Mtx **mtx, Vertex **vtx);
|
||||
Object *spectate_object(s32 cameraIndex);
|
||||
void ainode_enable(void);
|
||||
void ainode_tail_set(s32 nodeID);
|
||||
@@ -493,17 +417,18 @@ s32 init_object_shading(Object *obj, ShadeProperties *shadeData);
|
||||
ObjectHeader *load_object_header(s32 index);
|
||||
s32 obj_init_attachpoint(Object *);
|
||||
void try_free_object_header(s32 index);
|
||||
s32 get_object_property_size(Object *obj, Object_64 *obj64);
|
||||
s32 get_object_property_size(Object *obj, void *obj64);
|
||||
void light_setup_light_sources(Object *obj);
|
||||
s32 init_object_interaction_data(Object *obj, ObjectInteraction *interactObj);
|
||||
s32 obj_init_emitter(Object *obj, ParticleEmitter *emitter);
|
||||
s32 obj_init_property_flags(s32 behaviorId);
|
||||
void tt_ghost_beaten(s32 arg0, s16 *playerId);
|
||||
void obj_init_animcamera(Object *, Object *);
|
||||
void obj_init_animobject(Object *, Object *);
|
||||
Object *obj_butterfly_node(f32 x, f32 y, f32 z, f32 maxDistCheck, s32 dontCheckYAxis);
|
||||
void func_8002125C(Object *charSelectObj, LevelObjectEntry_CharacterSelect *entry, Object_CharacterSelect *charSelect, UNUSED s32 index);
|
||||
void func_80021104(Object *obj, Object_Animation *animObj, LevelObjectEntry_Animation *entry);
|
||||
s32 func_8001955C(Object *obj, s32 checkpoint, u8 arg2, s32 arg3, s32 arg4, f32 checkpointDist, f32 *outX, f32 *outY, f32 *outZ);
|
||||
void func_8002125C(Object *obj, LevelObjectEntry_Animation *entry, Object_AnimatedObject *charSelect, UNUSED s32 index);
|
||||
void func_80021104(Object *obj, Object_AnimatedObject *animObj, LevelObjectEntry_Animation *entry);
|
||||
s32 func_8001955C(Object *obj, s32 checkpoint, u8 arg2, s32 arg3, s32 arg4, f32 checkpointDist, f32 *outX, f32 *outY,
|
||||
f32 *outZ);
|
||||
void func_80016500(Object *obj, Object_Racer *racer);
|
||||
void func_8000C8F8(s32, s32);
|
||||
u8 timetrial_init_staff_ghost(s32 trackId);
|
||||
@@ -530,28 +455,29 @@ unk800179D0 *func_8001790C(u32 *arg0, u32 *arg1);
|
||||
unk800179D0 *func_80017978(s32 arg0, s32 arg1);
|
||||
s8 func_800214E4(Object *obj, s32 updateRate);
|
||||
f32 lerp_and_get_derivative(f32 *data, u32 index, f32 t, f32 *derivative);
|
||||
void race_check_finish(s32 updateRate);
|
||||
|
||||
/**
|
||||
* Faster variant of the shading function for objects.
|
||||
* Unlike the fancy option, does not calculate envmaps.
|
||||
*/
|
||||
void obj_shade_fast(ObjectModel *model, Object * obj, f32 intensity);
|
||||
*/
|
||||
void obj_shade_fast(ObjectModel *model, Object *obj, f32 intensity);
|
||||
|
||||
/**
|
||||
* Animation function for objects. Does per-vertex transformation.
|
||||
*/
|
||||
*/
|
||||
s32 obj_animate(Object *obj);
|
||||
|
||||
//Non Matching
|
||||
// Non Matching
|
||||
void calc_dynamic_lighting_for_object_1(Object *, ObjectModel *, s16, Object *, f32, f32);
|
||||
void calc_dynamic_lighting_for_object_2(Object *, ObjectModel *, s16, f32);
|
||||
void decrypt_magic_codes(s32 *data, s32 length);
|
||||
s32 get_first_active_object(s32 *);
|
||||
Object *spawn_object(LevelObjectEntryCommon *entry, s32);
|
||||
s32 func_8001F460(Object*, s32, Object*);
|
||||
s32 func_8001F460(Object *, s32, Object *);
|
||||
void func_8000B750(Object *racerObj, s32 racerIndex, s32 vehicleIDPrev, s32 boostType, s32 arg4);
|
||||
void func_80018CE0(Object* racerObj, f32 xPos, f32 yPos, f32 zPos, s32 updateRate);
|
||||
s32 func_800185E4(s32 checkpointIndex, Object *obj, f32 objX, f32 objY, f32 objZ, f32 *arg5, u8 *arg6);
|
||||
void func_80018CE0(Object *racerObj, f32 xPos, f32 yPos, f32 zPos, s32 updateRate);
|
||||
s32 func_800185E4(s32 checkpointIndex, Object *obj, f32 objX, f32 objY, f32 objZ, f32 *checkpointDistance, u8 *arg6);
|
||||
void obj_tex_animate(Object *, s32);
|
||||
Object *find_furthest_telepoint(f32 x, f32 z);
|
||||
void func_8006017C(ObjectModel *);
|
||||
@@ -562,15 +488,16 @@ void func_8000CC7C(Vehicle, u32, s32);
|
||||
void func_80017E98(void);
|
||||
void spectate_update(void);
|
||||
void func_8001E93C(void);
|
||||
void race_check_finish(s32 updateRate);
|
||||
void func_80014090(Object*, s32);
|
||||
void audspat_update_all(Object**, s32, s32);
|
||||
void func_80019808(s32 updateRate);
|
||||
void func_80014090(Object *, s32);
|
||||
void audspat_update_all(Object **, s32, s32);
|
||||
void func_8001E89C(void);
|
||||
CheckpointNode *func_800230D0(Object*, Object_Racer*);
|
||||
CheckpointNode *func_800230D0(Object *, Object_Racer *);
|
||||
void obj_update(s32 updateRate);
|
||||
void func_800159C8(Object *, Object *);
|
||||
void obj_door_number(ObjectModel *, Object *);
|
||||
s16 func_8001CD28(s32 arg0, s32 arg1, s32 arg2, s32 arg3); // NON MATCHING
|
||||
f32 func_8001C6C4(Object_NPC *, Object *, f32, f32, s32);
|
||||
s32 func_80017A18(ObjectModel *, s32, s32*, f32*, f32*, f32*, f32*, f32*, f32*, f32*, s8 *surface, f32); // NON EQUIVALENT
|
||||
s32 func_80017A18(ObjectModel *, s32, s32 *, f32 *, f32 *, f32 *, f32 *, f32 *, f32 *, f32 *, s8 *surface,
|
||||
f32); // NON EQUIVALENT
|
||||
#endif
|
||||
|
||||
+50
-55
@@ -720,9 +720,9 @@ void obj_enable_emitter(Object *obj, s32 emitterIndex) {
|
||||
emitter->timeFromLastSpawn = 0;
|
||||
|
||||
if (emitter->flags & PARTICLE_LINE) {
|
||||
emitter->lineRefPoint.x = obj->segment.trans.x_position;
|
||||
emitter->lineRefPoint.y = obj->segment.trans.y_position;
|
||||
emitter->lineRefPoint.z = obj->segment.trans.z_position;
|
||||
emitter->lineRefPoint.x = obj->trans.x_position;
|
||||
emitter->lineRefPoint.y = obj->trans.y_position;
|
||||
emitter->lineRefPoint.z = obj->trans.z_position;
|
||||
} else if (emitter->flags & PARTICLE_POINT) {
|
||||
emitter->point_opacity = gParticlesAssetTable[emitter->descriptorID]->colour.a << 8;
|
||||
|
||||
@@ -756,7 +756,7 @@ void obj_enable_emitter(Object *obj, s32 emitterIndex) {
|
||||
}
|
||||
emitter->flags &= ~PARTICLE_POINT_EMITTER_DISABLED;
|
||||
emitter->flags |= PARTICLE_EMITTER_ENABLED | PARTICLE_EMITTER_AWAITING_SPAWN;
|
||||
obj->segment.numActiveEmitters++;
|
||||
obj->numActiveEmitters++;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -768,7 +768,7 @@ void obj_disable_emitter(Object *obj, s32 emitterIndex) {
|
||||
emitter = &obj->particleEmitter[emitterIndex];
|
||||
|
||||
emitter->flags &= ~PARTICLE_EMITTER_ENABLED;
|
||||
obj->segment.numActiveEmitters--;
|
||||
obj->numActiveEmitters--;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -790,12 +790,12 @@ void update_vehicle_particles(Object *racerObj, s32 updateRate) {
|
||||
u32 emittersEnabled;
|
||||
u8 *alphaPtr;
|
||||
|
||||
racer = &racerObj->unk64->racer;
|
||||
racer = racerObj->racer;
|
||||
emittersEnabled = racerObj->particleEmittersEnabled;
|
||||
vehicleId = racer->vehicleID;
|
||||
i = 0;
|
||||
object_do_player_tumble(racerObj);
|
||||
for (; i < racerObj->segment.header->particleCount; i++) {
|
||||
for (; i < racerObj->header->particleCount; i++) {
|
||||
if (emittersEnabled & OBJ_EMIT_1) {
|
||||
someBool = TRUE;
|
||||
switch (vehicleId) {
|
||||
@@ -938,7 +938,7 @@ void obj_spawn_particle(Object *obj, s32 updateRate) {
|
||||
u32 bits;
|
||||
|
||||
bits = obj->particleEmittersEnabled;
|
||||
for (i = 0; i < obj->segment.header->particleCount; i++) {
|
||||
for (i = 0; i < obj->header->particleCount; i++) {
|
||||
if (bits & 1) {
|
||||
if (!(obj->particleEmitter[i].flags & PARTICLE_EMITTER_ENABLED)) {
|
||||
obj_enable_emitter(obj, i);
|
||||
@@ -1073,14 +1073,14 @@ void setup_particle_velocity(Particle *particle, Object *obj, ParticleEmitter *e
|
||||
switch (behaviour->flags & (PARTICLE_VELOCITY_RELATIVE_TO_PARENT | PARTICLE_VELOCITY_ABSOLUTE |
|
||||
PARTICLE_VELOCITY_SCALED_FROM_PARENT)) {
|
||||
case PARTICLE_VELOCITY_RELATIVE_TO_PARENT:
|
||||
particle->velocity.x += obj->segment.x_velocity;
|
||||
particle->velocity.y += obj->segment.y_velocity;
|
||||
particle->velocity.z += obj->segment.z_velocity;
|
||||
particle->velocity.x += obj->x_velocity;
|
||||
particle->velocity.y += obj->y_velocity;
|
||||
particle->velocity.z += obj->z_velocity;
|
||||
break;
|
||||
case PARTICLE_VELOCITY_SCALED_FROM_PARENT:
|
||||
particle->velocity.x *= obj->segment.x_velocity;
|
||||
particle->velocity.y *= obj->segment.y_velocity;
|
||||
particle->velocity.z *= obj->segment.z_velocity;
|
||||
particle->velocity.x *= obj->x_velocity;
|
||||
particle->velocity.y *= obj->y_velocity;
|
||||
particle->velocity.z *= obj->z_velocity;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1110,7 +1110,7 @@ void setup_particle_velocity(Particle *particle, Object *obj, ParticleEmitter *e
|
||||
} else {
|
||||
vec3f_rotate_py(&emitter->emissionDirection, &sourceVel);
|
||||
}
|
||||
vec3f_rotate(&particle->parentObj->segment.trans.rotation, &sourceVel);
|
||||
vec3f_rotate(&particle->parentObj->trans.rotation, &sourceVel);
|
||||
|
||||
particle->velocity.x += sourceVel.x;
|
||||
particle->velocity.y += sourceVel.y;
|
||||
@@ -1166,18 +1166,18 @@ void setup_particle_position(Particle *particle, Object *obj, ParticleEmitter *e
|
||||
particle->localPos.z += sourcePos.z;
|
||||
}
|
||||
if (particle->movementType != PARTICLE_MOVEMENT_BASIC_PARENT) {
|
||||
vec3f_rotate(&obj->segment.trans.rotation, &particle->localPos);
|
||||
vec3f_rotate(&obj->trans.rotation, &particle->localPos);
|
||||
}
|
||||
particle->trans.x_position = particle->localPos.x;
|
||||
particle->trans.y_position = particle->localPos.y;
|
||||
particle->trans.z_position = particle->localPos.z;
|
||||
if (particle->movementType == PARTICLE_MOVEMENT_BASIC_PARENT) {
|
||||
vec3f_rotate(&obj->segment.trans.rotation, (Vec3f *) &particle->trans.x_position);
|
||||
vec3f_rotate(&obj->trans.rotation, (Vec3f *) &particle->trans.x_position);
|
||||
}
|
||||
|
||||
particle->trans.x_position += obj->segment.trans.x_position;
|
||||
particle->trans.y_position += obj->segment.trans.y_position;
|
||||
particle->trans.z_position += obj->segment.trans.z_position;
|
||||
particle->trans.x_position += obj->trans.x_position;
|
||||
particle->trans.y_position += obj->trans.y_position;
|
||||
particle->trans.z_position += obj->trans.z_position;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1199,7 +1199,7 @@ PointParticle *create_point_particle(Object *obj, ParticleEmitter *emitter) {
|
||||
return particle;
|
||||
}
|
||||
|
||||
particle->base.segmentID = obj->segment.object.segmentID;
|
||||
particle->base.segmentID = obj->segmentID;
|
||||
particle->base.trans.flags = OBJ_FLAGS_PARTICLE;
|
||||
particle->base.movementType = descriptor->movementType;
|
||||
particle->base.descFlags = descriptor->flags;
|
||||
@@ -1249,12 +1249,9 @@ PointParticle *create_point_particle(Object *obj, ParticleEmitter *emitter) {
|
||||
particle->base.trans.rotation.x_rotation = behaviour->rotation.x_rotation;
|
||||
particle->base.trans.rotation.z_rotation = behaviour->rotation.z_rotation;
|
||||
} else {
|
||||
particle->base.trans.rotation.y_rotation =
|
||||
obj->segment.trans.rotation.y_rotation + behaviour->rotation.y_rotation;
|
||||
particle->base.trans.rotation.x_rotation =
|
||||
obj->segment.trans.rotation.x_rotation + behaviour->rotation.x_rotation;
|
||||
particle->base.trans.rotation.z_rotation =
|
||||
obj->segment.trans.rotation.z_rotation + behaviour->rotation.z_rotation;
|
||||
particle->base.trans.rotation.y_rotation = obj->trans.rotation.y_rotation + behaviour->rotation.y_rotation;
|
||||
particle->base.trans.rotation.x_rotation = obj->trans.rotation.x_rotation + behaviour->rotation.x_rotation;
|
||||
particle->base.trans.rotation.z_rotation = obj->trans.rotation.z_rotation + behaviour->rotation.z_rotation;
|
||||
}
|
||||
particle->base.angularVelocity.y_rotation = behaviour->angularVelocity.y_rotation;
|
||||
particle->base.angularVelocity.x_rotation = behaviour->angularVelocity.x_rotation;
|
||||
@@ -1333,7 +1330,7 @@ Particle *create_line_particle(Object *obj, ParticleEmitter *emitter) {
|
||||
if (particle == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
particle->segmentID = obj->segment.object.segmentID;
|
||||
particle->segmentID = obj->segmentID;
|
||||
particle->trans.flags = OBJ_FLAGS_PARTICLE;
|
||||
particle->movementType = descriptor->movementType;
|
||||
particle->descFlags = descriptor->flags;
|
||||
@@ -1380,10 +1377,10 @@ Particle *create_line_particle(Object *obj, ParticleEmitter *emitter) {
|
||||
emitter->lineRefPoint.x = emitter->position.x;
|
||||
emitter->lineRefPoint.y = emitter->position.y;
|
||||
emitter->lineRefPoint.z = emitter->position.z;
|
||||
vec3f_rotate(&obj->segment.trans.rotation, &emitter->lineRefPoint);
|
||||
emitter->lineRefPoint.x += obj->segment.trans.x_position;
|
||||
emitter->lineRefPoint.y += obj->segment.trans.y_position;
|
||||
emitter->lineRefPoint.z += obj->segment.trans.z_position;
|
||||
vec3f_rotate(&obj->trans.rotation, &emitter->lineRefPoint);
|
||||
emitter->lineRefPoint.x += obj->trans.x_position;
|
||||
emitter->lineRefPoint.y += obj->trans.y_position;
|
||||
emitter->lineRefPoint.z += obj->trans.z_position;
|
||||
|
||||
particle->lineCreationPhase = 0;
|
||||
particle->lineOrientation = 0;
|
||||
@@ -1433,9 +1430,9 @@ Particle *create_line_particle(Object *obj, ParticleEmitter *emitter) {
|
||||
}
|
||||
particle->lineOrientation = descriptor->lineOrientation;
|
||||
particle->line_unused_6B = descriptor->line_unused_B;
|
||||
particle->trans.x_position = obj->segment.trans.x_position;
|
||||
particle->trans.y_position = obj->segment.trans.y_position;
|
||||
particle->trans.z_position = obj->segment.trans.z_position;
|
||||
particle->trans.x_position = obj->trans.x_position;
|
||||
particle->trans.y_position = obj->trans.y_position;
|
||||
particle->trans.z_position = obj->trans.z_position;
|
||||
emitter->line_unused = 0;
|
||||
return particle;
|
||||
}
|
||||
@@ -1465,7 +1462,7 @@ Particle *create_general_particle(Object *obj, ParticleEmitter *emitter) {
|
||||
if (particle == NULL) {
|
||||
return particle;
|
||||
}
|
||||
particle->segmentID = obj->segment.object.segmentID;
|
||||
particle->segmentID = obj->segmentID;
|
||||
particle->trans.flags = OBJ_FLAGS_PARTICLE;
|
||||
particle->movementType = descriptor->movementType;
|
||||
particle->descFlags = descriptor->flags;
|
||||
@@ -1487,9 +1484,8 @@ Particle *create_general_particle(Object *obj, ParticleEmitter *emitter) {
|
||||
scale += (f32) rand_range(-behaviour->scaleVelocityRange, behaviour->scaleVelocityRange) * 0.00001525878906;
|
||||
}
|
||||
if (behaviour->flags & PARTICLE_SCALE_VELOCITY_INHERITS_PARENT_SPEED) {
|
||||
particle->scaleVelocity = sqrtf((obj->segment.x_velocity * obj->segment.x_velocity) +
|
||||
(obj->segment.y_velocity * obj->segment.y_velocity) +
|
||||
(obj->segment.z_velocity * obj->segment.z_velocity)) *
|
||||
particle->scaleVelocity = sqrtf((obj->x_velocity * obj->x_velocity) + (obj->y_velocity * obj->y_velocity) +
|
||||
(obj->z_velocity * obj->z_velocity)) *
|
||||
scale * 0.1f;
|
||||
} else {
|
||||
particle->scaleVelocity = descriptor->scale * scale;
|
||||
@@ -1627,9 +1623,9 @@ Particle *create_general_particle(Object *obj, ParticleEmitter *emitter) {
|
||||
particle->trans.rotation.x_rotation = behaviour->rotation.x_rotation;
|
||||
particle->trans.rotation.z_rotation = behaviour->rotation.z_rotation;
|
||||
} else {
|
||||
particle->trans.rotation.y_rotation = obj->segment.trans.rotation.y_rotation + behaviour->rotation.y_rotation;
|
||||
particle->trans.rotation.x_rotation = obj->segment.trans.rotation.x_rotation + behaviour->rotation.x_rotation;
|
||||
particle->trans.rotation.z_rotation = obj->segment.trans.rotation.z_rotation + behaviour->rotation.z_rotation;
|
||||
particle->trans.rotation.y_rotation = obj->trans.rotation.y_rotation + behaviour->rotation.y_rotation;
|
||||
particle->trans.rotation.x_rotation = obj->trans.rotation.x_rotation + behaviour->rotation.x_rotation;
|
||||
particle->trans.rotation.z_rotation = obj->trans.rotation.z_rotation + behaviour->rotation.z_rotation;
|
||||
}
|
||||
randomizationFlags =
|
||||
behaviour->randomizationFlags & (PARTICLE_RANDOM_ROLL | PARTICLE_RANDOM_PITCH | PARTICLE_RANDOM_YAW);
|
||||
@@ -2029,9 +2025,8 @@ void update_line_particle(Particle *particle) {
|
||||
if (particle->lineCreationPhase < 2 && obj != NULL) {
|
||||
|
||||
if (emitter->behaviour->flags & PARTICLE_SCALE_VELOCITY_INHERITS_PARENT_SPEED) {
|
||||
scale = sqrtf((obj->segment.x_velocity * obj->segment.x_velocity) +
|
||||
(obj->segment.y_velocity * obj->segment.y_velocity) +
|
||||
(obj->segment.z_velocity * obj->segment.z_velocity));
|
||||
scale = sqrtf((obj->x_velocity * obj->x_velocity) + (obj->y_velocity * obj->y_velocity) +
|
||||
(obj->z_velocity * obj->z_velocity));
|
||||
scale = scale * particle->trans.scale * 0.1f;
|
||||
} else {
|
||||
scale = particle->trans.scale;
|
||||
@@ -2051,11 +2046,11 @@ void update_line_particle(Particle *particle) {
|
||||
vtxOffset.y = scale;
|
||||
break;
|
||||
}
|
||||
vec3f_rotate(&obj->segment.trans.rotation, &vtxOffset);
|
||||
vec3f_rotate(&obj->trans.rotation, &vtxOffset);
|
||||
} else {
|
||||
vtxOffset.x = obj->segment.x_velocity;
|
||||
vtxOffset.y = obj->segment.y_velocity;
|
||||
vtxOffset.z = obj->segment.z_velocity;
|
||||
vtxOffset.x = obj->x_velocity;
|
||||
vtxOffset.y = obj->y_velocity;
|
||||
vtxOffset.z = obj->z_velocity;
|
||||
tempf = ((vtxOffset.x * vtxOffset.x) + (vtxOffset.y * vtxOffset.y)) + (vtxOffset.z * vtxOffset.f[2]);
|
||||
if (tempf < 0.01f) {
|
||||
tempf = 1.0f;
|
||||
@@ -2245,9 +2240,9 @@ void move_particle_basic_parent(Particle *particle) {
|
||||
particle->trans.z_position = particle->localPos.z;
|
||||
parent = particle->parentObj;
|
||||
if (parent) {
|
||||
particle->trans.x_position += parent->segment.trans.x_position;
|
||||
particle->trans.y_position += parent->segment.trans.y_position;
|
||||
particle->trans.z_position += parent->segment.trans.z_position;
|
||||
particle->trans.x_position += parent->trans.x_position;
|
||||
particle->trans.y_position += parent->trans.y_position;
|
||||
particle->trans.z_position += parent->trans.z_position;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2277,9 +2272,9 @@ void move_particle_attached_to_parent(Particle *particle) {
|
||||
|
||||
parent = particle->parentObj;
|
||||
if (parent != NULL) {
|
||||
particle->trans.x_position += parent->segment.trans.x_position;
|
||||
particle->trans.y_position += parent->segment.trans.y_position;
|
||||
particle->trans.z_position += parent->segment.trans.z_position;
|
||||
particle->trans.x_position += parent->trans.x_position;
|
||||
particle->trans.y_position += parent->trans.y_position;
|
||||
particle->trans.z_position += parent->trans.z_position;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+805
-828
File diff suppressed because it is too large
Load Diff
+135
-139
File diff suppressed because it is too large
Load Diff
+28
-28
@@ -61,8 +61,8 @@ void update_bluey(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *ra
|
||||
set_boss_voice_clip_offset(gBlueyVoiceTable);
|
||||
*buttonsPressed &= ~R_TRIG;
|
||||
*input &= ~R_TRIG;
|
||||
animID = obj->segment.object.animationID;
|
||||
animFrame = obj->segment.animFrame;
|
||||
animID = obj->animationID;
|
||||
animFrame = obj->animFrame;
|
||||
tempHeadAngle = racer->headAngle;
|
||||
if (racer->raceFinished == TRUE && func_80023568()) {
|
||||
func_80021400(130);
|
||||
@@ -93,37 +93,37 @@ void update_bluey(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *ra
|
||||
*startTimer = tempStartTimer;
|
||||
racer->lateral_velocity = 0.0f;
|
||||
racer->headAngle = tempHeadAngle;
|
||||
obj->segment.object.animationID = animID;
|
||||
obj->segment.animFrame = animFrame;
|
||||
obj->animationID = animID;
|
||||
obj->animFrame = animFrame;
|
||||
if (racer->attackType != ATTACK_NONE) {
|
||||
if (obj->segment.object.animationID != ANIM_BLUEY_DAMAGE) {
|
||||
racer->unk1CD = obj->segment.object.animationID;
|
||||
obj->segment.object.animationID = ANIM_BLUEY_DAMAGE;
|
||||
if (obj->animationID != ANIM_BLUEY_DAMAGE) {
|
||||
racer->unk1CD = obj->animationID;
|
||||
obj->animationID = ANIM_BLUEY_DAMAGE;
|
||||
racer->animationSpeed = 0.0f;
|
||||
play_random_boss_sound(BOSS_SOUND_NEGATIVE);
|
||||
sound_play(SOUND_EXPLOSION, NULL);
|
||||
set_camera_shake(12.0f);
|
||||
racer->attackType = ATTACK_NONE;
|
||||
racer->velocity *= 0.3;
|
||||
obj->segment.y_velocity += 7.5;
|
||||
obj->y_velocity += 7.5;
|
||||
}
|
||||
}
|
||||
if (racer->approachTarget != NULL) {
|
||||
diffX = obj->segment.x_velocity * obj->segment.x_velocity;
|
||||
diffZ = obj->segment.z_velocity * obj->segment.z_velocity;
|
||||
diffX = obj->x_velocity * obj->x_velocity;
|
||||
diffZ = obj->z_velocity * obj->z_velocity;
|
||||
racer->velocity = -sqrtf((diffX * diffX) + (diffZ * diffZ));
|
||||
}
|
||||
sp3C = FALSE;
|
||||
if ((find_next_checkpoint_node(racer->checkpoint, racer->unk1C8))->unk36[racer->unk1CA] == 1) {
|
||||
sp3C = TRUE;
|
||||
}
|
||||
if (obj->segment.object.animationID != ANIM_BLUEY_DAMAGE) {
|
||||
if (obj->animationID != ANIM_BLUEY_DAMAGE) {
|
||||
if (racer->velocity < -2.0) {
|
||||
if (sp3C) {
|
||||
if (racer->unk1CD != 3) {
|
||||
racer->animationSpeed = 40.0f;
|
||||
}
|
||||
obj->segment.object.animationID = ANIM_BLUEY_TURN;
|
||||
obj->animationID = ANIM_BLUEY_TURN;
|
||||
steerVel = racer->steerAngle * 2;
|
||||
steerVel = 40 - steerVel;
|
||||
if (steerVel < 0) {
|
||||
@@ -136,16 +136,16 @@ void update_bluey(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *ra
|
||||
racer->animationSpeed += (steerVel - racer->animationSpeed) * 0.25;
|
||||
} else {
|
||||
racer->unk1CD = 0;
|
||||
obj->segment.object.animationID = ANIM_BLUEY_RUN;
|
||||
obj->animationID = ANIM_BLUEY_RUN;
|
||||
racer->animationSpeed -= (racer->velocity * updateRateF) * 0.5;
|
||||
}
|
||||
} else if (racer->velocity < -0.1 || 0.1 < racer->velocity) {
|
||||
racer->unk1CD = 1;
|
||||
obj->segment.object.animationID = ANIM_BLUEY_WALK;
|
||||
obj->animationID = ANIM_BLUEY_WALK;
|
||||
racer->animationSpeed -= racer->velocity * updateRateF * 2;
|
||||
} else {
|
||||
racer->unk1CD = 2;
|
||||
obj->segment.object.animationID = ANIM_BLUEY_IDLE;
|
||||
obj->animationID = ANIM_BLUEY_IDLE;
|
||||
racer->animationSpeed += updateRateF * 1.0;
|
||||
}
|
||||
} else {
|
||||
@@ -153,7 +153,7 @@ void update_bluey(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *ra
|
||||
}
|
||||
modInst = obj->modelInstances[0];
|
||||
objModel = modInst->objModel;
|
||||
diffX = (objModel->animations[obj->segment.object.animationID].animLength * 16) - 17;
|
||||
diffX = (objModel->animations[obj->animationID].animLength * 16) - 17;
|
||||
while (racer->animationSpeed < 0.0f) {
|
||||
racer->animationSpeed += diffX;
|
||||
modInst->animationID = -1;
|
||||
@@ -162,38 +162,38 @@ void update_bluey(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *ra
|
||||
racer->animationSpeed -= diffX;
|
||||
modInst->animationID = -1;
|
||||
}
|
||||
if (modInst->animationID == -1 && obj->segment.object.animationID == ANIM_BLUEY_DAMAGE) {
|
||||
obj->segment.object.animationID = racer->unk1CD;
|
||||
if (modInst->animationID == -1 && obj->animationID == ANIM_BLUEY_DAMAGE) {
|
||||
obj->animationID = racer->unk1CD;
|
||||
}
|
||||
animFrame = obj->segment.animFrame;
|
||||
obj->segment.animFrame = racer->animationSpeed;
|
||||
animFrame = obj->animFrame;
|
||||
obj->animFrame = racer->animationSpeed;
|
||||
obj->particleEmittersEnabled = OBJ_EMIT_NONE;
|
||||
if (obj->segment.object.animationID == ANIM_BLUEY_RUN) {
|
||||
if (obj->animationID == ANIM_BLUEY_RUN) {
|
||||
play_footstep_sounds(obj, 2, animFrame, SOUND_STOMP2, SOUND_STOMP3);
|
||||
obj->particleEmittersEnabled |= OBJ_EMIT_1 | OBJ_EMIT_2;
|
||||
}
|
||||
obj_spawn_particle(obj, updateRate);
|
||||
fade_when_near_camera(obj, racer, 40);
|
||||
firstRacerObj = get_racer_object(PLAYER_ONE);
|
||||
diffX = firstRacerObj->segment.trans.x_position - obj->segment.trans.x_position;
|
||||
diffZ = firstRacerObj->segment.trans.z_position - obj->segment.trans.z_position;
|
||||
diffX = firstRacerObj->trans.x_position - obj->trans.x_position;
|
||||
diffZ = firstRacerObj->trans.z_position - obj->trans.z_position;
|
||||
if (sqrtf((diffX * diffX) + (diffZ * diffZ)) < 700.0) {
|
||||
tempStartTimer = (arctan2_f(diffX, diffZ) - (obj->segment.trans.rotation.y_rotation & 0xFFFF)) + 0x8000;
|
||||
tempStartTimer = (arctan2_f(diffX, diffZ) - (obj->trans.rotation.y_rotation & 0xFFFF)) + 0x8000;
|
||||
WRAP(tempStartTimer, -0x8000, 0x8000);
|
||||
CLAMP(tempStartTimer, -0xC00, 0xC00);
|
||||
racer->headAngleTarget = tempStartTimer;
|
||||
}
|
||||
if (obj->segment.object.animationID == ANIM_BLUEY_WALK) {
|
||||
if (obj->animationID == ANIM_BLUEY_WALK) {
|
||||
if ((racer->miscAnimCounter & 0x1F) < 10) {
|
||||
racer->headAngleTarget >>= 1;
|
||||
}
|
||||
}
|
||||
if (obj->segment.object.animationID == ANIM_BLUEY_TURN) {
|
||||
if (obj->animationID == ANIM_BLUEY_TURN) {
|
||||
racer->headAngleTarget = 0;
|
||||
}
|
||||
racer = &firstRacerObj->unk64->racer;
|
||||
racer = firstRacerObj->racer;
|
||||
if (obj == firstRacerObj->interactObj->obj && firstRacerObj->interactObj->flags & INTERACT_FLAGS_PUSHING &&
|
||||
obj->segment.object.animationID == ANIM_BLUEY_WALK) {
|
||||
obj->animationID == ANIM_BLUEY_WALK) {
|
||||
racer->attackType = ATTACK_SQUISHED;
|
||||
}
|
||||
if (racer->raceFinished) {
|
||||
|
||||
+22
-22
@@ -64,8 +64,8 @@ void update_bubbler(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *
|
||||
set_boss_voice_clip_offset(gBubblerVoiceTable);
|
||||
*buttonsPressed &= ~R_TRIG;
|
||||
*input &= ~R_TRIG;
|
||||
animID = obj->segment.object.animationID;
|
||||
animFrame = obj->segment.animFrame;
|
||||
animID = obj->animationID;
|
||||
animFrame = obj->animFrame;
|
||||
tempHeadAngle = racer->headAngle;
|
||||
if (racer->raceFinished == TRUE) {
|
||||
func_80021400(130);
|
||||
@@ -93,12 +93,12 @@ void update_bubbler(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *
|
||||
*startTimer = timer;
|
||||
racer->lateral_velocity = 0.0f;
|
||||
racer->headAngle = tempHeadAngle;
|
||||
obj->segment.object.animationID = animID;
|
||||
obj->segment.animFrame = animFrame;
|
||||
if (racer->attackType != ATTACK_NONE && obj->segment.object.animationID != ANIM_BUBBLER_DAMAGE) {
|
||||
racer->unk1CD = obj->segment.object.animationID;
|
||||
obj->segment.object.animationID = ANIM_BUBBLER_DAMAGE;
|
||||
obj->segment.y_velocity += 7.5;
|
||||
obj->animationID = animID;
|
||||
obj->animFrame = animFrame;
|
||||
if (racer->attackType != ATTACK_NONE && obj->animationID != ANIM_BUBBLER_DAMAGE) {
|
||||
racer->unk1CD = obj->animationID;
|
||||
obj->animationID = ANIM_BUBBLER_DAMAGE;
|
||||
obj->y_velocity += 7.5;
|
||||
play_random_boss_sound(BOSS_SOUND_NEGATIVE);
|
||||
sound_play(SOUND_EXPLOSION, NULL);
|
||||
set_camera_shake(12.0f);
|
||||
@@ -107,14 +107,14 @@ void update_bubbler(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *
|
||||
}
|
||||
racer->attackType = ATTACK_NONE;
|
||||
if (racer->approachTarget != 0) {
|
||||
diffX = obj->segment.x_velocity * obj->segment.x_velocity;
|
||||
diffZ = obj->segment.z_velocity * obj->segment.z_velocity;
|
||||
diffX = obj->x_velocity * obj->x_velocity;
|
||||
diffZ = obj->z_velocity * obj->z_velocity;
|
||||
racer->velocity = -sqrtf((diffX * diffX) + (diffZ * diffZ));
|
||||
}
|
||||
modInst = obj->modelInstances[0];
|
||||
model = modInst->objModel;
|
||||
diffX = (model->animations[obj->segment.object.animationID].animLength * 16) - 17;
|
||||
obj->segment.object.animationID = ANIM_BUBBLER_MOVE;
|
||||
diffX = (model->animations[obj->animationID].animLength * 16) - 17;
|
||||
obj->animationID = ANIM_BUBBLER_MOVE;
|
||||
racer->animationSpeed += 2.0 * updateRateF;
|
||||
while (racer->animationSpeed < 0.0f) {
|
||||
racer->animationSpeed += diffX;
|
||||
@@ -124,11 +124,11 @@ void update_bubbler(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *
|
||||
racer->animationSpeed -= diffX;
|
||||
modInst->animationID = -1;
|
||||
}
|
||||
if (modInst->animationID == -1 && obj->segment.object.animationID == ANIM_BUBBLER_DAMAGE) {
|
||||
obj->segment.object.animationID = ANIM_BUBBLER_MOVE;
|
||||
if (modInst->animationID == -1 && obj->animationID == ANIM_BUBBLER_DAMAGE) {
|
||||
obj->animationID = ANIM_BUBBLER_MOVE;
|
||||
racer->animationSpeed = 0.0f;
|
||||
}
|
||||
obj->segment.animFrame = racer->animationSpeed;
|
||||
obj->animFrame = racer->animationSpeed;
|
||||
if (racer->playerIndex == PLAYER_COMPUTER) {
|
||||
temp2 = func_80023568();
|
||||
if (temp2 != 0) {
|
||||
@@ -142,7 +142,7 @@ void update_bubbler(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *
|
||||
obj->particleEmittersEnabled = OBJ_EMIT_NONE;
|
||||
obj_spawn_particle(obj, updateRate);
|
||||
fade_when_near_camera(obj, racer, 40);
|
||||
switch (obj->segment.object.animationID) {
|
||||
switch (obj->animationID) {
|
||||
case ANIM_BUBBLER_MOVE:
|
||||
headAngleRange = 0x2500;
|
||||
break;
|
||||
@@ -154,22 +154,22 @@ void update_bubbler(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *
|
||||
break;
|
||||
}
|
||||
firstRacerObj = get_racer_object(PLAYER_ONE);
|
||||
diffX = firstRacerObj->segment.trans.x_position - obj->segment.trans.x_position;
|
||||
diffZ = firstRacerObj->segment.trans.z_position - obj->segment.trans.z_position;
|
||||
diffX = firstRacerObj->trans.x_position - obj->trans.x_position;
|
||||
diffZ = firstRacerObj->trans.z_position - obj->trans.z_position;
|
||||
if (sqrtf((diffX * diffX) + (diffZ * diffZ)) < 700.0) {
|
||||
timer = (arctan2_f(diffX, diffZ) - (obj->segment.trans.rotation.y_rotation & 0xFFFF)) + 0x8000;
|
||||
timer = (arctan2_f(diffX, diffZ) - (obj->trans.rotation.y_rotation & 0xFFFF)) + 0x8000;
|
||||
WRAP(timer, -0x8000, 0x8000);
|
||||
CLAMP(timer, -headAngleRange, headAngleRange);
|
||||
racer->headAngleTarget = timer;
|
||||
}
|
||||
if (obj->segment.object.animationID == ANIM_BUBBLER_MOVE) {
|
||||
if (obj->animationID == ANIM_BUBBLER_MOVE) {
|
||||
if ((racer->miscAnimCounter & 0x1F) < 10) {
|
||||
racer->headAngleTarget >>= 1;
|
||||
}
|
||||
}
|
||||
racer = &firstRacerObj->unk64->racer;
|
||||
racer = firstRacerObj->racer;
|
||||
if (obj == firstRacerObj->interactObj->obj && firstRacerObj->interactObj->flags & INTERACT_FLAGS_PUSHING &&
|
||||
obj->segment.object.animationID == ANIM_BUBBLER_MOVE) {
|
||||
obj->animationID == ANIM_BUBBLER_MOVE) {
|
||||
racer->attackType = ATTACK_SQUISHED;
|
||||
}
|
||||
if (racer->raceFinished) {
|
||||
|
||||
+27
-27
@@ -45,14 +45,14 @@ void update_rocket(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *r
|
||||
s32 tempStartTimer;
|
||||
Object *someObj;
|
||||
Object *firstRacerObj;
|
||||
Object_WizpigRocket *rocket;
|
||||
Object_Boost *boost;
|
||||
ModelInstance *modInst;
|
||||
ObjectModel *objModel;
|
||||
|
||||
set_boss_voice_clip_offset((u16 *) gRocketVoiceTable);
|
||||
racer->tappedR = 0;
|
||||
animID = obj->segment.object.animationID;
|
||||
animFrame = obj->segment.animFrame;
|
||||
animID = obj->animationID;
|
||||
animFrame = obj->animFrame;
|
||||
tempHeadAngle = racer->headAngle;
|
||||
if (racer->velocity < 0.3 && -0.3 < racer->velocity) {
|
||||
*buttonsPressed = 0;
|
||||
@@ -87,34 +87,34 @@ void update_rocket(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *r
|
||||
*startTimer = tempStartTimer;
|
||||
obj->particleEmittersEnabled = OBJ_EMIT_NONE;
|
||||
racer->headAngle = tempHeadAngle;
|
||||
obj->segment.object.animationID = animID;
|
||||
obj->segment.animFrame = animFrame;
|
||||
if (racer->attackType != ATTACK_NONE && obj->segment.object.animationID != ANIM_ROCKET_DAMAGE) {
|
||||
obj->animationID = animID;
|
||||
obj->animFrame = animFrame;
|
||||
if (racer->attackType != ATTACK_NONE && obj->animationID != ANIM_ROCKET_DAMAGE) {
|
||||
play_random_boss_sound(BOSS_SOUND_NEGATIVE);
|
||||
sound_play(SOUND_EXPLOSION, NULL);
|
||||
set_camera_shake(12.0f);
|
||||
obj->segment.x_velocity *= 0.4;
|
||||
obj->segment.object.animationID = ANIM_ROCKET_DAMAGE;
|
||||
obj->segment.z_velocity *= 0.4;
|
||||
obj->x_velocity *= 0.4;
|
||||
obj->animationID = ANIM_ROCKET_DAMAGE;
|
||||
obj->z_velocity *= 0.4;
|
||||
racer->animationSpeed = 0.0f;
|
||||
obj->segment.y_velocity += 4.0;
|
||||
obj->y_velocity += 4.0;
|
||||
}
|
||||
racer->attackType = ATTACK_NONE;
|
||||
if (racer->approachTarget != NULL) {
|
||||
diffX = obj->segment.x_velocity * obj->segment.x_velocity;
|
||||
diffZ = obj->segment.z_velocity * obj->segment.z_velocity;
|
||||
diffX = obj->x_velocity * obj->x_velocity;
|
||||
diffZ = obj->z_velocity * obj->z_velocity;
|
||||
racer->velocity = -sqrtf((diffX * diffX) + (diffZ * diffZ));
|
||||
if (racer->velocity > -0.5) {
|
||||
racer->velocity = 0.0f;
|
||||
obj->segment.x_velocity = 0.0f;
|
||||
obj->segment.y_velocity = 0.0f;
|
||||
obj->segment.z_velocity = 0.0f;
|
||||
obj->x_velocity = 0.0f;
|
||||
obj->y_velocity = 0.0f;
|
||||
obj->z_velocity = 0.0f;
|
||||
}
|
||||
}
|
||||
racer->animationSpeed += 2.0 * updateRateF;
|
||||
modInst = obj->modelInstances[0];
|
||||
objModel = modInst->objModel;
|
||||
diffX = (objModel->animations[obj->segment.object.animationID].animLength * 16) - 17;
|
||||
diffX = (objModel->animations[obj->animationID].animLength * 16) - 17;
|
||||
while (diffX <= racer->animationSpeed) {
|
||||
racer->animationSpeed -= diffX;
|
||||
modInst->animationID = -1;
|
||||
@@ -123,31 +123,31 @@ void update_rocket(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *r
|
||||
racer->animationSpeed += diffX;
|
||||
modInst->animationID = -1;
|
||||
}
|
||||
if (obj->segment.object.animationID == ANIM_ROCKET_DAMAGE && modInst->animationID == -1) {
|
||||
obj->segment.object.animationID = ANIM_ROCKET_IDLE;
|
||||
if (obj->animationID == ANIM_ROCKET_DAMAGE && modInst->animationID == -1) {
|
||||
obj->animationID = ANIM_ROCKET_IDLE;
|
||||
racer->animationSpeed = 0.0f;
|
||||
}
|
||||
obj->segment.animFrame = racer->animationSpeed;
|
||||
obj->animFrame = racer->animationSpeed;
|
||||
obj->particleEmittersEnabled = OBJ_EMIT_NONE;
|
||||
update_vehicle_particles(obj, updateRate);
|
||||
fade_when_near_camera(obj, racer, 40);
|
||||
if (*startTimer != 100) {
|
||||
someObj = racerfx_get_boost(BOOST_DEFAULT);
|
||||
if (someObj != NULL) {
|
||||
rocket = &someObj->unk64->wizpigRocket;
|
||||
someObj->properties.racer.unk0 = 0;
|
||||
if (rocket != NULL) {
|
||||
rocket->unk72 += updateRate;
|
||||
rocket->unk70 = 2;
|
||||
rocket->unk74 = 1.0f;
|
||||
boost = someObj->boost;
|
||||
someObj->properties.common.unk0 = 0;
|
||||
if (boost != NULL) {
|
||||
boost->unk72 += updateRate;
|
||||
boost->unk70 = 2;
|
||||
boost->unk74 = 1.0f;
|
||||
func_8000B750(obj, -1, 2, 1, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
firstRacerObj = get_racer_object(PLAYER_ONE);
|
||||
racer = &firstRacerObj->unk64->racer;
|
||||
racer = firstRacerObj->racer;
|
||||
if (obj == firstRacerObj->interactObj->obj && firstRacerObj->interactObj->flags & INTERACT_FLAGS_PUSHING &&
|
||||
obj->segment.object.animationID == ANIM_ROCKET_DAMAGE) {
|
||||
obj->animationID == ANIM_ROCKET_DAMAGE) {
|
||||
racer->attackType = ATTACK_SQUISHED;
|
||||
}
|
||||
if (racer->raceFinished != 0) {
|
||||
|
||||
+67
-67
@@ -68,8 +68,8 @@ void update_smokey(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *r
|
||||
Object *firstRacerObj;
|
||||
|
||||
set_boss_voice_clip_offset(gSmokeyVoiceTable);
|
||||
animID = obj->segment.object.animationID;
|
||||
animFrame = obj->segment.animFrame;
|
||||
animID = obj->animationID;
|
||||
animFrame = obj->animFrame;
|
||||
tempHeadAngle = racer->headAngle;
|
||||
if (racer->velocity < 0.3 && -0.3 < racer->velocity) {
|
||||
*stickMag = 0;
|
||||
@@ -102,33 +102,33 @@ void update_smokey(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *r
|
||||
*startTimer = headAngleRange;
|
||||
obj->particleEmittersEnabled = OBJ_EMIT_NONE;
|
||||
racer->headAngle = tempHeadAngle;
|
||||
obj->segment.object.animationID = animID;
|
||||
obj->segment.animFrame = animFrame;
|
||||
if (racer->attackType != ATTACK_NONE && obj->segment.object.animationID != ANIM_SMOKEY_DAMAGE) {
|
||||
obj->animationID = animID;
|
||||
obj->animFrame = animFrame;
|
||||
if (racer->attackType != ATTACK_NONE && obj->animationID != ANIM_SMOKEY_DAMAGE) {
|
||||
play_random_boss_sound(BOSS_SOUND_NEGATIVE);
|
||||
sound_play(SOUND_EXPLOSION, NULL);
|
||||
set_camera_shake(12.0f);
|
||||
obj->segment.object.animationID = ANIM_SMOKEY_DAMAGE;
|
||||
obj->segment.x_velocity *= 0.27;
|
||||
obj->segment.z_velocity *= 0.27;
|
||||
obj->animationID = ANIM_SMOKEY_DAMAGE;
|
||||
obj->x_velocity *= 0.27;
|
||||
obj->z_velocity *= 0.27;
|
||||
racer->animationSpeed = 0.0f;
|
||||
obj->segment.y_velocity += 4.0;
|
||||
obj->y_velocity += 4.0;
|
||||
}
|
||||
racer->attackType = ATTACK_NONE;
|
||||
if (racer->approachTarget != 0) {
|
||||
diffX = obj->segment.x_velocity * obj->segment.x_velocity;
|
||||
diffZ = obj->segment.z_velocity * obj->segment.z_velocity;
|
||||
diffX = obj->x_velocity * obj->x_velocity;
|
||||
diffZ = obj->z_velocity * obj->z_velocity;
|
||||
racer->velocity = -sqrtf((diffX * diffX) + (diffZ * diffZ));
|
||||
if (racer->velocity > -0.5) {
|
||||
racer->velocity = 0.0f;
|
||||
obj->segment.x_velocity = 0.0f;
|
||||
obj->segment.y_velocity = 0.0f;
|
||||
obj->segment.z_velocity = 0.0f;
|
||||
obj->x_velocity = 0.0f;
|
||||
obj->y_velocity = 0.0f;
|
||||
obj->z_velocity = 0.0f;
|
||||
}
|
||||
}
|
||||
modInst = obj->modelInstances[0];
|
||||
objModel = modInst->objModel;
|
||||
diffX = (objModel->animations[obj->segment.object.animationID].animLength * 16) - 17;
|
||||
diffX = (objModel->animations[obj->animationID].animLength * 16) - 17;
|
||||
animVelocity = (racer->velocity * updateRateF) * 0.45;
|
||||
if (animVelocity <= 0.0) {
|
||||
if (animVelocity > -2.0) {
|
||||
@@ -137,7 +137,7 @@ void update_smokey(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *r
|
||||
} else if (animVelocity < 2.0) {
|
||||
animVelocity = 2.0f;
|
||||
}
|
||||
switch (obj->segment.object.animationID) {
|
||||
switch (obj->animationID) {
|
||||
case 0:
|
||||
racer->unk1CD = 0;
|
||||
racer->animationSpeed += 1.0 * updateRateF;
|
||||
@@ -178,57 +178,57 @@ void update_smokey(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *r
|
||||
racer->animationSpeed += diffX;
|
||||
modInst->animationID = -1;
|
||||
}
|
||||
if (obj->segment.object.animationID == ANIM_SMOKEY_WALK && racer->groundedWheels == 0 && racer->velocity < -6.5) {
|
||||
obj->segment.object.animationID = ANIM_SMOKEY_LAND;
|
||||
if (obj->animationID == ANIM_SMOKEY_WALK && racer->groundedWheels == 0 && racer->velocity < -6.5) {
|
||||
obj->animationID = ANIM_SMOKEY_LAND;
|
||||
racer->animationSpeed = 0.0f;
|
||||
}
|
||||
if (modInst->animationID == -1 || obj->segment.object.animationID == ANIM_SMOKEY_IDLE) {
|
||||
if (obj->segment.object.animationID == ANIM_SMOKEY_DAMAGE) {
|
||||
obj->segment.object.animationID = racer->unk1CD;
|
||||
if (modInst->animationID == -1 || obj->animationID == ANIM_SMOKEY_IDLE) {
|
||||
if (obj->animationID == ANIM_SMOKEY_DAMAGE) {
|
||||
obj->animationID = racer->unk1CD;
|
||||
racer->animationSpeed = 0.0f;
|
||||
} else if (obj->segment.object.animationID == ANIM_SMOKEY_RUN) {
|
||||
} else if (obj->animationID == ANIM_SMOKEY_RUN) {
|
||||
if (racer->unk1CD == 0) {
|
||||
obj->segment.object.animationID = ANIM_SMOKEY_WALK;
|
||||
obj->animationID = ANIM_SMOKEY_WALK;
|
||||
} else {
|
||||
obj->segment.object.animationID = ANIM_SMOKEY_IDLE;
|
||||
obj->animationID = ANIM_SMOKEY_IDLE;
|
||||
}
|
||||
} else if (obj->segment.object.animationID == ANIM_SMOKEY_LAND) {
|
||||
} else if (obj->animationID == ANIM_SMOKEY_LAND) {
|
||||
if (racer->unk1CD == 4) {
|
||||
obj->segment.object.animationID = ANIM_SMOKEY_WALK;
|
||||
obj->animationID = ANIM_SMOKEY_WALK;
|
||||
} else {
|
||||
obj->segment.object.animationID = ANIM_SMOKEY_FLY;
|
||||
obj->animationID = ANIM_SMOKEY_FLY;
|
||||
}
|
||||
} else if (-0.1 < racer->velocity && racer->velocity < 0.1) {
|
||||
if (obj->segment.object.animationID == ANIM_SMOKEY_WALK) {
|
||||
obj->segment.object.animationID = ANIM_SMOKEY_RUN;
|
||||
racer->animationSpeed = (objModel->animations[obj->segment.object.animationID].animLength * 16) - 17;
|
||||
if (obj->animationID == ANIM_SMOKEY_WALK) {
|
||||
obj->animationID = ANIM_SMOKEY_RUN;
|
||||
racer->animationSpeed = (objModel->animations[obj->animationID].animLength * 16) - 17;
|
||||
} else {
|
||||
obj->segment.object.animationID = ANIM_SMOKEY_IDLE;
|
||||
obj->animationID = ANIM_SMOKEY_IDLE;
|
||||
}
|
||||
} else {
|
||||
if (obj->segment.object.animationID == ANIM_SMOKEY_IDLE) {
|
||||
obj->segment.object.animationID = ANIM_SMOKEY_RUN;
|
||||
if (obj->animationID == ANIM_SMOKEY_IDLE) {
|
||||
obj->animationID = ANIM_SMOKEY_RUN;
|
||||
racer->animationSpeed = 0.0f;
|
||||
}
|
||||
if (obj->segment.object.animationID == ANIM_SMOKEY_FLY && racer->groundedWheels && racer->velocity > -6.0) {
|
||||
obj->segment.object.animationID = ANIM_SMOKEY_LAND;
|
||||
racer->animationSpeed = (objModel->animations[obj->segment.object.animationID].animLength * 16) - 17;
|
||||
if (obj->animationID == ANIM_SMOKEY_FLY && racer->groundedWheels && racer->velocity > -6.0) {
|
||||
obj->animationID = ANIM_SMOKEY_LAND;
|
||||
racer->animationSpeed = (objModel->animations[obj->animationID].animLength * 16) - 17;
|
||||
}
|
||||
}
|
||||
}
|
||||
animFrame = obj->segment.animFrame;
|
||||
obj->segment.animFrame = racer->animationSpeed;
|
||||
stepFrame = obj->segment.animFrame >> 4;
|
||||
animFrame = obj->animFrame;
|
||||
obj->animFrame = racer->animationSpeed;
|
||||
stepFrame = obj->animFrame >> 4;
|
||||
obj->particleEmittersEnabled = OBJ_EMIT_NONE;
|
||||
if (obj->segment.object.animationID != ANIM_SMOKEY_RUN && obj->segment.object.animationID != 2) {
|
||||
if (obj->animationID != ANIM_SMOKEY_RUN && obj->animationID != 2) {
|
||||
animFrame >>= 4;
|
||||
stepFrame = 1;
|
||||
if (obj->segment.object.animationID == ANIM_SMOKEY_IDLE) {
|
||||
if (obj->animationID == ANIM_SMOKEY_IDLE) {
|
||||
stepFrame = 3;
|
||||
}
|
||||
if (animFrame == stepFrame && stepFrame + 1 == obj->segment.animFrame >> 4) {
|
||||
audspat_play_sound_at_position(SOUND_UNK_223, obj->segment.trans.x_position, obj->segment.trans.y_position,
|
||||
obj->segment.trans.z_position, AUDIO_POINT_FLAG_ONE_TIME_TRIGGER, NULL);
|
||||
if (animFrame == stepFrame && stepFrame + 1 == obj->animFrame >> 4) {
|
||||
audspat_play_sound_at_position(SOUND_UNK_223, obj->trans.x_position, obj->trans.y_position,
|
||||
obj->trans.z_position, AUDIO_POINT_FLAG_ONE_TIME_TRIGGER, NULL);
|
||||
}
|
||||
}
|
||||
if (racer->vehicleIDPrev == VEHICLE_SMOKEY && racer->playerIndex == PLAYER_COMPUTER && func_80023568()) {
|
||||
@@ -237,10 +237,10 @@ void update_smokey(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *r
|
||||
obj_spawn_particle(obj, updateRate);
|
||||
fade_when_near_camera(obj, racer, 40);
|
||||
firstRacerObj = get_racer_object(PLAYER_ONE);
|
||||
diffX = firstRacerObj->segment.trans.x_position - obj->segment.trans.x_position;
|
||||
diffZ = firstRacerObj->segment.trans.z_position - obj->segment.trans.z_position;
|
||||
diffX = firstRacerObj->trans.x_position - obj->trans.x_position;
|
||||
diffZ = firstRacerObj->trans.z_position - obj->trans.z_position;
|
||||
if (sqrtf((diffX * diffX) + (diffZ * diffZ)) < 700.0) {
|
||||
headAngleRange = (arctan2_f(diffX, diffZ) - (obj->segment.trans.rotation.y_rotation & 0xFFFF)) + 0x8000;
|
||||
headAngleRange = (arctan2_f(diffX, diffZ) - (obj->trans.rotation.y_rotation & 0xFFFF)) + 0x8000;
|
||||
if (headAngleRange > 0x8000) {
|
||||
headAngleRange -= 0xFFFF;
|
||||
}
|
||||
@@ -255,14 +255,14 @@ void update_smokey(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *r
|
||||
}
|
||||
racer->headAngleTarget = headAngleRange;
|
||||
}
|
||||
if (obj->segment.object.animationID >= ANIM_SMOKEY_WALK) {
|
||||
if (obj->animationID >= ANIM_SMOKEY_WALK) {
|
||||
if ((racer->miscAnimCounter & 0x1F) < 10) {
|
||||
racer->headAngleTarget >>= 1;
|
||||
}
|
||||
}
|
||||
racer = &firstRacerObj->unk64->racer;
|
||||
racer = firstRacerObj->racer;
|
||||
if (obj == firstRacerObj->interactObj->obj && firstRacerObj->interactObj->flags & INTERACT_FLAGS_PUSHING &&
|
||||
obj->segment.object.animationID == ANIM_SMOKEY_RUN) {
|
||||
obj->animationID == ANIM_SMOKEY_RUN) {
|
||||
racer->attackType = ATTACK_SQUISHED;
|
||||
}
|
||||
if (racer->raceFinished != FALSE) {
|
||||
@@ -293,34 +293,34 @@ void spawn_boss_hazard(Object *obj, Object_Racer *racer, f32 offset, s32 objectI
|
||||
objList = objGetObjList(&objListID, &objListCount);
|
||||
spawnObj.objectID = objectID;
|
||||
spawnObj.size = (((objectID & 0x100) & 0xFFFF) >> 1) | 8;
|
||||
spawnObj.x = obj->segment.trans.x_position - (racer->ox1 * offset);
|
||||
spawnObj.y = obj->segment.trans.y_position - (racer->oy1 * offset);
|
||||
spawnObj.z = obj->segment.trans.z_position - (racer->oz1 * offset);
|
||||
spawnObj.x = obj->trans.x_position - (racer->ox1 * offset);
|
||||
spawnObj.y = obj->trans.y_position - (racer->oy1 * offset);
|
||||
spawnObj.z = obj->trans.z_position - (racer->oz1 * offset);
|
||||
|
||||
for (i = 0; i < objListCount; i++) {
|
||||
tempObj = objList[i];
|
||||
if (tempObj->behaviorId == BHV_BOSS_HAZARD_TRIGGER) {
|
||||
entry = tempObj->segment.level_entry;
|
||||
entry = tempObj->level_entry;
|
||||
if ((s8) entry->animation.z_rotation == racer->lap + 1 || (s8) entry->animation.z_rotation == 0) {
|
||||
diffX = tempObj->segment.trans.x_position - obj->segment.trans.x_position;
|
||||
diffY = tempObj->segment.trans.y_position - obj->segment.trans.y_position;
|
||||
diffZ = tempObj->segment.trans.z_position - obj->segment.trans.z_position;
|
||||
diffX = tempObj->trans.x_position - obj->trans.x_position;
|
||||
diffY = tempObj->trans.y_position - obj->trans.y_position;
|
||||
diffZ = tempObj->trans.z_position - obj->trans.z_position;
|
||||
if (sqrtf((diffX * diffX) + (diffY * diffY) + (diffZ * diffZ)) <
|
||||
(f32) ((s8) entry->animation.x_rotation & 0xFF) * 4.0) {
|
||||
if (tempObj->properties.common.unk0 == 0) {
|
||||
tempObj->properties.common.unk0 = 1;
|
||||
newObj = spawn_object(&spawnObj, OBJECT_SPAWN_UNK01);
|
||||
if (newObj != NULL) {
|
||||
newObj->segment.level_entry = NULL;
|
||||
newObj->segment.x_velocity = obj->segment.x_velocity;
|
||||
newObj->segment.y_velocity = obj->segment.y_velocity;
|
||||
newObj->segment.z_velocity = obj->segment.z_velocity;
|
||||
newObj->properties.racer.unk0 = tempObj;
|
||||
newObj->properties.racer.unk4 = (s8) entry->animation.y_rotation * 60;
|
||||
newObj->segment.animFrame = rand_range(0, 255);
|
||||
audspat_play_sound_at_position(
|
||||
soundID, newObj->segment.trans.x_position, newObj->segment.trans.y_position,
|
||||
newObj->segment.trans.z_position, AUDIO_POINT_FLAG_ONE_TIME_TRIGGER, NULL);
|
||||
newObj->level_entry = NULL;
|
||||
newObj->x_velocity = obj->x_velocity;
|
||||
newObj->y_velocity = obj->y_velocity;
|
||||
newObj->z_velocity = obj->z_velocity;
|
||||
newObj->properties.common.unk0 = tempObj;
|
||||
newObj->properties.common.unk4 = (s8) entry->animation.y_rotation * 60;
|
||||
newObj->animFrame = rand_range(0, 255);
|
||||
audspat_play_sound_at_position(soundID, newObj->trans.x_position, newObj->trans.y_position,
|
||||
newObj->trans.z_position, AUDIO_POINT_FLAG_ONE_TIME_TRIGGER,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
+32
-32
@@ -56,7 +56,7 @@ void racer_special_init(Object *object, Object_Racer *racer) {
|
||||
object->interactObj->hitboxRadius = 30;
|
||||
object->interactObj->pushForce = 0;
|
||||
racer->animationSpeed = 0.0f;
|
||||
gTrickyRacerPeakHeight = object->segment.trans.y_position;
|
||||
gTrickyRacerPeakHeight = object->trans.y_position;
|
||||
if (racer->vehicleSound) {
|
||||
racer_sound_free(object);
|
||||
}
|
||||
@@ -83,8 +83,8 @@ void update_tricky(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *r
|
||||
set_boss_voice_clip_offset(gTrickyVoiceTable);
|
||||
*buttonsPressed &= ~R_TRIG;
|
||||
*input &= ~R_TRIG;
|
||||
animID = obj->segment.object.animationID;
|
||||
animFrame = obj->segment.animFrame;
|
||||
animID = obj->animationID;
|
||||
animFrame = obj->animFrame;
|
||||
tempHeadAngle = racer->headAngle;
|
||||
if (racer->raceFinished == TRUE) {
|
||||
func_80021400(130);
|
||||
@@ -112,12 +112,12 @@ void update_tricky(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *r
|
||||
*startTimer = tempStartTimer;
|
||||
racer->lateral_velocity = 0.0f;
|
||||
racer->headAngle = tempHeadAngle;
|
||||
obj->segment.object.animationID = animID;
|
||||
obj->segment.animFrame = animFrame;
|
||||
if (racer->attackType != ATTACK_NONE && obj->segment.object.animationID != ANIM_TRICKY_DAMAGE) {
|
||||
racer->unk1CD = obj->segment.object.animationID;
|
||||
obj->segment.object.animationID = ANIM_TRICKY_DAMAGE;
|
||||
obj->segment.y_velocity += 7.5;
|
||||
obj->animationID = animID;
|
||||
obj->animFrame = animFrame;
|
||||
if (racer->attackType != ATTACK_NONE && obj->animationID != ANIM_TRICKY_DAMAGE) {
|
||||
racer->unk1CD = obj->animationID;
|
||||
obj->animationID = ANIM_TRICKY_DAMAGE;
|
||||
obj->y_velocity += 7.5;
|
||||
play_random_boss_sound(BOSS_SOUND_NEGATIVE);
|
||||
sound_play(SOUND_EXPLOSION, NULL);
|
||||
set_camera_shake(12.0f);
|
||||
@@ -126,22 +126,22 @@ void update_tricky(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *r
|
||||
}
|
||||
racer->attackType = ATTACK_NONE;
|
||||
if (racer->approachTarget != NULL) {
|
||||
diffX = obj->segment.x_velocity * obj->segment.x_velocity;
|
||||
diffZ = obj->segment.z_velocity * obj->segment.z_velocity;
|
||||
diffX = obj->x_velocity * obj->x_velocity;
|
||||
diffZ = obj->z_velocity * obj->z_velocity;
|
||||
racer->velocity = -sqrtf((diffX * diffX) + (diffZ * diffZ));
|
||||
}
|
||||
modInst = obj->modelInstances[0];
|
||||
objModel = modInst->objModel;
|
||||
diffX = (objModel->animations[obj->segment.object.animationID].animLength * 16) - 17;
|
||||
if (obj->segment.object.animationID != ANIM_TRICKY_DAMAGE) {
|
||||
diffX = (objModel->animations[obj->animationID].animLength * 16) - 17;
|
||||
if (obj->animationID != ANIM_TRICKY_DAMAGE) {
|
||||
if (racer->velocity < -2.0) {
|
||||
obj->segment.object.animationID = ANIM_TRICKY_RUN;
|
||||
obj->animationID = ANIM_TRICKY_RUN;
|
||||
racer->animationSpeed -= (racer->velocity * updateRateF) * 0.5;
|
||||
} else if (racer->velocity < -0.1 || racer->velocity > 0.1) {
|
||||
obj->segment.object.animationID = ANIM_TRICKY_WALK;
|
||||
obj->animationID = ANIM_TRICKY_WALK;
|
||||
racer->animationSpeed -= (racer->velocity * updateRateF) * 2;
|
||||
} else {
|
||||
obj->segment.object.animationID = ANIM_TRICKY_IDLE;
|
||||
obj->animationID = ANIM_TRICKY_IDLE;
|
||||
racer->animationSpeed += 1.0 * updateRateF;
|
||||
}
|
||||
} else {
|
||||
@@ -155,19 +155,19 @@ void update_tricky(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *r
|
||||
racer->animationSpeed -= diffX;
|
||||
modInst->animationID = -1;
|
||||
}
|
||||
if (modInst->animationID == -1 && obj->segment.object.animationID == ANIM_TRICKY_DAMAGE) {
|
||||
obj->segment.object.animationID = racer->unk1CD;
|
||||
if (modInst->animationID == -1 && obj->animationID == ANIM_TRICKY_DAMAGE) {
|
||||
obj->animationID = racer->unk1CD;
|
||||
}
|
||||
animFrame = obj->segment.animFrame;
|
||||
obj->segment.animFrame = racer->animationSpeed;
|
||||
animFrame = obj->animFrame;
|
||||
obj->animFrame = racer->animationSpeed;
|
||||
obj->particleEmittersEnabled = OBJ_EMIT_NONE;
|
||||
if (obj->segment.object.animationID == ANIM_TRICKY_RUN) {
|
||||
if (obj->animationID == ANIM_TRICKY_RUN) {
|
||||
play_footstep_sounds(obj, 2, animFrame, SOUND_STOMP2, SOUND_STOMP3);
|
||||
obj->particleEmittersEnabled |= OBJ_EMIT_1 | OBJ_EMIT_2;
|
||||
}
|
||||
obj_spawn_particle(obj, updateRate);
|
||||
fade_when_near_camera(obj, racer, 120);
|
||||
switch (obj->segment.object.animationID) {
|
||||
switch (obj->animationID) {
|
||||
case ANIM_TRICKY_RUN:
|
||||
headAngleRange = 0x2500;
|
||||
break;
|
||||
@@ -179,32 +179,32 @@ void update_tricky(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *r
|
||||
break;
|
||||
}
|
||||
firstRacerObj = get_racer_object(PLAYER_ONE);
|
||||
diffX = firstRacerObj->segment.trans.x_position - obj->segment.trans.x_position;
|
||||
diffZ = firstRacerObj->segment.trans.z_position - obj->segment.trans.z_position;
|
||||
diffX = firstRacerObj->trans.x_position - obj->trans.x_position;
|
||||
diffZ = firstRacerObj->trans.z_position - obj->trans.z_position;
|
||||
if (sqrtf((diffX * diffX) + (diffZ * diffZ)) < 700.0) {
|
||||
tempStartTimer = (arctan2_f(diffX, diffZ) - (obj->segment.trans.rotation.y_rotation & 0xFFFF)) + 0x8000;
|
||||
tempStartTimer = (arctan2_f(diffX, diffZ) - (obj->trans.rotation.y_rotation & 0xFFFF)) + 0x8000;
|
||||
WRAP(tempStartTimer, -0x8000, 0x8000);
|
||||
CLAMP(tempStartTimer, -headAngleRange, headAngleRange);
|
||||
racer->headAngleTarget = tempStartTimer;
|
||||
}
|
||||
if (obj->segment.object.animationID == ANIM_TRICKY_RUN) {
|
||||
if (obj->animationID == ANIM_TRICKY_RUN) {
|
||||
if ((racer->miscAnimCounter & 0x1F) < 10) {
|
||||
racer->headAngleTarget >>= 1;
|
||||
}
|
||||
}
|
||||
// Record the players height record. Falling 400 units below that will trigger a warp.
|
||||
racer = &firstRacerObj->unk64->racer;
|
||||
if (gTrickyRacerPeakHeight < firstRacerObj->segment.trans.y_position) {
|
||||
gTrickyRacerPeakHeight = firstRacerObj->segment.trans.y_position;
|
||||
racer = firstRacerObj->racer;
|
||||
if (gTrickyRacerPeakHeight < firstRacerObj->trans.y_position) {
|
||||
gTrickyRacerPeakHeight = firstRacerObj->trans.y_position;
|
||||
}
|
||||
if (firstRacerObj->segment.trans.y_position + 400.0 < gTrickyRacerPeakHeight) {
|
||||
if (firstRacerObj->trans.y_position + 400.0 < gTrickyRacerPeakHeight) {
|
||||
if (check_fadeout_transition() == 0 && is_in_two_player_adventure()) {
|
||||
swap_lead_player();
|
||||
}
|
||||
level_transition_begin(1);
|
||||
}
|
||||
if (obj == firstRacerObj->interactObj->obj && firstRacerObj->interactObj->flags & INTERACT_FLAGS_PUSHING &&
|
||||
obj->segment.object.animationID == ANIM_TRICKY_RUN) {
|
||||
obj->animationID == ANIM_TRICKY_RUN) {
|
||||
racer->attackType = ATTACK_SQUISHED;
|
||||
}
|
||||
if (racer->raceFinished != FALSE) {
|
||||
@@ -392,7 +392,7 @@ void fade_when_near_camera(Object *object, Object_Racer *racer, s32 distance) {
|
||||
Object *player = get_racer_object(PLAYER_ONE);
|
||||
racer->transparency = 255;
|
||||
if (!get_race_countdown()) {
|
||||
if ((object->segment.object.distanceToCamera + distance) < player->segment.object.distanceToCamera) {
|
||||
if ((object->distanceToCamera + distance) < player->distanceToCamera) {
|
||||
racer->transparency = 64;
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user