Clean up Object struct quite a lot (#390)

* yo I finally went and figured out what the majority of unk6 is lmao

* rename entry

* man honestly game.c is a mess they really did just throw every old thing here

* Name some initialiser funcs

* more

* destroyed another temp struct

* potassium

* tweak

* pain

* it never ends

* a new pain arises

* Update README.md

* quick fixes

* add colour macro

* name a func

* Object78 is much cleaner now.

* object struct cleanup for particles

* object segment struct cleanup

* quick fix

* style fix

* Update racer.c

* Update structs.h

* squeeze in a bit more renaming

* ok last one

* fix funny typo

* smile emote

* Update racer.c
This commit is contained in:
Fazana
2023-05-14 22:48:05 +01:00
committed by GitHub
parent 444afbb470
commit 29307ec75a
24 changed files with 1185 additions and 1144 deletions
+21 -21
View File
@@ -18,9 +18,9 @@ typedef struct LevelObjectEntry_Racer {
typedef struct LevelObjectEntry_Scenery {
/* 0x00 */ LevelObjectEntryCommon common;
/* 0x08 */ u8 unk8;
/* 0x08 */ u8 numModelIDs;
/* 0x09 */ u8 radius;
/* 0x0A */ u8 unkA;
/* 0x0A */ u8 angleY;
/* 0x0B */ u8 solid;
} LevelObjectEntry_Scenery;
@@ -62,7 +62,7 @@ typedef struct LevelObjectEntry_Exit {
/* 0x0B */ u8 padB[5];
/* 0x10 */ u8 radius; // Activation radius.
/* 0x11 */ u8 unk11;
/* 0x11 */ u8 angleY;
/* 0x12 */ u8 pad12[5];
// Defines the location in a hub world the player will spawn at when exiting `destinationMapId`.
@@ -95,7 +95,7 @@ typedef struct LevelObjectEntry_AudioLine {
/* 0x00 */ LevelObjectEntryCommon common;
/* 0x08 */ u8 unk8;
/* 0x09 */ u8 unk9;
/* 0x0A */ u16 unkA;
/* 0x0A */ u16 soundID;
/* 0x0C */ u8 unkC;
/* 0x0D */ u8 unkD;
/* 0x0E */ u16 unkE;
@@ -185,7 +185,7 @@ typedef struct LevelObjectEntry_WeaponBalloon {
/* 0x00 */ LevelObjectEntryCommon common;
/* 0x08 */ u8 unk8; // Unused?
/* 0x09 */ u8 balloonType;
/* 0x0A */ u8 scale; // This is divided by 64 to get actual scale.
/* 0x0A */ u8 radius; // This is divided by 64 to get actual scale.
} LevelObjectEntry_WeaponBalloon;
typedef struct LevelObjectEntry_AudioSeqLine {
@@ -207,7 +207,7 @@ typedef struct LevelObjectEntry_Unknown25 {
typedef struct LevelObjectEntry_SkyControl {
/* 0x00 */ LevelObjectEntryCommon common;
/* 0x08 */ u8 unk8;
/* 0x08 */ u8 setting;
/* 0x09 */ u8 radius;
} LevelObjectEntry_SkyControl;
@@ -267,14 +267,14 @@ typedef struct LevelObjectEntry_Weather {
typedef struct LevelObjectEntry_Bridge_WhaleRamp {
/* 0x00 */ LevelObjectEntryCommon common;
/* 0x08 */ u8 unk8;
/* 0x09 */ u8 unk9;
/* 0x08 */ u8 numModelIDs;
/* 0x09 */ u8 angleY;
/* 0x0A */ u8 unkA;
/* 0x0B */ u8 unkB;
/* 0x0C */ u8 unkC;
/* 0x0C */ u8 radius;
/* 0x0D */ u8 unkD;
/* 0x0E */ s8 unkE;
/* 0x0F */ u8 unkF;
/* 0x0F */ u8 allowedVehicles;
} LevelObjectEntry_Bridge_WhaleRamp;
typedef struct LevelObjectEntry_RampSwitch {
@@ -368,8 +368,8 @@ typedef struct LevelObjectEntry_InfoPoint {
typedef struct LevelObjectEntry_Trigger {
/* 0x00 */ LevelObjectEntryCommon common;
/* 0x08 */ u8 scale;
/* 0x09 */ s8 unk9;
/* 0x0A */ u8 rotation;
/* 0x09 */ s8 index;
/* 0x0A */ u8 angleY;
/* 0x0B */ u8 unkB;
/* 0x0C */ u8 unkC;
/* 0x0D */ u8 unkD;
@@ -413,12 +413,12 @@ typedef struct LevelObjectEntry_BananaCreator {
typedef struct LevelObjectEntry_TreasureSucker {
/* 0x00 */ LevelObjectEntryCommon common;
/* 0x08 */ s8 unk8;
/* 0x08 */ s8 playerID;
} LevelObjectEntry_TreasureSucker;
typedef struct LevelObjectEntry_Log {
/* 0x00 */ LevelObjectEntryCommon common;
/* 0x08 */ u8 unk8;
/* 0x08 */ u8 numModelIDs;
/* 0x09 */ u8 radius;
/* 0x0A */ u8 angleY;
} LevelObjectEntry_Log;
@@ -440,7 +440,7 @@ typedef struct LevelObjectEntry_HitTester {
typedef struct LevelObjectEntry_MidiFade {
/* 0x00 */ LevelObjectEntryCommon common;
/* 0x08 */ u8 scale;
/* 0x09 */ u8 rotation;
/* 0x09 */ u8 angleY;
/* 0x0A */ u8 unkA[16]; // Is this 16 bytes or 15 bytes with a padded 0?
/* 0x1A */ u8 unk1A;
/* 0x1B */ u8 unk1B;
@@ -462,7 +462,7 @@ typedef struct LevelObjectEntry_EffectBox {
typedef struct LevelObjectEntry_TrophyCab {
/* 0x00 */ LevelObjectEntryCommon common;
/* 0x08 */ u8 rotation;
/* 0x08 */ u8 angleY;
} LevelObjectEntry_TrophyCab;
typedef struct LevelObjectEntry_Bubbler {
@@ -489,8 +489,8 @@ typedef struct LevelObjectEntry_Laserbolt {
typedef struct LevelObjectEntry_Lasergun {
/* 0x00 */ LevelObjectEntryCommon common;
/* 0x08 */ u8 angleX;
/* 0x09 */ u8 angleY;
/* 0x08 */ u8 angleY;
/* 0x09 */ u8 angleX;
/* 0x0A */ s8 targeting;
/* 0x0B */ s8 fireRate;
/* 0x0C */ u8 laserDuration;
@@ -501,7 +501,7 @@ typedef struct LevelObjectEntry_GroundZipper {
/* 0x00 */ LevelObjectEntryCommon common;
/* 0x08 */ u8 unk8;
/* 0x09 */ u8 scale;
/* 0x0A */ u8 rotation;
/* 0x0A */ u8 angleY;
} LevelObjectEntry_GroundZipper;
typedef struct LevelObjectEntry_OverridePos {
@@ -598,8 +598,8 @@ typedef struct LevelObjectEntry_OctoBubble {
typedef struct LevelObjectEntry_LevelName {
/* 0x00 */ LevelObjectEntryCommon common;
/* 0x08 */ s8 unk8;
/* 0x09 */ s8 unk9;
/* 0x08 */ s8 levelID;
/* 0x09 */ s8 radius;
} LevelObjectEntry_LevelName;
typedef struct LevelObjectEntry_Midichset {
+185
View File
@@ -0,0 +1,185 @@
#ifndef _OBJECT_PROPERTIES_H_
#define _OBJECT_PROPERTIES_H_
#include "types.h"
#include "enums.h"
#include "level_object_entries.h"
/**
* 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;
s32 unk4;
} ObjPropertyCommon;
typedef struct ObjPropertyDistance {
f32 radius;
s32 unk4;
} ObjPropertyDistance;
typedef struct ObjPropertySpeed {
s32 speed;
s32 unk4;
} ObjPropertySpeed;
typedef struct ObjPropertyBanana {
s32 unk0;
s16 unk4;
s16 unk6;
} ObjPropertyBanana;
typedef struct ObjPropertyName {
f32 radius;
s16 levelID;
s16 opacity;
} ObjPropertyName;
typedef struct ObjPropertyProjectile {
s32 timer;
s32 unk4;
} ObjPropertyProjectile;
typedef struct ObjPropertyLog {
s32 angleVel;
s32 velocityY;
} ObjPropertyLog;
typedef struct ObjPropertyScenery {
struct Object *interactObj;
s16 hitTimer;
s16 angleVel;
} ObjPropertyScenery;
typedef struct ObjPropertyFireball {
struct Object *obj;
s32 timer;
} ObjPropertyFireball;
typedef struct ObjPropertyLasergun {
s32 timer;
struct Object_LaserGun *obj;
} ObjPropertyLasergun;
typedef struct ObjPropertyTrophyCabinet {
s32 action;
s32 trophy;
} ObjPropertyTrophyCabinet;
typedef struct ObjPropertyEggSpawner {
struct Object *egg;
} ObjPropertyEggSpawner;
typedef struct ObjPropertyZipper {
s32 radius;
} ObjPropertyZipper;
typedef struct ObjPropertyCharacterFlag {
s32 playerID;
s32 characterID;
} ObjPropertyCharacterFlag;
typedef struct ObjPropertyNPC {
s32 action;
s32 timer;
} ObjPropertyNPC;
typedef struct ObjPropertyLavaSpurt {
s32 actionTimer;
s32 delayTimer;
} ObjPropertyLavaSpurt;
typedef struct ObjPropertyAnimation {
s32 action;
s32 behaviourID;
} ObjPropertyAnimation;
typedef struct ObjPropertyInfoPoint {
s32 radius;
s32 visible;
} ObjPropertyInfoPoint;
typedef struct ObjPropertyBombExplosion {
s32 timer;
s32 unk4;
} ObjPropertyBombExplosion;
typedef struct ObjPropertyLighthouse {
s32 active;
} ObjPropertyLighthouse;
typedef struct ObjPropertyDoor {
s32 closeAngle;
s32 openAngle;
} ObjPropertyDoor;
typedef struct ObjPropertySkyControl {
s32 setting;
s32 radius;
} ObjPropertySkyControl;
typedef struct ObjPropertyTreasureSucker {
s32 playerID;
s32 spawnTimer;
} ObjPropertyTreasureSucker;
typedef struct ObjPropertyTreasureBanana {
s32 diff;
struct Object_Racer *racer;
} ObjPropertyTreasureBanana;
typedef struct ObjPropertyBananaSpawner {
s32 timer;
s32 spawn;
} ObjPropertyBananaSpawner;
typedef struct ObjPropertyWorldKey {
s32 keyID;
} ObjPropertyWorldKey;
typedef struct ObjPropertyWeaponBalloon {
s32 balloonID;
s32 unk4;
} ObjPropertyWeaponBalloon;
typedef struct ObjPropertyRacer {
struct Object *unk0;
s32 unk4;
} ObjPropertyRacer;
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;
};
} ObjProperties;
#endif
+58 -205
View File
@@ -6,6 +6,7 @@
#include "types.h"
#include "enums.h"
#include "level_object_entries.h"
#include "object_properties.h"
// Stolen from PD
// This hacky structure allows coords to be accessed using
@@ -832,7 +833,7 @@ typedef struct Object_Animation {
} Object_Animation;
typedef struct Object_WeaponBalloon {
/* 0x0 */ f32 unk0;
/* 0x0 */ f32 radius;
/* 0x4 */ s16 unk4;
/* 0x6 */ s8 unk6[0x2];
} Object_WeaponBalloon;
@@ -848,7 +849,7 @@ typedef struct Object_Weapon {
/* 0x18 */ u8 weaponID;
/* 0x19 */ s8 checkpoint;
/* 0x19 */ s16 unk1A;
/* 0x19 */ s32 unk1C;
/* 0x19 */ s32 soundMask;
} Object_Weapon;
typedef struct Object_Butterfly {
@@ -898,7 +899,7 @@ typedef struct Object_EggCreator {
typedef struct Object_CollectEgg {
/* 0x0 */ u8 pad0[4];
/* 0x4 */ struct Object *unk4;
/* 0x4 */ struct Object *spawnerObj;
/* 0x8 */ s16 hatchTimer;
/* 0xA */ s8 racerID;
/* 0xB */ s8 status;
@@ -935,7 +936,7 @@ typedef struct Object_InfoPoint {
} Object_InfoPoint;
typedef struct Object_TTDoor {
/* 0x00 */ f32 unk0;
/* 0x00 */ f32 homeY;
/* 0x04 */ s32 *soundMask;
/* 0x08 */ s32 unk8;
/* 0x0C */ s16 unkC;
@@ -953,7 +954,7 @@ typedef struct Object_WorldKey {
typedef struct Object_AudioLine {
/* 0x00 */ u8 unk0;
/* 0x01 */ u8 pad1;
/* 0x02 */ u16 unk2;
/* 0x02 */ u16 soundID;
/* 0x04 */ u16 unk4;
/* 0x06 */ u16 unk6;
/* 0x08 */ union {
@@ -1245,24 +1246,6 @@ typedef struct Object_Racer {
/* 0x220 */ s32 unk220;
} Object_Racer;
typedef struct Object_Bonus {
/* 0x00 */ f32 directionX;
/* 0x04 */ f32 directionY;
/* 0x08 */ f32 directionZ;
/* 0x0C */ f32 rotationDiff; // Rotational offset, to test intersection when the exit is rotated.
/* 0x10 */ s32 radius; // Activation radius.
/* 0x14 */ s8 unk14;
} Object_Bonus;
typedef struct Object_ModeChange {
/* 0x00 */ f32 directionX;
/* 0x04 */ f32 directionY;
/* 0x08 */ f32 directionZ;
/* 0x0C */ f32 rotationDiff; // Rotational offset, to test intersection when the exit is rotated.
/* 0x10 */ s32 radius; // Activation radius.
/* 0x14 */ u8 vehicleID;
} Object_ModeChange;
typedef struct Object_Door {
/* 0x00 */ f32 homeY;
/* 0x04 */ u8 pad4[0x4];
@@ -1278,12 +1261,15 @@ typedef struct Object_Door {
} Object_Door;
typedef struct Object_Trigger {
/* 0x00 */ f32 unk0;
/* 0x04 */ f32 unk4;
/* 0x08 */ f32 unk8;
/* 0x0C */ f32 unkC;
/* 0x10 */ s32 unk10;
/* 0x00 */ f32 directionX;
/* 0x04 */ f32 directionY;
/* 0x08 */ f32 directionZ;
/* 0x0C */ f32 rotationDiff; // Rotational offset, to test intersection when the exit is rotated.
/* 0x10 */ s32 radius;
union {
/* 0x14 */ u8 vehicleID;
/* 0x14 */ u8 unk14;
};
} Object_Trigger;
typedef struct Object_Audio {
@@ -1293,7 +1279,7 @@ typedef struct Object_Audio {
/* 0x05 */ u8 unk5;
/* 0x06 */ u8 unk6;
/* 0x07 */ u8 unk7;
/* 0x08 */ s32 unk8;
/* 0x08 */ s32 soundMask;
/* 0x0C */ u8 unkC;
/* 0x0D */ u8 unkD;
} Object_Audio;
@@ -1381,19 +1367,6 @@ typedef struct Object_Bridge_WhaleRamp {
/* 0x4 */ s32 unk4;
} Object_Bridge_WhaleRamp;
typedef struct Object_80011AD0 {
/* 0x00 */ u8 pad0[0x20];
/* 0x20 */ u32 unk20;
/* 0x24 */ u32 unk24; //TextureHeader *?
/* 0x28 */ u8 pad28[0x48];
/* 0x70 */ u8 unk70;
/* 0x71 */ u8 pad71[0x3];
/* 0x74 */ f32 unk74;
/* 0x78 */ u8 pad78[0x80];
/* 0xF8 */ u32 unkF8; //TextureHeader *?
/* 0xFC */ u8 unkFC;
} Object_80011AD0;
typedef struct Object_8001B7A8 {
u8 pad0[0x112];
/* 0x112 */ s16 unk112;
@@ -1464,8 +1437,6 @@ typedef struct Object_64 {
Object_Wizpig2 wizpig2;
Object_Exit exit;
Object_Racer racer;
Object_Bonus bonus;
Object_ModeChange mode_change;
Object_Door door;
Object_Trigger trigger;
Object_Audio audio;
@@ -1477,7 +1448,6 @@ typedef struct Object_64 {
Object_NPC npc;
Object_TT tt;
Object_Bridge_WhaleRamp bridge_whale_ramp;
Object_80011AD0 obj80011AD0;
Object_8001B7A8 obj8001B7A8;
Object_80021400_64 obj80021400_64;
Object_Log log;
@@ -1524,7 +1494,7 @@ typedef struct ParticleBehavior {
f32 unk4;
f32 unk8;
f32 unkC;
u8 pad10[0x4];
f32 unk10;
s16 unk14;
s16 unk16;
s16 unk18;
@@ -1539,7 +1509,10 @@ typedef struct ParticleBehavior {
s16 unk2A;
s16 unk2C;
s16 unk2E;
u8 pad30[0x10];
f32 unk30;
f32 unk34;
f32 unk38;
f32 unk3C;
s16 unk40;
s16 unk42;
s16 unk44;
@@ -1550,9 +1523,19 @@ typedef struct ParticleBehavior {
s16 unk4E;
f32 unk50;
f32 unk54;
u8 pad58[0x4];
f32 unk58;
s32 unk5C;
u8 pad60[0x20];
s32 unk60;
s16 unk64;
s16 unk66;
s16 unk68;
s16 unk6A;
s16 unk6C;
s16 unk6E;
s32 unk70;
s32 unk74;
s32 unk78;
s32 unk7C;
s16 unk80;
s16 unk82;
s16 unk84;
@@ -1561,7 +1544,7 @@ typedef struct ParticleBehavior {
s16 unk8A;
s32 unk8C;
s32 unk90;
u8 pad94[0x4];
s32 unk94;
u8 unk98;
u8 unk99;
u8 unk9A;
@@ -1612,93 +1595,41 @@ typedef struct ObjectTransform {
/* 0x0014 */ f32 z_position;
} ObjectTransform;
/* Size: 0x018 bytes */
typedef struct ObjectTransform_2 {
/* 0x0000 */ s32 unk0;
/* 0x0004 */ s32 unk4;
/* 0x0008 */ s32 unk8;
/* 0x000C */ f32 x_position;
/* 0x0010 */ f32 y_position;
/* 0x0014 */ f32 z_position;
} ObjectTransform_2;
typedef struct SegmentPropertiesObject {
/* 0x002C */ s16 unk2C;
/* 0x002E */ s16 segmentID;
/* 0x0030 */ f32 distanceToCamera;
/* 0x0034 */ s16 cameraSegmentID;
/* 0x0036 */ s16 unk36;
/* 0x0038 */ u8 unk38;
/* 0x0039 */ u8 opacity;
/* 0x003A */ s8 numModelIDs;
/* 0x003B */ s8 animationID;
} SegmentPropertiesObject;
typedef struct ParticleProperties {
/* 0x0000 */ ParticleBehavior *behaviour;
/* 0x0004 */ s16 unk4;
/* 0x0006 */ u8 unk6;
/* 0x0007 */ u8 unk7;
/* 0x0004 */ s16 unk8;
/* 0x0004 */ s16 unkA;
union {
Vec3f pos;
unk800AF29C_C unkC;
unk800B2260_C **unkC_60;
unk800AF29C_C_400 unkC_400;
};
} ParticleProperties;
typedef struct SegmentPropertiesCamera {
/* 0x002C */ f32 unk2C;
/* 0x0030 */ f32 distanceToCamera;
/* 0x0034 */ f32 unk34;
/* 0x0038 */ s16 unk38;
/* 0x003A */ s16 unk3A;
} SegmentPropertiesCamera;
/* Size: 0x44 bytes */
typedef struct ObjectSegment {
union {
/* 0x0000 */ ObjectTransform trans;
/* 0x0000 */ ObjectTransform_2 trans_unk;
/* 0x0000 */ ParticleProperties particle;
};
/* 0x0018 */ s16 animFrame;
/* 0x001A */ s16 unk1A;
union {
/* 0x001C */ f32 x_velocity;
struct {
/* 0x001A */ s16 unk1C;
/* 0x001A */ s16 unk1E;
} unk1C_half;
};
/* 0x0020 */ f32 y_velocity;
/* 0x0024 */ f32 z_velocity;
/* 0x0028 */ f32 unk28;
union {
struct {
/* 0x002C */ s16 upper;
/* 0x002E */ s16 lower;
} half;
/* 0x002C */ f32 word;
} unk2C;
/* 0x0030 */ f32 unk30;
union {
/* 0x0034 */ f32 unk34;
struct {
/* 0x0034 */ s16 levelSegmentIndex;
/* 0x0036 */ s16 unk36;
};
} unk34_a;
union {
struct {
/* 0x0038 */ u8 unk38;
/* 0x0039 */ u8 unk39;
/* 0x003A */ s8 unk3A; // Index value for unk68 array
/* 0x003B */ s8 unk3B;
} byte;
struct {
/* 0x0038 */ s16 unk38;
/* 0x003A */ s16 unk3A;
} half;
f32 unk38_f32;
} unk38;
union {
/* 0x003C */ LevelObjectEntry* level_entry;
/* 0x003C */ void *unk3C_ptr;
/* 0x003C */ f32 unk3C_f;
} unk3C_a;
union {
/* 0x0040 */ ObjectHeader *header;
/* 0x0040 */ s32 unk40;
SegmentPropertiesObject object;
SegmentPropertiesCamera camera;
};
/* 0x003C */ LevelObjectEntry* level_entry;
/* 0x0040 */ ObjectHeader *header;
} ObjectSegment;
typedef struct unk800B0698_44_0 {
@@ -1722,102 +1653,24 @@ typedef struct Object {
};
/* 0x0048 */ s16 behaviorId;
/* 0x004A */ s16 unk4A;
union {
/* 0x004C */ ObjectInteraction *interactObj; //player + 0x318
/* 0x004C */ f32 unk4C_f32;
};
union {
/* 0x0050 */ ShadowData *shadow; //player + 0x2F4
/* 0x0050 */ f32 unk50_f32;
};
union {
/* 0x0054 */ Object_54 *unk54; //player + 0x2C0
/* 0x0054 */ f32 unk54_f32;
};
union {
/* 0x0058 */ void *unk58; //player + 0x304
/* 0x0058 */ f32 unk58_f32;
};
union {
/* 0x005C */ Object_5C *unk5C;
struct {
/* 0x005C */ s16 unk5C;
/* 0x005E */ s16 unk5E;
} unk5C_halfs;
/* 0x005C */ s32 unk5C_s32;
};
union {
/* 0x0060 */ Object_60 *unk60; //player + 0x340
struct {
/* 0x0060 */ s16 unk60;
/* 0x0062 */ s16 unk62;
} unk60_halfs;
/* 0x0060 */ s32 unk60_s32;
};
union {
/* 0x0064 */ Object_64 *unk64; //player + 0x98
struct {
/* 0x0064 */ s16 unk64;
/* 0x0066 */ s16 unk66;
} unk64_halfs;
};
union {
/* 0x0068 */ Object_68 **unk68; //player + 0x80
struct {
/* 0x0068 */ s16 unk68;
/* 0x006A */ s16 unk6A;
} unk68_halfs;
};
union {
/* 0x006C */ Object_6C *unk6C; //player + 0x370
struct {
/* 0x006C */ s16 unk6C;
/* 0x006E */ s16 unk6E;
} unk6C_halfs;
};
union {
/* 0x0070 */ u32 *unk70;
/* 0x0070 */ s32 unk70_s32;
};
union {
/* 0x0070 */ u32 *unk70;
/* 0x0074 */ u32 unk74;
/* 0x0074 */ s32 unk74_signed;
struct {
/* 0x0074 */ u8 first;
/* 0x0074 */ u8 second;
/* 0x0074 */ u8 third;
/* 0x0074 */ u8 fourth;
} unk74_bytes;
};
union {
/* 0x0078 */ s32 unk78;
/* 0x0078 */ ObjectTransform *trans78;
/* 0x0078 */ s32 action;
/* 0x0078 */ f32 unk78f;
/* 0x0078 */ struct Object *unk78_obj;
};
union {
struct {
s16 upper;
s16 lower;
} half;
s32 word;
} unk7C;
/* 0x0078 */ ObjProperties properties;
/* 0x0080 */ void *unk80;
/* 0x0084 */ u32 unk84;
/* 0x0088 */ u32 unk88;
/* 0x008C */ u32 unk8C;
/* 0x0090 */ u32 unk90;
union {
/* 0x0094 */ u32 unk94;
/* 0x0094 */ s32 unk94_signed;
};
/* 0x0094 */ u32 unk94;
/* 0x0098 */ Object_64 obj;
// May be a part of obj (likely Object_Player).
+6 -2
View File
@@ -474,8 +474,12 @@ void func_80001440(u8 *arg0) {
return;
}
void func_800014BC(f32 arg0) {
musicSetTempo((s32)((f32)(u32)(musicGetTempo() & 0xFF) * arg0));
/**
* Multiplies the current tempo of the background music.
* Since it calls musicGetTempo and multiplies it by the result, calling this repeatedly can recursively change the music's speed.
*/
void multiply_music_tempo(f32 tempo) {
musicSetTempo((s32)((f32)(u32)(musicGetTempo() & 0xFF) * tempo));
}
/**
+1 -1
View File
@@ -86,7 +86,7 @@ u8 func_800012A8(u8 arg0);
void func_800012E8(void);
u8 func_80001358(u8 arg0, u8 arg1, s32 arg2);
void func_80001440(u8 *arg0);
void func_800014BC(f32 arg0);
void multiply_music_tempo(f32 tempo);
void musicSetTempo(s32 tempo);
s16 musicGetTempo(void);
u8 music_is_playing(void);
+18 -18
View File
@@ -175,7 +175,7 @@ GLOBAL_ASM("asm/non_matchings/camera/func_80065EA0.s")
void func_80066060(s32 arg0, s32 arg1) {
if (arg0 >= 0 && arg0 < 4) {
D_800DD2F8[arg0] = arg1;
gActiveCameraStack[arg0].unk38.byte.unk3B = arg1;
gActiveCameraStack[arg0].object.animationID = arg1;
}
}
@@ -263,17 +263,17 @@ void func_80066230(Gfx **dlist, MatrixS **mats) {
posX = cam->trans.x_position;
posY = cam->trans.y_position;
posZ = cam->trans.z_position;
sp24 = cam->unk38.half.unk38;
sp24 = cam->camera.unk38;
cam->trans.z_rotation = 0;
cam->trans.x_rotation = 0;
cam->trans.y_rotation = -0x8000;
cam->unk38.half.unk38 = 0;
cam->camera.unk38 = 0;
cam->trans.x_position = 0.0f;
cam->trans.y_position = 0.0f;
cam->trans.z_position = 0.0f;
update_envmap_position(0.0f, 0.0f, -1.0f);
func_80066CDC(dlist, mats);
cam->unk38.half.unk38 = sp24;
cam->camera.unk38 = sp24;
cam->trans.y_rotation = angleY;
cam->trans.x_rotation = angleX;
cam->trans.z_rotation = angleZ;
@@ -307,14 +307,14 @@ void func_800663DC(s32 xPos, s32 yPos, s32 zPos, s32 arg3, s32 arg4, s32 arg5) {
gActiveCameraStack[gActiveCameraID].trans.y_position = (f32) yPos;
gActiveCameraStack[gActiveCameraID].trans.z_position = (f32) zPos;
gActiveCameraStack[gActiveCameraID].trans.x_rotation = (s16) (arg4 * 0xB6);
gActiveCameraStack[gActiveCameraID].unk38.half.unk38 = (s16) 0;
gActiveCameraStack[gActiveCameraID].camera.unk38 = (s16) 0;
gActiveCameraStack[gActiveCameraID].z_velocity = 0.0f;
gActiveCameraStack[gActiveCameraID].unk28 = 0.0f;
gActiveCameraStack[gActiveCameraID].unk2C.word = 0.0f;
gActiveCameraStack[gActiveCameraID].unk30 = 0.0f;
gActiveCameraStack[gActiveCameraID].camera.unk2C = 0.0f;
gActiveCameraStack[gActiveCameraID].camera.distanceToCamera = 0.0f;
gActiveCameraStack[gActiveCameraID].x_velocity = 160.0f;
gActiveCameraStack[gActiveCameraID].trans.y_rotation = (s16) (arg5 * 0xB6);
gActiveCameraStack[gActiveCameraID].unk38.byte.unk3B = D_800DD2F8[gActiveCameraID];
gActiveCameraStack[gActiveCameraID].object.animationID = D_800DD2F8[gActiveCameraID];
}
/**
@@ -324,14 +324,14 @@ void func_800663DC(s32 xPos, s32 yPos, s32 zPos, s32 arg3, s32 arg4, s32 arg5) {
*/
void write_to_object_render_stack(s32 stackPos, f32 xPos, f32 yPos, f32 zPos, s16 arg4, s16 arg5, s16 arg6) {
stackPos += 4;
gActiveCameraStack[stackPos].unk38.half.unk38 = 0;
gActiveCameraStack[stackPos].camera.unk38 = 0;
gActiveCameraStack[stackPos].trans.x_position = xPos;
gActiveCameraStack[stackPos].trans.y_position = yPos;
gActiveCameraStack[stackPos].trans.z_position = zPos;
gActiveCameraStack[stackPos].trans.y_rotation = arg4;
gActiveCameraStack[stackPos].trans.x_rotation = arg5;
gActiveCameraStack[stackPos].trans.z_rotation = arg6;
gActiveCameraStack[stackPos].unk34_a.levelSegmentIndex = get_level_segment_index_from_position(xPos, yPos, zPos);
gActiveCameraStack[stackPos].object.cameraSegmentID = get_level_segment_index_from_position(xPos, yPos, zPos);
gCutsceneCameraActive = TRUE;
}
@@ -857,13 +857,13 @@ void func_80067D3C(Gfx **dlist, UNUSED MatrixS **mats) {
}
gCameraTransform.y_rotation = 0x8000 + gActiveCameraStack[gActiveCameraID].trans.y_rotation;
gCameraTransform.x_rotation = gActiveCameraStack[gActiveCameraID].trans.x_rotation + gActiveCameraStack[gActiveCameraID].unk38.half.unk38;
gCameraTransform.x_rotation = gActiveCameraStack[gActiveCameraID].trans.x_rotation + gActiveCameraStack[gActiveCameraID].camera.unk38;
gCameraTransform.z_rotation = gActiveCameraStack[gActiveCameraID].trans.z_rotation;
gCameraTransform.x_position = -gActiveCameraStack[gActiveCameraID].trans.x_position;
gCameraTransform.y_position = -gActiveCameraStack[gActiveCameraID].trans.y_position;
if (D_80120D18 != 0) {
gCameraTransform.y_position -= gActiveCameraStack[gActiveCameraID].unk30;
gCameraTransform.y_position -= gActiveCameraStack[gActiveCameraID].camera.distanceToCamera;
}
gCameraTransform.z_position = -gActiveCameraStack[gActiveCameraID].trans.z_position;
@@ -871,13 +871,13 @@ void func_80067D3C(Gfx **dlist, UNUSED MatrixS **mats) {
f32_matrix_mult(&D_80120F60, &gPerspectiveMatrixF, &D_80120F20);
gCameraTransform.y_rotation = -0x8000 - gActiveCameraStack[gActiveCameraID].trans.y_rotation;
gCameraTransform.x_rotation = -(gActiveCameraStack[gActiveCameraID].trans.x_rotation + gActiveCameraStack[gActiveCameraID].unk38.half.unk38);
gCameraTransform.x_rotation = -(gActiveCameraStack[gActiveCameraID].trans.x_rotation + gActiveCameraStack[gActiveCameraID].camera.unk38);
gCameraTransform.z_rotation = -gActiveCameraStack[gActiveCameraID].trans.z_rotation;
gCameraTransform.scale = 1.0f;
gCameraTransform.x_position = gActiveCameraStack[gActiveCameraID].trans.x_position;
gCameraTransform.y_position = gActiveCameraStack[gActiveCameraID].trans.y_position;
if (D_80120D18 != 0) {
gCameraTransform.y_position += gActiveCameraStack[gActiveCameraID].unk30;
gCameraTransform.y_position += gActiveCameraStack[gActiveCameraID].camera.distanceToCamera;
}
gCameraTransform.z_position = gActiveCameraStack[gActiveCameraID].trans.z_position;
@@ -1342,7 +1342,7 @@ UNUSED void func_80069ACC(f32 x, f32 y, f32 z) {
gActiveCameraStack[gActiveCameraID].trans.x_position += x;
gActiveCameraStack[gActiveCameraID].trans.y_position += y;
gActiveCameraStack[gActiveCameraID].trans.z_position += z;
gActiveCameraStack[gActiveCameraID].unk34_a.levelSegmentIndex =
gActiveCameraStack[gActiveCameraID].object.cameraSegmentID =
get_level_segment_index_from_position(
gActiveCameraStack[gActiveCameraID].trans.x_position,
gActiveCameraStack[gActiveCameraID].trans.y_position,
@@ -1354,7 +1354,7 @@ UNUSED void func_80069B70(f32 x, UNUSED f32 y, f32 z) {
gActiveCameraStack[gActiveCameraID].trans.z_position -= x * sins_f(gActiveCameraStack[gActiveCameraID].trans.y_rotation);
gActiveCameraStack[gActiveCameraID].trans.x_position -= z * sins_f(gActiveCameraStack[gActiveCameraID].trans.y_rotation);
gActiveCameraStack[gActiveCameraID].trans.z_position += z * coss_f(gActiveCameraStack[gActiveCameraID].trans.y_rotation);
gActiveCameraStack[gActiveCameraID].unk34_a.levelSegmentIndex =
gActiveCameraStack[gActiveCameraID].object.cameraSegmentID =
get_level_segment_index_from_position(
gActiveCameraStack[gActiveCameraID].trans.x_position,
gActiveCameraStack[gActiveCameraID].trans.y_position,
@@ -1431,7 +1431,7 @@ void set_camera_shake_by_distance(f32 x, f32 y, f32 z, f32 dist, f32 magnitude)
diffZ = z - gActiveCameraStack[i].trans.z_position;
distance = sqrtf(((diffX * diffX) + (diffY * diffY)) + (diffZ * diffZ));
if (distance < dist) {
gActiveCameraStack[i].unk30 = ((dist - distance) * magnitude) / dist;
gActiveCameraStack[i].camera.distanceToCamera = ((dist - distance) * magnitude) / dist;
}
}
}
@@ -1442,7 +1442,7 @@ void set_camera_shake_by_distance(f32 x, f32 y, f32 z, f32 dist, f32 magnitude)
void set_camera_shake(f32 magnitude) {
s32 i;
for (i = 0; i <= gNumberOfViewports; i++) {
gActiveCameraStack[i].unk30 = magnitude;
gActiveCameraStack[i].camera.distanceToCamera = magnitude;
}
}
+1 -1
View File
@@ -698,7 +698,7 @@ void func_8006BD10(f32 arg0) {
if (gCurrentLevelHeader->music != 0) {
func_800012E8();
play_music(gCurrentLevelHeader->music);
func_800014BC(arg0);
multiply_music_tempo(arg0);
func_80001074(gCurrentLevelHeader->instruments);
}
}
+2 -2
View File
@@ -1889,7 +1889,7 @@ void render_minimap_and_misc_hud(Gfx **dList, MatrixS **mtx, Vertex **vtx, s32 u
D_80126CDC->unk1E6 = 14;
D_80126CDC->unk1E4 = 0;
D_80126CDC->unk1E8 = 1.0f;
tempVar1 = (opacity * (f32) temp_v0_8->segment.unk38.byte.unk39) * 0.0078125;
tempVar1 = (opacity * (f32) temp_v0_8->segment.object.opacity) * 0.0078125;
gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, 60, 60, 60, tempVar1);
func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk1E0);
}
@@ -1898,7 +1898,7 @@ void render_minimap_and_misc_hud(Gfx **dList, MatrixS **mtx, Vertex **vtx, s32 u
if (temp_v0_8 != NULL) {
func_800AA3EC(temp_v0_8->segment.trans.x_position, temp_v0_8->segment.trans.z_position, sp114, sp118, sp11C);
D_80126CDC->unk1E4 = 0;
tempVar1 = (opacity * (f32) temp_v0_8->segment.unk38.byte.unk39) * 0.0078125;
tempVar1 = (opacity * (f32) temp_v0_8->segment.object.opacity) * 0.0078125;
gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, gHudMinimapColours[8].red, gHudMinimapColours[8].green, gHudMinimapColours[8].blue, tempVar1);
D_80126CDC->unk1E8 = 1.0f;
D_80126CDC->unk1E6 = 14;
+1 -1
View File
@@ -2575,7 +2575,7 @@ s32 menu_title_screen_loop(s32 updateRate) {
gTitleRevealTimer += updateRate;
if (gTitleRevealTimer >= 32) {
gTitleRevealTimer = 32;
sp18->unk30 = 8.0f;
sp18->object.distanceToCamera = 8.0f;
play_sound_global(SOUND_EXPLOSION, 0);
}
} else {
+562 -557
View File
File diff suppressed because it is too large Load Diff
+3 -19
View File
@@ -11,6 +11,7 @@
#define TIME_JIFFIES_PER_SECOND 60
#define TIME_SECONDS(sec) sec * TIME_JIFFIES_PER_SECOND
#define U8_ANGLE_TO_U16(x) (x << 6 << 4)
enum BossRaceWarps {
WARP_STANDARD = -1,
@@ -33,7 +34,8 @@ enum TajBehaviours {
TAJ_MODE_SET_CHALLENGE = 15,
TAJ_MODE_TELEPORT_AWAY_BEGIN = 20,
TAJ_MODE_TELEPORT_AWAY_END,
TAJ_MODE_RACE = 30
TAJ_MODE_RACE = 30,
TAJ_MODE_UNK1F
};
enum TTBehaviours {
@@ -67,12 +69,6 @@ enum FrogActions {
FROG_UNSQUISH
};
typedef struct Object78_80033DD0 {
s32 *unk0;
s16 unk4;
s16 unk6;
} Object78_80033DD0;
typedef struct unk80034B4C {
u8 pad0[0x18];
s16 unk18;
@@ -243,18 +239,6 @@ typedef struct unk80041A90_MidiFade {
f32 unk14;
} unk80041A90_MidiFade;
typedef struct Object_78_Banana {
s32 unk0;
s16 unk4;
s16 unk6;
} Object_78_Banana;
typedef struct Object_LevelName_78 {
f32 radius;
s16 levelID;
s16 opacity;
} Object_LevelName_78;
// Unsure about the signed/unsigned with these arrays.
extern u16 D_800DC9A8[20];
extern u16 D_800DC9D0[64];
+10 -10
View File
@@ -176,24 +176,24 @@ void func_80061C0C(Object *obj) {
Object_68 *temp_a1;
s32 var_v1;
if (obj->segment.unk38.byte.unk3A < 0) {
obj->segment.unk38.byte.unk3A = 0;
if (obj->segment.object.numModelIDs < 0) {
obj->segment.object.numModelIDs = 0;
}
var_v1 = obj->segment.header->numberOfModelIds - 1;
if (var_v1 < obj->segment.unk38.byte.unk3A) {
obj->segment.unk38.byte.unk3A = var_v1;
if (var_v1 < obj->segment.object.numModelIDs) {
obj->segment.object.numModelIDs = var_v1;
}
temp_a1 = obj->unk68[obj->segment.unk38.byte.unk3A];
temp_a1 = obj->unk68[obj->segment.object.numModelIDs];
mdl = temp_a1->objModel;
if (temp_a1->objModel->animations != NULL) {
if (obj->segment.unk38.byte.unk3B < 0) {
obj->segment.unk38.byte.unk3B = 0;
if (obj->segment.object.animationID < 0) {
obj->segment.object.animationID = 0;
}
if (obj->segment.unk38.byte.unk3B >= mdl->numberOfAnimations) {
obj->segment.unk38.byte.unk3B = mdl->numberOfAnimations - 1;
if (obj->segment.object.animationID >= mdl->numberOfAnimations) {
obj->segment.object.animationID = mdl->numberOfAnimations - 1;
}
if (mdl->numberOfAnimations > 0) {
var_v1 = mdl->animations[obj->segment.unk38.byte.unk3B].unk4 - 2;
var_v1 = mdl->animations[obj->segment.object.animationID].unk4 - 2;
} else {
var_v1 = 0;
}
+36 -36
View File
@@ -692,7 +692,7 @@ void func_8000E2B4(void) {
if (get_filtered_cheats() & CHEAT_SMALL_CHARACTERS) {
player->segment.trans.scale *= 0.714f;
}
player->segment.unk3C_a.level_entry = NULL;
player->segment.level_entry = NULL;
player->segment.trans.y_rotation = D_8011AD4C;
player->segment.trans.y_position = D_8011AD48;
}
@@ -741,10 +741,10 @@ void func_8000E4E8(s32 index) {
s32 func_8000E558(Object *arg0){
s32 temp_v0;
s32 new_var, new_var2;
if (arg0->segment.unk3C_a.level_entry == NULL) {
if (arg0->segment.level_entry == NULL) {
return TRUE;
}
temp_v0 = (s32) arg0->segment.unk3C_a.level_entry;
temp_v0 = (s32) arg0->segment.level_entry;
new_var2 = (s32) D_8011AE98[0];
if ((temp_v0 >= new_var2) && (((D_8011AEA0[0] * 8) + new_var2) >= temp_v0)) {
return FALSE;
@@ -788,7 +788,7 @@ UNUSED s32 func_8000E9C0(void) {
void func_8000E9D0(Object *arg0) {
arg0->segment.trans.flags |= OBJ_FLAGS_DEACTIVATED;
func_800245B4(arg0->segment.unk2C.half.upper | 0xC000);
func_800245B4(arg0->segment.object.unk2C | 0xC000);
gObjPtrList[objCount++] = arg0;
if (1) {} // Fakematch
D_8011AE64++;
@@ -1125,7 +1125,7 @@ void func_80011134(Object *arg0, s32 arg1) {
s32 var_s1;
u8 temp_v0;
temp_s3 = arg0->unk68[arg0->segment.unk38.byte.unk3A]->objModel;
temp_s3 = arg0->unk68[arg0->segment.object.numModelIDs]->objModel;
temp_s5 = temp_s3->unk50;
temp_s4 = temp_s3->batches;
for (var_s1 = 0; temp_s5 > 0 && var_s1 < temp_s3->numberOfBatches; var_s1++) {
@@ -1303,20 +1303,20 @@ s32 move_object(Object *obj, f32 xPos, f32 yPos, f32 zPos) {
gNoBoundsCheck = FALSE;
if (outOfBounds) {
obj->segment.unk2C.half.lower = -1;
obj->segment.object.segmentID = -1;
return 1;
}
obj->segment.trans.x_position = newXPos;
obj->segment.trans.y_position = newYPos;
obj->segment.trans.z_position = newZPos;
box = get_segment_bounding_box(obj->segment.unk2C.half.lower);
box = get_segment_bounding_box(obj->segment.object.segmentID);
//For some reason the XYZ positions are converted into integers for the next section
intXPos = newXPos, intYPos = newYPos, intZPos = newZPos;
if (box == NULL) {
obj->segment.unk2C.half.lower = get_level_segment_index_from_position(intXPos, intYPos, intZPos);
obj->segment.object.segmentID = get_level_segment_index_from_position(intXPos, intYPos, intZPos);
return 0;
} else {
outsideBBox = FALSE;
@@ -1332,7 +1332,7 @@ s32 move_object(Object *obj, f32 xPos, f32 yPos, f32 zPos) {
if (outsideBBox) {
segmentID = get_level_segment_index_from_position(intXPos, intYPos, intZPos);
if (segmentID != -1) {
obj->segment.unk2C.half.lower = segmentID;
obj->segment.object.segmentID = segmentID;
}
}
}
@@ -1359,7 +1359,7 @@ void func_80011AD0(Object *this) {
switch (this->behaviorId) {
case BHV_CHARACTER_FLAG:
if (this->unk7C.word >= 0) {
if (this->properties.characterFlag.characterID >= 0) {
obj64 = this->unk64;
func_80011960(this, obj64->character_flag.vertices, 4, obj64->character_flag.triangles,
2, obj64->character_flag.texture, 11, 0, 1.0f);
@@ -1372,13 +1372,13 @@ void func_80011AD0(Object *this) {
case BHV_FISH:
obj64 = this->unk64;
tmp_f0 = this->segment.unk3C_a.level_entry->fish.unkC[1];
tmp_f0 = this->segment.level_entry->fish.unkC[1];
tmp_f0 *= 0.01f;
func_80011960(this, &obj64->fish.vertices[obj64->fish.unkFC * 6], 6, obj64->fish.triangles, 8, obj64->fish.texture, 26, 0, tmp_f0);
break;
case BHV_BOOST:
if ((this->unk78 != 0) && ((this->unk64->boost.unk70 > 0) || (this->unk64->boost.unk74 > 0.0f))) {
if ((this->properties.common.unk0 != 0) && ((this->unk64->boost.unk70 > 0) || (this->unk64->boost.unk74 > 0.0f))) {
func_800135B8(this);
}
break;
@@ -1412,14 +1412,14 @@ void render_3d_billboard(Object *obj) {
if (obj->behaviorId == BHV_BOMB_EXPLOSION) {
//!@bug Never true, because the type is u8.
if (obj->segment.unk38.byte.unk39 > 255) {
obj->segment.unk38.byte.unk39 = obj->unk7C.word & 0xFF;
if (obj->segment.object.opacity > 255) {
obj->segment.object.opacity = obj->properties.bombExplosion.unk4 & 0xFF;
} else {
obj->segment.unk38.byte.unk39 = (obj->segment.unk38.byte.unk39 * (obj->unk7C.word & 0xFF)) >> 8;
obj->segment.object.opacity = (obj->segment.object.opacity * (obj->properties.bombExplosion.unk4 & 0xFF)) >> 8;
}
}
alpha = obj->segment.unk38.byte.unk39;
alpha = obj->segment.object.opacity;
if (alpha > 255) {
alpha = 255;
}
@@ -1452,11 +1452,11 @@ void render_3d_billboard(Object *obj) {
} else {
gDPSetEnvColor(gObjectCurrDisplayList++, 255, 255, 255, 0);
}
sp58 = (unk80068514_arg4 *) obj->unk68[obj->segment.unk38.byte.unk3A];
sp58 = (unk80068514_arg4 *) obj->unk68[obj->segment.object.numModelIDs];
var_a0 = NULL;
if (obj->behaviorId == BHV_FIREBALL_OCTOWEAPON_2) {
var_a0 = (Object *) obj->trans78;
if (obj->unk7C.word > 0) {
var_a0 = obj->properties.fireball.obj;
if (obj->properties.fireball.timer > 0) {
var_a0 = obj;
}
}
@@ -1518,7 +1518,7 @@ void render_3d_model(Object *obj) {
ObjectModel *objModel;
Object_68 *something;
obj68 = obj->unk68[obj->segment.unk38.byte.unk3A];
obj68 = obj->unk68[obj->segment.object.numModelIDs];
if (obj68 != NULL) {
objModel = obj68->objModel;
hasOpacity = FALSE;
@@ -1575,14 +1575,14 @@ void render_3d_model(Object *obj) {
spB0 = FALSE;
if (racerObj != NULL) {
object_undo_player_tumble(obj);
if (obj->segment.unk38.byte.unk3B == 0 || racerObj->vehicleID >= VEHICLE_TRICKY) {
if (obj->segment.object.animationID == 0 || racerObj->vehicleID >= VEHICLE_TRICKY) {
func_80069790(&gObjectCurrDisplayList, &gObjectCurrMatrix, obj68, racerObj->headAngle);
spB0 = TRUE;
} else {
racerObj->headAngle = 0;
}
}
alpha = obj->segment.unk38.byte.unk39;
alpha = obj->segment.object.opacity;
if (alpha > 255) {
alpha = 255;
}
@@ -1629,7 +1629,7 @@ void render_3d_model(Object *obj) {
if (!(loopObj->segment.trans.flags & OBJ_FLAGS_INVISIBLE)) {
index = obj->unk60->unk2C[i];
if (index >= 0 && index < objModel->unk18) {
something = loopObj->unk68[loopObj->segment.unk38.byte.unk3A];
something = loopObj->unk68[loopObj->segment.object.numModelIDs];
vtxX = obj->unk44[objModel->unk14[index]].x;
vtxY = obj->unk44[objModel->unk14[index]].y;
vtxZ = obj->unk44[objModel->unk14[index]].z;
@@ -1659,7 +1659,7 @@ void render_3d_model(Object *obj) {
gDPSetEnvColor(gObjectCurrDisplayList++, 255, 255, 255, 0);
gDPSetPrimColor(gObjectCurrDisplayList++, 0, 0, intensity, intensity, intensity, alpha);
}
loopObj->unk78 = render_sprite_billboard(&gObjectCurrDisplayList, &gObjectCurrMatrix, &gObjectCurrVertexList, loopObj, (unk80068514_arg4 *) something, flags);
loopObj->properties.common.unk0 = render_sprite_billboard(&gObjectCurrDisplayList, &gObjectCurrMatrix, &gObjectCurrVertexList, loopObj, (unk80068514_arg4 *) something, flags);
if (var_v0_2) {
gDkrInsertMatrix(gObjectCurrDisplayList++, 0, 0);
func_80012CE8(&gObjectCurrDisplayList);
@@ -1679,7 +1679,7 @@ void render_3d_model(Object *obj) {
index = obj->segment.header->unk58;
if (index >= 0 && index < objModel->unk18) {
flags = (RENDER_Z_COMPARE | RENDER_FOG_ACTIVE | RENDER_Z_UPDATE);
something = loopObj->unk68[loopObj->segment.unk38.byte.unk3A];
something = loopObj->unk68[loopObj->segment.object.numModelIDs];
vtxX = obj->unk44[objModel->unk14[index]].x;
vtxY = obj->unk44[objModel->unk14[index]].y;
vtxZ = obj->unk44[objModel->unk14[index]].z;
@@ -1860,9 +1860,9 @@ void func_80012F94(Object *obj) {
if (get_current_viewport() != objRacer->playerIndex) {
var_a1 += 5;
}
var_f0_2 = obj->segment.unk30;
var_f0_2 = obj->segment.object.distanceToCamera;
temp_v1 = (s32) var_f0_2 >> 3;
if (obj->segment.unk30 < 0.0f) {
if (obj->segment.object.distanceToCamera < 0.0f) {
var_f0_2 = 0.0f;
} else if (var_f0_2 > 3500.0f) {
var_f0_2 = 3500.0f;
@@ -1914,14 +1914,14 @@ void func_80012F94(Object *obj) {
if (numberOfModels < var_t0) {
var_t0 = numberOfModels;
}
obj->segment.unk38.byte.unk3A = var_t0;
obj->segment.object.numModelIDs = var_t0;
if ((obj->unk54 != NULL) && (obj->unk54->unk0 < 0.6f)) {
objRacer->lightFlags |= RACER_LIGHT_NIGHT;
} else {
objRacer->lightFlags &= ~RACER_LIGHT_NIGHT;
}
racerLightTimer = objRacer->lightFlags & RACER_LIGHT_TIMER;
new_var = obj->unk68[obj->segment.unk38.byte.unk3A];
new_var = obj->unk68[obj->segment.object.numModelIDs];
temp_a1_3 = new_var->objModel;
if (racerLightTimer != 0) {
racerLightTimer--;
@@ -2751,7 +2751,7 @@ void func_8001BC54(void) {
for (i = 0; i < gCameraObjCount - 1; i++) {
objPtr = (*gCameraObjList)[i+1];
temp = (*gCameraObjList)[i];
if (temp->unk78 > objPtr->unk78) {
if (temp->properties.common.unk0 > objPtr->properties.common.unk0) {
(*gCameraObjList)[i] = (*gCameraObjList)[i+1];
(*gCameraObjList)[i+1] = temp;
continueLoop = FALSE;
@@ -2868,7 +2868,7 @@ s32 func_8001C524(f32 diffX, f32 diffY, f32 diffZ, s32 someFlag) {
for (numSteps = 0; numSteps != 128; numSteps++) {
segment = (ObjectSegment*) (*D_8011AF04)[numSteps];
if (segment) {
levelObj = &((segment->unk3C_a.level_entry)->ttDoor);
levelObj = &((segment->level_entry)->ttDoor);
var_a0 = 1;
if (someFlag && (sp64 != levelObj->doorID)) {
var_a0 = 0;
@@ -3047,7 +3047,7 @@ void func_8001E36C(s32 arg0, f32 *arg1, f32 *arg2, f32 *arg3) {
if (current_obj != NULL
&& !(current_obj->segment.trans.flags & OBJ_FLAGS_DEACTIVATED)
&& current_obj->behaviorId == BHV_RAMP_SWITCH
&& current_obj->action == arg0) {
&& current_obj->properties.common.unk0 == arg0) {
*arg1 = current_obj->segment.trans.x_position;
*arg2 = current_obj->segment.trans.y_position;
*arg3 = current_obj->segment.trans.z_position;
@@ -3107,7 +3107,7 @@ s32 func_8001F3EC(s32 arg0){
count = 0;
for (i = 0; i < D_8011AE78; i++) {
if (D_8011AE74[i]->unk7C.word == arg0){
if (D_8011AE74[i]->properties.common.unk4 == arg0){
count++;
}
}
@@ -3137,7 +3137,7 @@ void func_80021400(s32 arg0) {
arg0 &= 0xFF; //?
for (i = 0; i < D_8011AE78 && (arg0 != (D_8011AE74[i]->unk7C.word & 0xFF)); i++) {}
for (i = 0; i < D_8011AE78 && (arg0 != (D_8011AE74[i]->properties.common.unk4 & 0xFF)); i++) {}
if (i < D_8011AE78) {
if (D_8011AE74[i]->unk64 != NULL) {
@@ -3175,11 +3175,11 @@ s8 func_800214E4(Object *obj, s32 updateRate) {
i = 0;
if (D_8011AE78 > 0) {
temp_v1 = animObj->unk28;
if (temp_v1 != (s32) (*D_8011AE74)->unk7C.word) {
if (temp_v1 != (s32) (*D_8011AE74)->properties.common.unk4) {
loop_11:
i++;
if (i < D_8011AE78) {
if (temp_v1 != (s32) D_8011AE74[i]->unk7C.word) {
if (temp_v1 != (s32) D_8011AE74[i]->properties.common.unk4) {
goto loop_11;
}
}
+75 -73
View File
@@ -541,7 +541,7 @@ void func_800AF52C(Object *obj, s32 arg1) {
if (temp_v0->unk6 > 0) { // Useless if statement, since the loop already does this.
for (i = 0; i < temp_v0->unk6; i++){
temp = temp_v0->unkC_60[i];
temp->unk38.half.unk3A = 0;
temp->segment.unk38.half.unk3A = 0;
}
}
if (temp_v1->flags & 1) {
@@ -609,7 +609,7 @@ void func_800AFE5C(unk800B1CB8 *arg0, Particle *arg1) {
if (temp_s0 != NULL) {
func_8000E9D0((Object *) temp_s0);
temp_s0->unk74 = arg1->unk6;
temp_s0->unk40 |= 0x2000;
temp_s0->segment.unk40 |= 0x2000;
arg1->unkC_60[arg1->unk6] = temp_s0;
arg1->unk6++;
}
@@ -629,33 +629,33 @@ void func_800AFE5C(unk800B1CB8 *arg0, Particle *arg1) {
}
}
void func_800B0010(Object *arg0, Object *arg1, unk800B03C0_arg2 *arg2, Object *arg3) {
void func_800B0010(Particle2 *arg0, Particle2 *arg1, unk800B03C0_arg2 *arg2, ParticleBehavior *arg3) {
s32 sp3C;
Vec3f sp30;
Vec3s sp28;
if (arg3->segment.trans_unk.unk0 & 0x70) {
arg0->segment.x_velocity = arg3->segment.unk30;
arg0->segment.y_velocity = arg3->segment.unk34_a.unk34;
arg0->segment.z_velocity = arg3->segment.unk38.unk38_f32;
if (arg3->flags & 0x70) {
arg0->segment.x_velocity = arg3->unk30;
arg0->segment.y_velocity = arg3->unk34;
arg0->segment.z_velocity = arg3->unk38;
} else {
arg0->segment.x_velocity = 0.0f;
arg0->segment.y_velocity = 0.0f;
arg0->segment.z_velocity = 0.0f;
}
sp3C = arg3->unk5C_s32 & 0x700;
sp3C = arg3->unk5C & 0x700;
if (sp3C) {
if (sp3C & 0x100) {
arg0->segment.x_velocity += (f32) get_random_number_from_range(-arg3->unk74_signed, arg3->unk74_signed) * 0.00001525878906;
arg0->segment.x_velocity += (f32) get_random_number_from_range(-arg3->unk74, arg3->unk74) * 0.00001525878906;
}
if (sp3C & 0x200) {
arg0->segment.y_velocity += (f32) get_random_number_from_range(-arg3->unk78, arg3->unk78) * 0.00001525878906;
}
if (sp3C & 0x400) {
arg0->segment.z_velocity += (f32) get_random_number_from_range(-arg3->unk7C.word, arg3->unk7C.word) * 0.00001525878906;
arg0->segment.z_velocity += (f32) get_random_number_from_range(-arg3->unk7C, arg3->unk7C) * 0.00001525878906;
}
}
switch (arg3->segment.trans_unk.unk0 & 0x70) {
switch (arg3->flags & 0x70) {
case 0x10:
arg0->segment.x_velocity += arg1->segment.x_velocity;
arg0->segment.y_velocity += arg1->segment.y_velocity;
@@ -667,22 +667,22 @@ void func_800B0010(Object *arg0, Object *arg1, unk800B03C0_arg2 *arg2, Object *a
arg0->segment.z_velocity *= arg1->segment.z_velocity;
break;
}
if (arg3->segment.trans_unk.unk0 & 4) {
if (arg3->flags & 4) {
sp30.x = 0.0f;
sp30.y = 0.0f;
sp30.z = -arg3->segment.unk3C_a.unk3C_f;
sp3C = arg3->unk5C_s32;
sp30.z = -arg3->unk3C;
sp3C = arg3->unk5C;
if (sp3C & 0x10) {
sp30.z += (f32) get_random_number_from_range(-arg3->unk70_s32, arg3->unk70_s32) * 0.00001525878906;
sp30.z += (f32) get_random_number_from_range(-arg3->unk70, arg3->unk70) * 0.00001525878906;
}
if (sp3C & 0x60) {
sp28.y_rotation = arg2->unk12;
if (sp3C & 0x20) {
sp28.y_rotation += get_random_number_from_range((s32) -arg3->unk68_halfs.unk6A, (s32) arg3->unk68_halfs.unk6A);
sp28.y_rotation += get_random_number_from_range(-arg3->unk6A, arg3->unk6A);
}
sp28.x_rotation = arg2->unk14;
if (sp3C & 0x40) {
sp28.x_rotation += get_random_number_from_range((s32) -arg3->unk6C_halfs.unk6C, (s32) arg3->unk6C_halfs.unk6C);
sp28.x_rotation += get_random_number_from_range((s32) -arg3->unk6C, (s32) arg3->unk6C);
}
f32_vec3_apply_object_rotation3((ObjectTransform* ) &sp28, (f32*) &sp30);
} else {
@@ -695,7 +695,7 @@ void func_800B0010(Object *arg0, Object *arg1, unk800B03C0_arg2 *arg2, Object *a
}
}
void func_800B03C0(Object *arg0, ObjectTransform *arg1, unk800B03C0_arg2 *arg2, Object *arg3) {
void func_800B03C0(Particle2 *arg0, ObjectTransform *arg1, unk800B03C0_arg2 *arg2, ParticleBehavior *arg3) {
s32 sp3C;
Vec3f sp30;
Vec3s sp28;
@@ -703,26 +703,26 @@ void func_800B03C0(Object *arg0, ObjectTransform *arg1, unk800B03C0_arg2 *arg2,
arg0->unk4C_f32 = arg2->unk18;
arg0->unk50_f32 = arg2->unk1A;
arg0->unk54_f32 = arg2->unk1C;
arg0->unk58_f32 = arg3->unk58_f32;
if (arg3->unk5C_s32 & 0x80000) {
arg0->unk58_f32 += (f32) get_random_number_from_range(-arg3->unk94_signed, arg3->unk94_signed) * 0.00001525878906; // 0.00001525878906 ~= 1.0/65536.0
arg0->unk58_f32 = arg3->unk58;
if (arg3->unk5C & 0x80000) {
arg0->unk58_f32 += (f32) get_random_number_from_range(-arg3->unk94, arg3->unk94) * 0.00001525878906; // 0.00001525878906 ~= 1.0/65536.0
}
if (arg3->segment.trans_unk.unk0 & 1) {
if (arg3->flags & 1) {
sp30.x = 0.0f;
sp30.y = 0.0f;
sp30.z = -arg3->segment.trans_unk.y_position;
sp3C = arg3->unk5C_s32;
sp30.z = -arg3->unk10;
sp3C = arg3->unk5C;
if (sp3C & 1) {
sp30.z += (f32) get_random_number_from_range(-arg3->unk60_s32, arg3->unk60_s32) * 0.00001525878906;
sp30.z += (f32) get_random_number_from_range(-arg3->unk60, arg3->unk60) * 0.00001525878906;
}
if (sp3C & 6) {
sp28.y_rotation = arg2->y_rotation;
if (sp3C & 2) {
sp28.y_rotation += get_random_number_from_range(-arg3->unk64_halfs.unk64, arg3->unk64_halfs.unk64);
sp28.y_rotation += get_random_number_from_range(-arg3->unk64, arg3->unk64);
}
sp28.x_rotation = arg2->x_rotation;
if (sp3C & 4) {
sp28.x_rotation += get_random_number_from_range(-arg3->unk64_halfs.unk66, arg3->unk64_halfs.unk66);
sp28.x_rotation += get_random_number_from_range(-arg3->unk66, arg3->unk66);
}
f32_vec3_apply_object_rotation3((ObjectTransform* ) &sp28, (f32 *) &sp30);
} else {
@@ -802,7 +802,7 @@ Particle2 *func_800B0698(unk800B1CB8 *arg0, Particle *arg1) {
} else {
var_v0->unk0.unk5E = 0;
}
func_800B03C0((Object *) var_v0, (ObjectTransform *) arg0, (unk800B03C0_arg2 *) arg1, (Object *)sp20);
func_800B03C0((Particle2 *) var_v0, (ObjectTransform *) arg0, (unk800B03C0_arg2 *) arg1, (ParticleBehavior *)sp20);
if (sp20->flags & 0x80) {
var_v0->unk0.unk0 = sp20->unk44;
var_v0->unk0.unk2 = sp20->unk46;
@@ -815,7 +815,7 @@ Particle2 *func_800B0698(unk800B1CB8 *arg0, Particle *arg1) {
var_v0->unk0.unk62 = sp20->unk4A;
var_v0->unk0.unk64 = sp20->unk4C;
var_v0->unk0.unk66 = sp20->unk4E;
func_800B0010((Object *) var_v0, (Object *) arg0, (unk800B03C0_arg2 *) arg1, (Object *)sp20);
func_800B0010((Particle2 *) var_v0, (Particle2 *) arg0, (unk800B03C0_arg2 *) arg1, (ParticleBehavior *)sp20);
var_v0->unk0.unk68 = D_800E2E2C[(var_v0->unk0.unk40 >> 4) & 7];
if (var_v0->unk0.unk39 == 5) {
temp_f0 = var_v0->unk0.unk1C;
@@ -1017,7 +1017,7 @@ Particle2 *func_800B1130(unk800B1CB8 *arg0, Particle *arg1) {
func_800AF0F0((Object* ) var_v0);
}
}
func_800B03C0((Object *) var_v0, (ObjectTransform *) arg0, (unk800B03C0_arg2 *) arg1, (Object *) partBeh);
func_800B03C0((Particle2 *) var_v0, (ObjectTransform *) arg0, (unk800B03C0_arg2 *) arg1, (ParticleBehavior *) partBeh);
if (partBeh->flags & 0x80) {
var_v0->unk0 = partBeh->unk44;
var_v0->unk2 = partBeh->unk46;
@@ -1054,7 +1054,7 @@ Particle2 *func_800B1130(unk800B1CB8 *arg0, Particle *arg1) {
var_v0->unk66 += get_random_number_from_range(-partBeh->unk8A, partBeh->unk8A);
}
}
func_800B0010((Object *) var_v0, (Object *) arg0, (unk800B03C0_arg2 *) arg1, (Object *) partBeh);
func_800B0010((Particle2 *) var_v0, (Particle2 *) arg0, (unk800B03C0_arg2 *) arg1, (ParticleBehavior *) partBeh);
var_v0->unk68 = D_800E2E2C[(var_v0->unk40 >> 4) & 7];
if (var_v0->unk39 == 5) {
var_v0->unk58 = sqrtf((var_v0->unk1C * var_v0->unk1C) + (var_v0->unk20 * var_v0->unk20) + (var_v0->unk24 * var_v0->unk24));
@@ -1184,14 +1184,14 @@ unk800B1CB8 *func_800B1CB8(s32 arg0) {
void func_800B2040(Particle2 *arg0) {
TextureHeader *tex;
switch (arg0->unk2C) {
switch (arg0->segment.unk2C) {
case 0x80:
if (D_800E2CB8 > 0) {
if (arg0->unk44 != NULL) {
free_sprite((Sprite *) arg0->unk44);
}
D_800E2CB8--;
arg0->unk2C = 0;
arg0->segment.unk2C = 0;
}
break;
case 0:
@@ -1202,7 +1202,7 @@ void func_800B2040(Particle2 *arg0) {
free_texture(arg0->unk44_1->texture);
}
D_800E2CA0--;
arg0->unk2C = 0;
arg0->segment.unk2C = 0;
}
break;
case 2:
@@ -1212,7 +1212,7 @@ void func_800B2040(Particle2 *arg0) {
free_texture(tex);
}
D_800E2CAC--;
arg0->unk2C = 0;
arg0->segment.unk2C = 0;
}
break;
case 3:
@@ -1222,7 +1222,7 @@ void func_800B2040(Particle2 *arg0) {
free_texture(tex);
}
D_800E2CC4--;
arg0->unk2C = 0;
arg0->segment.unk2C = 0;
}
break;
case 4:
@@ -1233,7 +1233,7 @@ void func_800B2040(Particle2 *arg0) {
free_texture(tex);
}
D_800E2CD0--;
arg0->unk2C = 0;
arg0->segment.unk2C = 0;
}
break;
}
@@ -1248,7 +1248,7 @@ void func_800B2260(Particle *arg0) {
if (arg0->unkC_60 != NULL) {
for (i = 0; i < arg0->unk6; i++) {
temp_v0 = arg0->unkC_60[i];
temp_v0->unk38.half.unk3A = 0;
temp_v0->segment.unk38.half.unk3A = 0;
temp_v0->unk70 = 0;
}
free_from_memory_pool(arg0->unkC_60);
@@ -1263,53 +1263,55 @@ void func_800B22FC(Particle2 *arg0, s32 arg1) {
D_80127C80 = arg1;
sp20 = NULL;
if (arg0->unk2C == 3) {
if (arg0->segment.unk2C == 3) {
func_800B26E0();
} else {
if (arg0->unk40 & 3) {
if (arg0->segment.unk40 & 3) {
if (D_80127C80 > 0) {
sp20 = NULL;
func_800B2FBC(arg0);
sp20 = NULL;
}
}
if (arg0->unk2C == 4) {
if (arg0->segment.unk2C == 4) {
sp20 = arg0;
arg0->unk75 = 1 - arg0->unk75;
arg0->unk77 = 0;
}
if (sp20 == NULL || (sp20 != NULL && sp20->unk70 != 0)) {
if (arg0->unk38.byte.unk39 == 2) {
if (arg0->segment.unk38.byte.unk39 == 2) {
func_800B3358(arg0);
} else if (arg0->unk38.byte.unk39 == 3) {
} else if (arg0->segment.unk38.byte.unk39 == 3) {
func_800B3240(arg0);
} else if (arg0->unk38.byte.unk39 == 4) {
} else if (arg0->segment.unk38.byte.unk39 == 4) {
func_800B3140(arg0);
} else if (arg0->unk38.byte.unk39 == 5) {
} else if (arg0->segment.unk38.byte.unk39 == 5) {
func_800B3564(arg0);
} else {
func_800B34B0(arg0);
}
}
temp_v0_2 = get_segment_bounding_box(arg0->unk2E);
temp_v0_2 = get_segment_bounding_box(arg0->segment.unk2E);
if (temp_v0_2 != NULL) {
if (arg0->trans.x_position < temp_v0_2->x1 || temp_v0_2->x2 < arg0->trans.x_position || arg0->trans.y_position < temp_v0_2->y1 || temp_v0_2->y2 < arg0->trans.y_position || arg0->trans.z_position < temp_v0_2->z1 || temp_v0_2->z2 < arg0->trans.z_position) {
arg0->unk2E = get_level_segment_index_from_position(arg0->trans.x_position, arg0->trans.y_position, arg0->trans.z_position);
if (arg0->segment.trans.x_position < temp_v0_2->x1 || temp_v0_2->x2 < arg0->segment.trans.x_position ||
arg0->segment.trans.y_position < temp_v0_2->y1 || temp_v0_2->y2 < arg0->segment.trans.y_position ||
arg0->segment.trans.z_position < temp_v0_2->z1 || temp_v0_2->z2 < arg0->segment.trans.z_position) {
arg0->segment.unk2E = get_level_segment_index_from_position(arg0->segment.trans.x_position, arg0->segment.trans.y_position, arg0->segment.trans.z_position);
}
} else {
arg0->unk2E = get_level_segment_index_from_position(arg0->trans.x_position, arg0->trans.y_position, arg0->trans.z_position);
arg0->segment.unk2E = get_level_segment_index_from_position(arg0->segment.trans.x_position, arg0->segment.trans.y_position, arg0->segment.trans.z_position);
}
arg0->unk38.half.unk3A -= D_80127C80;
if (arg0->unk38.half.unk3A <= 0) {
arg0->segment.unk38.half.unk3A -= D_80127C80;
if (arg0->segment.unk38.half.unk3A <= 0) {
gParticlePtrList_addObject((Object*) arg0);
} else {
if (arg0->unk60_halfs.unk60 == 0) {
arg0->unk5C_halfs.unk5C += D_80127C80 * arg0->unk5C_halfs.unk5E;
if (arg0->unk5C_halfs.unk5C < 0xFF) {
if (arg0->unk40 & 0x1000) {
arg0->trans.flags |= OBJ_FLAGS_UNK_0100;
if (arg0->segment.unk40 & 0x1000) {
arg0->segment.trans.flags |= OBJ_FLAGS_UNK_0100;
} else {
arg0->trans.flags |= OBJ_FLAGS_UNK_0080;
arg0->segment.trans.flags |= OBJ_FLAGS_UNK_0080;
}
}
} else {
@@ -1360,47 +1362,47 @@ void func_800B2FBC(Particle2 *arg0) {
keepGoing = -1;
i = 128; // This is needed to match.
if (arg0->unk2C == i) {
if (arg0->segment.unk2C == i) {
var_a1 = arg0->unk44->unk0 * 256;
} else {
var_a1 = arg0->unk44->unk0Ptr->unk12;
}
someFlag4 = arg0->unk40 & 1;
someFlag2 = arg0->unk40 & 2;
someFlag3 = arg0->unk40 & 4;
someFlag = arg0->unk40 & 8;
someFlag4 = arg0->segment.unk40 & 1;
someFlag2 = arg0->segment.unk40 & 2;
someFlag3 = arg0->segment.unk40 & 4;
someFlag = arg0->segment.unk40 & 8;
for (i = 0; (i++ < D_80127C80) && keepGoing;) {
if (!someFlag) {
arg0->unk18 += arg0->unk1A;
if (arg0->unk18 >= var_a1) {
arg0->segment.unk18 += arg0->segment.unk1A;
if (arg0->segment.unk18 >= var_a1) {
if (someFlag2) {
arg0->unk18 = ((var_a1 * 2) - arg0->unk18) - 1;
arg0->segment.unk18 = ((var_a1 * 2) - arg0->segment.unk18) - 1;
someFlag = TRUE;
arg0->unk40 |= 8;
arg0->segment.unk40 |= 8;
} else if (someFlag3) {
arg0->unk18 -= var_a1;
arg0->segment.unk18 -= var_a1;
} else {
arg0->unk18 = var_a1 - 1;
arg0->segment.unk18 = var_a1 - 1;
keepGoing = FALSE;
arg0->unk40 &= ~3;
arg0->segment.unk40 &= ~3;
}
}
} else {
arg0->unk18 -= arg0->unk1A;
if (arg0->unk18 < 0) {
arg0->segment.unk18 -= arg0->segment.unk1A;
if (arg0->segment.unk18 < 0) {
if (someFlag3) {
if (someFlag4) {
arg0->unk18 = -arg0->unk18;
arg0->segment.unk18 = -arg0->segment.unk18;
someFlag = FALSE;
arg0->unk40 &= ~8;
arg0->segment.unk40 &= ~8;
} else {
arg0->unk18 += var_a1;
arg0->segment.unk18 += var_a1;
}
} else {
arg0->unk18 = 0;
arg0->segment.unk18 = 0;
keepGoing = FALSE;
arg0->unk40 &= ~3;
arg0->segment.unk40 &= ~3;
}
}
}
+27 -17
View File
@@ -218,38 +218,48 @@ typedef struct Particle {
/* 0x006E */ s16 unk6E;
} Particle;
typedef struct Particle2 {
typedef struct ParticleSegment {
/* 0x0000 */ ObjectTransform trans;
/* 0x0018 */ s16 unk18;
/* 0x0018 */ s16 unk1A;
/* 0x001C */ s16 unk1C;
/* 0x001E */ s16 unk1E;
/* 0x0020 */ s16 unk20;
/* 0x0022 */ s16 unk22;
/* 0x0024 */ s16 unk24;
/* 0x0026 */ s16 unk26;
/* 0x0028 */ s16 unk28;
/* 0x002A */ s16 unk2A;
/* 0x001A */ s16 unk1A;
/* 0x001C */ f32 x_velocity;
/* 0x0020 */ f32 y_velocity;
/* 0x0024 */ f32 z_velocity;
/* 0x0028 */ f32 unk28;
/* 0x002C */ s16 unk2C;
/* 0x002E */ s16 unk2E;
/* 0x0030 */ f32 unk30;
/* 0x0034 */ f32 unk34;
union {
/* 0x0034 */ f32 unk34;
struct {
/* 0x0034 */ s16 levelSegmentIndex;
/* 0x0036 */ s16 unk36;
};
} unk34_a;
union {
struct {
/* 0x0038 */ u8 unk38;
/* 0x0039 */ u8 unk39;
/* 0x003A */ s8 unk3A;
/* 0x003A */ s8 unk3A; // Index value for unk68 array
/* 0x003B */ s8 unk3B;
} byte;
struct {
/* 0x0038 */ s16 unk38;
/* 0x003A */ s16 unk3A;
} half;
f32 unk38_f32;
} unk38;
/* 0x003C */ f32 unk3C;
/* 0x0040 */ s32 unk40;
union {
/* 0x003C */ void *unk3C_ptr;
/* 0x003C */ f32 unk3C_f;
} unk3C_a;
/* 0x0040 */ s32 unk40;
} ParticleSegment;
typedef struct Particle2 {
/* 0x0000 */ ParticleSegment segment;
union {
/* 0x0044 */ unk800B0698_44 *unk44;
/* 0x0044 */ TextureHeader *unk44_0;
@@ -312,10 +322,10 @@ void func_800B2260(Particle *arg0);
void func_800B263C(Particle2 *arg0);
void init_particle_assets(void);
void func_800B2FBC(Particle2 *arg0);
void func_800B03C0(Object *arg0, ObjectTransform *arg1, unk800B03C0_arg2 *arg2, Object *arg3);
void func_800B03C0(Particle2 *arg0, ObjectTransform *arg1, unk800B03C0_arg2 *arg2, ParticleBehavior *arg3);
void func_800B2040(Particle2 *arg0);
void func_800B22FC(Particle2 *arg0, s32 arg1);
void func_800B0010(Object *arg0, Object *arg1, unk800B03C0_arg2 *arg2, Object *arg3);
void func_800B0010(Particle2 *arg0, Particle2 *arg1, unk800B03C0_arg2 *arg2, ParticleBehavior *arg3);
Particle2 *func_800B0698(unk800B1CB8 *arg0, Particle *arg1);
unk800B1CB8 *func_800B1CB8(s32 arg0);
void func_800AFE5C(unk800B1CB8 *arg0, Particle *arg1);
+35 -37
View File
@@ -218,7 +218,7 @@ s16 D_8011D5B8;
/******************************/
#ifdef NON_MATCHING
#ifdef NON_EQUIVALENT
void func_80042D20(Object *obj, Object_Racer *racer, s32 updateRate) {
s32 numRacers;
u8 *miscAsset4;
@@ -968,7 +968,7 @@ void func_80046524(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *r
guMtxXFMF(sp68, 0.0f, 1.0f, 0.0f, &racer->ox2, &racer->oy2, &racer->oz2);
guMtxXFMF(sp68, 1.0f, 0.0f, 0.0f, &racer->ox3, &racer->oy3, &racer->oz3);
if (racer->approachTarget == 0) {
obj->segment.unk38.byte.unk3B = 0;
obj->segment.object.animationID = 0;
var_v0 = racer->steerAngle;
var_v0 >>= 1;
var_v0 = 40 - var_v0;
@@ -2060,17 +2060,17 @@ void update_carpet(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *r
racer->vehicleID = VEHICLE_CARPET;
func_80049794(updateRate, updateRateF, obj, racer);
racer->vehicleID = racer->vehicleIDPrev;
obj->segment.unk38.byte.unk3B = 0;
obj->segment.object.animationID = 0;
if (racer->vehicleID == VEHICLE_CARPET) {
if (racer->unk154 != NULL) {
racer->unk154->segment.trans.x_position = obj->segment.trans.x_position;
racer->unk154->segment.trans.y_position = obj->segment.trans.y_position;
racer->unk154->segment.trans.z_position = obj->segment.trans.z_position;
racer->unk154->segment.unk2C.half.lower = obj->segment.unk2C.half.lower;
racer->unk154->segment.object.segmentID = obj->segment.object.segmentID;
racer->unk154->segment.trans.y_rotation = obj->segment.trans.y_rotation;
racer->unk154->segment.trans.x_rotation = obj->segment.trans.x_rotation;
racer->unk154->segment.trans.z_rotation = obj->segment.trans.z_rotation;
obj->segment.unk38.byte.unk3B = 0;
obj->segment.object.animationID = 0;
obj->segment.animFrame = sp26 + updateRate;
func_80061C0C(obj);
}
@@ -2431,7 +2431,7 @@ void update_player_racer(Object *obj, s32 updateRate) {
if (gCurrentPlayerIndex != PLAYER_COMPUTER) {
gCameraObject = (ObjectCamera *) get_active_camera_segment_no_cutscenes();
}
gRacerWaveCount = func_8002B0F4(obj->segment.unk2C.half.lower, obj->segment.trans.x_position, obj->segment.trans.z_position, &gRacerCurrentWave);
gRacerWaveCount = func_8002B0F4(obj->segment.object.segmentID, obj->segment.trans.x_position, obj->segment.trans.z_position, &gRacerCurrentWave);
if (gRacerWaveCount) {
for (i = 0; i < gRacerWaveCount; i++) {
if (gRacerCurrentWave[i]->type == WATER_UNK_F) {
@@ -2521,7 +2521,7 @@ void update_player_racer(Object *obj, s32 updateRate) {
}
if (tempRacer->playerIndex != PLAYER_COMPUTER && tempRacer->lap + 1 == header->laps
&& !D_8011D580 && get_current_level_race_type() == RACETYPE_DEFAULT) {
func_800014BC(1.12f);
multiply_music_tempo(1.12f);
D_8011D580 = 1;
}
}
@@ -2536,8 +2536,8 @@ void update_player_racer(Object *obj, s32 updateRate) {
newObject.size = 8;
tempRacer->unk15C = spawn_object(&newObject, 1);
if (tempRacer->unk15C) {
tempRacer->unk15C->segment.unk3C_a.level_entry = NULL;
tempRacer->unk15C->segment.unk38.byte.unk39 = 128;
tempRacer->unk15C->segment.level_entry = NULL;
tempRacer->unk15C->segment.object.opacity = 128;
}
}
if (tempRacer->unk15C) {
@@ -2549,7 +2549,7 @@ void update_player_racer(Object *obj, s32 updateRate) {
tempRacer->unk15C->segment.trans.z_position = checkpointNode->obj->segment.trans.z_position;
tempRacer->unk15C->segment.trans.y_rotation = checkpointNode->obj->segment.trans.y_rotation;
tempRacer->unk15C->segment.trans.x_rotation = checkpointNode->obj->segment.trans.x_rotation;
tempRacer->unk15C->segment.unk2C.half.lower = checkpointNode->obj->segment.unk2C.half.lower;
tempRacer->unk15C->segment.object.segmentID = checkpointNode->obj->segment.object.segmentID;
}
}
}
@@ -2652,8 +2652,8 @@ void update_player_racer(Object *obj, s32 updateRate) {
tempRacer->unk150->segment.trans.y_position = obj->segment.trans.y_position + yAsset[tempRacer->characterId];
tempRacer->unk150->segment.trans.z_position = obj->segment.trans.z_position;
tempRacer->unk150->segment.trans.scale = obj->segment.unk30 / 265.0f;
if (obj->segment.unk30 < 1500.0 || get_filtered_cheats() & CHEAT_MIRRORED_TRACKS) {
tempRacer->unk150->segment.trans.scale = obj->segment.object.distanceToCamera / 265.0f;
if (obj->segment.object.distanceToCamera < 1500.0 || get_filtered_cheats() & CHEAT_MIRRORED_TRACKS) {
tempObj = tempRacer->unk150;
tempObj->segment.trans.flags |= OBJ_FLAGS_INVISIBLE;
}
@@ -2728,7 +2728,7 @@ void racer_approach_object(Object *obj, Object_Racer *racer, f32 divisor) {
f32 diffY;
f32 diffZ;
obj->segment.unk38.byte.unk3B = 0;
obj->segment.object.animationID = 0;
obj->segment.animFrame = 40;
diffX = racer->approachTarget->segment.trans.x_position - obj->segment.trans.x_position;
diffY = racer->approachTarget->segment.trans.y_position - obj->segment.trans.y_position;
@@ -2795,9 +2795,7 @@ void apply_vehicle_rotation_offset(Object_Racer *obj, s32 max, s16 yRotation, s1
tempAngle = diff;
}
obj->z_rotation_offset += tempAngle;
return;
}
if (tempAngle < 0) {
} else if (tempAngle < 0) {
diff = -(max * 0x600);
if (tempAngle < diff) {
tempAngle = diff;
@@ -3454,7 +3452,7 @@ void func_8005250C(Object* obj, Object_Racer* racer, s32 updateRate) {
}
}
obj->segment.animFrame += angleVel;
obj->segment.unk38.byte.unk3B = 0;
obj->segment.object.animationID = 0;
if (angleVel) {} // Fakematch
if (racer->unk1F3 & 4) {
racer->unk1F2 = 3;
@@ -3504,34 +3502,34 @@ void func_80052988(Object *obj, Object_Racer *racer, s32 action, s32 arg3, s32 d
arg5 *= arg7;
if (gCurrentPlayerIndex == PLAYER_COMPUTER && action >= 3) {
obj->segment.unk38.byte.unk3B = 0;
obj->segment.object.animationID = 0;
racer->unk1F2 = 0;
} else if (obj->segment.unk38.byte.unk3B == 0) {
} else if (obj->segment.object.animationID == 0) {
if (flags & 1) {
if (obj->segment.animFrame > 40) {
obj->segment.animFrame -= arg7 * 4;
if (obj->segment.animFrame <= 40) {
obj->segment.unk38.byte.unk3B = action;
obj->segment.object.animationID = action;
obj->segment.animFrame = arg3;
}
} else {
obj->segment.animFrame += arg7 * 4;
if (obj->segment.animFrame >= 40) {
obj->segment.unk38.byte.unk3B = action;
obj->segment.object.animationID = action;
obj->segment.animFrame = arg3;
}
}
} else {
obj->segment.unk38.byte.unk3B = action;
obj->segment.object.animationID = action;
obj->segment.animFrame = arg3;
racer->unk1F3 &= ~0x80;
}
} else if (obj->segment.unk38.byte.unk3B == action) {
} else if (obj->segment.object.animationID == action) {
if (flags & 2) {
if (racer->unk1F3 & 0x80) {
obj->segment.animFrame -= arg5; //!@Delta
if (obj->segment.animFrame <= 0) {
obj->segment.unk38.byte.unk3B = 0;
obj->segment.object.animationID = 0;
racer->unk1F2 = 0;
obj->segment.animFrame = 40;
racer->unk1F3 = 0;
@@ -3548,7 +3546,7 @@ void func_80052988(Object *obj, Object_Racer *racer, s32 action, s32 arg3, s32 d
} else {
obj->segment.animFrame += arg5; //!@Delta
if (obj->segment.animFrame >= duration) {
obj->segment.unk38.byte.unk3B = 0;
obj->segment.object.animationID = 0;
racer->unk1F2 = 0;
obj->segment.animFrame = 40;
racer->unk1F3 = 0;
@@ -3556,7 +3554,7 @@ void func_80052988(Object *obj, Object_Racer *racer, s32 action, s32 arg3, s32 d
}
} else {
obj->segment.animFrame = arg3;
obj->segment.unk38.byte.unk3B = action;
obj->segment.object.animationID = action;
}
}
@@ -3958,7 +3956,7 @@ void update_onscreen_AI_racer(Object *obj, Object_Racer *racer, s32 updateRate,
} else if (racer->groundedWheels > 2) {
racer->unk1F0 = 0;
}
obj->segment.unk38.byte.unk3B = 0;
obj->segment.object.animationID = 0;
steerVel = ((-racer->y_rotation_vel >> 8) / gCurrentRacerHandlingStat);
steerVel = 40 - steerVel;
if (steerVel < 0) {
@@ -4336,8 +4334,8 @@ void handle_racer_items(Object *obj, Object_Racer *racer, UNUSED s32 updateRate)
if (gCurrentButtonsPressed & Z_TRIG || racer->raceFinished || racer->attackType) {
scaleY = 0;
scaleZ = 0;
if (obj->unk68[obj->segment.unk38.byte.unk3A] != NULL) {
model = obj->unk68[obj->segment.unk38.byte.unk3A]->objModel;
if (obj->unk68[obj->segment.object.numModelIDs] != NULL) {
model = obj->unk68[obj->segment.object.numModelIDs]->objModel;
if (obj->segment.header->unk58 > -1 && obj->segment.header->unk58 < model->unk18) {
if (obj->unk44 != NULL) {
heldObjData = obj->unk44;
@@ -4352,7 +4350,7 @@ void handle_racer_items(Object *obj, Object_Racer *racer, UNUSED s32 updateRate)
heldObj->segment.trans.x_position = obj->segment.trans.x_position + (racer->ox1 * scaleZ) + (racer->ox2 * scaleY);
heldObj->segment.trans.y_position = obj->segment.trans.y_position + (racer->oy1 * scaleZ) + (racer->oy2 * scaleY);
heldObj->segment.trans.z_position = obj->segment.trans.z_position + (racer->oz1 * scaleZ) + (racer->oz2 * scaleY);
heldObj->segment.unk2C.half.lower = obj->segment.unk2C.half.lower;
heldObj->segment.object.segmentID = obj->segment.object.segmentID;
heldObj->segment.x_velocity = obj->segment.x_velocity * 0.7;
heldObj->segment.y_velocity = obj->segment.y_velocity - 2.0;
heldObj->segment.z_velocity = obj->segment.z_velocity * 0.7;
@@ -4551,7 +4549,7 @@ void handle_racer_items(Object *obj, Object_Racer *racer, UNUSED s32 updateRate)
newObject.objectID = objID;
spawnedObj = spawn_object(&newObject, 1);
if (spawnedObj != NULL) {
spawnedObj->segment.unk3C_a.level_entry = NULL;
spawnedObj->segment.level_entry = NULL;
spawnedObj->segment.x_velocity = obj->segment.x_velocity - (racer->ox1 * velocity);
spawnedObj->segment.y_velocity = obj->segment.y_velocity - (racer->oy1 * velocity);
spawnedObj->segment.z_velocity = obj->segment.z_velocity - (racer->oz1 * velocity);
@@ -4904,7 +4902,7 @@ void drop_bananas(Object *obj, Object_Racer *racer, s32 number) {
if (get_current_level_race_type() != RACETYPE_CHALLENGE) {
bananaObj = spawn_object(&newObject, 1);
if (bananaObj != NULL) {
bananaObj->segment.unk3C_a.level_entry = NULL;
bananaObj->segment.level_entry = NULL;
banana = (Object_Banana *) bananaObj->unk64;
banana->unk9 = racer->vehicleID;
bananaObj->segment.x_velocity = racer->ox1 * 2;
@@ -4919,7 +4917,7 @@ void drop_bananas(Object *obj, Object_Racer *racer, s32 number) {
bananaObj->segment.y_velocity -= racer->oy3 * variance;
bananaObj->segment.z_velocity -= (racer->oz3 - racer->oz1) * variance;
}
bananaObj->action = 1;
bananaObj->properties.banana.unk0 = 1;
}
}
number--;
@@ -5749,7 +5747,7 @@ void racer_enter_door(Object_Racer* racer, s32 updateRate) {
if (racer->transitionTimer > 0) {
racer->transitionTimer -= updateRate;
if (racer->transitionTimer <= 0) {
func_8006D968((s8* ) racer->exitObj->segment.unk3C_a.level_entry);
func_8006D968((s8* ) racer->exitObj->segment.level_entry);
racer->transitionTimer = 0;
}
}
@@ -5891,7 +5889,7 @@ void update_AI_racer(Object *obj, Object_Racer *racer, s32 updateRate, f32 updat
racer->buoyancy = 0;
gRacerWaveCount = 0;
} else {
gRacerWaveCount = func_8002B0F4(obj->segment.unk2C.half.lower, obj->segment.trans.x_position, obj->segment.trans.z_position, &gRacerCurrentWave);
gRacerWaveCount = func_8002B0F4(obj->segment.object.segmentID, obj->segment.trans.x_position, obj->segment.trans.z_position, &gRacerCurrentWave);
}
func_8002ACC8(0);
if ((racer->approachTarget != NULL) || (gRaceStartTimer != 0) || (racer->unk204 > 0)) {
@@ -6034,8 +6032,8 @@ void update_AI_racer(Object *obj, Object_Racer *racer, s32 updateRate, f32 updat
temp = (s8 *) get_misc_asset(MISC_ASSET_UNK00);
racer->unk150->segment.trans.y_position = obj->segment.trans.y_position + temp[racer->characterId];
racer->unk150->segment.trans.z_position = obj->segment.trans.z_position;
racer->unk150->segment.trans.scale = obj->segment.unk30 / 265.0f;
if (obj->segment.unk30 < 1500.0) {
racer->unk150->segment.trans.scale = obj->segment.object.distanceToCamera / 265.0f;
if (obj->segment.object.distanceToCamera < 1500.0) {
racer->unk150->segment.trans.flags |= OBJ_FLAGS_INVISIBLE;
}
if (racer->unk150->segment.trans.scale < 1.0) {
+22 -22
View File
@@ -671,7 +671,7 @@ void spawn_skydome(s32 objectID) {
spawnObject.objectID = objectID;
gSkydomeSegment = spawn_object(&spawnObject, 2);
if (gSkydomeSegment != NULL) {
gSkydomeSegment->segment.unk3C_a.level_entry = NULL;
gSkydomeSegment->segment.level_entry = NULL;
gSkydomeSegment->unk4A = -1;
}
}
@@ -823,7 +823,7 @@ void initialise_player_viewport_vars(s32 updateRate) {
viewportID = get_current_viewport();
compute_scene_camera_transform_matrix();
update_envmap_position((f32) gScenePerspectivePos.x / 65536.0f, (f32) gScenePerspectivePos.y / 65536.0f, (f32) gScenePerspectivePos.z / 65536.0f);
segmentIndex = gSceneActiveCamera->unk34_a.levelSegmentIndex;
segmentIndex = gSceneActiveCamera->object.cameraSegmentID;
if (segmentIndex > -1 && (segmentIndex < gCurrentLevelModel->numberOfSegments)) {
gSceneStartSegment = gCurrentLevelModel->segments[segmentIndex].unk28;
} else {
@@ -835,7 +835,7 @@ void initialise_player_viewport_vars(s32 updateRate) {
if (D_8011D384 != 0) {
func_800B8B8C();
racers = get_racer_objects(&numRacers);
if (gSceneActiveCamera->unk34_a.unk36 != 7 && numRacers > 0 && !check_if_showing_cutscene_camera()) {
if (gSceneActiveCamera->object.unk36 != 7 && numRacers > 0 && !check_if_showing_cutscene_camera()) {
i = -1;
do {
i++;
@@ -919,12 +919,12 @@ void render_level_geometry_and_objects(void) {
if (objFlags & OBJ_FLAGS_UNK_0080) {
visible = 0;
} else if (!(objFlags & OBJ_FLAGS_DEACTIVATED)) {
visible = obj->segment.unk38.byte.unk39;
visible = obj->segment.object.opacity;
}
if (objFlags & visibleFlags) {
visible = 0;
}
if (obj != NULL && visible == 255 && check_if_in_draw_range(obj) && (objectsVisible[obj->segment.unk2C.half.lower + 1] || obj->segment.unk34_a.unk34 > 1000.0)) {
if (obj != NULL && visible == 255 && check_if_in_draw_range(obj) && (objectsVisible[obj->segment.object.segmentID + 1] || obj->segment.camera.unk34 > 1000.0)) {
if (obj->segment.trans.flags & OBJ_FLAGS_DEACTIVATED) {
func_80012D5C(&gSceneCurrDisplayList, &gSceneCurrMatrix, &gSceneCurrVertexList, obj);
continue;
@@ -946,7 +946,7 @@ void render_level_geometry_and_objects(void) {
} else {
visible = TRUE;
}
if (obj != NULL && visible && objFlags & OBJ_FLAGS_UNK_0100 && objectsVisible[obj->segment.unk2C.half.lower + 1] && check_if_in_draw_range(obj)) {
if (obj != NULL && visible && objFlags & OBJ_FLAGS_UNK_0100 && objectsVisible[obj->segment.object.segmentID + 1] && check_if_in_draw_range(obj)) {
if (obj->segment.trans.flags & OBJ_FLAGS_DEACTIVATED) {
func_80012D5C(&gSceneCurrDisplayList, &gSceneCurrMatrix, &gSceneCurrVertexList, obj);
continue;
@@ -982,7 +982,7 @@ void render_level_geometry_and_objects(void) {
if (objFlags & OBJ_FLAGS_UNK_0080) {
visible = TRUE;
} else if (!(objFlags & OBJ_FLAGS_DEACTIVATED)) {
visible = obj->segment.unk38.byte.unk39;
visible = obj->segment.object.opacity;
}
if (objFlags & visibleFlags) {
visible = FALSE;
@@ -990,7 +990,7 @@ void render_level_geometry_and_objects(void) {
if (obj->behaviorId == BHV_RACER && visible >= 255) {
visible = FALSE;
}
if (obj != NULL && visible < 255 && objectsVisible[obj->segment.unk2C.half.lower + 1] && check_if_in_draw_range(obj)) {
if (obj != NULL && visible < 255 && objectsVisible[obj->segment.object.segmentID + 1] && check_if_in_draw_range(obj)) {
if (visible > 0) {
if (obj->segment.trans.flags & OBJ_FLAGS_DEACTIVATED) {
func_80012D5C(&gSceneCurrDisplayList, &gSceneCurrMatrix, &gSceneCurrVertexList, obj);
@@ -1487,11 +1487,11 @@ s32 check_if_in_draw_range(Object *obj) {
switch (obj->behaviorId) {
case BHV_RACER:
obj64 = obj->unk64;
obj->segment.unk38.byte.unk39 = ((obj64->racer.transparency + 1) * alpha) >> 8;
obj->segment.object.opacity = ((obj64->racer.transparency + 1) * alpha) >> 8;
break;
case BHV_UNK_3A: //Ghost Object?
obj64 = obj->unk64;
obj->segment.unk38.byte.unk39 = obj64->racer.transparency;
obj->segment.object.opacity = obj64->racer.transparency;
break;
case BHV_ANIMATED_OBJECT: // Cutscene object?
case BHV_CAMERA_ANIMATION:
@@ -1502,14 +1502,14 @@ s32 check_if_in_draw_range(Object *obj) {
case BHV_HIT_TESTER_2: // animated objects?
case BHV_ANIMATED_OBJECT_2: // space ships
obj64 = obj->unk64;
obj->segment.unk38.byte.unk39 = obj64->effect_box.pad0[0x42];
obj->segment.object.opacity = obj64->effect_box.pad0[0x42];
break;
case BHV_PARK_WARDEN:
case BHV_GOLDEN_BALLOON:
case BHV_PARK_WARDEN_2: // GBParkwarden
break;
default:
obj->segment.unk38.byte.unk39 = alpha;
obj->segment.object.opacity = alpha;
break;
}
for (i = 0; i < 3; i++) {
@@ -1517,7 +1517,7 @@ s32 check_if_in_draw_range(Object *obj) {
z = D_8011D0F8[i].z;
w = D_8011D0F8[i].w;
y = D_8011D0F8[i].y;
accum = (x * obj->segment.trans.x_position) + (y * obj->segment.trans.y_position) + (z * obj->segment.trans.z_position) + w + obj->segment.unk34_a.unk34;
accum = (x * obj->segment.trans.x_position) + (y * obj->segment.trans.y_position) + (z * obj->segment.trans.z_position) + w + obj->segment.camera.unk34;
if (accum < 0.0f) {
return FALSE;
}
@@ -1624,12 +1624,12 @@ s32 func_8002B9BC(Object *obj, f32 *arg1, f32 *arg2, s32 arg3) {
arg2[2] = 0.0f;
arg2[1] = 1.0f;
}
if ((obj->segment.unk2C.half.lower < 0) || (obj->segment.unk2C.half.lower >= gCurrentLevelModel->numberOfSegments)) {
if ((obj->segment.object.segmentID < 0) || (obj->segment.object.segmentID >= gCurrentLevelModel->numberOfSegments)) {
return FALSE;
}
seg = &gCurrentLevelModel->segments[obj->segment.unk2C.half.lower];
seg = &gCurrentLevelModel->segments[obj->segment.object.segmentID];
if ((seg->unk2B != 0) && (D_8011D384 != 0) && (arg3 == 1)) {
*arg1 = func_800BB2F4(obj->segment.unk2C.half.lower, obj->segment.trans.x_position, obj->segment.trans.z_position, arg2);
*arg1 = func_800BB2F4(obj->segment.object.segmentID, obj->segment.trans.x_position, obj->segment.trans.z_position, arg2);
return TRUE;
} else {
*arg1 = seg->unk38;
@@ -1931,11 +1931,11 @@ void render_object_shadow(Object *obj, ShadowData *shadow) {
D_8011D348 = (unk8011D348 *) D_8011D338[D_8011B0CC];
someAlpha = D_8011D348[D_8011D360[i].unk6].unk9;
flags = RENDER_FOG_ACTIVE | RENDER_Z_COMPARE;
if (someAlpha == 0 || obj->segment.unk38.byte.unk39 == 0) {
if (someAlpha == 0 || obj->segment.object.opacity == 0) {
i = shadow->unkA;
} else if (someAlpha != 255 || obj->segment.unk38.byte.unk39 != 255) {
} else if (someAlpha != 255 || obj->segment.object.opacity != 255) {
flags = RENDER_FOG_ACTIVE | RENDER_SEMI_TRANSPARENT | RENDER_Z_COMPARE;
someAlpha = (obj->segment.unk38.byte.unk39 * someAlpha) >> 8;
someAlpha = (obj->segment.object.opacity * someAlpha) >> 8;
gDPSetPrimColor(gSceneCurrDisplayList++, 0, 0, 255, 255, 255, someAlpha);
}
while (i < shadow->unkA) {
@@ -2144,7 +2144,7 @@ void func_8002DE30(Object *obj) {
obj_yPos = obj->segment.trans.y_position;
sp94 = obj_yPos + objHeader->unk44;
sp90 = obj_yPos + objHeader->unk42;
segmentIndex = obj->segment.unk2C.half.lower;
segmentIndex = obj->segment.object.segmentID;
var_s7 = 0;
if (segmentIndex != -1) {
//func_800314DC = collision
@@ -2384,7 +2384,7 @@ void obj_loop_fogchanger(Object *obj) {
ObjectSegment *camera;
racers = NULL;
fogChanger = (LevelObjectEntry_FogChanger *) obj->segment.unk3C_a.level_entry;
fogChanger = (LevelObjectEntry_FogChanger *) obj->segment.level_entry;
camera = NULL;
if (check_if_showing_cutscene_camera()) {
@@ -2413,7 +2413,7 @@ void obj_loop_fogchanger(Object *obj) {
x -= obj->segment.trans.x_position;
z -= obj->segment.trans.z_position;
if (1) {} // Fakematch
if ((x * x) + (z * z) < obj->unk78f) {
if ((x * x) + (z * z) < obj->properties.distance.radius) {
fogNear = fogChanger->near;
fogFar = fogChanger->far;
fogR = fogChanger->r;
+17 -17
View File
@@ -81,7 +81,7 @@ void update_bluey(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *ra
set_boss_voice_clip_offset(D_800DCE00);
*buttonsPressed &= ~R_TRIG;
*input &= ~R_TRIG;
sp5E = obj->segment.unk38.byte.unk3B;
sp5E = obj->segment.object.animationID;
sp5C = obj->segment.animFrame;
sp5A = racer->headAngle;
if (racer->raceFinished == TRUE && func_80023568()) {
@@ -113,12 +113,12 @@ void update_bluey(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *ra
*startTimer = sp48;
racer->lateral_velocity = 0.0f;
racer->headAngle = sp5A;
obj->segment.unk38.byte.unk3B = (s8) sp5E;
obj->segment.object.animationID = (s8) sp5E;
obj->segment.animFrame = sp5C;
if (racer->attackType != ATTACK_NONE) {
if (obj->segment.unk38.byte.unk3B != 4) {
racer->unk1CD = obj->segment.unk38.byte.unk3B;
obj->segment.unk38.byte.unk3B = 4;
if (obj->segment.object.animationID != 4) {
racer->unk1CD = obj->segment.object.animationID;
obj->segment.object.animationID = 4;
racer->unkC = 0.0f;
func_8005CB04(1);
play_sound_global(SOUND_EXPLOSION, NULL);
@@ -137,13 +137,13 @@ void update_bluey(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *ra
if ((find_next_checkpoint_node(racer->checkpoint, racer->unk1C8))->unk36[racer->unk1CA] == 1) {
sp3C = TRUE;
}
if (obj->segment.unk38.byte.unk3B != 4) {
if (obj->segment.object.animationID != 4) {
if (racer->velocity < -2.0) {
if (sp3C) {
if (racer->unk1CD != 3) {
racer->unkC = 40.0f;
}
obj->segment.unk38.byte.unk3B = 3;
obj->segment.object.animationID = 3;
var_v0 = racer->steerAngle;
var_v0 *= 2;
var_v0 = 40 - var_v0;
@@ -157,16 +157,16 @@ void update_bluey(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *ra
racer->unkC += (var_v0 - racer->unkC) * 0.25;
} else {
racer->unk1CD = 0;
obj->segment.unk38.byte.unk3B = 0;
obj->segment.object.animationID = 0;
racer->unkC -= (racer->velocity * updateRateF) * 0.5;
}
} else if (racer->velocity < -0.1 || 0.1 < racer->velocity) {
racer->unk1CD = 1;
obj->segment.unk38.byte.unk3B = 1;
obj->segment.object.animationID = 1;
racer->unkC -= racer->velocity * updateRateF * 2;
} else {
racer->unk1CD = 2;
obj->segment.unk38.byte.unk3B = 2;
obj->segment.object.animationID = 2;
racer->unkC += updateRateF * 1.0;
}
} else {
@@ -174,7 +174,7 @@ void update_bluey(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *ra
}
obj68 = *obj->unk68;
objModel = obj68->objModel;
diffX = (objModel->animations[obj->segment.unk38.byte.unk3B].unk4 * 16) - 17;
diffX = (objModel->animations[obj->segment.object.animationID].unk4 * 16) - 17;
while (racer->unkC < 0.0f) {
racer->unkC += diffX;
obj68->unk10 = -1;
@@ -183,13 +183,13 @@ void update_bluey(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *ra
racer->unkC -= diffX;
obj68->unk10 = -1;
}
if ((obj68->unk10 == -1) && (obj->segment.unk38.byte.unk3B == 4)) {
obj->segment.unk38.byte.unk3B = racer->unk1CD;
if ((obj68->unk10 == -1) && (obj->segment.object.animationID == 4)) {
obj->segment.object.animationID = racer->unk1CD;
}
sp5C = obj->segment.animFrame;
obj->segment.animFrame = racer->unkC;
obj->unk74 = 0;
if (obj->segment.unk38.byte.unk3B == 0) {
if (obj->segment.object.animationID == 0) {
func_800113CC(obj, 2, sp5C, SOUND_STOMP2, SOUND_STOMP3);
obj->unk74 |= 3;
}
@@ -204,16 +204,16 @@ void update_bluey(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *ra
CLAMP(sp48, -0xC00, 0xC00);
racer->headAngleTarget = sp48;
}
if (obj->segment.unk38.byte.unk3B == 1) {
if (obj->segment.object.animationID == 1) {
if ((racer->miscAnimCounter & 0x1F) < 10) {
racer->headAngleTarget >>= 1;
}
}
if (obj->segment.unk38.byte.unk3B == 3) {
if (obj->segment.object.animationID == 3) {
racer->headAngleTarget = 0;
}
racer = (Object_Racer *) firstRacerObj->unk64;
if (obj == firstRacerObj->interactObj->obj && firstRacerObj->interactObj->flags & INTERACT_FLAGS_PUSHING && obj->segment.unk38.byte.unk3B == 1) {
if (obj == firstRacerObj->interactObj->obj && firstRacerObj->interactObj->flags & INTERACT_FLAGS_PUSHING && obj->segment.object.animationID == 1) {
racer->attackType = ATTACK_SQUISHED;
}
if (racer->raceFinished) {
+12 -12
View File
@@ -63,7 +63,7 @@ void update_bubbler(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *
set_boss_voice_clip_offset(D_800DCE40);
*buttonsPressed &= ~R_TRIG;
*input &= ~R_TRIG;
sp56 = obj->segment.unk38.byte.unk3B;
sp56 = obj->segment.object.animationID;
animFrame = obj->segment.animFrame;
sp52 = racer->headAngle;
if (racer->raceFinished == TRUE) {
@@ -92,11 +92,11 @@ void update_bubbler(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *
*startTimer = timer;
racer->lateral_velocity = 0.0f;
racer->headAngle = sp52;
obj->segment.unk38.byte.unk3B = sp56;
obj->segment.object.animationID = sp56;
obj->segment.animFrame = animFrame;
if (racer->attackType != ATTACK_NONE && obj->segment.unk38.byte.unk3B != 2) {
racer->unk1CD = obj->segment.unk38.byte.unk3B;
obj->segment.unk38.byte.unk3B = 2;
if (racer->attackType != ATTACK_NONE && obj->segment.object.animationID != 2) {
racer->unk1CD = obj->segment.object.animationID;
obj->segment.object.animationID = 2;
obj->segment.y_velocity += 7.5;
func_8005CB04(1);
play_sound_global(SOUND_EXPLOSION, 0);
@@ -112,8 +112,8 @@ void update_bubbler(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *
}
gfxData = *obj->unk68;
model = gfxData->objModel;
diffX = (model->animations[obj->segment.unk38.byte.unk3B].unk4 * 16) - 17;
obj->segment.unk38.byte.unk3B = 1;
diffX = (model->animations[obj->segment.object.animationID].unk4 * 16) - 17;
obj->segment.object.animationID = 1;
racer->unkC += 2.0 * updateRateF;
while (racer->unkC < 0.0f) {
racer->unkC += diffX;
@@ -123,8 +123,8 @@ void update_bubbler(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *
racer->unkC -= diffX;
gfxData->unk10 = -1;
}
if (gfxData->unk10 == -1 && obj->segment.unk38.byte.unk3B == 2) {
obj->segment.unk38.byte.unk3B = 1;
if (gfxData->unk10 == -1 && obj->segment.object.animationID == 2) {
obj->segment.object.animationID = 1;
racer->unkC = 0.0f;
}
obj->segment.animFrame = racer->unkC;
@@ -141,7 +141,7 @@ void update_bubbler(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *
obj->unk74 = 0;
func_800AFC3C(obj, updateRate);
fade_when_near_camera(obj, racer, 0x28);
switch (obj->segment.unk38.byte.unk3B) {
switch (obj->segment.object.animationID) {
case 1:
sp38 = 0x2500;
break;
@@ -161,13 +161,13 @@ void update_bubbler(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *
CLAMP(timer, -sp38, sp38);
racer->headAngleTarget = timer;
}
if (obj->segment.unk38.byte.unk3B == 1) {
if (obj->segment.object.animationID == 1) {
if ((racer->miscAnimCounter & 0x1F) < 10) {
racer->headAngleTarget >>= 1;
}
}
racer = (Object_Racer *) firstRacerObj->unk64;
if (obj == firstRacerObj->interactObj->obj && firstRacerObj->interactObj->flags & INTERACT_FLAGS_PUSHING && obj->segment.unk38.byte.unk3B == 1) {
if (obj == firstRacerObj->interactObj->obj && firstRacerObj->interactObj->flags & INTERACT_FLAGS_PUSHING && obj->segment.object.animationID == 1) {
racer->attackType = ATTACK_SQUISHED;
}
if (racer->raceFinished) {
+9 -9
View File
@@ -58,7 +58,7 @@ void update_rocket(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *r
set_boss_voice_clip_offset((u16* ) D_800DCE80);
racer->unk1EC = 0;
sp3E = obj->segment.unk38.byte.unk3B;
sp3E = obj->segment.object.animationID;
sp3C = obj->segment.animFrame;
sp3A = racer->headAngle;
if ((racer->velocity < 0.3) && (-0.3 < racer->velocity)) {
@@ -94,14 +94,14 @@ void update_rocket(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *r
*startTimer = sp2C;
obj->unk74 = 0;
racer->headAngle = sp3A;
obj->segment.unk38.byte.unk3B = sp3E;
obj->segment.object.animationID = sp3E;
obj->segment.animFrame = sp3C;
if (racer->attackType != ATTACK_NONE && obj->segment.unk38.byte.unk3B != 1) {
if (racer->attackType != ATTACK_NONE && obj->segment.object.animationID != 1) {
func_8005CB04(1);
play_sound_global(SOUND_EXPLOSION, NULL);
set_camera_shake(12.0f);
obj->segment.x_velocity *= 0.4;
obj->segment.unk38.byte.unk3B = 1;
obj->segment.object.animationID = 1;
obj->segment.z_velocity *= 0.4;
racer->unkC = 0.0f;
obj->segment.y_velocity += 4.0;
@@ -121,7 +121,7 @@ void update_rocket(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *r
racer->unkC += 2.0 * updateRateF;
gfxData = *obj->unk68;
objModel = gfxData->objModel;
diffX = (objModel->animations[obj->segment.unk38.byte.unk3B].unk4 * 16) - 17;
diffX = (objModel->animations[obj->segment.object.animationID].unk4 * 16) - 17;
while (diffX <= racer->unkC) {
racer->unkC -= diffX;
gfxData->unk10 = -1;
@@ -130,8 +130,8 @@ void update_rocket(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *r
racer->unkC += diffX;
gfxData->unk10 = -1;
}
if (obj->segment.unk38.byte.unk3B == 1 && gfxData->unk10 == -1) {
obj->segment.unk38.byte.unk3B = 0;
if (obj->segment.object.animationID == 1 && gfxData->unk10 == -1) {
obj->segment.object.animationID = 0;
racer->unkC = 0.0f;
}
obj->segment.animFrame = racer->unkC;
@@ -142,7 +142,7 @@ void update_rocket(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *r
someObj = func_8000BF44(-1);
if (someObj != NULL) {
rocket = (Object_WizpigRocket *) someObj->unk64;
someObj->unk78 = 0;
someObj->properties.racer.unk0 = 0;
if (rocket != NULL) {
rocket->unk72 += updateRate;
rocket->unk70 = 2;
@@ -153,7 +153,7 @@ void update_rocket(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *r
}
firstRacerObj = get_racer_object(0);
racer = (Object_Racer*)firstRacerObj->unk64;
if (obj == firstRacerObj->interactObj->obj && firstRacerObj->interactObj->flags & INTERACT_FLAGS_PUSHING && obj->segment.unk38.byte.unk3B == 1) {
if (obj == firstRacerObj->interactObj->obj && firstRacerObj->interactObj->flags & INTERACT_FLAGS_PUSHING && obj->segment.object.animationID == 1) {
racer->attackType = ATTACK_SQUISHED;
}
if (racer->raceFinished != 0) {

Some files were not shown because too many files have changed in this diff Show More