|
|
@ -1,4 +1,4 @@
|
|
|
|
/* $Id: player.c,v 1.67 2004/01/25 19:37:05 stpohle Exp $
|
|
|
|
/* $Id: player.c,v 1.68 2004/01/27 20:44:03 stpohle Exp $
|
|
|
|
* player.c - everything what have to do with the player */
|
|
|
|
* player.c - everything what have to do with the player */
|
|
|
|
|
|
|
|
|
|
|
|
#include <SDL.h>
|
|
|
|
#include <SDL.h>
|
|
|
@ -56,6 +56,37 @@ draw_player (_player * player)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else if (PS_IS_respawn (player->state)) {
|
|
|
|
|
|
|
|
/* player is respawning
|
|
|
|
|
|
|
|
* first: draw the star */
|
|
|
|
|
|
|
|
dest.w = src.w = gfx.respawn.image->w;
|
|
|
|
|
|
|
|
dest.h = src.h = player->gfx->ani.h;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dest.x = gfx.offset.x + ((player->pos.x-0.5f) * gfx.block.x);
|
|
|
|
|
|
|
|
dest.y = gfx.offset.y + ((player->pos.y - 1.0f) * gfx.block.y);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src.x = 0;
|
|
|
|
|
|
|
|
src.y = (2 * gfx.block.y) * (int)player->frame;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gfx_blit (gfx.respawn.image, &src, gfx.screen, &dest, 0xFFFF);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (player->frame > (player->gfx->ani.frames/2)) {
|
|
|
|
|
|
|
|
/* second: draw the player behind the star */
|
|
|
|
|
|
|
|
dest.x =
|
|
|
|
|
|
|
|
gfx.offset.x + player->gfx->offset.x + player->pos.x * gfx.block.x;
|
|
|
|
|
|
|
|
dest.y =
|
|
|
|
|
|
|
|
gfx.offset.y + player->gfx->offset.y + player->pos.y * gfx.block.y;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dest.w = src.w = player->gfx->ani.w;
|
|
|
|
|
|
|
|
dest.h = src.h = player->gfx->ani.h;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src.x = 0;
|
|
|
|
|
|
|
|
src.y = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gfx_blit (player->gfx->ani.image, &src, gfx.screen, &dest, 0xE000);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
/* player is dead */
|
|
|
|
/* player is dead */
|
|
|
|
dest.w = src.w = gfx.dead.image->w;
|
|
|
|
dest.w = src.w = gfx.dead.image->w;
|
|
|
@ -71,6 +102,7 @@ draw_player (_player * player)
|
|
|
|
|
|
|
|
|
|
|
|
gfx_blit (gfx.dead.image, &src, gfx.screen, &dest, 0xFFFF);
|
|
|
|
gfx_blit (gfx.dead.image, &src, gfx.screen, &dest, 0xFFFF);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
player->old = player->pos; // save this position
|
|
|
|
player->old = player->pos; // save this position
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|