X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ftools.c;h=7da6d255c83ac159006baf1ae5849bd83f7effa4;hb=7f77c2e8dcb7ad575fcaf89512f4f616846c8b41;hp=eafeb524763d57c1424d061ff48ca7ce714e230e;hpb=e05dda5c8cc6687dcbc59e182a81aed627e262d0;p=rocksndiamonds.git diff --git a/src/tools.c b/src/tools.c index eafeb524..7da6d255 100644 --- a/src/tools.c +++ b/src/tools.c @@ -138,7 +138,6 @@ void RedrawPlayfield(boolean force_redraw, int x, int y, int width, int height) level.game_engine_type == GAME_ENGINE_TYPE_EM) { /* currently there is no partial redraw -- always redraw whole playfield */ - RedrawPlayfield_EM(TRUE); /* blit playfield from scroll buffer to normal back buffer for fading in */ @@ -184,6 +183,14 @@ void RedrawPlayfield(boolean force_redraw, int x, int y, int width, int height) } } + if (force_redraw) + { + x = gfx.sx; + y = gfx.sy; + width = gfx.sxsize; + height = gfx.sysize; + } + BlitBitmap(drawto, window, x, y, width, height, x, y); } @@ -424,24 +431,24 @@ void FadeExt(int fade_mask, int fade_mode) int post_delay = (fade_mode == FADE_MODE_FADE_OUT ? menu.post_delay : 0); int x, y, width, height; - if (fade_mask & REDRAW_ALL) - { - x = 0; - y = 0; - width = WIN_XSIZE; - height = WIN_YSIZE; - } - else if (fade_mask & REDRAW_FIELD) + if (fade_mask & REDRAW_FIELD) { x = REAL_SX; y = REAL_SY; width = FULL_SXSIZE; height = FULL_SYSIZE; } + else /* REDRAW_ALL */ + { + x = 0; + y = 0; + width = WIN_XSIZE; + height = WIN_YSIZE; + } redraw_mask |= fade_mask; - if (!setup.fading || fade_delay == 0) + if (!setup.fade_screens || fade_delay == 0) { if (fade_mode == FADE_MODE_FADE_OUT) ClearRectangle(backbuffer, x, y, width, height); @@ -2226,6 +2233,10 @@ void WaitForEventToContinue() button_status = MB_RELEASED; +#if 1 + ClearEventQueue(); +#endif + while (still_wait) { if (PendingEvent()) @@ -5306,9 +5317,9 @@ int getGameFrameDelay_EM(int native_em_game_frame_delay) unsigned int InitRND(long seed) { if (level.game_engine_type == GAME_ENGINE_TYPE_EM) - return InitEngineRND_EM(seed); + return InitEngineRandom_EM(seed); else - return InitEngineRND(seed); + return InitEngineRandom_RND(seed); } void InitGraphicInfo_EM(void) @@ -6015,6 +6026,11 @@ void ToggleFullscreenIfNeeded() FreeBitmap(tmp_backbuffer); +#if 1 + /* update visible window/screen */ + BlitBitmap(backbuffer, window, 0, 0, WIN_XSIZE, WIN_YSIZE, 0, 0); +#else redraw_mask = REDRAW_ALL; +#endif } }