bugfix with more as 8 different playergraphics. Dedicated server mode removed

origin
stpohle 21 years ago
parent a98791b800
commit 473a92c692

@ -1,4 +1,13 @@
$Id: ChangeLog,v 1.103 2005/04/11 22:21:11 stpohle Exp $
$Id: ChangeLog,v 1.104 2005/07/06 13:11:51 stpohle Exp $
- Fixed: Bug with more as 8 diffrent player graphics.
The window size hasen't changed if there where more as
8 different player graphics to choose from.
- Removed the Dedicated Server Support from the game.
The whole bomberclone game is not desinged for a dedicated
server. The test shown that the whole game would have to
be rewritten. Also that the host can leave the game would
not work no more.
Version 0.11.6.2
- Client network player could die two times in a game.

@ -1,4 +1,4 @@
# Anjuta Version 1.2.2
# Anjuta Version 1.2.3
Compatibility Level: 1
<PROJECT_DESCRIPTION_START>
@ -39,7 +39,7 @@ echo "T $target H $host B $buid" >cross-target.txt
props.file.type=project
anjuta.version=1.2.2
anjuta.version=1.2.3
anjuta.compatibility.level=1
project.name=bomberclone

@ -1,4 +1,4 @@
/* $Id: basic.h,v 1.32 2005/04/10 00:22:16 stpohle Exp $ */
/* $Id: basic.h,v 1.33 2005/07/06 13:11:55 stpohle Exp $ */
/* basic types which we need everywhere */
#ifndef _BC_BASIC_H_
@ -80,7 +80,7 @@
#define UDP_TIMEOUT 15000
#define BUF_SIZE 1024
#define AUTOSTART 20 /* dedicated server autostart */
#define AUTOSTART 20 /* server autostart */
#define MW_IS_GFX_SELECT(__gfx_nr,__result) for (__result = (MAX_PLAYERS-1); (__result >= 0) && (players[__result].gfx_nr != __gfx_nr); __result--);

