|
|
@ -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 */
|
|
|
|
/* field.c - procedures which are needed to control the field */
|
|
|
|
|
|
|
|
|
|
|
|
#include "bomberclone.h"
|
|
|
|
#include "bomberclone.h"
|
|
|
@ -28,7 +28,7 @@ void stonelist_draw () {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* add stone to draw */
|
|
|
|
/* add stone to draw */
|
|
|
|
void stonelist_add (int x, int y) {
|
|
|
|
static void _stonelist_add (int x, int y, int recursive) {
|
|
|
|
int i;
|
|
|
|
int i;
|
|
|
|
_point *slentry = NULL;
|
|
|
|
_point *slentry = NULL;
|
|
|
|
|
|
|
|
|
|
|
@ -41,8 +41,13 @@ void stonelist_add (int x, int y) {
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
slentry->x = x;
|
|
|
|
slentry->x = x;
|
|
|
|
slentry->y = y;
|
|
|
|
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
|
|
|
|
void
|
|
|
@ -93,7 +98,9 @@ draw_stone (int x, int y)
|
|
|
|
field_animation_add (x, y);
|
|
|
|
field_animation_add (x, y);
|
|
|
|
|
|
|
|
|
|
|
|
if (stone->frame < gfx.field[FT_stone].frames) {
|
|
|
|
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;
|
|
|
|
srcimg = gfx.field[FT_stone].image;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
@ -103,7 +110,9 @@ draw_stone (int x, int y)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
else if (stone->type == FT_stone || stone->type == FT_block) {
|
|
|
|
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;
|
|
|
|
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);
|
|
|
|
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
|
|
|
|
// draw explosions if there is any
|
|
|
|
for (d = 0, i = 0; d < 4; d++)
|
|
|
|
for (d = 0, i = 0; d < 4; d++)
|
|
|
|
if (stone->ex[d].count > 0) {
|
|
|
|
if (stone->ex[d].count > 0) {
|
|
|
|