Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Friday, October 16, 2026

Diff for games/mines/mines.c between version 1.15 and 1.16

version 1.15, 2003/10/27 09:57:36 version 1.16, 2003/11/04 22:00:52
Line 8 
Line 8 
  * All rights reserved.   * All rights reserved.
  */   */
   
 /* $Platon: games/mines/mines.c,v 1.14 2003/08/12 20:51:00 nepto Exp $ */  /* $Platon: games/mines/mines.c,v 1.15 2003/10/27 09:57:36 nepto Exp $ */
   
   /* LANGUAGE */
   #define LANG_ENGLISH_NEW        0
   #define LANG_ENGLISH_OLD        1
   #define LANG_SLOVAK                     2
   #define LANG_ENGLISH            LANG_ENGLISH_NEW
   #define LANGUAGE                        LANG_ENGLISH /* alter this to change language */
   
 #define PSQUARE_DYNAMIC_ALLOCATION      (0)  #define PSQUARE_DYNAMIC_ALLOCATION      (0)
 #define ASSERTION_USAGE                         (1)  #define ASSERTION_USAGE                         (1)
   
 /* CONSTS */  /* CONSTS */
 #define EXENAME     "mines.exe"  #if LANGUAGE == LANG_SLOVAK
 #define ERR_ARGC    "Pr¡lis vela argumentov v pr¡kazovom riadku."  #  define EXENAME     "mines.exe"
 #define ERR_EXEC    "Nem“zem spustit"  #  define ERR_ARGC    "Pr¡lis vela argumentov v pr¡kazovom riadku."
 #define ERR_BREAK   "Chyba v presmerovan¡ Ctrl-Break." /* N/A */  #  define ERR_EXEC    "Nem“zem spustit"
 #define ERR_MOUSE   "Tento program potrebuje mys."  #  define ERR_BREAK   "Chyba v presmerovan¡ Ctrl-Break." /* N/A */
 #define ERR_WRITE   "Chyba pri z pise. Plny disk?"  #  define ERR_MOUSE   "Tento program potrebuje mys."
 #define ERR_MEMORY  "Nedostatok volnej pam„te."  #  define ERR_WRITE   "Chyba pri z pise. Plny disk?"
 #define ERR_GRAPH   "Chyba grafiky:"  #  define ERR_MEMORY  "Nedostatok volnej pam„te."
   #  define ERR_GRAPH   "Chyba grafiky:"
   #  define STR_OK                "OK"
   #  define STR_YES               "Ano"
   #  define STR_NO                "Nie"
   #  define STR_RESET             "Reset"
   #  define STR_MORE_INFO         "viac info"
   #  define STR_PLAYGROUND_WIDTH  "S¡rka pola"
   #  define STR_PLAYGROUND_HEIGHT "Vyska pola"
   #  define STR_INFO_TABLE        "Info tabulka"
   #  define STR_PAUSE             "P A U Z A"
   #  define STR_CLICK_HERE        "Klikni sem pre pokracovanie..."
   #  define STR_WELL_DONE         "Hotovo!"
   #  define STR_MINES_REPORT      "%u m¡n si zlikvidoval(a) na ploche %ux%u za %u:%02u:%02u"
   #  define STR_ENTER_YOUR_NAME   "Zadaj svoje meno:"
   #  define STR_BAD_LUCK          "Upsss... SMOLA!"
   #  define STR_PLAY_AGAIN        "Chces hrat znovu?"
   #  define STR_HELP              "Pomoc"
   #  define STR_OTHER_PROGRAMS    "In‚ programy"
   #  define STR_SOURCE_EXAMPLE    "Uk zka zdrojov‚ho textu z tohto programu"
   #  define STR_BACK              "<--sp„t--"
   #  define STR_DIFFICULTY        "Obtiaznost"
   #  define STR_END_GAME          "Koniec hry?"
   #  define STR_HALL_OF_FAME      "Tabulka najleps¡ch"
   #  define STR_HSC_ENTRY         "M¡n:%u / Velkost:%ux%u / Cas:%u:%02u:%02u / D tum:%u.%u.%u"
   #else
   #  define EXENAME     "mines.exe"
   #  define ERR_ARGC    "Too many arguments in command line."
   #  define ERR_EXEC    "Can't run"
   #  define ERR_BREAK   "Error redirecting Ctrl-Break."
   #  define ERR_MOUSE   "This program requires mouse."
   #  define ERR_WRITE   "Can't write. Disk full?"
   #  define ERR_MEMORY  "Not enough memory"
   #  define ERR_GRAPH   "Graphics error: "
   #  define STR_OK                "OK"
   #  define STR_YES               "Yes"
   #  define STR_NO                "No"
   #  define STR_RESET             "Reset"
   #  define STR_MORE_INFO         "more info"
   #  define STR_PLAYGROUND_WIDTH  "Width"
   #  define STR_PLAYGROUND_HEIGHT "Height"
   #  define STR_INFO_TABLE        "Info table"
   #  define STR_PAUSE             "P A U S E"
   #  define STR_CLICK_HERE        "Click here to continue..."
   #  define STR_WELL_DONE         "Well done!"
   #  define STR_MINES_REPORT      "%u mines on %ux%u size playground were destroyed in %u:%02u:%02u"
   #  define STR_ENTER_YOUR_NAME   "Enter your name:"
   #  define STR_BAD_LUCK          "Upsss... SHAME!"
   #  define STR_PLAY_AGAIN        "Do you want to play again?"
   #  define STR_HELP              "Help"
   #  define STR_OTHER_PROGRAMS    "Other programs"
   #  define STR_SOURCE_EXAMPLE    "This program source code example"
   #  define STR_BACK              "<--back--"
   #  define STR_DIFFICULTY        "Difficulty"
   #  define STR_END_GAME          "End game?"
   #  define STR_HALL_OF_FAME      "Hall of fame"
   #  define STR_HSC_ENTRY         "Mines:%u / Size:%ux%u / Time:%u:%02u:%02u / Date:%u.%u.%u"
   #endif
   
 #define MINBARSIZE      (8)  #define MINBARSIZE      (8)
 #define MAXBARSIZE      (18)  #define MAXBARSIZE      (18)
