Rangi42 / tilemap-studio

A tilemap editor for Game Boy, Color, Advance, DS, and SNES projects. Written in C++ with FLTK.
https://hax.iimarckus.org/topic/7691/
Other
381 stars 30 forks source link

Import/export tilemaps in different formats #44

Closed Rangi42 closed 3 years ago

Rangi42 commented 3 years ago

Tilemap formats are binary data, and I would recommend that projects use asm INCBIN, C incbin, or xxd -i to include tilemaps in their asm or C projects. However, some GBDK users are used to a different workflow. It would thus be convenient to export tilemaps as .c files:

/* Tilemap: 20 x 18, Plain */
unsigned char filename[] = {
  0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
  0x0c, 0x0d, 0x0e, 0x0f
};

Ideally an existing .c file could be imported as well. This just has to parse enough C to handle /* comment */ unsigned char name[] = {1, 0x2, 03, ...};.

Also Telefang stores its tilemaps as .csv files, so as suggested in issue #15, these could be imported and exported. (Telefang's are Plain format, but any format would be exportable.)