Use local mirror for cglm
All checks were successful
Build Dusk / run-tests (push) Successful in 1m26s
Build Dusk / build-linux (push) Successful in 1m33s
Build Dusk / build-psp (push) Successful in 2m8s
Build Dusk / build-dolphin (push) Successful in 2m1s

This commit is contained in:
2026-02-09 13:19:13 -06:00
parent dfed732825
commit a26e51cf46
2 changed files with 29 additions and 2 deletions

View File

@@ -7,7 +7,7 @@ include(FetchContent)
FetchContent_Declare(
cglm
GIT_REPOSITORY https://github.com/recp/cglm.git
GIT_REPOSITORY https://git.wish.moe/YourWishes/cglm.git
GIT_TAG v0.9.6
)

View File

@@ -11,6 +11,7 @@
#include "util/math.h"
#include "util/string.h"
#include "display/palette/palettelist.h"
#include "debug/debug.h"
const texture_t *TEXTURE_BOUND = NULL;
@@ -258,7 +259,7 @@ void textureInit(
);
break;
case TEXTURE_FORMAT_ALPHA:
case TEXTURE_FORMAT_ALPHA: {
assertTrue(
(width % 4) == 0 && (height % 4) == 0,
"GX_TF_I8 requires w/h multiple of 4 (or pad)"
@@ -312,6 +313,32 @@ void textureInit(
GX_ANISO_1
);
break;
}
case TEXTURE_FORMAT_PALETTE: {
// Not supported, convert to RGBA using lookup
printf("Warning: Palette textures not supported on Dolphin, converted to RGBA1\n");
color_t* formatted = memoryAllocate(width * height * sizeof(color_t));
for(int32_t i = 0; i < width * height; i++) {
uint8_t index = data.palette.data[i];
assertTrue(
index < data.palette.palette->colorCount,
"Palette index out of range"
);
formatted[i] = data.palette.palette->colors[index];
printf("Index %i: Color %02X%02X%02X%02X\n", index, formatted[i].r, formatted[i].g, formatted[i].b, formatted[i].a);
}
printf("Warning: Palette textures not supported on Dolphin, converted to RGBA2\n");
textureInit(
texture, width, height, TEXTURE_FORMAT_RGBA,
(texturedata_t){
.rgba = { .colors = formatted }
}
);
memoryFree(formatted);
break;
}
default:
assertUnreachable("Unsupported texture format for Dolphin");