@ -1,4 +1,4 @@
/* $Id: bomberclone.h,v 1.33 2005/04/09 18:22:40 stpohle Exp $ */
/* $Id: bomberclone.h,v 1.34 2005/07/06 13:11:55 stpohle Exp $ */
/* bomberclone.h */
#ifndef _BOMBERCLONE_H_
@ -85,7 +85,6 @@ struct {
int firewall;
int notifygamemaster;
int broadcast;
int dedicated; // if started as dedicated server
int autostart; // time for an autostart of the game
int minplayers; // minimal number of players

@ -1,4 +1,4 @@
/* $Id: bomb.c,v 1.63 2005/04/09 18:22:40 stpohle Exp $ */
/* $Id: bomb.c,v 1.64 2005/07/06 13:11:55 stpohle Exp $ */
/* everything what have to do with the bombs */
#include "bomberclone.h"
@ -19,8 +19,6 @@ draw_bomb (_bomb * bomb)
y1,
y2;
if (bman.dedicated)
return;
if (x < 0 || y < 0 || x >= map.size.x || y >= map.size.y) {
d_printf ("FATAL: Draw Bomb out of range [%f,%f]\n", x, y);

@ -1,4 +1,4 @@
/* $Id: configuration.c,v 1.75 2005/04/10 00:22:17 stpohle Exp $
/* $Id: configuration.c,v 1.76 2005/07/06 13:11:55 stpohle Exp $
* configuration */
#include <SDL.h>
@ -21,29 +21,31 @@
* 2) ./data
* 3) ../data
*/
void config_get_datapath () {
FILE *f;
char filename[255];
void
config_get_datapath ()
{
FILE *f;
char filename[255];
sprintf (bman.datapath, PACKAGE_DATA_DIR);
sprintf (filename, "%s/gfx/logo.png", bman.datapath);
f = fopen (filename, "r");
if (!f) {
sprintf (bman.datapath, "data");
f = fopen (filename, "r");
if (!f) {
sprintf (bman.datapath, "data");
sprintf (filename, "%s/gfx/logo.png", bman.datapath);
f = fopen (filename, "r");
if (!f) {
sprintf (bman.datapath, "../data");
sprintf (filename, "%s/gfx/logo.png", bman.datapath);
f = fopen (filename, "r");
if (!f) {
printf ("Can't find Datafiles.\n");
exit (1);
}
sprintf (bman.datapath, "../data");
sprintf (filename, "%s/gfx/logo.png", bman.datapath);
f = fopen (filename, "r");
if (!f) {
printf ("Can't find Datafiles.\n");
exit (1);
}
}
}
fclose (f);
}
fclose (f);
}
@ -53,26 +55,28 @@ void config_get_datapath () {
void
config_init (int argc, char **argv)
{
SDL_Surface *icon_img;
char text[255], icon[255];
int i, j;
SDL_Surface *icon_img;
char text[255],
icon[255];
int i,
j;
config_get_datapath ();
config_get_datapath ();
srand (((int) time (NULL))); // initialize randomgenerator
for (i = 0; i < MAX_TEAMS; i++) {
teams[i].col = i;
sprintf (teams[i].name, "Team %d", i+1);
for (j = 0; j < MAX_PLAYERS; j++)
teams[i].players[j] = NULL;
}
for (i = 0; i < MAX_TEAMS; i++) {
teams[i].col = i;
sprintf (teams[i].name, "Team %d", i + 1);
for (j = 0; j < MAX_PLAYERS; j++)
teams[i].players[j] = NULL;
}
stonelist_del ();
chat.oldscreen = NULL;
chat.active = 0;
chat.oldscreen = NULL;
chat.active = 0;
chat.curline = 0;
keyb_config_reset ();
keyb_config_reset ();
keybinput_new (&chat.input, KEYBI_text, 255);
for (i = 0; i < CHAT_MAX_LINES; i++)
@ -81,28 +85,27 @@ config_init (int argc, char **argv)
bman.maxplayer = MAX_PLAYERS;
bman.net_ai_family = PF_INET;
bman.sock = -1;
bman.p_nr = -1;
bman.p2_nr = -1;
bman.p_nr = -1;
bman.p2_nr = -1;
bman.gamename[0] = 0;
sprintf (bman.playername, "Player1");
sprintf (bman.player2name, "Player2");
sprintf (bman.playername, "Player1");
sprintf (bman.player2name, "Player2");
sprintf (bman.port, "%d", DEFAULT_UDPPORT);
sprintf (bman.ogcserver, DEFAULT_GAMECACHE);
sprintf (bman.ogc_port, DEFAULT_GAMECACHEPORT);
resend_cache.data = NULL;
resend_cache.fill = -1;
bman.notifygamemaster = 1;
bman.broadcast = 1;
bman.dedicated = 0;
bman.autostart = AUTOSTART;
bman.broadcast = 1;
bman.autostart = AUTOSTART;
bman.askplayername = 0;
debug = 0;
gfx.res.x = 640;
gfx.res.y = 480;
gfx.bpp = 16;
gfx.players = NULL;
bman.password[0] = 0;
bman.passwordenabled = 0;
gfx.players = NULL;
bman.password[0] = 0;
bman.passwordenabled = 0;
map.tileset[0] = 0;
map.random_tileset = 1;
map.size.x = 25;
@ -113,7 +116,7 @@ config_init (int argc, char **argv)
bman.firewall = 0;
bman.init_timeout = GAME_TIMEOUT;
bman.ai_players = 1;
bman.minplayers = 0;
bman.minplayers = 0;
snd.inited = 0;
snd.audio_rate = 22050;
snd.audio_format = AUDIO_S16;
@ -129,52 +132,52 @@ config_init (int argc, char **argv)
map.sp_row = GAME_SPECIAL_ITEMSROW;
map.sp_push = GAME_SPECIAL_ITEMSPUSH;
map.sp_kick = GAME_SPECIAL_ITEMSKICK;
bman.start_bombs = START_BOMBS;
bman.start_speed = START_SPEED;
bman.start_range = START_RANGE;
bman.bomb_tickingtime = BOMB_TIMEOUT;
bman.dropitemsondeath = 0;
d_printf ("\n\n ***** Bomberclone Version %s \n\n", VERSION);
config_read ();
bman.start_bombs = START_BOMBS;
bman.start_speed = START_SPEED;
bman.start_range = START_RANGE;
bman.bomb_tickingtime = BOMB_TIMEOUT;
bman.dropitemsondeath = 0;
d_printf ("\n\n ***** Bomberclone Version %s \n\n", VERSION);
config_read ();
ReadPrgArgs (argc, argv);
gfx_init ();
gfx_init ();
draw_logo ();
if (bman.askplayername)
playernamemenu ();
if (bman.askplayername)
playernamemenu ();
snd_init ();
gfx_blitdraw ();
if (!bman.dedicated)
SDL_Flip (gfx.screen);
sprintf (text,"Bomberclone %s", VERSION);
sprintf (icon,"%s/pixmaps/bomberclone.png", bman.datapath);
SDL_WM_SetCaption(text , NULL);
icon_img = IMG_Load(icon);
if (icon_img == NULL)
d_printf ("could not load icon. (%s)\n", icon);
gfx_blitdraw ();
SDL_Flip (gfx.screen);
sprintf (text, "Bomberclone %s", VERSION);
sprintf (icon, "%s/pixmaps/bomberclone.png", bman.datapath);
SDL_WM_SetCaption (text, NULL);
icon_img = IMG_Load (icon);
if (icon_img == NULL)
d_printf ("could not load icon. (%s)\n", icon);
#ifdef _WIN32
{
SDL_Surface *tmp = icon_img;
icon_img = scale_image (tmp, 32, 32);
SDL_FreeSurface (tmp);
}
{
SDL_Surface *tmp = icon_img;
icon_img = scale_image (tmp, 32, 32);
SDL_FreeSurface (tmp);
}
#endif
SDL_WM_SetIcon (icon_img, NULL);
SDL_WM_SetIcon (icon_img, NULL);
ReadPrgArgs_Jump (argc, argv);
ReadPrgArgs_Jump (argc, argv);
};
/* read the configuration file
* return -1 if something went wrong and 0 if no problem */
int
config_read () {
config_read ()
{
FILE *config;
char buf[1024];
char *findit,
@ -372,61 +375,61 @@ config_read () {
if (!strcmp (keyword, "dropitemsondeath")) {
bman.dropitemsondeath = atoi (value);
}
for (i = 0; i < MAX_TEAMS; i++) {
char txt[255];
sprintf (txt,"teamcol%d", i);
if (!strcmp (keyword, txt)) {
teams[i].col = atoi (value);
}
sprintf (txt,"teamname%d", i);
if (!strcmp (keyword, txt)) {
strncpy (teams[i].name,value, LEN_PLAYERNAME);
}
}
/*
* keyboard config, i will give names to the keys insteed of the numbers,
* this is done to add more keys to the game without destroying the config.
*/
if (!strcmp (keyword, "key_p1_up"))
keyb_gamekeys.keycode[BCPK_up] = atoi (value);
if (!strcmp (keyword, "key_p1_down"))
keyb_gamekeys.keycode[BCPK_down] = atoi (value);
if (!strcmp (keyword, "key_p1_left"))
keyb_gamekeys.keycode[BCPK_left] = atoi (value);
if (!strcmp (keyword, "key_p1_right"))
keyb_gamekeys.keycode[BCPK_right] = atoi (value);
if (!strcmp (keyword, "key_p1_bomb"))
keyb_gamekeys.keycode[BCPK_drop] = atoi (value);
if (!strcmp (keyword, "key_p1_special"))
keyb_gamekeys.keycode[BCPK_special] = atoi (value);
if (!strcmp (keyword, "key_p2_up"))
keyb_gamekeys.keycode[BCPK_max + BCPK_up] = atoi (value);
if (!strcmp (keyword, "key_p2_down"))
keyb_gamekeys.keycode[BCPK_max + BCPK_down] = atoi (value);
if (!strcmp (keyword, "key_p2_left"))
keyb_gamekeys.keycode[BCPK_max + BCPK_left] = atoi (value);
if (!strcmp (keyword, "key_p2_right"))
keyb_gamekeys.keycode[BCPK_max + BCPK_right] = atoi (value);
if (!strcmp (keyword, "key_p2_bomb"))
keyb_gamekeys.keycode[BCPK_max + BCPK_drop] = atoi (value);
if (!strcmp (keyword, "key_p2_special"))
keyb_gamekeys.keycode[BCPK_max + BCPK_special] = atoi (value);
if (!strcmp (keyword, "key_help"))
keyb_gamekeys.keycode[BCK_help] = atoi (value);
if (!strcmp (keyword, "key_playermenu"))
keyb_gamekeys.keycode[BCK_playermenu] = atoi (value);
if (!strcmp (keyword, "key_mapmenu"))
keyb_gamekeys.keycode[BCK_mapmenu] = atoi (value);
if (!strcmp (keyword, "key_chat"))
keyb_gamekeys.keycode[BCK_chat] = atoi (value);
if (!strcmp (keyword, "key_pause"))
keyb_gamekeys.keycode[BCK_pause] = atoi (value);
if (!strcmp (keyword, "key_fullscreen"))
keyb_gamekeys.keycode[BCK_fullscreen] = atoi (value);
for (i = 0; i < MAX_TEAMS; i++) {
char txt[255];
sprintf (txt, "teamcol%d", i);
if (!strcmp (keyword, txt)) {
teams[i].col = atoi (value);
}
sprintf (txt, "teamname%d", i);
if (!strcmp (keyword, txt)) {
strncpy (teams[i].name, value, LEN_PLAYERNAME);
}
}
/*
* keyboard config, i will give names to the keys insteed of the numbers,
* this is done to add more keys to the game without destroying the config.
*/
if (!strcmp (keyword, "key_p1_up"))
keyb_gamekeys.keycode[BCPK_up] = atoi (value);
if (!strcmp (keyword, "key_p1_down"))
keyb_gamekeys.keycode[BCPK_down] = atoi (value);
if (!strcmp (keyword, "key_p1_left"))
keyb_gamekeys.keycode[BCPK_left] = atoi (value);
if (!strcmp (keyword, "key_p1_right"))
keyb_gamekeys.keycode[BCPK_right] = atoi (value);
if (!strcmp (keyword, "key_p1_bomb"))
keyb_gamekeys.keycode[BCPK_drop] = atoi (value);
if (!strcmp (keyword, "key_p1_special"))
keyb_gamekeys.keycode[BCPK_special] = atoi (value);
if (!strcmp (keyword, "key_p2_up"))
keyb_gamekeys.keycode[BCPK_max + BCPK_up] = atoi (value);
if (!strcmp (keyword, "key_p2_down"))
keyb_gamekeys.keycode[BCPK_max + BCPK_down] = atoi (value);
if (!strcmp (keyword, "key_p2_left"))
keyb_gamekeys.keycode[BCPK_max + BCPK_left] = atoi (value);
if (!strcmp (keyword, "key_p2_right"))
keyb_gamekeys.keycode[BCPK_max + BCPK_right] = atoi (value);
if (!strcmp (keyword, "key_p2_bomb"))
keyb_gamekeys.keycode[BCPK_max + BCPK_drop] = atoi (value);
if (!strcmp (keyword, "key_p2_special"))
keyb_gamekeys.keycode[BCPK_max + BCPK_special] = atoi (value);
if (!strcmp (keyword, "key_help"))
keyb_gamekeys.keycode[BCK_help] = atoi (value);
if (!strcmp (keyword, "key_playermenu"))
keyb_gamekeys.keycode[BCK_playermenu] = atoi (value);
if (!strcmp (keyword, "key_mapmenu"))
keyb_gamekeys.keycode[BCK_mapmenu] = atoi (value);
if (!strcmp (keyword, "key_chat"))
keyb_gamekeys.keycode[BCK_chat] = atoi (value);
if (!strcmp (keyword, "key_pause"))
keyb_gamekeys.keycode[BCK_pause] = atoi (value);
if (!strcmp (keyword, "key_fullscreen"))
keyb_gamekeys.keycode[BCK_fullscreen] = atoi (value);
}
fclose (config);
return 0;
@ -437,9 +440,9 @@ int
config_write ()
{
FILE *config;
int i;
int i;
char filename[512];
#ifdef _WIN32
sprintf (filename, "%sbomberclone.cfg", s_gethomedir ());
#else
@ -466,8 +469,8 @@ config_write ()
fprintf (config, "gametype=%d\n", bman.gametype);
fprintf (config, "maxplayer=%d\n", bman.maxplayer);
fprintf (config, "debug=%d\n", debug);
fprintf (config, "password=%s\n", bman.password);
fprintf (config, "passwordenabled=%d\n", bman.passwordenabled);
fprintf (config, "password=%s\n", bman.password);
fprintf (config, "passwordenabled=%d\n", bman.passwordenabled);
fprintf (config, "askplayername=%d\n", bman.askplayername);
fprintf (config, "playername=%s\n", bman.playername);
fprintf (config, "player2name=%s\n", bman.player2name);
@ -479,38 +482,38 @@ config_write ()
fprintf (config, "sndformat=%d\n", snd.audio_format);
fprintf (config, "sndplaymusic=%d\n", snd.playmusic);
fprintf (config, "sndplaysound=%d\n", snd.playsound);
fprintf (config, "start_bombs=%d\n", bman.start_bombs);
fprintf (config, "start_range=%d\n", bman.start_range);
fprintf (config, "start_speed=%f\n", bman.start_speed);
fprintf (config, "bomb_ticking=%f\n", bman.bomb_tickingtime);
for (i = 0; i < MAX_TEAMS; i++) {
fprintf (config, "teamcol%d=%d\n", i, teams[i].col);
fprintf (config, "teamname%d=%s\n", i, teams[i].name);
}
fprintf (config, "start_bombs=%d\n", bman.start_bombs);
fprintf (config, "start_range=%d\n", bman.start_range);
fprintf (config, "start_speed=%f\n", bman.start_speed);
fprintf (config, "bomb_ticking=%f\n", bman.bomb_tickingtime);
for (i = 0; i < MAX_TEAMS; i++) {
fprintf (config, "teamcol%d=%d\n", i, teams[i].col);
fprintf (config, "teamname%d=%s\n", i, teams[i].name);
}
/*
* keyboard config
*/
fprintf (config, "key_p1_up=%d\n", keyb_gamekeys.keycode[BCPK_up]);
fprintf (config, "key_p1_down=%d\n", keyb_gamekeys.keycode[BCPK_down]);
fprintf (config, "key_p1_left=%d\n", keyb_gamekeys.keycode[BCPK_left]);
fprintf (config, "key_p1_right=%d\n", keyb_gamekeys.keycode[BCPK_right]);
fprintf (config, "key_p1_bomb=%d\n", keyb_gamekeys.keycode[BCPK_drop]);
fprintf (config, "key_p1_special=%d\n", keyb_gamekeys.keycode[BCPK_special]);
fprintf (config, "key_p2_up=%d\n", keyb_gamekeys.keycode[BCPK_max + BCPK_up]);
fprintf (config, "key_p2_down=%d\n", keyb_gamekeys.keycode[BCPK_max + BCPK_down]);
fprintf (config, "key_p2_left=%d\n", keyb_gamekeys.keycode[BCPK_max + BCPK_left]);
fprintf (config, "key_p2_right=%d\n", keyb_gamekeys.keycode[BCPK_max + BCPK_right]);
fprintf (config, "key_p2_bomb=%d\n", keyb_gamekeys.keycode[BCPK_max + BCPK_drop]);
fprintf (config, "key_p2_special=%d\n", keyb_gamekeys.keycode[BCPK_max + BCPK_special]);
fprintf (config, "key_help=%d\n", keyb_gamekeys.keycode[BCK_help]);
fprintf (config, "key_fullscreen=%d\n", keyb_gamekeys.keycode[BCK_fullscreen]);
fprintf (config, "key_chat=%d\n", keyb_gamekeys.keycode[BCK_chat]);
fprintf (config, "key_mapmenu=%d\n", keyb_gamekeys.keycode[BCK_mapmenu]);
fprintf (config, "key_pause=%d\n", keyb_gamekeys.keycode[BCK_pause]);
fprintf (config, "key_playermenu=%d\n", keyb_gamekeys.keycode[BCK_playermenu]);
/*
* keyboard config
*/
fprintf (config, "key_p1_up=%d\n", keyb_gamekeys.keycode[BCPK_up]);
fprintf (config, "key_p1_down=%d\n", keyb_gamekeys.keycode[BCPK_down]);
fprintf (config, "key_p1_left=%d\n", keyb_gamekeys.keycode[BCPK_left]);
fprintf (config, "key_p1_right=%d\n", keyb_gamekeys.keycode[BCPK_right]);
fprintf (config, "key_p1_bomb=%d\n", keyb_gamekeys.keycode[BCPK_drop]);
fprintf (config, "key_p1_special=%d\n", keyb_gamekeys.keycode[BCPK_special]);
fprintf (config, "key_p2_up=%d\n", keyb_gamekeys.keycode[BCPK_max + BCPK_up]);
fprintf (config, "key_p2_down=%d\n", keyb_gamekeys.keycode[BCPK_max + BCPK_down]);
fprintf (config, "key_p2_left=%d\n", keyb_gamekeys.keycode[BCPK_max + BCPK_left]);
fprintf (config, "key_p2_right=%d\n", keyb_gamekeys.keycode[BCPK_max + BCPK_right]);
fprintf (config, "key_p2_bomb=%d\n", keyb_gamekeys.keycode[BCPK_max + BCPK_drop]);
fprintf (config, "key_p2_special=%d\n", keyb_gamekeys.keycode[BCPK_max + BCPK_special]);
fprintf (config, "key_help=%d\n", keyb_gamekeys.keycode[BCK_help]);
fprintf (config, "key_fullscreen=%d\n", keyb_gamekeys.keycode[BCK_fullscreen]);
fprintf (config, "key_chat=%d\n", keyb_gamekeys.keycode[BCK_chat]);
fprintf (config, "key_mapmenu=%d\n", keyb_gamekeys.keycode[BCK_mapmenu]);
fprintf (config, "key_pause=%d\n", keyb_gamekeys.keycode[BCK_pause]);
fprintf (config, "key_playermenu=%d\n", keyb_gamekeys.keycode[BCK_playermenu]);
fclose (config);
return 0;
}
@ -540,8 +543,8 @@ config_video ()
_charlist *selbpp = NULL;
char text[100];
_menu *menu;
_menu *menu;
/* set all pointers in this array */
charlist_fillarraypointer (screenres, 5);
charlist_fillarraypointer (screenbpp, 3);
@ -576,14 +579,14 @@ config_video ()
gfx.res.y = y;
gfx_init ();
draw_logo ();
break;
break;
case (2): // new color depth
gfx_shutdown ();
sscanf (selbpp->text, "%d", &x);
gfx.bpp = x;
gfx_init ();
draw_logo ();
break;
draw_logo ();
break;
default:
done = 1;
break;
@ -602,8 +605,8 @@ void
config_menu ()
{
int menuselect = 0;
_menu *menu;
_menu *menu;
while (menuselect != -1 && bman.state != GS_quit) {
menu = menu_new ("Configuration", 400, 300);
menu_create_label (menu, "General Option", -1, 50, 1, COLOR_brown);
@ -634,13 +637,13 @@ config_menu ()
else
menuselect = -1;
break;
case (1): // player screen
playernamemenu ();
break;
case (2): // keyboard settings
keyb_config ();
break;
case (3): // Screen Options
case (1): // player screen
playernamemenu ();
break;
case (2): // keyboard settings
keyb_config ();
break;
case (3): // Screen Options
config_video ();
break;
}
@ -665,18 +668,17 @@ ReadPrgArgs (int argc, char **argv)
printf ("\nProgramm options:\n");
printf (" -name PLAYERNAME - set the Playername\n");
printf (" -name2 PLAYERNAME - set the Playername for the second player\n");
printf (" -gamename GAMENAME - set the name of the game\n");
printf (" -gamename GAMENAME - set the name of the game\n");
printf (" -port PORT - set the local BomberClone port\n");
printf (" (Def.: 11000)\n");
printf (" (Def.: 11000)\n");
printf (" -ogcport PORT - set the local OGC Port (Def.: 11100)\n");
printf (" -ogc 0/1 - Enable/Disable OGC\n");
printf (" -broadcast 0/1 - Enable/Disable broadcast requests.\n");
printf (" -host - start a network game\n");
printf (" -join - go into the join menu\n");
printf (" -connect ADDRESS - connect to a server\n");
printf (" -debug 0/1 - enable/disable debug\n");
printf (" -dedicated - run as dedicated server\n");
printf (" -autostart SECONDS - time before a game starts\n");
printf (" -broadcast 0/1 - Enable/Disable broadcast requests.\n");
printf (" -host - start a network game\n");
printf (" -join - go into the join menu\n");
printf (" -connect ADDRESS - connect to a server\n");
printf (" -debug 0/1 - enable/disable debug\n");
printf (" -autostart SECONDS - time before a game starts\n");
exit (0);
}
if (!strcmp (argv[i], "-port"))
@ -686,24 +688,18 @@ ReadPrgArgs (int argc, char **argv)
if (!strcmp (argv[i], "-name"))
strncpy (bman.playername, argv[++i], LEN_PLAYERNAME);
if (!strcmp (argv[i], "-name2"))
strncpy (bman.player2name, argv[++i], LEN_PLAYERNAME);
if (!strcmp (argv[i], "-gamename"))
strncpy (bman.gamename, argv[++i], LEN_GAMENAME);
strncpy (bman.player2name, argv[++i], LEN_PLAYERNAME);
if (!strcmp (argv[i], "-gamename"))
strncpy (bman.gamename, argv[++i], LEN_GAMENAME);
if (!strcmp (argv[i], "-ogc"))
bman.notifygamemaster = atoi (argv[++i]);
if (!strcmp (argv[i], "-broadcast"))
bman.broadcast = atoi (argv[++i]);
if (!strcmp (argv[i], "-debug"))
debug = atoi (argv[++i]);
if (!strcmp (argv[i], "-dedicated")) {
if (bman.minplayers <= 1)
bman.minplayers = 2;
bman.dedicated = 1;
printf ("\nDedicated Bomberclone Server - Version " VERSION "\n\n");
if (!strcmp (argv[i], "-autostart"))
bman.autostart = atoi (argv[++i]);
}
if (!strcmp (argv[i], "-autostart"))
bman.autostart = atoi (argv[++i]);
}
};
@ -715,43 +711,45 @@ ReadPrgArgs_Jump (int argc, char **argv)
int i = 0;
while (argv[++i] != NULL) {
/* check for commands which will put us into a certain menu */
if (!strcmp (argv[i], "-host")) {
host_multiplayer_game ();
}
else if (!strcmp (argv[i], "-join")) {
join_multiplayer_game ();
}
else if (!strcmp (argv[i], "-connect")) {
strncpy (bman.servername, argv[++i], LEN_SERVERNAME + LEN_PORT + 2);
join_multiplayer_game ();
}
}
if (bman.dedicated > 0)
host_multiplayer_game ();
/* check for commands which will put us into a certain menu */
if (!strcmp (argv[i], "-host")) {
host_multiplayer_game ();
}
else if (!strcmp (argv[i], "-join")) {
join_multiplayer_game ();
}
else if (!strcmp (argv[i], "-connect")) {
strncpy (bman.servername, argv[++i], LEN_SERVERNAME + LEN_PORT + 2);
join_multiplayer_game ();
}
}
};
/* check the version number, return [ 0 =] [-1 <] [ 1 >] */
int check_version (int ma, int mi, int su, char *ver) {
int v1, v2, v3, res = 0;
sscanf (ver, "%d.%d.%d", &v1, &v2, &v3);
if (v1 < ma)
res = -1;
else if (v1 > ma)
res = 1;
else if (v2 < mi)
res = -1;
else if (v2 > mi)
res = 1;
else if (v3 < su)
res = -1;
else if (v3 > su)
res = 1;
// d_printf ("version_check (%d.%d.%d, %s = %d\n" , ma, mi, su, ver, res);
return res;
int
check_version (int ma, int mi, int su, char *ver)
{
int v1,
v2,
v3,
res = 0;
sscanf (ver, "%d.%d.%d", &v1, &v2, &v3);
if (v1 < ma)
res = -1;
else if (v1 > ma)
res = 1;
else if (v2 < mi)
res = -1;
else if (v2 > mi)
res = 1;
else if (v3 < su)
res = -1;
else if (v3 > su)
res = 1;
// d_printf ("version_check (%d.%d.%d, %s = %d\n" , ma, mi, su, ver, res);
return res;
};

@ -1,4 +1,4 @@
/* $Id: font.c,v 1.15 2005/04/09 18:22:40 stpohle Exp $ */
/* $Id: font.c,v 1.16 2005/07/06 13:11:55 stpohle Exp $ */
// Using Fonts in SDL
#include <string.h>
@ -127,22 +127,17 @@ void font_load () {
break;
}
if (!bman.dedicated) {
font[i].image[c] = SDL_DisplayFormat (tmp);
SDL_SetColorKey (font[i].image[c] , SDL_SRCCOLORKEY, SDL_MapRGB (font[i].image[c]->format, 0,0,0));
SDL_FillRect (font[i].image[c], NULL, SDL_MapRGB (font[i].image[c]->format, r,g,b));
SDL_BlitSurface (raw, NULL, font[i].image[c], NULL);
}
else
font[i].image[c] = tmp;
font[i].image[c] = SDL_DisplayFormat (tmp);
SDL_SetColorKey (font[i].image[c] , SDL_SRCCOLORKEY, SDL_MapRGB (font[i].image[c]->format, 0,0,0));
SDL_FillRect (font[i].image[c], NULL, SDL_MapRGB (font[i].image[c]->format, r,g,b));
SDL_BlitSurface (raw, NULL, font[i].image[c], NULL);
}
font[i].size.x = tmp->w / 16;
font[i].size.y = tmp->h / 16;
SDL_FreeSurface (raw);
if (!bman.dedicated)
SDL_FreeSurface (tmp);
SDL_FreeSurface (tmp);
}
};

