|
|
@ -27,69 +27,70 @@ game_draw_info ()
|
|
|
|
|
|
|
|
|
|
|
|
redraw_logo (0, 0, gfx.res.x, 3 * 16);
|
|
|
|
redraw_logo (0, 0, gfx.res.x, 3 * 16);
|
|
|
|
if (bman.updatestatusbar) {
|
|
|
|
if (bman.updatestatusbar) {
|
|
|
|
gfx_AddUpdateRect (0, 0, gfx.res.x, 3 * 16);
|
|
|
|
|
|
|
|
bman.updatestatusbar = 0;
|
|
|
|
bman.updatestatusbar = 0;
|
|
|
|
}
|
|
|
|
gfx_AddUpdateRect (0, 0, gfx.res.x, 3 * 16);
|
|
|
|
bman.players_nr = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (GT_MP_PTP) {
|
|
|
|
|
|
|
|
/* In Multiplayer mode draw Player names and
|
|
|
|
|
|
|
|
count the players who are still alife. */
|
|
|
|
|
|
|
|
for (x = 0, j = 0, i = 0; i < MAX_PLAYERS; i++)
|
|
|
|
|
|
|
|
if ((bman.players[i].state & PSFM_used) != 0) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (bman.players[i].gfx_nr != -1 && PS_IS_used (bman.players[i].state)) {
|
|
|
|
|
|
|
|
src.x = 3 * bman.players[i].gfx->smal_size.x;
|
|
|
|
|
|
|
|
src.y = 0;
|
|
|
|
|
|
|
|
src.w = dest.w = bman.players[i].gfx->smal_size.x;
|
|
|
|
|
|
|
|
src.h = dest.h = bman.players[i].gfx->smal_size.y;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dest.x = x;
|
|
|
|
|
|
|
|
dest.y = j - 4;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SDL_BlitSurface (bman.players[i].gfx->smal_image, &src, gfx.screen, &dest);
|
|
|
|
bman.players_nr = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sprintf (scrtext, "%10s:%2d", bman.players[i].name, bman.players[i].points);
|
|
|
|
if (GT_MP_PTP) {
|
|
|
|
if ((bman.players[i].state & PSFM_alife) != PSFM_alife) { // Player is dead
|
|
|
|
/* In Multiplayer mode draw Player names and
|
|
|
|
draw_text (x, j, scrtext, 0);
|
|
|
|
count the players who are still alife. */
|
|
|
|
if ((bman.players[i].state & PSF_used) != PSF_used)
|
|
|
|
for (x = 0, j = 0, i = 0; i < MAX_PLAYERS; i++)
|
|
|
|
draw_text (x, j, "-------------", 1);
|
|
|
|
if ((bman.players[i].state & PSFM_used) != 0) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (bman.players[i].gfx_nr != -1 && PS_IS_used (bman.players[i].state)) {
|
|
|
|
|
|
|
|
src.x = 3 * bman.players[i].gfx->smal_size.x;
|
|
|
|
|
|
|
|
src.y = 0;
|
|
|
|
|
|
|
|
src.w = dest.w = bman.players[i].gfx->smal_size.x;
|
|
|
|
|
|
|
|
src.h = dest.h = bman.players[i].gfx->smal_size.y;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dest.x = x;
|
|
|
|
|
|
|
|
dest.y = j - 4;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SDL_BlitSurface (bman.players[i].gfx->smal_image, &src, gfx.screen, &dest);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sprintf (scrtext, "%10s:%2d", bman.players[i].name, bman.players[i].points);
|
|
|
|
|
|
|
|
if ((bman.players[i].state & PSFM_alife) != PSFM_alife) { // Player is dead
|
|
|
|
|
|
|
|
draw_text (x, j, scrtext, 0);
|
|
|
|
|
|
|
|
if ((bman.players[i].state & PSF_used) != PSF_used)
|
|
|
|
|
|
|
|
draw_text (x, j, "-------------", 1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else { // players is alife
|
|
|
|
|
|
|
|
draw_text (x, j, scrtext, 1);
|
|
|
|
|
|
|
|
bman.players_nr++;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
x = x + 170;
|
|
|
|
|
|
|
|
if (x >= gfx.res.x - (120 + 170)) {
|
|
|
|
|
|
|
|
x = 0;
|
|
|
|
|
|
|
|
j = j + 14;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else { // players is alife
|
|
|
|
}
|
|
|
|
draw_text (x, j, scrtext, 1);
|
|
|
|
else
|
|
|
|
|
|
|
|
/* in single mode count the player's who are still alife */
|
|
|
|
|
|
|
|
for (i = 0; i < MAX_PLAYERS; i++)
|
|
|
|
|
|
|
|
if (PS_IS_alife (bman.players[i].state))
|
|
|
|
bman.players_nr++;
|
|
|
|
bman.players_nr++;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
x = x + 170;
|
|
|
|
|
|
|
|
if (x >= gfx.res.x - (120 + 170)) {
|
|
|
|
|
|
|
|
x = 0;
|
|
|
|
|
|
|
|
j = j + 14;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
/* in single mode count the player's who are still alife */
|
|
|
|
|
|
|
|
for (i = 0; i < MAX_PLAYERS; i++)
|
|
|
|
|
|
|
|
if (PS_IS_alife (bman.players[i].state))
|
|
|
|
|
|
|
|
bman.players_nr++;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
x = gfx.res.x - 120;
|
|
|
|
|
|
|
|
sprintf (text, "Bombs: %2d", bman.players[bman.p_nr].bombs_n);
|
|
|
|
|
|
|
|
draw_text (x, 0, text, 1);
|
|
|
|
|
|
|
|
sprintf (text, "Range: %2d", bman.players[bman.p_nr].range);
|
|
|
|
|
|
|
|
draw_text (x, 16, text, 1);
|
|
|
|
|
|
|
|
sprintf (text, "Speed: %2d", bman.players[bman.p_nr].speed);
|
|
|
|
|
|
|
|
draw_text (x, 32, text, 1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (bman.state == GS_ready && GT_MP_PTPM)
|
|
|
|
|
|
|
|
draw_text (100, 32, "Press F4 to start the game", 1);
|
|
|
|
|
|
|
|
else if (bman.state == GS_ready)
|
|
|
|
|
|
|
|
draw_text (100, 32, "Waiting for the Server to Start", 1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
x = gfx.res.x - 120;
|
|
|
|
|
|
|
|
sprintf (text, "Bombs: %2d", bman.players[bman.p_nr].bombs_n);
|
|
|
|
|
|
|
|
draw_text (x, 0, text, 1);
|
|
|
|
|
|
|
|
sprintf (text, "Range: %2d", bman.players[bman.p_nr].range);
|
|
|
|
|
|
|
|
draw_text (x, 16, text, 1);
|
|
|
|
|
|
|
|
sprintf (text, "SP: %d Speed: %2d", bman.players[bman.p_nr].special,
|
|
|
|
|
|
|
|
bman.players[bman.p_nr].speed);
|
|
|
|
|
|
|
|
draw_text (x - 90, 32, text, 1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (bman.state == GS_ready && GT_MP_PTPM)
|
|
|
|
|
|
|
|
draw_text (100, 32, "Press F4 to start the game", 1);
|
|
|
|
|
|
|
|
else if (bman.state == GS_ready)
|
|
|
|
|
|
|
|
draw_text (100, 32, "Waiting for the Server to Start", 1);
|
|
|
|
|
|
|
|
}
|
|
|
|
if (debug) { /* do some debug informations on the screen */
|
|
|
|
if (debug) { /* do some debug informations on the screen */
|
|
|
|
redraw_logo (0, gfx.res.y - gfx.font.size.y, gfx.res.x, gfx.res.y);
|
|
|
|
redraw_logo (0, gfx.res.y - gfx.font.size.y, gfx.res.x, gfx.res.y);
|
|
|
|
for (x = 0; x < bman.fieldsize.x; x++)
|
|
|
|
for (x = 0; x < bman.fieldsize.x; x++)
|
|
|
|
draw_stone (x, bman.fieldsize.y - 1);
|
|
|
|
draw_stone (x, bman.fieldsize.y - 1);
|
|
|
|
if (GT_MP_PTP) {
|
|
|
|
if (GT_MP_PTP) {
|
|
|
@ -171,8 +172,8 @@ game_loop ()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
key_bomb = 0;
|
|
|
|
key_bomb = 0;
|
|
|
|
if (keys[SDLK_LSHIFT] || keys[SDLK_RSHIFT]) {
|
|
|
|
if ((keys[SDLK_LSHIFT] || keys[SDLK_RSHIFT]) && bman.players[bman.p_nr].special) {
|
|
|
|
d_printf ("not in use yet\n");
|
|
|
|
special_use (bman.p_nr);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (GT_MP_PTPM && keys[SDLK_F4] && event.type == SDL_KEYDOWN) {
|
|
|
|
else if (GT_MP_PTPM && keys[SDLK_F4] && event.type == SDL_KEYDOWN) {
|
|
|
|