Fix dolphin color-less
This commit is contained in:
@@ -43,9 +43,14 @@ errorret_t meshDrawDolphin(
|
||||
|
||||
// Matches vertex format described in displaydolphin.c
|
||||
assertTrue(sizeof(color_t) == 4, "color_t must be exactly 4 bytes");
|
||||
assertTrue(offsetof(meshvertex_t, color) == 0, "color offset wrong");
|
||||
assertTrue(offsetof(meshvertex_t, uv) == 4, "uv offset wrong");
|
||||
assertTrue(offsetof(meshvertex_t, pos) == 12, "pos offset wrong");
|
||||
#if MESH_ENABLE_COLOR
|
||||
assertTrue(offsetof(meshvertex_t, color) == 0, "color offset wrong");
|
||||
assertTrue(offsetof(meshvertex_t, uv) == 4, "uv offset wrong");
|
||||
assertTrue(offsetof(meshvertex_t, pos) == 12, "pos offset wrong");
|
||||
#else
|
||||
assertTrue(offsetof(meshvertex_t, uv) == 0, "uv offset wrong");
|
||||
assertTrue(offsetof(meshvertex_t, pos) == 8, "pos offset wrong");
|
||||
#endif
|
||||
|
||||
DCFlushRange(
|
||||
(void*)&mesh->vertices[vertexOffset],
|
||||
@@ -57,7 +62,12 @@ errorret_t meshDrawDolphin(
|
||||
|
||||
const uint8_t stride = (uint8_t)sizeof(meshvertex_t);
|
||||
GX_SetArray(GX_VA_POS, (void*)&mesh->vertices[vertexOffset].pos[0], stride);
|
||||
GX_SetArray(GX_VA_CLR0, (void*)&mesh->vertices[vertexOffset].color.r, stride);
|
||||
#if MESH_ENABLE_COLOR
|
||||
GX_SetArray(
|
||||
GX_VA_CLR0,
|
||||
(void*)&mesh->vertices[vertexOffset].color.r, stride
|
||||
);
|
||||
#endif
|
||||
GX_SetArray(GX_VA_TEX0, (void*)&mesh->vertices[vertexOffset].uv[0], stride);
|
||||
|
||||
GX_InvVtxCache();
|
||||
@@ -65,7 +75,9 @@ errorret_t meshDrawDolphin(
|
||||
GX_Begin(mesh->primitiveType, GX_VTXFMT0, (uint16_t)vertexCount);
|
||||
for(uint16_t i = 0; i < (uint16_t)vertexCount; ++i) {
|
||||
GX_Position1x16(i);
|
||||
GX_Color1x16(i);
|
||||
#if MESH_ENABLE_COLOR
|
||||
GX_Color1x16(i);
|
||||
#endif
|
||||
GX_TexCoord1x16(i);
|
||||
}
|
||||
GX_End();
|
||||
|
||||
Reference in New Issue
Block a user