cleanup of redraw masks
authorHolger Schemel <info@artsoft.org>
Tue, 19 May 2015 07:46:47 +0000 (09:46 +0200)
committerHolger Schemel <info@artsoft.org>
Tue, 19 May 2015 07:55:03 +0000 (09:55 +0200)
src/game.c
src/libgame/system.h
src/libgame/toons.c
src/tools.c

index 2be5985f4466cde783be13950cba59ce4a7c79b0..6a8967685317b411cd256feb9d8fba756c639555 100644 (file)
@@ -3916,8 +3916,6 @@ void InitGame()
 
   /* blit playfield from scroll buffer to normal back buffer for fading in */
   BlitScreenToBitmap(backbuffer);
-
-  redraw_mask |= REDRAW_FROM_BACKBUFFER;
   /* !!! FIX THIS (END) !!! */
 
   FadeIn(REDRAW_FIELD);
index a6e9b9f33b63b3bb572f1f1317873be97316aa56..85ab383f89342e3c37d9297645e89c36362af49b 100644 (file)
 #define REDRAW_NONE            (0)
 #define REDRAW_ALL             (1 << 0)
 #define REDRAW_FIELD           (1 << 1)
-#define REDRAW_TILES           (1 << 2)
-#define REDRAW_DOOR_1          (1 << 3)
-#define REDRAW_VIDEO_1         (1 << 4)
-#define REDRAW_VIDEO_2         (1 << 5)
-#define REDRAW_VIDEO_3         (1 << 6)
-#define REDRAW_MICROLEVEL      (1 << 7)
-#define REDRAW_MICROLABEL      (1 << 8)
-#define REDRAW_FROM_BACKBUFFER (1 << 9)
-#define REDRAW_DOOR_2          (REDRAW_VIDEO_1 | \
-                                REDRAW_VIDEO_2 | \
-                                REDRAW_VIDEO_3)
-#define REDRAW_DOOR_3          (1 << 10)
+#define REDRAW_DOOR_1          (1 << 2)
+#define REDRAW_DOOR_2          (1 << 3)
+#define REDRAW_DOOR_3          (1 << 4)
+#define REDRAW_FPS             (1 << 5)
+
 #define REDRAW_DOORS           (REDRAW_DOOR_1 | \
                                 REDRAW_DOOR_2 | \
                                 REDRAW_DOOR_3)
-#define REDRAW_MAIN            (REDRAW_FIELD | \
-                                REDRAW_TILES | \
-                                REDRAW_MICROLEVEL)
-#define REDRAW_FPS             (1 << 11)
 
 #define IN_GFX_FIELD_PLAY(x, y)        (x >= gfx.sx && x < gfx.sx + gfx.sxsize && \
                                 y >= gfx.sy && y < gfx.sy + gfx.sysize)
index c9bf81ccf0eb54d3de8dd65cb6c53e941173f02a..b41b93867877e426e0fc0eb0a54ad3d9258ca634 100644 (file)
@@ -352,7 +352,7 @@ void HandleAnimation(int mode)
     case ANIM_STOP:
       if (anim_running)
       {
-       redraw_mask |= (REDRAW_FIELD | REDRAW_FROM_BACKBUFFER);
+       redraw_mask |= REDRAW_FIELD;
 
        screen_info.update_function();
 
index 0813343df51fcdc5cee07479518aff07ef59739d..16985341b6241826baa1074be7d99c6f927b3d43 100644 (file)
@@ -436,10 +436,6 @@ void BackToFront()
   if (redraw_mask == REDRAW_NONE)
     return;
 
-  // redraw playfield if anything inside main playfield area needs redraw
-  if (redraw_mask & REDRAW_MAIN)
-    redraw_mask |= REDRAW_FIELD;
-
   // draw masked border to all viewports, if defined
   DrawMaskedBorder(redraw_mask);
 
@@ -1975,7 +1971,7 @@ void AnimateEnvelope(int envelope_nr, int anim_mode, int action)
                   level.envelope[envelope_nr].autowrap,
                   level.envelope[envelope_nr].centered, FALSE);
 
-    redraw_mask |= REDRAW_FIELD | REDRAW_FROM_BACKBUFFER;
+    redraw_mask |= REDRAW_FIELD;
     BackToFront();
 
     SkipUntilDelayReached(&anim_delay, anim_delay_value, &i, last_frame);
@@ -2221,7 +2217,7 @@ void AnimateEnvelopeRequest(int anim_mode, int action)
       }
     }
 
-    redraw_mask |= REDRAW_FIELD | REDRAW_FROM_BACKBUFFER;
+    redraw_mask |= REDRAW_FIELD;
 
     DoAnimation();
     BackToFront();
@@ -2413,7 +2409,7 @@ static void DrawPreviewLevelPlayfieldExt(int from_x, int from_y)
     }
   }
 
-  redraw_mask |= REDRAW_MICROLEVEL;
+  redraw_mask |= REDRAW_FIELD;
 }
 
 #define MICROLABEL_EMPTY               0
@@ -2482,7 +2478,7 @@ static void DrawPreviewLevelLabelExt(int mode)
   if (strlen(label_text) > 0)
     DrawTextSAligned(pos->x, pos->y, label_text, font_nr, pos->align);
 
-  redraw_mask |= REDRAW_MICROLEVEL;
+  redraw_mask |= REDRAW_FIELD;
 }
 
 static void DrawPreviewLevelExt(boolean restart)