Disable paletted textures for now

This commit is contained in:
2026-03-28 15:40:30 -05:00
parent 87d2d9123e
commit 0e794f28b1
5 changed files with 71 additions and 149 deletions
@@ -69,83 +69,6 @@ errorret_t textureInitDolphin(
break;
}
case TEXTURE_FORMAT_RGB4A3: {
assertUnreachable("RGB4A3 texture format not yet implemented");
}
case TEXTURE_FORMAT_RGB5: {
assertUnreachable("RGB5 texture format not yet implemented");
}
// assertTrue(
// (width % 4) == 0 && (height % 4) == 0,
// "RGB4A3 requires w/h multiple of 4 (or pad)"
// );
// // Convert to RGB4A3 format
// size_t rgbaSize = width * height * sizeof(u16);
// texture->rgba = (u16*)memalign(32, rgbaSize);
// assertNotNull(texture->rgba, "Failed to allocate texture RGBA data");
// for(uint32_t y = 0; y < height; ++y) {
// for(uint32_t x = 0; x < width; ++x) {
// const int src = y * width + x;
// const int tileX = x >> 2;
// const int tileY = y >> 2;
// const int tilesPerRow = width >> 2;
// const int tileIndex = tileY * tilesPerRow + tileX;
// const int tileBaseWords = tileIndex * 16;
// const int inTile = ((y & 3) << 2) + (x & 3);
// const int dest = tileBaseWords + inTile;
// color4b_t col = data.rgbaColors[src];
// u16 outCol;
// if(col.a < 255) {
// // 0AAA RRRR GGGG BBBB
// outCol = (
// (0u << 15) |
// ((u16)(col.a >> 5) << 12) |
// ((u16)(col.r >> 4) << 8) |
// ((u16)(col.g >> 4) << 4) |
// ((u16)(col.b >> 4) << 0)
// );
// } else {
// // 1RRRR RRGG GGGB BBBB
// outCol = (
// (1u << 15) |
// ((u16)(col.r >> 3) << 10) |
// ((u16)(col.g >> 3) << 5) |
// ((u16)(col.b >> 3) << 0)
// );
// }
// texture->rgba[dest] = outCol;
// }
// }
// DCFlushRange(texture->rgba, rgbaSize);
// GX_InitTexObj(
// &texture->texObj,
// texture->rgba,
// width, height,
// GX_TF_RGB5A3,
// GX_REPEAT, GX_REPEAT,
// GX_FALSE
// );
// DCFlushRange(texture->rgba, rgbaSize);
// GX_InvalidateTexAll();
// GX_InitTexObjLOD(
// &texture->texObj,
// GX_NEAR, GX_NEAR,
// 0.0f, 0.0f, 0.0f,
// GX_FALSE,
// GX_FALSE,
// GX_ANISO_1
// );
case TEXTURE_FORMAT_PALETTE: {
assertUnreachable("Paletted textures not yet implemented for Dolphin");
break;
@@ -171,18 +94,18 @@ errorret_t textureDisposeDolphin(texturedolphin_t *texture) {
break;
}
case TEXTURE_FORMAT_RGB4A3: {
assertUnreachable("RGB4A3 texture format not yet implemented");
}
// case TEXTURE_FORMAT_RGB4A3: {
// assertUnreachable("RGB4A3 texture format not yet implemented");
// }
case TEXTURE_FORMAT_RGB5: {
assertUnreachable("RGB5 texture format not yet implemented");
}
// case TEXTURE_FORMAT_RGB5: {
// assertUnreachable("RGB5 texture format not yet implemented");
// }
case TEXTURE_FORMAT_PALETTE: {
assertUnreachable("Paletted textures not yet implemented for Dolphin");
break;
}
// case TEXTURE_FORMAT_PALETTE: {
// assertUnreachable("Paletted textures not yet implemented for Dolphin");
// break;
// }
default: {
assertUnreachable("Unsupported texture format for Dolphin");
@@ -12,9 +12,9 @@ typedef union texturedata_u texturedata_t;
typedef enum {
TEXTURE_FORMAT_RGBA = GX_TF_RGBA8,
TEXTURE_FORMAT_PALETTE = GX_TF_CI8,
TEXTURE_FORMAT_RGB4A3 = GX_TF_RGB5A3,
TEXTURE_FORMAT_RGB5 = GX_TF_RGB565,
// TEXTURE_FORMAT_PALETTE = GX_TF_CI8,
// TEXTURE_FORMAT_RGB4A3 = GX_TF_RGB5A3,
// TEXTURE_FORMAT_RGB5 = GX_TF_RGB565,
} textureformatdolphin_t;
typedef struct {