TempleOSCD_140715.ISO
This commit is contained in:
1 parent
7ef616a20e
commit
64f679eeb9
1095 files changed
+24814
-221011
No files matched your search
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,5 +1,4 @@
|
||||
//This uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.CPP"$.
|
||||
|
||||
//Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.CPP"$.
|
||||
|
||||
AcctRegSetDftEntry("TempleOS/CastleFrankenstein","F64 best_score=9999;\n");
|
||||
AcctRegExeBranch("TempleOS/CastleFrankenstein");
|
||||
@@ -27,10 +26,8 @@ $SP,"<1>",BI=1$
|
||||
|
||||
|
||||
|
||||
|
||||
#define MONSTER_SCALE 2.0
|
||||
|
||||
|
||||
$SP,"<2>",BI=2$
|
||||
|
||||
|
||||
@@ -78,7 +75,6 @@ $SP,"<1>",BI=1$
|
||||
|
||||
|
||||
|
||||
|
||||
$SP,"<6>",BI=6$
|
||||
|
||||
|
||||
@@ -87,8 +83,6 @@ $SP,"<1>",BI=1$
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define SCREEN_SCALE 512
|
||||
#define PLOT_GRID_WIDTH 24
|
||||
#define PLOT_GRID_HEIGHT 24
|
||||
@@ -104,7 +98,7 @@ F64 man_
|
||||
|
||||
F64 t0,tf;
|
||||
|
||||
#define NUM_MONSTERS 16
|
||||
#define NUM_MONSTERS 10
|
||||
I64 monsters_left;
|
||||
class Monster
|
||||
{
|
||||
@@ -136,7 +130,7 @@ Bool LOSPlot(U8 *,I64 x,I64 y,I64)
|
||||
}
|
||||
|
||||
Bool LOS(I64 x1,I64 y1,I64 x2,I64 y2)
|
||||
{ //Line of sight
|
||||
{//Line of sight
|
||||
return Line(NULL,x1*LOS_SCALE/SCREEN_SCALE,y1*LOS_SCALE/SCREEN_SCALE,0,
|
||||
x2*LOS_SCALE/SCREEN_SCALE,y2*LOS_SCALE/SCREEN_SCALE,0,&LOSPlot);
|
||||
}
|
||||
@@ -357,7 +351,6 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
dc->color=LTCYAN;
|
||||
GrPlot3(dc,2*(man_xx/SCREEN_SCALE),2*(map_height-1-man_yy/SCREEN_SCALE),0);
|
||||
|
||||
|
||||
if (tf) {
|
||||
dc->color=LTRED;
|
||||
if (Blink)
|
||||
@@ -401,14 +394,13 @@ U0 Fire()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
U0 Init()
|
||||
{
|
||||
I64 i,x,y;
|
||||
I64 min_map_x,max_map_x,min_map_y,max_map_y;
|
||||
CDC *dc;
|
||||
DocClear;
|
||||
"$$BG,BLACK$$"; NewLine(TEXT_ROWS/2);
|
||||
"$$BG,BLACK$$%h*c",TEXT_ROWS/2,'\n';
|
||||
|
||||
SpriteExtents($IB,"<1>",BI=1$,&min_map_x,&max_map_x,&min_map_y,&max_map_y);
|
||||
map_width =(max_map_x-min_map_x+1)/MAP_SCALE+2;
|
||||
@@ -482,7 +474,7 @@ U0 CleanUp()
|
||||
}
|
||||
|
||||
U0 SongTask(I64)
|
||||
{ //Song by Terry A. Davis
|
||||
{//Song by Terry A. Davis
|
||||
Fs->task_end_cb=&SndTaskEndCB;
|
||||
MusicSettingsRst;
|
||||
while (TRUE) {
|
||||
@@ -531,7 +523,7 @@ U0 CastleFrankenstein()
|
||||
"Play {"
|
||||
" Restart(,'\n');"
|
||||
" Fwd(,,SC_CURSOR_UP);"
|
||||
" Backward(,,SC_CURSOR_DOWN);"
|
||||
" Bwd(,,SC_CURSOR_DOWN);"
|
||||
" Left(,,SC_CURSOR_LEFT);"
|
||||
" Right(,,SC_CURSOR_RIGHT);"
|
||||
" Fire(,CH_SPACE);"
|
||||
|
||||
Binary file not shown.
+18
-21
@@ -2,7 +2,6 @@
|
||||
|
||||
//Giotto, a famous artist, drew a freehand circle as a portfolio for a job.
|
||||
|
||||
|
||||
AcctRegSetDftEntry("TempleOS/CircleTrace","F64 best_score=999;\n");
|
||||
AcctRegExeBranch("TempleOS/CircleTrace");
|
||||
|
||||
@@ -17,11 +16,9 @@ U0 SongTask(I64)
|
||||
Play("hEDCARCDECR");
|
||||
}
|
||||
|
||||
U0 DrawIt(CTask *task,CDC *)
|
||||
U0 DrawIt(CTask *task,CDC *dc)
|
||||
{
|
||||
U8 buf[128];
|
||||
SPrint(buf,"Error:%6.3f Time:%6.3f Score:%6.3f Best:%8.3f",avg_error,elapsed_time,score,best_score);
|
||||
PlotWinStr(task,buf,BLACK<<4+WHITE,0,0);
|
||||
GrPrint(dc,0,0,"Error:%6.3f Time:%6.3f Score:%6.3f Best:%8.3f",avg_error,elapsed_time,score,best_score);
|
||||
}
|
||||
|
||||
#define CIRCLE_RADIUS 100
|
||||
@@ -37,7 +34,7 @@ Bool CTPlot(CDC *dc,I64 x,I64 y,I64)
|
||||
|
||||
U0 CircleTrace()
|
||||
{
|
||||
I64 msg_code,p1,p2,x1,y1;
|
||||
I64 msg_code,a1,a2,x1,y1;
|
||||
F64 rad,t0,total_distance;
|
||||
CDC *dc=DCAlias;
|
||||
|
||||
@@ -48,40 +45,40 @@ U0 CircleTrace()
|
||||
cx=Fs->pix_width/2;
|
||||
cy=Fs->pix_height/2;
|
||||
|
||||
Fs->win_inhibit=WIG_TASK_DFT-WIF_FOCUS-WIF_BORDER;
|
||||
Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_FOCUS-WIF_SELF_BORDER;
|
||||
DocCursor;
|
||||
DocClear;
|
||||
Fs->draw_it=&DrawIt;
|
||||
|
||||
DCFill;
|
||||
dc->color=ROP_XOR+BLACK^COLOR_TRANSPARENT;
|
||||
dc->color=ROP_XOR+BLACK^TRANSPARENT;
|
||||
GrCircle(dc,cx,cy,CIRCLE_RADIUS);
|
||||
do {
|
||||
msg_code=GetMsg(&p1,&p2,
|
||||
msg_code=GetMsg(&a1,&a2,
|
||||
1<<MSG_KEY_DOWN+1<<MSG_IP_L_DOWN);
|
||||
switch (msg_code) {
|
||||
case MSG_KEY_UP:
|
||||
break;
|
||||
case MSG_IP_L_DOWN:
|
||||
DCFill;
|
||||
dc->color=ROP_XOR+BLACK^COLOR_TRANSPARENT;
|
||||
dc->color=ROP_XOR+BLACK^TRANSPARENT;
|
||||
GrCircle(dc,cx,cy,CIRCLE_RADIUS);
|
||||
dc->color=ROP_XOR+RED^COLOR_TRANSPARENT;
|
||||
dc->color=ROP_XOR+RED^TRANSPARENT;
|
||||
t0=tS;
|
||||
total_distance=0.001;
|
||||
total_error=0;
|
||||
x1=p1; y1=p2;
|
||||
x1=a1; y1=a2;
|
||||
do {
|
||||
msg_code=ScanMsg(&p1,&p2,
|
||||
msg_code=ScanMsg(&a1,&a2,
|
||||
1<<MSG_IP_L_UP+1<<MSG_IP_MOVE);
|
||||
switch (msg_code) {
|
||||
case MSG_IP_L_UP:
|
||||
break;
|
||||
case MSG_IP_MOVE:
|
||||
if (x1!=p1 || y1!=p2) {
|
||||
total_distance+=Sqrt(Sqr(x1-p1)+Sqr(y1-p2));
|
||||
Line(dc,x1,y1,0,p1,p2,0,&CTPlot);
|
||||
x1=p1;y1=p2;
|
||||
if (x1!=a1 || y1!=a2) {
|
||||
total_distance+=Sqrt(Sqr(x1-a1)+Sqr(y1-a2));
|
||||
Line(dc,x1,y1,0,a1,a2,0,&CTPlot);
|
||||
x1=a1;y1=a2;
|
||||
//undo overlapping pixs on segments
|
||||
GrPlot(dc,x1,y1);
|
||||
rad=Sqrt(Sqr(x1-cx)+Sqr(y1-cy));
|
||||
@@ -93,7 +90,7 @@ U0 CircleTrace()
|
||||
avg_error=total_error/total_distance;
|
||||
score=elapsed_time*avg_error;
|
||||
|
||||
//This $LK,"Sleep",A="MN:Sleep"$()s until the next time the
|
||||
//$LK,"Sleep",A="MN:Sleep"$()s until the next time the
|
||||
//window mgr task runs. The
|
||||
//window mgr calls the UpdateWin() routine
|
||||
//and places msgs in the que, so there's
|
||||
@@ -101,7 +98,7 @@ U0 CircleTrace()
|
||||
WinMgrSync;
|
||||
|
||||
} while (msg_code!=MSG_IP_L_UP);
|
||||
music_mute=TRUE; Sleep(200);
|
||||
music.mute=TRUE; Sleep(200);
|
||||
if (total_distance>0.95*CIRCUMFERENCE) {
|
||||
if (score<best_score) {
|
||||
Snd(2000);Sleep(50);Snd(0);Sleep(50);
|
||||
@@ -114,10 +111,10 @@ U0 CircleTrace()
|
||||
} else {
|
||||
Snd(100);Sleep(1000);
|
||||
}
|
||||
Snd(0); Sleep(200); music_mute=FALSE;
|
||||
Snd(0); Sleep(200); music.mute=FALSE;
|
||||
break;
|
||||
}
|
||||
} while (msg_code!=MSG_KEY_DOWN || p1!=CH_SHIFT_ESC && p1!=CH_ESC);
|
||||
} while (msg_code!=MSG_KEY_DOWN || a1!=CH_SHIFT_ESC && a1!=CH_ESC);
|
||||
GetMsg(,,1<<MSG_KEY_UP);
|
||||
SettingsPop;
|
||||
DCFill;
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -17,7 +17,7 @@ U0 PrintPattern(U8 *st)
|
||||
I64 ch;
|
||||
while (ch=*st++)
|
||||
PrintDigit(ch);
|
||||
NewLine;
|
||||
'\n';
|
||||
}
|
||||
|
||||
U0 Digits()
|
||||
@@ -30,7 +30,7 @@ U0 Digits()
|
||||
DocClear;
|
||||
//Set default background and foreground
|
||||
"$$WW,1$$$$BD,DKGRAY$$$$FD,WHITE$$"
|
||||
"\nThis is a mem game. "
|
||||
"\nThis is a memory game. "
|
||||
"Try to remember the digits and enter them. "
|
||||
"They are colored based on electrical "
|
||||
"engineering color codes.\n";
|
||||
|
||||
+45
-29
@@ -1,3 +1,6 @@
|
||||
AcctRegSetDftEntry("TempleOS/DunGen","F64 best_score=9999;\n");
|
||||
AcctRegExeBranch("TempleOS/DunGen");
|
||||
|
||||
//Set snap to 4 and width to 4
|
||||
//if you edit this map.
|
||||
|
||||
@@ -20,26 +23,19 @@ $SP,"<2>",BI=2$
|
||||
|
||||
|
||||
$SP,"<3>",BI=3$
|
||||
|
||||
|
||||
$SP,"<4>",BI=4$ //This is a template you can copy and use to make a tile.
|
||||
|
||||
|
||||
|
||||
|
||||
$SP,"<5>",BI=5$
|
||||
|
||||
|
||||
$SP,"<6>",BI=6$
|
||||
|
||||
|
||||
$SP,"<7>",BI=7$
|
||||
|
||||
|
||||
$SP,"<8>",BI=8$
|
||||
|
||||
|
||||
|
||||
|
||||
$SP,"<9>",BI=9$
|
||||
|
||||
@@ -48,10 +44,7 @@ $SP,"<10>",BI=10$
|
||||
$SP,"<11>",BI=11$
|
||||
|
||||
|
||||
|
||||
$BG$
|
||||
|
||||
//These are indexed by color #.
|
||||
$BG$//These are indexed by color #.
|
||||
//See $LK,"COLORS",A="MN:RED"$.
|
||||
|
||||
U8 *tiles1[16]=
|
||||
@@ -66,8 +59,6 @@ U8 *tiles2[16]=
|
||||
NULL,NULL,NULL,NULL,
|
||||
NULL,NULL,NULL,NULL};
|
||||
|
||||
|
||||
|
||||
#define SCREEN_SCALE 24
|
||||
#define SCREEN_WIDTH 24
|
||||
#define SCREEN_HEIGHT 24
|
||||
@@ -81,13 +72,16 @@ I64 man_x,man_y,man_dx,man_dy;
|
||||
Bool man_attack;
|
||||
F64 man_attack_t0;
|
||||
|
||||
#define NUM_MONSTERS 16
|
||||
#define NUM_MONSTERS 10
|
||||
I64 monsters_left;
|
||||
class Monster
|
||||
{
|
||||
I64 x,y,dx,dy;
|
||||
Bool dead,pad[7];
|
||||
} monsters[NUM_MONSTERS];
|
||||
|
||||
F64 t0,tf;
|
||||
|
||||
#define LOS_SCALE 4
|
||||
|
||||
Bool LOSPlot(U8 *,I64 x,I64 y,I64)
|
||||
@@ -99,17 +93,20 @@ Bool LOSPlot(U8 *,I64 x,I64 y,I64)
|
||||
}
|
||||
|
||||
Bool LOS(I64 x1,I64 y1,I64 x2,I64 y2)
|
||||
{ //Line of sight
|
||||
{//Line of sight
|
||||
return Line(NULL,x1*LOS_SCALE+LOS_SCALE/2,y1*LOS_SCALE+LOS_SCALE/2,0,
|
||||
x2*LOS_SCALE+LOS_SCALE/2,y2*LOS_SCALE+LOS_SCALE/2,0,&LOSPlot);
|
||||
}
|
||||
|
||||
U0 DrawIt(CTask *task,CDC *dc)
|
||||
{
|
||||
CDC *dc_t=DCAlias(gr_dc2,task);
|
||||
I64 i,x,y,xx,yy,x1,y1,z1,color;
|
||||
CDC *dc_t=DCAlias(gr.dc2,task);
|
||||
I64 i,x,y,xx,yy,x1,y1,z1,color,
|
||||
cx=task->pix_width/2,
|
||||
cy=task->pix_height/2;
|
||||
CD3I32 poly[4];
|
||||
U8 **_tiles;
|
||||
F64 tt;
|
||||
|
||||
if (Blink(5))
|
||||
_tiles=tiles1;
|
||||
@@ -141,7 +138,7 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
z1=0;
|
||||
GrTransform(dc_t,&x1,&y1,&z1);
|
||||
Sprite3(dc,x1,y1,z1,_tiles[color]);
|
||||
} else { //If no tile defined, do solid color.
|
||||
} else {//If no tile defined, do solid color.
|
||||
poly[0].x=x*SCREEN_SCALE;
|
||||
poly[0].y=y*SCREEN_SCALE;
|
||||
poly[0].z=0;
|
||||
@@ -228,8 +225,18 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
Sprite3(dc,x1,y1,z1,$IB,"<2>",BI=2$);
|
||||
|
||||
DCDel(dc_t);
|
||||
}
|
||||
|
||||
if (tf) {
|
||||
dc->color=LTRED;
|
||||
if (Blink)
|
||||
GrPrint(dc,cx-(FONT_WIDTH*14)/2,cy-FONT_HEIGHT/2,"Game Completed");
|
||||
tt=tf;
|
||||
} else {
|
||||
dc->color=LTGREEN;
|
||||
tt=tS;
|
||||
}
|
||||
GrPrint(dc,0,0,"Enemy:%d Time:%3.2f Best:%3.2f",monsters_left,tt-t0,best_score);
|
||||
}
|
||||
|
||||
U0 Attack()
|
||||
{
|
||||
@@ -238,12 +245,17 @@ U0 Attack()
|
||||
Noise(100,300,1000);
|
||||
for (i=0;i<NUM_MONSTERS;i++) {
|
||||
if (!monsters[i].dead &&
|
||||
man_x+man_dx==monsters[i].x && man_y+man_dy==monsters[i].y)
|
||||
man_x+man_dx==monsters[i].x && man_y+man_dy==monsters[i].y) {
|
||||
monsters[i].dead=TRUE;
|
||||
if (!--monsters_left) {
|
||||
tf=tS;
|
||||
if (tf-t0<best_score)
|
||||
best_score=tf-t0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
U0 Init()
|
||||
{
|
||||
I64 i,x,y,minx,maxx,miny,maxy;
|
||||
@@ -260,6 +272,14 @@ U0 Init()
|
||||
map[y*map_width+x]=GrPeek(dc,x*MAP_SCALE,y*MAP_SCALE);
|
||||
DCDel(dc);
|
||||
|
||||
man_attack_t0=tS;
|
||||
man_attack=FALSE;
|
||||
man_x=0;
|
||||
man_y=4;
|
||||
man_dx=0;
|
||||
man_dy=0;
|
||||
screen_x=0;
|
||||
screen_y=0;
|
||||
for (i=0;i<NUM_MONSTERS;i++) {
|
||||
monsters[i].dead=FALSE;
|
||||
monsters[i].dx=0;
|
||||
@@ -269,14 +289,9 @@ U0 Init()
|
||||
monsters[i].y=RandU64%(map_height-2)+1;
|
||||
} while (!map[(monsters[i].y)*map_width+monsters[i].x]);
|
||||
}
|
||||
man_attack_t0=tS;
|
||||
man_attack=FALSE;
|
||||
man_x=0;
|
||||
man_y=4;
|
||||
man_dx=0;
|
||||
man_dy=0;
|
||||
screen_x=0;
|
||||
screen_y=0;
|
||||
monsters_left=NUM_MONSTERS;
|
||||
tf=0;
|
||||
t0=tS;
|
||||
}
|
||||
|
||||
U0 CleanUp()
|
||||
@@ -428,6 +443,7 @@ dg_done:
|
||||
PutExcept;
|
||||
SettingsPop;
|
||||
MenuPop;
|
||||
AcctRegWriteBranch("TempleOS/DunGen","F64 best_score=%5.4f;\n",best_score);
|
||||
CleanUp;
|
||||
}
|
||||
|
||||
|
||||
+58
-97
@@ -1,15 +1,7 @@
|
||||
//This uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.CPP"$.
|
||||
//Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.CPP"$.
|
||||
|
||||
//This program can be AOT compiled to a .BIN.Z or JIT.
|
||||
//If AOT compiling, override the filename extention warning.
|
||||
#ifaot
|
||||
#include "::/Kernel/AOT.HPP"
|
||||
I64 best_score=0; //Doesn't work yet for AOT
|
||||
#else
|
||||
AcctRegSetDftEntry("TempleOS/EagleDive","I64 best_score=0;\n");
|
||||
AcctRegExeBranch("TempleOS/EagleDive");
|
||||
#endif
|
||||
|
||||
|
||||
//Keep these power of two so shift is used instead of multiply
|
||||
//to index arrays.
|
||||
@@ -50,7 +42,6 @@ class Fish
|
||||
|
||||
|
||||
|
||||
|
||||
$SP,"<1>",BI=1$
|
||||
|
||||
|
||||
@@ -68,22 +59,17 @@ U0 CriticalSectionEnd()
|
||||
LBtr(&critical_section_flag,0);
|
||||
}
|
||||
|
||||
//These are $BK,1$NOT$BK,0$ deallocated after the program ends,
|
||||
//but I did them this way for your benefit
|
||||
//so 2D array indexing is not done by hand.
|
||||
//You can type "EagleDive;" at the command line
|
||||
//to rerun without new allocations.
|
||||
//Normally, just spawn a popup task,
|
||||
//run it and kill it using an icon.
|
||||
#ifaot
|
||||
#exe {OptOn(OPTf_GLBLS_ON_DATA_HEAP);};
|
||||
#endif
|
||||
/*These are $BK,1$NOT$BK,0$ deallocated after the program ends,
|
||||
but I did them this way for your benefit
|
||||
so 2D array indexing is not done by hand.
|
||||
You can type "EagleDive;" at the command line
|
||||
to rerun without new allocations.
|
||||
Normally, just spawn a popup task,
|
||||
run it and kill it using an icon.
|
||||
*/
|
||||
I16 elevations[MAP_HEIGHT][MAP_WIDTH];
|
||||
I32 normals[MAP_HEIGHT][MAP_WIDTH*2];
|
||||
Panel *panels[MAP_HEIGHT][MAP_WIDTH*2];
|
||||
#ifaot
|
||||
#exe {OptOff(OPTf_GLBLS_ON_DATA_HEAP);};
|
||||
#endif
|
||||
|
||||
I64 num_panels;
|
||||
Panel *panel_root;
|
||||
@@ -105,27 +91,16 @@ class MPCtrl {
|
||||
U0 FSTransform(CDC *dc,I64 *x,I64 *y,I64 *z)
|
||||
{
|
||||
I64 zz;
|
||||
//I accidentally made the Z coordinate sign backward
|
||||
//from the fill-poly depth buf scheme, so it is negated at the end.
|
||||
//Negative Z coordinates are the ones we want plotted.
|
||||
GrRot(dc->r,x,y,z);
|
||||
|
||||
//We don't want divide by zero or make too monstrous foreground objects.
|
||||
//The foreground object boundary is kinda crappy looking when
|
||||
//you point toward the ground.
|
||||
*z=-*z;
|
||||
zz=*z+50;
|
||||
*z=zz=-*z;
|
||||
if (zz>0) {
|
||||
//The divide causes "foreshortening" which makes the distance go to a vanishing point.
|
||||
*x = *x * DISPLAY_SCALE/ zz;
|
||||
*x = *x * DISPLAY_SCALE/ zz; //Foreshortening
|
||||
*y = *y * DISPLAY_SCALE/ zz;
|
||||
}
|
||||
*x+=dc->x;
|
||||
*y =dc->y-*y;
|
||||
}
|
||||
|
||||
|
||||
|
||||
U0 CalcNormals()
|
||||
{
|
||||
/*The idea is that there are two tris
|
||||
@@ -157,7 +132,6 @@ It works pretty well. It combines
|
||||
more than it should, but that's good
|
||||
because it would result in too many
|
||||
panels.
|
||||
|
||||
*/
|
||||
I64 i,j,k,dz1,dz2;
|
||||
for (j=0;j<MAP_HEIGHT-1;j++) {
|
||||
@@ -331,23 +305,10 @@ U0 MPDoPanels(CTask *task)
|
||||
LBtr(&mp.init_not_done_flags,Gs->num);
|
||||
}
|
||||
|
||||
|
||||
U0 InitMap()
|
||||
U0 InitElevations()
|
||||
{
|
||||
//We make a topographic data structure "elevations[][]"
|
||||
//and convert it to panels. The conversion to panels leaves
|
||||
//gaps the way I did it, but it looks good, except for sky leaking through
|
||||
//There is no wrong way to pick colors if it looks good, unless
|
||||
//you wanted to do lighting.
|
||||
|
||||
//"panels[][]" holds the flat and sloped panels for each spot, while
|
||||
//"hstep_panels[][]" holds side panels in cases of step-like formations.
|
||||
//They require a separate array because a single "elevation[][]" spot can
|
||||
//have a panel on top and a panel on the side like stairs.
|
||||
|
||||
I64 i,j,l,k1,k2,x,y,xx,yy;
|
||||
I64 i,j,l,x,y,xx,yy,x1,y1,x2,y2;
|
||||
MemSet(elevations,0,sizeof(elevations));
|
||||
MemSet(panels,0,sizeof(panels));
|
||||
for (i=0;i<MAP_WIDTH*MAP_HEIGHT/128;i++) {
|
||||
x=RandU32%MAP_WIDTH;
|
||||
y=RandU32%MAP_HEIGHT;
|
||||
@@ -357,27 +318,44 @@ U0 InitMap()
|
||||
if (!l && RandU16<MAX_U16/4)
|
||||
l=RandU16%(j+1);
|
||||
if (l) {
|
||||
for (k1=-j;k1<=j;k1++)
|
||||
for (k2=-j;k2<=j;k2++) {
|
||||
xx=x+k2; yy=y+k1;
|
||||
if (0<=xx<MAP_WIDTH &&
|
||||
0<=yy<MAP_HEIGHT)
|
||||
elevations[yy][xx]+=MAP_SCALE/2;
|
||||
}
|
||||
l--;
|
||||
x1=ClampI64(x-j,0,MAP_WIDTH-1);
|
||||
x2=ClampI64(x+j,0,MAP_WIDTH-1);
|
||||
y1=ClampI64(y-j,0,MAP_HEIGHT-1);
|
||||
y2=ClampI64(y+j,0,MAP_HEIGHT-1);
|
||||
for (yy=y1;yy<y2;yy++)
|
||||
for (xx=x1;xx<x2;xx++)
|
||||
elevations[yy][xx]+=MAP_SCALE/2;
|
||||
l--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
xx=x/(MAP_SCALE*COORDINATE_SCALE);
|
||||
yy=y/(MAP_SCALE*COORDINATE_SCALE);
|
||||
z+=elevations[yy][xx]*COORDINATE_SCALE;
|
||||
|
||||
for (j=0;j<MAP_HEIGHT;j++)
|
||||
for (i=0;i<MAP_WIDTH;i++)
|
||||
if (elevations[j][i]<WATER_ELEVATION*MAP_SCALE)
|
||||
elevations[j][i]=WATER_ELEVATION*MAP_SCALE;
|
||||
}
|
||||
|
||||
U0 InitMap()
|
||||
{/*We make a topographic data structure "elevations[][]"
|
||||
and convert it to panels. The conversion to panels leaves
|
||||
gaps the way I did it, but it looks good, except for sky leaking through
|
||||
There is no wrong way to pick colors if it looks good, unless
|
||||
you wanted to do lighting.
|
||||
|
||||
"panels[][]" holds the flat and sloped panels for each spot, while
|
||||
"hstep_panels[][]" holds side panels in cases of step-like formations.
|
||||
They require a separate array because a single "elevation[][]" spot can
|
||||
have a panel on top and a panel on the side like stairs.
|
||||
*/
|
||||
I64 i,x,y,xx,yy;
|
||||
|
||||
InitElevations;
|
||||
|
||||
MemSet(panels,0,sizeof(panels));
|
||||
xx=x/(MAP_SCALE*COORDINATE_SCALE);
|
||||
yy=y/(MAP_SCALE*COORDINATE_SCALE);
|
||||
z+=elevations[yy][xx]*COORDINATE_SCALE;
|
||||
|
||||
CalcNormals;
|
||||
|
||||
@@ -392,7 +370,6 @@ U0 InitMap()
|
||||
panels_processed_bitmap=MAlloc((num_panels+7)>>3);
|
||||
}
|
||||
|
||||
|
||||
CDC *main_dc;
|
||||
|
||||
U0 DrawIt(CTask *,CDC *dc)
|
||||
@@ -402,8 +379,6 @@ U0 DrawIt(CTask *,CDC *dc)
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
|
||||
$SP,"<2>",BI=2$
|
||||
|
||||
|
||||
@@ -423,7 +398,6 @@ $SP,"<2>",BI=2$
|
||||
|
||||
|
||||
|
||||
|
||||
$SP,"<3>",BI=3$
|
||||
|
||||
|
||||
@@ -462,14 +436,12 @@ and render the panel for each square, marking-it done.
|
||||
|
||||
The depth buf is not locked in the graphic routines
|
||||
so we get some glitches.
|
||||
|
||||
*/
|
||||
|
||||
I64 update_jiffy_limit;
|
||||
|
||||
U0 MPDrawIt(CTask *task,CDC *dc)
|
||||
{
|
||||
//This is identical to the previous routine but is run by core#1
|
||||
I64 j,strip_width,*s2w,x1,y1,z1, xx,yy,
|
||||
xh,yh,zh,yh2,xh2,x1h,y1h,x1wa,y1wa,x1wb,y1wb,
|
||||
x3,y3,z3,
|
||||
@@ -530,7 +502,7 @@ U0 MPDrawIt(CTask *task,CDC *dc)
|
||||
yy+=y3;
|
||||
}
|
||||
|
||||
if (Gs->num&1) { //alternate left-right,right-left
|
||||
if (Gs->num&1) {//alternate left-right,right-left
|
||||
yh2=-yh;
|
||||
xh2=-xh;
|
||||
} else {
|
||||
@@ -550,10 +522,10 @@ U0 MPDrawIt(CTask *task,CDC *dc)
|
||||
//Take half steps to cover whole grid.
|
||||
xh>>=1; yh>>=1;
|
||||
xh2>>=1; yh2>>=1;
|
||||
for (strip_width=0;sys_jiffies<update_jiffy_limit;strip_width++) {
|
||||
for (strip_width=0;cnts.jiffies<update_jiffy_limit;strip_width++) {
|
||||
x1h=x1wa;
|
||||
y1h=y1wa;
|
||||
for (j=0;j<strip_height && sys_jiffies<update_jiffy_limit;j++) {
|
||||
for (j=0;j<strip_height && cnts.jiffies<update_jiffy_limit;j++) {
|
||||
x1=x1h>>8; y1=y1h>>8;
|
||||
if (0<=x1<MAP_WIDTH && 0<=y1<MAP_HEIGHT) {
|
||||
if ((tempp=panels[y1][x1*2]) && !LBts(panels_processed_bitmap,tempp->num)) {
|
||||
@@ -637,8 +609,8 @@ U0 DrawHorizon(CDC *dc)
|
||||
|
||||
MemSet(p,0,sizeof(p));
|
||||
if (x2<x1) {
|
||||
SwapU64(&x1,&x2);
|
||||
SwapU64(&y1,&y2);
|
||||
SwapI64(&x1,&x2);
|
||||
SwapI64(&y1,&y2);
|
||||
}
|
||||
if (!x1 && x2==dc->width-1) {
|
||||
p[0].x=0;
|
||||
@@ -663,8 +635,8 @@ U0 DrawHorizon(CDC *dc)
|
||||
GrFillPoly3(dc,4,p);
|
||||
} else {
|
||||
if (y2<y1) {
|
||||
SwapU64(&x1,&x2);
|
||||
SwapU64(&y1,&y2);
|
||||
SwapI64(&x1,&x2);
|
||||
SwapI64(&y1,&y2);
|
||||
}
|
||||
if (!y1 && y2==dc->height-1) {
|
||||
p[0].x=0;
|
||||
@@ -692,7 +664,6 @@ U0 DrawHorizon(CDC *dc)
|
||||
dc->depth_buf=old_db;
|
||||
}
|
||||
|
||||
|
||||
U0 BSPEagleDive()
|
||||
{
|
||||
CDC *dc=DCAlias(main_dc,Fs);
|
||||
@@ -702,7 +673,7 @@ U0 BSPEagleDive()
|
||||
F64 min_strip_width;
|
||||
Fish *tempf;
|
||||
|
||||
update_jiffy_limit=sys_jiffies+JIFFY_FREQ/40;
|
||||
update_jiffy_limit=cnts.jiffies+JIFFY_FREQ/40;
|
||||
MemSet(panels_processed_bitmap,0,(num_panels+7)>>3);
|
||||
|
||||
xx=x/(MAP_SCALE*COORDINATE_SCALE);
|
||||
@@ -713,10 +684,10 @@ U0 BSPEagleDive()
|
||||
dc->color=bkcolor=BLACK;
|
||||
if (!game_over) {
|
||||
GrRect(dc,0,0,dc->width,dc->height);
|
||||
music_mute=TRUE;
|
||||
music.mute=TRUE;
|
||||
Beep;
|
||||
game_over=TRUE;
|
||||
music_mute=FALSE;
|
||||
music.mute=FALSE;
|
||||
}
|
||||
} else
|
||||
bkcolor=BLUE;
|
||||
@@ -782,8 +753,7 @@ U0 BSPEagleDive()
|
||||
#define ANIMATE_MS 10
|
||||
|
||||
U0 AnimateTask(I64)
|
||||
{
|
||||
//This just steadily moves the airplane fwd.
|
||||
{//Steadily moves the airplane fwd.
|
||||
I64 *s2w,x1,y1,z1;
|
||||
F64 t0=tS,mS;
|
||||
Fish *tempf,*tempf1;
|
||||
@@ -815,9 +785,9 @@ U0 AnimateTask(I64)
|
||||
best_score=game_score;
|
||||
QueRem(tempf);
|
||||
Free(tempf);
|
||||
music_mute=TRUE;
|
||||
music.mute=TRUE;
|
||||
Snd(1000); Sleep(200); Snd(0);
|
||||
music_mute=FALSE;
|
||||
music.mute=FALSE;
|
||||
}
|
||||
tempf=tempf1;
|
||||
}
|
||||
@@ -852,14 +822,10 @@ U0 TaskEndCB()
|
||||
}
|
||||
|
||||
U0 SongTask(I64)
|
||||
{ //Song by Terry A. Davis
|
||||
#ifaot
|
||||
Fs->task_end_cb=HashVal(HashFind("SndTaskEndCB",Fs->hash_table,HTT_FUN));
|
||||
#else
|
||||
{//Song by Terry A. Davis
|
||||
Fs->task_end_cb=&SndTaskEndCB;
|
||||
#endif
|
||||
MusicSettingsRst;
|
||||
music_stacatto_factor=0.2;
|
||||
music.stacatto_factor=0.2;
|
||||
while (TRUE) {
|
||||
Play("3eBDEDBDEDFEEDFEED");
|
||||
Play("BDEDBDEDFEEDFEED");
|
||||
@@ -882,8 +848,6 @@ U0 Init(I64 _mp_cnt)
|
||||
InitMap;
|
||||
DCAllocDepthBuf(main_dc);
|
||||
|
||||
Fs->win_max_refresh=30.0;
|
||||
|
||||
strip_height=128;
|
||||
è =-90.0*ã/180.0;
|
||||
é1= 0.0*ã/180.0;
|
||||
@@ -929,9 +893,6 @@ U0 EagleDive(I64 _mp_cnt=MP_MAX_PROCESSORS)
|
||||
F64 pp,tt1,tt2;
|
||||
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
//We really can't afford to run at 60Hz. This is how often VGA
|
||||
//memory is updated, not related to actual hardware refresh rates.
|
||||
|
||||
WordStat;
|
||||
MenuPush(
|
||||
"File {"
|
||||
@@ -955,7 +916,7 @@ U0 EagleDive(I64 _mp_cnt=MP_MAX_PROCESSORS)
|
||||
DocCursor;
|
||||
DocClear;
|
||||
Fs->draw_it=&DrawIt;
|
||||
try //in case <CTRL-ALT-C> is pressed.
|
||||
try //in case <CTRL-ALT-c> is pressed.
|
||||
do {
|
||||
if (ScanKey(&ch,&sc)) {
|
||||
pp=è; tt1=é1; tt2=é2;
|
||||
|
||||
Binary file not shown.
+141
-32
@@ -3,7 +3,8 @@
|
||||
F64 game_speed,
|
||||
launch_unit_x1,launch_unit_y1,launch_unit_x2,launch_unit_y2,launch_t,
|
||||
return_unit_x1,return_unit_y1,return_unit_x2,return_unit_y2,return_t,
|
||||
set_é_unit_x1,set_é_unit_y1,set_é_unit_x2,set_é_unit_y2,set_é_t;
|
||||
set_é_unit_x1,set_é_unit_y1,set_é_unit_x2,set_é_unit_y2,set_é_t,
|
||||
next_noise;
|
||||
CTask *main_task;
|
||||
|
||||
#define OT_CARRIER 0
|
||||
@@ -16,6 +17,16 @@ CTask *main_task;
|
||||
#define OF_RETURNING 4
|
||||
#define OF_SHOOTING 8
|
||||
|
||||
#define FIRE_WIDTH 56
|
||||
#define FIRE_HEIGHT 16
|
||||
#define FIRE_X_SCALE 0.5
|
||||
#define FIRE_Y_SCALE 0.5
|
||||
|
||||
#define FIRE_COLORS 16
|
||||
U8 fire_colors[FIRE_COLORS]={
|
||||
YELLOW,YELLOW,LTRED,YELLOW, BLACK,YELLOW,RED,YELLOW,
|
||||
YELLOW,BLACK,YELLOW,LTRED, RED,YELLOW,DKGRAY,YELLOW};
|
||||
|
||||
class Obj
|
||||
{
|
||||
Obj *next,*last;
|
||||
@@ -34,6 +45,7 @@ class Obj
|
||||
death_time,next_action_time;
|
||||
I32 torpedos,max_torpedos;
|
||||
F64 torpedos_range;
|
||||
U8 fire[(FIRE_WIDTH*FIRE_HEIGHT+7)/8];
|
||||
} obj_root;
|
||||
|
||||
class Torpedo
|
||||
@@ -55,7 +67,6 @@ class Squadron : Obj
|
||||
I64 action,dead_mask,total_mask;
|
||||
} *squadrons;
|
||||
|
||||
|
||||
U0 SquadronIns(Obj *o,Obj *pred)
|
||||
{
|
||||
Obj *succ=pred->next_in_squadron;
|
||||
@@ -118,7 +129,6 @@ U0 ObjDel(Obj *tempo)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$BG,1$
|
||||
|
||||
|
||||
@@ -148,6 +158,7 @@ CSprite *imgs[NUM_PLAYERS][OT_NUM_TYPES]={{$IB,"<1>",BI=1$,$IB,"<2>",BI=2$,$IB,"
|
||||
|
||||
U0 DrawIt(CTask *task,CDC *dc)
|
||||
{
|
||||
I64 i,j,k;
|
||||
F64 d,cur_time=tS;
|
||||
Obj *tempo;
|
||||
Torpedo *tempt;
|
||||
@@ -164,6 +175,17 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
while (tempo!=&obj_root) {
|
||||
if (tempo->flags&OF_ACTIVE && tempo->flags&OF_SHIP) {
|
||||
SpriteZ3B(dc,tempo->x,tempo->y,0,imgs[tempo->player][tempo->type],tempo->é+ã/2);
|
||||
|
||||
k=0;
|
||||
for (j=0;j<FIRE_HEIGHT;j++)
|
||||
for (i=0;i<FIRE_WIDTH;i++)
|
||||
if (Bt(tempo->fire,k++)) {
|
||||
dc->color=fire_colors[ToI64(k+10*tS)&(FIRE_COLORS-1)];
|
||||
GrPlot(dc,tempo->x+FIRE_X_SCALE*(i-FIRE_WIDTH /2+(11*tS+i)%1.7)*Cos(tempo->é)-
|
||||
FIRE_Y_SCALE*(j-FIRE_HEIGHT/2+(12*tS+j)%1.7)*Sin(tempo->é),
|
||||
tempo->y+FIRE_Y_SCALE*(j-FIRE_HEIGHT/2+(19*tS+j)%1.7)*Cos(tempo->é)+
|
||||
FIRE_X_SCALE*(i-FIRE_WIDTH /2+(13*tS+i)%1.7)*Sin(tempo->é));
|
||||
}
|
||||
if (Blink) {
|
||||
dc->color=BLACK;
|
||||
GrLine(dc,tempo->x+5,tempo->y,tempo->x+5+10,tempo->y);
|
||||
@@ -231,11 +253,11 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
if (!num_alive[1]) {
|
||||
dc->color=LTGREEN;
|
||||
GrPrint(dc,task->pix_width>>1 -(FONT_WIDTH*14)/2-task->scroll_x,
|
||||
task->pix_height>>1-FONT_HEIGHT/2-task->scroll_y,"Game Completed");
|
||||
task->pix_height>>1-FONT_HEIGHT/2-task->scroll_y,"Game Completed");
|
||||
} else {
|
||||
dc->color=LTRED;
|
||||
GrPrint(dc,task->pix_width>>1 -(FONT_WIDTH*9)/2-task->scroll_x,
|
||||
task->pix_height>>1-FONT_HEIGHT/2-task->scroll_y,"Game Over");
|
||||
task->pix_height>>1-FONT_HEIGHT/2-task->scroll_y,"Game Over");
|
||||
}
|
||||
}
|
||||
Preempt(old_preempt);
|
||||
@@ -250,6 +272,7 @@ U0 Init()
|
||||
QueInit(&obj_root);
|
||||
QueInit(&torpedo_root);
|
||||
|
||||
next_noise=tS;
|
||||
Fs->scroll_x=0;
|
||||
Fs->scroll_y=0;
|
||||
game_speed=1.0;
|
||||
@@ -387,8 +410,8 @@ Squadron *SquadronLaunch(I64 player,F64 x=MAX_F64,F64 y=MAX_F64)
|
||||
if (player==0) {
|
||||
launch_unit_x1=tempo->x;
|
||||
launch_unit_y1=tempo->y;
|
||||
launch_unit_x2=ipx-main_task->pix_left-main_task->scroll_x;
|
||||
launch_unit_y2=ipy-main_task->pix_top -main_task->scroll_y;
|
||||
launch_unit_x2=ip.pos.x-main_task->pix_left-main_task->scroll_x;
|
||||
launch_unit_y2=ip.pos.y-main_task->pix_top -main_task->scroll_y;
|
||||
launch_t=tS+0.5;
|
||||
}
|
||||
if (tempo->squadron>=0) {
|
||||
@@ -403,7 +426,6 @@ Squadron *SquadronLaunch(I64 player,F64 x=MAX_F64,F64 y=MAX_F64)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
Obj *ObjReturn(I64 player,F64 x,F64 y)
|
||||
{
|
||||
Obj *tempo;
|
||||
@@ -456,8 +478,8 @@ Squadron *SquadronSet
|
||||
if (player==0) {
|
||||
set_é_unit_x1=tempo->x;
|
||||
set_é_unit_y1=tempo->y;
|
||||
set_é_unit_x2=ipx-main_task->pix_left-main_task->scroll_x;
|
||||
set_é_unit_y2=ipy-main_task->pix_top -main_task->scroll_y;
|
||||
set_é_unit_x2=ip.pos.x-main_task->pix_left-main_task->scroll_x;
|
||||
set_é_unit_y2=ip.pos.y-main_task->pix_top -main_task->scroll_y;
|
||||
set_é_t=tS+0.5;
|
||||
}
|
||||
if (tempo->squadron>=0) {
|
||||
@@ -538,6 +560,44 @@ U0 AI(I64 player,F64 period)
|
||||
}
|
||||
}
|
||||
|
||||
U0 ShipDammage(Obj *tempo,F64 d)
|
||||
{
|
||||
I64 i,x=Rand*FIRE_WIDTH,y=Rand*FIRE_HEIGHT;
|
||||
tempo->life_percent-=d;
|
||||
while (d>0) {
|
||||
if (!Bts(tempo->fire,y*FIRE_WIDTH+x))
|
||||
d-=500.0/(FIRE_WIDTH*FIRE_HEIGHT);
|
||||
else
|
||||
d-=25.0/(FIRE_WIDTH*FIRE_HEIGHT);
|
||||
i=RandI16&7;
|
||||
x+=gr_x_offsets[i];
|
||||
y+=gr_y_offsets[i];
|
||||
while (x>=FIRE_WIDTH)
|
||||
x-=FIRE_WIDTH;
|
||||
while (x<0)
|
||||
x+=FIRE_WIDTH;
|
||||
while (y>=FIRE_HEIGHT)
|
||||
y-=FIRE_HEIGHT;
|
||||
while (y<0)
|
||||
y+=FIRE_HEIGHT;
|
||||
}
|
||||
}
|
||||
|
||||
U0 ShipFix(Obj *tempo,F64 d)
|
||||
{
|
||||
tempo->life_percent+=d;
|
||||
if (tempo->life_percent>=100.0) {
|
||||
tempo->life_percent=100.0;
|
||||
MemSet(tempo->fire,0,sizeof(Obj.fire));
|
||||
return;
|
||||
}
|
||||
while (d>0)
|
||||
if (Btr(tempo->fire,FIRE_WIDTH*FIRE_HEIGHT*Rand))
|
||||
d-=400.0/(FIRE_WIDTH*FIRE_HEIGHT);
|
||||
else
|
||||
d-=20.0/(FIRE_WIDTH*FIRE_HEIGHT);
|
||||
}
|
||||
|
||||
U0 Combat(F64 period)
|
||||
{
|
||||
F64 d;
|
||||
@@ -566,11 +626,14 @@ U0 Combat(F64 period)
|
||||
} else if (tempo->ship_guns>0 && d<tempo->ship_guns_range) {
|
||||
tempo->flags|=OF_SHOOTING;
|
||||
if (Rand<125.0*period) {
|
||||
tempo1->life_percent-=tempo->ship_guns*Rand*period;
|
||||
ShipDammage(tempo1,tempo->ship_guns*Rand*period);
|
||||
if (Rand<10.0*period)
|
||||
tempo1->fuel*=0.75*Rand+0.25;
|
||||
}
|
||||
Noise(100,75,200);
|
||||
if (tS>next_noise) {
|
||||
Noise(100,75,200);
|
||||
next_noise=tS+0.1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (tempo->air_guns>0 && d<tempo->air_guns_range) {
|
||||
@@ -580,7 +643,10 @@ U0 Combat(F64 period)
|
||||
if (Rand<10.0*period)
|
||||
tempo1->fuel*=0.75*Rand+0.25;
|
||||
}
|
||||
Noise(25,500,2000);
|
||||
if (tS>next_noise) {
|
||||
Noise(25,500,2000);
|
||||
next_noise=tS+0.025;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -606,11 +672,10 @@ U0 Combat(F64 period)
|
||||
|
||||
#define ANIMATE_FREQ 50
|
||||
U0 AnimateTask(I64)
|
||||
{ //Preemption is off after Spawn
|
||||
{//Preemption is off after Spawn
|
||||
Obj *tempo;
|
||||
Torpedo *tempt,*tempt1;
|
||||
F64 d,period;
|
||||
I64 cnt=0;
|
||||
|
||||
while (TRUE) {
|
||||
period=GAME_SPEED_SCALE*game_speed/ANIMATE_FREQ;
|
||||
@@ -639,7 +704,7 @@ U0 AnimateTask(I64)
|
||||
if (tS>tempt->timeout) {
|
||||
tempo=tempt->target;
|
||||
if (Rand<0.333333) {
|
||||
tempo->life_percent-=150*Rand*Rand;
|
||||
ShipDammage(tempo,150*Rand*Rand);
|
||||
if (Rand<0.333333)
|
||||
tempo->fuel*=0.75*Rand+0.25;
|
||||
}
|
||||
@@ -683,7 +748,7 @@ U0 AnimateTask(I64)
|
||||
if (tempo->flags&OF_RETURNING)
|
||||
tempo->dé+=Wrap(Arg(tempo->host->x-tempo->x,tempo->host->y-tempo->y)-(tempo->é+tempo->dé),-ã);
|
||||
} else if (tempo->type==OT_CARRIER)
|
||||
tempo->life_percent=Min(100.0,tempo->life_percent+2.5*period);
|
||||
ShipFix(tempo,2.5*period);
|
||||
}
|
||||
tempo=tempo->next;
|
||||
}
|
||||
@@ -694,21 +759,22 @@ U0 AnimateTask(I64)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
U0 FlatTops()
|
||||
{
|
||||
I64 p1,p2;
|
||||
I64 a1,a2;
|
||||
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
Fs->text_attr=BLUE<<4+WHITE;
|
||||
WinMax;
|
||||
WinBorder;
|
||||
WordStat;
|
||||
DocCursor;
|
||||
DocClear;
|
||||
PopUpOk("$$GREEN$${Left-Mouse}$$FG$$\t\tChange Course\n"
|
||||
"$$GREEN$${Right-Mouse}$$FG$$\t\tLaunch Squadron\n"
|
||||
"$$GREEN$${Right-Double-Mouse}$$FG$$\tReturn Squadron\n"
|
||||
"$$GREEN$${Ctrl-Left Grab}$$FG$$\tScroll Screen\n");
|
||||
Preempt(OFF),
|
||||
WinBorder;
|
||||
WordStat;
|
||||
|
||||
MenuPush(
|
||||
"File {"
|
||||
" Abort(,CH_SHIFT_ESC);"
|
||||
@@ -720,18 +786,15 @@ U0 FlatTops()
|
||||
" Slower(,'-');"
|
||||
"}"
|
||||
);
|
||||
WinMax;
|
||||
Fs->win_inhibit|=WIF_IP_L|WIF_IP_R;
|
||||
Fs->win_inhibit|=WIF_SELF_IP_L|WIF_SELF_IP_R;
|
||||
Init;
|
||||
DocCursor;
|
||||
DocClear;
|
||||
Fs->draw_it=&DrawIt;
|
||||
Fs->animate_task=Spawn(&AnimateTask,NULL,"Animate",,Fs);
|
||||
try {
|
||||
while (TRUE)
|
||||
switch(GetMsg(&p1,&p2,1<<MSG_KEY_DOWN|1<<MSG_IP_L_UP|1<<MSG_IP_R_UP|1<<MSG_IP_R_D_UP)) {
|
||||
switch(GetMsg(&a1,&a2,1<<MSG_KEY_DOWN|1<<MSG_IP_L_UP|1<<MSG_IP_R_UP|1<<MSG_IP_R_D_UP)) {
|
||||
case MSG_KEY_DOWN:
|
||||
switch (p1) {
|
||||
switch (a1) {
|
||||
case '\n':
|
||||
CleanUp;
|
||||
Init;
|
||||
@@ -748,13 +811,13 @@ U0 FlatTops()
|
||||
}
|
||||
break;
|
||||
case MSG_IP_L_UP:
|
||||
SquadronSeté(0,p1,p2);
|
||||
SquadronSeté(0,a1,a2);
|
||||
break;
|
||||
case MSG_IP_R_UP:
|
||||
SquadronLaunch(0,p1,p2);
|
||||
SquadronLaunch(0,a1,a2);
|
||||
break;
|
||||
case MSG_IP_R_D_UP:
|
||||
SquadronReturn(0,p1,p2);
|
||||
SquadronReturn(0,a1,a2);
|
||||
break;
|
||||
}
|
||||
nv_done:
|
||||
@@ -767,8 +830,54 @@ nv_done:
|
||||
}
|
||||
|
||||
FlatTops;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//Maybe use this in the future $SP,"<7>",BI=7$
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
| ||||