X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fscreens.c;h=90225db681b23804d49648fd4f50f9aefdc1d7b8;hb=b4972331ee89ad1a930c3e78ea26562720f64805;hp=c593ac8fd62230ec19b4852c877f0a4ad40ebc26;hpb=c4e1a476135ce36417cdd797481feeaaff4301af;p=rocksndiamonds.git diff --git a/src/screens.c b/src/screens.c index c593ac8f..90225db6 100644 --- a/src/screens.c +++ b/src/screens.c @@ -1,7 +1,7 @@ /*********************************************************** * Rocks'n'Diamonds -- McDuffin Strikes Back! * *----------------------------------------------------------* -* (c) 1995-2000 Artsoft Entertainment * +* (c) 1995-2001 Artsoft Entertainment * * Holger Schemel * * Detmolder Strasse 189 * * 33604 Bielefeld * @@ -62,6 +62,29 @@ void DrawHeadline() DrawTextFCentered(46, FC_RED, WINDOW_SUBTITLE_STRING); } +static void ToggleFullscreenIfNeeded() +{ + if (setup.fullscreen != video.fullscreen_enabled) + { + /* save old door content */ + BlitBitmap(backbuffer, pix[PIX_DB_DOOR], + DX, DY, DXSIZE, DYSIZE, DOOR_GFX_PAGEX1, DOOR_GFX_PAGEY1); + + /* toggle fullscreen */ + ChangeVideoModeIfNeeded(setup.fullscreen); + setup.fullscreen = video.fullscreen_enabled; + + /* redraw background to newly created backbuffer */ + BlitBitmap(pix[PIX_BACK], backbuffer, 0,0, WIN_XSIZE,WIN_YSIZE, 0,0); + + /* restore old door content */ + BlitBitmap(pix[PIX_DB_DOOR], backbuffer, + DOOR_GFX_PAGEX1, DOOR_GFX_PAGEY1, DXSIZE, DYSIZE, DX, DY); + + redraw_mask = REDRAW_ALL; + } +} + void DrawMainMenu() { static struct LevelDirInfo *leveldir_last_valid = NULL; @@ -84,7 +107,8 @@ void DrawMainMenu() UndrawSpecialEditorDoor(); /* needed if last screen was the setup screen and fullscreen state changed */ - setup.fullscreen = ChangeVideoModeIfNeeded(setup.fullscreen); + ToggleFullscreenIfNeeded(); + #ifdef TARGET_SDL SetDrawtoField(DRAW_BACKBUFFER); #endif @@ -677,7 +701,9 @@ void DrawHelpScreenMusicText(int num) DrawTextFCentered(ybottom, FC_BLUE, "Press any key or button for next page"); +#if 0 PlaySoundLoop(background_loop[num]); +#endif } void DrawHelpScreenCreditsText()