1
0
mirror of https://github.com/zeldaret/oot.git synced 2024-09-21 04:24:43 +00:00

Match retail effects files in code (#1690)

* Match code effects files

* Poke jenkins
This commit is contained in:
cadmic 2024-02-02 08:45:50 -08:00 committed by GitHub
parent 3be307bf35
commit 8f481b648d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 28 additions and 24 deletions

View File

@ -4,16 +4,10 @@
void EffectBlure_AddVertex(EffectBlure* this, Vec3f* p1, Vec3f* p2) {
EffectBlureElement* elem;
s32 numElements;
Vec3f sp16C;
Vec3f sp160;
Vec3f sp154;
f32 scale;
MtxF sp110;
MtxF spD0;
MtxF sp90;
MtxF sp50;
Vec3f sp44;
Vec3f sp38;
// Necessary to match
if (this) {}
if (this) {}
if (this != NULL) {
numElements = this->numElements;
@ -34,6 +28,17 @@ void EffectBlure_AddVertex(EffectBlure* this, Vec3f* p1, Vec3f* p2) {
elem->p2.y = p2->y;
elem->p2.z = p2->z;
} else {
Vec3f sp16C;
Vec3f sp160;
Vec3f sp154;
f32 scale;
MtxF sp110;
MtxF spD0;
MtxF sp90;
MtxF sp50;
Vec3f sp44;
Vec3f sp38;
sp16C.x = ((f32)(elem - 1)->p2.x + (f32)(elem - 1)->p1.x) * 0.5f;
sp16C.y = ((f32)(elem - 1)->p2.y + (f32)(elem - 1)->p1.y) * 0.5f;
sp16C.z = ((f32)(elem - 1)->p2.z + (f32)(elem - 1)->p1.z) * 0.5f;
@ -255,19 +260,16 @@ void EffectBlure_UpdateFlags(EffectBlureElement* elem) {
Vec3f sp58;
Vec3f sp4C;
Vec3f sp40;
EffectBlureElement* prev = elem - 1;
EffectBlureElement* next = elem + 1;
f32 sp34;
f32 sp30;
f32 sp2C;
if (((elem - 1)->state == 0) || ((elem + 1)->state == 0)) {
elem->flags &= ~3;
elem->flags |= 2;
} else {
EffectBlureElement* prev = elem - 1;
EffectBlureElement* next = elem + 1;
f32 sp34;
f32 sp30;
f32 sp2C;
if (1) {} // Necessary to match
Math_Vec3s_DiffToVec3f(&sp64, &elem->p1, &prev->p1);
Math_Vec3s_DiffToVec3f(&sp58, &elem->p2, &prev->p2);
Math_Vec3s_DiffToVec3f(&sp4C, &next->p1, &elem->p1);
@ -1013,11 +1015,11 @@ void EffectBlure_Draw(void* thisx, GraphicsContext* gfxCtx) {
}
}
flag = 0;
j = 0;
gSPVertex(POLY_XLU_DISP++, vtx, 32, 0);
flag = 0;
for (i = 0; i < this->numElements; i++) {
elem = &this->elements[i];

View File

@ -114,7 +114,6 @@ s32 EffectShieldParticle_Update(void* thisx) {
void EffectShieldParticle_GetColors(EffectShieldParticle* this, Color_RGBA8* primColor, Color_RGBA8* envColor) {
s32 halfDuration = this->duration * 0.5f;
f32 ratio;
if (halfDuration == 0) {
primColor->r = this->primColorStart.r;
@ -126,7 +125,8 @@ void EffectShieldParticle_GetColors(EffectShieldParticle* this, Color_RGBA8* pri
envColor->b = this->envColorStart.b;
envColor->a = this->envColorStart.a;
} else if (this->timer < halfDuration) {
ratio = this->timer / (f32)halfDuration;
f32 ratio = this->timer / (f32)halfDuration;
primColor->r = this->primColorStart.r + (this->primColorMid.r - this->primColorStart.r) * ratio;
primColor->g = this->primColorStart.g + (this->primColorMid.g - this->primColorStart.g) * ratio;
primColor->b = this->primColorStart.b + (this->primColorMid.b - this->primColorStart.b) * ratio;
@ -136,7 +136,8 @@ void EffectShieldParticle_GetColors(EffectShieldParticle* this, Color_RGBA8* pri
envColor->b = this->envColorStart.b + (this->envColorMid.b - this->envColorStart.b) * ratio;
envColor->a = this->envColorStart.a + (this->envColorMid.a - this->envColorStart.a) * ratio;
} else {
ratio = (this->timer - halfDuration) / (f32)halfDuration;
f32 ratio = (this->timer - halfDuration) / (f32)halfDuration;
primColor->r = this->primColorMid.r + (this->primColorEnd.r - this->primColorMid.r) * ratio;
primColor->g = this->primColorMid.g + (this->primColorEnd.g - this->primColorMid.g) * ratio;
primColor->b = this->primColorMid.b + (this->primColorEnd.b - this->primColorMid.b) * ratio;

View File

@ -5,7 +5,6 @@
void EffectSpark_Init(void* thisx, void* initParamsx) {
EffectSpark* this = (EffectSpark*)thisx;
EffectSparkInit* initParams = (EffectSparkInit*)initParamsx;
EffectSparkElement* elem;
f32 velocityNorm;
s32 i;
@ -61,7 +60,7 @@ void EffectSpark_Init(void* thisx, void* initParamsx) {
}
for (i = 0; i < this->numElements; i++) {
elem = &this->elements[i];
EffectSparkElement* elem = &this->elements[i];
elem->position.x = this->position.x;
elem->position.y = this->position.y;

View File

@ -8,11 +8,13 @@ void EffectSs_InitInfo(PlayState* play, s32 tableSize) {
EffectSs* effectSs;
EffectSsOverlay* overlay;
#if OOT_DEBUG
for (i = 0; i < ARRAY_COUNT(gEffectSsOverlayTable); i++) {
overlay = &gEffectSsOverlayTable[i];
PRINTF("effect index %3d:size=%6dbyte romsize=%6dbyte\n", i,
(uintptr_t)overlay->vramEnd - (uintptr_t)overlay->vramStart, overlay->vromEnd - overlay->vromStart);
}
#endif
sEffectSsInfo.table =
GAME_STATE_ALLOC(&play->state, tableSize * sizeof(EffectSs), "../z_effect_soft_sprite.c", 289);