X-Git-Url: http://git.shiar.net/netris.git/blobdiff_plain/b9acedeb4df336717c043378799fe005118b1fc6..875286b30ed0217383fc8aed8cfa39b506146be7:/client.c diff --git a/client.c b/client.c index c4de9b1..6c45fc3 100644 --- a/client.c +++ b/client.c @@ -41,7 +41,6 @@ static struct option options[] = { { "level", 1, 0, 'l' }, { "nick", 1, 0, 'n' }, { "team", 1, 0, 't' }, - { "dropmode", 2, 0, 'd' }, { "color", 2, 0, 'C' }, { "slowterm", 2, 0, 'S' }, { "keys", 1, 0, 'k' }, @@ -52,12 +51,12 @@ static struct option options[] = { }; enum { - KT_left, KT_right, KT_rotright, KT_rotleft, KT_drop, KT_down, + KT_left, KT_right, KT_rotright, KT_rotleft, KT_drop, KT_dropsoft, KT_down, KT_faster, KT_pause, KT_redraw, KT_say, KT_quit, KT_numKeys }; static char *keyNames[KT_numKeys+1] = { - "Left", "Right", "RotRight", "RotLeft", "Drop", "Down", + "Left", "Right", "RotRight", "RotLeft", "Drop", "DropSoft", "Down", "Faster", "Pause", "Redraw", "Say", "Quit", NULL }; @@ -134,8 +133,6 @@ void Usage(void) " -t, --team \tJoin a team (don't receive lines from your teammates)\n" " -l, --level \tBegin at a higher level (can be used as handicap)\n" " -k, --keys \tRemap keys (default is \"%s\" for cursors)\n" - " -d, --dropmode\tDrops go into drop mode\n" - " -D, --instadrop\tInstant drop\n" "\n" " -r, --robot \tExecute program to control the game instead of keyboard\n" " -F, --fair-robot\tUse fair robot interface\n" @@ -170,9 +167,6 @@ void HandleOption(char tag, char *value) case 't': //team Players[0].team = atoi(value); break; - case 'd': //dropmode - Sets.dropmode = value ? atoi(value) : 1; - break; case 'C': //color Sets.color = value && strcasecmp(value, "0") ? 1 : 0; break; @@ -333,7 +327,6 @@ void OneGame(void) { int changed = 0; short gameStatus = 2; //2=loop; 1=new piece; 0=quit - int dropMode = 0; int chatMode = 0; char chatText[MSG_WIDTH] = "\0"; @@ -476,14 +469,19 @@ void OneGame(void) else gameStatus = 1; //completely dropped break; - case KT_drop: + case KT_dropsoft: SetITimer(Game.speed, Game.speed); if (DropPiece(me)) { if (spied) SendPacket(me, NP_drop, 0, NULL); - if (!Sets.dropmode) gameStatus = 1; //instadrop } else gameStatus = 1; //dropped - dropMode = Sets.dropmode > 1; + break; + case KT_drop: + SetITimer(Game.speed, Game.speed); + if (DropPiece(me)) { + if (spied) SendPacket(me, NP_drop, 0, NULL); + } + gameStatus = 1; // drop break; case KT_faster: if (game != GT_onePlayer) break; @@ -495,11 +493,6 @@ void OneGame(void) changed = 1; break; } - - if (dropMode && DropPiece(me) > 0) { - SetITimer(Game.speed, Game.speed); - if (spied) SendPacket(me, NP_drop, 0, NULL); - } return; } //GameKey @@ -770,7 +763,6 @@ GameLoop: oldPaused = paused; } //(un)pause } //game loop - dropMode = 0; Players[me].score.score++; CheckClears(me); } //new piece loop @@ -807,7 +799,6 @@ int main(int argc, char **argv) strncpy(Players[0].name, userName, 16); //sizeof(Player.name) Players[0].name[16] = 0; Players[0].alive = 1; - Players[0].dropmode = 0; } //set defaults // if (getopt(argc, argv, "f:") == 'f') @@ -815,7 +806,7 @@ int main(int argc, char **argv) // else ReadConf(CONFIG_FILE); while ((ch = getopt_long( - argc, argv, "hHRk:c:n:odDSCap:i:l:t:", options, NULL + argc, argv, "hHRk:c:n:oSCap:i:l:t:", options, NULL )) != -1) HandleOption(ch, optarg); if (optind < argc) {