File size: 762 Bytes
806d4b5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
#define DC_NUM 4
CDC *cafe_dc[DC_NUM];
F64 glbl_scale;
U0 DrawIt(CTask *,CDC *dc)
{
dc->flags|=DCF_TRANSFORMATION;
Mat4x4Scale(dc->r,glbl_scale);
GrBlot3(dc,0,0,0,cafe_dc[winmgr.updates%DC_NUM]);
}
U0 Init(U8 *filename,F64 scale)
{
I64 i;
glbl_scale=scale;
for (i=0;i<DC_NUM;i++)
cafe_dc[i]=BMPRead(filename,TRUE);
}
U0 CleanUp()
{
I64 i;
for (i=0;i<DC_NUM;i++)
DCDel(cafe_dc[i]);
}
U0 BMP24View(U8 *filename,F64 scale=1.0)
{
Cd(__DIR__);
if (!FileFind(filename))
throw('NotFound');
Init(filename,scale);
SettingsPush; //See SettingsPush
AutoComplete;
WinBorder;
WinMax;
DocClear;
Fs->draw_it=&DrawIt;
GetChar;
SettingsPop;
CleanUp;
}
BMP24View("Cafe.BMP.Z",0.785);
BMP24View("Elephants.BMP.Z",2.135);
|