Files
TempleOS-Rijn/SparrowOS/Demo/Graphics/Golf.CPP
T
2018-09-08 21:45:28 +02:00

55 lines
1.0 KiB
C++

/* This demonstrates "interpolation"
which is generating frames between
frames. For interpolation to work,
your CSprite must not be bitmaps and
must be identical, except shifted
around. Cut and paste and use
"shift points."
*/
$SP,"<1>",1$
$SP,"<2>",2$
F64 t0;
U0 DrawIt(CTask *task,CDC *dc)
{
U8 *inter;
if (tP(task)-t0<1.0) {
inter=CSpriteInterpolate($IB,"<1>",1$,$IB,"<2>",2$,(tP(task)-t0)%1.0);
CSpritePlot3(dc,100,100,0,inter);
Free(inter);
} else
CSpritePlot3(dc,100,100,0,$IB,"<1>",1$);
}
U0 Golf()
{
SettingsPush; //See $LK,"SettingsPush","MN:SettingsPush"$
Fs->draw_it=&DrawIt;
DocClear;
do t0=tP;
while (PressAKey);
SettingsPop;
}
Golf;
¨6>þÿÿÿ>þÿÿÿD>üÿÿÿFèÿÿÿ>úÿÿÿ:æÿÿÿBâÿÿÿ@âÿÿÿ@âÿÿÿDÚÿÿÿDæÿÿÿD8âÿÿÿ@þÿÿÿBúÿÿÿB¨6>þÿÿÿ>þÿÿÿB>üÿÿÿFèÿÿÿ8üÿÿÿ:æÿÿÿBâÿÿÿ@âÿÿÿ@âÿÿÿDÚÿÿÿDæÿÿÿ8üÿÿÿ8âÿÿÿ@þÿÿÿ6úÿÿÿ(