For the one(s ?) interested, here is some extract of a working C file with system sprite (not tested with top release of SMSQ/E but with at least a modern one for the Q40).


short zozo[]={0,10,11,9,8};

// I use four system sprites
...

// I use some macro to fill in the structure
   LISsk(0,0,&sp4_coeur,lit_quit,K_CANCEL,5)
   LISsk(4,0,&zozo[4],lit_move,K_MOVE,5)
   LISsk(3,0,&zozo[3],lit_size,K_SIZE,5)
   LISsk(1,0,&zozo[1],lit_sleep,K_SLEEP,5)
   LISsk(2,0,&zozo[2],lit_wake,K_WAKE,5)

// sp4_coeur is a classical sprite provided here to help any comparaison

And now, the smart part: the macro (previously defined, of course):

#define BASE 180
#define LISsk(x,y,t,n,k,z) \
   loose_list[n].xsize= BASE/z-4;\
   loose_list[n].ysize=10;\
   loose_list[n].xorg=x*BASE/z+2;\
   loose_list[n].yorg=y*12+1;\
   loose_list[n].xjst=0;\
   loose_list[n].yjst=0;\
   loose_list[n].type=TYP_SPRITE;\
   loose_list[n].skey=k;\
   loose_list[n].pobj=t;\
   loose_list[n].pact=&action;\
   loose_list[n].item=n;


And voilą! Hope this could help!



_______________________________________________
QL-Users Mailing List
http://www.quanta.org.uk/mailing.htm

Reply via email to