int chrono = 0;
char *filename = NULL;
+int multi = 0;
int scale = 1;
int height = 20;
fprintf (fd, " -c: time penalty (%s)\n", (chrono) ? "yes" : "no" );
fprintf (fd, " -f: file name (%s)\n", (filename) ? filename : "none");
fprintf (fd, " -h: help message\n");
+ fprintf (fd, " -m: multi players (%s)", (multi) ? "yes" : "no" );
fprintf (fd, " -s: scale [0..3] (%d)\n", scale);
fprintf (fd, " -v: verbose level (%d)\n", verbose);
fprintf (fd, " -w: board width [%d, %d] (%d)\n", minwidth, maxwidth, width);
return usage (1);
}
filename = arg;
+ multi = 0;
+ break;
+ case 'm':
+ multi = 1;
+ filename = NULL;
break;
case 's':
arg = (arg[2]) ? arg + 2 : (--argc > 0) ? *(++argv) : NULL;
/* init all variables */
board_t *board = NULL;
+ board_t *board2 = NULL;
int current = -1;
int lines = 0;
int next = -1;
score = board->score;
} else {
board = initboard (width, height);
+ if (multi) {
+ board2 = initboard (width, height);
+ }
}
setscale (board, scale);
+ if (multi) {
+ setscale (board2, scale);
+ }
/* get blocks */
int nb_blocks = 0;
int ymsg = max (yboard + xoffset + 1 + board->ysize, yhelp + lhelp + yoffset);
int lmsg = xhelp - xmsg + strmaxlen (help, '\n');
+ /* resize windows for multiplayer */
+ if (board2) {
+ board2->xoffset = xhelp + strmaxlen (help, '\n') + xoffset + 1;
+ board2->yoffset = yboard;
+ nextblock->xoffset += (nbdigit + 1) / 2;
+ lmsg += xhelp - xmsg;
+ }
+
/* event loop */
int mode = -1;
int settle = 0;
}
boardwindow (board, 0);
+ if (multi) {
+ boardwindow (board2, 0);
+ }
scorewindow (xscore, yscore, nbdigit, score, (lines / 10) + 1);
int newspeed = 10 + 4900 / (lines / 10 + 1);
if (newspeed != speed) {