git.shiar.nl
/
netris.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
local player settings together in a struct
[netris.git]
/
client.c
diff --git
a/client.c
b/client.c
index 6ed8087e7df9ad23c24af9c7fea8e850fec56724..8f2b00b1e81a032e788885b855ffe96466574b05 100644
(file)
--- a/
client.c
+++ b/
client.c
@@
-44,7
+44,6
@@
static struct option options[] = {
{ "color", 2, 0, 'C' },
{ "slowterm", 2, 0, 'S' },
{ "keys", 1, 0, 'k' },
{ "color", 2, 0, 'C' },
{ "slowterm", 2, 0, 'S' },
{ "keys", 1, 0, 'k' },
- { "rules", 0, 0, 'R' },
{ "info", 0, 0, 'H' },
{ "help", 0, 0, 'h' },
{ 0, 0, 0, 0 }
{ "info", 0, 0, 'H' },
{ "help", 0, 0, 'h' },
{ 0, 0, 0, 0 }
@@
-77,7
+76,7
@@
static bool paused = 0;
static char lastadd;
static char lastadd;
-void handle_setkeys(char *newKeys)
+
static
void handle_setkeys(char *newKeys)
{
int i, k, ch;
char used[256];
{
int i, k, ch;
char used[256];
@@
-113,7
+112,7
@@
void handle_setkeys(char *newKeys)
exit(1);
}
exit(1);
}
-void Usage(void)
+
static
void Usage(void)
{
Header();
fprintf(stderr,
{
Header();
fprintf(stderr,
@@
-121,7
+120,6
@@
void Usage(void)
"\n"
" -h, --help\t\tPrint this usage information\n"
" -H, --info\t\tShow distribution and warranty information\n"
"\n"
" -h, --help\t\tPrint this usage information\n"
" -H, --info\t\tShow distribution and warranty information\n"
- " -R, --rules\t\tShow game rules\n"
"\n"
" -S, --slowterm\tDisable inverse/bold/color for slow terminals\n"
" -a, --ascii\t\tUse ascii characters\n"
"\n"
" -S, --slowterm\tDisable inverse/bold/color for slow terminals\n"
" -a, --ascii\t\tUse ascii characters\n"
@@
-138,7
+136,7
@@
void Usage(void)
);
}
);
}
-void handle_arg(char tag, char *value)
+
static
void handle_arg(char tag, char *value)
{
switch (tag) {
case 'a': //ascii
{
switch (tag) {
case 'a': //ascii
@@
-177,9
+175,6
@@
void handle_arg(char tag, char *value)
Header();
DistInfo();
exit(0);
Header();
DistInfo();
exit(0);
- case 'R': //rules
- Rules();
- exit(0);
case 'h': //help
Usage();
exit(0);
case 'h': //help
Usage();
exit(0);
@@
-189,7
+184,7
@@
void handle_arg(char tag, char *value)
}
}
}
}
-void handle_conffile(char *filename)
+
static
void handle_conffile(char *filename)
{
FILE *file_in;
char buf[513];
{
FILE *file_in;
char buf[513];
@@
-222,7
+217,7
@@
void handle_conffile(char *filename)
} //defaults
}
} //defaults
}
-int game_piece(int scr, char shape)
+
static
int game_piece(int scr, char shape)
{
Players[scr].score.pieces++;
{
{
Players[scr].score.pieces++;
{
@@
-242,7
+237,7
@@
int game_piece(int scr, char shape)
return 1;
}
return 1;
}
-void game_setpaused(void)
+
static
void game_setpaused(void)
{ //check whether anyone paused the game
int i;
{ //check whether anyone paused the game
int i;
@@
-251,7
+246,7
@@
void game_setpaused(void)
paused |= (Players[i].flags & SCF_paused) != 0;
}
paused |= (Players[i].flags & SCF_paused) != 0;
}
-void game_reset(void)
+
static
void game_reset(void)
{ //init new game
int i;
{ //init new game
int i;
@@
-274,7
+269,7
@@
void game_reset(void)
InitFields();
}
InitFields();
}
-void game_clear(int scr)
+
static
void game_clear(int scr)
{ //check for full lines
int linesCleared;
int linevalues[] = { 40, 100, 400, 1200, }; //= 50*lines! - 10*(lines==1)
{ //check for full lines
int linesCleared;
int linevalues[] = { 40, 100, 400, 1200, }; //= 50*lines! - 10*(lines==1)
@@
-318,7
+313,7
@@
void game_clear(int scr)
} //lines cleared
}
} //lines cleared
}
-void game_loop(void)
+
static
void game_loop(void)
{
bool changed = 0;
short gameStatus = 2; //2=loop; 1=new piece; 0=quit
{
bool changed = 0;
short gameStatus = 2; //2=loop; 1=new piece; 0=quit
@@
-709,7
+704,7
@@
void game_loop(void)
} //new piece
while (gameStatus == 2) {
for (i = 1; i < MAX_SCREENS; i++)
} //new piece
while (gameStatus == 2) {
for (i = 1; i < MAX_SCREENS; i++)
- if (Players[i].alive > 0 &&
PlayerDisp[i]
)
+ if (Players[i].alive > 0 &&
window[i].shown
)
changed |= RefreshBoard(i);
if (changed) {
if (!paused) ShowTime();
changed |= RefreshBoard(i);
if (changed) {
if (!paused) ShowTime();
@@
-794,7
+789,7
@@
int main(int argc, char **argv)
// else
handle_conffile(CONFIG_FILE);
while ((ch = getopt_long(
// else
handle_conffile(CONFIG_FILE);
while ((ch = getopt_long(
- argc, argv, "hH
R
k:c:n:oSCap:i:l:t:", options, NULL
+ argc, argv, "hHk:c:n:oSCap:i:l:t:", options, NULL
)) != -1)
handle_arg(ch, optarg);
if (optind < argc) {
)) != -1)
handle_arg(ch, optarg);
if (optind < argc) {