Remove THIS macro (#1756)

* Remove THIS macro

* Revert changes to the documentation

* Undo revert to STYLE.md
This commit is contained in:
Tom Overton
2024-12-13 03:34:39 -08:00
committed by GitHub
parent f6d4a8731e
commit 8efc382b9f
581 changed files with 2710 additions and 3869 deletions
+3 -5
View File
@@ -3,8 +3,6 @@
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY)
#define THIS ((EnAObj*)thisx)
void EnAObj_Init(Actor* thisx, PlayState* play);
void EnAObj_Destroy(Actor* thisx, PlayState* play);
void EnAObj_Update(Actor* thisx, PlayState* play);
@@ -50,7 +48,7 @@ static InitChainEntry sInitChain[] = {
};
void EnAObj_Init(Actor* thisx, PlayState* play) {
EnAObj* this = THIS;
EnAObj* this = (EnAObj*)thisx;
this->actor.textId = AOBJ_GET_TEXTID(&this->actor);
this->actor.params = AOBJ_GET_TYPE(&this->actor);
@@ -63,7 +61,7 @@ void EnAObj_Init(Actor* thisx, PlayState* play) {
}
void EnAObj_Destroy(Actor* thisx, PlayState* play) {
EnAObj* this = THIS;
EnAObj* this = (EnAObj*)thisx;
Collider_DestroyCylinder(play, &this->collision);
}
@@ -89,7 +87,7 @@ void EnAObj_Talk(EnAObj* this, PlayState* play) {
}
void EnAObj_Update(Actor* thisx, PlayState* play) {
EnAObj* this = THIS;
EnAObj* this = (EnAObj*)thisx;
this->actionFunc(this, play);
Actor_SetFocus(&this->actor, 45.0f);
+4 -6
View File
@@ -8,8 +8,6 @@
#define FLAGS 0x00000000
#define THIS ((EnItem00*)thisx)
void EnItem00_Init(Actor* thisx, PlayState* play);
void EnItem00_Destroy(Actor* thisx, PlayState* play);
void EnItem00_Update(Actor* thisx, PlayState* play);
@@ -74,7 +72,7 @@ void EnItem00_SetObject(EnItem00* this, PlayState* play, f32* shadowOffset, f32*
}
void EnItem00_Init(Actor* thisx, PlayState* play) {
EnItem00* this = THIS;
EnItem00* this = (EnItem00*)thisx;
s32 pad;
f32 shadowOffset = 980.0f;
f32 shadowScale = 6.0f;
@@ -312,7 +310,7 @@ void EnItem00_Init(Actor* thisx, PlayState* play) {
}
void EnItem00_Destroy(Actor* thisx, PlayState* play) {
EnItem00* this = THIS;
EnItem00* this = (EnItem00*)thisx;
Collider_DestroyCylinder(play, &this->collider);
}
@@ -489,7 +487,7 @@ void func_800A6A40(EnItem00* this, PlayState* play) {
}
void EnItem00_Update(Actor* thisx, PlayState* play) {
EnItem00* this = THIS;
EnItem00* this = (EnItem00*)thisx;
s32 pad;
Player* player = GET_PLAYER(play);
s32 sp38 = player->stateFlags3 & PLAYER_STATE3_1000;
@@ -703,7 +701,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) {
void EnItem00_Draw(Actor* thisx, PlayState* play) {
s32 pad;
EnItem00* this = THIS;
EnItem00* this = (EnItem00*)thisx;
if (!(this->unk14E & this->unk150)) {
switch (this->actor.params) {
+8 -10
View File
@@ -6,8 +6,6 @@
#include "z64math.h"
#include "z64save.h"
#define THIS ((TransitionFade*)thisx)
typedef enum TransitionFadeDirection {
/* 0 */ TRANS_FADE_DIR_IN,
/* 1 */ TRANS_FADE_DIR_OUT
@@ -37,7 +35,7 @@ TransitionProfile TransitionFade_Profile = {
};
void TransitionFade_Start(void* thisx) {
TransitionFade* this = THIS;
TransitionFade* this = (TransitionFade*)thisx;
switch (this->type) {
case TRANS_FADE_TYPE_NONE:
@@ -59,7 +57,7 @@ void TransitionFade_Start(void* thisx) {
}
void* TransitionFade_Init(void* thisx) {
TransitionFade* this = THIS;
TransitionFade* this = (TransitionFade*)thisx;
bzero(this, sizeof(TransitionFade));
return this;
@@ -71,7 +69,7 @@ void TransitionFade_Destroy(void* thisx) {
void TransitionFade_Update(void* thisx, s32 updateRate) {
s32 alpha;
s16 newAlpha;
TransitionFade* this = THIS;
TransitionFade* this = (TransitionFade*)thisx;
switch (this->type) {
case TRANS_FADE_TYPE_NONE:
@@ -79,7 +77,7 @@ void TransitionFade_Update(void* thisx, s32 updateRate) {
case TRANS_FADE_TYPE_ONE_WAY:
//! FAKE:
THIS->timer += updateRate;
((TransitionFade*)thisx)->timer += updateRate;
if (this->timer >= ((void)0, gSaveContext.transFadeDuration)) {
this->timer = ((void)0, gSaveContext.transFadeDuration);
@@ -114,7 +112,7 @@ void TransitionFade_Update(void* thisx, s32 updateRate) {
}
void TransitionFade_Draw(void* thisx, Gfx** gfxP) {
TransitionFade* this = THIS;
TransitionFade* this = (TransitionFade*)thisx;
Gfx* gfx;
Color_RGBA8_u32* color = &this->color;
@@ -128,19 +126,19 @@ void TransitionFade_Draw(void* thisx, Gfx** gfxP) {
}
s32 TransitionFade_IsDone(void* thisx) {
TransitionFade* this = THIS;
TransitionFade* this = (TransitionFade*)thisx;
return this->isDone;
}
void TransitionFade_SetColor(void* thisx, u32 color) {
TransitionFade* this = THIS;
TransitionFade* this = (TransitionFade*)thisx;
this->color.rgba = color;
}
void TransitionFade_SetType(void* thisx, s32 type) {
TransitionFade* this = THIS;
TransitionFade* this = (TransitionFade*)thisx;
if (type == TRANS_INSTANCE_TYPE_FILL_OUT) {
this->type = TRANS_FADE_TYPE_ONE_WAY;