mirror of
https://github.com/zeldaret/mm.git
synced 2026-09-07 11:01:38 -04:00
Remove THIS macro (#1756)
* Remove THIS macro * Revert changes to the documentation * Undo revert to STYLE.md
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user