Debug Messages because of the crash

origin
stpohle 23 years ago
parent 5839c3b3be
commit b6cb595011

@ -19,7 +19,8 @@ draw_bomb (_bomb * bomb)
return; return;
} }
if (bomb->state != BS_trigger || ((bomb->state == BS_trigger) && (bomb->to<BOMB_TIMEOUT*TIME_FACTOR))) { if (bomb->state != BS_trigger
|| ((bomb->state == BS_trigger) && (bomb->to < BOMB_TIMEOUT * TIME_FACTOR))) {
/* check the framenumber */ /* check the framenumber */
if (bomb->frameto-- == 0) { if (bomb->frameto-- == 0) {
bomb->frameto = ANI_BOMBTIMEOUT; bomb->frameto = ANI_BOMBTIMEOUT;
@ -76,19 +77,24 @@ bomb_move (_bomb *bomb)
_point npos; _point npos;
if (bomb->pos.x == bomb->moveto.x) { if (bomb->pos.x == bomb->moveto.x) {
if (bomb->pos.y == bomb->moveto.y) { if (bomb->pos.y == bomb->moveto.y) {
bomb->moves=0;return;} bomb->moves = 0;
return;
}
if (bomb->pos.y > bomb->moveto.y) { if (bomb->pos.y > bomb->moveto.y) {
npos.y = bomb->pos.y - bomb->moves; //move bomb up npos.y = bomb->pos.y - bomb->moves; //move bomb up
npos.x = bomb->pos.x; npos.x = bomb->pos.x;
} else { }
else {
npos.y = bomb->pos.y + bomb->moves; // move bomb down npos.y = bomb->pos.y + bomb->moves; // move bomb down
npos.x = bomb->pos.x; npos.x = bomb->pos.x;
} }
} else { }
else {
if (bomb->pos.x > bomb->moveto.x) { if (bomb->pos.x > bomb->moveto.x) {
npos.x = bomb->pos.x - bomb->moves; //move bomb left npos.x = bomb->pos.x - bomb->moves; //move bomb left
npos.y = bomb->pos.y; npos.y = bomb->pos.y;
} else { }
else {
npos.x = bomb->pos.x + bomb->moves; // move bomb right npos.x = bomb->pos.x + bomb->moves; // move bomb right
npos.y = bomb->pos.y; npos.y = bomb->pos.y;
} }
@ -343,7 +349,8 @@ draw_explosion (_bomb * bomb)
r, r,
dx, dx,
dy; dy;
_point p, bpos; _point p,
bpos;
bpos.x = bomb->pos.x >> 8; bpos.x = bomb->pos.x >> 8;
bpos.y = bomb->pos.y >> 8; bpos.y = bomb->pos.y >> 8;

@ -1,4 +1,4 @@
/* $Id: field.c,v 1.31 2003/06/07 19:35:42 stpohle Exp $ */ /* $Id: field.c,v 1.32 2003/06/07 19:52:45 stpohle Exp $ */
/* field.c - procedures which are needed to control the field */ /* field.c - procedures which are needed to control the field */
#include <stdlib.h> #include <stdlib.h>
@ -24,8 +24,6 @@ draw_stone (int x, int y)
return; return;
} }
printf ("Draw Stone [%d,%d]\n", x,y);
src.w = dest.w = gfx.block.x; src.w = dest.w = gfx.block.x;
src.h = dest.h = gfx.block.y; src.h = dest.h = gfx.block.y;
@ -43,8 +41,6 @@ draw_stone (int x, int y)
srcbg.x = (x % gfx.field[FT_nothing].frames) * gfx.block.x; srcbg.x = (x % gfx.field[FT_nothing].frames) * gfx.block.x;
srcbg.y = (y % gfx.field[FT_nothing].frames) * gfx.block.y; srcbg.y = (y % gfx.field[FT_nothing].frames) * gfx.block.y;
printf (" Draw Background\n");
SDL_BlitSurface (gfx.field[FT_nothing].image, &srcbg, gfx.screen, &dest); SDL_BlitSurface (gfx.field[FT_nothing].image, &srcbg, gfx.screen, &dest);
} }
@ -91,27 +87,22 @@ draw_stone (int x, int y)
src.y = stone->frame * gfx.block.y; src.y = stone->frame * gfx.block.y;
} }
printf (" Draw Stone or Powerup Background Type=%d i=%d d=%d\n", stone->type, i, d);
if (srcimg != NULL) if (srcimg != NULL)
SDL_BlitSurface (srcimg, &src, gfx.screen, &dest); SDL_BlitSurface (srcimg, &src, gfx.screen, &dest);
if (i >= FT_death) { /* draw now the powerup itself */ if (i >= FT_death) { /* draw now the powerup itself */
printf (" Draw Stone the Powerup itself\n");
srcimg = gfx.field[i].image; srcimg = gfx.field[i].image;
src.y = 0; src.y = 0;
SDL_BlitSurface (srcimg, &src, gfx.screen, &dest); SDL_BlitSurface (srcimg, &src, gfx.screen, &dest);
} }
// draw explosions if there is any // draw explosions if there is any
printf (" Draw Explosion if there is any\n");
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) {
i = 1; // mark that there is already an explosion i = 1; // mark that there is already an explosion
draw_fire (x, y, d, -1); draw_fire (x, y, d, -1);
} }
printf (" function ok.\n");
return; return;
}; };

Loading…
Cancel
Save