Subversion Repositories Games.Chess Giants

Rev

Rev 192 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 192 Rev 194
Line 99... Line 99...
99
   hMOTDWnd = NULL;
99
   hMOTDWnd = NULL;
100
   hOpponentsWnd = NULL;
100
   hOpponentsWnd = NULL;
101
   hSoughtWnd = NULL;
101
   hSoughtWnd = NULL;
102
   is_paused = false; // clear pause status
102
   is_paused = false; // clear pause status
103
#ifdef NO_REGISTRATION
103
#ifdef NO_REGISTRATION
104
   is_registered = true;
-
 
105
   want_framerate = true; // display framerate in debug mode
104
   want_framerate = IsDebuggerPresent (); // display framerate in debug mode
106
#else // !NO_REGISTRATION
105
#else // !NO_REGISTRATION
107
   is_registered = false;
106
   is_registered = false;
108
   dont_nag = false;
107
   dont_nag = false;
109
   want_framerate = false; // release mode, don't display framerate
108
   want_framerate = false; // release mode, don't display framerate
110
#endif // NO_REGISTRATION
109
#endif // NO_REGISTRATION
Line 203... Line 202...
203
   wc.hInstance = hAppInstance;
202
   wc.hInstance = hAppInstance;
204
   wc.hIcon = LoadIcon (hAppInstance, (wchar_t *) ICON_MAIN);
203
   wc.hIcon = LoadIcon (hAppInstance, (wchar_t *) ICON_MAIN);
205
   wc.hCursor = LoadCursor (NULL, IDC_ARROW);
204
   wc.hCursor = LoadCursor (NULL, IDC_ARROW);
206
   wc.lpszClassName = PROGRAM_NAME L" WndClass";
205
   wc.lpszClassName = PROGRAM_NAME L" WndClass";
207
   RegisterClassEx (&wc);
206
   RegisterClassEx (&wc);
208
   swprintf_s (temp_string, WCHAR_SIZEOF (temp_string), PROGRAM_NAME L"%s", (is_registered ? L"" : LOCALIZE (L"EvaluationMode"))); // build window title
207
   swprintf_s (temp_string, WCHAR_SIZEOF (temp_string), PROGRAM_NAME L"%s",
-
 
208
#ifndef NO_REGISTRATION
-
 
209
               (is_registered ?
-
 
210
#endif // !NO_REGISTRATION
-
 
211
               L""
-
 
212
#ifndef NO_REGISTRATION
-
 
213
               : LOCALIZE (L"EvaluationMode"))
-
 
214
#endif // !NO_REGISTRATION
-
 
215
   ); // build window title
209
   if (options.want_fullscreen)
216
   if (options.want_fullscreen)
210
      hMainWnd = CreateWindowEx (0, wc.lpszClassName, temp_string, WS_POPUPWINDOW, // temp_string holds window title
217
      hMainWnd = CreateWindowEx (0, wc.lpszClassName, temp_string, WS_POPUPWINDOW, // temp_string holds window title
211
                                 0, 0, GetSystemMetrics (SM_CXSCREEN), GetSystemMetrics (SM_CYSCREEN), NULL, NULL, hAppInstance, NULL);
218
                                 0, 0, GetSystemMetrics (SM_CXSCREEN), GetSystemMetrics (SM_CYSCREEN), NULL, NULL, hAppInstance, NULL);
212
   else
219
   else
213
   {
220
   {
Line 362... Line 369...
362
         SendInput (1, &mousemove_input, sizeof (mousemove_input)); // send a fake mouse move input event
369
         SendInput (1, &mousemove_input, sizeof (mousemove_input)); // send a fake mouse move input event
363
 
370
 
364
         screensaverwatchdog_feedtime = current_time + 50.0f; // feed screensaver watchdog again in 50 seconds
371
         screensaverwatchdog_feedtime = current_time + 50.0f; // feed screensaver watchdog again in 50 seconds
365
      }
372
      }
366
 
373
 
-
 
374
#ifndef NO_REGISTRATION
367
      // are we in demo mode and is it time to quit ?
375
      // are we in demo mode and is it time to quit ?