Line 149  STSQUARE *psquare;
Line 213  STSQUARE *psquare;
 STSQUARE psquare[MAXNX * MAXNY];  STSQUARE psquare[MAXNX * MAXNY];
 #endif  #endif
 /* All unneccessary question marks will be removed. */  /* All unneccessary question marks will be removed. */
   #if LANGUAGE == LANG_SLOVAK
 char infostr1[]="Super Mines v????????? - (c) 1999 Condy software inc.",  char infostr1[]="Super Mines v????????? - (c) 1999 Condy software inc.",
         infostr2[]="Ondrej Jomb¡k - Gymn zium Bil¡kova 24 - Okt va C - 1998/99",          infostr2[]="Ondrej Jomb¡k - Gymn zium Bil¡kova 24 - Okt va C - 1998/99",
         *infostr3[]={"       "," MINES ","","   x   ","","  Cas  "," :  :  ","","  M¡n  ","--   --","","EscMenu","F1Pomoc","F4Pauza"};          *infostr3[]={"       "," MINES ","","   x   ","","  Cas  "," :  :  ","","  M¡n  ","--   --","","EscMenu","F1Pomoc","F4Pauza"};
 char*yesnostr[]={"Ano","Nie",NULL};  char*yesnostr[]={"Ano","Nie",NULL};
   #else
   char infostr1[]="Super Mines v????????? by Ondrej Jombik <nepto@platon.sk>",
           infostr2[]="Copyright (c) 2001-2003 Platon SDG, http://platon.sk/",
           *infostr3[]={"       "," MINES ","","   x   ",""," Time  "," :  :  ",""," Mines ","--   --","","EscExit","F1Help ","F4Pause"};
   char*yesnostr[]={"Yes","No",NULL};
   #endif
 BYTE barsize,                           /* pixels by square */  BYTE barsize,                           /* pixels by square */
         diff=DEFDIFF,          diff=DEFDIFF,
         itabsize=DEFITABSIZE,   /* Info Tab Size */          itabsize=DEFITABSIZE,   /* Info Tab Size */
