website logo
Auteur
avatar
Pierro787

Forum » » Création-Développement » » Intégration de sprites et décors dans executable OS 4.1 ?


Posté : 28-05-2013 21:09 icone du post

Merci Thellier pour le code, je vais regarder ça en détail tout à l'heure.

En attendant, j'ai constaté que GIMP 2.8 avait deux possibilités de conversion d'images en code .c et en en tête .h. Ci joint le début d'une conversion d'un gif en .h, il semble que le soft génère une sortie optimisée mais un gif 256 couleurs de 19 Ko génère quand même un en tête .h de 569 ko !

Vous en pensez quoi ?



/* GIMP header image file format (INDEXED): F:\Temp\badniks.h */

static unsigned int width = 500;
static unsigned int height = 500;

/* Call this macro repeatedly. After each use, the pixel data can be extracted */

#define HEADER_PIXEL(data,pixel) {\
pixel[0] = header_data_cmap[(unsigned char)data[0]][0]; \
pixel[1] = header_data_cmap[(unsigned char)data[0]][1]; \
pixel[2] = header_data_cmap[(unsigned char)data[0]][2]; \
data ++; }

static char header_data_cmap[256][3] = {
{ 0, 0, 0},
{ 0, 0,128},
{ 64, 0, 0},
{128, 0, 0},
{ 32, 32,128},
etc...
etc...

Merci par avance pour vos infos,

Pierre
Vive l'Amiga !

Cet article provient de Le site des utilisateurs francophones actuels et futurs d'AmigaOS 4.x
https://amiga-ng.org/viewtopic.php?topic=1554&forum=14