diff options
author | Ian C <ianc@noddybox.co.uk> | 2018-10-18 07:20:23 +0000 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2018-10-18 07:20:23 +0000 |
commit | 6681cf2d0bcbca5785c0173f4ef5065423aba1a4 (patch) | |
tree | 4ad776f0aaeeefb941d1bf5a95e3deeeb67b3bd7 /xd.c | |
parent | 3649f1f0319fa2ff434d2dfed3dfd3d731f92fad (diff) |
Tweaks to catwalk demo.
Diffstat (limited to 'xd.c')
-rw-r--r-- | xd.c | 47 |
1 files changed, 44 insertions, 3 deletions
@@ -262,7 +262,7 @@ static DemoInfo demotbl[NO_DEMOS]= UsesPixmap }, { - "Catwalk trench", + "Catwalk trench (LMB to change draw mode)", CatwalkDemo, UsesPixmap }, @@ -3827,6 +3827,8 @@ static void CatwalkDemo(void) static int move=0; + static int drawmode = MODE_EDGE; + static int init=FALSE; int f,r; @@ -3844,7 +3846,8 @@ static void CatwalkDemo(void) catwalk[f].no_poly = 1; catwalk[f].origin.x = 0; - catwalk[f].origin.y = RND2(TRENCH_Y_BOT, TRENCH_Y_TOP + TRENCH_CWH); + catwalk[f].origin.y = RND2(TRENCH_Y_BOT - TRENCH_CWH, + TRENCH_Y_TOP + TRENCH_CWH); catwalk[f].origin.z = TRENCH_Z_MAX - 1500 * f; catwalk[f].ps = cw_point; @@ -3867,6 +3870,43 @@ static void CatwalkDemo(void) init=TRUE; } + if (mouse_b&Button1Mask) + { + static time_t bounce=0; + + if (bounce!=time(NULL)) + { + drawmode = (drawmode + 1) % 3; + + switch(drawmode) + { + case MODE_WIRE: + trench.mode = MODE_WIRE; + for(f = 0; f < no_catwalk; f++) + { + catwalk[f].mode = MODE_WIRE; + } + break; + case MODE_EDGE: + trench.mode = MODE_WIRE; + for(f = 0; f < no_catwalk; f++) + { + catwalk[f].mode = MODE_EDGE; + } + break; + case MODE_SOLID: + trench.mode = MODE_SOLID; + for(f = 0; f < no_catwalk; f++) + { + catwalk[f].mode = MODE_SOLID; + } + break; + } + + bounce=time(NULL); + } + } + Cls(); DrawObj(&trench,col); @@ -3890,7 +3930,8 @@ static void CatwalkDemo(void) catwalk[0] = t; catwalk[0].origin.z = TRENCH_Z_MAX; - catwalk[0].origin.y = RND2(TRENCH_Y_BOT, TRENCH_Y_TOP + TRENCH_CWH); + catwalk[0].origin.y = RND2(TRENCH_Y_BOT - TRENCH_CWH, + TRENCH_Y_TOP + TRENCH_CWH); } } |