Line 338  void koniec(void) /* {{{ */
Line 409  void koniec(void) /* {{{ */
         hiscore_close();          hiscore_close();
         fcloseall();          fcloseall();
         endstring("MINES");          endstring("MINES");
   #if (LANGUAGE == LANG_ENGLISH)
           /* TODO */
           printf("Platon\n");
   #else
         randomize();          randomize();
         switch (RAND_INT(0, 3)) {          switch (RAND_INT(0, 3)) {
                 case 0:                  case 0:
Line 381  void koniec(void) /* {{{ */
Line 455  void koniec(void) /* {{{ */
                         break;                          break;
         }          }
         textattr(0x07);cputs("\n\r");          textattr(0x07);cputs("\n\r");
   #endif
 } /* }}} */  } /* }}} */
   
 void WriteError(void) /* {{{ */  void WriteError(void) /* {{{ */
Line 395  BYTE MainMenu(void) /* {{{ */
Line 470  BYTE MainMenu(void) /* {{{ */
 {  {
         register BYTE but;          register BYTE but;
         WORD x,y;          WORD x,y;
   #if (LANGUAGE == LANG_ENGLISH)
           char*menustr[]={"New game","Settings","Hall of fame","Information","Quit to OS",NULL};
           char*itabstr[]={"Normal","High","Very high"};
           char*infostr[]={"Systematically analyzed,","psychically transformed", "and as well as programmed by:","Ondrej Jombik"};
   #else
         char*menustr[]={"Nov  Hra","Nastavenie","Tabulka najleps¡ch","Inform cie","Odchod do DOSu",NULL};          char*menustr[]={"Nov  Hra","Nastavenie","Tabulka najleps¡ch","Inform cie","Odchod do DOSu",NULL};
         char*itabstr[]={"Norm lna","Velk ","Velmi velk "};          char*itabstr[]={"Norm lna","Velk ","Velmi velk "};
         char*infostr[]={"Systematicky analyzoval,","psychicky transformoval", "a v konecnom d“sledku naprogramoval:","Ondrej Jomb¡k"};          char*infostr[]={"Systematicky analyzoval,","psychicky transformoval", "a v konecnom d“sledku naprogramoval:","Ondrej Jomb¡k"};
   #endif
         FadeOut();          FadeOut();
         hidemouse();          hidemouse();
         DrawWindow(0,0,getmaxx(),getmaxy(),BLACK,DARKGRAY);          DrawWindow(0,0,getmaxx(),getmaxy(),BLACK,DARKGRAY);
Line 432  BYTE MainMenu(void) /* {{{ */
Line 513  BYTE MainMenu(void) /* {{{ */
                                 return(but);                                  return(but);
                         case 1:                          case 1:
                                 hidemouse();                                  hidemouse();
                                 DrawDefWindow(420,195,325,menustr[but]);                                  DrawDefWindow( 420, 195, 325, menustr[but]);
                                 DrawNumButton(190,254,"S¡rka pola",nx,GREEN,BLUE,WHITE);                                  DrawNumButton( 190, 254, STR_PLAYGROUND_WIDTH,  nx, GREEN, BLUE, WHITE);
                                 DrawNumButton(190,296,"Vyska pola",ny,GREEN,BLUE,WHITE);                                  DrawNumButton( 190, 296, STR_PLAYGROUND_HEIGHT, ny, GREEN, BLUE, WHITE);
                                 DrawDiffButton(320,254,diff,1);                                  DrawDiffButton(320, 254, diff,1);
                                 DrawNormButton(320,296,"Info tabulka",itabstr[itabsize],BLUE,ColorConvert(itabsize+2),WHITE);                                  DrawNormButton(320, 296, STR_INFO_TABLE, itabstr[itabsize], BLUE, ColorConvert(itabsize+2), WHITE);
                                 DrawNormButton(450,254,"","Reset",RED,WHITE,WHITE);                                  DrawNormButton(450, 254, "", STR_RESET, RED, WHITE, WHITE);
                                 DrawNormButton(450,296,"","OK",RED,WHITE,WHITE);                                  DrawNormButton(450, 296, "", STR_OK,    RED, WHITE, WHITE);
                                 showmouse();                                  showmouse();
                                 while (!(but=releasebutton(0,&x,&y))||!isinnormbutton(x,y,450,296)) {                                  while (!(but=releasebutton(0,&x,&y))||!isinnormbutton(x,y,450,296)) {
                                         if (kbhit()) /* catching characters */                                          if (kbhit()) /* catching characters */
Line 446  BYTE MainMenu(void) /* {{{ */
Line 527  BYTE MainMenu(void) /* {{{ */
                                         if (but) {                                          if (but) {
                                                 if (isinnormbutton(x,y,450,254) != 0) { /* Reset */                                                  if (isinnormbutton(x,y,450,254) != 0) { /* Reset */
                                                         hidemouse();                                                          hidemouse();
                                                         nx=DEFNX;DrawNumButton(190,254,"S¡rka pola",nx,GREEN,BLUE,WHITE);                                                          nx = DEFNX;
                                                         ny=DEFNY;DrawNumButton(190,296,"Vyska pola",ny,GREEN,BLUE,WHITE);                                                          ny = DEFNY;
                                                         itabsize=DEFITABSIZE;                                                          itabsize = DEFITABSIZE;
                                                         DrawNormButton(320,296,"Info tabulka",itabstr[itabsize],BLUE,ColorConvert(itabsize+2),WHITE);                                                          diff     = DEFDIFF;
                                                         diff=DEFDIFF;                                                          DrawNumButton( 190, 254, STR_PLAYGROUND_WIDTH,  nx, GREEN, BLUE, WHITE);
                                                         DrawDiffButton(320,254,diff,1);                                                          DrawNumButton( 190, 296, STR_PLAYGROUND_HEIGHT, ny, GREEN, BLUE, WHITE);
                                                           DrawNormButton(320, 296, STR_INFO_TABLE, itabstr[itabsize], BLUE, ColorConvert(itabsize+2), WHITE);
                                                           DrawDiffButton(320, 254, diff, 1);
                                                         showmouse();                                                          showmouse();
                                                 }                                                  }
                                                 if (isinnormbutton(x,y,320,296) != 0) { /* Info table */                                                  if (isinnormbutton(x,y,320,296) != 0) { /* Info table */
Line 459  BYTE MainMenu(void) /* {{{ */
Line 542  BYTE MainMenu(void) /* {{{ */
                                                         if (itabsize>2)                                                          if (itabsize>2)
                                                                 itabsize=0;                                                                  itabsize=0;
                                                         hidemouse();                                                          hidemouse();
                                                         DrawNormButton(320,296,"Info tabulka",itabstr[itabsize],BLUE,ColorConvert(itabsize+2),WHITE);                                                          DrawNormButton(320, 296, STR_INFO_TABLE,
                                                                           itabstr[itabsize], BLUE, ColorConvert(itabsize + 2), WHITE);
                                                         showmouse();                                                          showmouse();
                                                 }                                                  }
                                                 if ((but=isinnormbutton(x,y,320,254))!=0) {                                                  if ((but=isinnormbutton(x,y,320,254))!=0) {
Line 478  BYTE MainMenu(void) /* {{{ */
Line 562  BYTE MainMenu(void) /* {{{ */
                                                                 case 4:nx+=min(10,MAXNX-nx);break;                                                                  case 4:nx+=min(10,MAXNX-nx);break;
                                                         }                                                          }
                                                         hidemouse();                                                          hidemouse();
                                                         DrawNumButton(190,254,"S¡rka pola",nx,GREEN,BLUE,WHITE);                                                          DrawNumButton(190, 254, STR_PLAYGROUND_WIDTH, nx, GREEN, BLUE, WHITE);
                                                         showmouse();                                                          showmouse();
                                                 }                                                  }
                                                 if ((but=isinnumbutton(x,y,190,296))!=0&&((but%2&&ny>1)||(!(but%2)&&ny<MAXNY))) {                                                  if ((but=isinnumbutton(x,y,190,296))!=0&&((but%2&&ny>1)||(!(but%2)&&ny<MAXNY))) {
Line 489  BYTE MainMenu(void) /* {{{ */
Line 573  BYTE MainMenu(void) /* {{{ */
                                                                 case 4:ny+=min(10,MAXNY-ny);break;                                                                  case 4:ny+=min(10,MAXNY-ny);break;
                                                         }                                                          }
                                                         hidemouse();                                                          hidemouse();
                                                         DrawNumButton(190,296,"Vyska pola",ny,GREEN,BLUE,WHITE);                                                          DrawNumButton(190, 296, STR_PLAYGROUND_HEIGHT, ny, GREEN, BLUE, WHITE);
                                                         showmouse();                                                          showmouse();
                                                 }                                                  }
                                         }                                          }
