Files
TempleOS-Rijn/TempleOS/Demo/Graphics/SpritePlot.CPP
T
2018-09-08 21:45:37 +02:00

67 lines
20 KiB
C++

/*
Graphics can be placed into src code
files. The actual data is stored in the
file after the text area. <CTRL-R> was used
to generate the sprite. Press <CTRL-T> to
toggle to plain text mode and see
how it is encoded. You can place any text
you want in the tag quotes. The text doesn't matter,
but the num does matter. The num identifies
the sprite and can't be changed.
You make use of a sprite in a program by entering
"insert binary", $$IB$$ cmds by hand after pressing
<CTRL-T> or using <CTRL-R> and
selecting "Pointer to CSprite Data".
They behave like string constants when compiled.
That is, they are ptrs to data.
SpritePlot.CPP.Z uses the persistent graphic CDC, gr_dc2,
while the other demo's use gr_dc which must
be redrawn each update of the screen (by the
window mgr task). This demo is simpler
because you do not need a window update routine.
*/
$SP,"<1>",1$
U0 SpritePlot()
{
CDC *dc=DCAlias;
I64 i;
"$$CL$$";
for (i=0;i<GR_WIDTH>>2;i++) {
DCFill;
SpritePlot3(dc,i,GR_HEIGHT>>1,0,$IB,"<1>",1$);
Sleep(3);
}
"Image size:%d\n",$IS,"<1>",1$;
"Image type:%d\n",$IT,"<1>",1$;
DCDel(dc);
PressAKey;
DCFill;
}
SpritePlot;
/LÅÿÿÿbWelcome to TempleOS€˜ÏÿÿÿÅÿÿÿ