changed names of constants for different drawing targets
authorHolger Schemel <info@artsoft.org>
Wed, 11 May 2016 19:05:32 +0000 (21:05 +0200)
committerHolger Schemel <info@artsoft.org>
Wed, 11 May 2016 19:05:32 +0000 (21:05 +0200)
src/init.c
src/libgame/sdl.c
src/libgame/system.h
src/screens.c
src/tools.c
src/tools.h

index 61d4d5c35cb7768204e8fd199dc3b780fa726b19..e91e8a411340ff5a4aa3fb084a2d7e67f5946182 100644 (file)
@@ -5366,7 +5366,7 @@ void InitGfx()
 void InitGfxBackground()
 {
   fieldbuffer = bitmap_db_field;
-  SetDrawtoField(DRAW_BACKBUFFER);
+  SetDrawtoField(DRAW_TO_BACKBUFFER);
 
   ClearRectangle(backbuffer, 0, 0, WIN_XSIZE, WIN_YSIZE);
 
index ebfd6a5c48b279fc7ff84abd233f241b2ade0d9a..4546e67d07dd175d3753bbdf1d324480c26ca52f 100644 (file)
@@ -50,7 +50,7 @@ static void FinalizeScreen()
 
   // copy global masked border to render target buffer, if defined
   if (gfx.draw_global_border_function != NULL)
-    gfx.draw_global_border_function(DRAW_BORDER_TO_SCREEN);
+    gfx.draw_global_border_function(DRAW_TO_SCREEN);
 
   // copy global animations to render target buffer, if defined (above border)
   if (gfx.draw_global_anim_function != NULL)
@@ -948,22 +948,22 @@ void SDLFadeRectangle(Bitmap *bitmap_cross, int x, int y, int width, int height,
     SDL_BlitSurface(surface_cross,  &src_rect, surface_source, &src_rect);
     SDL_BlitSurface(surface_screen, &dst_rect, surface_target, &src_rect);
 
-    draw_global_border_function(DRAW_BORDER_TO_FADE_SOURCE);
-    draw_global_border_function(DRAW_BORDER_TO_FADE_TARGET);
+    draw_global_border_function(DRAW_TO_FADE_SOURCE);
+    draw_global_border_function(DRAW_TO_FADE_TARGET);
   }
   else if (fade_mode & FADE_TYPE_FADE_IN)
   {
     SDL_BlitSurface(surface_black,  &src_rect, surface_source, &src_rect);
     SDL_BlitSurface(surface_screen, &dst_rect, surface_target, &src_rect);
 
-    draw_global_border_function(DRAW_BORDER_TO_FADE_TARGET);
+    draw_global_border_function(DRAW_TO_FADE_TARGET);
   }
   else         /* FADE_TYPE_FADE_OUT */
   {
     SDL_BlitSurface(surface_screen, &dst_rect, surface_source, &src_rect);
     SDL_BlitSurface(surface_black,  &src_rect, surface_target, &src_rect);
 
-    draw_global_border_function(DRAW_BORDER_TO_FADE_SOURCE);
+    draw_global_border_function(DRAW_TO_FADE_SOURCE);
   }
 
   time_current = SDL_GetTicks();
index 9193f8a915cdca70f0470ba33e74df53bcd0a779..b7da38b53adcd21081a749a56c6609c8d36ddf37 100644 (file)
 #define DRAW_GLOBAL_ANIM_STAGE_1       1
 #define DRAW_GLOBAL_ANIM_STAGE_2       2
 
-/* values for drawing target for global border */
-#define DRAW_BORDER_TO_BACKBUFFER      0
-#define DRAW_BORDER_TO_SCREEN          1
-#define DRAW_BORDER_TO_FADE_SOURCE     2
-#define DRAW_BORDER_TO_FADE_TARGET     3
+/* values for drawing target (various functions) */
+#define DRAW_TO_BACKBUFFER             0
+#define DRAW_TO_FIELDBUFFER            1
+#define DRAW_TO_SCREEN                 2
+#define DRAW_TO_FADE_SOURCE            3
+#define DRAW_TO_FADE_TARGET            4
 
 /* values for move directions and special "button" key bitmasks */
 #define MV_NONE                        0
index e6e471a2786c32321d9d6790bec8c8d26da15ef2..4f7dd6f6670a41294c810cb738d26cfd09e55930 100644 (file)
@@ -1460,7 +1460,7 @@ void DrawMainMenu()
 
   FadeOut(fade_mask);
 
-  SetDrawtoField(DRAW_BACKBUFFER);
+  SetDrawtoField(DRAW_TO_BACKBUFFER);
 
   /* level_nr may have been set to value over handicap with level editor */
   if (setup.handicap && level_nr > leveldir_current->handicap_level)
index 972e5a24eab5b0e4ea6551fadf86276a4cc627fd..9d7e5c7482906558affecfadbd1dce7d5e838f39 100644 (file)
@@ -234,7 +234,7 @@ void DumpTile(int x, int y)
 
 void SetDrawtoField(int mode)
 {
-  if (mode == DRAW_FIELDBUFFER)
+  if (mode == DRAW_TO_FIELDBUFFER)
   {
     FX = 2 * TILEX_VAR;
     FY = 2 * TILEY_VAR;
@@ -245,7 +245,7 @@ void SetDrawtoField(int mode)
 
     drawto_field = fieldbuffer;
   }
-  else /* DRAW_BACKBUFFER */
+  else /* DRAW_TO_BACKBUFFER */
   {
     FX = SX;
     FY = SY;
@@ -294,7 +294,7 @@ static void DrawMaskedBorderExt_Rect(int x, int y, int width, int height,
   if (x == -1 && y == -1)
     return;
 
-  if (draw_target == DRAW_BORDER_TO_SCREEN)
+  if (draw_target == DRAW_TO_SCREEN)
     BlitToScreenMasked(src_bitmap, x, y, width, height, x, y);
   else
     BlitBitmapMasked(src_bitmap, dst_bitmap, x, y, width, height, x, y);
@@ -312,7 +312,7 @@ static void DrawMaskedBorderExt_FIELD(int draw_target)
 static void DrawMaskedBorderExt_DOOR_1(int draw_target)
 {
   // when drawing to backbuffer, never draw border over open doors
-  if (draw_target == DRAW_BORDER_TO_BACKBUFFER &&
+  if (draw_target == DRAW_TO_BACKBUFFER &&
       (GetDoorState() & DOOR_OPEN_1))
     return;
 
@@ -325,7 +325,7 @@ static void DrawMaskedBorderExt_DOOR_1(int draw_target)
 static void DrawMaskedBorderExt_DOOR_2(int draw_target)
 {
   // when drawing to backbuffer, never draw border over open doors
-  if (draw_target == DRAW_BORDER_TO_BACKBUFFER &&
+  if (draw_target == DRAW_TO_BACKBUFFER &&
       (GetDoorState() & DOOR_OPEN_2))
     return;
 
@@ -371,18 +371,18 @@ static void DrawMaskedBorderExt(int redraw_mask, int draw_target)
 
 void DrawMaskedBorder_FIELD()
 {
-  DrawMaskedBorderExt_FIELD(DRAW_BORDER_TO_BACKBUFFER);
+  DrawMaskedBorderExt_FIELD(DRAW_TO_BACKBUFFER);
 }
 
 void DrawMaskedBorder(int redraw_mask)
 {
-  DrawMaskedBorderExt(redraw_mask, DRAW_BORDER_TO_BACKBUFFER);
+  DrawMaskedBorderExt(redraw_mask, DRAW_TO_BACKBUFFER);
 }
 
 void DrawMaskedBorderToTarget(int draw_target)
 {
-  if (draw_target == DRAW_BORDER_TO_BACKBUFFER ||
-      draw_target == DRAW_BORDER_TO_SCREEN)
+  if (draw_target == DRAW_TO_BACKBUFFER ||
+      draw_target == DRAW_TO_SCREEN)
   {
     DrawMaskedBorderExt(REDRAW_ALL, draw_target);
   }
@@ -390,12 +390,12 @@ void DrawMaskedBorderToTarget(int draw_target)
   {
     int last_border_status = global.border_status;
 
-    if (draw_target == DRAW_BORDER_TO_FADE_SOURCE)
+    if (draw_target == DRAW_TO_FADE_SOURCE)
     {
       global.border_status = gfx.fade_border_source_status;
       gfx.masked_border_bitmap_ptr = gfx.fade_bitmap_source;
     }
-    else if (draw_target == DRAW_BORDER_TO_FADE_TARGET)
+    else if (draw_target == DRAW_TO_FADE_TARGET)
     {
       global.border_status = gfx.fade_border_target_status;
       gfx.masked_border_bitmap_ptr = gfx.fade_bitmap_target;
@@ -1103,11 +1103,11 @@ void ClearField()
   if (game_status == GAME_MODE_PLAYING)
   {
     ClearRectangle(fieldbuffer, 0, 0, FXSIZE, FYSIZE);
-    SetDrawtoField(DRAW_FIELDBUFFER);
+    SetDrawtoField(DRAW_TO_FIELDBUFFER);
   }
   else
   {
-    SetDrawtoField(DRAW_BACKBUFFER);
+    SetDrawtoField(DRAW_TO_BACKBUFFER);
   }
 }
 
@@ -2300,11 +2300,11 @@ void AnimateEnvelope(int envelope_nr, int anim_mode, int action)
     int sy = SY + (SYSIZE - ysize * font_height) / 2;
     int xx, yy;
 
-    SetDrawtoField(DRAW_FIELDBUFFER);
+    SetDrawtoField(DRAW_TO_FIELDBUFFER);
 
     BlitScreenToBitmap(backbuffer);
 
-    SetDrawtoField(DRAW_BACKBUFFER);
+    SetDrawtoField(DRAW_TO_BACKBUFFER);
 
     for (yy = 0; yy < ysize; yy++)
       for (xx = 0; xx < xsize; xx++)
@@ -2361,7 +2361,7 @@ void ShowEnvelope(int envelope_nr)
 
   game.envelope_active = FALSE;
 
-  SetDrawtoField(DRAW_FIELDBUFFER);
+  SetDrawtoField(DRAW_TO_FIELDBUFFER);
 
   redraw_mask |= REDRAW_FIELD;
   BackToFront();
@@ -2620,7 +2620,7 @@ void ShowEnvelopeRequest(char *text, unsigned int req_state, int action)
   if (game_status == GAME_MODE_PLAYING)
     BlitScreenToBitmap(backbuffer);
 
-  SetDrawtoField(DRAW_BACKBUFFER);
+  SetDrawtoField(DRAW_TO_BACKBUFFER);
 
   // SetDrawBackgroundMask(REDRAW_NONE);
 
@@ -2684,7 +2684,7 @@ void ShowEnvelopeRequest(char *text, unsigned int req_state, int action)
   if (action == ACTION_CLOSING &&
       game_status == GAME_MODE_PLAYING &&
       level.game_engine_type == GAME_ENGINE_TYPE_RND)
-    SetDrawtoField(DRAW_FIELDBUFFER);
+    SetDrawtoField(DRAW_TO_FIELDBUFFER);
 }
 
 void DrawPreviewElement(int dst_x, int dst_y, int element, int tilesize)
@@ -3569,11 +3569,11 @@ static int RequestHandleEvents(unsigned int req_state)
   {
     if (level_solved)
     {
-      SetDrawtoField(DRAW_FIELDBUFFER);
+      SetDrawtoField(DRAW_TO_FIELDBUFFER);
 
       HandleGameActions();
 
-      SetDrawtoField(DRAW_BACKBUFFER);
+      SetDrawtoField(DRAW_TO_BACKBUFFER);
 
       if (global.use_envelope_request)
       {
index 703a52233030700d19aea9af5454c1d27578c4dc..4c7a65266ba7cef1ea89fed9e269726b4170113e 100644 (file)
@@ -15,9 +15,6 @@
 #include "main.h"
 #include "game.h"
 
-/* for SetDrawtoField */
-#define DRAW_FIELDBUFFER       1
-#define DRAW_BACKBUFFER                2
 
 /* for DrawElementShifted */
 #define NO_CUTTING             0