Line 498  BYTE MainMenu(void) /* {{{ */
Line 582  BYTE MainMenu(void) /* {{{ */
                         case 3: /* Information */                          case 3: /* Information */
                                 hidemouse();                                  hidemouse();
                                 DrawDefWindow(420,195,325,menustr[but]);                                  DrawDefWindow(420,195,325,menustr[but]);
                                 DrawNormButton(getmaxx()/2-65,297,"","OK",RED,WHITE,WHITE);                                  DrawNormButton(getmaxx() / 2 - 65, 297, "", STR_OK,        RED, WHITE, WHITE);
                                 DrawNormButton(getmaxx()/2+65,297,"","viac info",RED,WHITE,WHITE);                                  DrawNormButton(getmaxx() / 2 + 65, 297, "", STR_MORE_INFO, RED, WHITE, WHITE);
                                 for (but=0;but<3;but++) {                                  for (but=0;but<3;but++) {
                                         setcolor(ColorConvert(but+2));                                          setcolor(ColorConvert(but+2));
                                         outtextxy(getmaxx()/2,242+but*11,infostr[but]);                                          outtextxy(getmaxx()/2,242+but*11,infostr[but]);
Line 772  BYTE DoAll(void) /* {{{ */
Line 856  BYTE DoAll(void) /* {{{ */
                                                 DrawWindow(getmaxx() / 2 - 150, getmaxy() / 2 - 20,                                                  DrawWindow(getmaxx() / 2 - 150, getmaxy() / 2 - 20,
                                                                 getmaxx() / 2 + 150, getmaxy() / 2 + 20, 15, 0);                                                                  getmaxx() / 2 + 150, getmaxy() / 2 + 20, 15, 0);
                                                 settextstyle(0, 0, 2);                                                  settextstyle(0, 0, 2);
                                                 outtextxy(getmaxx() / 2, getmaxy() / 2 - 6, "P A U Z A");                                                  outtextxy(getmaxx() / 2, getmaxy() / 2 - 6, STR_PAUSE);
                                                 settextstyle(0, 0, 1);                                                  settextstyle(0, 0, 1);
                                                 outtextxy(getmaxx() / 2, getmaxy() / 2 + 10, "Klikni sem pre pokracovanie...");                                                  outtextxy(getmaxx() / 2, getmaxy() / 2 + 10, STR_CLICK_HERE);
                                                 showmouse();                                                  showmouse();
                                                 while ((! releasebutton(0, &x, &y) || ! isinbar(x, y,                                                  while ((! releasebutton(0, &x, &y) || ! isinbar(x, y,
                                                                                 getmaxx() / 2 - 150, getmaxy() / 2 - 20,                                                                                  getmaxx() / 2 - 150, getmaxy() / 2 - 20,
Line 945  BYTE DoAll(void) /* {{{ */
Line 1029  BYTE DoAll(void) /* {{{ */
                                 (void) getch();                                  (void) getch();
                         while (! releasebutton(0, NULL, NULL) && ! kbhit());                          while (! releasebutton(0, NULL, NULL) && ! kbhit());
                         hidemouse();                          hidemouse();
                         DrawDefWindow(500,190,290,"Upsss... SMOLA!");                          DrawDefWindow(500, 190, 290, STR_BAD_LUCK);
                         outtextxy(getmaxx()/2,243,"Chces hrat znovu?");                          outtextxy(getmaxx() / 2, 243, STR_CLICK_HERE);
                         DrawNormButton(getmaxx()/2-65,262,"","Ano",GREEN,WHITE,WHITE);                          DrawNormButton(getmaxx() / 2 - 65, 262, "", STR_YES, GREEN, WHITE, WHITE);
                         DrawNormButton(getmaxx()/2+65,262,"","Nie",RED,WHITE,WHITE);                          DrawNormButton(getmaxx() / 2 + 65, 262, "", STR_NO, RED, WHITE, WHITE);
                         showmouse();                          showmouse();
                         while (kbhit())                          while (kbhit())
                                 (void) getch();                                  (void) getch();
Line 976  BYTE DoAll(void) /* {{{ */
Line 1060  BYTE DoAll(void) /* {{{ */
                         HISCORE_ITEM item;                          HISCORE_ITEM item;
                         char s[80];                          char s[80];
                         hidemouse();                          hidemouse();
                         DrawDefWindow(500,190,290,"Hotovo!");                          DrawDefWindow(500, 190, 290, STR_WELL_DONE);
                         DrawNormButton(getmaxx()/2,262,"","OK",RED,WHITE,WHITE);                          DrawNormButton(getmaxx() / 2, 262, "", STR_OK, RED, WHITE, WHITE);
                         sprintf(s,"%u m¡n si zlikvidoval(a) na ploche %ux%u za %u:%02u:%02u",                          sprintf(s, STR_MINES_REPORT, getmines(nx, ny, diff), nx, ny,
                                         getmines(nx,ny,diff),nx,ny,                                          (unsigned)((curr / CLOCKS_PER_SEC) / 60) / 60,
                                         (unsigned)((curr/CLOCKS_PER_SEC)/60)/60,                                          (unsigned)((curr / CLOCKS_PER_SEC) / 60) % 60,
                                         (unsigned)((curr/CLOCKS_PER_SEC)/60)%60,                                          (unsigned)(curr  / CLOCKS_PER_SEC) % 60);
                                         (unsigned)(curr/CLOCKS_PER_SEC)%60);  
                         setcolor(LIGHTGREEN);outtextxy(getmaxx()/2,245,s);                          setcolor(LIGHTGREEN);outtextxy(getmaxx()/2,245,s);
                         for (k=0; s[k]!=EOS; k++)                          for (k=0; s[k]!=EOS; k++)
                                 if (!isdigit(s[k]))                                  if (!isdigit(s[k]))
Line 1018  BYTE DoAll(void) /* {{{ */
Line 1101  BYTE DoAll(void) /* {{{ */
                                 if (k!=0xff) {                                  if (k!=0xff) {
                                         register BYTE count=0,c;                                          register BYTE count=0,c;
                                         hidemouse();                                          hidemouse();
                                         DrawDefWindow(550,207,273,"Zadaj svoje meno:");                                          DrawDefWindow(550, 207, 273, STR_ENTER_YOUR_NAME);
                                         memset(item.name,EOS,HISCORE_NAME_LEN+1);                                          memset(item.name,EOS,HISCORE_NAME_LEN+1);
                                         while (((c=getch())!=EOL)||(!strlen(item.name))) {                                          while (((c=getch())!=EOL)||(!strlen(item.name))) {
                                                 setcolor(BLUE);outtextxy(getmaxx()/2,257,item.name);                                                  setcolor(BLUE);outtextxy(getmaxx()/2,257,item.name);
Line 1093  rozhoduje mens¡ cas.\n\
Line 1176  rozhoduje mens¡ cas.\n\
                 FadeOut();                  FadeOut();
                 hidemouse();                  hidemouse();
                 cleardevice();                  cleardevice();
                 DrawDefWindow(getmaxx()-30,15,getmaxy()-15,"Pomoc");                  DrawDefWindow(getmaxx()-30,15,getmaxy()-15,STR_HELP);
                 DrawNormButton(getmaxx()/2,getmaxy()-93,"","OK",RED,WHITE,WHITE);                  DrawNormButton(getmaxx()/2,getmaxy()-93,"",STR_OK,RED,WHITE,WHITE);
                 DrawNormButton(40+50,getmaxy()-93,"In‚ programy","Pexeso",BLUE,H_DEFCOLOR,H_INSCOLOR);                  DrawNormButton(40+50,getmaxy()-93,STR_OTHER_PROGRAMS,"Pexeso",BLUE,H_DEFCOLOR,H_INSCOLOR);
                 DrawNormButton(40+75,getmaxy()-78,"","ImageEdit",BLUE,H_DEFCOLOR,H_INSCOLOR);                  DrawNormButton(40+75,getmaxy()-78,"","ImageEdit",BLUE,H_DEFCOLOR,H_INSCOLOR);
                 DrawNormButton(40+100,getmaxy()-63,"","2D / 3D",BLUE,H_DEFCOLOR,H_INSCOLOR);                  DrawNormButton(40+100,getmaxy()-63,"","2D / 3D",BLUE,H_DEFCOLOR,H_INSCOLOR);
                 DrawNormButton(40+125,getmaxy()-48,"","...",BLUE,H_DEFCOLOR,H_INSCOLOR);                  DrawNormButton(40+125,getmaxy()-48,"","...",BLUE,H_DEFCOLOR,H_INSCOLOR);
                 DrawWindow(getmaxx()/2-49,getmaxy()-48,getmaxx()-40,getmaxy()-33,MAGENTA,LIGHTCYAN);                  DrawWindow(getmaxx()/2-49,getmaxy()-48,getmaxx()-40,getmaxy()-33,MAGENTA,LIGHTCYAN);
                 setcolor(WHITE);outtextxy((getmaxx()/2-49+getmaxx()-40)/2,getmaxy()-40,"Uk zka zdrojov‚ho textu z tohto programu");                  setcolor(WHITE);
                   outtextxy((getmaxx()/2-49+getmaxx()-40)/2,getmaxy()-40, STR_SOURCE_EXAMPLE);
                 ShowHelpText(40,70,12,H_DEFCOLOR,H_INSCOLOR,helptext);                  ShowHelpText(40,70,12,H_DEFCOLOR,H_INSCOLOR,helptext);
                 showmouse();                  showmouse();
                 FadeIn();                  FadeIn();
Line 1112  rozhoduje mens¡ cas.\n\
Line 1196  rozhoduje mens¡ cas.\n\
                                                 isinnormbutton(x,y,40+75,getmaxy()-78)||                                                  isinnormbutton(x,y,40+75,getmaxy()-78)||
                                                 isinnormbutton(x,y,40+100,getmaxy()-63)||                                                  isinnormbutton(x,y,40+100,getmaxy()-63)||
                                                 isinnormbutton(x,y,40+125,getmaxy()-48)){                                                  isinnormbutton(x,y,40+125,getmaxy()-48)){
   #if LANGUAGE == LANG_SLOVAK
 char ineprogtext[]="\  char ineprogtext[]="\
 < In‚ programyô?õ Niektor‚ sa nach dzaj£\n\  < In‚ programyô?õ Niektor‚ sa nach dzaj£\n\
 <na mojej ôhomepageõ, ale viac informaci¡\n\  <na mojej ôwebstránkeõ, ale viac informaci¡\n\
 < sa dozviete prostredn¡ctvom ôe-mailõu.\n";  < sa dozviete prostredn¡ctvom ôe-mailõu.\n";
   #else
   char ineprogtext[]="\
   < Other programsô?õ Some of them are located\n\
   <on my ôhomepageõ, but you can get more\n\
   <information through ôe-mailõ.\n";
   #endif
                                         void*safe;                                          void*safe;
                                         static WORD fontcolor=2;                                          static WORD fontcolor=2;
                                         hidemouse();                                          hidemouse();
                                         if ((safe=malloc(imagesize(229,374,getmaxx()-9,getmaxy()-9)))==NULL)exit(1);                                          if ((safe=malloc(imagesize(229,374,getmaxx()-9,getmaxy()-9)))==NULL)exit(1);
                                         getimage(229,374,getmaxx()-9,getmaxy()-9,safe);                                          getimage(229,374,getmaxx()-9,getmaxy()-9,safe);
                                         DrawWindow(229,374,getmaxx()-9,getmaxy()-9,BLUE,WHITE);                                          DrawWindow(229,374,getmaxx()-9,getmaxy()-9,BLUE,WHITE);
                                         DrawNormButton((getmaxx()+229)/2,getmaxy()-38,"","<--sp„t--",GREEN,WHITE,WHITE);                                          DrawNormButton((getmaxx()+229)/2,getmaxy()-38,"",STR_BACK,GREEN,WHITE,WHITE);
                                         ShowHelpText(280,392,15,11+(fontcolor++)%3,WHITE,ineprogtext);                                          ShowHelpText(280,392,15,11+(fontcolor++)%3,WHITE,ineprogtext);
                                         showmouse();                                          showmouse();
                                         while (!(releasebutton(0,&x,&y))                                          while (!(releasebutton(0,&x,&y))
Line 1391  WORD  OpenNearSquares(WORD x,WORD y) /*
Line 1482  WORD  OpenNearSquares(WORD x,WORD y) /*
 /*----------------------------------------------------------------------*/  /*----------------------------------------------------------------------*/
 void DrawDiffButton(WORD x,WORD y,BYTE diff,BYTE label) /* {{{ */  void DrawDiffButton(WORD x,WORD y,BYTE diff,BYTE label) /* {{{ */
 {  {
   #if LANGUAGE == LANG_SLOVAK
         char*diffstr[]={"Lahk ","Norm lna","Tazk ","Velmi tazk "};          char*diffstr[]={"Lahk ","Norm lna","Tazk ","Velmi tazk "};
         DrawNormButton(x,y,label?"Obtiaznost":"",diffstr[diff],BLUE,  #else
                         !diff?CYAN:ColorConvert(diff+1),WHITE);          char*diffstr[]={"Easy","Normal","Difficult","Extrem"};
   #endif
           DrawNormButton(x, y, label ? STR_DIFFICULTY : "", diffstr[diff],
                           BLUE, ! diff ? CYAN : ColorConvert(diff + 1), WHITE);
 } /* }}} */  } /* }}} */
   
 void DrawDefWindow(WORD sizex,WORD y1,WORD y2,char*text) /* {{{ */  void DrawDefWindow(WORD sizex,WORD y1,WORD y2,char*text) /* {{{ */
Line 1461  BYTE YesNo() /* {{{ */
Line 1556  BYTE YesNo() /* {{{ */
         if ((safe = malloc(imagesize(0, 195, getmaxx(), 325))) == NULL)          if ((safe = malloc(imagesize(0, 195, getmaxx(), 325))) == NULL)
                 desktop_save_or_restore(DESKTOP_SAVE);                  desktop_save_or_restore(DESKTOP_SAVE);
         getimage(0, 195, getmaxx(), 325, safe);          getimage(0, 195, getmaxx(), 325, safe);
         DrawDefWindow(420, 195, 325, "Koniec hry?");          DrawDefWindow(420, 195, 325, STR_END_GAME);
         showmouse();          showmouse();
         ret = menu(yesnostr, getmaxx() / 2, 256, 0, 2, 25, RED, LIGHTGREEN);          ret = menu(yesnostr, getmaxx() / 2, 256, 0, 2, 25, RED, LIGHTGREEN);
         settextstyle(0, 0, 1);          settextstyle(0, 0, 1);
Line 1616  void HscTable(void) /* {{{ */
Line 1711  void HscTable(void) /* {{{ */
         HISCORE_ITEM item;          HISCORE_ITEM item;
         char s[80];          char s[80];
         hidemouse();          hidemouse();
         DrawDefWindow(getmaxx(),0,getmaxy(),"Tabulka najleps¡ch");          DrawDefWindow(getmaxx(), 0, getmaxy(), STR_HALL_OF_FAME);
         for (k=0;k<min(hiscore_items(),HISCORE_MAX_ITEMS);k++) {          for (k=0;k<min(hiscore_items(),HISCORE_MAX_ITEMS);k++) {
                 if (hiscore_get_item(&item,k) < 0)                  if (hiscore_get_item(&item,k) < 0)
                         WriteError();                          WriteError();
Line 1632  void HscTable(void) /* {{{ */
Line 1727  void HscTable(void) /* {{{ */
                 outtextxy(10,47+k*40,s);                  outtextxy(10,47+k*40,s);
                 /* STATUS */                  /* STATUS */
                 settextstyle(0,0,1);                  settextstyle(0,0,1);
                 sprintf(s,"M¡n:%u / Velkost:%ux%u / Cas:%u:%02u:%02u / D tum:%u.%u.%u",                  sprintf(s, STR_HSC_ENTRY,
                                 getmines(item.nx,item.ny,item.diff),item.nx,item.ny,                                  getmines(item.nx,item.ny,item.diff),item.nx,item.ny,
                                 item.time.ti_hour,item.time.ti_min,item.time.ti_sec,                                  item.time.ti_hour,item.time.ti_min,item.time.ti_sec,
                                 item.date.da_day,item.date.da_mon,item.date.da_year);                                  item.date.da_day,item.date.da_mon,item.date.da_year);
Line 1647  void HscTable(void) /* {{{ */
Line 1742  void HscTable(void) /* {{{ */
                 settextjustify(CENTER_TEXT,CENTER_TEXT);                  settextjustify(CENTER_TEXT,CENTER_TEXT);
                 DrawDiffButton(566,51+k*40,item.diff,k?0:1);                  DrawDiffButton(566,51+k*40,item.diff,k?0:1);
         }          }
         DrawNormButton(getmaxx()/2,getmaxy()-31,"","OK",RED,WHITE,WHITE);          DrawNormButton(getmaxx() / 2, getmaxy() - 31, "", STR_OK, RED, WHITE, WHITE);
         showmouse();          showmouse();
         FadeIn();          FadeIn();
         while (!(releasebutton(0,&x,&y))          while (!(releasebutton(0,&x,&y))

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top