1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-04 06:54:33 +00:00

En_Clear_Tag OK and documented (#689)

* Decompile and document En_Clear_Tag

* Adds a define for setting the total count of ClearTag particles.

* Fixes swap in particle effect struct member names.

Additionally, implements the DECR macro where available.
Additionally, implements the CLAMP_MIN macro.
Additionally, adds more comments inside of functions explaining how the Arwing works.

* Reformats z_en_clear_tag.c after recent fixes.

* Removes not OK DECR and CLAMP_MIN macros.

I don't know why they built locally OK for me. May have had a stale build.

* Added static to data declarations.

Additionally added white spacing between data definitions.

* Various syling fixes in EnClearTag

Fixes inconsistent usage of particle/effect. They're Effect is the better name, so I went with that.

Fixed a naming issue in CalculateFloorTangent.

Adds s prefix to all the static variables.

Renames clearTagParticlesBuffer to sClearTagEffects

Consistent capitalization in comments.

Adds more descriptive comments to function level comments that didn't say a lot already.

Renamed gameplay.particleEffects to gameplay.specialEffects.

Renames cameraNumber to cameraId.

Fixed capitalization in display list variable names.

* Always capitalize the A in arwing.

* Fixes issue with overzealous replacement of arwing -> Arwing

* Renames arwing display lists to include the g prefix.

* Renames effect seed -> random

* Removes unnecessary decrement timer comments.

* Updates Arwing comments to detail why it's important that the roll is updated to zero.

* Updates stack variable names in EnClearTag_Update to be more consistent with each other.

* Updates Arwing crashing documentation.

* Further update documentation on arwing crashing.

* Even further updates to Arwing crashing docs.

* Fixes issue of missing newline in En_Clear_Tag.xml

* targetDirection reset now has a chained assignment

* Rotation angle to hex

* Fixes rotation hex and identifies float.

* Updates arwing fire check.

* Arwing cutscene timer is multiplied by 128 rather than shifting 7

* Updates scaledCrashingTimer assignment to be more consistent.

* Updates max scale to multiply by 2

* Gives name to the work buffer indices.

Additionally, makes enum names more consistent.

* Removes unnecessary globalCtx2 in EnClearTag_CreateFlashEffect

* Runs format.sh after recent changes.

* Updated path of ClearTag assets.

* Clear tag now uses Arwing in the display list name for all effects.

* Updates work buffer to expand and contract as new enums are added.

* Uses c99 defines in my c89

* Updates the unknown 8 bytes in en_clear_tag

* review

Co-authored-by: fig02 <fig02srl@gmail.com>
This commit is contained in:
Kenix3 2021-03-29 13:14:08 -04:00 committed by GitHub
parent ed4021a6fe
commit f4499a8de2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 1114 additions and 3026 deletions

File diff suppressed because it is too large Load diff

View file

@ -6,11 +6,92 @@
struct EnClearTag;
typedef enum {
/* 0x00 */ CLEAR_TAG_CUTSCENE_ARWING = 0,
/* 0x01 */ CLEAR_TAG_ARWING = 1,
/* 0x64 */ CLEAR_TAG_LASER = 100
} ClearTagType;
typedef enum {
/* 0x00 */ CLEAR_TAG_STATE_FLYING = 0,
/* 0x01 */ CLEAR_TAG_STATE_TARGET_LOCKED = 1,
/* 0x02 */ CLEAR_TAG_STATE_DEMO = 2,
/* 0x0A */ CLEAR_TAG_STATE_CRASHING = 10,
/* 0x64 */ CLEAR_TAG_STATE_LASER = 100
} ClearTagState;
typedef enum {
/* 0x00 */ CLEAR_TAG_CUTSCENE_MODE_NONE,
/* 0x01 */ CLEAR_TAG_CUTSCENE_MODE_SETUP,
/* 0x02 */ CLEAR_TAG_CUTSCENE_MODE_PLAY
} ClearTagDemoMode;
typedef enum {
/* 0x00 */ CLEAR_TAG_DRAW_MODE_ARWING,
/* 0x01 */ CLEAR_TAG_DRAW_MODE_ALL,
/* 0x02 */ CLEAR_TAG_DRAW_MODE_EFFECT
} ClearTagDrawMode;
typedef enum {
/* 0x00 */ CLEAR_TAG_EFFECT_AVAILABLE,
/* 0x01 */ CLEAR_TAG_EFFECT_DEBRIS,
/* 0x02 */ CLEAR_TAG_EFFECT_FIRE,
/* 0x03 */ CLEAR_TAG_EFFECT_SMOKE,
/* 0x04 */ CLEAR_TAG_EFFECT_FLASH
} ClearTagEffectType;
typedef enum {
/* 0x00 */ CLEAR_TAG_TIMER_ARWING_UPDATE_STATE = 0,
/* 0x00 */ CLEAR_TAG_TIMER_LASER_DEATH = 0,
/* 0x01 */ CLEAR_TAG_TIMER_ARWING_ENTER_LOCKED_ON,
/* 0x02 */ CLEAR_TAG_TIMER_ARWING_UPDATE_BG_INFO,
/* 0x03 */ CLEAR_TAG_TIMER_COUNT
} ClearTagTimers;
typedef struct EnClearTag {
/* 0x0000 */ Actor actor;
/* 0x014C */ char unk_14C[0xB8];
/* 0x014C */ u8 shouldExplode;
/* 0x014D */ u8 drawMode;
/* 0x014E */ u8 state;
/* 0x0150 */ s16 work[CLEAR_TAG_TIMER_COUNT];
/* 0x0158 */ Vec3f targetPosition;
/* 0x0164 */ Vec3f targetDirection;
/* 0x0170 */ Vec3f acceleration;
/* 0x017C */ u8 timer;
/* 0x017D */ u8 shouldShootLaser;
/* 0x0180 */ f32 roll;
/* 0x0184 */ s16 crashingTimer;
/* 0x0186 */ s16 deathTimer;
/* 0x0188 */ Vec3f floorTangent;
/* 0x0194 */ ColliderCylinder collider;
/* 0x01E0 */ u8 cutsceneMode;
/* 0x01E2 */ s16 cameraId;
/* 0x01E4 */ Vec3f cutsceneCameraAt;
/* 0x01F0 */ Vec3f cutsceneCameraEye;
/* 0x01FC */ s16 cutsceneTimer;
/* 0x01FE */ char unk_1FE[0x06];
} EnClearTag; // size = 0x0204
typedef struct EnClearTagEffect {
/* 0x0000 */ u8 type;
/* 0x0001 */ u8 random;
/* 0x0004 */ Vec3f position;
/* 0x0010 */ Vec3f velocity;
/* 0x001C */ Vec3f acceleration;
/* 0x0028 */ Color_RGBAf primColor;
/* 0x0038 */ Color_RGBAf envColor;
/* 0x0048 */ s16 bounces;
/* 0x004A */ s16 timer;
/* 0x004C */ f32 scale;
/* 0x0050 */ f32 maxScale;
/* 0x0054 */ f32 rotationY;
/* 0x0058 */ f32 rotationX;
/* 0x005C */ f32 floorHeight;
/* 0x0060 */ Vec3f floorTangent;
} EnClearTagEffect; // size = 0x6C
#define CLEAR_TAG_EFFECT_MAX_COUNT 100
extern const ActorInit En_Clear_Tag_InitVars;
#endif