fixed: playergfx overlapped the player name. if you selected no player you will see for you or anyone else who have no player a ghost player.

origin
stpohle 21 years ago
parent 0ff6bf3256
commit d86a085930

@ -1,4 +1,10 @@
$Id: ChangeLog,v 1.99 2005/03/28 18:20:18 stpohle Exp $
$Id: ChangeLog,v 1.100 2005/04/06 21:17:42 stpohle Exp $
Version 0.11.6.1
================
- Ghost Player added.
Version 0.11.6
==============

@ -5,7 +5,7 @@ dnl Please disable it in the Anjuta project configuration
AC_INIT(configure.in)
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE(bomberclone, 0.11.6)
AM_INIT_AUTOMAKE(bomberclone, 0.11.6.1)
AM_CONFIG_HEADER(config.h)

@ -1,4 +1,4 @@
/* $Id: gfx.h,v 1.8 2004/09/26 02:28:05 stpohle Exp $ */
/* $Id: gfx.h,v 1.9 2005/04/06 21:17:48 stpohle Exp $ */
#ifndef _GFX_H_
#define _GFX_H_
@ -60,6 +60,8 @@ struct __gfx {
_gfxani bomb; // bomb animation
_gfxani ill; // sick animation above the player
_gfxani dead; // load the dead player animation
SDL_Surface *ghost; // gfx of the ghost player.
SDL_Surface *ghost_small; // small ghost player
_gfxani respawn; // respawn image
_gfxani menuselect; // The Menu Select GFX (the bomb ?)

@ -1,4 +1,4 @@
/* $Id: game.c,v 1.107 2005/02/14 20:09:19 stpohle Exp $
/* $Id: game.c,v 1.108 2005/04/06 21:17:48 stpohle Exp $
game.c - procedures for the game. */
#include <string.h>
@ -629,8 +629,8 @@ void game_showresultteam (int pos_x, int pos_y, int pos_w, int pos_h) {
for (t_nr = 0; t_nr < t_count; t_nr++) {
sprintf (text, "%s Victorys %d (%d)", tdata[t_nr].team->name, tdata[t_nr].team->wins, tdata[t_nr].team->points);
sx = (pos_w - strlen (text) * font[0].size.x) / 2;
font_gfxdrawbold (pos_x + sx, pos_y + sy+3, text, 0, COLOR_brown, 1, 1);
font_gfxdraw (pos_x + sx, pos_y + sy+3, text, 0, COLOR_yellow, 2);
font_gfxdrawbold (10+ pos_x + sx, pos_y + sy+3, text, 0, COLOR_brown, 1, 1);
font_gfxdraw (10+ pos_x + sx, pos_y + sy+3, text, 0, COLOR_yellow, 2);
sy += SHOWRESULT_TEAMHEAD;
dx = pos_w / p_x;
sx = (dx - SHOWRESULT_TEAMPLAYERWIDTH)/2;
@ -651,8 +651,17 @@ void game_showresultteam (int pos_x, int pos_y, int pos_w, int pos_h) {
src.y = 0;
gfx_blit (tdata[t_nr].pl[p_nr]->gfx->small_image, &src, gfx.screen, &dest, 1);
}
else {
dest.x = pos_x + x;
dest.y = pos_y + sy;
src.w = dest.w = gfx.ghost_small->w;
src.h = dest.h = gfx.ghost_small->h;
src.x = 0;
src.y = 0;
gfx_blit (gfx.ghost_small, &src, gfx.screen, &dest, 1);
}
sprintf (text, "%s(%d/%d)", tdata[t_nr].pl[p_nr]->name, tdata[t_nr].pl[p_nr]->wins, tdata[t_nr].pl[p_nr]->points);
font_gfxdraw (pos_x + x + GFX_SMALLPLAYERIMGSIZE_X*2, pos_y + sy + 2, text, 0, 0, 2);
font_gfxdraw (10+ pos_x + x + GFX_SMALLPLAYERIMGSIZE_X*2, pos_y + sy + 2, text, 0, 0, 2);
x += dx;
col++;
}
@ -718,14 +727,14 @@ void game_showresultnormal (int pos_x, int pos_y, int pos_w, int pos_h) {
for (i = 1, p = 0; p < pl_cnt; p++) {
if (PS_IS_used (pl[p]->state)) {
if (PS_IS_alife (pl[p]->state)) {
font_gfxdrawbold (pos_x + x + GFX_MENUPLAYERIMGSIZE_X + 8, pos_y + y - 10, pl[p]->name, 0, COLOR_brown, 1, 1);
font_gfxdraw (pos_x + x + GFX_MENUPLAYERIMGSIZE_X + 8,pos_y + y - 10, pl[p]->name, 0, COLOR_yellow, 1);
font_gfxdrawbold (10+ pos_x + x + GFX_MENUPLAYERIMGSIZE_X + 8, pos_y + y - 10, pl[p]->name, 0, COLOR_brown, 1, 1);
font_gfxdraw (10+ pos_x + x + GFX_MENUPLAYERIMGSIZE_X + 8,pos_y + y - 10, pl[p]->name, 0, COLOR_yellow, 1);
}
else
font_gfxdraw (pos_x + x + GFX_MENUPLAYERIMGSIZE_X,pos_y + y - 10, pl[p]->name, 0, COLOR_gray, 1);
font_gfxdraw (10+ pos_x + x + GFX_MENUPLAYERIMGSIZE_X,pos_y + y - 10, pl[p]->name, 0, COLOR_gray, 1);
sprintf (text, "%3d (%3d)", pl[p]->wins, pl[p]->points);
font_gfxdraw (pos_x + x + GFX_MENUPLAYERIMGSIZE_X, pos_y + y + 6, text, 0, 0, 1);
font_gfxdraw (10+ pos_x + x + GFX_MENUPLAYERIMGSIZE_X, pos_y + y + 6, text, 0, 0, 1);
if (pl[p]->gfx != NULL) {
dest.x = pos_x + x;
@ -736,6 +745,15 @@ void game_showresultnormal (int pos_x, int pos_y, int pos_w, int pos_h) {
src.y = 0;
gfx_blit (pl[p]->gfx->menu_image, &src, gfx.screen, &dest, 1);
}
else {
dest.x = pos_x + x;
dest.y = pos_y + y - 16;
src.w = dest.w = gfx.ghost->w;
src.h = dest.h = gfx.ghost->h;
src.x = 0;
src.y = 0;
gfx_blit (gfx.ghost, &src, gfx.screen, &dest, 1);
}
/* setup the new position */
y += (dy / pl_x);
x += dx;

@ -1,4 +1,4 @@
/* $Id: gfx.c,v 1.38 2004/09/26 02:28:06 stpohle Exp $ */
/* $Id: gfx.c,v 1.39 2005/04/06 21:17:48 stpohle Exp $ */
/* gfx.c */
#include "bomberclone.h"
@ -333,6 +333,20 @@ static void gfx_load_menusmall_players () {
SDL_FreeSurface (img);
}
}
/* load the ghost player */
sprintf (filename, "%s/player/ghost.png", bman.datapath);
orgimg = IMG_Load (filename);
sfkt = (float)(((float)(GFX_MENUPLAYERIMGSIZE_X * 2)) / ((float)orgimg->h));
gfx.ghost = scale_image (orgimg, (int)(((float)orgimg->w)*sfkt), GFX_MENUPLAYERIMGSIZE_X * 2);
if (gfx.ghost == NULL) {
printf ("Can't load image: %s\n", SDL_GetError ());
exit (1);
}
sfkt = (float)(((float)(GFX_SMALLPLAYERIMGSIZE_X * 2)) / ((float)orgimg->h));
gfx.ghost_small = scale_image (orgimg, (int)(((float)orgimg->w)*sfkt), GFX_SMALLPLAYERIMGSIZE_X * 2);
SDL_FreeSurface (orgimg);
}
@ -484,6 +498,11 @@ gfx_shutdown ()
}
}
if (gfx.ghost != NULL)
SDL_FreeSurface (gfx.ghost);
if (gfx.ghost_small != NULL)
SDL_FreeSurface (gfx.ghost_small);
for (i = 0; i < FT_max; i++) if (gfx.menu_field[i] != NULL) {
SDL_FreeSurface (gfx.menu_field[i]);
gfx.menu_field[i] = NULL;

@ -151,8 +151,11 @@ do_joingame (struct pkg_joingame *p_jg, _net_addr * addr)
team_choose (pl);
}
strncpy (pl->name, p_jg->name, LEN_PLAYERNAME);
pl->gfx_nr = -1;
pl->gfx = NULL;
pl->gfx_nr = s_random (gfx.player_gfx_count);
while (pl->gfx_nr >= gfx.player_gfx_count) {
pl->gfx_nr -= gfx.player_gfx_count;
}
pl->gfx = &gfx.players[pl->gfx_nr];
pl->state &= (0xFF - (PSF_alife + PSF_playing));
/* Reset the network data */

Loading…
Cancel
Save