Team Ai
Datasetpublic

hschumann2/TempleOS-Source-Code

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes847downloads
SpritePlot.txt63 linesDownload Raw Back to Graphics
1 2/*Sprite graphics can be placed in src code.3The binary graphic data is stored in the4file after the text area.  <CTRL-r> is used5to generate a sprite.  Press <CTRL-t> to6toggle to plain text mode and see its7text place holder $SP...$.  You can place any text8in the tag quotes or none.  The text doesn't matter,9but the BI=num does.  The num identifies10the sprite and can't be changed by you.11 12Insert a ptr to a sprite by pressing <CTRL-r>13and "Ptr to Sprite".  This creates an "Insert Bin",14$IB...$ DolDoc cmd you can see by toggling15to text with <CTRL-t>.16 17IB's behave like string consts in HolyC when18compiled.  That is, they are ptrs to data.19 20This file uses the persistent graphic21device context CDC, gr.dc, while the other22demo's use gr.dc2 which must be redrawn at2330 fps by the window mgr task.  This demo24is simpler because you do not need25a window update callback routine.26*/27 28 29 30 31 32 33 34 35 36            <1>/* Graphics Not Rendered in HTML */37 38 39 40 41 42 43 44 45 46U0 SpritePlot()47{48  CDC *dc=DCAlias;49  I64 i;50  DocClear;51  for (i=0;i<GR_WIDTH>>2;i++) {52    DCFill;53    Sprite3(dc,i,GR_HEIGHT>>1,0,<1>);54    Sleep(3);55  }56  "Image size:%d\n",<1>;57  DCDel(dc);58  PressAKey;59  DCFill;60}61 62SpritePlot;63