confused with the "Insert" key for jumping to the last editor cascade
block in the element list)
* added Rocks'n'Diamonds icon for use as window icon to SDL version
+ * added key shortcut "Alt + Enter" to toggle fullscreen mode at any time
2006-08-01
* added selection of preferred fullscreen mode to setup / graphics menu
-#define COMPILE_DATE_STRING "[2006-08-05 00:42]"
+#define COMPILE_DATE_STRING "[2006-08-05 02:13]"
if (key_status == KEY_RELEASED)
return;
+ if (key == KSYM_Return && GetKeyModState() & KMOD_Alt &&
+ video.fullscreen_available)
+ {
+ setup.fullscreen = !setup.fullscreen;
+
+ ToggleFullscreenIfNeeded();
+
+ return;
+ }
+
if (game_status == GAME_MODE_PLAYING && AllPlayersGone &&
(key == KSYM_Return || key == setup.shortcut.toggle_pause))
{
DrawTextSCentered(MENU_TITLE2_YPOS, FONT_TITLE_2, PROGRAM_COPYRIGHT_STRING);
}
-static void ToggleFullscreenIfNeeded()
-{
- if (setup.fullscreen != video.fullscreen_enabled ||
- setup.fullscreen_mode != video.fullscreen_mode_current)
- {
- /* save old door content */
- BlitBitmap(backbuffer, bitmap_db_door,
- DX, DY, DXSIZE, DYSIZE, DOOR_GFX_PAGEX1, DOOR_GFX_PAGEY1);
-
- if (setup.fullscreen && video.fullscreen_enabled)
- {
- /* keep fullscreen mode, but change screen mode */
- video.fullscreen_mode_current = setup.fullscreen_mode;
- video.fullscreen_enabled = FALSE;
- }
-
- /* toggle fullscreen */
- ChangeVideoModeIfNeeded(setup.fullscreen);
- setup.fullscreen = video.fullscreen_enabled;
-
- /* redraw background to newly created backbuffer */
- BlitBitmap(graphic_info[IMG_GLOBAL_BORDER].bitmap, backbuffer,
- 0,0, WIN_XSIZE,WIN_YSIZE, 0,0);
-
- /* restore old door content */
- BlitBitmap(bitmap_db_door, backbuffer,
- DOOR_GFX_PAGEX1, DOOR_GFX_PAGEY1, DXSIZE, DYSIZE, DX, DY);
-
- redraw_mask = REDRAW_ALL;
- }
-}
-
static int getLastLevelButtonPos()
{
return 10;
PlayMusic(music);
}
+
+void ToggleFullscreenIfNeeded()
+{
+ if (setup.fullscreen != video.fullscreen_enabled ||
+ setup.fullscreen_mode != video.fullscreen_mode_current)
+ {
+ Bitmap *tmp_backbuffer = CreateBitmap(WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH);
+
+ /* save backbuffer content which gets lost when toggling fullscreen mode */
+ BlitBitmap(backbuffer, tmp_backbuffer, 0, 0, WIN_XSIZE, WIN_YSIZE, 0, 0);
+
+ if (setup.fullscreen && video.fullscreen_enabled)
+ {
+ /* keep fullscreen mode, but change screen mode */
+ video.fullscreen_mode_current = setup.fullscreen_mode;
+ video.fullscreen_enabled = FALSE;
+ }
+
+ /* toggle fullscreen */
+ ChangeVideoModeIfNeeded(setup.fullscreen);
+ setup.fullscreen = video.fullscreen_enabled;
+
+ /* restore backbuffer content from temporary backbuffer backup bitmap */
+ BlitBitmap(tmp_backbuffer, backbuffer, 0, 0, WIN_XSIZE, WIN_YSIZE, 0, 0);
+
+ FreeBitmap(tmp_backbuffer);
+
+ redraw_mask = REDRAW_ALL;
+ }
+}
void PlayMenuSoundIfLoop();
void PlayMenuMusic();
+void ToggleFullscreenIfNeeded();
+
#endif /* TOOLS_H */