File diff suppressed because it is too large Load Diff

@ -1,4 +1,4 @@
/* $Id: gfx.c,v 1.40 2005/04/09 18:22:40 stpohle Exp $ */
/* $Id: gfx.c,v 1.41 2005/07/06 13:11:55 stpohle Exp $ */
/* gfx.c */
#include "bomberclone.h"
@ -26,7 +26,7 @@ int gfx_get_nr_of_playergfx () {
sprintf (filename, "%s/player/player%d.png", bman.datapath, i);
f = fopen (filename, "r");
} while (f);
return i;
}
@ -66,23 +66,16 @@ gfx_load_players (int sx, int sy)
gfx.players[i].ani.w = (tmpimage->w / 4) * sfkt;
gfx.players[i].ani.frames = tmpimage->h / GFX_PLAYERIMGSIZE_Y;
if (!bman.dedicated) {
tmpimage1 =
scale_image (tmpimage, gfx.players[i].ani.w * 4,
gfx.players[i].ani.frames * gfx.players[i].ani.h);
getRGBpixel (tmpimage1, 0, 0, &r, &g, &b);
SDL_SetColorKey (tmpimage1, SDL_SRCCOLORKEY, SDL_MapRGB (tmpimage1->format, r, g, b));
gfx.players[i].ani.image = SDL_DisplayFormat (tmpimage1);
SDL_FreeSurface (tmpimage1);
/* calculate the numbers of images for the animation */
gfx.players[i].offset.x = (sx - gfx.players[i].ani.w) / 2;
gfx.players[i].offset.y = -sy;
}
else
gfx.players[i].ani.image = NULL;
SDL_FreeSurface (tmpimage);
tmpimage1 = scale_image (tmpimage, gfx.players[i].ani.w * 4, gfx.players[i].ani.frames * gfx.players[i].ani.h);
getRGBpixel (tmpimage1, 0, 0, &r, &g, &b);
SDL_SetColorKey (tmpimage1, SDL_SRCCOLORKEY, SDL_MapRGB (tmpimage1->format, r, g, b));
gfx.players[i].ani.image = SDL_DisplayFormat (tmpimage1);
SDL_FreeSurface (tmpimage1);
/* calculate the numbers of images for the animation */
gfx.players[i].offset.x = (sx - gfx.players[i].ani.w) / 2;
gfx.players[i].offset.y = -sy;
SDL_FreeSurface (tmpimage);
}
}
@ -96,48 +89,38 @@ gfx_load_players (int sx, int sy)
}
gfx.dead.frames = tmpimage->h / (2* GFX_IMGSIZE);
if (!bman.dedicated) {
tmpimage1 =
scale_image (tmpimage, ((2 * sx * tmpimage->w) / (2 * GFX_IMGSIZE)),
gfx.dead.frames * (2 * sy));
getRGBpixel (tmpimage1, 0, 0, &r, &g, &b);
SDL_SetColorKey (tmpimage1, SDL_SRCCOLORKEY, SDL_MapRGB (tmpimage1->format, r, g, b));
gfx.dead.image = SDL_DisplayFormat (tmpimage1);
SDL_FreeSurface (tmpimage1);
SDL_FreeSurface (tmpimage);
/* load the illnessthing */
sprintf (filename, "%s/player/playersick.png", bman.datapath);
tmpimage = IMG_Load (filename);
if (tmpimage == NULL) {
printf ("Can't load image: %s\n", SDL_GetError ());
exit (1);
}
gfx.ill.frames = tmpimage->h / (2 * GFX_IMGSIZE);
tmpimage1 =
scale_image (tmpimage, (2 * sx * tmpimage->w) / (2 * GFX_IMGSIZE),
gfx.ill.frames * (2 * sy));
getRGBpixel (tmpimage1, 0, 0, &r, &g, &b);
SDL_SetColorKey (tmpimage1, SDL_SRCCOLORKEY, SDL_MapRGB (tmpimage1->format, r, g, b));
gfx.ill.image = SDL_DisplayFormat (tmpimage1);
SDL_FreeSurface (tmpimage);
SDL_FreeSurface (tmpimage1);
/* load the respawn gfx */
sprintf (filename, "%s/player/respawn.png", bman.datapath);
tmpimage = IMG_Load (filename);
if (tmpimage == NULL) {
printf ("Can't load image: %s\n", SDL_GetError ());
exit (1);
}
gfx.respawn.frames = tmpimage->h / (2 * GFX_IMGSIZE);
gfx.respawn.image =
scale_image (tmpimage, (2 * sx * tmpimage->w) / (2 * GFX_IMGSIZE),
gfx.respawn.frames * (2 * sy));
SDL_FreeSurface (tmpimage);
}
else
SDL_FreeSurface (tmpimage);
tmpimage1 = scale_image (tmpimage, ((2 * sx * tmpimage->w) / (2 * GFX_IMGSIZE)), gfx.dead.frames * (2 * sy));
getRGBpixel (tmpimage1, 0, 0, &r, &g, &b);
SDL_SetColorKey (tmpimage1, SDL_SRCCOLORKEY, SDL_MapRGB (tmpimage1->format, r, g, b));
gfx.dead.image = SDL_DisplayFormat (tmpimage1);
SDL_FreeSurface (tmpimage1);
SDL_FreeSurface (tmpimage);
/* load the illnessthing */
sprintf (filename, "%s/player/playersick.png", bman.datapath);
tmpimage = IMG_Load (filename);
if (tmpimage == NULL) {
printf ("Can't load image: %s\n", SDL_GetError ());
exit (1);
}
gfx.ill.frames = tmpimage->h / (2 * GFX_IMGSIZE);
tmpimage1 = scale_image (tmpimage, (2 * sx * tmpimage->w) / (2 * GFX_IMGSIZE), gfx.ill.frames * (2 * sy));
getRGBpixel (tmpimage1, 0, 0, &r, &g, &b);
SDL_SetColorKey (tmpimage1, SDL_SRCCOLORKEY, SDL_MapRGB (tmpimage1->format, r, g, b));
gfx.ill.image = SDL_DisplayFormat (tmpimage1);
SDL_FreeSurface (tmpimage);
SDL_FreeSurface (tmpimage1);
/* load the respawn gfx */
sprintf (filename, "%s/player/respawn.png", bman.datapath);
tmpimage = IMG_Load (filename);
if (tmpimage == NULL) {
printf ("Can't load image: %s\n", SDL_GetError ());
exit (1);
}
gfx.respawn.frames = tmpimage->h / (2 * GFX_IMGSIZE);
gfx.respawn.image = scale_image (tmpimage, (2 * sx * tmpimage->w) / (2 * GFX_IMGSIZE), gfx.respawn.frames * (2 * sy));
SDL_FreeSurface (tmpimage);
};
@ -146,8 +129,8 @@ void
gfx_free_players ()
{
int i;
d_printf ("gfx_free_players\n");
d_printf ("gfx_free_players\n");
for (i = 0; i < gfx.player_gfx_count; i++) {
if (gfx.players[i].ani.image != NULL)
@ -170,22 +153,15 @@ gfx_init ()
{
int i;
if (gfx.fullscreen && !bman.dedicated)
gfx.screen =
SDL_SetVideoMode (gfx.res.x, gfx.res.y, gfx.bpp,
SDL_SWSURFACE | SDL_DOUBLEBUF | SDL_HWACCEL | SDL_FULLSCREEN);
if (gfx.fullscreen)
gfx.screen = SDL_SetVideoMode (gfx.res.x, gfx.res.y, gfx.bpp, SDL_SWSURFACE | SDL_DOUBLEBUF | SDL_HWACCEL | SDL_FULLSCREEN);
else if (!bman.dedicated)
gfx.screen =
SDL_SetVideoMode (gfx.res.x, gfx.res.y, gfx.bpp,
SDL_SWSURFACE | SDL_DOUBLEBUF | SDL_HWACCEL);
if (!bman.dedicated && gfx.screen == NULL) {
else
gfx.screen = SDL_SetVideoMode (gfx.res.x, gfx.res.y, gfx.bpp, SDL_SWSURFACE | SDL_DOUBLEBUF | SDL_HWACCEL);
if (gfx.screen == NULL) {
d_printf ("Unable to set video mode: %s\n", SDL_GetError ());
return;
}
else if (bman.dedicated) {
gfx.screen = NULL;
}
SDL_ShowCursor (SDL_DISABLE);
/* delete small gfx und the menu player gfx */
@ -532,14 +508,13 @@ draw_logo ()
{
SDL_Rect dest;
if (bman.dedicated) return;
dest.x = dest.y = 0;
dest.w = gfx.res.x;
dest.h = gfx.res.y;
SDL_BlitSurface (gfx.logo, NULL, gfx.screen, NULL);
gfx_blitupdaterectadd (&dest);
SDL_BlitSurface (gfx.logo, NULL, gfx.screen, NULL);
gfx_blitupdaterectadd (&dest);
};

@ -1,4 +1,4 @@
/* $Id: gfxengine.c,v 1.6 2005/04/09 18:22:41 stpohle Exp $ */
/* $Id: gfxengine.c,v 1.7 2005/07/06 13:11:55 stpohle Exp $ */
/* GFX Game Engine */
#include "bomberclone.h"
@ -103,7 +103,7 @@ gfx_blitdraw ()
{
int i;
if (blitdb_nr < 0 || bman.dedicated) {
if (blitdb_nr < 0) {
blitdb_nr = 0;
return;
}
@ -111,7 +111,7 @@ gfx_blitdraw ()
gfx_blitsort ();
for (i = 0; i < MAX_BLITRECTS && sortblitdb[i] != NULL; i++) {
SDL_BlitSurface (sortblitdb[i]->srci, &sortblitdb[i]->srcr, sortblitdb[i]->desti, &sortblitdb[i]->destr);
SDL_BlitSurface (sortblitdb[i]->srci, &sortblitdb[i]->srcr, sortblitdb[i]->desti, &sortblitdb[i]->destr);
gfx_blitupdaterectadd (&sortblitdb[i]->destr);
}

@ -1,4 +1,4 @@
/* $Id: main.c,v 1.31 2005/04/09 18:22:41 stpohle Exp $ */
/* $Id: main.c,v 1.32 2005/07/06 13:11:55 stpohle Exp $ */
#include "basic.h"
#include "bomberclone.h"
@ -42,7 +42,7 @@ main (int argc, char **argv)
config_init (argc, argv);
while (menuselect != -1 && bman.state != GS_quit && bman.dedicated == 0) {
while (menuselect != -1 && bman.state != GS_quit) {
menu = menu_new ("Bomberclone", 400, 250); // y=230
menu_create_button (menu, "Single Game", -1, 70, 200, 0);

@ -1,4 +1,4 @@
/* $Id: multiwait.c,v 1.55 2005/04/09 18:22:41 stpohle Exp $
/* $Id: multiwait.c,v 1.56 2005/07/06 13:11:55 stpohle Exp $
multiwait.c - this manages only the network screen where
everyone have to select it's players and where even the basic chat is inside
*/
@ -33,30 +33,24 @@ extern int blitdb_nr;
static void mw_init ()
{
team_update ();
if (!bman.dedicated) {
gfx_blitdraw ();
draw_logo ();
gfx_blitdraw ();
}
bman.updatestatusbar = 1;
gfx_blitdraw ();
draw_logo ();
gfx_blitdraw ();
bman.updatestatusbar = 1;
d_playerdetail ("mw_init:\n");
if (!bman.dedicated) {
SDL_Flip (gfx.screen);
chat_show (10, gfx.res.y / 2, gfx.res.x - 20, gfx.res.y / 2 - 10);
chat_setactive (1, 1);
}
SDL_Flip (gfx.screen);
chat_show (10, gfx.res.y / 2, gfx.res.x - 20, gfx.res.y / 2 - 10);
chat_setactive (1, 1);
};
/* free all graphics */
static void mw_shutdown () {
if (!bman.dedicated) {
chat_show (-1, -1, -1, -1);
gfx_blitdraw ();
draw_logo ();
chat_show (-1, -1, -1, -1);
gfx_blitdraw ();
draw_logo ();
SDL_Flip (gfx.screen);
}
SDL_Flip (gfx.screen);
};
@ -241,50 +235,25 @@ void wait_for_players () {
/*
* the drawing stuff
*/
if (!bman.dedicated) {
if (mw_check_screenredraw()) {
d_printf ("Draw Status\n");
gfx_blitdraw ();
draw_logo ();
if (bman.gametype==GT_team) mw_draw_all_teams();
else mw_draw_all_player ();
}
if (mw_check_screenredraw()) {
d_printf ("Draw Status\n");
gfx_blitdraw ();
/*
* input handling
*/
keyb_loop (&event);
mw_keys_loop ();
chat_loop (&event);
chat.active = 1;
}
else {
/* check for the minimum of players */
for (humanpl_cnt = 0, i = 0, cnt = 0, aipl = -1; i < MAX_PLAYERS; i++) {
if (PS_IS_used (players[i].state)) {
cnt++;
if (PS_IS_aiplayer (players[i].state))
aipl = i;
else if (players[i].gfx_nr >= 0)
humanpl_cnt++;
}
}
if (cnt < (bman.minplayers+1))
single_create_ai (1);
if (cnt > (bman.minplayers+1) && aipl >= 0)
player_delete (aipl);
draw_logo ();
if (bman.gametype==GT_team) mw_draw_all_teams();
else mw_draw_all_player ();
}
gfx_blitdraw ();
s_calctimesync ();
if ((bman.autostart > 0) && (timestamp > timeout_timestamp) && bman.dedicated && humanpl_cnt > 0)
bman.state = GS_ready;
/*
* input handling
*/
keyb_loop (&event);
mw_keys_loop ();
chat_loop (&event);
chat.active = 1;
s_calctimesync ();
} while (bman.state == GS_wait && bman.sock != -1);
mw_shutdown ();

@ -1,4 +1,4 @@
/* $Id: network.c,v 1.74 2005/04/10 00:22:17 stpohle Exp $ */
/* $Id: network.c,v 1.75 2005/07/06 13:11:56 stpohle Exp $ */
/*
network routines.
*/
@ -477,14 +477,12 @@ net_transmit_gamedata ()
Uint8 *keys;
Uint32 downtimestamp = 0;
if (!bman.dedicated) {
draw_logo ();
draw_logo ();
if (GT_MP_PTPM)
font_draw (100, 0, "Waiting for the Clients", 1, 0);
else
font_draw (100, 0, "Downloading Data", 1, 0);
}
if (GT_MP_PTPM)
font_draw (100, 0, "Waiting for the Clients", 1, 0);
else
font_draw (100, 0, "Downloading Data", 1, 0);
/*
prepare everything for the loop
@ -505,10 +503,8 @@ net_transmit_gamedata ()
else
net_istep = 3;
if (!bman.dedicated) {
draw_netupdatestate (1);
SDL_Flip (gfx.screen);
}
draw_netupdatestate (1);
SDL_Flip (gfx.screen);
downtimestamp = timestamp;
while (!done && (bman.state == GS_update || (GT_MP_PTPS && net_istep != 0))) {
@ -617,40 +613,37 @@ net_transmit_gamedata ()
}
/* do the grafik work */
if (!bman.dedicated) {
draw_netupdatestate (0);
if (SDL_PollEvent (&event) != 0)
switch (event.type) {
case (SDL_QUIT):
bman.state = GS_quit;
bman.p_nr = -1;
done = 1;
}
draw_netupdatestate (0);
keys = SDL_GetKeyState (NULL);
if (keys[SDLK_ESCAPE] && event.type == SDL_KEYDOWN) {
done = 1;
if (SDL_PollEvent (&event) != 0)
switch (event.type) {
case (SDL_QUIT):
bman.state = GS_quit;
bman.p_nr = -1;
keypressed = 1;
bman.state = GS_startup;
done = 1;
}
if (event.type == SDL_KEYUP)
keypressed = 0;
}
timestamp = SDL_GetTicks (); // needed for time sync.
SDL_Delay (1); // we don't need here anything better
keys = SDL_GetKeyState (NULL);
/* player is only watching so just go after we have got everything
go to show the field */
if (GT_MP_PTPS && bman.state == GS_update && net_istep == 0
&& players[bman.p_nr].gfx_nr == -1) {
if (keys[SDLK_ESCAPE] && event.type == SDL_KEYDOWN) {
done = 1;
bman.state = GS_running;
bman.p_nr = -1;
keypressed = 1;
bman.state = GS_startup;
}
if (event.type == SDL_KEYUP)
keypressed = 0;
}
timestamp = SDL_GetTicks (); // needed for time sync.
SDL_Delay (1); // we don't need here anything better
/* player is only watching so just go after we have got everything
go to show the field */
if (GT_MP_PTPS && bman.state == GS_update && net_istep == 0 && players[bman.p_nr].gfx_nr == -1) {
done = 1;
bman.state = GS_running;
}
};

@ -1,4 +1,4 @@
/* $Id: player.c,v 1.101 2005/04/11 22:21:14 stpohle Exp $
/* $Id: player.c,v 1.102 2005/07/06 13:11:56 stpohle Exp $
* player.c - everything what have to do with the player */
#include <SDL.h>
@ -17,9 +17,6 @@ draw_player (_player * player)
SDL_Rect src,
dest;
int i;
if (bman.dedicated)
return;
if ((int)player->pos.x < 0 || (int)player->pos.x >= map.size.x ||
(int)player->pos.y < 0 || (int)player->pos.y >= map.size.y) {
@ -582,8 +579,6 @@ draw_players ()
{
int p;
if (bman.dedicated) return;
for (p = 0; p < MAX_PLAYERS; p++) {
if (PS_IS_playing (players[p].state) && players[p].tunnelto <= 0)
draw_player (&players[p]);

@ -1,4 +1,4 @@
/* $Id: playermenu.c,v 1.16 2004/12/26 04:19:20 stpohle Exp $
/* $Id: playermenu.c,v 1.17 2005/07/06 13:11:56 stpohle Exp $
*/
#include "bomberclone.h"
@ -28,7 +28,9 @@ static void playermenu_selgfx_drawplayer (int selgfx, _menu *menu) {
static int changed = 0;
SDL_Rect rect, srcrect;
int i;
int i_start;
int i_end;
/*
* delete old state, to force an update of all playergfx
*/
@ -50,26 +52,36 @@ static void playermenu_selgfx_drawplayer (int selgfx, _menu *menu) {
rect.h = 4 * GFX_IMGSIZE;
menu_draw_background (menu, &rect);
for (i = 0; i < gfx.player_gfx_count; i++) {
srcrect.h = rect.h = gfx.players[i].menu_image->h;
srcrect.w = rect.w = gfx.players[i].menu_image->w;
/* calculate the first element on the screen */
if (gfx.player_gfx_count < 12 || selgfx < 4) i_start = 0;
else {
i_start = (((selgfx / 4)-1) * 4);
if (i_start < 0) i_start = 0;
}
if ((i_end = i_start + 12) > gfx.player_gfx_count)
i_end = gfx.player_gfx_count;
for (i = 0; i < i_end - i_start; i++) {
srcrect.h = rect.h = gfx.players[i + i_start].menu_image->h;
srcrect.w = rect.w = gfx.players[i + i_start].menu_image->w;
rect.x = (2 * GFX_MENUPLAYERIMGSIZE_X) * (i % 4) + ((menu->oldscreenpos.w - 2 * menuimages[0]->w) - (8 * GFX_MENUPLAYERIMGSIZE_X)) / 2;
rect.y = (GFX_MENUPLAYERIMGSIZE_X * 2) * (i / 4) + PLAYERMENU_GFXSEL_Y;
srcrect.x = 0;
srcrect.y = 0;
rect.x += menu->oldscreenpos.x + menuimages[0]->w;
rect.y += menu->oldscreenpos.y + menuimages[0]->h;
gfx_blit (gfx.players[i].menu_image, &srcrect, gfx.screen, &rect, 10002);
gfx_blit (gfx.players[i + i_start].menu_image, &srcrect, gfx.screen, &rect, 10002);
/* draw the select border */
if (i == selgfx) {
if ((i + i_start) == selgfx) {
srcrect.x = 0;
srcrect.y = 0;
srcrect.h = rect.h = GFX_IMGSIZE;
srcrect.w = rect.w = GFX_IMGSIZE;
rect.x = GFX_IMGSIZE * (i % 4) + ((menu->oldscreenpos.w - 2 * menuimages[0]->w) -(4 * GFX_IMGSIZE)) / 2;
rect.y = GFX_IMGSIZE * (i / 4) + PLAYERMENU_GFXSEL_Y;
rect.x += (gfx.players[i].menu_image->w - gfx.menuselect.image->w) / 2; // center the playergfx
rect.x += (gfx.players[i + i_start].menu_image->w - gfx.menuselect.image->w) / 2; // center the playergfx
rect.x += menu->oldscreenpos.x + menuimages[0]->w;
rect.y += menu->oldscreenpos.y + menuimages[0]->h;
gfx_blit (gfx.menuselect.image, &srcrect, gfx.screen, &rect, 10001);
@ -98,7 +110,10 @@ int playermenu_selgfx (int pl_nr) {
playermenu_selgfx_drawplayer (-1, NULL);
player_set_gfx (&players[pl_nr], -1);
menu = menu_new ("Player Selection", 400, 270);
if (gfx.player_gfx_count > 8)
menu = menu_new ("Player Selection", 400, 330);
else
menu = menu_new ("Player Selection", 400, 270);
menu_create_text (menu, "playergfxsel", -1, 50, 40, 5, COLOR_yellow, "%s, please select your Player and press ENTER/RETURN or press ESCAPE for no player (that means you will only watch the next game).", players[pl_nr].name);
menu->looprunning = 1;

@ -1,4 +1,4 @@
/* $Id: sound.c,v 1.7 2005/04/09 18:22:41 stpohle Exp $ */
/* $Id: sound.c,v 1.8 2005/07/06 13:11:56 stpohle Exp $ */
/* sound */
#include "sound.h"
@ -80,11 +80,6 @@ void
snd_init ()
{
#if HAVE_SDL_MIXER
if (bman.dedicated) {
snd.inited = 0;
return;
}
if (Mix_OpenAudio (snd.audio_rate, snd.audio_format, snd.audio_channels, 1024) < 0) {
d_printf ("Couldn't open audio mixer: %s\n", SDL_GetError ());
snd.inited = 0;

Loading…
Cancel
Save