Use local mirror for cglm
This commit is contained in:
@@ -7,7 +7,7 @@ include(FetchContent)
|
|||||||
|
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
cglm
|
cglm
|
||||||
GIT_REPOSITORY https://github.com/recp/cglm.git
|
GIT_REPOSITORY https://git.wish.moe/YourWishes/cglm.git
|
||||||
GIT_TAG v0.9.6
|
GIT_TAG v0.9.6
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#include "util/math.h"
|
#include "util/math.h"
|
||||||
#include "util/string.h"
|
#include "util/string.h"
|
||||||
#include "display/palette/palettelist.h"
|
#include "display/palette/palettelist.h"
|
||||||
|
#include "debug/debug.h"
|
||||||
|
|
||||||
const texture_t *TEXTURE_BOUND = NULL;
|
const texture_t *TEXTURE_BOUND = NULL;
|
||||||
|
|
||||||
@@ -258,7 +259,7 @@ void textureInit(
|
|||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TEXTURE_FORMAT_ALPHA:
|
case TEXTURE_FORMAT_ALPHA: {
|
||||||
assertTrue(
|
assertTrue(
|
||||||
(width % 4) == 0 && (height % 4) == 0,
|
(width % 4) == 0 && (height % 4) == 0,
|
||||||
"GX_TF_I8 requires w/h multiple of 4 (or pad)"
|
"GX_TF_I8 requires w/h multiple of 4 (or pad)"
|
||||||
@@ -312,6 +313,32 @@ void textureInit(
|
|||||||
GX_ANISO_1
|
GX_ANISO_1
|
||||||
);
|
);
|
||||||
break;
|
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:
|
default:
|
||||||
assertUnreachable("Unsupported texture format for Dolphin");
|
assertUnreachable("Unsupported texture format for Dolphin");
|
||||||
|
|||||||
Reference in New Issue
Block a user