happy Le 02/09/2001 à 14:00 g un sprite animé, donc g plusieur sprite dan mon prog kon appélera:
-anim1
-anim2
-anim3
-...
on les affiche bien sur avec une sytaxe du genre:
sprite32 (x,y,hauteur,nom du sprite, addresse memoire, mode);
au lieu de devoir refaire toute la manip pour chak sprite en changeant a chak foi le nom, je voudrai kil y ai un sprite générale d'affichage,
cad ke je fait:
sprite_general=anim1;
sprite32 (x,y,hauteur,sprite_general, addresse memoire, mode);
le pb c ke je sai pa komment déclaré le sprite_general et komment ensuite dan le prog enregistré dessu anim1
happy Le 02/09/2001 à 14:00 g essayé un truc mai c pa tré propre comme méthode mém si ca marche:
g un warning "assigement makes integer from pointer without a cast", en gro je mélange integer et pointeur a la ligne juste apré clrscr
#define OPTIMIZE_ROM_CALLS // Use ROM Call Optimization
#define SAVE_SCREEN // Save/Restore LCD Contents
#include <tigcclib.h> // Include All Header Files
short _ti89; // Produce .89Z File
unsigned long happy_stop[] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xFFF, 0xFFF, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
unsigned long happy_sprite;
// Main Function
void _main(void)
{
clrscr();
happy_sprite = happy_stop;
Sprite32 (10, 10, 32, happy_sprite, LCD_MEM, SPRT_OR);
ngetchx();
}
ya til un moyen pour eviter ce warning?
[edit]Edité par happy le 01-09-2001 à 13:19:12[/edit]
TiMad Le 02/09/2001 à 14:00 c'est simple..
tu fais un seul sprite et tu pointe sur le bon sprite..
exemple:
void DrawSprite(char numero_sprite)
{
register unsigned char* sprite=mon_srite+(numero_sprite<<5);
sprite32(x,y,32,sprite,LCD_MEM,A_NORMAL);
}
Enfin je crois... j'ai pas l'habitude d'utiliser les fonctions de tigcc...
tu devrais aller voir mon topic dans actualites.. j'ai mis des sources de routines graphiques... ca pourait t'interesser..
XLib v1.00 Powerrrrrrrrrrrrrrrrrrrr!
y a ce topic qui voulait remonter alors je me suis propose pour l'aider :]

pwet
erf c lui qui me l'a demande aussi !

pwet