Rev 87 | Rev 124 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 87 | Rev 116 | ||
|---|---|---|---|
| Line 151... | Line 151... | ||
| 151 | // create the main menu line, and its accelerators |
151 | // create the main menu line, and its accelerators |
| 152 | hMainMenu = NULL; |
152 | hMainMenu = NULL; |
| 153 | hMainAccelerators = NULL; |
153 | hMainAccelerators = NULL; |
| 154 | CreateOrUpdateApplicationMenu (); |
154 | CreateOrUpdateApplicationMenu (); |
| 155 | 155 | ||
| 156 | // display the splash screen |
156 | // display the splash screen (uglily first, using GDI functions) |
| 157 | memset ((void *) &splash_bmp, 0, sizeof (splash_bmp)); |
157 | memset ((void *) &splash_bmp, 0, sizeof (splash_bmp)); |
| 158 | hSplashBmp = W32LoadImage (L"%s/data/splash.bmp", app_path); // load the splash bitmap |
158 | hSplashBmp = W32LoadImage (L"%s/data/splash.bmp", app_path); // load the splash bitmap |
| 159 | GetObject (hSplashBmp, sizeof (splash_bmp), (void *) &splash_bmp); // get a structure containing its size (among others) |
159 | GetObject (hSplashBmp, sizeof (splash_bmp), (void *) &splash_bmp); // get a structure containing its size (among others) |
| 160 | hdcMem = CreateCompatibleDC (NULL); // create a device context compatible with the screen |
160 | hdcMem = CreateCompatibleDC (NULL); // create a device context compatible with the screen |
| 161 | hbmTmp = SelectBitmap (hdcMem, hSplashBmp); // select our bitmap to use in it |
161 | hbmTmp = SelectBitmap (hdcMem, hSplashBmp); // select our bitmap to use in it |
| Line 208... | Line 208... | ||
| 208 | // before any rendering is done, it's a good idea to know what time it is |
208 | // before any rendering is done, it's a good idea to know what time it is |
| 209 | current_time = ProcessTime (); |
209 | current_time = ProcessTime (); |
| 210 | stoppage_time = 0; |
210 | stoppage_time = 0; |
| 211 | screensaverwatchdog_feedtime = current_time + 50.0f; // feed screensaver watchdog every 50 seconds |
211 | screensaverwatchdog_feedtime = current_time + 50.0f; // feed screensaver watchdog every 50 seconds |
| 212 | 212 | ||
| 213 | // initialize |
213 | // initialize audio and renderer, and display a cleaner version of the splash screen this time :) |
| 214 | if (!Render_Init ()) |
214 | if (!Audio_Init () || !Render_Init (L"%s/data/splash.bmp", app_path)) |
| 215 | return (-1); // bomb out on error |
215 | return (-1); // bomb out on error |
| 216 | 216 | ||
| 217 | // load sprites |
217 | // load sprites |
| 218 | larrow_spriteindex = Render_LoadSprite (L"%s/data/sprites/arrow-left.*", app_path); |
218 | larrow_spriteindex = Render_LoadSprite (L"%s/data/sprites/arrow-left.*", app_path); |
| 219 | rarrow_spriteindex = Render_LoadSprite (L"%s/data/sprites/arrow-right.*", app_path); |
219 | rarrow_spriteindex = Render_LoadSprite (L"%s/data/sprites/arrow-right.*", app_path); |
| Line 414... | Line 414... | ||
| 414 | } |
414 | } |
| 415 | 415 | ||
| 416 | ///////////////////////////////////////////////////////////////////////// |
416 | ///////////////////////////////////////////////////////////////////////// |
| 417 | // at this point, we exited the main loop and we are returning to Windows |
417 | // at this point, we exited the main loop and we are returning to Windows |
| 418 | 418 | ||
| 419 | // release scene, game, themes and shutdown |
419 | // release scene, game, themes and shutdown renderer and audio |
| 420 | Scene_Shutdown (&the_scene); |
420 | Scene_Shutdown (&the_scene); |
| 421 | Board_Shutdown (&the_board); |
421 | Board_Shutdown (&the_board); |
| 422 | Themes_Shutdown (); |
422 | Themes_Shutdown (); |
| 423 | Render_Shutdown (); |
423 | Render_Shutdown (); |
| - | 424 | Audio_Shutdown (); |
|
| 424 | 425 | ||
| 425 | // delete the font resources |
426 | // delete the font resources |
| 426 | DeleteObject (hFontChat); |
427 | DeleteObject (hFontChat); |
| 427 | 428 | ||
| 428 | // delete the bitmap and icon ressources |
429 | // delete the bitmap and icon ressources |