summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2003-09-22 07:45:34 +0000
committerDimitri Sokolyuk <demon@dim13.org>2003-09-22 07:45:34 +0000
commitc7e3d91d9e4fb2a4ea4312b01d6b9ea6ff66952c (patch)
tree1f79bfc47c4912094d6dfe0d33729d5fde5dd286
parent0ce1636e8e6c0a7a9a6cc8343fbbdc6fe51224d9 (diff)
2000-Feb-13 v2
-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);