From: Holger Schemel Date: Fri, 10 Jan 2003 19:35:53 +0000 (+0100) Subject: rnd-20030110-1-src X-Git-Tag: 3.0.0^2~182 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=081f176501bc84d81d6f9d27d6170e70e4a23661;p=rocksndiamonds.git rnd-20030110-1-src --- diff --git a/src/conftime.h b/src/conftime.h index 4a631944..ec1581b4 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-01-08 01:08]" +#define COMPILE_DATE_STRING "[2003-01-10 20:34]" diff --git a/src/game.c b/src/game.c index 7754a4c0..3b52b068 100644 --- a/src/game.c +++ b/src/game.c @@ -192,7 +192,7 @@ static unsigned int getStateCheckSum(int counter) checksum += mult++ * Store[x][y]; checksum += mult++ * Store2[x][y]; checksum += mult++ * StorePlayer[x][y]; - checksum += mult++ * Frame[x][y]; + checksum += mult++ * ExplodePhase[x][y]; checksum += mult++ * AmoebaNr[x][y]; checksum += mult++ * JustStopped[x][y]; checksum += mult++ * Stop[x][y]; @@ -797,12 +797,14 @@ void InitGame() Feld[x][y] = Ur[x][y]; MovPos[x][y] = MovDir[x][y] = MovDelay[x][y] = 0; Store[x][y] = Store2[x][y] = StorePlayer[x][y] = 0; - Frame[x][y] = 0; - GfxAction[x][y] = GFX_ACTION_DEFAULT; AmoebaNr[x][y] = 0; JustStopped[x][y] = 0; Stop[x][y] = FALSE; + ExplodePhase[x][y] = 0; ExplodeField[x][y] = EX_NO_EXPLOSION; + + GfxFrame[x][y] = 0; + GfxAction[x][y] = GFX_ACTION_DEFAULT; } } @@ -1337,6 +1339,9 @@ void InitMovingField(int x, int y, int direction) int newx = x + (direction == MV_LEFT ? -1 : direction == MV_RIGHT ? +1 : 0); int newy = y + (direction == MV_UP ? -1 : direction == MV_DOWN ? +1 : 0); + if (!JustStopped[x][y] || direction != MovDir[x][y]) + GfxFrame[x][y] = 0; + MovDir[x][y] = direction; MovDir[newx][newy] = direction; @@ -1652,7 +1657,7 @@ void Explode(int ex, int ey, int phase, int mode) Feld[x][y] = EL_EXPLOSION; MovDir[x][y] = MovPos[x][y] = 0; AmoebaNr[x][y] = 0; - Frame[x][y] = 1; + ExplodePhase[x][y] = 1; Stop[x][y] = TRUE; } @@ -1668,7 +1673,7 @@ void Explode(int ex, int ey, int phase, int mode) x = ex; y = ey; - Frame[x][y] = (phase < last_phase ? phase + 1 : 0); + ExplodePhase[x][y] = (phase < last_phase ? phase + 1 : 0); if (phase == first_phase_after_start) { @@ -4975,6 +4980,8 @@ void GameActions() if (JustStopped[x][y] > 0) JustStopped[x][y]--; + GfxFrame[x][y]++; + #if DEBUG if (IS_BLOCKED(x, y)) { @@ -5042,7 +5049,7 @@ void GameActions() CheckDynamite(x, y); #if 0 else if (element == EL_EXPLOSION && !game.explosions_delayed) - Explode(x, y, Frame[x][y], EX_NORMAL); + Explode(x, y, ExplodePhase[x][y], EX_NORMAL); #endif else if (element == EL_AMOEBA_CREATING) AmoebeWaechst(x, y); @@ -5182,7 +5189,7 @@ void GameActions() if (ExplodeField[x][y]) Explode(x, y, EX_PHASE_START, ExplodeField[x][y]); else if (element == EL_EXPLOSION) - Explode(x, y, Frame[x][y], EX_NORMAL); + Explode(x, y, ExplodePhase[x][y], EX_NORMAL); ExplodeField[x][y] = EX_NO_EXPLOSION; } diff --git a/src/main.c b/src/main.c index f41160dc..1a71792c 100644 --- a/src/main.c +++ b/src/main.c @@ -44,16 +44,18 @@ short MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; short Store[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; short Store2[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; short StorePlayer[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -short Frame[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -short GfxAction[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; boolean Stop[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; short JustStopped[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; short AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; short AmoebaCnt[MAX_NUM_AMOEBA], AmoebaCnt2[MAX_NUM_AMOEBA]; +short ExplodePhase[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; short ExplodeField[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; unsigned long Elementeigenschaften1[MAX_ELEMENTS]; unsigned long Elementeigenschaften2[MAX_ELEMENTS]; +int GfxFrame[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +short GfxAction[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; + int lev_fieldx,lev_fieldy, scroll_x,scroll_y; int FX = SX, FY = SY, ScrollStepSize; diff --git a/src/main.h b/src/main.h index 6c233032..6998dd83 100644 --- a/src/main.h +++ b/src/main.h @@ -1688,16 +1688,18 @@ extern short MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern short Store[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern short Store2[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern short StorePlayer[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -extern short Frame[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -extern short GfxAction[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern boolean Stop[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern short JustStopped[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern short AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern short AmoebaCnt[MAX_NUM_AMOEBA], AmoebaCnt2[MAX_NUM_AMOEBA]; +extern short ExplodePhase[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern short ExplodeField[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern unsigned long Elementeigenschaften1[MAX_ELEMENTS]; extern unsigned long Elementeigenschaften2[MAX_ELEMENTS]; +extern int GfxFrame[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +extern short GfxAction[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; + extern int lev_fieldx,lev_fieldy, scroll_x,scroll_y; extern int FX,FY, ScrollStepSize; diff --git a/src/tools.c b/src/tools.c index 16cb3984..2eac4a72 100644 --- a/src/tools.c +++ b/src/tools.c @@ -757,7 +757,7 @@ void DrawPlayer(struct PlayerInfo *player) stored == EL_SP_INFOTRON ? IMG_SP_EXPLOSION_INFOTRON : IMG_SP_EXPLOSION); int delay = (game.emulation == EMU_SUPAPLEX ? 3 : 2); - int phase = Frame[last_jx][last_jy] - 1; + int phase = ExplodePhase[last_jx][last_jy] - 1; int frame = getGraphicAnimationFrame(graphic, phase - delay); if (phase >= delay) @@ -801,8 +801,10 @@ void DrawGraphicAnimationExt(DrawBuffer *dst_bitmap, int x, int y, void DrawGraphicAnimation(int x, int y, int graphic) { + int ux = LEVELX(x), uy = LEVELY(y); + if (!IN_SCR_FIELD(x, y) || - (FrameCounter % new_graphic_info[graphic].anim_delay) != 0) + (GfxFrame[ux][uy] % new_graphic_info[graphic].anim_delay) != 0) return; DrawGraphicAnimationExt(drawto_field, FX + x * TILEX, FY + y * TILEY, @@ -1307,7 +1309,11 @@ inline static int getFramePosition(int x, int y) else if (IS_MOVING(x, y) || CAN_MOVE(element) || CAN_FALL(element)) frame_pos = ABS(MovPos[x][y]) / (TILEX / 8); #else + frame_pos = ABS(MovPos[x][y]) / (TILEX / 8); + + frame_pos = GfxFrame[x][y]; + #endif return frame_pos;