mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-06 14:20:11 +00:00
Global Context And General Cleanup (#863)
* door context * renames * done * fix unintended change * all nb gone * more nb gone * merge fishing * fix size commentX * door changes suggested by dragorn * fix accidental semicolon * another * change all texture pointers to void* * error fix and format * Update src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c Co-authored-by: Anghelo Carvajal <anghelo.carvajal.14@sansano.usm.cl> * fix ostime * correct mistake in SkyboxContext * probably fix nonmatching * Update include/z64.h Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com> * roman's suggestions, fix incorrect type definition in z64scene.h * typo in struct * make typedef use u8 array * forgot one * pull in master and format.sh Co-authored-by: Anghelo Carvajal <anghelo.carvajal.14@sansano.usm.cl> Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com> Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>
This commit is contained in:
parent
1890e751b9
commit
7551dc2b71
105 changed files with 496 additions and 508 deletions
|
@ -35,14 +35,13 @@ u32 EffectSsBomb_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, void*
|
|||
return 1;
|
||||
}
|
||||
|
||||
static UNK_PTR sTextures[] = {
|
||||
gEffBombExplosion1Tex,
|
||||
gEffBombExplosion2Tex,
|
||||
gEffBombExplosion3Tex,
|
||||
gEffBombExplosion4Tex,
|
||||
};
|
||||
|
||||
void EffectSsBomb_Draw(GlobalContext* globalCtx, u32 index, EffectSs* this) {
|
||||
static void* explosionTextures[] = {
|
||||
gEffBombExplosion1Tex,
|
||||
gEffBombExplosion2Tex,
|
||||
gEffBombExplosion3Tex,
|
||||
gEffBombExplosion4Tex,
|
||||
};
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
MtxF mfTrans;
|
||||
MtxF mfScale;
|
||||
|
@ -70,7 +69,7 @@ void EffectSsBomb_Draw(GlobalContext* globalCtx, u32 index, EffectSs* this) {
|
|||
|
||||
if (mtx != NULL) {
|
||||
gSPMatrix(POLY_XLU_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sTextures[this->rTexIdx]));
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(explosionTextures[this->rTexIdx]));
|
||||
gDPPipeSync(POLY_XLU_DISP++);
|
||||
func_80094C50(gfxCtx);
|
||||
color = this->life * 12.75f;
|
||||
|
|
|
@ -60,7 +60,7 @@ u32 EffectSsBomb2_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, void
|
|||
|
||||
// unused in the original game. looks like EffectSsBomb but with color
|
||||
void EffectSsBomb2_DrawFade(GlobalContext* globalCtx, u32 index, EffectSs* this) {
|
||||
static UNK_PTR textures[] = {
|
||||
static void* textures[] = {
|
||||
gEffBombExplosion1Tex, gEffBombExplosion2Tex, gEffBombExplosion3Tex, gEffBombExplosion4Tex,
|
||||
gEffBombExplosion5Tex, gEffBombExplosion6Tex, gEffBombExplosion7Tex, gEffBombExplosion8Tex,
|
||||
};
|
||||
|
@ -100,7 +100,7 @@ void EffectSsBomb2_DrawFade(GlobalContext* globalCtx, u32 index, EffectSs* this)
|
|||
}
|
||||
|
||||
void EffectSsBomb2_DrawLayered(GlobalContext* globalCtx, u32 index, EffectSs* this) {
|
||||
static UNK_PTR textures[] = {
|
||||
static void* textures[] = {
|
||||
gEffBombExplosion1Tex, gEffBombExplosion2Tex, gEffBombExplosion3Tex, gEffBombExplosion4Tex,
|
||||
gEffBombExplosion5Tex, gEffBombExplosion6Tex, gEffBombExplosion7Tex, gEffBombExplosion8Tex,
|
||||
};
|
||||
|
|
|
@ -56,7 +56,7 @@ u32 EffectSsDeadDb_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, voi
|
|||
return 1;
|
||||
}
|
||||
|
||||
static UNK_PTR sTextures[] = {
|
||||
static void* sTextures[] = {
|
||||
gEffEnemyDeathFlame1Tex, gEffEnemyDeathFlame2Tex, gEffEnemyDeathFlame3Tex, gEffEnemyDeathFlame4Tex,
|
||||
gEffEnemyDeathFlame5Tex, gEffEnemyDeathFlame6Tex, gEffEnemyDeathFlame7Tex, gEffEnemyDeathFlame8Tex,
|
||||
gEffEnemyDeathFlame9Tex, gEffEnemyDeathFlame10Tex,
|
||||
|
|
|
@ -76,11 +76,10 @@ u32 EffectSsDust_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, void*
|
|||
return 1;
|
||||
}
|
||||
|
||||
static UNK_PTR sTextures[] = {
|
||||
gDust1Tex, gDust2Tex, gDust3Tex, gDust4Tex, gDust5Tex, gDust6Tex, gDust7Tex, gDust8Tex,
|
||||
};
|
||||
|
||||
void EffectSsDust_Draw(GlobalContext* globalCtx, u32 index, EffectSs* this) {
|
||||
static void* dustTextures[] = {
|
||||
gDust1Tex, gDust2Tex, gDust3Tex, gDust4Tex, gDust5Tex, gDust6Tex, gDust7Tex, gDust8Tex,
|
||||
};
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
MtxF mfTrans;
|
||||
MtxF mfScale;
|
||||
|
@ -104,7 +103,7 @@ void EffectSsDust_Draw(GlobalContext* globalCtx, u32 index, EffectSs* this) {
|
|||
if (mtx != NULL) {
|
||||
gSPMatrix(POLY_XLU_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gDPPipeSync(POLY_XLU_DISP++);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sTextures[this->rTexIdx]));
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(dustTextures[this->rTexIdx]));
|
||||
POLY_XLU_DISP = Gfx_CallSetupDL(POLY_XLU_DISP, 0);
|
||||
gDPPipeSync(POLY_XLU_DISP++);
|
||||
|
||||
|
|
|
@ -43,13 +43,13 @@ u32 EffectSsGFire_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, void
|
|||
}
|
||||
|
||||
void EffectSsGFire_Draw(GlobalContext* globalCtx, u32 index, EffectSs* this) {
|
||||
UNK_PTR textures[] = {
|
||||
void* fireFootprintTextures[] = {
|
||||
gEffFireFootprint1Tex, gEffFireFootprint2Tex, gEffFireFootprint3Tex, gEffFireFootprint4Tex,
|
||||
gEffFireFootprint5Tex, gEffFireFootprint6Tex, gEffFireFootprint7Tex, gEffFireFootprint8Tex,
|
||||
};
|
||||
s16 texIdx = (this->rgTexIdx / 100) % 7;
|
||||
|
||||
EffectSs_DrawGEffect(globalCtx, this, textures[texIdx]);
|
||||
EffectSs_DrawGEffect(globalCtx, this, fireFootprintTextures[texIdx]);
|
||||
}
|
||||
|
||||
void EffectSsGFire_Update(GlobalContext* globalCtx, u32 index, EffectSs* this) {
|
||||
|
|
|
@ -75,7 +75,7 @@ void EffectSsGRipple_DrawRipple(GlobalContext* globalCtx, EffectSs* this, UNK_PT
|
|||
|
||||
radius = this->rRadius * 0.0025f;
|
||||
|
||||
if ((this->rWaterBoxNum != -1) && (this->rWaterBoxNum < globalCtx->colCtx.colHeader->nbWaterBoxes)) {
|
||||
if ((this->rWaterBoxNum != -1) && (this->rWaterBoxNum < globalCtx->colCtx.colHeader->numWaterBoxes)) {
|
||||
yPos = (this->rWaterBoxNum + globalCtx->colCtx.colHeader->waterBoxes)->ySurface;
|
||||
} else {
|
||||
yPos = this->pos.y;
|
||||
|
|
|
@ -65,14 +65,13 @@ u32 EffectSsGSpk_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, void*
|
|||
return 1;
|
||||
}
|
||||
|
||||
static UNK_PTR sTextures[] = {
|
||||
gEffSpark1Tex,
|
||||
gEffSpark2Tex,
|
||||
gEffSpark3Tex,
|
||||
gEffSpark4Tex,
|
||||
};
|
||||
|
||||
void EffectSsGSpk_Draw(GlobalContext* globalCtx, u32 index, EffectSs* this) {
|
||||
static void* sparkTextures[] = {
|
||||
gEffSpark1Tex,
|
||||
gEffSpark2Tex,
|
||||
gEffSpark3Tex,
|
||||
gEffSpark4Tex,
|
||||
};
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
MtxF mfTrans;
|
||||
MtxF mfScale;
|
||||
|
@ -94,7 +93,7 @@ void EffectSsGSpk_Draw(GlobalContext* globalCtx, u32 index, EffectSs* this) {
|
|||
|
||||
if (mtx != NULL) {
|
||||
gSPMatrix(POLY_XLU_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sTextures[this->rTexIdx]));
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sparkTextures[this->rTexIdx]));
|
||||
func_80094BC4(gfxCtx);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, this->rPrimColorR, this->rPrimColorG, this->rPrimColorB, 255);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, this->rEnvColorR, this->rEnvColorG, this->rEnvColorB, this->rEnvColorA);
|
||||
|
|
|
@ -89,12 +89,11 @@ u32 EffectSsGSplash_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, vo
|
|||
return 1;
|
||||
}
|
||||
|
||||
static UNK_PTR sTextures[] = {
|
||||
gEffWaterSplash1Tex, gEffWaterSplash2Tex, gEffWaterSplash3Tex, gEffWaterSplash4Tex,
|
||||
gEffWaterSplash5Tex, gEffWaterSplash6Tex, gEffWaterSplash7Tex, gEffWaterSplash8Tex,
|
||||
};
|
||||
|
||||
void EffectSsGSplash_Draw(GlobalContext* globalCtx, u32 index, EffectSs* this) {
|
||||
static void* waterSplashTextures[] = {
|
||||
gEffWaterSplash1Tex, gEffWaterSplash2Tex, gEffWaterSplash3Tex, gEffWaterSplash4Tex,
|
||||
gEffWaterSplash5Tex, gEffWaterSplash6Tex, gEffWaterSplash7Tex, gEffWaterSplash8Tex,
|
||||
};
|
||||
s16 texIdx;
|
||||
|
||||
switch (this->rType) {
|
||||
|
@ -103,7 +102,7 @@ void EffectSsGSplash_Draw(GlobalContext* globalCtx, u32 index, EffectSs* this) {
|
|||
if (texIdx > 7) {
|
||||
texIdx = 7;
|
||||
}
|
||||
EffectSs_DrawGEffect(globalCtx, this, sTextures[texIdx]);
|
||||
EffectSs_DrawGEffect(globalCtx, this, waterSplashTextures[texIdx]);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
|
@ -111,7 +110,7 @@ void EffectSsGSplash_Draw(GlobalContext* globalCtx, u32 index, EffectSs* this) {
|
|||
if (texIdx > 7) {
|
||||
texIdx = 7;
|
||||
}
|
||||
EffectSs_DrawGEffect(globalCtx, this, sTextures[texIdx]);
|
||||
EffectSs_DrawGEffect(globalCtx, this, waterSplashTextures[texIdx]);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
|
@ -119,7 +118,7 @@ void EffectSsGSplash_Draw(GlobalContext* globalCtx, u32 index, EffectSs* this) {
|
|||
if (texIdx > 7) {
|
||||
texIdx = 7;
|
||||
}
|
||||
EffectSs_DrawGEffect(globalCtx, this, sTextures[texIdx]);
|
||||
EffectSs_DrawGEffect(globalCtx, this, waterSplashTextures[texIdx]);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -27,7 +27,7 @@ static Color_RGB8 sColors[] = {
|
|||
{ 255, 255, 255 }, { 0, 255, 200 }, { 255, 255, 255 }, { 150, 0, 255 },
|
||||
};
|
||||
|
||||
static UNK_PTR sTextures[] = {
|
||||
static void* sTextures[] = {
|
||||
gEffHitMark1Tex, gEffHitMark2Tex, gEffHitMark3Tex, gEffHitMark4Tex, gEffHitMark5Tex, gEffHitMark6Tex,
|
||||
gEffHitMark7Tex, gEffHitMark8Tex, gEffHitMark9Tex, gEffHitMark10Tex, gEffHitMark11Tex, gEffHitMark12Tex,
|
||||
gEffHitMark13Tex, gEffHitMark14Tex, gEffHitMark15Tex, gEffHitMark16Tex, gEffHitMark17Tex, gEffHitMark18Tex,
|
||||
|
|
|
@ -66,12 +66,11 @@ void EffectSsLightning_NewLightning(GlobalContext* globalCtx, Vec3f* pos, s16 ya
|
|||
EffectSs_Insert(globalCtx, &newLightning);
|
||||
}
|
||||
|
||||
static UNK_PTR sTextures[] = {
|
||||
gEffLightning1Tex, gEffLightning2Tex, gEffLightning3Tex, gEffLightning4Tex,
|
||||
gEffLightning5Tex, gEffLightning6Tex, gEffLightning7Tex, gEffLightning8Tex,
|
||||
};
|
||||
|
||||
void EffectSsLightning_Draw(GlobalContext* globalCtx, u32 index, EffectSs* this) {
|
||||
static void* lightningTextures[] = {
|
||||
gEffLightning1Tex, gEffLightning2Tex, gEffLightning3Tex, gEffLightning4Tex,
|
||||
gEffLightning5Tex, gEffLightning6Tex, gEffLightning7Tex, gEffLightning8Tex,
|
||||
};
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
MtxF mfResult;
|
||||
MtxF mfTrans;
|
||||
|
@ -108,7 +107,7 @@ void EffectSsLightning_Draw(GlobalContext* globalCtx, u32 index, EffectSs* this)
|
|||
if (mtx != NULL) {
|
||||
gSPMatrix(POLY_XLU_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
func_80094C50(gfxCtx);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sTextures[texIdx]));
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(lightningTextures[texIdx]));
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, this->rPrimColorR, this->rPrimColorG, this->rPrimColorB,
|
||||
this->rPrimColorA);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, this->rEnvColorR, this->rEnvColorG, this->rEnvColorB, this->rEnvColorA);
|
||||
|
|
|
@ -50,12 +50,12 @@ u32 EffectSsSibuki2_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, vo
|
|||
return 1;
|
||||
}
|
||||
|
||||
static UNK_PTR sTextures[] = {
|
||||
gEffUnusedBubbles1Tex, gEffUnusedBubbles1Tex, gEffUnusedBubbles2Tex, gEffUnusedBubbles3Tex, gEffUnusedBubbles4Tex,
|
||||
gEffUnusedBubbles5Tex, gEffUnusedBubbles6Tex, gEffUnusedBubbles7Tex, gEffUnusedBubbles8Tex,
|
||||
};
|
||||
|
||||
void EffectSsSibuki2_Draw(GlobalContext* globalCtx, u32 index, EffectSs* this) {
|
||||
static void* bubbleTextures[] = {
|
||||
gEffUnusedBubbles1Tex, gEffUnusedBubbles1Tex, gEffUnusedBubbles2Tex,
|
||||
gEffUnusedBubbles3Tex, gEffUnusedBubbles4Tex, gEffUnusedBubbles5Tex,
|
||||
gEffUnusedBubbles6Tex, gEffUnusedBubbles7Tex, gEffUnusedBubbles8Tex,
|
||||
};
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
f32 scale = this->rScale / 100.0f;
|
||||
|
||||
|
@ -68,7 +68,7 @@ void EffectSsSibuki2_Draw(GlobalContext* globalCtx, u32 index, EffectSs* this) {
|
|||
func_80093D18(gfxCtx);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, this->rPrimColorR, this->rPrimColorG, this->rPrimColorB, this->rPrimColorA);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, this->rEnvColorR, this->rEnvColorG, this->rEnvColorB, this->rEnvColorA);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sTextures[this->rTexIdx]));
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(bubbleTextures[this->rTexIdx]));
|
||||
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gEffUnusedBubblesDL));
|
||||
|
||||
CLOSE_DISPS(gfxCtx, "../z_eff_ss_sibuki2.c", 198);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue