1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-14 03:44:34 +00:00

Fix most compiler warnings in the boot and code segments (#674)

* Less warnings in boot & code segments

* few more warnings gone

* Ran formatter

* z_view warning gone

* -> 1

* f31 -> 31

* Remove function casts

* Few more small improvements

* Separate declaration and assignment in func_80091738 and Item_Give

Co-authored-by: Thar0 <maximilianc64@gmail.com>
This commit is contained in:
Tharo 2021-02-14 00:49:40 +00:00 committed by GitHub
parent d615ec4f31
commit f9d96d9f73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
208 changed files with 1702 additions and 1846 deletions

View file

@ -12,7 +12,11 @@ static Gfx sRCPSetupFade[] = {
gsSPEndDisplayList(),
};
void TransitionFade_Start(TransitionFade* this) {
#define THIS ((TransitionFade*)thisx)
void TransitionFade_Start(void* thisx) {
TransitionFade* this = THIS;
switch (this->fadeType) {
case 0:
break;
@ -27,17 +31,20 @@ void TransitionFade_Start(TransitionFade* this) {
this->isDone = 0;
}
TransitionFade* TransitionFade_Init(TransitionFade* this) {
void* TransitionFade_Init(void* thisx) {
TransitionFade* this = THIS;
bzero(this, sizeof(*this));
return this;
}
void TransitionFade_Destroy(TransitionFade* this) {
void TransitionFade_Destroy(void* thisx) {
}
void TransitionFade_Update(TransitionFade* this, s32 updateRate) {
void TransitionFade_Update(void* thisx, s32 updateRate) {
s32 alpha;
s16 newAlpha;
TransitionFade* this = THIS;
switch (this->fadeType) {
case 0:
@ -53,7 +60,7 @@ void TransitionFade_Update(TransitionFade* this, s32 updateRate) {
osSyncPrintf(VT_COL(RED, WHITE) "0除算! ZCommonGet fade_speed に0がはいってる" VT_RST);
}
alpha = (255.0f * this->fadeTimer) / (0, gSaveContext.fadeDuration);
alpha = (255.0f * this->fadeTimer) / ((void)0, gSaveContext.fadeDuration);
this->fadeColor.a = (this->fadeDirection != 0) ? 255 - alpha : alpha;
break;
case 2:
@ -76,11 +83,12 @@ void TransitionFade_Update(TransitionFade* this, s32 updateRate) {
}
}
void TransitionFade_Draw(TransitionFade* this, Gfx** gfxP) {
void TransitionFade_Draw(void* thisx, Gfx** gfxP) {
TransitionFade* this = THIS;
Gfx* gfx;
Color_RGBA8_u32* color;
if (this->fadeColor.a > 0) {
color = &this->fadeColor;
Color_RGBA8_u32* color = &this->fadeColor;
if (color->a > 0) {
gfx = *gfxP;
gSPDisplayList(gfx++, sRCPSetupFade);
gDPSetPrimColor(gfx++, 0, 0, color->r, color->g, color->b, color->a);
@ -90,15 +98,21 @@ void TransitionFade_Draw(TransitionFade* this, Gfx** gfxP) {
}
}
s32 TransitionFade_IsDone(TransitionFade* this) {
s32 TransitionFade_IsDone(void* thisx) {
TransitionFade* this = THIS;
return this->isDone;
}
void TransitionFade_SetColor(TransitionFade* this, u32 color) {
void TransitionFade_SetColor(void* thisx, u32 color) {
TransitionFade* this = THIS;
this->fadeColor.rgba = color;
}
void TransitionFade_SetType(TransitionFade* this, s32 type) {
void TransitionFade_SetType(void* thisx, s32 type) {
TransitionFade* this = THIS;
if (type == 1) {
this->fadeType = 1;
this->fadeDirection = 1;