CE-Programming / toolchain

Toolchain and libraries for C/C++ programming on the TI-84+ CE calculator series
https://ce-programming.github.io/toolchain/index.html
GNU Lesser General Public License v3.0
527 stars 53 forks source link

little misconfiguration in an exemple #495

Closed PurpleProg closed 1 month ago

PurpleProg commented 3 months ago

in the graphx sprite_moving example this code

   /* Set the palette for the sprites */
    gfx_SetPalette(global_palette, sizeof_global_palette, 0);
    gfx_FillScreen(1);
    gfx_SetTransparentColor(0);

    /* Draw to the offscreen buffer */
    gfx_SetDrawBuffer();

cause the background to be white, regardless of the palette. It should be something like

   /* Set the palette for the sprites */
    gfx_SetPalette(global_palette, sizeof_global_palette, 0);
    gfx_SetTransparentColor(0);

    /* Draw to the offscreen buffer */
    gfx_SetDrawBuffer();
    gfx_FillScreen(1);

the gfx_FillScreen(1) call should be make after the call to gfx_SetDrawBuffer(). I mean it's not a big deal especially cause here the index 1 is white but just for you know.