From: Holger Schemel Date: Mon, 24 Aug 1998 23:24:40 +0000 (+0200) Subject: rnd-19980825 X-Git-Tag: 1.2.0^2~92 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=e1e1f0e96140865d39f667f6af11ebec5e8c9cad;p=rocksndiamonds.git rnd-19980825 --- diff --git a/src/Makefile b/src/Makefile index 510e71d4..27bcd6fc 100644 --- a/src/Makefile +++ b/src/Makefile @@ -21,7 +21,7 @@ SCORE_ENTRIES = -DMANY_PER_NAME # many score entries per name # If you use the Xpm library, convert the GIF files to Xpm # files (and the mask files ('*Maske.gif') to xbm files). -# XPM_INCLUDE_FILE = -DXPM_INCLUDE_FILE="" +XPM_INCLUDE_FILE = -DXPM_INCLUDE_FILE="" CONFIG = $(GAME_DIR) $(SOUNDS) $(JOYSTICK) \ $(SCORE_ENTRIES) $(XPM_INCLUDE_FILE) diff --git a/src/game.c b/src/game.c index c75c9dd4..73fca1bd 100644 --- a/src/game.c +++ b/src/game.c @@ -1008,6 +1008,13 @@ void Impact(int x, int y) break; case EL_FELSBROCKEN: sound = SND_KLOPF; + + + + printf("FUMPF!\n"); + + + break; case EL_SCHLUESSEL: case EL_SCHLUESSEL1: @@ -2581,15 +2588,12 @@ void GameActions() */ - if (PlayerMovPos) ScrollFigure(0); DrawPlayerField(); - - if (!DelayReached(&action_delay, action_delay_value)) return; @@ -2916,7 +2920,9 @@ void ScrollFigure(int init) if (oldJX != -1 && oldJY != -1) DrawLevelElement(oldJX,oldJY, Feld[oldJX][oldJY]); - if (Feld[lastJX][lastJY] == EL_LEERRAUM) + if (Feld[lastJX][lastJY] == EL_LEERRAUM && + IN_LEV_FIELD(lastJX,lastJY-1) && + CAN_FALL(Feld[lastJX][lastJY-1])) Feld[lastJX][lastJY] = EL_PLAYER_IS_LEAVING; DrawLevelElement(lastJX,lastJY, Feld[lastJX][lastJY]); DrawPlayerField(); diff --git a/src/misc.c b/src/misc.c index b9127322..14007b7e 100644 --- a/src/misc.c +++ b/src/misc.c @@ -167,3 +167,16 @@ char *GetLoginName() else return(pwd->pw_name); } + +void MarkTileDirty(int x, int y) +{ + int xx = redraw_x1 + x; + int yy = redraw_y1 + y; + + if (!redraw[xx][yy]) + { + redraw[xx][yy] = TRUE; + redraw_tiles++; + redraw_mask |= REDRAW_TILES; + } +} diff --git a/src/misc.h b/src/misc.h index 1a2f29f0..5a0baab0 100644 --- a/src/misc.h +++ b/src/misc.h @@ -38,5 +38,6 @@ unsigned int SimpleRND(unsigned int); unsigned int RND(unsigned int); unsigned int InitRND(long); char *GetLoginName(void); +void MarkTileDirty(int, int); #endif diff --git a/src/screens.c b/src/screens.c index 50d6506a..13bf5fab 100644 --- a/src/screens.c +++ b/src/screens.c @@ -482,10 +482,11 @@ void DrawHelpScreenElAction(int start) i++; } - redraw_tiles += 28; for(i=2;i<16;i++) - redraw[0][i] = redraw[1][i] = TRUE; - redraw_mask |= REDRAW_TILES; + { + MarkTileDirty(0,i); + MarkTileDirty(1,i); + } } void DrawHelpScreenElText(int start) diff --git a/src/tools.c b/src/tools.c index fe7f0e5c..35adb435 100644 --- a/src/tools.c +++ b/src/tools.c @@ -101,6 +101,15 @@ void BackToFront() XCopyArea(display,buffer,window,gc, fx,fy, SXSIZE,SYSIZE, SX,SY); + + + + printf("Full screen redraw (%d) (%ld)\n", + ScreenMovPos, + Counter()); + + + } redraw_mask &= ~REDRAW_MAIN; } @@ -420,6 +429,10 @@ void DrawPlayerField() + MarkTileDirty(sx,sy); + + + if (PlayerPushing && PlayerMovPos) { int nextJX = JX + (JX - lastJX); @@ -544,9 +557,7 @@ void DrawGraphic(int x, int y, int graphic) #endif DrawGraphicExt(drawto_field, gc, x, y, graphic); - redraw_tiles++; - redraw[redraw_x1 + x][redraw_y1 + y] = TRUE; - redraw_mask |= REDRAW_TILES; + MarkTileDirty(x,y); } void DrawGraphicExt(Drawable d, GC gc, int x, int y, int graphic) @@ -628,9 +639,7 @@ void DrawGraphicThruMask(int x, int y, int graphic) return; } - redraw_tiles++; - redraw[redraw_x1 + x][redraw_y1 + y]=TRUE; - redraw_mask|=REDRAW_TILES; + MarkTileDirty(x,y); } void DrawElementThruMask(int x, int y, int element) @@ -641,9 +650,7 @@ void DrawElementThruMask(int x, int y, int element) void DrawMiniGraphic(int x, int y, int graphic) { DrawMiniGraphicExt(drawto, gc, x, y, graphic); - redraw_tiles++; - redraw[x/2][y/2]=TRUE; - redraw_mask|=REDRAW_TILES; + MarkTileDirty(x/2, y/2); } void DrawMiniGraphicExt(Drawable d, GC gc, int x, int y, int graphic) @@ -709,7 +716,7 @@ void DrawGraphicShifted(int x,int y, int dx,int dy, int graphic, int cut_mode) else if (x==BX2 && dx>0) /* Element verläßt rechts das Bild */ width -= dx; else if (dx) /* allg. Bewegung in x-Richtung */ - redraw[redraw_x1 + x + SIGN(dx)][redraw_y1 + y] = TRUE; + MarkTileDirty(x + SIGN(dx), y); if (y < BY1) /* Element kommt von oben ins Bild */ { @@ -741,12 +748,12 @@ void DrawGraphicShifted(int x,int y, int dx,int dy, int graphic, int cut_mode) height = dy; cy = TILEY-dy; dy = TILEY; - redraw[redraw_x1 + x][redraw_y1 + y + 1] = TRUE; + MarkTileDirty(x, y + 1); } /* Element verläßt unten das Bild */ else if (dy > 0 && (y == BY2 || cut_mode==CUT_BELOW)) height -= dy; else if (dy) /* allg. Bewegung in y-Richtung */ - redraw[redraw_x1 + x][redraw_y1 + y + SIGN(dy)] = TRUE; + MarkTileDirty(x, y + SIGN(dy)); } if (graphic >= GFX_START_ROCKSSCREEN && graphic <= GFX_END_ROCKSSCREEN) @@ -775,9 +782,7 @@ void DrawGraphicShifted(int x,int y, int dx,int dy, int graphic, int cut_mode) } #endif - redraw_tiles++; - redraw[redraw_x1 + x][redraw_y1 + y] = TRUE; - redraw_mask |= REDRAW_TILES; + MarkTileDirty(x,y); } void DrawElementShifted(int x, int y, int dx, int dy, int element,int cut_mode) @@ -903,7 +908,7 @@ void DrawGraphicShiftedThruMask(int x,int y, int dx,int dy, int graphic, else if (x==BX2 && dx>0) /* Element verläßt rechts das Bild */ width -= dx; else if (dx) /* allg. Bewegung in x-Richtung */ - redraw[redraw_x1 + x + SIGN(dx)][redraw_y1 + y] = TRUE; + MarkTileDirty(x + SIGN(dx), y); if (y < BY1) /* Element kommt von oben ins Bild */ { @@ -935,12 +940,12 @@ void DrawGraphicShiftedThruMask(int x,int y, int dx,int dy, int graphic, height = dy; cy = TILEY-dy; dy = TILEY; - redraw[redraw_x1 + x][redraw_y1 + y + 1] = TRUE; + MarkTileDirty(x, y + 1); } /* Element verläßt unten das Bild */ else if (dy > 0 && (y == BY2 || cut_mode==CUT_BELOW)) height -= dy; else if (dy) /* allg. Bewegung in y-Richtung */ - redraw[redraw_x1 + x][redraw_y1 + y + SIGN(dy)] = TRUE; + MarkTileDirty(x, y + SIGN(dy)); } if (graphic >= GFX_START_ROCKSSCREEN && graphic <= GFX_END_ROCKSSCREEN) @@ -978,9 +983,7 @@ void DrawGraphicShiftedThruMask(int x,int y, int dx,int dy, int graphic, } #endif - redraw_tiles++; - redraw[redraw_x1 + x][redraw_y1 + y] = TRUE; - redraw_mask |= REDRAW_TILES; + MarkTileDirty(x,y); } void ErdreichAnbroeckeln(int x, int y) @@ -1048,8 +1051,7 @@ void ErdreichAnbroeckeln(int x, int y) width,height, FX+x*TILEX+cx,FY+y*TILEY+cy); } - redraw_tiles++; - redraw[redraw_x1 + x][redraw_y1 + y] = TRUE; + MarkTileDirty(x,y); } else { @@ -1093,8 +1095,7 @@ void ErdreichAnbroeckeln(int x, int y) SY+(graphic / GFX_PER_LINE)*TILEY+cy, width,height, FX+xx*TILEX+cx,FY+yy*TILEY+cy); - redraw_tiles++; - redraw[redraw_x1 + xx][redraw_y1 + yy] = TRUE; + MarkTileDirty(xx,yy); } } } @@ -1216,10 +1217,6 @@ void DrawMiniElement(int x, int y, int element) graphic = el2gfx(element); DrawMiniGraphic(x,y,graphic); - - redraw_tiles++; - redraw[x/2][y/2]=TRUE; - redraw_mask|=REDRAW_TILES; } void DrawMiniElementOrWall(int x, int y, int scroll_x, int scroll_y)