diff --git a/src/bomb.c b/src/bomb.c index c075177..ab310a6 100644 --- a/src/bomb.c +++ b/src/bomb.c @@ -1,4 +1,4 @@ -/* $Id: bomb.c,v 1.35 2003/07/22 18:29:08 stpohle Exp $ */ +/* $Id: bomb.c,v 1.36 2003/07/23 01:43:34 stpohle Exp $ */ /* everything what have to do with the bombs */ #include "bomberclone.h" @@ -42,7 +42,7 @@ draw_bomb (_bomb * bomb) stonelist_add ((x>>8)+1, (y>>8)+1); } - gfx_blit (gfx.bomb.image, &src, gfx.screen, &dest, y + 16); + gfx_blit (gfx.bomb.image, &src, gfx.screen, &dest, y + 2); }; diff --git a/src/field.c b/src/field.c index 0010a09..2edca18 100644 --- a/src/field.c +++ b/src/field.c @@ -1,4 +1,4 @@ -/* $Id: field.c,v 1.36 2003/07/22 18:29:08 stpohle Exp $ */ +/* $Id: field.c,v 1.37 2003/07/23 01:43:34 stpohle Exp $ */ /* field.c - procedures which are needed to control the field */ #include "bomberclone.h" @@ -28,7 +28,7 @@ void stonelist_draw () { /* add stone to draw */ -void stonelist_add (int x, int y) { +static void _stonelist_add (int x, int y, int recursive) { int i; _point *slentry = NULL; @@ -41,8 +41,13 @@ void stonelist_add (int x, int y) { else { slentry->x = x; slentry->y = y; + + if (recursive && gfx.field[map.field[x][y].type].h != gfx.field[map.field[x][y].type].w) + /* field is higher as usual */ + _stonelist_add (x, y-1, 0); } }; +inline void stonelist_add (int x, int y) { _stonelist_add (x, y, 1); }; void @@ -93,7 +98,9 @@ draw_stone (int x, int y) field_animation_add (x, y); if (stone->frame < gfx.field[FT_stone].frames) { - src.y = stone->frame * gfx.block.y; + src.y = stone->frame * gfx.field[FT_stone].h; + dest.h = src.h = gfx.field[FT_stone].h; + dest.y -= (gfx.field[stone->type].h - gfx.field[stone->type].w); srcimg = gfx.field[FT_stone].image; } else { @@ -103,7 +110,9 @@ draw_stone (int x, int y) } else if (stone->type == FT_stone || stone->type == FT_block) { - src.y = 0; + src.y = stone->frame * gfx.field[stone->type].h; + dest.h = src.h = gfx.field[stone->type].h; + dest.y -= (gfx.field[stone->type].h - gfx.field[stone->type].w); srcimg = gfx.field[stone->type].image; } @@ -132,6 +141,17 @@ draw_stone (int x, int y) gfx_blit (srcimg, &src, gfx.screen, &dest, (y << 8) + 2); } + /* if the current field is half hidden by the lower + field (y+1) draw this little part too */ + if (y < map.size.y-1 && gfx.field[map.field[x][y+1].type].h > gfx.field[map.field[x][y+1].type].w) { + src.x = 0; + src.y = map.field[x][y+1].frame * gfx.field[map.field[x][y+1].type].h; + dest.h = src.h = gfx.field[map.field[x][y+1].type].h - gfx.field[map.field[x][y+1].type].w; + dest.w = src.w = gfx.field[map.field[x][y+1].type].w; + dest.y = gfx.offset.y + ((gfx.block.y * (y+1)) - (gfx.field[map.field[x][y+1].type].h - gfx.field[map.field[x][y+1].type].w)); + gfx_blit (gfx.field[map.field[x][y+1].type].image, &src, gfx.screen, &dest, (y << 8) + 3); + } + // draw explosions if there is any for (d = 0, i = 0; d < 4; d++) if (stone->ex[d].count > 0) { diff --git a/src/game.c b/src/game.c index 7d7b815..8896445 100644 --- a/src/game.c +++ b/src/game.c @@ -25,8 +25,8 @@ game_draw_info () SDL_Rect src, dest; - redraw_logo (0, 0, gfx.res.x, 3 * 16); if (bman.updatestatusbar) { + redraw_logo (0, 0, gfx.res.x, 3 * 16); bman.updatestatusbar = 0; dest.x = dest.y = 0; dest.h = 3*16;