From: Holger Schemel Date: Wed, 11 May 2016 19:05:32 +0000 (+0200) Subject: changed names of constants for different drawing targets X-Git-Tag: 4.0.0.0-rc3~61 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=0b35d42d7e09d2f9ac90b57f20ac77df07841e19;p=rocksndiamonds.git changed names of constants for different drawing targets --- diff --git a/src/init.c b/src/init.c index 61d4d5c3..e91e8a41 100644 --- a/src/init.c +++ b/src/init.c @@ -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); diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index ebfd6a5c..4546e67d 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -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(); diff --git a/src/libgame/system.h b/src/libgame/system.h index 9193f8a9..b7da38b5 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -192,11 +192,12 @@ #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 diff --git a/src/screens.c b/src/screens.c index e6e471a2..4f7dd6f6 100644 --- a/src/screens.c +++ b/src/screens.c @@ -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) diff --git a/src/tools.c b/src/tools.c index 972e5a24..9d7e5c74 100644 --- a/src/tools.c +++ b/src/tools.c @@ -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) { diff --git a/src/tools.h b/src/tools.h index 703a5223..4c7a6526 100644 --- a/src/tools.h +++ b/src/tools.h @@ -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