X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ftools.c;h=415935a4ed98f9772989edf5f8bd2c6f62b2f0c6;hb=c71f734c9f306daaca1a262d9f07ddae5bc71073;hp=3228959755cc0ea844df4885eb485e2e62e244c8;hpb=5b31d2c27a79ba23688c130c3324cadfa110d0fa;p=rocksndiamonds.git diff --git a/src/tools.c b/src/tools.c index 32289597..415935a4 100644 --- a/src/tools.c +++ b/src/tools.c @@ -274,7 +274,7 @@ void BackToFront() if (redraw_mask & REDRAW_TILES && game_status == GAME_MODE_PLAYING && - border.draw_masked[game_status]) + border.draw_masked[GAME_MODE_PLAYING]) redraw_mask |= REDRAW_FIELD; if (global.fps_slowdown && game_status == GAME_MODE_PLAYING) @@ -315,7 +315,10 @@ void BackToFront() SyncDisplay(); #if 1 - DrawMaskedBorder(redraw_mask); + if (game_status != GAME_MODE_PLAYING || + redraw_mask & REDRAW_FROM_BACKBUFFER || + buffer == backbuffer) + DrawMaskedBorder(redraw_mask); #endif if (redraw_mask & REDRAW_ALL) @@ -333,9 +336,6 @@ void BackToFront() if (game_status != GAME_MODE_PLAYING || redraw_mask & REDRAW_FROM_BACKBUFFER) { -#if 0 - DrawMaskedBorder(REDRAW_FIELD); -#endif BlitBitmap(backbuffer, window, REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE, REAL_SX, REAL_SY); } @@ -354,21 +354,22 @@ void BackToFront() ABS(ScreenMovPos) == ScrollStepSize || redraw_tiles > REDRAWTILES_THRESHOLD) { -#if 1 - if (border.draw_masked[GFX_SPECIAL_ARG_MAIN]) + if (border.draw_masked[GAME_MODE_PLAYING]) { - BlitBitmap(buffer, backbuffer, fx, fy, SXSIZE, SYSIZE, SX, SY); + if (buffer != backbuffer) + { + BlitBitmap(buffer, backbuffer, fx, fy, SXSIZE, SYSIZE, SX, SY); + DrawMaskedBorder(REDRAW_FIELD); + } - DrawMaskedBorder(REDRAW_FIELD); BlitBitmap(backbuffer, window, REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE, REAL_SX, REAL_SY); } else + { BlitBitmap(buffer, window, fx, fy, SXSIZE, SYSIZE, SX, SY); -#else - BlitBitmap(buffer, window, fx, fy, SXSIZE, SYSIZE, SX, SY); -#endif + } #if 0 #ifdef DEBUG @@ -392,28 +393,13 @@ void BackToFront() if (redraw_mask & REDRAW_DOORS) { if (redraw_mask & REDRAW_DOOR_1) - { -#if 0 - DrawMaskedBorder(REDRAW_DOOR_1); -#endif BlitBitmap(backbuffer, window, DX, DY, DXSIZE, DYSIZE, DX, DY); - } if (redraw_mask & REDRAW_DOOR_2) - { -#if 0 - DrawMaskedBorder(REDRAW_DOOR_2); -#endif BlitBitmap(backbuffer, window, VX, VY, VXSIZE, VYSIZE, VX, VY); - } if (redraw_mask & REDRAW_DOOR_3) - { -#if 0 - DrawMaskedBorder(REDRAW_DOOR_3); -#endif BlitBitmap(backbuffer, window, EX, EY, EXSIZE, EYSIZE, EX, EY); - } redraw_mask &= ~REDRAW_DOORS; } @@ -627,19 +613,39 @@ void SetPanelBackground() SetDoorBackgroundBitmap(bitmap_db_panel); } -void DrawBackground(int dst_x, int dst_y, int width, int height) +void DrawBackground(int x, int y, int width, int height) { /* !!! "drawto" might still point to playfield buffer here (see below) !!! */ /* (when entering hall of fame after playing) */ #if 0 - ClearRectangleOnBackground(drawto, dst_x, dst_y, width, height); + ClearRectangleOnBackground(drawto, x, y, width, height); #else - ClearRectangleOnBackground(backbuffer, dst_x, dst_y, width, height); + ClearRectangleOnBackground(backbuffer, x, y, width, height); #endif redraw_mask |= REDRAW_FIELD; } +void DrawBackgroundForFont(int x, int y, int width, int height, int font_nr) +{ + struct FontBitmapInfo *font = getFontBitmapInfo(font_nr); + + if (font->bitmap == NULL) + return; + + DrawBackground(x, y, width, height); +} + +void DrawBackgroundForGraphic(int x, int y, int width, int height, int graphic) +{ + struct GraphicInfo *g = &graphic_info[graphic]; + + if (g->bitmap == NULL) + return; + + DrawBackground(x, y, width, height); +} + void ClearWindow() { /* !!! "drawto" might still point to playfield buffer here (see above) !!! */