aboutsummaryrefslogtreecommitdiffstats
path: root/drawlevel.c
diff options
context:
space:
mode:
Diffstat (limited to 'drawlevel.c')
-rw-r--r--drawlevel.c64
1 files changed, 33 insertions, 31 deletions
diff --git a/drawlevel.c b/drawlevel.c
index 069cda1..a1339e8 100644
--- a/drawlevel.c
+++ b/drawlevel.c
@@ -547,46 +547,48 @@ static void level_full(void)
level_frame();
}
+static void add_white(int x, int y)
+{
+ int nw = gp.nwhite++;
+
+ gp.whitecherrylist[nw].x = x;
+ gp.whitecherrylist[nw].y = y;
+ lprint(x, y, "\xeb");
+}
+
/* Level 75: Finale */
static void level_finale(void)
{
int i, j, e;
- int nw;
-
- gp.nextwhite = 0;
- nw = 0;
-#define ADDW(i,j) ( gp.whitecherrylist[nw].x = (i), \
- gp.whitecherrylist[nw].y = (j), \
- lprint((i),(j),"\xeb"), \
- nw++ )
+ gp.nextwhite = gp.nwhite = 0;
color(15, gp.c);
for ( i = 3 ; i <= 22 ; i += 2 ) {
- ADDW(i,2);
- ADDW(i,6);
- ADDW(i,10);
- ADDW(i,14);
- ADDW(i,18);
- ADDW(i,22);
- ADDW(i,26);
- ADDW(i,30);
- ADDW(i,34);
- ADDW(i,38);
-
- ADDW(i+1,4);
- ADDW(i+1,8);
- ADDW(i+1,12);
- ADDW(i+1,16);
- ADDW(i+1,20);
- ADDW(i+1,24);
- ADDW(i+1,28);
- ADDW(i+1,32);
- ADDW(i+1,36);
- }
- gp.Bar = gp.nwhite = nw;
+ add_white(i,2);
+ add_white(i,6);
+ add_white(i,10);
+ add_white(i,14);
+ add_white(i,18);
+ add_white(i,22);
+ add_white(i,26);
+ add_white(i,30);
+ add_white(i,34);
+ add_white(i,38);
+
+ add_white(i+1,4);
+ add_white(i+1,8);
+ add_white(i+1,12);
+ add_white(i+1,16);
+ add_white(i+1,20);
+ add_white(i+1,24);
+ add_white(i+1,28);
+ add_white(i+1,32);
+ add_white(i+1,36);
+ }
+ gp.Bar = gp.nwhite;
/* Shuffle the white cherry list */
- for ( i = nw-1 ; i >= 0 ; i-- ) {
+ for ( i = gp.nwhite-1 ; i >= 0 ; i-- ) {
struct xy tmp;
j = irnd(i+1);