X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ftools.c;h=f7a67afb42b0a9a3a9a1e345923ed77c08eaf1c4;hb=6269ea8e89e9dea338b286bc6cb3a48388a43ad7;hp=52f64b144287a478879204f3e4603de41ca97c85;hpb=998be01ad92a672b69b11e24d472f6c0c076817f;p=rocksndiamonds.git diff --git a/src/tools.c b/src/tools.c index 52f64b14..f7a67afb 100644 --- a/src/tools.c +++ b/src/tools.c @@ -1,14 +1,14 @@ /*********************************************************** -* Rocks'n'Diamonds -- McDuffin Strikes Back! * +* Rocks'n'Diamonds -- McDuffin Strikes Back! * *----------------------------------------------------------* -* (c) 1995-98 Artsoft Entertainment * -* Holger Schemel * -* Oststrasse 11a * -* 33604 Bielefeld * -* phone: ++49 +521 290471 * -* email: aeglos@valinor.owl.de * +* (c) 1995-2001 Artsoft Entertainment * +* Holger Schemel * +* Detmolder Strasse 189 * +* 33604 Bielefeld * +* Germany * +* e-mail: info@artsoft.org * *----------------------------------------------------------* -* tools.c * +* tools.c * ***********************************************************/ #include @@ -85,7 +85,7 @@ void SetDrawtoField(int mode) void BackToFront() { int x,y; - DrawBuffer buffer = (drawto_field == window ? backbuffer : drawto_field); + DrawBuffer *buffer = (drawto_field == window ? backbuffer : drawto_field); if (setup.direct_draw && game_status == PLAYING) redraw_mask &= ~REDRAW_MAIN; @@ -771,7 +771,7 @@ void DrawGraphic(int x, int y, int graphic) MarkTileDirty(x,y); } -void DrawGraphicExt(DrawBuffer bitmap, int x, int y, int graphic) +void DrawGraphicExt(DrawBuffer *bitmap, int x, int y, int graphic) { int bitmap_nr; int src_x, src_y; @@ -795,12 +795,12 @@ void DrawGraphicThruMask(int x, int y, int graphic) MarkTileDirty(x,y); } -void DrawGraphicThruMaskExt(DrawBuffer d, int dest_x, int dest_y, int graphic) +void DrawGraphicThruMaskExt(DrawBuffer *d, int dest_x, int dest_y, int graphic) { int tile = graphic; int bitmap_nr; int src_x, src_y; - Bitmap src_bitmap; + Bitmap *src_bitmap; GC drawing_gc; if (graphic == GFX_LEERRAUM) @@ -837,7 +837,7 @@ void DrawMiniGraphic(int x, int y, int graphic) MarkTileDirty(x/2, y/2); } -void getMiniGraphicSource(int graphic, Bitmap *bitmap, int *x, int *y) +void getMiniGraphicSource(int graphic, Bitmap **bitmap, int *x, int *y) { if (graphic >= GFX_START_ROCKSSCREEN && graphic <= GFX_END_ROCKSSCREEN) { @@ -884,9 +884,9 @@ void getMiniGraphicSource(int graphic, Bitmap *bitmap, int *x, int *y) } } -void DrawMiniGraphicExt(DrawBuffer d, int x, int y, int graphic) +void DrawMiniGraphicExt(DrawBuffer *d, int x, int y, int graphic) { - Bitmap bitmap; + Bitmap *bitmap; int src_x, src_y; getMiniGraphicSource(graphic, &bitmap, &src_x, &src_y); @@ -901,7 +901,7 @@ void DrawGraphicShifted(int x,int y, int dx,int dy, int graphic, int src_x, src_y, dest_x, dest_y; int tile = graphic; int bitmap_nr; - Bitmap src_bitmap; + Bitmap *src_bitmap; GC drawing_gc; if (graphic < 0) @@ -1336,7 +1336,7 @@ void DrawLevelElement(int x, int y, int element) void DrawScreenField(int x, int y) { int ux = LEVELX(x), uy = LEVELY(y); - int element; + int element, content; if (!IN_LEV_FIELD(ux, uy)) { @@ -1350,33 +1350,44 @@ void DrawScreenField(int x, int y) } element = Feld[ux][uy]; + content = Store[ux][uy]; if (IS_MOVING(ux, uy)) { int horiz_move = (MovDir[ux][uy] == MV_LEFT || MovDir[ux][uy] == MV_RIGHT); boolean cut_mode = NO_CUTTING; - if (Store[ux][uy] == EL_MORAST_LEER || - Store[ux][uy] == EL_MAGIC_WALL_EMPTY || - Store[ux][uy] == EL_MAGIC_WALL_BD_EMPTY || - Store[ux][uy] == EL_AMOEBE_NASS) + if (element == EL_QUICKSAND_EMPTYING || + content == EL_MAGIC_WALL_EMPTY || + content == EL_MAGIC_WALL_BD_EMPTY || + content == EL_AMOEBE_NASS) cut_mode = CUT_ABOVE; - else if (Store[ux][uy] == EL_MORAST_VOLL || - Store[ux][uy] == EL_MAGIC_WALL_FULL || - Store[ux][uy] == EL_MAGIC_WALL_BD_FULL) + else if (element == EL_QUICKSAND_FILLING || + content == EL_MAGIC_WALL_FULL || + content == EL_MAGIC_WALL_BD_FULL) cut_mode = CUT_BELOW; if (cut_mode == CUT_ABOVE) - DrawScreenElementShifted(x, y, 0, 0, Store[ux][uy], NO_CUTTING); + { + if (element == EL_QUICKSAND_EMPTYING) + DrawScreenElementShifted(x, y, 0, 0, element, NO_CUTTING); + else + DrawScreenElementShifted(x, y, 0, 0, content, NO_CUTTING); + } else DrawScreenElement(x, y, EL_LEERRAUM); if (horiz_move) DrawScreenElementShifted(x, y, MovPos[ux][uy], 0, element, NO_CUTTING); else - DrawScreenElementShifted(x, y, 0, MovPos[ux][uy], element, cut_mode); + { + if (element == EL_QUICKSAND_FILLING || element == EL_QUICKSAND_EMPTYING) + DrawScreenElementShifted(x, y, 0, MovPos[ux][uy], content, cut_mode); + else + DrawScreenElementShifted(x, y, 0, MovPos[ux][uy], element, cut_mode); + } - if (Store[ux][uy] == EL_SALZSAEURE) + if (content == EL_SALZSAEURE) DrawLevelElementThruMask(ux, uy + 1, EL_SALZSAEURE); } else if (IS_BLOCKED(ux, uy)) @@ -1385,6 +1396,7 @@ void DrawScreenField(int x, int y) int sx, sy; int horiz_move; boolean cut_mode = NO_CUTTING; + int element_old, content_old; Blocked2Moving(ux, uy, &oldx, &oldy); sx = SCREENX(oldx); @@ -1392,19 +1404,29 @@ void DrawScreenField(int x, int y) horiz_move = (MovDir[oldx][oldy] == MV_LEFT || MovDir[oldx][oldy] == MV_RIGHT); - if (Store[oldx][oldy] == EL_MORAST_LEER || - Store[oldx][oldy] == EL_MAGIC_WALL_EMPTY || - Store[oldx][oldy] == EL_MAGIC_WALL_BD_EMPTY || - Store[oldx][oldy] == EL_AMOEBE_NASS) + element_old = Feld[oldx][oldy]; + content_old = Store[oldx][oldy]; + + if (element_old == EL_QUICKSAND_EMPTYING || + content_old == EL_MAGIC_WALL_EMPTY || + content_old == EL_MAGIC_WALL_BD_EMPTY || + content_old == EL_AMOEBE_NASS) cut_mode = CUT_ABOVE; DrawScreenElement(x, y, EL_LEERRAUM); - element = Feld[oldx][oldy]; if (horiz_move) - DrawScreenElementShifted(sx,sy, MovPos[oldx][oldy],0,element,NO_CUTTING); + DrawScreenElementShifted(sx, sy, MovPos[oldx][oldy], 0, element_old, + NO_CUTTING); else - DrawScreenElementShifted(sx,sy, 0,MovPos[oldx][oldy],element,cut_mode); + { + if (element_old == EL_QUICKSAND_EMPTYING) + DrawScreenElementShifted(sx, sy, 0, MovPos[oldx][oldy], content_old, + cut_mode); + else + DrawScreenElementShifted(sx, sy, 0, MovPos[oldx][oldy], element_old, + cut_mode); + } } else if (IS_DRAWABLE(element)) DrawScreenElement(x, y, element); @@ -2028,7 +2050,7 @@ unsigned int MoveDoor(unsigned int door_state) for(x=start; x<=DXSIZE; x+=stepsize) { - Bitmap bitmap = pix[PIX_DOOR]; + Bitmap *bitmap = pix[PIX_DOOR]; GC gc = bitmap->stored_clip_gc; WaitUntilDelayReached(&door_delay, door_delay_value); @@ -2146,7 +2168,7 @@ void UndrawSpecialEditorDoor() } #ifndef TARGET_SDL -int ReadPixel(DrawBuffer bitmap, int x, int y) +int ReadPixel(DrawBuffer *bitmap, int x, int y) { XImage *pixel_image; unsigned long pixel_value; @@ -2275,8 +2297,8 @@ void CreateToolButtons() for (i=0; i