From 14d7691c65ca4a466ce9b9448153e8fbe8351a81 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Fri, 17 Oct 2014 19:08:21 +0200 Subject: [PATCH] removed some remaining unused X11 stuff --- ChangeLog | 3 +++ src/conftime.h | 2 +- src/events.c | 2 -- src/game.c | 7 ------- src/game_em/graphics.c | 18 ------------------ src/game_em/init.c | 3 --- src/game_em/main_em.h | 9 --------- src/game_sp/DDScrollBuffer.c | 4 ---- src/libgame/misc.c | 5 ----- src/libgame/sdl.h | 8 -------- src/libgame/system.c | 25 ------------------------- src/libgame/system.h | 10 ---------- src/libgame/text.c | 3 --- src/libgame/toons.c | 11 +++-------- src/main.c | 1 - src/main.h | 1 - src/screens.c | 5 +---- src/tools.c | 26 +------------------------- 18 files changed, 9 insertions(+), 134 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6eb942cb..f897a153 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2014-10-17 + * removed some remaining unused X11 stuff + 2014-10-16 * fixed bug not loading tape when selecting level from level selection screen (thanks to filbo for finding this bug and supplying a patch) diff --git a/src/conftime.h b/src/conftime.h index d410d2ac..a3077953 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2014-10-16 02:19" +#define COMPILE_DATE_STRING "2014-10-17 19:07" diff --git a/src/events.c b/src/events.c index fd735bfe..f89e5236 100644 --- a/src/events.c +++ b/src/events.c @@ -231,8 +231,6 @@ void EventLoop(void) } else { - SyncDisplay(); - if (!PendingEvent()) /* delay only if no pending events */ Delay(10); } diff --git a/src/game.c b/src/game.c index a906aad2..0fa3035d 100644 --- a/src/game.c +++ b/src/game.c @@ -2519,17 +2519,11 @@ void DisplayGameControlValues() height = graphic_info[graphic].height * size / TILESIZE; if (draw_masked) - { - SetClipOrigin(src_bitmap, src_bitmap->stored_clip_gc, - dst_x - src_x, dst_y - src_y); BlitBitmapMasked(src_bitmap, drawto, src_x, src_y, width, height, dst_x, dst_y); - } else - { BlitBitmap(src_bitmap, drawto, src_x, src_y, width, height, dst_x, dst_y); - } } } else if (type == TYPE_STRING) @@ -5007,7 +5001,6 @@ void DrawRelocateScreen(int old_x, int old_y, int x, int y, int move_dir, /* scroll in two steps of half tile size to make things smoother */ BlitBitmap(drawto_field, window, fx, fy, SXSIZE, SYSIZE, SX, SY); - FlushDisplay(); Delay(wait_delay_value); /* scroll second step to align at full tile size */ diff --git a/src/game_em/graphics.c b/src/game_em/graphics.c index 12c62180..2a624af2 100644 --- a/src/game_em/graphics.c +++ b/src/game_em/graphics.c @@ -104,8 +104,6 @@ void BackToFront_EM(void) boolean scrolling = (screen_x != screen_x_last || screen_y != screen_y_last); int x, y; - SyncDisplay(); - if (redraw_tiles > REDRAWTILES_THRESHOLD || scrolling || scrolling_last) { /* blit all (up to four) parts of the scroll buffer to the backbuffer */ @@ -153,8 +151,6 @@ void BackToFront_EM(void) InitGfxClipRegion(FALSE, -1, -1, -1, -1); } - FlushDisplay(); - for (x = 0; x < MAX_BUF_XSIZE; x++) for (y = 0; y < MAX_BUF_YSIZE; y++) redraw[x][y] = FALSE; @@ -212,12 +208,8 @@ static void DrawLevelField_EM(int x, int y, int sx, int sy, if (draw_masked) { if (width > 0 && height > 0) - { - SetClipOrigin(g->bitmap, g->bitmap->stored_clip_gc, - dst_x - src_x, dst_y - src_y); BlitBitmapMasked(g->bitmap, screenBitmap, src_x, src_y, width, height, dst_x, dst_y); - } } else { @@ -280,12 +272,8 @@ static void DrawLevelFieldCrumbled_EM(int x, int y, int sx, int sy, int dst_y = sy * TILEY + cy; if (draw_masked) - { - SetClipOrigin(g->crumbled_bitmap, g->crumbled_bitmap->stored_clip_gc, - dst_x - src_x, dst_y - src_y); BlitBitmapMasked(g->crumbled_bitmap, screenBitmap, src_x, src_y, width, height, dst_x, dst_y); - } else BlitBitmap(g->crumbled_bitmap, screenBitmap, src_x, src_y, width, height, dst_x, dst_y); @@ -314,24 +302,18 @@ static void DrawLevelPlayer_EM(int x1, int y1, int player_nr, int anim, /* draw the player to current location */ dst_x = x1; dst_y = y1; - SetClipOrigin(g->bitmap, g->bitmap->stored_clip_gc, - dst_x - src_x, dst_y - src_y); BlitBitmapMasked(g->bitmap, screenBitmap, src_x, src_y, TILEX, TILEY, dst_x, dst_y); /* draw the player to opposite wrap-around column */ dst_x = x1 - MAX_BUF_XSIZE * TILEX; dst_y = y1; - SetClipOrigin(g->bitmap, g->bitmap->stored_clip_gc, - dst_x - src_x, dst_y - src_y); BlitBitmapMasked(g->bitmap, screenBitmap, g->src_x, g->src_y, TILEX, TILEY, dst_x, dst_y); /* draw the player to opposite wrap-around row */ dst_x = x1; dst_y = y1 - MAX_BUF_YSIZE * TILEY; - SetClipOrigin(g->bitmap, g->bitmap->stored_clip_gc, - dst_x - src_x, dst_y - src_y); BlitBitmapMasked(g->bitmap, screenBitmap, g->src_x, g->src_y, TILEX, TILEY, dst_x, dst_y); } diff --git a/src/game_em/init.c b/src/game_em/init.c index d0ccc094..719f5e13 100644 --- a/src/game_em/init.c +++ b/src/game_em/init.c @@ -13,9 +13,6 @@ Bitmap *sprBitmap; Bitmap *screenBitmap; -Pixmap objPixmap; -Pixmap sprPixmap; - char play[SAMPLE_MAX]; int play_x[SAMPLE_MAX]; int play_y[SAMPLE_MAX]; diff --git a/src/game_em/main_em.h b/src/game_em/main_em.h index 46ade655..6c965315 100644 --- a/src/game_em/main_em.h +++ b/src/game_em/main_em.h @@ -126,15 +126,6 @@ extern Bitmap *sprBitmap; extern Bitmap *ttlBitmap; extern Bitmap *botBitmap; -extern Pixmap screenPixmap; -extern Pixmap scorePixmap; -extern Pixmap spriteBitmap; - -extern Pixmap objmaskBitmap; -extern Pixmap sprmaskBitmap; - -extern GC spriteGC; - /* ------------------------------------------------------------------------- */ /* exported functions */ diff --git a/src/game_sp/DDScrollBuffer.c b/src/game_sp/DDScrollBuffer.c index 698d33b8..271a6404 100644 --- a/src/game_sp/DDScrollBuffer.c +++ b/src/game_sp/DDScrollBuffer.c @@ -245,8 +245,6 @@ void BackToFront_SP(void) boolean scrolling = (mScrollX != scroll_x_last || mScrollY != scroll_y_last); int x, y; - SyncDisplay(); - if (0 || redraw_tiles > REDRAWTILES_THRESHOLD || scrolling || scrolling_last || ExplosionShakeMurphy != 0 || ExplosionShakeMurphy_last != 0) @@ -291,8 +289,6 @@ void BackToFront_SP(void) InitGfxClipRegion(FALSE, -1, -1, -1, -1); } - FlushDisplay(); - for (x = 0; x < 2 + MAX_PLAYFIELD_WIDTH + 2; x++) for (y = 0; y < 2 + MAX_PLAYFIELD_HEIGHT + 2; y++) redraw[x][y] = FALSE; diff --git a/src/libgame/misc.c b/src/libgame/misc.c index cd9d3e93..31adce34 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -760,7 +760,6 @@ void GetOptions(char *argv[], options.network = FALSE; options.verbose = FALSE; options.debug = FALSE; - options.debug_x11_sync = FALSE; #if 1 options.verbose = TRUE; @@ -888,10 +887,6 @@ void GetOptions(char *argv[], { options.debug = TRUE; } - else if (strncmp(option, "-debug-x11-sync", option_len) == 0) - { - options.debug_x11_sync = TRUE; - } else if (strncmp(option, "-verbose", option_len) == 0) { options.verbose = TRUE; diff --git a/src/libgame/sdl.h b/src/libgame/sdl.h index 35251220..79827b45 100644 --- a/src/libgame/sdl.h +++ b/src/libgame/sdl.h @@ -92,12 +92,6 @@ typedef SDL_Event ExposeEvent; typedef SDL_Event FocusChangeEvent; typedef SDL_Event ClientMessageEvent; -typedef int GC; -typedef int Pixmap; -typedef int Display; -typedef int Visual; -typedef int Colormap; - /* structure definitions */ @@ -108,8 +102,6 @@ struct SDLSurfaceInfo int width, height; SDL_Surface *surface; SDL_Surface *surface_masked; - GC gc; - GC stored_clip_gc; }; struct MouseCursorInfo diff --git a/src/libgame/system.c b/src/libgame/system.c index 9484cbd2..25edb0ef 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -44,11 +44,6 @@ int level_nr; struct LevelStats level_stats[MAX_LEVELS]; -Display *display = NULL; -Visual *visual = NULL; -int screen = 0; -Colormap cmap = None; - DrawWindow *window = NULL; DrawBuffer *backbuffer = NULL; DrawBuffer *drawto = NULL; @@ -660,14 +655,6 @@ void ClearRectangleOnBackground(Bitmap *bitmap, int x, int y, ClearRectangle(bitmap, x, y, width, height); } -void SetClipMask(Bitmap *bitmap, GC clip_gc, Pixmap clip_pixmap) -{ -} - -void SetClipOrigin(Bitmap *bitmap, GC clip_gc, int clip_x, int clip_y) -{ -} - void BlitBitmapMasked(Bitmap *src_bitmap, Bitmap *dst_bitmap, int src_x, int src_y, int width, int height, int dst_x, int dst_y) @@ -690,8 +677,6 @@ void BlitBitmapOnBackground(Bitmap *src_bitmap, Bitmap *dst_bitmap, dst_x, dst_y); /* draw foreground */ - SetClipOrigin(src_bitmap, src_bitmap->stored_clip_gc, - dst_x - src_x, dst_y - src_y); BlitBitmapMasked(src_bitmap, dst_bitmap, src_x, src_y, width, height, dst_x, dst_y); } @@ -774,16 +759,6 @@ Pixel GetPixelFromRGBcompact(Bitmap *bitmap, unsigned int color) return GetPixelFromRGB(bitmap, color_r, color_g, color_b); } -/* execute all pending screen drawing operations */ -void FlushDisplay(void) -{ -} - -/* execute and wait for all pending screen drawing operations */ -void SyncDisplay(void) -{ -} - void KeyboardAutoRepeatOn(void) { #if defined(TARGET_SDL2) diff --git a/src/libgame/system.h b/src/libgame/system.h index 671a0e73..04d97974 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -707,7 +707,6 @@ struct OptionInfo boolean network; boolean verbose; boolean debug; - boolean debug_x11_sync; }; struct ScreenModeInfo @@ -1241,11 +1240,6 @@ extern int level_nr; extern struct LevelStats level_stats[]; -extern Display *display; -extern Visual *visual; -extern int screen; -extern Colormap cmap; - extern DrawWindow *window; extern DrawBuffer *backbuffer; extern DrawBuffer *drawto; @@ -1307,8 +1301,6 @@ void FadeRectangle(Bitmap *bitmap, int, int, int, int, int, int, int, void FillRectangle(Bitmap *, int, int, int, int, Pixel); void ClearRectangle(Bitmap *, int, int, int, int); void ClearRectangleOnBackground(Bitmap *, int, int, int, int); -void SetClipMask(Bitmap *, GC, Pixmap); -void SetClipOrigin(Bitmap *, GC, int, int); void BlitBitmapMasked(Bitmap *, Bitmap *, int, int, int, int, int, int); boolean DrawingOnBackground(int, int); void BlitBitmapOnBackground(Bitmap *, Bitmap *, int, int, int, int, int, int); @@ -1319,8 +1311,6 @@ Pixel GetPixel(Bitmap *, int, int); Pixel GetPixelFromRGB(Bitmap *, unsigned int,unsigned int,unsigned int); Pixel GetPixelFromRGBcompact(Bitmap *, unsigned int); -void FlushDisplay(void); -void SyncDisplay(void); void KeyboardAutoRepeatOn(void); void KeyboardAutoRepeatOff(void); boolean PointerInWindow(DrawWindow *); diff --git a/src/libgame/text.c b/src/libgame/text.c index 36cb6dd5..4c3f30ff 100644 --- a/src/libgame/text.c +++ b/src/libgame/text.c @@ -307,9 +307,6 @@ void DrawTextExt(DrawBuffer *dst_bitmap, int dst_x, int dst_y, char *text, font_width, font_height); } - SetClipOrigin(src_bitmap, src_bitmap->stored_clip_gc, - dst_x - src_x, dst_y - src_y); - BlitBitmapMasked(src_bitmap, dst_bitmap, src_x, src_y, font_width, font_height, dst_x, dst_y); } diff --git a/src/libgame/toons.c b/src/libgame/toons.c index 8d0a8ba5..c9bf81cc 100644 --- a/src/libgame/toons.c +++ b/src/libgame/toons.c @@ -119,8 +119,7 @@ void InitToonScreen(Bitmap *save_buffer, screen_info.frame_delay_value = frame_delay_value; } -void DrawAnim(Bitmap *toon_bitmap, GC toon_clip_gc, - int src_x, int src_y, int width, int height, +void DrawAnim(Bitmap *toon_bitmap, int src_x, int src_y, int width, int height, int dest_x, int dest_y, int pad_x, int pad_y) { int pad_dest_x = dest_x - pad_x; @@ -151,7 +150,6 @@ void DrawAnim(Bitmap *toon_bitmap, GC toon_clip_gc, /* special method to avoid flickering interference with BackToFront() */ BlitBitmap(backbuffer, screen_info.save_buffer, pad_dest_x, pad_dest_y, pad_width, pad_height, buffer_x, buffer_y); - SetClipOrigin(toon_bitmap, toon_clip_gc, dest_x - src_x, dest_y - src_y); BlitBitmapMasked(toon_bitmap, backbuffer, src_x, src_y, width, height, dest_x, dest_y); BlitBitmap(backbuffer, window, pad_dest_x, pad_dest_y, pad_width, pad_height, @@ -161,8 +159,6 @@ void DrawAnim(Bitmap *toon_bitmap, GC toon_clip_gc, BlitBitmap(screen_info.save_buffer, backbuffer, buffer_x, buffer_y, pad_width, pad_height, pad_dest_x, pad_dest_y); - - FlushDisplay(); } boolean AnimateToon(int toon_nr, boolean restart) @@ -181,7 +177,6 @@ boolean AnimateToon(int toon_nr, boolean restart) static int dest_x, dest_y; struct ToonInfo *anim = &screen_info.toons[toon_nr]; Bitmap *anim_bitmap = screen_info.toons[toon_nr].bitmap; - GC anim_clip_gc = anim_bitmap->stored_clip_gc; int direction = get_toon_direction(anim->direction); if (restart) @@ -257,7 +252,7 @@ boolean AnimateToon(int toon_nr, boolean restart) if (!DelayReached(&anim_delay, anim_delay_value)) { if (screen_info.redraw_needed_function() && !restart) - DrawAnim(anim_bitmap, anim_clip_gc, + DrawAnim(anim_bitmap, src_x + cut_x, src_y + cut_y, width, height, screen_info.startx + dest_x, @@ -304,7 +299,7 @@ boolean AnimateToon(int toon_nr, boolean restart) else if (pos_y > screen_info.height - anim->height) height -= (pos_y - (screen_info.height - anim->height)); - DrawAnim(anim_bitmap, anim_clip_gc, + DrawAnim(anim_bitmap, src_x + cut_x, src_y + cut_y, width, height, screen_info.startx + dest_x, diff --git a/src/main.c b/src/main.c index 74e53965..94c44254 100644 --- a/src/main.c +++ b/src/main.c @@ -5560,7 +5560,6 @@ static void print_usage() " -v, --verbose verbose mode\n" " -V, --version show program version\n" " --debug display debugging information\n" - " --debug-x11-sync enable X11 synchronous mode\n" " -e, --execute COMMAND execute batch COMMAND\n" "\n" "Valid commands for '--execute' option:\n" diff --git a/src/main.h b/src/main.h index 14e94143..4937e55c 100644 --- a/src/main.h +++ b/src/main.h @@ -2797,7 +2797,6 @@ extern Bitmap *bitmap_db_panel; extern Bitmap *bitmap_db_door_1; extern Bitmap *bitmap_db_door_2; extern Bitmap *bitmap_db_toons; -extern Pixmap tile_clipmask[]; extern DrawBuffer *fieldbuffer; extern DrawBuffer *drawto_field; diff --git a/src/screens.c b/src/screens.c index 20f5f67c..0bd9af84 100644 --- a/src/screens.c +++ b/src/screens.c @@ -1224,10 +1224,7 @@ void DrawTitleScreenImage(int nr, boolean initial) ClearRectangleOnBackground(drawto, 0, 0, WIN_XSIZE, WIN_YSIZE); if (DrawingOnBackground(dst_x, dst_y)) - { - SetClipOrigin(bitmap, bitmap->stored_clip_gc, dst_x - src_x, dst_y - src_y); BlitBitmapMasked(bitmap, drawto, src_x, src_y, width, height, dst_x, dst_y); - } else BlitBitmap(bitmap, drawto, src_x, src_y, width, height, dst_x, dst_y); @@ -1684,7 +1681,7 @@ void HandleMainMenu_SelectLevel(int step, int direction, int selected_level_nr) /* needed because DrawPreviewLevelInitial() takes some time */ BackToFront(); - SyncDisplay(); + /* SyncDisplay(); */ } } diff --git a/src/tools.c b/src/tools.c index 082aa5ea..e2ce4712 100644 --- a/src/tools.c +++ b/src/tools.c @@ -292,7 +292,6 @@ void DrawMaskedBorder_Rect(int x, int y, int width, int height) { Bitmap *bitmap = graphic_info[IMG_GLOBAL_BORDER].bitmap; - SetClipOrigin(bitmap, bitmap->stored_clip_gc, 0, 0); BlitBitmapMasked(bitmap, backbuffer, x, y, width, height, x, y); } @@ -531,7 +530,7 @@ void BackToFront() this could mean that we have to wait for the graphics to complete, although we could go on doing calculations for the next frame */ - SyncDisplay(); + /* SyncDisplay(); */ /* never draw masked border to backbuffer when using playfield buffer */ if (game_status != GAME_MODE_PLAYING || @@ -664,8 +663,6 @@ void BackToFront() DrawTextExt(window, SX + SXSIZE + SX, 0, text, FONT_TEXT_2, BLIT_OPAQUE); } - FlushDisplay(); - for (x = 0; x < MAX_BUF_XSIZE; x++) for (y = 0; y < MAX_BUF_YSIZE; y++) redraw[x][y] = 0; @@ -1249,9 +1246,6 @@ void DrawGraphicThruMaskExt(DrawBuffer *d, int dst_x, int dst_y, int graphic, getGraphicSource(graphic, frame, &src_bitmap, &src_x, &src_y); - SetClipOrigin(src_bitmap, src_bitmap->stored_clip_gc, - dst_x - src_x, dst_y - src_y); - BlitBitmapMasked(src_bitmap, d, src_x, src_y, TILEX_VAR, TILEY_VAR, dst_x, dst_y); } @@ -1264,8 +1258,6 @@ void DrawFixedGraphicThruMaskExt(DrawBuffer *d, int dst_x, int dst_y, getFixedGraphicSource(graphic, frame, &src_bitmap, &src_x, &src_y); - SetClipOrigin(src_bitmap, src_bitmap->stored_clip_gc, - dst_x - src_x, dst_y - src_y); BlitBitmapMasked(src_bitmap, d, src_x, src_y, TILEX, TILEY, dst_x, dst_y); } @@ -1402,12 +1394,8 @@ inline static void DrawGraphicShiftedNormal(int x, int y, int dx, int dy, dst_y = FY + y * TILEY_VAR + dy; if (mask_mode == USE_MASKING) - { - SetClipOrigin(src_bitmap, src_bitmap->stored_clip_gc, - dst_x - src_x, dst_y - src_y); BlitBitmapMasked(src_bitmap, drawto_field, src_x, src_y, width, height, dst_x, dst_y); - } else BlitBitmap(src_bitmap, drawto_field, src_x, src_y, width, height, dst_x, dst_y); @@ -1453,12 +1441,8 @@ inline static void DrawGraphicShiftedDouble(int x, int y, int dx, int dy, dst_y = FY + y1 * TILEY_VAR; if (mask_mode == USE_MASKING) - { - SetClipOrigin(src_bitmap, src_bitmap->stored_clip_gc, - dst_x - src_x, dst_y - src_y); BlitBitmapMasked(src_bitmap, drawto_field, src_x, src_y, width, height, dst_x, dst_y); - } else BlitBitmap(src_bitmap, drawto_field, src_x, src_y, width, height, dst_x, dst_y); @@ -1475,12 +1459,8 @@ inline static void DrawGraphicShiftedDouble(int x, int y, int dx, int dy, dst_y = FY + y2 * TILEY_VAR; if (mask_mode == USE_MASKING) - { - SetClipOrigin(src_bitmap, src_bitmap->stored_clip_gc, - dst_x - src_x, dst_y - src_y); BlitBitmapMasked(src_bitmap, drawto_field, src_x, src_y, width, height, dst_x, dst_y); - } else BlitBitmap(src_bitmap, drawto_field, src_x, src_y, width, height, dst_x, dst_y); @@ -2094,12 +2074,8 @@ void DrawEnvelopeBackgroundTiles(int graphic, int startx, int starty, inner_sy + (y - 1) * tile_height % inner_height); if (draw_masked) - { - SetClipOrigin(src_bitmap, src_bitmap->stored_clip_gc, - dst_x - src_x, dst_y - src_y); BlitBitmapMasked(src_bitmap, drawto, src_x, src_y, tile_width, tile_height, dst_x, dst_y); - } else BlitBitmap(src_bitmap, drawto, src_x, src_y, tile_width, tile_height, dst_x, dst_y); -- 2.34.1