View Single Post
Old 17th July 2004, 15:32   #209
TomyLobo
Major Dude
 
TomyLobo's Avatar
 
Join Date: Feb 2004
Location: Germany
Posts: 580
you could check playpos using gettime(-1) and see if it changed in the last frame
code:

lpos=pos;
pos=gettime(-1);
enabled=1-equal(pos,lpos);


or optimized:
code:

lpos=pos;
enabled=1-equal(lpos,assign(pos,gettime(-1)));



[edit]
even more optimized ^^
code:

enabled=1-equal(pos+0,assign(pos,gettime(-1)));


the +0 is needed so equal() wont read its first input value from pos, but from a temporary buffer

If you can't say something nice, say something surrealistic.

Last edited by TomyLobo; 17th July 2004 at 16:52.
TomyLobo is offline   Reply With Quote