Fix Skybox star colors (#608)

* Fix Skybox star colors

* switch to Color_RGBA8 solution
This commit is contained in:
Archez
2024-05-30 21:56:08 -04:00
committed by GitHub
parent 74afca9bf7
commit 73c468d5cf
+8 -4
View File
@@ -3161,13 +3161,14 @@ void Environment_DrawSkyboxStarsImpl(PlayState* play, Gfx** gfxP) {
{ 0xD058, 0x4C2C, 0x3A98 }, { 0xD8F0, 0x36B0, 0x47E0 }, { 0xD954, 0x3264, 0x3E1C }, { 0xD8F0, 0x3070, 0x37DC },
{ 0xD8F0, 0x1F40, 0x5208 }, { 0xD760, 0x1838, 0x27D8 }, { 0x0000, 0x4E20, 0x4A38 }, { 0x076C, 0x2328, 0xDCD8 },
};
static const Color_RGBA8_u32 D_801DD8E0[] = {
// 2S2H [Port] Switched from Color_RGBA8_u32 to Color_RGBA8 to avoid endianenes struct union ordering issues
static const Color_RGBA8 D_801DD8E0[] = {
{ 65, 164, 255, 255 }, { 131, 164, 230, 255 }, { 98, 205, 255, 255 }, { 82, 82, 255, 255 },
{ 123, 164, 164, 255 }, { 98, 205, 255, 255 }, { 98, 164, 230, 255 }, { 255, 90, 0, 255 },
};
// 2S2H [Port] This originally had `UNALIGNED` however we don't need that for PC and it was causing warnings in the
// header file
static const Color_RGBA8_u32 D_801DD900[] = {
static const Color_RGBA8 D_801DD900[] = {
{ 64, 80, 112, 255 }, { 96, 96, 128, 255 }, { 128, 112, 144, 255 }, { 160, 128, 160, 255 },
{ 192, 144, 168, 255 }, { 224, 160, 176, 255 }, { 224, 160, 176, 255 }, { 104, 104, 136, 255 },
{ 136, 120, 152, 255 }, { 168, 136, 168, 255 }, { 200, 152, 184, 255 }, { 232, 168, 184, 255 },
@@ -3268,9 +3269,12 @@ void Environment_DrawSkyboxStarsImpl(PlayState* play, Gfx** gfxP) {
}
if ((i < 15) || ((i == 15) && ((((void)0, gSaveContext.save.day) % 7) == 0))) {
gDPSetColor(gfx++, G_SETPRIMCOLOR, D_801DD8E0[i % ARRAY_COUNTU(D_801DD8E0)].rgba);
// 2S2H [Port] Switched from gDPSetColor to gDPSetPrimColor for Color_RGBA8 individual fields
Color_RGBA8 color = D_801DD8E0[i % ARRAY_COUNTU(D_801DD8E0)];
gDPSetPrimColor(gfx++, 0, 0, color.r, color.g, color.b, color.a);
} else if (((i & 0x3F) == 0) || (i == 16)) {
gDPSetColor(gfx++, G_SETPRIMCOLOR, D_801DD900[phi_v1 % ARRAY_COUNTU(D_801DD900)].rgba);
Color_RGBA8 color = D_801DD900[phi_v1 % ARRAY_COUNTU(D_801DD900)];
gDPSetPrimColor(gfx++, 0, 0, color.r, color.g, color.b, color.a);
phi_v1++;
}