From 719709bd5d8a665b7ea982665991615c28cdb638 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Tue, 1 Oct 2002 01:18:34 +0200 Subject: [PATCH] rnd-20021001-1-src --- src/conftime.h | 2 +- src/game.c | 29 +++++++++++++++-------------- src/libgame/x11.c | 8 ++++++++ 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/src/conftime.h b/src/conftime.h index 36a50855..6f3e9765 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2002-09-30 23:37]" +#define COMPILE_DATE_STRING "[2002-10-01 00:29]" diff --git a/src/game.c b/src/game.c index 56cb38b2..8e4d256c 100644 --- a/src/game.c +++ b/src/game.c @@ -1459,7 +1459,7 @@ void DrawDynamite(int x, int y) #else int graphic = el2img(Feld[x][y]); #endif - int phase; + int frame; if (!IN_SCR_FIELD(sx, sy) || IS_PLAYER(x, y)) return; @@ -1473,37 +1473,37 @@ void DrawDynamite(int x, int y) if (Feld[x][y] == EL_DYNAMITE_ACTIVE) { - if ((phase = (96 - MovDelay[x][y]) / 12) > 6) - phase = 6; + if ((frame = (96 - MovDelay[x][y]) / 12) > 6) + frame = 6; } else { - if ((phase = ((96 - MovDelay[x][y]) / 6) % 8) > 3) - phase = 7 - phase; + if ((frame = ((96 - MovDelay[x][y]) / 6) % 8) > 3) + frame = 7 - frame; } #if 1 - phase = getNewGraphicAnimationFrame(graphic, 96 - MovDelay[x][y]); + frame = getNewGraphicAnimationFrame(graphic, 96 - MovDelay[x][y]); #endif /* - printf("-> %d: %d [%d]\n", graphic, phase, MovDelay[x][y]); + printf("-> %d: %d [%d]\n", graphic, frame, MovDelay[x][y]); */ #if 0 if (game.emulation == EMU_SUPAPLEX) DrawGraphic(sx, sy, GFX_SP_DISK_RED); else if (Store[x][y]) - DrawGraphicThruMask(sx, sy, graphic + phase); + DrawGraphicThruMask(sx, sy, graphic + frame); else - DrawGraphic(sx, sy, graphic + phase); + DrawGraphic(sx, sy, graphic + frame); #else if (game.emulation == EMU_SUPAPLEX) DrawNewGraphic(sx, sy, IMG_SP_DISK_RED, 0); else if (Store[x][y]) - DrawNewGraphicThruMask(sx, sy, graphic, phase); + DrawNewGraphicThruMask(sx, sy, graphic, frame); else - DrawNewGraphic(sx, sy, graphic, phase); + DrawNewGraphic(sx, sy, graphic, frame); #endif } @@ -1540,7 +1540,8 @@ void CheckDynamite(int x, int y) void Explode(int ex, int ey, int phase, int mode) { int x, y; - int num_phase = 9, delay = (game.emulation == EMU_SUPAPLEX ? 3 : 2); + int num_phase = 9; + int delay = (game.emulation == EMU_SUPAPLEX ? 3 : 2); int last_phase = num_phase * delay; int half_phase = (num_phase / 2) * delay; int first_phase_after_start = EX_PHASE_START + 1; @@ -1724,7 +1725,7 @@ void Explode(int ex, int ey, int phase, int mode) InitField(x, y, FALSE); if (CAN_MOVE(element) || COULD_MOVE(element)) InitMovDir(x, y); - DrawLevelField(x, y); + DrawNewLevelField(x, y); if (IS_PLAYER(x, y) && !PLAYERINFO(x,y)->present) StorePlayer[x][y] = 0; @@ -1745,7 +1746,7 @@ void Explode(int ex, int ey, int phase, int mode) if (IS_PFORTE(Store[x][y])) { - DrawLevelElement(x, y, Store[x][y]); + DrawNewLevelElement(x, y, Store[x][y]); DrawGraphicThruMask(SCREENX(x), SCREENY(y), graphic); } else diff --git a/src/libgame/x11.c b/src/libgame/x11.c index 4ef1bd16..6c2942d1 100644 --- a/src/libgame/x11.c +++ b/src/libgame/x11.c @@ -254,6 +254,8 @@ Bitmap *X11LoadImage(char *filename) Bitmap *new_bitmap = CreateBitmapStruct(); char *error = "Read_PCX_to_Pixmap(): %s '%s'"; int pcx_err; + XGCValues clip_gc_values; + unsigned long clip_gc_valuemask; pcx_err = Read_PCX_to_Pixmap(display, window->drawable, window->gc, filename, &new_bitmap->drawable, &new_bitmap->clip_mask); @@ -296,6 +298,12 @@ Bitmap *X11LoadImage(char *filename) return NULL; } + clip_gc_values.graphics_exposures = False; + clip_gc_values.clip_mask = new_bitmap->clip_mask; + clip_gc_valuemask = GCGraphicsExposures | GCClipMask; + new_bitmap->stored_clip_gc = XCreateGC(display, window->drawable, + clip_gc_valuemask, &clip_gc_values); + /* set GraphicContext inheritated from Window */ new_bitmap->gc = window->gc; -- 2.34.1