368
      if (!is_registered && (current_time > DEMO_TIMEOUT))
376
      if (!is_registered && (current_time > DEMO_TIMEOUT))
369
         DestroyWindow (hMainWnd); // if so, send a quit message in order to break the loop
377
         DestroyWindow (hMainWnd); // if so, send a quit message in order to break the loop
-
 
378
#endif // !NO_REGISTRATION
370
 
379
 
371
      // are we in the middle of an animation or just after it ?
380
      // are we in the middle of an animation or just after it ?
372
      if (current_time < animation_endtime + 0.5f)
381
      if (current_time < animation_endtime + 0.5f)
373
         the_scene.update = true; // always update during animations
382
         the_scene.update = true; // always update during animations
374
      else
383
      else
Line 763... Line 772...
763
   EnableMenuItem (GetMenu (hMainWnd), MENUID_CHESSBOARD_RENAMESIDES, (network_player == NULL ? MF_ENABLED : MF_GRAYED));
772
   EnableMenuItem (GetMenu (hMainWnd), MENUID_CHESSBOARD_RENAMESIDES, (network_player == NULL ? MF_ENABLED : MF_GRAYED));
764
 
773
 
765
   // update window title
774
   // update window title
766
   if ((the_board.players[COLOR_WHITE].name[0] != 0) && (the_board.players[COLOR_BLACK].name[0] != 0))
775
   if ((the_board.players[COLOR_WHITE].name[0] != 0) && (the_board.players[COLOR_BLACK].name[0] != 0))
767
   {
776
   {
768
      swprintf_s (window_title, WCHAR_SIZEOF (window_title), L"%s %s %s - " PROGRAM_NAME L"%s", the_board.players[COLOR_WHITE].name, LOCALIZE (L"Versus"), the_board.players[COLOR_BLACK].name, (is_registered ? L"" : LOCALIZE (L"EvaluationMode")));
777
      swprintf_s (window_title, WCHAR_SIZEOF (window_title), L"%s %s %s - " PROGRAM_NAME L"%s", the_board.players[COLOR_WHITE].name, LOCALIZE (L"Versus"), the_board.players[COLOR_BLACK].name,
-
 
778
#ifndef NO_REGISTRATION
-
 
779
                  (is_registered ?
-
 
780
#endif // !NO_REGISTRATION
-
 
781
                  L""
-
 
782
#ifndef NO_REGISTRATION
-
 
783
                  : LOCALIZE (L"EvaluationMode"))
-
 
784
#endif // !NO_REGISTRATION
-
 
785
      );
769
      SetWindowText (hMainWnd, window_title); // update window title
786
      SetWindowText (hMainWnd, window_title); // update window title
770
   }
787
   }
771
   else if (the_board.players[COLOR_WHITE].name[0] != 0)
788
   else if (the_board.players[COLOR_WHITE].name[0] != 0)
772
   {
789
   {
773
      swprintf_s (window_title, WCHAR_SIZEOF (window_title), L"%s - " PROGRAM_NAME L"%s", the_board.players[COLOR_WHITE].name, (is_registered ? L"" : LOCALIZE (L"EvaluationMode")));
790
      swprintf_s (window_title, WCHAR_SIZEOF (window_title), L"%s - " PROGRAM_NAME L"%s", the_board.players[COLOR_WHITE].name,
-
 
791
#ifndef NO_REGISTRATION
-
 
792
                  (is_registered ?
-
 
793
#endif // !NO_REGISTRATION
-
 
794
                  L""
-
 
795
#ifndef NO_REGISTRATION
-
 
796
                  : LOCALIZE (L"EvaluationMode"))
-
 
797
#endif // !NO_REGISTRATION
-
 
798
      );
774
      SetWindowText (hMainWnd, window_title); // update window title
799
      SetWindowText (hMainWnd, window_title); // update window title
775
   }
800
   }
776
 
801
 
777
   // are we in internet mode AND are we logged in ?
802
   // are we in internet mode AND are we logged in ?
778
   if ((network_player != NULL) && network_player->is_logged_in)
803
   if ((network_player != NULL) && network_player->is_logged_in)