Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
With the following setup:

Code:
#include "gfx/TCDAT.h"

uint8_t tempimg[40*40+2];

void keywait(void) { while (!kb_AnyKey()); return; }
void waitanykey(void) { keywait(); while (kb_AnyKey()); keywait(); }

void main(void) {
   uint8_t i;
   
   if (!TCDAT_init()) return;
   gfx_Begin();
   gfx_SetDrawBuffer();
   gfx_FillScreen(0);
   dzx7_Turbo(cardmat2_tiles_compressed[1],tempimg);
   gfx_Sprite_NoClip((gfx_sprite_t*)tempimg,0,0);
   gfx_SwapDraw();
   waitanykey();
   gfx_End();
}



Code:
#GroupC         : export_gfx
#Palette        : xlibc
#Compression    : zx7
#Tilemap        : 40,40,true
#NoPaletteArray
 cardmat2
#AppvarC        : TCDAT
#OutputInitCode : true
 cardmat2


And using this image

I am unable to correctly decompress and display any tile other than tile 0. The line that reads

Code:
   dzx7_Turbo(cardmat2_tiles_compressed[1],tempimg);
has the constant varied to test varying tiles. Using 0 displays the proper tile, using 1 shows a garbled mess, and 2 results in a colorful crash. I stopped testing at that point.

What am I doing wrong?

This is obviously a test setup. The code that this was supposed to be used in is designed to display a fullscreen image one tile at a time. Each tile is assumed 40x40 pixels for a total of 48 tiles.
You aren't doing anything wrong. This is a convpng bug. I'll fix it. In the meantime, github is a great place for posting issues like this because it really prompts developers to get things done. But here works totally fine too, thanks! Smile
Fixed and updated, along with an example in the toolchain (gfx_fullscreen_tiled_image) which demonstrates exactly what you want to do Smile

https://github.com/CE-Programming/toolchain/releases/latest
https://github.com/CE-Programming/libraries/releases/latest
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement