TempleOSCDV4.08.ISO

This commit is contained in:
Terry A. Davis authored and minexew committed 2018-09-08 21:47:25 +02:00
1 parent b632ab9a4f
commit 2d56cda5f3
258 files changed
+6973 -5476

No files matched your search

+24 -23
View File
@@ -86,11 +86,6 @@ RegExeBranch("TempleOS/Wenceslas");
CSprite *king_imgs[4]={$IB,"<2>",BI=2$,$IB,"<1>",BI=1$,$IB,"<2>",BI=2$,$IB,"<3>",BI=3$};
CSprite *peasant_imgs[4]={$IB,"<5>",BI=5$,$IB,"<4>",BI=4$,$IB,"<5>",BI=5$,$IB,"<6>",BI=6$};
#define NUM_FLAKES 0x8000
class Flake
{
U16 x,y;
} flakes[NUM_FLAKES];
#define NUM_TREES 8
class Tree
@@ -99,7 +94,10 @@ class Tree
I64 fire_frame_idx;
} trees[NUM_TREES];
I64 snow_x,snow_y;
U64 snow_x,snow_y,new_snow_mS;
#define SNOW_TILE_SIZE 128
CDC *snow_tile;
I64 king_x,king_y,king_mS,king_phase,
not_stopped_cnt;
F64 king_timeout,king_é,t0,tf,door_open_t0;
@@ -122,7 +120,7 @@ class Step
U0 DrawIt(CTask *task,CDC *dc)
{
I64 r[16],i,w=task->pix_width,h=task->pix_height;
I64 r[16],i,w=task->pix_width,h=task->pix_height,x,y;
U8 *img;
CSprite *temps;
Step *tempst;
@@ -206,10 +204,10 @@ U0 DrawIt(CTask *task,CDC *dc)
}
dc->pen_width=1;
dc->color=WHITE;
for (i=0;i<NUM_FLAKES;i++)
GrPlot(dc,(flakes[i].x+snow_x)%task->pix_width,
(flakes[i].y+snow_y)%task->pix_height);
dc->color=ROP_MONO|WHITE;
for (y=snow_y%SNOW_TILE_SIZE-SNOW_TILE_SIZE;y<=h;y+=SNOW_TILE_SIZE)
for (x=snow_x%SNOW_TILE_SIZE-SNOW_TILE_SIZE;x<=w;x+=SNOW_TILE_SIZE)
GrBlot(dc,x,y,snow_tile);
if (tf) {
dc->color=LTRED;
@@ -266,12 +264,10 @@ U0 Init()
I64 i,min_x,max_x,min_y,max_y,
w=Fs->pix_width,h=Fs->pix_height;
Peasant *tempp;
snow_x=0;
snow_y=0;
for (i=0;i<NUM_FLAKES;i++) {
flakes[i].x=RandU16;
flakes[i].y=RandU16;
}
snow_x=snow_y=0;
new_snow_mS=0;
snow_tile=DCNew(SNOW_TILE_SIZE,SNOW_TILE_SIZE);
SpriteExtents($IB,"<7>",BI=7$,&min_x,&max_x,&min_y,&max_y);
for (i=0;i<NUM_TREES;i++) {
@@ -309,6 +305,7 @@ U0 Init()
U0 CleanUp()
{
DCDel(snow_tile);
QueDel(&peasant_root,TRUE);
QueDel(&step_root,TRUE);
QueDel(&king_step_root,TRUE);
@@ -410,15 +407,19 @@ U0 AnimateTask(I64)
snow_x+=RandU16%3-1;
snow_y+=1-SignI64(RandU16&3);
if (new_snow_mS++>8) {
new_snow_mS=0;
snow_tile->color=WHITE;
GrPlot(snow_tile,RandU16&(SNOW_TILE_SIZE-1),RandU16&(SNOW_TILE_SIZE-1));
}
Sleep(1);
animate_mS++;
if (animate_mS>=250) {
if (animate_mS++>=250) {
animate_mS=0;
animate_phase=(animate_phase+1)&3;
}
if (tS<king_timeout) {
king_mS++;
if (king_mS>=250) {
if (king_mS++>=250) {
king_mS=0;
king_phase|=1;
}
@@ -550,7 +551,7 @@ Lead peasants to fires.
break;
case 0:
switch (sc.u8[0]) {
sub_switch_start:
start:
case SC_CURSOR_RIGHT:
if (king_x+KING_STEP<Fs->pix_width-BORDER)
king_x+=KING_STEP;
@@ -571,7 +572,7 @@ Lead peasants to fires.
king_y-=KING_STEP;
king_é=ã/2;
break;
sub_switch_end:
end:
king_mS=0;
king_phase=(king_phase+2)&2;
StepNew(Fs,king_x,king_y,king_é,king_phase&2,TRUE);