| version 1.17, 2003/11/07 18:17:35 |
version 1.18, 2003/11/07 21:38:17 |
|
|
| * All rights reserved. |
* All rights reserved. |
| */ |
*/ |
| |
|
| /* $Platon: games/mines/mines.c,v 1.16 2003/11/04 22:00:52 nepto Exp $ */ |
/* $Platon: games/mines/mines.c,v 1.17 2003/11/07 18:17:35 nepto Exp $ */ |
| |
|
| /* LANGUAGE */ |
/* LANGUAGE */ |
| #define LANG_ENGLISH_NEW 0 |
#define LANG_ENGLISH_NEW 0 |
| Line 455 char *strdel(char *s); |
|
| Line 455 char *strdel(char *s); |
|
| |
|
| /* /////////////////////////////////////////////////////////////////////// */ |
/* /////////////////////////////////////////////////////////////////////// */ |
| /* MAIN */ |
/* MAIN */ |
| int main(int argc,char*argv[]) |
int main(int argc, char **argv) |
| { |
{ |
| register WORD k; |
register WORD k; |
| gotoxy(1,25); |
gotoxy(1,25); |
| Line 466 int main(int argc,char*argv[]) |
|
| Line 466 int main(int argc,char*argv[]) |
|
| setcbrk(1); |
setcbrk(1); |
| ctrlbrk(brkfnc); |
ctrlbrk(brkfnc); |
| atexit(koniec); |
atexit(koniec); |
| |
#if 0 |
| |
#if PLATON_SYSTEM_MSDOS |
| if (argc>1) { |
if (argc>1) { |
| puts(ERR_ARGC); |
puts(ERR_ARGC); |
| return 1; |
return 1; |
| } |
} |
| #if PLATON_SYSTEM_MSDOS |
|
| { |
{ |
| char exename[]=EXENAME; |
char exename[]=EXENAME; |
| if (strcmpi(exename,argv[0]+strlen(argv[0])-strlen(exename))) { |
if (strcmpi(exename,argv[0]+strlen(argv[0])-strlen(exename))) { |
| Line 479 int main(int argc,char*argv[]) |
|
| Line 480 int main(int argc,char*argv[]) |
|
| } |
} |
| } |
} |
| #endif |
#endif |
| |
#endif |
| if (!initmouse()) { |
if (!initmouse()) { |
| puts(ERR_MOUSE); |
puts(ERR_MOUSE); |
| return 1; |
return 1; |
| } |
} |
| #if PLATON_SYSTEM_MSDOS |
#if PLATON_SYSTEM_MSDOS |
| |
argc = argc; /* just to prevent warning */ |
| hiscore_init(argv[0], HISCORE_AUTODETECT); |
hiscore_init(argv[0], HISCORE_AUTODETECT); |
| #elif PLATON_SYSTEM_WIN32 |
#elif PLATON_SYSTEM_WIN32 |
| hiscore_init("c:\\windows\\mines.hsc", 0L); |
hiscore_init("c:\\windows\\mines.hsc", 0L); |
| Line 896 void WriteInfo(int x, int y) /* {{{ */ |
|
| Line 899 void WriteInfo(int x, int y) /* {{{ */ |
|
| } |
} |
| |
|
| /* HideInfo() */ |
/* HideInfo() */ |
| if (x == 0xffff && y == 0xffff) { |
if ((WORD) x == 0xffff && (WORD) y == 0xffff) { |
| if (infosafe != NULL) { |
if (infosafe != NULL) { |
| free(infosafe); |
free(infosafe); |
| infosafe = NULL; |
infosafe = NULL; |
| Line 944 BYTE DoAll(void) /* {{{ */ |
|
| Line 947 BYTE DoAll(void) /* {{{ */ |
|
| { |
{ |
| WORD x,y,xold=0xffff,yold=0,mlstant=0,mrstant=0,cminesold=0; |
WORD x,y,xold=0xffff,yold=0,mlstant=0,mrstant=0,cminesold=0; |
| BYTE but = 0, first_click = 1; |
BYTE but = 0, first_click = 1; |
| clock_t start,curr,clktmp; |
clock_t start, curr, clktmp; |
| start=curr=clock(); |
start = curr = clock(); |
| |
|
| xoff=(getmaxx()+1-nx*barsize)/2; |
xoff=(getmaxx()+1-nx*barsize)/2; |
| yoff=(getmaxy()+1-ny*barsize)/2; |
yoff=(getmaxy()+1-ny*barsize)/2; |
| Line 979 BYTE DoAll(void) /* {{{ */ |
|
| Line 982 BYTE DoAll(void) /* {{{ */ |
|
| if (!but) { |
if (!but) { |
| switch (but = getch()) { |
switch (but = getch()) { |
| case 59: /* F1 */ |
case 59: /* F1 */ |
| |
clktmp = clock(); |
| hidemouse(); |
hidemouse(); |
| desktop_save_or_restore(DESKTOP_SAVE); |
desktop_save_or_restore(DESKTOP_SAVE); |
| FadeOut(); |
FadeOut(); |
| Line 987 BYTE DoAll(void) /* {{{ */ |
|
| Line 991 BYTE DoAll(void) /* {{{ */ |
|
| hidemouse(); |
hidemouse(); |
| desktop_save_or_restore(DESKTOP_RESTORE); |
desktop_save_or_restore(DESKTOP_RESTORE); |
| showmouse(); |
showmouse(); |
| |
start += clock() - clktmp; |
| break; |
break; |
| case 62: /* F4 */ |
case 62: /* F4 */ |
| hidemouse(); |
hidemouse(); |