From: Holger Schemel Date: Sun, 27 Oct 2002 01:26:00 +0000 (+0100) Subject: rnd-20021027-1-src X-Git-Tag: 3.0.0^2~218 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=234748b5eb0bc4fe29a36fd25a1d25658f53858a;p=rocksndiamonds.git rnd-20021027-1-src --- diff --git a/src/cartoons.c b/src/cartoons.c index 309d4ca4..fde4e0ca 100644 --- a/src/cartoons.c +++ b/src/cartoons.c @@ -283,7 +283,7 @@ static void PrepareBackbuffer() for(xx=0; xx start_sx) { Feld[lx - 1][ly] = delete_buffer[sx - start_sx - 1]; - DrawNewMiniElement(sx - 1, sy, Feld[lx - 1][ly]); + DrawMiniElement(sx - 1, sy, Feld[lx - 1][ly]); DrawLevelText(sx - 1, sy, 0, TEXT_SETCURSOR); } break; @@ -3213,7 +3213,7 @@ static int DrawLevelText(int sx, int sy, char letter, int mode) case TEXT_END: CopyLevelToUndoBuffer(UNDO_IMMEDIATE); - DrawNewMiniElement(sx, sy, Feld[lx][ly]); + DrawMiniElement(sx, sy, Feld[lx][ly]); typing = FALSE; break; @@ -3234,7 +3234,7 @@ static void SetTextCursor(int unused_sx, int unused_sy, int sx, int sy, int ly = sy + level_ypos; if (element == -1) - DrawNewMiniElement(sx, sy, Feld[lx][ly]); + DrawMiniElement(sx, sy, Feld[lx][ly]); else DrawAreaBorder(sx, sy, sx, sy); } @@ -3279,7 +3279,7 @@ static void CopyLevelToUndoBuffer(int mode) last_border_element = BorderElement; SetBorderElement(); if (BorderElement != last_border_element) - DrawNewMiniLevel(ed_fieldx, ed_fieldy, level_xpos, level_ypos); + DrawMiniLevel(ed_fieldx, ed_fieldy, level_xpos, level_ypos); #if 0 #ifdef DEBUG @@ -3320,7 +3320,7 @@ static void RandomPlacement(int new_element) for (y=0; y= 0 && x - level_xpos < ed_fieldx && y - level_ypos >= 0 && y - level_ypos < ed_fieldy) - DrawNewMiniElement(x - level_xpos, y - level_ypos, + DrawMiniElement(x - level_xpos, y - level_ypos, EL_EMPTY); } } @@ -3466,16 +3466,16 @@ static void HandleDrawingAreas(struct GadgetInfo *gi) } Feld[lx][ly] = new_element; - DrawNewMiniElement(sx, sy, new_element); + DrawMiniElement(sx, sy, new_element); } } else { - DrawNewMiniGraphicExt(drawto, + DrawMiniGraphicExt(drawto, gi->x + sx * MINI_TILEX, gi->y + sy * MINI_TILEY, el2img(new_element)); - DrawNewMiniGraphicExt(window, + DrawMiniGraphicExt(window, gi->x + sx * MINI_TILEX, gi->y + sy * MINI_TILEY, el2img(new_element)); @@ -3575,7 +3575,7 @@ static void HandleDrawingAreas(struct GadgetInfo *gi) if (button_press_event && Feld[lx][ly] != new_element) { FloodFill(lx, ly, new_element); - DrawNewMiniLevel(ed_fieldx, ed_fieldy, level_xpos, level_ypos); + DrawMiniLevel(ed_fieldx, ed_fieldy, level_xpos, level_ypos); CopyLevelToUndoBuffer(UNDO_IMMEDIATE); } break; @@ -3698,7 +3698,7 @@ static void HandleControlButtons(struct GadgetInfo *gi) if (button == 1) ScrollMiniLevel(level_xpos, level_ypos, ED_SCROLL_RIGHT); else - DrawNewMiniLevel(ed_fieldx, ed_fieldy, level_xpos, level_ypos); + DrawMiniLevel(ed_fieldx, ed_fieldy, level_xpos, level_ypos); ModifyGadget(level_editor_gadget[GADGET_ID_SCROLL_HORIZONTAL], GDI_SCROLLBAR_ITEM_POSITION, level_xpos + 1, GDI_END); @@ -3717,7 +3717,7 @@ static void HandleControlButtons(struct GadgetInfo *gi) if (button == 1) ScrollMiniLevel(level_xpos, level_ypos, ED_SCROLL_LEFT); else - DrawNewMiniLevel(ed_fieldx, ed_fieldy, level_xpos, level_ypos); + DrawMiniLevel(ed_fieldx, ed_fieldy, level_xpos, level_ypos); ModifyGadget(level_editor_gadget[GADGET_ID_SCROLL_HORIZONTAL], GDI_SCROLLBAR_ITEM_POSITION, level_xpos + 1, GDI_END); @@ -3736,7 +3736,7 @@ static void HandleControlButtons(struct GadgetInfo *gi) if (button == 1) ScrollMiniLevel(level_xpos, level_ypos, ED_SCROLL_DOWN); else - DrawNewMiniLevel(ed_fieldx, ed_fieldy, level_xpos, level_ypos); + DrawMiniLevel(ed_fieldx, ed_fieldy, level_xpos, level_ypos); ModifyGadget(level_editor_gadget[GADGET_ID_SCROLL_VERTICAL], GDI_SCROLLBAR_ITEM_POSITION, level_ypos + 1, GDI_END); @@ -3755,7 +3755,7 @@ static void HandleControlButtons(struct GadgetInfo *gi) if (button == 1) ScrollMiniLevel(level_xpos, level_ypos, ED_SCROLL_UP); else - DrawNewMiniLevel(ed_fieldx, ed_fieldy, level_xpos, level_ypos); + DrawMiniLevel(ed_fieldx, ed_fieldy, level_xpos, level_ypos); ModifyGadget(level_editor_gadget[GADGET_ID_SCROLL_VERTICAL], GDI_SCROLLBAR_ITEM_POSITION, level_ypos + 1, GDI_END); @@ -3764,12 +3764,12 @@ static void HandleControlButtons(struct GadgetInfo *gi) case GADGET_ID_SCROLL_HORIZONTAL: level_xpos = gi->event.item_position - 1; - DrawNewMiniLevel(ed_fieldx, ed_fieldy, level_xpos, level_ypos); + DrawMiniLevel(ed_fieldx, ed_fieldy, level_xpos, level_ypos); break; case GADGET_ID_SCROLL_VERTICAL: level_ypos = gi->event.item_position - 1; - DrawNewMiniLevel(ed_fieldx, ed_fieldy, level_xpos, level_ypos); + DrawMiniLevel(ed_fieldx, ed_fieldy, level_xpos, level_ypos); break; case GADGET_ID_SCROLL_LIST_UP: @@ -3800,7 +3800,7 @@ static void HandleControlButtons(struct GadgetInfo *gi) int element = editor_element[element_shift + i]; UnmapGadget(gi); - getNewMiniGraphicSource(el2img(element), &gd->bitmap, &gd->x, &gd->y); + getMiniGraphicSource(el2img(element), &gd->bitmap, &gd->x, &gd->y); ModifyGadget(gi, GDI_INFO_TEXT, getElementInfoText(element), GDI_END); MapGadget(gi); } @@ -3869,7 +3869,7 @@ static void HandleControlButtons(struct GadgetInfo *gi) for(x=0; x 6) - frame = 6; - } - else - { - if ((frame = ((96 - MovDelay[x][y]) / 6) % 8) > 3) - frame = 7 - frame; - } -#else - frame = getNewGraphicAnimationFrame(graphic, 96 - MovDelay[x][y]); -#endif + frame = getGraphicAnimationFrame(graphic, 96 - 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); + DrawGraphic(sx, sy, IMG_SP_DISK_RED, 0); else if (Store[x][y]) - DrawGraphicThruMask(sx, sy, graphic + frame); + DrawGraphicThruMask(sx, sy, graphic, frame); else - 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, frame); - else - DrawNewGraphic(sx, sy, graphic, frame); -#endif + DrawGraphic(sx, sy, graphic, frame); } void CheckDynamite(int x, int y) @@ -1725,23 +1695,13 @@ void Explode(int ex, int ey, int phase, int mode) InitField(x, y, FALSE); if (CAN_MOVE(element) || COULD_MOVE(element)) InitMovDir(x, y); - DrawNewLevelField(x, y); + DrawLevelField(x, y); if (IS_PLAYER(x, y) && !PLAYERINFO(x,y)->present) StorePlayer[x][y] = 0; } else if (!(phase % delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y))) { -#if 0 - int graphic = GFX_EXPLOSION; - - if (game.emulation == EMU_SUPAPLEX) - graphic = (Store[x][y] == EL_SP_INFOTRON ? - GFX_SP_EXPLODE_INFOTRON : - GFX_SP_EXPLODE_EMPTY); - - graphic += (phase / delay - 1); -#else int graphic = IMG_EXPLOSION; int frame = (phase / delay - 1); @@ -1749,26 +1709,17 @@ void Explode(int ex, int ey, int phase, int mode) graphic = (Store[x][y] == EL_SP_INFOTRON ? IMG_SP_EXPLOSION_INFOTRON : IMG_SP_EXPLOSION); -#endif if (phase == delay) DrawCrumbledSand(SCREENX(x), SCREENY(y)); if (IS_PFORTE(Store[x][y])) { - DrawNewLevelElement(x, y, Store[x][y]); -#if 0 - DrawGraphicThruMask(SCREENX(x), SCREENY(y), graphic); -#else - DrawNewGraphicThruMask(SCREENX(x), SCREENY(y), graphic, frame); -#endif + DrawLevelElement(x, y, Store[x][y]); + DrawGraphicThruMask(SCREENX(x), SCREENY(y), graphic, frame); } else -#if 0 - DrawGraphic(SCREENX(x), SCREENY(y), graphic); -#else - DrawNewGraphic(SCREENX(x), SCREENY(y), graphic, frame); -#endif + DrawGraphic(SCREENX(x), SCREENY(y), graphic, frame); } } @@ -1898,14 +1849,9 @@ void Blurb(int x, int y) } else /* go on */ { -#if 0 - int graphic = - (element == EL_ACID_SPLASH_LEFT ? GFX_BLURB_LEFT : GFX_BLURB_RIGHT); -#else int graphic = (element == EL_ACID_SPLASH_LEFT ? IMG_ACID_SPLASH_LEFT : IMG_ACID_SPLASH_RIGHT); -#endif if (!MovDelay[x][y]) /* initialize animation counter */ MovDelay[x][y] = 9; @@ -1914,20 +1860,16 @@ void Blurb(int x, int y) { MovDelay[x][y]--; if (MovDelay[x][y]/2 && IN_SCR_FIELD(SCREENX(x), SCREENY(y))) -#if 0 - DrawGraphic(SCREENX(x), SCREENY(y), graphic+4-MovDelay[x][y]/2); -#else { - int frame = getNewGraphicAnimationFrame(graphic, 8 - MovDelay[x][y]); + int frame = getGraphicAnimationFrame(graphic, 8 - MovDelay[x][y]); - DrawNewGraphic(SCREENX(x), SCREENY(y), graphic, frame); + DrawGraphic(SCREENX(x), SCREENY(y), graphic, frame); } -#endif if (!MovDelay[x][y]) { Feld[x][y] = EL_EMPTY; - DrawNewLevelField(x, y); + DrawLevelField(x, y); } } } @@ -2004,7 +1946,7 @@ static void ToggleBeltSwitch(int x, int y) if (e_belt_nr == belt_nr) { Feld[xx][yy] = belt_base_switch_element[belt_nr] + belt_dir_nr; - DrawNewLevelField(xx, yy); + DrawLevelField(xx, yy); } } else if (IS_BELT(element) && belt_dir != MV_NO_MOVING) @@ -2016,7 +1958,7 @@ static void ToggleBeltSwitch(int x, int y) int belt_part = Feld[xx][yy] - belt_base_element[belt_nr]; Feld[xx][yy] = belt_base_active_element[belt_nr] + belt_part; - DrawNewLevelField(xx, yy); + DrawLevelField(xx, yy); } } else if (IS_BELT_ACTIVE(element) && belt_dir == MV_NO_MOVING) @@ -2028,7 +1970,7 @@ static void ToggleBeltSwitch(int x, int y) int belt_part = Feld[xx][yy] - belt_base_active_element[belt_nr]; Feld[xx][yy] = belt_base_element[belt_nr] + belt_part; - DrawNewLevelField(xx, yy); + DrawLevelField(xx, yy); } } } @@ -2051,7 +1993,7 @@ static void ToggleSwitchgateSwitch(int x, int y) element == EL_SWITCHGATE_SWITCH_DOWN) { Feld[xx][yy] = EL_SWITCHGATE_SWITCH_UP + game.switchgate_pos; - DrawNewLevelField(xx, yy); + DrawLevelField(xx, yy); } else if (element == EL_SWITCHGATE_OPEN || element == EL_SWITCHGATE_OPENING) @@ -2097,13 +2039,13 @@ static void RedrawAllLightSwitchesAndInvisibleElements() game.light_time_left > 0) { Feld[x][y] = EL_LIGHT_SWITCH_ACTIVE; - DrawNewLevelField(x, y); + DrawLevelField(x, y); } else if (element == EL_LIGHT_SWITCH_ACTIVE && game.light_time_left == 0) { Feld[x][y] = EL_LIGHT_SWITCH; - DrawNewLevelField(x, y); + DrawLevelField(x, y); } else if (element == EL_INVISIBLE_STEELWALL || element == EL_INVISIBLE_WALL || @@ -2112,7 +2054,7 @@ static void RedrawAllLightSwitchesAndInvisibleElements() if (game.light_time_left > 0) Feld[x][y] = getInvisibleActiveFromInvisibleElement(element); - DrawNewLevelField(x, y); + DrawLevelField(x, y); } else if (element == EL_INVISIBLE_STEELWALL_ACTIVE || element == EL_INVISIBLE_WALL_ACTIVE || @@ -2121,7 +2063,7 @@ static void RedrawAllLightSwitchesAndInvisibleElements() if (game.light_time_left == 0) Feld[x][y] = getInvisibleFromInvisibleActiveElement(element); - DrawNewLevelField(x, y); + DrawLevelField(x, y); } } } @@ -2992,7 +2934,7 @@ void StartMoving(int x, int y) element == EL_SP_SNIKSNAK || element == EL_SP_ELECTRON || element == EL_MOLE)) - DrawNewLevelField(x, y); + DrawLevelField(x, y); } } @@ -3003,22 +2945,13 @@ void StartMoving(int x, int y) if (element == EL_ROBOT || element == EL_YAMYAM || element == EL_DARK_YAMYAM) { - int phase = MovDelay[x][y] % 8; - - if (phase > 3) - phase = 7 - phase; - if (IN_SCR_FIELD(SCREENX(x), SCREENY(y))) -#if 0 - DrawGraphic(SCREENX(x), SCREENY(y), el2gfx(element) + phase); -#else { int graphic = el2img(element); - int frame = getNewGraphicAnimationFrame(graphic, MovDelay[x][y] % 8); + int frame = getGraphicAnimationFrame(graphic, MovDelay[x][y] % 8); - DrawNewGraphic(SCREENX(x), SCREENY(y), graphic, frame); + DrawGraphic(SCREENX(x), SCREENY(y), graphic, frame); } -#endif if (MovDelay[x][y] % 4 == 3) { @@ -3029,30 +2962,18 @@ void StartMoving(int x, int y) } } else if (element == EL_SP_ELECTRON) -#if 0 - DrawGraphicAnimation(x, y, GFX2_SP_ELECTRON, 8, 2, ANIM_LOOP); -#else - DrawNewGraphicAnimation(x, y, IMG_SP_ELECTRON); -#endif + DrawGraphicAnimation(x, y, IMG_SP_ELECTRON); else if (element == EL_DRAGON) { int i; int dir = MovDir[x][y]; int dx = (dir == MV_LEFT ? -1 : dir == MV_RIGHT ? +1 : 0); int dy = (dir == MV_UP ? -1 : dir == MV_DOWN ? +1 : 0); -#if 0 - int graphic = (dir == MV_LEFT ? GFX_FLAMMEN_LEFT : - dir == MV_RIGHT ? GFX_FLAMMEN_RIGHT : - dir == MV_UP ? GFX_FLAMMEN_UP : - dir == MV_DOWN ? GFX_FLAMMEN_DOWN : GFX_LEERRAUM); - int phase = FrameCounter % 2; -#else int graphic = (dir == MV_LEFT ? IMG_FLAMES_LEFT1 : dir == MV_RIGHT ? IMG_FLAMES_RIGHT1 : dir == MV_UP ? IMG_FLAMES_UP1 : dir == MV_DOWN ? IMG_FLAMES_DOWN1 : IMG_EMPTY); - int frame = getNewGraphicAnimationFrame(graphic, -1); -#endif + int frame = getGraphicAnimationFrame(graphic, -1); for (i=1; i<=3; i++) { @@ -3075,17 +2996,13 @@ void StartMoving(int x, int y) Feld[xx][yy] = EL_FLAMES; if (IN_SCR_FIELD(sx, sy)) -#if 0 - DrawGraphic(sx, sy, graphic + phase*3 + i-1); -#else - DrawNewGraphic(sx, sy, flame_graphic, frame); -#endif + DrawGraphic(sx, sy, flame_graphic, frame); } else { if (Feld[xx][yy] == EL_FLAMES) Feld[xx][yy] = EL_EMPTY; - DrawNewLevelField(xx, yy); + DrawLevelField(xx, yy); } } } @@ -3130,16 +3047,11 @@ void StartMoving(int x, int y) if (Feld[newx][newy] == EL_EXIT_OPEN) { Feld[x][y] = EL_EMPTY; - DrawNewLevelField(x, y); + DrawLevelField(x, y); PlaySoundLevel(newx, newy, SND_PENGUIN_PASSING_EXIT); if (IN_SCR_FIELD(SCREENX(newx), SCREENY(newy))) -#if 0 - DrawGraphicThruMask(SCREENX(newx), SCREENY(newy), el2gfx(element)); -#else - DrawNewGraphicThruMask(SCREENX(newx), SCREENY(newy), el2img(element), - 0); -#endif + DrawGraphicThruMask(SCREENX(newx),SCREENY(newy), el2img(element), 0); local_player->friends_still_needed--; if (!local_player->friends_still_needed && @@ -3151,7 +3063,7 @@ void StartMoving(int x, int y) else if (IS_MAMPF3(Feld[newx][newy])) { if (DigField(local_player, newx, newy, 0, 0, DF_DIG) == MF_MOVING) - DrawNewLevelField(newx, newy); + DrawLevelField(newx, newy); else MovDir[x][y] = MV_NO_MOVING; } @@ -3160,7 +3072,7 @@ void StartMoving(int x, int y) if (IS_PLAYER(x, y)) DrawPlayerField(x, y); else - DrawNewLevelField(x, y); + DrawLevelField(x, y); return; } } @@ -3173,7 +3085,7 @@ void StartMoving(int x, int y) else { Feld[newx][newy] = EL_EMPTY; - DrawNewLevelField(newx, newy); + DrawLevelField(newx, newy); } PlaySoundLevel(x, y, SND_PIG_EATING); @@ -3183,7 +3095,7 @@ void StartMoving(int x, int y) if (IS_PLAYER(x, y)) DrawPlayerField(x, y); else - DrawNewLevelField(x, y); + DrawLevelField(x, y); return; } } @@ -3194,7 +3106,7 @@ void StartMoving(int x, int y) if (IS_PLAYER(x, y)) DrawPlayerField(x, y); else - DrawNewLevelField(x, y); + DrawLevelField(x, y); return; } else @@ -3215,7 +3127,7 @@ void StartMoving(int x, int y) if (IS_PLAYER(x, y)) DrawPlayerField(x, y); else - DrawNewLevelField(x, y); + DrawLevelField(x, y); PlaySoundLevel(x, y, SND_DRAGON_ATTACKING); @@ -3237,7 +3149,7 @@ void StartMoving(int x, int y) else { Feld[newx][newy] = EL_EMPTY; - DrawNewLevelField(newx, newy); + DrawLevelField(newx, newy); } PlaySoundLevel(x, y, SND_YAMYAM_EATING); @@ -3258,7 +3170,7 @@ void StartMoving(int x, int y) else { Feld[newx][newy] = EL_EMPTY; - DrawNewLevelField(newx, newy); + DrawLevelField(newx, newy); } PlaySoundLevel(x, y, SND_DARK_YAMYAM_EATING); @@ -3284,7 +3196,7 @@ void StartMoving(int x, int y) else /* element == EL_PACMAN */ { Feld[newx][newy] = EL_EMPTY; - DrawNewLevelField(newx, newy); + DrawLevelField(newx, newy); PlaySoundLevel(x, y, SND_PACMAN_EATING); } } @@ -3303,36 +3215,16 @@ void StartMoving(int x, int y) if (element == EL_BUG || element == EL_SPACESHIP || element == EL_SP_SNIKSNAK) -#if 0 DrawLevelField(x, y); -#else - DrawNewLevelField(x, y); -#endif else if (element == EL_BUG || element == EL_SPACESHIP || element == EL_SP_SNIKSNAK || element == EL_MOLE) -#if 0 DrawLevelField(x, y); -#else - DrawNewLevelField(x, y); -#endif else if (element == EL_BD_BUTTERFLY || element == EL_BD_FIREFLY) -#if 0 - DrawGraphicAnimation(x, y, el2gfx(element), 2, 4, ANIM_LOOP); -#else - DrawNewGraphicAnimation(x, y, el2img(element)); -#endif + DrawGraphicAnimation(x, y, el2img(element)); else if (element == EL_SATELLITE) -#if 0 - DrawGraphicAnimation(x, y, GFX_SONDE_START, 8, 2, ANIM_LOOP); -#else - DrawNewGraphicAnimation(x, y, IMG_SATELLITE); -#endif + DrawGraphicAnimation(x, y, IMG_SATELLITE); else if (element == EL_SP_ELECTRON) -#if 0 - DrawGraphicAnimation(x, y, GFX2_SP_ELECTRON, 8, 2, ANIM_LOOP); -#else - DrawNewGraphicAnimation(x, y, IMG_SP_ELECTRON); -#endif + DrawGraphicAnimation(x, y, IMG_SP_ELECTRON); if (DONT_TOUCH(element)) TestIfBadThingTouchesHero(x, y); @@ -3401,7 +3293,7 @@ void ContinueMoving(int x, int y) }; Feld[x][y] = EL_SAND; - DrawNewLevelField(x, y); + DrawLevelField(x, y); for(i=0; i<4; i++) { @@ -3411,7 +3303,7 @@ void ContinueMoving(int x, int y) yy = y + xy[i][1]; if (IN_LEV_FIELD(xx, yy) && Feld[xx][yy] == EL_SAND) - DrawNewLevelField(xx, yy); /* for "DrawCrumbledSand()" */ + DrawLevelField(xx, yy); /* for "DrawCrumbledSand()" */ } } @@ -3473,8 +3365,8 @@ void ContinueMoving(int x, int y) if (!CAN_MOVE(element)) MovDir[newx][newy] = 0; - DrawNewLevelField(x, y); - DrawNewLevelField(newx, newy); + DrawLevelField(x, y); + DrawLevelField(newx, newy); Stop[newx][newy] = TRUE; JustStopped[newx][newy] = 3; @@ -3497,7 +3389,7 @@ void ContinueMoving(int x, int y) if (GfxAction[x][y] == GFX_ACTION_DEFAULT) GfxAction[x][y] = GFX_ACTION_MOVING; - DrawNewLevelField(x, y); + DrawLevelField(x, y); } } @@ -3668,7 +3560,7 @@ void AmoebeUmwandelnBD(int ax, int ay, int new_element) AmoebaNr[x][y] = 0; Feld[x][y] = new_element; InitField(x, y, FALSE); - DrawNewLevelField(x, y); + DrawLevelField(x, y); done = TRUE; } } @@ -3703,22 +3595,18 @@ void AmoebeWaechst(int x, int y) { MovDelay[x][y]--; if (MovDelay[x][y]/2 && IN_SCR_FIELD(SCREENX(x), SCREENY(y))) -#if 0 - DrawGraphic(SCREENX(x), SCREENY(y), GFX_AMOEBING + 3 - MovDelay[x][y]/2); -#else { - int frame = getNewGraphicAnimationFrame(IMG_AMOEBA_CREATING, - 6 - MovDelay[x][y]); + int frame = getGraphicAnimationFrame(IMG_AMOEBA_CREATING, + 6 - MovDelay[x][y]); - DrawNewGraphic(SCREENX(x), SCREENY(y), IMG_AMOEBA_CREATING, frame); + DrawGraphic(SCREENX(x), SCREENY(y), IMG_AMOEBA_CREATING, frame); } -#endif if (!MovDelay[x][y]) { Feld[x][y] = Store[x][y]; Store[x][y] = 0; - DrawNewLevelField(x, y); + DrawLevelField(x, y); } } } @@ -3740,21 +3628,17 @@ void AmoebaDisappearing(int x, int y) { MovDelay[x][y]--; if (MovDelay[x][y]/2 && IN_SCR_FIELD(SCREENX(x), SCREENY(y))) -#if 0 - DrawGraphic(SCREENX(x), SCREENY(y), GFX_AMOEBING + MovDelay[x][y]/2); -#else { - int frame = getNewGraphicAnimationFrame(IMG_AMOEBA_SHRINKING, - 6 - MovDelay[x][y]); + int frame = getGraphicAnimationFrame(IMG_AMOEBA_SHRINKING, + 6 - MovDelay[x][y]); - DrawNewGraphic(SCREENX(x), SCREENY(y), IMG_AMOEBA_SHRINKING, frame); + DrawGraphic(SCREENX(x), SCREENY(y), IMG_AMOEBA_SHRINKING, frame); } -#endif if (!MovDelay[x][y]) { Feld[x][y] = EL_EMPTY; - DrawNewLevelField(x, y); + DrawLevelField(x, y); /* don't let mole enter this field in this cycle; (give priority to objects falling to this field from above) */ @@ -3779,7 +3663,7 @@ void AmoebeAbleger(int ax, int ay) if (!level.amoeba_speed) { Feld[ax][ay] = EL_AMOEBA_DEAD; - DrawNewLevelField(ax, ay); + DrawLevelField(ax, ay); return; } @@ -3842,7 +3726,7 @@ void AmoebeAbleger(int ax, int ay) if (i == 4 && (!waiting_for_player || game.emulation == EMU_BOULDERDASH)) { Feld[ax][ay] = EL_AMOEBA_DEAD; - DrawNewLevelField(ax, ay); + DrawLevelField(ax, ay); AmoebaCnt[AmoebaNr[ax][ay]]--; if (AmoebaCnt[AmoebaNr[ax][ay]] <= 0) /* amoeba is completely dead */ @@ -3905,7 +3789,7 @@ void AmoebeAbleger(int ax, int ay) return; } - DrawNewLevelField(newax, neway); + DrawLevelField(newax, neway); } void Life(int ax, int ay) @@ -3957,7 +3841,7 @@ void Life(int ax, int ay) { Feld[xx][yy] = EL_EMPTY; if (!Stop[xx][yy]) - DrawNewLevelField(xx, yy); + DrawLevelField(xx, yy); Stop[xx][yy] = TRUE; changed = TRUE; } @@ -3969,7 +3853,7 @@ void Life(int ax, int ay) Feld[xx][yy] = element; MovDelay[xx][yy] = (element == EL_GAMEOFLIFE ? 0 : life_time-1); if (!Stop[xx][yy]) - DrawNewLevelField(xx, yy); + DrawLevelField(xx, yy); Stop[xx][yy] = TRUE; changed = TRUE; } @@ -3992,15 +3876,12 @@ void RobotWheel(int x, int y) if (MovDelay[x][y]) { if (IN_SCR_FIELD(SCREENX(x), SCREENY(y))) -#if 0 - DrawGraphic(SCREENX(x), SCREENY(y), GFX_ABLENK+MovDelay[x][y]%4); -#else - { - int frame = getNewGraphicAnimationFrame(IMG_ROBOT_WHEEL_ACTIVE, -1); + { + int frame = getGraphicAnimationFrame(IMG_ROBOT_WHEEL_ACTIVE, -1); + + DrawGraphic(SCREENX(x), SCREENY(y), IMG_ROBOT_WHEEL_ACTIVE, frame); + } - DrawNewGraphic(SCREENX(x), SCREENY(y), IMG_ROBOT_WHEEL_ACTIVE, frame); - } -#endif if (!(MovDelay[x][y]%4)) PlaySoundLevel(x, y, SND_ROBOT_WHEEL_ACTIVE); return; @@ -4008,7 +3889,7 @@ void RobotWheel(int x, int y) } Feld[x][y] = EL_ROBOT_WHEEL; - DrawNewLevelField(x, y); + DrawLevelField(x, y); if (ZX == x && ZY == y) ZX = ZY = -1; } @@ -4024,16 +3905,12 @@ void TimegateWheel(int x, int y) if (MovDelay[x][y]) { if (IN_SCR_FIELD(SCREENX(x), SCREENY(y))) -#if 0 - DrawGraphic(SCREENX(x), SCREENY(y), - GFX_TIMEGATE_SWITCH + MovDelay[x][y]%4); -#else - { - int frame = getNewGraphicAnimationFrame(IMG_TIMEGATE_SWITCH_ACTIVE, -1); + { + int frame = getGraphicAnimationFrame(IMG_TIMEGATE_SWITCH_ACTIVE, -1); + + DrawGraphic(SCREENX(x), SCREENY(y), IMG_TIMEGATE_SWITCH_ACTIVE, frame); + } - DrawNewGraphic(SCREENX(x), SCREENY(y), IMG_TIMEGATE_SWITCH_ACTIVE, frame); - } -#endif if (!(MovDelay[x][y]%4)) PlaySoundLevel(x, y, SND_TIMEGATE_SWITCH_ACTIVE); return; @@ -4041,21 +3918,14 @@ void TimegateWheel(int x, int y) } Feld[x][y] = EL_TIMEGATE_SWITCH; - DrawNewLevelField(x, y); + DrawLevelField(x, y); if (ZX == x && ZY == y) ZX = ZY = -1; } void Blubber(int x, int y) { -#if 0 - if (y > 0 && IS_MOVING(x, y - 1) && MovDir[x][y - 1] == MV_DOWN) - DrawNewLevelField(x, y - 1); - else - DrawGraphicAnimation(x, y, GFX_GEBLUBBER, 4, 10, ANIM_LOOP); -#else - DrawNewGraphicAnimation(x, y, IMG_ACID); -#endif + DrawGraphicAnimation(x, y, IMG_ACID); } void NussKnacken(int x, int y) @@ -4067,22 +3937,17 @@ void NussKnacken(int x, int y) { MovDelay[x][y]--; if (MovDelay[x][y]/2 && IN_SCR_FIELD(SCREENX(x), SCREENY(y))) -#if 0 - DrawGraphic(SCREENX(x), SCREENY(y), - GFX_CRACKINGNUT + 3 - MovDelay[x][y]/2); -#else { - int frame = getNewGraphicAnimationFrame(IMG_NUT_CRACKING, - 6 - MovDelay[x][y]); + int frame = getGraphicAnimationFrame(IMG_NUT_CRACKING, + 6 - MovDelay[x][y]); - DrawNewGraphic(SCREENX(x), SCREENY(y), IMG_NUT_CRACKING, frame); + DrawGraphic(SCREENX(x), SCREENY(y), IMG_NUT_CRACKING, frame); } -#endif if (!MovDelay[x][y]) { Feld[x][y] = EL_EMERALD; - DrawNewLevelField(x, y); + DrawLevelField(x, y); } } } @@ -4096,37 +3961,26 @@ void BreakingPearl(int x, int y) { MovDelay[x][y]--; if (MovDelay[x][y]/2 && IN_SCR_FIELD(SCREENX(x), SCREENY(y))) -#if 0 - DrawGraphic(SCREENX(x), SCREENY(y), - GFX_PEARL_BREAKING + 4 - MovDelay[x][y]/2); -#else { - int frame = getNewGraphicAnimationFrame(IMG_PEARL_BREAKING, - 8 - MovDelay[x][y]); + int frame = getGraphicAnimationFrame(IMG_PEARL_BREAKING, + 8 - MovDelay[x][y]); - DrawNewGraphic(SCREENX(x), SCREENY(y), IMG_PEARL_BREAKING, frame); + DrawGraphic(SCREENX(x), SCREENY(y), IMG_PEARL_BREAKING, frame); } -#endif if (!MovDelay[x][y]) { Feld[x][y] = EL_EMPTY; - DrawNewLevelField(x, y); + DrawLevelField(x, y); } } } void SiebAktivieren(int x, int y, int type) { -#if 0 - int graphic = (type == 1 ? GFX_MAGIC_WALL_FULL : GFX_MAGIC_WALL_BD_FULL) + 3; - - DrawGraphicAnimation(x, y, graphic, 4, 4, ANIM_REVERSE); -#else int graphic = (type == 1 ? IMG_MAGIC_WALL_FULL : IMG_BD_MAGIC_WALL_FULL); - DrawNewGraphicAnimation(x, y, graphic); -#endif + DrawGraphicAnimation(x, y, graphic); } void AusgangstuerPruefen(int x, int y) @@ -4173,32 +4027,24 @@ void AusgangstuerOeffnen(int x, int y) MovDelay[x][y]--; tuer = MovDelay[x][y]/delay; if (!(MovDelay[x][y]%delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y))) -#if 0 - DrawGraphic(SCREENX(x), SCREENY(y), GFX_AUSGANG_AUF-tuer); -#else { - int frame = getNewGraphicAnimationFrame(IMG_EXIT_OPENING, - 29 - MovDelay[x][y]); + int frame = getGraphicAnimationFrame(IMG_EXIT_OPENING, + 29 - MovDelay[x][y]); - DrawNewGraphic(SCREENX(x), SCREENY(y), IMG_EXIT_OPENING, frame); + DrawGraphic(SCREENX(x), SCREENY(y), IMG_EXIT_OPENING, frame); } -#endif if (!MovDelay[x][y]) { Feld[x][y] = EL_EXIT_OPEN; - DrawNewLevelField(x, y); + DrawLevelField(x, y); } } } void AusgangstuerBlinken(int x, int y) { -#if 0 - DrawGraphicAnimation(x, y, GFX_AUSGANG_AUF, 4, 4, ANIM_PINGPONG); -#else - DrawNewGraphicAnimation(x, y, IMG_EXIT_OPEN); -#endif + DrawGraphicAnimation(x, y, IMG_EXIT_OPEN); } void OpenSwitchgate(int x, int y) @@ -4210,26 +4056,20 @@ void OpenSwitchgate(int x, int y) if (MovDelay[x][y]) /* wait some time before next frame */ { - int phase; - MovDelay[x][y]--; - phase = MovDelay[x][y] / delay; + if (!(MovDelay[x][y] % delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y))) -#if 0 - DrawGraphic(SCREENX(x), SCREENY(y), GFX_SWITCHGATE_OPEN - phase); -#else { - int frame = getNewGraphicAnimationFrame(IMG_SWITCHGATE_OPENING, - 29 - MovDelay[x][y]); + int frame = getGraphicAnimationFrame(IMG_SWITCHGATE_OPENING, + 29 - MovDelay[x][y]); - DrawNewGraphic(SCREENX(x), SCREENY(y), IMG_SWITCHGATE_OPENING, frame); + DrawGraphic(SCREENX(x), SCREENY(y), IMG_SWITCHGATE_OPENING, frame); } -#endif if (!MovDelay[x][y]) { Feld[x][y] = EL_SWITCHGATE_OPEN; - DrawNewLevelField(x, y); + DrawLevelField(x, y); } } } @@ -4243,26 +4083,20 @@ void CloseSwitchgate(int x, int y) if (MovDelay[x][y]) /* wait some time before next frame */ { - int phase; - MovDelay[x][y]--; - phase = MovDelay[x][y] / delay; + if (!(MovDelay[x][y] % delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y))) -#if 0 - DrawGraphic(SCREENX(x), SCREENY(y), GFX_SWITCHGATE_CLOSED + phase); -#else { - int frame = getNewGraphicAnimationFrame(IMG_SWITCHGATE_CLOSING, - 29 - MovDelay[x][y]); + int frame = getGraphicAnimationFrame(IMG_SWITCHGATE_CLOSING, + 29 - MovDelay[x][y]); - DrawNewGraphic(SCREENX(x), SCREENY(y), IMG_SWITCHGATE_CLOSING, frame); + DrawGraphic(SCREENX(x), SCREENY(y), IMG_SWITCHGATE_CLOSING, frame); } -#endif if (!MovDelay[x][y]) { Feld[x][y] = EL_SWITCHGATE_CLOSED; - DrawNewLevelField(x, y); + DrawLevelField(x, y); } } } @@ -4276,26 +4110,20 @@ void OpenTimegate(int x, int y) if (MovDelay[x][y]) /* wait some time before next frame */ { - int phase; - MovDelay[x][y]--; - phase = MovDelay[x][y] / delay; + if (!(MovDelay[x][y] % delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y))) -#if 0 - DrawGraphic(SCREENX(x), SCREENY(y), GFX_TIMEGATE_OPEN - phase); -#else { - int frame = getNewGraphicAnimationFrame(IMG_TIMEGATE_OPENING, - 29 - MovDelay[x][y]); + int frame = getGraphicAnimationFrame(IMG_TIMEGATE_OPENING, + 29 - MovDelay[x][y]); - DrawNewGraphic(SCREENX(x), SCREENY(y), IMG_TIMEGATE_OPENING, frame); + DrawGraphic(SCREENX(x), SCREENY(y), IMG_TIMEGATE_OPENING, frame); } -#endif if (!MovDelay[x][y]) { Feld[x][y] = EL_TIMEGATE_OPEN; - DrawNewLevelField(x, y); + DrawLevelField(x, y); } } } @@ -4309,26 +4137,20 @@ void CloseTimegate(int x, int y) if (MovDelay[x][y]) /* wait some time before next frame */ { - int phase; - MovDelay[x][y]--; - phase = MovDelay[x][y] / delay; + if (!(MovDelay[x][y] % delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y))) -#if 0 - DrawGraphic(SCREENX(x), SCREENY(y), GFX_TIMEGATE_CLOSED + phase); -#else { - int frame = getNewGraphicAnimationFrame(IMG_TIMEGATE_CLOSING, - 29 - MovDelay[x][y]); + int frame = getGraphicAnimationFrame(IMG_TIMEGATE_CLOSING, + 29 - MovDelay[x][y]); - DrawNewGraphic(SCREENX(x), SCREENY(y), IMG_TIMEGATE_CLOSING, frame); + DrawGraphic(SCREENX(x), SCREENY(y), IMG_TIMEGATE_CLOSING, frame); } -#endif if (!MovDelay[x][y]) { Feld[x][y] = EL_TIMEGATE_CLOSED; - DrawNewLevelField(x, y); + DrawLevelField(x, y); } } } @@ -4358,11 +4180,7 @@ void EdelsteinFunkeln(int x, int y) return; if (Feld[x][y] == EL_BD_DIAMOND) -#if 0 - DrawGraphicAnimation(x, y, GFX_EDELSTEIN_BD, 4, 4, ANIM_REVERSE); -#else - DrawNewGraphicAnimation(x, y, IMG_BD_DIAMOND); -#endif + DrawGraphicAnimation(x, y, IMG_BD_DIAMOND); else { if (!MovDelay[x][y]) /* next animation frame */ @@ -4375,30 +4193,14 @@ void EdelsteinFunkeln(int x, int y) if (setup.direct_draw && MovDelay[x][y]) SetDrawtoField(DRAW_BUFFERED); -#if 0 - DrawGraphic(SCREENX(x), SCREENY(y), el2gfx(Feld[x][y])); -#else - DrawNewGraphic(SCREENX(x), SCREENY(y), el2img(Feld[x][y]), 0); -#endif + DrawGraphic(SCREENX(x), SCREENY(y), el2img(Feld[x][y]), 0); if (MovDelay[x][y]) { - int phase = (MovDelay[x][y]-1)/2; + int frame = getGraphicAnimationFrame(IMG_TWINKLE_WHITE, + 10 - MovDelay[x][y]); - if (phase > 2) - phase = 4-phase; - -#if 0 - DrawGraphicThruMask(SCREENX(x), SCREENY(y), GFX_FUNKELN_WEISS + phase); -#else - { - int frame = getNewGraphicAnimationFrame(IMG_TWINKLE_WHITE, - 10 - MovDelay[x][y]); - - DrawNewGraphicThruMask(SCREENX(x), SCREENY(y), IMG_TWINKLE_WHITE, - frame); - } -#endif + DrawGraphicThruMask(SCREENX(x), SCREENY(y), IMG_TWINKLE_WHITE, frame); if (setup.direct_draw) { @@ -4425,54 +4227,43 @@ void MauerWaechst(int x, int y) if (MovDelay[x][y]) /* wait some time before next frame */ { - int phase; - MovDelay[x][y]--; - phase = 2 - MovDelay[x][y] / delay; -#if 0 - if (!(MovDelay[x][y]%delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y))) - DrawGraphic(SCREENX(x), SCREENY(y), - (MovDir[x][y] == MV_LEFT ? GFX_MAUER_LEFT : - MovDir[x][y] == MV_RIGHT ? GFX_MAUER_RIGHT : - MovDir[x][y] == MV_UP ? GFX_MAUER_UP : - GFX_MAUER_DOWN ) + phase); -#else + if (IN_SCR_FIELD(SCREENX(x), SCREENY(y))) { int graphic = el_dir2img(Feld[x][y], MovDir[x][y]); - int frame = getNewGraphicAnimationFrame(graphic, 17 - MovDelay[x][y]); + int frame = getGraphicAnimationFrame(graphic, 17 - MovDelay[x][y]); - DrawNewGraphic(SCREENX(x), SCREENY(y), graphic, frame); + DrawGraphic(SCREENX(x), SCREENY(y), graphic, frame); } -#endif if (!MovDelay[x][y]) { if (MovDir[x][y] == MV_LEFT) { if (IN_LEV_FIELD(x - 1, y) && IS_MAUER(Feld[x - 1][y])) - DrawNewLevelField(x - 1, y); + DrawLevelField(x - 1, y); } else if (MovDir[x][y] == MV_RIGHT) { if (IN_LEV_FIELD(x + 1, y) && IS_MAUER(Feld[x + 1][y])) - DrawNewLevelField(x + 1, y); + DrawLevelField(x + 1, y); } else if (MovDir[x][y] == MV_UP) { if (IN_LEV_FIELD(x, y - 1) && IS_MAUER(Feld[x][y - 1])) - DrawNewLevelField(x, y - 1); + DrawLevelField(x, y - 1); } else { if (IN_LEV_FIELD(x, y + 1) && IS_MAUER(Feld[x][y + 1])) - DrawNewLevelField(x, y + 1); + DrawLevelField(x, y + 1); } Feld[x][y] = Store[x][y]; Store[x][y] = 0; MovDir[x][y] = MV_NO_MOVING; - DrawNewLevelField(x, y); + DrawLevelField(x, y); } } } @@ -4513,12 +4304,8 @@ void MauerAbleger(int ax, int ay) Store[ax][ay-1] = element; MovDir[ax][ay-1] = MV_UP; if (IN_SCR_FIELD(SCREENX(ax), SCREENY(ay-1))) -#if 0 - DrawGraphic(SCREENX(ax), SCREENY(ay-1), GFX_MAUER_UP); -#else - DrawNewGraphic(SCREENX(ax), SCREENY(ay - 1), - IMG_WALL_GROWING_ACTIVE_UP, 0); -#endif + DrawGraphic(SCREENX(ax), SCREENY(ay - 1), + IMG_WALL_GROWING_ACTIVE_UP, 0); new_wall = TRUE; } if (unten_frei) @@ -4527,12 +4314,8 @@ void MauerAbleger(int ax, int ay) Store[ax][ay+1] = element; MovDir[ax][ay+1] = MV_DOWN; if (IN_SCR_FIELD(SCREENX(ax), SCREENY(ay+1))) -#if 0 - DrawGraphic(SCREENX(ax), SCREENY(ay+1), GFX_MAUER_DOWN); -#else - DrawNewGraphic(SCREENX(ax), SCREENY(ay + 1), - IMG_WALL_GROWING_ACTIVE_DOWN, 0); -#endif + DrawGraphic(SCREENX(ax), SCREENY(ay + 1), + IMG_WALL_GROWING_ACTIVE_DOWN, 0); new_wall = TRUE; } } @@ -4546,12 +4329,8 @@ void MauerAbleger(int ax, int ay) Store[ax-1][ay] = element; MovDir[ax-1][ay] = MV_LEFT; if (IN_SCR_FIELD(SCREENX(ax-1), SCREENY(ay))) -#if 0 - DrawGraphic(SCREENX(ax-1), SCREENY(ay), GFX_MAUER_LEFT); -#else - DrawNewGraphic(SCREENX(ax - 1), SCREENY(ay), - IMG_WALL_GROWING_ACTIVE_LEFT, 0); -#endif + DrawGraphic(SCREENX(ax - 1), SCREENY(ay), + IMG_WALL_GROWING_ACTIVE_LEFT, 0); new_wall = TRUE; } @@ -4561,18 +4340,14 @@ void MauerAbleger(int ax, int ay) Store[ax+1][ay] = element; MovDir[ax+1][ay] = MV_RIGHT; if (IN_SCR_FIELD(SCREENX(ax+1), SCREENY(ay))) -#if 0 - DrawGraphic(SCREENX(ax+1), SCREENY(ay), GFX_MAUER_RIGHT); -#else - DrawNewGraphic(SCREENX(ax + 1), SCREENY(ay), - IMG_WALL_GROWING_ACTIVE_RIGHT, 0); -#endif + DrawGraphic(SCREENX(ax + 1), SCREENY(ay), + IMG_WALL_GROWING_ACTIVE_RIGHT, 0); new_wall = TRUE; } } if (element == EL_WALL_GROWING && (links_frei || rechts_frei)) - DrawNewLevelField(ax, ay); + DrawLevelField(ax, ay); if (!IN_LEV_FIELD(ax, ay-1) || IS_MAUER(Feld[ax][ay-1])) oben_massiv = TRUE; @@ -4633,7 +4408,7 @@ void CheckForDragon(int x, int y) if (IN_LEV_FIELD(xx, yy) && Feld[xx][yy] == EL_FLAMES) { Feld[xx][yy] = EL_EMPTY; - DrawNewLevelField(xx, yy); + DrawLevelField(xx, yy); } else break; @@ -4655,11 +4430,7 @@ static void CheckBuggyBase(int x, int y) { MovDelay[x][y]--; if (MovDelay[x][y] < 5 && IN_SCR_FIELD(SCREENX(x), SCREENY(y))) -#if 0 - DrawGraphic(SCREENX(x), SCREENY(y), GFX_SP_BUG_WARNING); -#else - DrawNewGraphic(SCREENX(x), SCREENY(y), IMG_SP_BUGGY_BASE, 0); -#endif + DrawGraphic(SCREENX(x), SCREENY(y), IMG_SP_BUGGY_BASE, 0); if (MovDelay[x][y]) return; @@ -4686,16 +4457,12 @@ static void CheckBuggyBase(int x, int y) }; if (IN_SCR_FIELD(SCREENX(x), SCREENY(y))) -#if 0 - DrawGraphic(SCREENX(x),SCREENY(y), GFX_SP_BUG_ACTIVE + SimpleRND(4)); -#else { int graphic = IMG_SP_BUGGY_BASE_ACTIVE; - int frame = getNewGraphicAnimationFrame(graphic, SimpleRND(100)); + int frame = getGraphicAnimationFrame(graphic, SimpleRND(100)); - DrawNewGraphic(SCREENX(x), SCREENY(y), graphic, frame); + DrawGraphic(SCREENX(x), SCREENY(y), graphic, frame); } -#endif for (i=0; i<4; i++) { @@ -4712,7 +4479,7 @@ static void CheckBuggyBase(int x, int y) } Feld[x][y] = EL_SP_BUGGY_BASE; - DrawNewLevelField(x, y); + DrawLevelField(x, y); } } } @@ -4752,22 +4519,12 @@ static void CheckTrap(int x, int y) { if (!(MovDelay[x][y] % delay)) { - int phase = MovDelay[x][y]/delay; - - if (phase >= num_frames/2) - phase = num_frames - phase; - if (IN_SCR_FIELD(SCREENX(x), SCREENY(y))) { -#if 0 - DrawGraphic(SCREENX(x),SCREENY(y), GFX_TRAP_INACTIVE + phase - 1); -#else int graphic = IMG_TRAP_ACTIVE; - int frame = getNewGraphicAnimationFrame(graphic, - 31 - MovDelay[x][y]); + int frame = getGraphicAnimationFrame(graphic, 31 - MovDelay[x][y]); - DrawNewGraphic(SCREENX(x),SCREENY(y), graphic, frame); -#endif + DrawGraphic(SCREENX(x),SCREENY(y), graphic, frame); DrawCrumbledSand(SCREENX(x), SCREENY(y)); } } @@ -4776,7 +4533,7 @@ static void CheckTrap(int x, int y) } Feld[x][y] = EL_TRAP; - DrawNewLevelField(x, y); + DrawLevelField(x, y); } } } @@ -4788,17 +4545,9 @@ static void DrawBeltAnimation(int x, int y, int element) if (belt_dir != MV_NO_MOVING) { -#if 0 - int delay = 2; - int mode = ANIM_LOOP | (belt_dir == MV_LEFT ? 0 : ANIM_REVERSE); - int graphic = el2gfx(element) + (belt_dir == MV_LEFT ? 0 : 7); - - DrawGraphicAnimation(x, y, graphic, 8, delay, mode); -#else int graphic = el2img(element); - DrawNewGraphicAnimation(x, y, graphic); -#endif + DrawGraphicAnimation(x, y, graphic); if (!(FrameCounter % 2)) PlaySoundLevel(x, y, SND_CONVEYOR_BELT_ACTIVE); @@ -4895,6 +4644,7 @@ static void PlayerActions(struct PlayerInfo *player, byte player_action) */ #endif + /* if the player does not move for some time, reset animation to start */ if (++player->frame_reset_delay > player->move_delay_value) player->Frame = 0; } @@ -5153,18 +4903,10 @@ void GameActions() else if (element == EL_TRAP || element == EL_TRAP_ACTIVE) CheckTrap(x, y); else if (element == EL_SP_TERMINAL) -#if 0 - DrawGraphicAnimation(x, y, GFX2_SP_TERMINAL, 7, 12, ANIM_LOOP); -#else - DrawNewGraphicAnimation(x, y, IMG_SP_TERMINAL); -#endif + DrawGraphicAnimation(x, y, IMG_SP_TERMINAL); else if (element == EL_SP_TERMINAL_ACTIVE) { -#if 0 - DrawGraphicAnimation(x, y, GFX2_SP_TERMINAL_ACTIVE, 7, 4, ANIM_LOOP); -#else - DrawNewGraphicAnimation(x, y, IMG_SP_TERMINAL_ACTIVE); -#endif + DrawGraphicAnimation(x, y, IMG_SP_TERMINAL_ACTIVE); #if 0 if (!(FrameCounter % 4)) @@ -5182,18 +4924,10 @@ void GameActions() else if (element == EL_TIMEGATE_CLOSING) CloseTimegate(x, y); else if (element == EL_EXTRA_TIME) -#if 0 - DrawGraphicAnimation(x, y, GFX_EXTRA_TIME, 6, 4, ANIM_LOOP); -#else - DrawNewGraphicAnimation(x, y, IMG_EXTRA_TIME); -#endif + DrawGraphicAnimation(x, y, IMG_EXTRA_TIME); else if (element == EL_SHIELD_NORMAL) { -#if 0 - DrawGraphicAnimation(x, y, GFX_SHIELD_PASSIVE, 6, 4, ANIM_LOOP); -#else - DrawNewGraphicAnimation(x, y, IMG_SHIELD_NORMAL); -#endif + DrawGraphicAnimation(x, y, IMG_SHIELD_NORMAL); #if 0 if (!(FrameCounter % 4)) @@ -5202,11 +4936,7 @@ void GameActions() } else if (element == EL_SHIELD_DEADLY) { -#if 0 - DrawGraphicAnimation(x, y, GFX_SHIELD_ACTIVE, 6, 4, ANIM_LOOP); -#else - DrawNewGraphicAnimation(x, y, IMG_SHIELD_DEADLY); -#endif + DrawGraphicAnimation(x, y, IMG_SHIELD_DEADLY); #if 0 if (!(FrameCounter % 4)) @@ -5329,13 +5059,13 @@ void GameActions() element == EL_MAGIC_WALL_FULL) { Feld[x][y] = EL_MAGIC_WALL_DEAD; - DrawNewLevelField(x, y); + DrawLevelField(x, y); } else if (element == EL_BD_MAGIC_WALL_ACTIVE || element == EL_BD_MAGIC_WALL_FULL) { Feld[x][y] = EL_BD_MAGIC_WALL_DEAD; - DrawNewLevelField(x, y); + DrawLevelField(x, y); } } @@ -5489,14 +5219,14 @@ void ScrollLevel(int dx, int dy) { x = (dx == 1 ? BX1 : BX2); for (y=BY1; y<=BY2; y++) - DrawNewScreenField(x, y); + DrawScreenField(x, y); } if (dy) { y = (dy == 1 ? BY1 : BY2); for (x=BX1; x<=BX2; x++) - DrawNewScreenField(x, y); + DrawScreenField(x, y); } redraw_mask |= REDRAW_FIELD; @@ -5728,7 +5458,11 @@ boolean MoveFigure(struct PlayerInfo *player, int dx, int dy) if (!(moved & MF_MOVING) && !player->Pushing) player->Frame = 0; else +#if 0 player->Frame = (player->Frame + 1) % 4; +#else + player->Frame += 1 * 0; +#endif if (moved & MF_MOVING) { @@ -5737,7 +5471,7 @@ boolean MoveFigure(struct PlayerInfo *player, int dx, int dy) else if (old_jx == jx && old_jy != jy) player->MovDir = (old_jy < jy ? MV_DOWN : MV_UP); - DrawNewLevelField(jx, jy); /* for "DrawCrumbledSand()" */ + DrawLevelField(jx, jy); /* for "DrawCrumbledSand()" */ player->last_move_dir = player->MovDir; player->is_moving = TRUE; @@ -5773,6 +5507,8 @@ void ScrollFigure(struct PlayerInfo *player, int mode) { player->actual_frame_counter = FrameCounter; player->GfxPos = move_stepsize * (player->MovPos / move_stepsize); + if (player->Frame) + player->Frame += 1; if (Feld[last_jx][last_jy] == EL_EMPTY) Feld[last_jx][last_jy] = EL_PLAYER_IS_LEAVING; @@ -5785,6 +5521,7 @@ void ScrollFigure(struct PlayerInfo *player, int mode) player->MovPos += (player->MovPos > 0 ? -1 : 1) * move_stepsize; player->GfxPos = move_stepsize * (player->MovPos / move_stepsize); + player->Frame += 1; if (Feld[last_jx][last_jy] == EL_PLAYER_IS_LEAVING) Feld[last_jx][last_jy] = EL_EMPTY; @@ -6306,9 +6043,9 @@ int DigField(struct PlayerInfo *player, RemoveField(x, y); player->key[key_nr] = TRUE; RaiseScoreElement(element); - DrawNewMiniGraphicExt(drawto, DX_KEYS + key_nr * MINI_TILEX, DY_KEYS, + DrawMiniGraphicExt(drawto, DX_KEYS + key_nr * MINI_TILEX, DY_KEYS, GFX_SCHLUESSEL1 + key_nr); - DrawNewMiniGraphicExt(window, DX_KEYS + key_nr * MINI_TILEX, DY_KEYS, + DrawMiniGraphicExt(window, DX_KEYS + key_nr * MINI_TILEX, DY_KEYS, GFX_SCHLUESSEL1 + key_nr); PlaySoundLevel(x, y, SND_KEY_COLLECTING); break; @@ -6324,9 +6061,9 @@ int DigField(struct PlayerInfo *player, RemoveField(x, y); player->key[key_nr] = TRUE; RaiseScoreElement(element); - DrawNewMiniGraphicExt(drawto, DX_KEYS + key_nr * MINI_TILEX, DY_KEYS, + DrawMiniGraphicExt(drawto, DX_KEYS + key_nr * MINI_TILEX, DY_KEYS, GFX_SCHLUESSEL1 + key_nr); - DrawNewMiniGraphicExt(window, DX_KEYS + key_nr * MINI_TILEX, DY_KEYS, + DrawMiniGraphicExt(window, DX_KEYS + key_nr * MINI_TILEX, DY_KEYS, GFX_SCHLUESSEL1 + key_nr); PlaySoundLevel(x, y, SND_KEY_COLLECTING); break; @@ -6336,7 +6073,7 @@ int DigField(struct PlayerInfo *player, Feld[x][y] = EL_ROBOT_WHEEL_ACTIVE; ZX = x; ZY = y; - DrawNewLevelField(x, y); + DrawLevelField(x, y); PlaySoundLevel(x, y, SND_ROBOT_WHEEL_ACTIVATING); return MF_ACTION; break; @@ -6492,7 +6229,7 @@ int DigField(struct PlayerInfo *player, player->push_delay_value = (element == EL_SPRING ? 0 : 2 + RND(8)); - DrawNewLevelField(x + dx, y + dy); + DrawLevelField(x + dx, y + dy); PlaySoundLevelElementAction(x, y, element, SND_ACTION_PUSHING); break; @@ -6662,7 +6399,7 @@ int DigField(struct PlayerInfo *player, case EL_LAMP: Feld[x][y] = EL_LAMP_ACTIVE; local_player->lights_still_needed--; - DrawNewLevelField(x, y); + DrawLevelField(x, y); PlaySoundLevel(x, y, SND_LAMP_ACTIVATING); return MF_ACTION; break; @@ -6671,7 +6408,7 @@ int DigField(struct PlayerInfo *player, Feld[x][y] = EL_TIME_ORB_EMPTY; TimeLeft += 10; DrawText(DX_TIME, DY_TIME, int2str(TimeLeft, 3), FS_SMALL, FC_YELLOW); - DrawNewLevelField(x, y); + DrawLevelField(x, y); PlaySoundStereo(SND_TIME_ORB_FULL_COLLECTING, SOUND_MAX_RIGHT); return MF_ACTION; break; @@ -6756,8 +6493,8 @@ int DigField(struct PlayerInfo *player, player->push_delay_value = (element == EL_BALLOON ? 0 : 2); - DrawNewLevelField(x, y); - DrawNewLevelField(x + dx, y + dy); + DrawLevelField(x, y); + DrawLevelField(x + dx, y + dy); if (IS_SB_ELEMENT(element) && local_player->sokobanfields_still_needed == 0 && @@ -6815,7 +6552,7 @@ boolean SnapField(struct PlayerInfo *player, int dx, int dy) return FALSE; player->snapped = TRUE; - DrawNewLevelField(x, y); + DrawLevelField(x, y); BackToFront(); return TRUE; @@ -6847,18 +6584,10 @@ boolean PlaceBomb(struct PlayerInfo *player) FS_SMALL, FC_YELLOW); if (IN_SCR_FIELD(SCREENX(jx), SCREENY(jy))) { -#if 0 if (game.emulation == EMU_SUPAPLEX) - DrawGraphic(SCREENX(jx), SCREENY(jy), GFX_SP_DISK_RED); + DrawGraphic(SCREENX(jx), SCREENY(jy), IMG_SP_DISK_RED, 0); else - DrawGraphicThruMask(SCREENX(jx), SCREENY(jy), GFX_DYNAMIT); -#else - if (game.emulation == EMU_SUPAPLEX) - DrawNewGraphic(SCREENX(jx), SCREENY(jy), IMG_SP_DISK_RED, 0); - else - DrawNewGraphicThruMask(SCREENX(jx), SCREENY(jy), - IMG_DYNAMITE_ACTIVE, 0); -#endif + DrawGraphicThruMask(SCREENX(jx), SCREENY(jy), IMG_DYNAMITE_ACTIVE, 0); } PlaySoundLevel(jx, jy, SND_DYNAMITE_DROPPING); @@ -6870,12 +6599,7 @@ boolean PlaceBomb(struct PlayerInfo *player) MovDelay[jx][jy] = 96; player->dynabombs_left--; if (IN_SCR_FIELD(SCREENX(jx), SCREENY(jy))) -#if 0 - DrawGraphicThruMask(SCREENX(jx), SCREENY(jy), GFX_DYNABOMB); -#else - DrawNewGraphicThruMask(SCREENX(jx), SCREENY(jy), - el2img(Feld[jx][jy]), 0); -#endif + DrawGraphicThruMask(SCREENX(jx), SCREENY(jy), el2img(Feld[jx][jy]), 0); PlaySoundLevel(jx, jy, SND_DYNABOMB_DROPPING); } diff --git a/src/init.c b/src/init.c index bd79cc78..7d0c731b 100644 --- a/src/init.c +++ b/src/init.c @@ -1137,6 +1137,28 @@ static void InitGraphicInfo() if (parameter[GFX_ARG_MODE_REVERSE]) new_graphic_info[i].anim_mode |= ANIM_REVERSE; +#if 1 + /* set first frame of animation after determining animation mode */ + new_graphic_info[i].anim_start_frame = parameter[GFX_ARG_START_FRAME]; + if (new_graphic_info[i].anim_start_frame == -1) + new_graphic_info[i].anim_start_frame = 0; + else if (new_graphic_info[i].anim_mode & ANIM_REVERSE) + new_graphic_info[i].anim_start_frame = + new_graphic_info[i].anim_frames + - new_graphic_info[i].anim_start_frame - 1; +#else + /* set first frame of animation after determining animation mode */ + new_graphic_info[i].anim_start_frame = parameter[GFX_ARG_START_FRAME]; + if (parameter[GFX_ARG_START_FRAME] == -1) /* default: start with ... */ + { + if (parameter[GFX_ARG_MODE_REVERSE]) + new_graphic_info[i].anim_start_frame = + new_graphic_info[i].anim_frames - 1; /* ... last frame */ + else + new_graphic_info[i].anim_start_frame = 0; /* ... first frame */ + } +#endif + /* animation synchronized with global frame counter, not move position */ new_graphic_info[i].anim_global_sync = parameter[GFX_ARG_GLOBAL_SYNC]; } diff --git a/src/main.c b/src/main.c index 18547e32..9158955f 100644 --- a/src/main.c +++ b/src/main.c @@ -167,9 +167,7 @@ struct ConfigInfo image_config_suffix[] = { ".offset", "32" }, { ".vertical", "0" }, { ".frames", "1" }, -#if 0 { ".start_frame", "-1" }, -#endif { ".delay", "1" }, { ".mode_loop", "0" }, { ".mode_linear", "0" }, @@ -208,12 +206,13 @@ struct ConfigInfo image_config[] = { "bd_rock.moving_left.ypos", "2" }, { "bd_rock.moving_left.frames", "4" }, { "bd_rock.moving_left.delay", "2" }, + { "bd_rock.moving_left.mode_reverse", "1" }, { "bd_rock.moving_right", "RocksMore.pcx" }, { "bd_rock.moving_right.xpos", "4" }, { "bd_rock.moving_right.ypos", "2" }, { "bd_rock.moving_right.frames", "4" }, + { "bd_rock.moving_right.start_frame", "1" }, { "bd_rock.moving_right.delay", "2" }, - { "bd_rock.moving_right.mode_reverse", "1" }, { "bd_diamond", "RocksElements.pcx" }, { "bd_diamond.xpos", "0" }, @@ -358,12 +357,13 @@ struct ConfigInfo image_config[] = { "sp_zonk.moving_left.ypos", "6" }, { "sp_zonk.moving_left.frames", "4" }, { "sp_zonk.moving_left.delay", "2" }, + { "sp_zonk.moving_left.mode_reverse", "1" }, { "sp_zonk.moving_right", "RocksSP.pcx" }, { "sp_zonk.moving_right.xpos", "0" }, { "sp_zonk.moving_right.ypos", "6" }, { "sp_zonk.moving_right.frames", "4" }, + { "sp_zonk.moving_right.start_frame", "1" }, { "sp_zonk.moving_right.delay", "2" }, - { "sp_zonk.moving_right.mode_reverse", "1" }, { "sp_base", "RocksSP.pcx" }, { "sp_base.xpos", "2" }, @@ -729,12 +729,13 @@ struct ConfigInfo image_config[] = { "rock.moving_left.ypos", "0" }, { "rock.moving_left.frames", "4" }, { "rock.moving_left.delay", "2" }, + { "rock.moving_left.mode_reverse", "1" }, { "rock.moving_right", "RocksElements.pcx" }, { "rock.moving_right.xpos", "12" }, { "rock.moving_right.ypos", "0" }, { "rock.moving_right.frames", "4" }, + { "rock.moving_right.start_frame", "1" }, { "rock.moving_right.delay", "2" }, - { "rock.moving_right.mode_reverse", "1" }, { "emerald", "RocksElements.pcx" }, { "emerald.xpos", "8" }, @@ -2178,14 +2179,17 @@ struct ConfigInfo image_config[] = { "player1_down.moving.xpos", "0" }, { "player1_down.moving.ypos", "0" }, { "player1_down.moving.frames", "4" }, + { "player1_down.moving.start_frame", "1" }, + { "player1_down.moving.delay", "4" }, { "player1_down.digging", "RocksHeroes.pcx" }, { "player1_down.digging.xpos", "0" }, { "player1_down.digging.ypos", "0" }, { "player1_down.digging.frames", "4" }, { "player1_down.pushing", "RocksHeroes.pcx" }, { "player1_down.pushing.xpos", "0" }, - { "player1_down.pushing.ypos", "2" }, + { "player1_down.pushing.ypos", "0" }, { "player1_down.pushing.frames", "4" }, + { "player1_down.pushing.delay", "2" }, { "player1_down.snapping", "RocksHeroes.pcx" }, { "player1_down.snapping.xpos", "0" }, { "player1_down.snapping.ypos", "0" }, @@ -2198,6 +2202,8 @@ struct ConfigInfo image_config[] = { "player1_up.moving.xpos", "4" }, { "player1_up.moving.ypos", "0" }, { "player1_up.moving.frames", "4" }, + { "player1_up.moving.start_frame", "1" }, + { "player1_up.moving.delay", "4" }, { "player1_up.digging", "RocksHeroes.pcx" }, { "player1_up.digging.xpos", "4" }, { "player1_up.digging.ypos", "0" }, @@ -2206,6 +2212,7 @@ struct ConfigInfo image_config[] = { "player1_up.pushing.xpos", "4" }, { "player1_up.pushing.ypos", "0" }, { "player1_up.pushing.frames", "4" }, + { "player1_up.pushing.delay", "2" }, { "player1_up.snapping", "RocksHeroes.pcx" }, { "player1_up.snapping.xpos", "4" }, { "player1_up.snapping.ypos", "0" }, @@ -2218,6 +2225,8 @@ struct ConfigInfo image_config[] = { "player1_left.moving.xpos", "0" }, { "player1_left.moving.ypos", "1" }, { "player1_left.moving.frames", "4" }, + { "player1_left.moving.start_frame", "1" }, + { "player1_left.moving.delay", "4" }, { "player1_left.digging", "RocksHeroes.pcx" }, { "player1_left.digging.xpos", "0" }, { "player1_left.digging.ypos", "1" }, @@ -2226,6 +2235,7 @@ struct ConfigInfo image_config[] = { "player1_left.pushing.xpos", "4" }, { "player1_left.pushing.ypos", "2" }, { "player1_left.pushing.frames", "4" }, + { "player1_left.pushing.delay", "2" }, { "player1_left.snapping", "RocksHeroes.pcx" }, { "player1_left.snapping.xpos", "0" }, { "player1_left.snapping.ypos", "1" }, @@ -2238,6 +2248,8 @@ struct ConfigInfo image_config[] = { "player1_right.moving.xpos", "4" }, { "player1_right.moving.ypos", "1" }, { "player1_right.moving.frames", "4" }, + { "player1_right.moving.delay", "4" }, + { "player1_right.moving.start_frame", "1" }, { "player1_right.digging", "RocksHeroes.pcx" }, { "player1_right.digging.xpos", "4" }, { "player1_right.digging.ypos", "1" }, @@ -2246,6 +2258,7 @@ struct ConfigInfo image_config[] = { "player1_right.pushing.xpos", "0" }, { "player1_right.pushing.ypos", "2" }, { "player1_right.pushing.frames", "4" }, + { "player1_right.pushing.delay", "2" }, { "player1_right.snapping", "RocksHeroes.pcx" }, { "player1_right.snapping.xpos", "4" }, { "player1_right.snapping.ypos", "1" }, @@ -2269,7 +2282,7 @@ struct ConfigInfo image_config[] = { "player2_down.digging.frames", "4" }, { "player2_down.pushing", "RocksHeroes.pcx" }, { "player2_down.pushing.xpos", "0" }, - { "player2_down.pushing.ypos", "5" }, + { "player2_down.pushing.ypos", "3" }, { "player2_down.pushing.frames", "4" }, { "player2_down.snapping", "RocksHeroes.pcx" }, { "player2_down.snapping.xpos", "0" }, @@ -2354,7 +2367,7 @@ struct ConfigInfo image_config[] = { "player3_down.digging.frames", "4" }, { "player3_down.pushing", "RocksHeroes.pcx" }, { "player3_down.pushing.xpos", "0" }, - { "player3_down.pushing.ypos", "8" }, + { "player3_down.pushing.ypos", "6" }, { "player3_down.pushing.frames", "4" }, { "player3_down.snapping", "RocksHeroes.pcx" }, { "player3_down.snapping.xpos", "0" }, @@ -2439,7 +2452,7 @@ struct ConfigInfo image_config[] = { "player4_down.digging.frames", "4" }, { "player4_down.pushing", "RocksHeroes.pcx" }, { "player4_down.pushing.xpos", "0" }, - { "player4_down.pushing.ypos", "11" }, + { "player4_down.pushing.ypos", "9" }, { "player4_down.pushing.frames", "4" }, { "player4_down.snapping", "RocksHeroes.pcx" }, { "player4_down.snapping.xpos", "0" }, diff --git a/src/main.h b/src/main.h index a0f3ad80..af0b57cf 100644 --- a/src/main.h +++ b/src/main.h @@ -1368,13 +1368,14 @@ #define GFX_ARG_OFFSET 2 #define GFX_ARG_VERTICAL 3 #define GFX_ARG_FRAMES 4 -#define GFX_ARG_DELAY 5 -#define GFX_ARG_MODE_LOOP 6 -#define GFX_ARG_MODE_LINEAR 7 -#define GFX_ARG_MODE_PINGPONG 8 -#define GFX_ARG_MODE_PINGPONG2 9 -#define GFX_ARG_MODE_REVERSE 10 -#define GFX_ARG_GLOBAL_SYNC 11 +#define GFX_ARG_START_FRAME 5 +#define GFX_ARG_DELAY 6 +#define GFX_ARG_MODE_LOOP 7 +#define GFX_ARG_MODE_LINEAR 8 +#define GFX_ARG_MODE_PINGPONG 9 +#define GFX_ARG_MODE_PINGPONG2 10 +#define GFX_ARG_MODE_REVERSE 11 +#define GFX_ARG_GLOBAL_SYNC 12 /* values for sound configuration suffixes */ /* (currently none) */ @@ -1610,6 +1611,7 @@ struct NewGraphicInfo int src_x, src_y; /* derived from (tile sized) .xpos/.ypos */ int offset_x, offset_y; /* x/y offset to next animation frame */ int anim_frames; + int anim_start_frame; int anim_delay; /* important: delay of 1 means "no delay"! */ int anim_mode; boolean anim_global_sync; diff --git a/src/screens.c b/src/screens.c index 386094d4..61e30852 100644 --- a/src/screens.c +++ b/src/screens.c @@ -84,7 +84,7 @@ static void drawCursorExt(int pos, int color, int graphic) graphic == IMG_ARROW_BLUE_RIGHT ? IMG_ARROW_RED_RIGHT : IMG_BALL_RED); - DrawNewGraphic(0, MENU_SCREEN_START_YPOS + pos, graphic, 0); + DrawGraphic(0, MENU_SCREEN_START_YPOS + pos, graphic, 0); } static void initCursor(int pos, int graphic) @@ -208,8 +208,8 @@ void DrawMainMenu() for(i=0; i<8; i++) initCursor(i, (i == 1 || i == 6 ? IMG_ARROW_BLUE_RIGHT : IMG_BALL_BLUE)); - DrawNewGraphic(10, 3, IMG_ARROW_BLUE_LEFT, 0); - DrawNewGraphic(14, 3, IMG_ARROW_BLUE_RIGHT, 0); + DrawGraphic(10, 3, IMG_ARROW_BLUE_LEFT, 0); + DrawGraphic(14, 3, IMG_ARROW_BLUE_RIGHT, 0); DrawText(SX + 56, SY + 326, "A Game by Artsoft Entertainment", FS_SMALL, FC_RED); @@ -892,7 +892,7 @@ void HandleTypeName(int newxpos, Key key) { xpos = newxpos; DrawText(SX + 6*32, SY + ypos*32, setup.player_name, FS_BIG, FC_YELLOW); - DrawNewGraphic(xpos + 6, ypos, IMG_BALL_RED, 0); + DrawGraphic(xpos + 6, ypos, IMG_BALL_RED, 0); return; } @@ -914,19 +914,19 @@ void HandleTypeName(int newxpos, Key key) setup.player_name, FS_BIG, FC_YELLOW); DrawTextExt(window, SX + 6*32, SY + ypos*32, setup.player_name, FS_BIG, FC_YELLOW); - DrawNewGraphic(xpos + 6, ypos, IMG_BALL_RED, 0); + DrawGraphic(xpos + 6, ypos, IMG_BALL_RED, 0); } else if ((key == KSYM_Delete || key == KSYM_BackSpace) && xpos > 0) { xpos--; setup.player_name[xpos] = 0; - DrawNewGraphic(xpos + 6, ypos, IMG_BALL_RED, 0); - DrawNewGraphic(xpos + 7, ypos, IMG_EMPTY, 0); + DrawGraphic(xpos + 6, ypos, IMG_BALL_RED, 0); + DrawGraphic(xpos + 7, ypos, IMG_EMPTY, 0); } else if (key == KSYM_Return && xpos > 0) { DrawText(SX + 6*32, SY + ypos*32, setup.player_name, FS_BIG, FC_RED); - DrawNewGraphic(xpos + 6, ypos, IMG_EMPTY, 0); + DrawGraphic(xpos + 6, ypos, IMG_EMPTY, 0); SaveSetup(); game_status = MAINMENU; @@ -1009,10 +1009,10 @@ static void drawChooseTreeList(int first_entry, int num_page_entries, } if (first_entry > 0) - DrawNewGraphic(0, 1, IMG_ARROW_BLUE_UP, 0); + DrawGraphic(0, 1, IMG_ARROW_BLUE_UP, 0); if (first_entry + num_page_entries < num_entries) - DrawNewGraphic(0, MAX_MENU_ENTRIES_ON_SCREEN + 1, IMG_ARROW_BLUE_DOWN, 0); + DrawGraphic(0, MAX_MENU_ENTRIES_ON_SCREEN + 1, IMG_ARROW_BLUE_DOWN, 0); } static void drawChooseTreeInfo(int entry_pos, TreeInfo *ti) @@ -1825,8 +1825,8 @@ void DrawSetupScreen_Input() initCursor(2, IMG_ARROW_BLUE_RIGHT); initCursor(13, IMG_ARROW_BLUE_LEFT); - DrawNewGraphic(10, MENU_SCREEN_START_YPOS, IMG_ARROW_BLUE_LEFT, 0); - DrawNewGraphic(12, MENU_SCREEN_START_YPOS, IMG_ARROW_BLUE_RIGHT, 0); + DrawGraphic(10, MENU_SCREEN_START_YPOS, IMG_ARROW_BLUE_LEFT, 0); + DrawGraphic(12, MENU_SCREEN_START_YPOS, IMG_ARROW_BLUE_RIGHT, 0); DrawText(SX+32, SY+2*32, "Player:", FS_BIG, FC_GREEN); DrawText(SX+32, SY+3*32, "Device:", FS_BIG, FC_GREEN); @@ -1892,7 +1892,7 @@ static void drawPlayerSetupInputInfo(int player_nr) custom_key = setup.input[player_nr].key; DrawText(SX+11*32, SY+2*32, int2str(player_nr + 1, 1), FS_BIG, FC_RED); - DrawNewGraphic(8, 2, PLAYER_NR_GFX(IMG_PLAYER1, player_nr), 0); + DrawGraphic(8, 2, PLAYER_NR_GFX(IMG_PLAYER1, player_nr), 0); if (setup.input[player_nr].use_joystick) { @@ -1910,10 +1910,10 @@ static void drawPlayerSetupInputInfo(int player_nr) } DrawText(SX+32, SY+5*32, "Actual Settings:", FS_BIG, FC_GREEN); - DrawNewGraphic(1, 6, IMG_ARROW_BLUE_LEFT, 0); - DrawNewGraphic(1, 7, IMG_ARROW_BLUE_RIGHT, 0); - DrawNewGraphic(1, 8, IMG_ARROW_BLUE_UP, 0); - DrawNewGraphic(1, 9, IMG_ARROW_BLUE_DOWN, 0); + DrawGraphic(1, 6, IMG_ARROW_BLUE_LEFT, 0); + DrawGraphic(1, 7, IMG_ARROW_BLUE_RIGHT, 0); + DrawGraphic(1, 8, IMG_ARROW_BLUE_UP, 0); + DrawGraphic(1, 9, IMG_ARROW_BLUE_DOWN, 0); DrawText(SX+2*32, SY+6*32, ":", FS_BIG, FC_BLUE); DrawText(SX+2*32, SY+7*32, ":", FS_BIG, FC_BLUE); DrawText(SX+2*32, SY+8*32, ":", FS_BIG, FC_BLUE); @@ -2215,7 +2215,7 @@ static boolean CalibrateJoystickMain(int player_nr) for(x=0; x<3; x++) { check[x][y] = FALSE; - DrawNewGraphic(xpos + x - 1, ypos + y - 1, IMG_BALL_BLUE, 0); + DrawGraphic(xpos + x - 1, ypos + y - 1, IMG_BALL_BLUE, 0); } } @@ -2238,7 +2238,7 @@ static boolean CalibrateJoystickMain(int player_nr) new_joystick_xmiddle = joy_x; new_joystick_ymiddle = joy_y; - DrawNewGraphic(xpos + last_x, ypos + last_y, IMG_BALL_RED, 0); + DrawGraphic(xpos + last_x, ypos + last_y, IMG_BALL_RED, 0); BackToFront(); while(Joystick(player_nr) & JOY_BUTTON); /* wait for released button */ @@ -2308,8 +2308,8 @@ static boolean CalibrateJoystickMain(int player_nr) if (x != last_x || y != last_y) { - DrawNewGraphic(xpos + last_x, ypos + last_y, IMG_BALL_YELLOW, 0); - DrawNewGraphic(xpos + x, ypos + y, IMG_BALL_RED, 0); + DrawGraphic(xpos + last_x, ypos + last_y, IMG_BALL_YELLOW, 0); + DrawGraphic(xpos + x, ypos + y, IMG_BALL_RED, 0); last_x = x; last_y = y; diff --git a/src/tools.c b/src/tools.c index 78ade237..b3dca8a0 100644 --- a/src/tools.c +++ b/src/tools.c @@ -93,7 +93,7 @@ void RedrawPlayfield(boolean force_redraw, int x, int y, int width, int height) for(xx=BX1; xx<=BX2; xx++) for(yy=BY1; yy<=BY2; yy++) if (xx >= x1 && xx <= x2 && yy >= y1 && yy <= y2) - DrawNewScreenField(xx, yy); + DrawScreenField(xx, yy); DrawAllPlayers(); if (setup.direct_draw) @@ -466,29 +466,29 @@ void DrawPlayer(struct PlayerInfo *player) { if (Store[last_jx][last_jy] && IS_DRAWABLE(last_element)) { - DrawNewLevelElement(last_jx, last_jy, Store[last_jx][last_jy]); + DrawLevelElement(last_jx, last_jy, Store[last_jx][last_jy]); if (last_element == EL_DYNAMITE_ACTIVE) DrawDynamite(last_jx, last_jy); else - DrawNewLevelFieldThruMask(last_jx, last_jy); + DrawLevelFieldThruMask(last_jx, last_jy); } else if (last_element == EL_DYNAMITE_ACTIVE) DrawDynamite(last_jx, last_jy); else - DrawNewLevelField(last_jx, last_jy); + DrawLevelField(last_jx, last_jy); if (player->Pushing && IN_SCR_FIELD(SCREENX(next_jx), SCREENY(next_jy))) { if (player->GfxPos) { if (Feld[next_jx][next_jy] == EL_SOKOBAN_FIELD_FULL) - DrawNewLevelElement(next_jx, next_jy, EL_SOKOBAN_FIELD_EMPTY); + DrawLevelElement(next_jx, next_jy, EL_SOKOBAN_FIELD_EMPTY); else - DrawNewLevelElement(next_jx, next_jy, EL_EMPTY); + DrawLevelElement(next_jx, next_jy, EL_EMPTY); } else - DrawNewLevelField(next_jx, next_jy); + DrawLevelField(next_jx, next_jy); } } @@ -501,11 +501,11 @@ void DrawPlayer(struct PlayerInfo *player) /* draw things behind the player, if needed */ if (Store[jx][jy]) - DrawNewLevelElement(jx, jy, Store[jx][jy]); + DrawLevelElement(jx, jy, Store[jx][jy]); else if (!IS_ACTIVE_BOMB(element)) - DrawNewLevelField(jx, jy); + DrawLevelField(jx, jy); else - DrawNewLevelElement(jx, jy, EL_EMPTY); + DrawLevelElement(jx, jy, EL_EMPTY); /* draw player himself */ @@ -556,7 +556,7 @@ void DrawPlayer(struct PlayerInfo *player) else graphic = IMG_SP_MURPHY_LEFT_MOVING; - frame = getNewGraphicAnimationFrame(graphic, -1); + frame = getGraphicAnimationFrame(graphic, -1); } if (player->MovDir == MV_LEFT || player->MovDir == MV_RIGHT) @@ -566,20 +566,28 @@ void DrawPlayer(struct PlayerInfo *player) { if (player->MovDir == MV_LEFT) graphic = (player->Pushing ? IMG_PLAYER1_LEFT_PUSHING : - IMG_PLAYER1_LEFT_MOVING); + player->is_moving ? IMG_PLAYER1_LEFT_MOVING : + IMG_PLAYER1_LEFT); else if (player->MovDir == MV_RIGHT) graphic = (player->Pushing ? IMG_PLAYER1_RIGHT_PUSHING : - IMG_PLAYER1_RIGHT_MOVING); + player->is_moving ? IMG_PLAYER1_RIGHT_MOVING : + IMG_PLAYER1_RIGHT); else if (player->MovDir == MV_UP) graphic = (player->Pushing ? IMG_PLAYER1_UP_PUSHING : - IMG_PLAYER1_UP_MOVING); + player->is_moving ? IMG_PLAYER1_UP_MOVING : + IMG_PLAYER1_UP); else /* MV_DOWN || MV_NO_MOVING */ graphic = (player->Pushing ? IMG_PLAYER1_DOWN_PUSHING : - IMG_PLAYER1_DOWN_MOVING); + player->is_moving ? IMG_PLAYER1_DOWN_MOVING : + IMG_PLAYER1_DOWN); graphic = PLAYER_NR_GFX(graphic, player->index_nr); +#if 0 frame = player->Frame; +#else + frame = getGraphicAnimationFrame(graphic, player->Frame); +#endif } if (player->GfxPos) @@ -593,41 +601,62 @@ void DrawPlayer(struct PlayerInfo *player) if (!setup.soft_scrolling && ScreenMovPos) sxx = syy = 0; - DrawNewGraphicShiftedThruMask(sx, sy, sxx, syy, graphic, frame, NO_CUTTING); +#if 0 + if (player->Frame) + printf("-> %d\n", player->Frame); +#endif + + DrawGraphicShiftedThruMask(sx, sy, sxx, syy, graphic, frame, NO_CUTTING); if (SHIELD_ON(player)) { int graphic = (player->shield_deadly_time_left ? IMG_SHIELD_DEADLY_ACTIVE : IMG_SHIELD_NORMAL_ACTIVE); - int frame = getNewGraphicAnimationFrame(graphic, -1); + int frame = getGraphicAnimationFrame(graphic, -1); - DrawNewGraphicShiftedThruMask(sx, sy, sxx, syy, graphic, frame, NO_CUTTING); + DrawGraphicShiftedThruMask(sx, sy, sxx, syy, graphic, frame, NO_CUTTING); } +#if 0 if (player->Pushing && player->GfxPos) +#else + if (player->Pushing && player_is_moving) +#endif { int px = SCREENX(next_jx), py = SCREENY(next_jy); if (element == EL_SOKOBAN_FIELD_EMPTY || Feld[next_jx][next_jy] == EL_SOKOBAN_FIELD_FULL) - DrawNewGraphicShiftedThruMask(px, py, sxx, syy, GFX_SOKOBAN_OBJEKT, 0, + DrawGraphicShiftedThruMask(px, py, sxx, syy, GFX_SOKOBAN_OBJEKT, 0, NO_CUTTING); else { int element = Feld[next_jx][next_jy]; int graphic = el2img(element); +#if 1 int frame = 0; +#endif if ((element == EL_ROCK || - element == EL_SP_ZONK || - element == EL_BD_ROCK) && sxx) + element == EL_BD_ROCK || + element == EL_SP_ZONK) && sxx) { - graphic = el_dir_act2img(element, player->MovDir, GFX_ACTION_PUSHING); - frame = getNewGraphicAnimationFrame(graphic, player->GfxPos); + graphic = el_dir_act2img(element, player->MovDir, GFX_ACTION_MOVING); +#if 1 + frame = getGraphicAnimationFrame(graphic, player->GfxPos); + + frame = getGraphicAnimationFrame(graphic, player->Frame); +#endif + +#if 0 + printf("-> %d [%d]\n", player->Frame, player->GfxPos); +#endif +#if 0 /* !!! FIX !!! */ if (player->MovDir == MV_LEFT) frame = 3 - frame; +#endif #if 0 frame = (player->GfxPos / (TILEX / 4)); @@ -637,8 +666,8 @@ void DrawPlayer(struct PlayerInfo *player) #endif } - DrawNewGraphicShifted(px, py, sxx, syy, graphic, frame, - NO_CUTTING, NO_MASKING); + DrawGraphicShifted(px, py, sxx, syy, graphic, frame, + NO_CUTTING, NO_MASKING); } } @@ -660,13 +689,13 @@ void DrawPlayer(struct PlayerInfo *player) frame = 7 - frame; } #else - frame = getNewGraphicAnimationFrame(graphic, 96 - MovDelay[jx][jy]); + frame = getGraphicAnimationFrame(graphic, 96 - MovDelay[jx][jy]); #endif if (game.emulation == EMU_SUPAPLEX) - DrawNewGraphic(sx, sy, GFX_SP_DISK_RED, 0); + DrawGraphic(sx, sy, GFX_SP_DISK_RED, 0); else - DrawNewGraphicThruMask(sx, sy, graphic, frame); + DrawGraphicThruMask(sx, sy, graphic, frame); } if (player_is_moving && last_element == EL_EXPLOSION) @@ -675,17 +704,17 @@ void DrawPlayer(struct PlayerInfo *player) int delay = 2; if (frame > 2) - DrawNewGraphicThruMask(SCREENX(last_jx), SCREENY(last_jy), - GFX_EXPLOSION, ((frame - 1) / delay - 1)); + DrawGraphicThruMask(SCREENX(last_jx), SCREENY(last_jy), GFX_EXPLOSION, + ((frame - 1) / delay - 1)); } /* draw elements that stay over the player */ /* handle the field the player is leaving ... */ if (player_is_moving && IS_OVER_PLAYER(last_element)) - DrawNewLevelField(last_jx, last_jy); + DrawLevelField(last_jx, last_jy); /* ... and the field the player is entering */ if (IS_OVER_PLAYER(element)) - DrawNewLevelField(jx, jy); + DrawLevelField(jx, jy); if (setup.direct_draw) { @@ -722,7 +751,7 @@ static int getGraphicAnimationPhase(int frames, int delay, int mode) return phase; } -int getNewGraphicAnimationFrame(int graphic, int sync_frame) +int getGraphicAnimationFrame(int graphic, int sync_frame) { int num_frames = new_graphic_info[graphic].anim_frames; int delay = new_graphic_info[graphic].anim_delay; @@ -733,6 +762,8 @@ int getNewGraphicAnimationFrame(int graphic, int sync_frame) if (new_graphic_info[graphic].anim_global_sync || sync_frame < 0) sync_frame = FrameCounter; + sync_frame += new_graphic_info[graphic].anim_start_frame * delay; + if (mode & ANIM_LOOP) /* normal, looping animation */ { frame = (sync_frame % (delay * num_frames)) / delay; @@ -765,7 +796,7 @@ int getNewGraphicAnimationFrame(int graphic, int sync_frame) return frame; } -void DrawNewGraphicAnimationExt(int x, int y, int graphic, int mask_mode) +void DrawGraphicAnimationExt(int x, int y, int graphic, int mask_mode) { #if 0 int delay = new_graphic_info[graphic].anim_delay; @@ -775,12 +806,12 @@ void DrawNewGraphicAnimationExt(int x, int y, int graphic, int mask_mode) if (IN_SCR_FIELD(SCREENX(x), SCREENY(y))) #endif { - int frame = getNewGraphicAnimationFrame(graphic, -1); + int frame = getGraphicAnimationFrame(graphic, -1); if (mask_mode == USE_MASKING) - DrawNewGraphicThruMask(SCREENX(x), SCREENY(y), graphic, frame); + DrawGraphicThruMask(SCREENX(x), SCREENY(y), graphic, frame); else - DrawNewGraphic(SCREENX(x), SCREENY(y), graphic, frame); + DrawGraphic(SCREENX(x), SCREENY(y), graphic, frame); } } @@ -792,9 +823,9 @@ void DrawOldGraphicAnimation(int x, int y, int graphic, } #endif -void DrawNewGraphicAnimation(int x, int y, int graphic) +void DrawGraphicAnimation(int x, int y, int graphic) { - DrawNewGraphicAnimationExt(x, y, graphic, NO_MASKING); + DrawGraphicAnimationExt(x, y, graphic, NO_MASKING); } #if 1 @@ -858,19 +889,18 @@ void getOldGraphicSource(int graphic, Bitmap **bitmap, int *x, int *y) } #endif -void DrawNewGraphic(int x, int y, int graphic, int frame) +void DrawGraphic(int x, int y, int graphic, int frame) { #if DEBUG if (!IN_SCR_FIELD(x, y)) { - printf("DrawNewGraphic(): x = %d, y = %d, graphic = %d\n", x, y, graphic); - printf("DrawNewGraphic(): This should never happen!\n"); + printf("DrawGraphic(): x = %d, y = %d, graphic = %d\n", x, y, graphic); + printf("DrawGraphic(): This should never happen!\n"); return; } #endif - DrawNewGraphicExt(drawto_field, FX + x * TILEX, FY + y * TILEY, - graphic, frame); + DrawGraphicExt(drawto_field, FX + x * TILEX, FY + y * TILEY, graphic, frame); MarkTileDirty(x, y); } @@ -883,8 +913,8 @@ void DrawOldGraphicExt(DrawBuffer *dst_bitmap, int x, int y, int graphic) BlitBitmap(src_bitmap, dst_bitmap, src_x, src_y, TILEX, TILEY, x, y); } -void DrawNewGraphicExt(DrawBuffer *dst_bitmap, int x, int y, int graphic, - int frame) +void DrawGraphicExt(DrawBuffer *dst_bitmap, int x, int y, int graphic, + int frame) { Bitmap *src_bitmap = new_graphic_info[graphic].bitmap; int src_x = new_graphic_info[graphic].src_x; @@ -898,7 +928,7 @@ void DrawNewGraphicExt(DrawBuffer *dst_bitmap, int x, int y, int graphic, BlitBitmap(src_bitmap, dst_bitmap, src_x, src_y, TILEX, TILEY, x, y); } -void DrawNewGraphicThruMask(int x, int y, int graphic, int frame) +void DrawGraphicThruMask(int x, int y, int graphic, int frame) { #if DEBUG if (!IN_SCR_FIELD(x, y)) @@ -909,13 +939,13 @@ void DrawNewGraphicThruMask(int x, int y, int graphic, int frame) } #endif - DrawNewGraphicThruMaskExt(drawto_field, FX + x * TILEX, FY + y *TILEY, - graphic, frame); + DrawGraphicThruMaskExt(drawto_field, FX + x * TILEX, FY + y *TILEY, graphic, + frame); MarkTileDirty(x, y); } -void DrawNewGraphicThruMaskExt(DrawBuffer *d, int dest_x, int dest_y, - int graphic, int frame) +void DrawGraphicThruMaskExt(DrawBuffer *d, int dest_x, int dest_y, int graphic, + int frame) { Bitmap *src_bitmap = new_graphic_info[graphic].bitmap; GC drawing_gc = src_bitmap->stored_clip_gc; @@ -931,14 +961,13 @@ void DrawNewGraphicThruMaskExt(DrawBuffer *d, int dest_x, int dest_y, BlitBitmapMasked(src_bitmap, d, src_x, src_y, TILEX, TILEY, dest_x, dest_y); } -void DrawNewMiniGraphic(int x, int y, int graphic) +void DrawMiniGraphic(int x, int y, int graphic) { - DrawNewMiniGraphicExt(drawto, - SX + x * MINI_TILEX, SY + y * MINI_TILEY, graphic); + DrawMiniGraphicExt(drawto, SX + x * MINI_TILEX,SY + y * MINI_TILEY, graphic); MarkTileDirty(x / 2, y / 2); } -void getNewMiniGraphicSource(int graphic, Bitmap **bitmap, int *x, int *y) +void getMiniGraphicSource(int graphic, Bitmap **bitmap, int *x, int *y) { Bitmap *src_bitmap = new_graphic_info[graphic].bitmap; int mini_startx = 0; @@ -951,16 +980,16 @@ void getNewMiniGraphicSource(int graphic, Bitmap **bitmap, int *x, int *y) *y = src_y; } -void DrawNewMiniGraphicExt(DrawBuffer *d, int x, int y, int graphic) +void DrawMiniGraphicExt(DrawBuffer *d, int x, int y, int graphic) { Bitmap *src_bitmap; int src_x, src_y; - getNewMiniGraphicSource(graphic, &src_bitmap, &src_x, &src_y); + getMiniGraphicSource(graphic, &src_bitmap, &src_x, &src_y); BlitBitmap(src_bitmap, d, src_x, src_y, MINI_TILEX, MINI_TILEY, x, y); } -void DrawNewGraphicShifted(int x,int y, int dx,int dy, int graphic, int frame, +void DrawGraphicShifted(int x,int y, int dx,int dy, int graphic, int frame, int cut_mode, int mask_mode) { Bitmap *src_bitmap; @@ -976,7 +1005,7 @@ void DrawNewGraphicShifted(int x,int y, int dx,int dy, int graphic, int frame, if (graphic < 0) { - DrawNewGraphic(x, y, graphic, frame); + DrawGraphic(x, y, graphic, frame); return; } @@ -1083,10 +1112,10 @@ void DrawNewGraphicShifted(int x,int y, int dx,int dy, int graphic, int frame, MarkTileDirty(x,y); } -void DrawNewGraphicShiftedThruMask(int x,int y, int dx,int dy, int graphic, - int frame, int cut_mode) +void DrawGraphicShiftedThruMask(int x,int y, int dx,int dy, int graphic, + int frame, int cut_mode) { - DrawNewGraphicShifted(x,y, dx,dy, graphic, frame, cut_mode, USE_MASKING); + DrawGraphicShifted(x,y, dx,dy, graphic, frame, cut_mode, USE_MASKING); } #if 0 @@ -1267,15 +1296,15 @@ inline static int getGfxAction(int x, int y) return gfx_action; } -void DrawNewScreenElementExt(int x, int y, int dx, int dy, int element, - int cut_mode, int mask_mode) +void DrawScreenElementExt(int x, int y, int dx, int dy, int element, + int cut_mode, int mask_mode) { int ux = LEVELX(x), uy = LEVELY(y); int move_dir = MovDir[ux][uy]; int move_pos = getFramePosition(ux, uy); int gfx_action = getGfxAction(ux, uy); int graphic = el_dir_act2img(element, move_dir, gfx_action); - int frame = getNewGraphicAnimationFrame(graphic, move_pos); + int frame = getGraphicAnimationFrame(graphic, move_pos); if (element == EL_WALL_GROWING) { @@ -1337,53 +1366,53 @@ void DrawNewScreenElementExt(int x, int y, int dx, int dy, int element, } if (dx || dy) - DrawNewGraphicShifted(x, y, dx, dy, graphic, frame, cut_mode, mask_mode); + DrawGraphicShifted(x, y, dx, dy, graphic, frame, cut_mode, mask_mode); else if (mask_mode == USE_MASKING) - DrawNewGraphicThruMask(x, y, graphic, frame); + DrawGraphicThruMask(x, y, graphic, frame); else - DrawNewGraphic(x, y, graphic, frame); + DrawGraphic(x, y, graphic, frame); } -void DrawNewLevelElementExt(int x, int y, int dx, int dy, int element, +void DrawLevelElementExt(int x, int y, int dx, int dy, int element, int cut_mode, int mask_mode) { if (IN_LEV_FIELD(x, y) && IN_SCR_FIELD(SCREENX(x), SCREENY(y))) - DrawNewScreenElementExt(SCREENX(x), SCREENY(y), dx, dy, element, + DrawScreenElementExt(SCREENX(x), SCREENY(y), dx, dy, element, cut_mode, mask_mode); } -void DrawNewScreenElementShifted(int x, int y, int dx, int dy, int element, +void DrawScreenElementShifted(int x, int y, int dx, int dy, int element, int cut_mode) { - DrawNewScreenElementExt(x, y, dx, dy, element, cut_mode, NO_MASKING); + DrawScreenElementExt(x, y, dx, dy, element, cut_mode, NO_MASKING); } -void DrawNewLevelElementShifted(int x, int y, int dx, int dy, int element, +void DrawLevelElementShifted(int x, int y, int dx, int dy, int element, int cut_mode) { - DrawNewLevelElementExt(x, y, dx, dy, element, cut_mode, NO_MASKING); + DrawLevelElementExt(x, y, dx, dy, element, cut_mode, NO_MASKING); } #if 0 -void DrawScreenElementThruMask(int x, int y, int element) +void DrawOldScreenElementThruMask(int x, int y, int element) { - DrawScreenElementExt(x, y, 0, 0, element, NO_CUTTING, USE_MASKING); + DrawOldScreenElementExt(x, y, 0, 0, element, NO_CUTTING, USE_MASKING); } -void DrawNewScreenElementThruMask(int x, int y, int element) +void DrawScreenElementThruMask(int x, int y, int element) { - DrawNewScreenElementExt(x, y, 0, 0, element, NO_CUTTING, USE_MASKING); + DrawScreenElementExt(x, y, 0, 0, element, NO_CUTTING, USE_MASKING); } #endif -void DrawNewLevelElementThruMask(int x, int y, int element) +void DrawLevelElementThruMask(int x, int y, int element) { - DrawNewLevelElementExt(x, y, 0, 0, element, NO_CUTTING, USE_MASKING); + DrawLevelElementExt(x, y, 0, 0, element, NO_CUTTING, USE_MASKING); } -void DrawNewLevelFieldThruMask(int x, int y) +void DrawLevelFieldThruMask(int x, int y) { - DrawNewLevelElementExt(x, y, 0, 0, Feld[x][y], NO_CUTTING, USE_MASKING); + DrawLevelElementExt(x, y, 0, 0, Feld[x][y], NO_CUTTING, USE_MASKING); } void DrawCrumbledSand(int x, int y) @@ -1507,19 +1536,19 @@ void DrawCrumbledSand(int x, int y) } } -void DrawNewScreenElement(int x, int y, int element) +void DrawScreenElement(int x, int y, int element) { - DrawNewScreenElementExt(x, y, 0, 0, element, NO_CUTTING, NO_MASKING); + DrawScreenElementExt(x, y, 0, 0, element, NO_CUTTING, NO_MASKING); DrawCrumbledSand(x, y); } -void DrawNewLevelElement(int x, int y, int element) +void DrawLevelElement(int x, int y, int element) { if (IN_LEV_FIELD(x, y) && IN_SCR_FIELD(SCREENX(x), SCREENY(y))) - DrawNewScreenElement(SCREENX(x), SCREENY(y), element); + DrawScreenElement(SCREENX(x), SCREENY(y), element); } -void DrawNewScreenField(int x, int y) +void DrawScreenField(int x, int y) { int ux = LEVELX(x), uy = LEVELY(y); int element, content; @@ -1531,7 +1560,7 @@ void DrawNewScreenField(int x, int y) else element = BorderElement; - DrawNewScreenElement(x, y, element); + DrawScreenElement(x, y, element); return; } @@ -1554,19 +1583,19 @@ void DrawNewScreenField(int x, int y) cut_mode = CUT_BELOW; if (cut_mode == CUT_ABOVE) - DrawNewScreenElementShifted(x, y, 0, 0, element, NO_CUTTING); + DrawScreenElementShifted(x, y, 0, 0, element, NO_CUTTING); else - DrawNewScreenElement(x, y, EL_EMPTY); + DrawScreenElement(x, y, EL_EMPTY); if (horiz_move) - DrawNewScreenElementShifted(x, y, MovPos[ux][uy], 0, element, NO_CUTTING); + DrawScreenElementShifted(x, y, MovPos[ux][uy], 0, element, NO_CUTTING); else if (cut_mode == NO_CUTTING) - DrawNewScreenElementShifted(x, y, 0, MovPos[ux][uy], element, cut_mode); + DrawScreenElementShifted(x, y, 0, MovPos[ux][uy], element, cut_mode); else - DrawNewScreenElementShifted(x, y, 0, MovPos[ux][uy], content, cut_mode); + DrawScreenElementShifted(x, y, 0, MovPos[ux][uy], content, cut_mode); if (content == EL_ACID) - DrawNewLevelElementThruMask(ux, uy + 1, EL_ACID); + DrawLevelElementThruMask(ux, uy + 1, EL_ACID); } else if (IS_BLOCKED(ux, uy)) { @@ -1591,35 +1620,35 @@ void DrawNewScreenField(int x, int y) element_old == EL_AMOEBA_DRIPPING) cut_mode = CUT_ABOVE; - DrawNewScreenElement(x, y, EL_EMPTY); + DrawScreenElement(x, y, EL_EMPTY); if (horiz_move) - DrawNewScreenElementShifted(sx, sy, MovPos[oldx][oldy], 0, element_old, + DrawScreenElementShifted(sx, sy, MovPos[oldx][oldy], 0, element_old, NO_CUTTING); else if (cut_mode == NO_CUTTING) - DrawNewScreenElementShifted(sx, sy, 0, MovPos[oldx][oldy], element_old, + DrawScreenElementShifted(sx, sy, 0, MovPos[oldx][oldy], element_old, cut_mode); else - DrawNewScreenElementShifted(sx, sy, 0, MovPos[oldx][oldy], content_old, + DrawScreenElementShifted(sx, sy, 0, MovPos[oldx][oldy], content_old, cut_mode); } else if (IS_DRAWABLE(element)) - DrawNewScreenElement(x, y, element); + DrawScreenElement(x, y, element); else - DrawNewScreenElement(x, y, EL_EMPTY); + DrawScreenElement(x, y, EL_EMPTY); } -void DrawNewLevelField(int x, int y) +void DrawLevelField(int x, int y) { if (IN_SCR_FIELD(SCREENX(x), SCREENY(y))) - DrawNewScreenField(SCREENX(x), SCREENY(y)); + DrawScreenField(SCREENX(x), SCREENY(y)); else if (IS_MOVING(x, y)) { int newx,newy; Moving2Blocked(x, y, &newx, &newy); if (IN_SCR_FIELD(SCREENX(newx), SCREENY(newy))) - DrawNewScreenField(SCREENX(newx), SCREENY(newy)); + DrawScreenField(SCREENX(newx), SCREENY(newy)); } else if (IS_BLOCKED(x, y)) { @@ -1627,26 +1656,26 @@ void DrawNewLevelField(int x, int y) Blocked2Moving(x, y, &oldx, &oldy); if (IN_SCR_FIELD(SCREENX(oldx), SCREENY(oldy))) - DrawNewScreenField(SCREENX(oldx), SCREENY(oldy)); + DrawScreenField(SCREENX(oldx), SCREENY(oldy)); } } -void DrawNewMiniElement(int x, int y, int element) +void DrawMiniElement(int x, int y, int element) { int graphic; graphic = el2img(element); - DrawNewMiniGraphic(x, y, graphic); + DrawMiniGraphic(x, y, graphic); } -void DrawNewMiniElementOrWall(int sx, int sy, int scroll_x, int scroll_y) +void DrawMiniElementOrWall(int sx, int sy, int scroll_x, int scroll_y) { int x = sx + scroll_x, y = sy + scroll_y; if (x < -1 || x > lev_fieldx || y < -1 || y > lev_fieldy) - DrawNewMiniElement(sx, sy, EL_EMPTY); + DrawMiniElement(sx, sy, EL_EMPTY); else if (x > -1 && x < lev_fieldx && y > -1 && y < lev_fieldy) - DrawNewMiniElement(sx, sy, Feld[x][y]); + DrawMiniElement(sx, sy, Feld[x][y]); else { int steel_type, steel_position; @@ -1669,11 +1698,11 @@ void DrawNewMiniElementOrWall(int sx, int sy, int scroll_x, int scroll_y) y == -1 || y == lev_fieldy ? 5 : -1); if (steel_position != -1) - DrawNewMiniGraphic(sx, sy, border[steel_position][steel_type]); + DrawMiniGraphic(sx, sy, border[steel_position][steel_type]); } } -void getNewMicroGraphicSource(int graphic, Bitmap **bitmap, int *x, int *y) +void getMicroGraphicSource(int graphic, Bitmap **bitmap, int *x, int *y) { Bitmap *src_bitmap = new_graphic_info[graphic].bitmap; int mini_startx = src_bitmap->width * 3 / 4; @@ -1686,7 +1715,7 @@ void getNewMicroGraphicSource(int graphic, Bitmap **bitmap, int *x, int *y) *y = src_y; } -void DrawNewMicroElement(int xpos, int ypos, int element) +void DrawMicroElement(int xpos, int ypos, int element) { Bitmap *src_bitmap; int src_x, src_y; @@ -1697,7 +1726,7 @@ void DrawNewMicroElement(int xpos, int ypos, int element) graphic = el2img(element); - getNewMicroGraphicSource(graphic, &src_bitmap, &src_x, &src_y); + getMicroGraphicSource(graphic, &src_bitmap, &src_x, &src_y); BlitBitmap(src_bitmap, drawto, src_x, src_y, MICRO_TILEX, MICRO_TILEY, xpos, ypos); } @@ -1710,23 +1739,23 @@ void DrawLevel() for(x=BX1; x<=BX2; x++) for(y=BY1; y<=BY2; y++) - DrawNewScreenField(x, y); + DrawScreenField(x, y); redraw_mask |= REDRAW_FIELD; } -void DrawNewMiniLevel(int size_x, int size_y, int scroll_x, int scroll_y) +void DrawMiniLevel(int size_x, int size_y, int scroll_x, int scroll_y) { int x,y; for(x=0; x= 0 && lx < lev_fieldx && ly >= 0 && ly < lev_fieldy) - DrawNewMicroElement(xpos + x * MICRO_TILEX, ypos + y * MICRO_TILEY, - Ur[lx][ly]); + DrawMicroElement(xpos + x * MICRO_TILEX, ypos + y * MICRO_TILEY, + Ur[lx][ly]); else if (lx >= -1 && lx < lev_fieldx+1 && ly >= -1 && ly < lev_fieldy+1) - DrawNewMicroElement(xpos + x * MICRO_TILEX, ypos + y * MICRO_TILEY, - BorderElement); + DrawMicroElement(xpos + x * MICRO_TILEX, ypos + y * MICRO_TILEY, + BorderElement); } } @@ -1807,7 +1836,7 @@ void DrawMicroLevel(int xpos, int ypos, boolean restart) label_state = 1; label_counter = 0; - DrawNewMicroLevelExt(xpos, ypos, from_x, from_y); + DrawMicroLevelExt(xpos, ypos, from_x, from_y); DrawMicroLevelLabelExt(label_state); /* initialize delay counters */ @@ -1855,7 +1884,7 @@ void DrawMicroLevel(int xpos, int ypos, boolean restart) break; } - DrawNewMicroLevelExt(xpos, ypos, from_x, from_y); + DrawMicroLevelExt(xpos, ypos, from_x, from_y); } /* redraw micro level label, if needed */ @@ -2500,8 +2529,8 @@ void CreateToolButtons() { int player_nr = id - TOOL_CTRL_ID_PLAYER_1; - getNewMiniGraphicSource(PLAYER_NR_GFX(IMG_PLAYER1, player_nr), - &deco_bitmap, &deco_x, &deco_y); + getMiniGraphicSource(PLAYER_NR_GFX(IMG_PLAYER1, player_nr), + &deco_bitmap, &deco_x, &deco_y); deco_xpos = (toolbutton_info[i].width - MINI_TILEX) / 2; deco_ypos = (toolbutton_info[i].height - MINI_TILEY) / 2; } diff --git a/src/tools.h b/src/tools.h index 5964d6bc..5f188c47 100644 --- a/src/tools.h +++ b/src/tools.h @@ -70,35 +70,35 @@ void SetBorderElement(); void DrawAllPlayers(void); void DrawPlayerField(int, int); void DrawPlayer(struct PlayerInfo *); -int getNewGraphicAnimationFrame(int, int); -void DrawNewGraphicAnimation(int, int, int); -void DrawNewGraphic(int, int, int, int); +int getGraphicAnimationFrame(int, int); +void DrawGraphicAnimation(int, int, int); +void DrawGraphic(int, int, int, int); void DrawOldGraphicExt(DrawBuffer *, int, int, int); -void DrawNewGraphicExt(DrawBuffer *, int, int, int, int); -void DrawNewGraphicThruMask(int, int, int, int); -void DrawNewGraphicThruMaskExt(DrawBuffer *, int, int, int, int); -void DrawNewMiniGraphic(int, int, int); -void getNewMiniGraphicSource(int, Bitmap **, int *, int *); -void DrawNewMiniGraphicExt(DrawBuffer *, int, int, int); -void DrawNewGraphicShifted(int, int, int, int, int, int, int, int); -void DrawNewGraphicShiftedThruMask(int, int, int, int, int, int, int); -void DrawNewScreenElementExt(int, int, int, int, int, int, int); -void DrawNewLevelElementExt(int, int, int, int, int, int, int); -void DrawNewScreenElementShifted(int, int, int, int, int, int); -void DrawNewLevelElementShifted(int, int, int, int, int, int); -void DrawNewScreenElementThruMask(int, int, int); -void DrawNewLevelElementThruMask(int, int, int); -void DrawNewLevelFieldThruMask(int, int); +void DrawGraphicExt(DrawBuffer *, int, int, int, int); +void DrawGraphicThruMask(int, int, int, int); +void DrawGraphicThruMaskExt(DrawBuffer *, int, int, int, int); +void DrawMiniGraphic(int, int, int); +void getMiniGraphicSource(int, Bitmap **, int *, int *); +void DrawMiniGraphicExt(DrawBuffer *, int, int, int); +void DrawGraphicShifted(int, int, int, int, int, int, int, int); +void DrawGraphicShiftedThruMask(int, int, int, int, int, int, int); +void DrawScreenElementExt(int, int, int, int, int, int, int); +void DrawLevelElementExt(int, int, int, int, int, int, int); +void DrawScreenElementShifted(int, int, int, int, int, int); +void DrawLevelElementShifted(int, int, int, int, int, int); +void DrawScreenElementThruMask(int, int, int); +void DrawLevelElementThruMask(int, int, int); +void DrawLevelFieldThruMask(int, int); void DrawCrumbledSand(int, int); -void DrawNewScreenElement(int, int, int); -void DrawNewLevelElement(int, int, int); -void DrawNewScreenField(int, int); -void DrawNewLevelField(int, int); -void DrawNewMiniElement(int, int, int); -void DrawNewMiniElementOrWall(int, int, int, int); -void DrawNewMicroElement(int, int, int); +void DrawScreenElement(int, int, int); +void DrawLevelElement(int, int, int); +void DrawScreenField(int, int); +void DrawLevelField(int, int); +void DrawMiniElement(int, int, int); +void DrawMiniElementOrWall(int, int, int, int); +void DrawMicroElement(int, int, int); void DrawLevel(void); -void DrawNewMiniLevel(int, int, int, int); +void DrawMiniLevel(int, int, int, int); void DrawMicroLevel(int, int, boolean); boolean Request(char *, unsigned int);