Skip to content

Commit

Permalink
use flat_color in atlas
Browse files Browse the repository at this point in the history
  • Loading branch information
fjtrujy committed Dec 11, 2024
1 parent bded5bf commit 6506b9a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions examples/atlas/atlas.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ int main(int argc, char *argv[])

gsKit_set_clamp(gsGlobal, GS_CMODE_CLAMP);

GSPRIMUVPOINT *verts = (GSPRIMUVPOINT*)malloc(sizeof(GSPRIMUVPOINT) * totalVertices);
GSPRIMUVPOINTFLAT *verts = (GSPRIMUVPOINTFLAT*)malloc(sizeof(GSPRIMUVPOINTFLAT) * totalVertices);
for (int i = 0; i < TOTAL_RUNNERS_SCREEN; i++) {
int line = i / RUNNER_PER_LINE_SCREEN;
int col = i % RUNNER_PER_LINE_SCREEN;
Expand All @@ -92,10 +92,7 @@ int main(int argc, char *argv[])
int y1 = y0 + RUNNER_HEIGHT;

verts[i*2].xyz2 = vertex_to_XYZ2(gsGlobal, x0, y0, 0);
verts[i*2].rgbaq = color;

verts[i*2+1].xyz2 = vertex_to_XYZ2(gsGlobal, x1, y1, 0);
verts[i*2+1].rgbaq = color;
}

while(1)
Expand All @@ -108,7 +105,7 @@ int main(int argc, char *argv[])
}

gsKit_clear(gsGlobal, White);
gskit_prim_list_sprite_texture_uv_3d(gsGlobal, &atlas, totalVertices, verts);
gskit_prim_list_sprite_texture_uv_flat_color(gsGlobal, &atlas, color, totalVertices, verts);

gsKit_queue_exec(gsGlobal);
gsKit_sync_flip(gsGlobal);
Expand Down

0 comments on commit 6506b9a

Please sign in to comment.