summaryrefslogtreecommitdiff
path: root/stern.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'stern.cpp')
-rw-r--r--stern.cpp74
1 files changed, 37 insertions, 37 deletions
diff --git a/stern.cpp b/stern.cpp
index a2ea075..6d17ebe 100644
--- a/stern.cpp
+++ b/stern.cpp
@@ -16,34 +16,10 @@ void Rotation(void);
int key(void);
#define COPYRIGHT "Dark Alliance (c) 1996-2000 DreamDemon"
-#define PI 3.1415926
-#define Lines 36
+#define PI 3.14
+#define Lines 72
static int World[Lines][3] = {
- -60, 40, 20, -20, 40, 20,
- -20, 40, 20, -20, 0, 20,
- -20, 0, 20, 60, 0, 20,
- 60, 0, 20, 60,-40, 20,
- 60,-40, 20, -60,-40, 20,
- -60,-40, 20, -60, 40, 20,
-
- -60, 40,-20, -20, 40,-20,
- -20, 40,-20, -20, 0,-20,
- -20, 0,-20, 60, 0,-20,
- 60, 0,-20, 60,-40,-20,
- 60,-40,-20, -60,-40,-20,
- -60,-40,-20, -60, 40,-20,
-
- -60, 40, 20, -60, 40,-20,
- -20, 40, 20, -20, 40,-20,
- -20, 0, 20, -20, 0,-20,
- 60, 0, 20, 60, 0,-20,
- 60,-40, 20, 60,-40,-20,
- -60,-40, 20, -60,-40,-20};
-
-
-/* Lines 72
-static int World[Lines][3] = {
90, 0, 0, 10, 10, 10, 90, 0, 0, 10, 10,-10,
90, 0, 0, 10,-10,-10, 90, 0, 0, 10,-10, 10,
-90, 0, 0, -10, 10, 10, -90, 0, 0, -10, 10,-10,
@@ -62,8 +38,8 @@ static int World[Lines][3] = {
10, 10,-10, 10,-10,-10, -10, 10,-10, -10,-10,-10,
10, 10, 10, 10, 10,-10, 10,-10, 10, 10,-10,-10,
-10,-10, 10, -10,-10,-10, -10, 10, 10, -10, 10,-10};
-*/
-float X, Y, Z, sX, sY, Xa, Ya, Za, sXs, sYs, D, Page, Xmid, Ymid;
+
+float X, Y, Z, sX, sY, Xa, Ya, Za, sXs, sYs, D, G, Page, Xmid, Ymid;
float R, R1, R2, R3, Sr1, Sr2, Sr3, Cr1, Cr2, Cr3, mX, mY, mZ;
void main(void)
@@ -134,6 +110,7 @@ void InitProgram(void)
R1 = 0;
R2 = 0;
R3 = 0.3;
+ G = 0.3;
}
void MainLoop(void)
@@ -141,19 +118,42 @@ void MainLoop(void)
int k;
while((k=key()) != 27)
{
- R += 0.1;
- if(R > (2 * PI)) R = 0;
-// R -= 0.1;
-// if(R < 0) R = 2 * PI;
- R1 = R;
- R2 = R;
- R3 = R;
-
+ switch(k) {
+ case 115: case 83: // S
+ R1 += G;
+ if(R1 > (2 * PI)) R1 = 0;
+ break;
+ case 101: case 69: // E
+ R2 += G;
+ if(R2 > (2 * PI)) R2 = 0;
+ break;
+ case 113: case 81: // Q
+ R3 += G;
+ if(R3 > (2 * PI)) R3 = 0;
+ break;
+ case 119: case 87: // W
+ R1 -= G;
+ if(R1 < 0) R1 = 2 * PI;
+ break;
+ case 100: case 68: // D
+ R2 -= G;
+ if(R2 < 0) R2 = 2 * PI;
+ break;
+ case 97: case 65: // A
+ R3 -= G;
+ if(R3 < 0) R3 = 2 * PI;
+ break;
+ default: break;
+ }
-// WAIT 986, 8
clearviewport();
DrawObject();
+
+ outtextxy(10,10,"Esc - Quit");
+ outtextxy(550,10,"Q W E");
+ outtextxy(550,20,"A S D");
outtextxy(10,330,COPYRIGHT);
+
setvisualpage(Page);
Page = 1 - Page;
setactivepage(Page);