Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Skybox star colors #608

Merged
merged 2 commits into from
May 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions mm/src/code/z_kankyo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down Expand Up @@ -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++;
}

Expand Down