X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ftools.c;h=9b972e7df955a0557e9876d2c413142ab35859eb;hb=aed278e72703016e2729b55d8b629b7e1b31469e;hp=e241c79adb289bdb3fe69614687019ebf79a8aed;hpb=c6f9fba81fc59eff4b6b454dff92adecd28a7ad5;p=rocksndiamonds.git diff --git a/src/tools.c b/src/tools.c index e241c79a..9b972e7d 100644 --- a/src/tools.c +++ b/src/tools.c @@ -790,7 +790,7 @@ void DrawGraphicAnimation(int x, int y, int graphic) MarkTileDirty(x, y); } -#if 1 +#if 0 void getOldGraphicSource(int graphic, Bitmap **bitmap, int *x, int *y) { if (graphic >= 0 && graphic_info[graphic].bitmap != NULL) @@ -1306,6 +1306,12 @@ inline static int getGfxAction(int x, int y) gfx_action = GfxAction[x][y]; #endif +#if DEBUG + if (gfx_action < 0) + printf("getGfxAction: THIS SHOULD NEVER HAPPEN: GfxAction[%d][%d] == %d\n", + x, y, gfx_action); +#endif + return gfx_action; } @@ -1313,11 +1319,23 @@ 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 = getGraphicAnimationFrame(graphic, move_pos); + int graphic; + int frame; + + if (IN_LEV_FIELD(ux, uy)) + { + int move_dir = MovDir[ux][uy]; + int move_pos = getFramePosition(ux, uy); + int gfx_action = getGfxAction(ux, uy); + + graphic = el_dir_act2img(element, move_dir, gfx_action); + frame = getGraphicAnimationFrame(graphic, move_pos); + } + else + { + graphic = el2img(element); + frame = getGraphicAnimationFrame(graphic, 0); + } if (element == EL_WALL_GROWING) { @@ -2244,10 +2262,17 @@ unsigned int MoveDoor(unsigned int door_state) { stepsize = 20; door_delay_value = 0; + StopSound(SND_MENU_DOOR_OPENING); StopSound(SND_MENU_DOOR_CLOSING); } + if (global.autoplay_leveldir) + { + door_state |= DOOR_NO_DELAY; + door_state &= ~DOOR_CLOSE_ALL; + } + if (door_state & DOOR_ACTION) { if (!(door_state & DOOR_NO_DELAY)) @@ -2266,7 +2291,8 @@ unsigned int MoveDoor(unsigned int door_state) Bitmap *bitmap = new_graphic_info[IMG_MENU_DOOR].bitmap; GC gc = bitmap->stored_clip_gc; - WaitUntilDelayReached(&door_delay, door_delay_value); + if (!(door_state & DOOR_NO_DELAY)) + WaitUntilDelayReached(&door_delay, door_delay_value); if (door_state & DOOR_ACTION_1) { @@ -2558,6 +2584,14 @@ void CreateToolButtons() } } +void FreeToolButtons() +{ + int i; + + for (i=0; i