1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-12-27 23:36:22 +00:00

Convert Blure to use array colours (#1347)

This commit is contained in:
EllipticEllipsis 2022-08-13 14:57:58 +01:00 committed by GitHub
parent 5fc85d0eab
commit dda78f9e2c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 40 additions and 52 deletions

View file

@ -97,10 +97,10 @@ typedef struct {
/* 0x188 */ u16 flags; /* 0x188 */ u16 flags;
/* 0x18A */ s16 addAngleChange; /* 0x18A */ s16 addAngleChange;
/* 0x18C */ s16 addAngle; /* 0x18C */ s16 addAngle;
/* 0x18E */ Color_RGBA8 p1StartColor; /* 0x18E */ u8 p1StartColor[4];
/* 0x192 */ Color_RGBA8 p2StartColor; /* 0x192 */ u8 p2StartColor[4];
/* 0x196 */ Color_RGBA8 p1EndColor; /* 0x196 */ u8 p1EndColor[4];
/* 0x19A */ Color_RGBA8 p2EndColor; /* 0x19A */ u8 p2EndColor[4];
/* 0x19E */ u8 numElements; // "now_edge_num" /* 0x19E */ u8 numElements; // "now_edge_num"
/* 0x19F */ u8 elemDuration; /* 0x19F */ u8 elemDuration;
/* 0x1A0 */ u8 unkFlag; /* 0x1A0 */ u8 unkFlag;

View file

@ -115,23 +115,17 @@ void EffectBlure_Init1(void* thisx, void* initParamsx) {
EffectBlureInit1* initParams = (EffectBlureInit1*)initParamsx; EffectBlureInit1* initParams = (EffectBlureInit1*)initParamsx;
if ((this != NULL) && (initParams != NULL)) { if ((this != NULL) && (initParams != NULL)) {
s32 i;
EffectBlure_InitElements(this); EffectBlure_InitElements(this);
this->p1StartColor.r = initParams->p1StartColor[0];
this->p2StartColor.r = initParams->p2StartColor[0]; for (i = 0; i < 4; i++) {
this->p1EndColor.r = initParams->p1EndColor[0]; this->p1StartColor[i] = initParams->p1StartColor[i];
this->p2EndColor.r = initParams->p2EndColor[0]; this->p2StartColor[i] = initParams->p2StartColor[i];
this->p1StartColor.g = initParams->p1StartColor[1]; this->p1EndColor[i] = initParams->p1EndColor[i];
this->p2StartColor.g = initParams->p2StartColor[1]; this->p2EndColor[i] = initParams->p2EndColor[i];
this->p1EndColor.g = initParams->p1EndColor[1]; }
this->p2EndColor.g = initParams->p2EndColor[1];
this->p1StartColor.b = initParams->p1StartColor[2];
this->p2StartColor.b = initParams->p2StartColor[2];
this->p1EndColor.b = initParams->p1EndColor[2];
this->p2EndColor.b = initParams->p2EndColor[2];
this->p1StartColor.a = initParams->p1StartColor[3];
this->p2StartColor.a = initParams->p2StartColor[3];
this->p1EndColor.a = initParams->p1EndColor[3];
this->p2EndColor.a = initParams->p2EndColor[3];
this->elemDuration = initParams->elemDuration; this->elemDuration = initParams->elemDuration;
this->unkFlag = initParams->unkFlag; this->unkFlag = initParams->unkFlag;
this->calcMode = initParams->calcMode; this->calcMode = initParams->calcMode;
@ -156,23 +150,17 @@ void EffectBlure_Init2(void* thisx, void* initParamsx) {
EffectBlureInit2* initParams = (EffectBlureInit2*)initParamsx; EffectBlureInit2* initParams = (EffectBlureInit2*)initParamsx;
if ((this != NULL) && (initParams != NULL)) { if ((this != NULL) && (initParams != NULL)) {
s32 i;
EffectBlure_InitElements(this); EffectBlure_InitElements(this);
this->p1StartColor.r = initParams->p1StartColor[0];
this->p2StartColor.r = initParams->p2StartColor[0]; for (i = 0; i < 4; i++) {
this->p1EndColor.r = initParams->p1EndColor[0]; this->p1StartColor[i] = initParams->p1StartColor[i];
this->p2EndColor.r = initParams->p2EndColor[0]; this->p2StartColor[i] = initParams->p2StartColor[i];
this->p1StartColor.g = initParams->p1StartColor[1]; this->p1EndColor[i] = initParams->p1EndColor[i];
this->p2StartColor.g = initParams->p2StartColor[1]; this->p2EndColor[i] = initParams->p2EndColor[i];
this->p1EndColor.g = initParams->p1EndColor[1]; }
this->p2EndColor.g = initParams->p2EndColor[1];
this->p1StartColor.b = initParams->p1StartColor[2];
this->p2StartColor.b = initParams->p2StartColor[2];
this->p1EndColor.b = initParams->p1EndColor[2];
this->p2EndColor.b = initParams->p2EndColor[2];
this->p1StartColor.a = initParams->p1StartColor[3];
this->p2StartColor.a = initParams->p2StartColor[3];
this->p1EndColor.a = initParams->p1EndColor[3];
this->p2EndColor.a = initParams->p2EndColor[3];
this->elemDuration = initParams->elemDuration; this->elemDuration = initParams->elemDuration;
this->unkFlag = initParams->unkFlag; this->unkFlag = initParams->unkFlag;
this->calcMode = initParams->calcMode; this->calcMode = initParams->calcMode;
@ -368,14 +356,14 @@ void EffectBlure_GetComputedValues(EffectBlure* this, s32 index, f32 ratio, Vec3
color1->r = color1->g = color1->b = color1->a = 255; color1->r = color1->g = color1->b = color1->a = 255;
color2->r = color2->g = color2->b = color2->a = 255; color2->r = color2->g = color2->b = color2->a = 255;
} else { } else {
color1->r = func_80027E84(this->p1StartColor.r, this->p1EndColor.r, ratio); color1->r = func_80027E84(this->p1StartColor[0], this->p1EndColor[0], ratio);
color1->g = func_80027E84(this->p1StartColor.g, this->p1EndColor.g, ratio); color1->g = func_80027E84(this->p1StartColor[1], this->p1EndColor[1], ratio);
color1->b = func_80027E84(this->p1StartColor.b, this->p1EndColor.b, ratio); color1->b = func_80027E84(this->p1StartColor[2], this->p1EndColor[2], ratio);
color1->a = func_80027E84(this->p1StartColor.a, this->p1EndColor.a, ratio); color1->a = func_80027E84(this->p1StartColor[3], this->p1EndColor[3], ratio);
color2->r = func_80027E84(this->p2StartColor.r, this->p2EndColor.r, ratio); color2->r = func_80027E84(this->p2StartColor[0], this->p2EndColor[0], ratio);
color2->g = func_80027E84(this->p2StartColor.g, this->p2EndColor.g, ratio); color2->g = func_80027E84(this->p2StartColor[1], this->p2EndColor[1], ratio);
color2->b = func_80027E84(this->p2StartColor.b, this->p2EndColor.b, ratio); color2->b = func_80027E84(this->p2StartColor[2], this->p2EndColor[2], ratio);
color2->a = func_80027E84(this->p2StartColor.a, this->p2EndColor.a, ratio); color2->a = func_80027E84(this->p2StartColor[3], this->p2EndColor[3], ratio);
} }
} }
@ -1008,19 +996,19 @@ void EffectBlure_Draw(void* thisx, GraphicsContext* gfxCtx) {
vtx[j].v.flag = 0; vtx[j].v.flag = 0;
vtx[j].v.tc[0] = 0; vtx[j].v.tc[0] = 0;
vtx[j].v.tc[1] = 0; vtx[j].v.tc[1] = 0;
vtx[j].v.cn[0] = func_80027E84(this->p1StartColor.r, this->p1EndColor.r, ratio); vtx[j].v.cn[0] = func_80027E84(this->p1StartColor[0], this->p1EndColor[0], ratio);
vtx[j].v.cn[1] = func_80027E84(this->p1StartColor.g, this->p1EndColor.g, ratio); vtx[j].v.cn[1] = func_80027E84(this->p1StartColor[1], this->p1EndColor[1], ratio);
vtx[j].v.cn[2] = func_80027E84(this->p1StartColor.b, this->p1EndColor.b, ratio); vtx[j].v.cn[2] = func_80027E84(this->p1StartColor[2], this->p1EndColor[2], ratio);
vtx[j].v.cn[3] = func_80027E84(this->p1StartColor.a, this->p1EndColor.a, ratio); vtx[j].v.cn[3] = func_80027E84(this->p1StartColor[3], this->p1EndColor[3], ratio);
j++; j++;
vtx[j].v.flag = 0; vtx[j].v.flag = 0;
vtx[j].v.tc[0] = 0; vtx[j].v.tc[0] = 0;
vtx[j].v.tc[1] = 0; vtx[j].v.tc[1] = 0;
vtx[j].v.cn[0] = func_80027E84(this->p2StartColor.r, this->p2EndColor.r, ratio); vtx[j].v.cn[0] = func_80027E84(this->p2StartColor[0], this->p2EndColor[0], ratio);
vtx[j].v.cn[1] = func_80027E84(this->p2StartColor.g, this->p2EndColor.g, ratio); vtx[j].v.cn[1] = func_80027E84(this->p2StartColor[1], this->p2EndColor[1], ratio);
vtx[j].v.cn[2] = func_80027E84(this->p2StartColor.b, this->p2EndColor.b, ratio); vtx[j].v.cn[2] = func_80027E84(this->p2StartColor[2], this->p2EndColor[2], ratio);
vtx[j].v.cn[3] = func_80027E84(this->p2StartColor.a, this->p2EndColor.a, ratio); vtx[j].v.cn[3] = func_80027E84(this->p2StartColor[3], this->p2EndColor[3], ratio);
j++; j++;
} }
} }