load free data bug found.. sound didn't wanted to stop

origin
stpohle 22 years ago
parent 32165ca1fe
commit 56eb2c9812

@ -1,4 +1,8 @@
$Id: ChangeLog,v 1.38 2003/08/24 20:18:06 stpohle Exp $
$Id: ChangeLog,v 1.39 2003/08/29 23:50:39 stpohle Exp $
- added liquid and moving bombs special.
- timer options, for how long the game will go.
- added tunnels to the game so player can go through.
PKG_playermove changed and PGK_tunneldata added

@ -1,6 +1,4 @@
$Id: TODO,v 1.21 2003/08/27 21:14:48 stpohle Exp $
- timer options, for how long the game will go.
$Id: TODO,v 1.22 2003/08/29 23:50:39 stpohle Exp $
- more specials (Kicking Bomb, Pushing Bomb Ver.2)

@ -1,4 +1,4 @@
/* $Id: bomberclone.h,v 1.53 2003/08/29 22:04:19 stpohle Exp $ */
/* $Id: bomberclone.h,v 1.54 2003/08/29 23:50:39 stpohle Exp $ */
/* bomberclone.h */
#ifndef _BOMBERCLONE_H_
@ -135,6 +135,7 @@ struct __bomberclone {
unsigned char gametype;
unsigned char multitype;
unsigned char state;
int init_timeout; // gametimeout init value
int timeout; // game timeout
char playername[LEN_PLAYERNAME];
int players_nr_s; // number of players at the beginning

@ -59,6 +59,7 @@ game_init (int argc, char **argv)
map.type = -1;
bman.firewall = 0;
bman.broadcasted_chat = 1;
bman.init_timeout = GAME_TIMEOUT;
bman.ai_players = 1;
snd.inited = 0;
snd.audio_rate = 22050;
@ -235,6 +236,9 @@ ReadConfig ()
}
if (!strcmp (keyword, "randomtileset")) {
map.random_tileset = atoi (value);
}
if (!strcmp (keyword, "gametimeout")) {
bman.init_timeout = atoi (value);
}
if(!strcmp (keyword, "sndrate")) {
snd.audio_rate = atoi (value);
@ -290,6 +294,7 @@ WriteConfig ()
fprintf (config, "ai_family=%d\n", bman.net_ai_family);
fprintf (config, "masterserver=%s\n", bman.gamemaster);
fprintf (config, "gamename=%s\n", bman.gamename);
fprintf (config, "gametimeout=%d\n", bman.init_timeout);
fprintf (config, "maxplayer=%d\n", bman.maxplayer);
for (i = 0; i < MAX_SERVERENTRYS; i++)
fprintf (config, "ip%d=%s\n", i, bman.serverlist[i].name);

@ -1,4 +1,4 @@
/* $Id: game.c,v 1.52 2003/08/27 21:14:50 stpohle Exp $
/* $Id: game.c,v 1.53 2003/08/29 23:50:39 stpohle Exp $
game.c - procedures for the game. */
#include <string.h>
@ -254,9 +254,9 @@ game_end ()
{
int i;
snd_music_stop ();
gfx_free_players ();
tileset_free ();
snd_music_stop ();
snd_free ();
/* count the points */
@ -337,7 +337,7 @@ game_start ()
snd_load (map.tileset);
snd_music_start ();
map.state = MS_normal;
bman.timeout = GAME_TIMEOUT;
bman.timeout = bman.init_timeout;
};

@ -1,4 +1,4 @@
/* $Id: mapmenu.c,v 1.10 2003/08/29 22:04:19 stpohle Exp $ */
/* $Id: mapmenu.c,v 1.11 2003/08/29 23:50:39 stpohle Exp $ */
/* map/tileset selection menu */
#include "bomberclone.h"
@ -29,7 +29,7 @@ mapmenu ()
{12, "Special Trigger :"},
{13, "Special Push Liq. Moved:"},
{14, "Special Row :"},
{0, ""},
{15, "Gamet Timeout:"},
{16, "Maptype: Random"},
{0, ""},
{15, "Return To Previous Menu"},
@ -99,6 +99,8 @@ mapmenu ()
sprintf (menu[13].text, "Special Push :%d", map.sp_push);
sprintf (menu[14].text, "Special Row :%d", map.sp_row);
sprintf (menu[15].text, "Game Timeout:%d", bman.init_timeout);
switch (map.type) {
case (MAPT_normal):
sprintf (menu[16].text, "Maptype: NORMAL");
@ -222,6 +224,11 @@ mapmenu ()
menu_get_text ("Row Specials", text, 2);
map.sp_row = atoi (text);
break;
case (15):
sprintf (text, "%d", bman.init_timeout);
menu_get_text ("Game Timeout", text, 7);
bman.init_timeout = atoi (text);
break;
case (16):
map.type++;
if (map.type >= MAPT_max)

@ -251,6 +251,8 @@ host_multiplayer_game ()
net_send_servermode ();
net_send_players ();
}
else
game_end ();
}
}
@ -278,10 +280,13 @@ join_multiplayer_game ()
if (bman.state == GS_ready || bman.state == GS_running)
game_loop ();
game_end ();
}
else
else {
bman.state = GS_startup;
}
}
network_shutdown ();
};

@ -699,6 +699,7 @@ void send_tunneldata (_net_addr *addr, int tunnelnr, int x, int y) {
d_printf ("send_tunneldata (Tunnel %d Target [%d,%d])\n", tunnelnr, x, y);
tun_pkg.h.typ = PKG_tunneldata;
tun_pkg.h.flags = PKGF_ackreq;
tun_pkg.h.len = sizeof (struct pkg_tunneldata);
if ((GT_MP_PTPM && x != -1 && y != -1) || (GT_MP_PTPS && x == -1 && y == -1)) {

@ -1,4 +1,4 @@
/* $Id: tileset.c,v 1.8 2003/08/29 22:04:19 stpohle Exp $ */
/* $Id: tileset.c,v 1.9 2003/08/29 23:50:39 stpohle Exp $ */
/* load and select tilesets */
#include "bomberclone.h"
@ -243,6 +243,7 @@ tileset_load (char *tilesetname)
void
tileset_free () {
int i;
for (i = 0; i < FT_max; i++) {
if (gfx.field[i].image != NULL)
SDL_FreeSurface (gfx.field[i].image);
@ -260,6 +261,7 @@ tileset_free () {
for (i = 0; i < PWUP_max; i++)
if (gfx.powerup[i].image != NULL)
SDL_FreeSurface (gfx.powerup[i].image);
gfx.bomb.image = NULL;
gfx.fire.image = NULL;
};

Loading…
Cancel
Save