Sound enabled thanks alot to Henrik Enqvist

origin
stpohle 23 years ago
parent 6aab25e1d6
commit 4eae7a42c3

@ -3,7 +3,7 @@
## If you don't want it to overwrite it, ## If you don't want it to overwrite it,
## Please disable it in the Anjuta project configuration ## Please disable it in the Anjuta project configuration
SUBDIRS = src SUBDIRS = src
bomberclonedocdir = ${prefix}/doc/bomberclone bomberclonedocdir = ${prefix}/doc/bomberclone
bomberclonedoc_DATA = \ bomberclonedoc_DATA = \
@ -17,8 +17,6 @@ bomberclonedoc_DATA = \
EXTRA_DIST = bomberclone.prj $(bomberclonedoc_DATA) EXTRA_DIST = bomberclone.prj $(bomberclonedoc_DATA)
# Copy all the spec files. Of cource, only one is actually used. # Copy all the spec files. Of cource, only one is actually used.
dist-hook: dist-hook:
for specfile in *.spec; do \ for specfile in *.spec; do \

@ -111,7 +111,9 @@ module.source.files=\
single.c\ single.c\
sysfunc.h\ sysfunc.h\
mapmenu.c\ mapmenu.c\
special.c special.c\
sound.h\
sound.c
module.pixmap.name=pixmaps module.pixmap.name=pixmaps
module.pixmap.type= module.pixmap.type=

@ -23,3 +23,6 @@
/* Version number of package */ /* Version number of package */
#undef VERSION #undef VERSION
/* SDL_mixer */
#undef HAVE_SDL_MIXER

@ -46,6 +46,27 @@ esac
CFLAGS="$CFLAGS -Wall" CFLAGS="$CFLAGS -Wall"
dnl SDL_mixer **********************************
AC_ARG_WITH(sdlmixer-prefix, [ --with-sdlmixer-prefix=PFX prefix where SDL_mixer library is installed], sdlmixer_prefix="$withval", sdlmixer_prefix="")
if test x"$sdlmixer_prefix" != "x"; then
SDLMIXER_LIB="-L$sdlmixer_prefix/lib"
SDLMIXER_CFLAGS="-I$sdlmixer_prefix/include"
LDFLAGS="$SDLMIXER_LIB $LDFLAGS"
CFLAGS="$CFLAGS $SDLMIXER_CFLAGS"
fi
AC_CHECK_LIB(SDL_mixer, Mix_OpenAudio, have_sdl_mixer="yes", have_sdl_mixer="no" , )
if test "x$have_sdl_mixer" = "xyes"; then
AC_DEFINE(HAVE_SDL_MIXER, [1], [SDL_mixer])
LIBS="$LIBS -lSDL_mixer"
else
AC_MSG_WARN([*** libSDL_mixer not found. Make sure you have the development package of SDL_mixer installed - (www.libsdl.org) - or try to use --with-sdlmixer-prefix option])
fi
dnl Checks for library functions. dnl Checks for library functions.

@ -32,7 +32,9 @@ bomberclone_SOURCES = \
keybinput.h \ keybinput.h \
keybinput.c \ keybinput.c \
single.c \ single.c \
special.c special.c \
sound.h \
sound.c
## bomberclone_LDADD = ## bomberclone_LDADD =

@ -3,7 +3,7 @@
#include "bomberclone.h" #include "bomberclone.h"
#include "network.h" #include "network.h"
#include "gfx.h" #include "gfx.h"
#include "sound.h"
void void
@ -58,6 +58,8 @@ bomb_explode (int p, int b, int net)
if (GT_MP_PTPM && net) /* from now on only the server let the bomb explode */ if (GT_MP_PTPM && net) /* from now on only the server let the bomb explode */
net_game_send_bomb (p, b); net_game_send_bomb (p, b);
snd_play (SND_explode);
}; };

@ -1,4 +1,4 @@
/* $Id: bomberclone.h,v 1.25 2003/05/19 21:51:35 stpohle Exp $ */ /* $Id: bomberclone.h,v 1.26 2003/05/26 20:25:54 stpohle Exp $ */
/* bomberclone.h */ /* bomberclone.h */
#ifndef _BOMBERCLONE_H_ #ifndef _BOMBERCLONE_H_
@ -33,7 +33,11 @@
#include <dirent.h> #include <dirent.h>
#endif #endif
#include <SDL.h> #include <SDL.h>
#include "../config.h"
#if HAVE_CONFIG_H
#include "config.h"
#endif
#include "gfx.h" #include "gfx.h"
#include "network.h" #include "network.h"
#include "sysfunc.h" #include "sysfunc.h"
@ -221,7 +225,7 @@ void menu_clearkeybuff();
// configuration // configuration
extern void configuration (); extern void configuration ();
extern void game_init (); extern void game_init (int argc, char **argv);
extern int ReadConfig(); extern int ReadConfig();
extern int WriteConfig(); extern int WriteConfig();
extern void ReadPrgArgs (int argc, char **argv); extern void ReadPrgArgs (int argc, char **argv);

@ -8,9 +8,10 @@
#include "packets.h" #include "packets.h"
#include "gfx.h" #include "gfx.h"
#include "chat.h" #include "chat.h"
#include "sound.h"
void void
game_init () game_init (int argc, char **argv)
{ {
int i; int i;
@ -51,7 +52,23 @@ game_init ()
sprintf (bman.datapath, PACKAGE_DATA_DIR); sprintf (bman.datapath, PACKAGE_DATA_DIR);
bman.fieldpath[0] = 0; bman.fieldpath[0] = 0;
bman.random_map = 2; bman.random_map = 2;
snd.inited = 0;
init_map_tileset(); init_map_tileset();
d_printf ("\n\n ***** Bomberclone Version %s \n\n",VERSION);
if (ReadConfig()) {
gfx_init ();
menu_get_text ("Please You Playername", bman.playername, LEN_PLAYERNAME-1);
bman.playername[LEN_PLAYERNAME-1] = 0;
} else {
gfx_init ();
if (bman.askplayername)
menu_get_text ("Please You Playername", bman.playername, LEN_PLAYERNAME);
else menu_clearkeybuff();
}
ReadPrgArgs (argc, argv);
snd_init ();
}; };
int int

@ -3,6 +3,7 @@
#include <SDL.h> #include <SDL.h>
#include "bomberclone.h" #include "bomberclone.h"
#include "gfx.h" #include "gfx.h"
#include "sound.h"
int UpdateRects_nr = 0; int UpdateRects_nr = 0;
SDL_Rect UpdateRects[MAX_UPDATERECTS]; SDL_Rect UpdateRects[MAX_UPDATERECTS];
@ -464,6 +465,7 @@ gfx_game_init ()
menu_displaytext ("Loading..", "Please Wait", 32, 128, 32); menu_displaytext ("Loading..", "Please Wait", 32, 128, 32);
gfx_load_tileset (gfx.tileset); gfx_load_tileset (gfx.tileset);
gfx_load_players (gfx.block.x, gfx.block.y); gfx_load_players (gfx.block.x, gfx.block.y);
snd_load (gfx.tileset);
}; };
void void

@ -31,19 +31,7 @@ main (int argc, char **argv)
SDL_WM_SetCaption(text , NULL); SDL_WM_SetCaption(text , NULL);
SDL_EnableUNICODE(1); SDL_EnableUNICODE(1);
game_init (argv); game_init (argc, argv);
d_printf ("\n\n ***** Bomberclone Version %s \n\n",VERSION);
if (ReadConfig()) {
gfx_init ();
menu_get_text ("Please You Playername", bman.playername, LEN_PLAYERNAME-1);
bman.playername[LEN_PLAYERNAME-1] = 0;
} else {
gfx_init ();
if (bman.askplayername)
menu_get_text ("Please You Playername", bman.playername, LEN_PLAYERNAME);
else menu_clearkeybuff();
}
ReadPrgArgs (argc, argv);
sprintf(text,"Welcome to BomberClone"); sprintf(text,"Welcome to BomberClone");
while (menuselect != -1 && bman.state != GS_quit) { while (menuselect != -1 && bman.state != GS_quit) {

@ -3,7 +3,7 @@
#include <SDL.h> #include <SDL.h>
#include "bomberclone.h" #include "bomberclone.h"
#include "network.h" #include "network.h"
#include "sound.h"
void void
draw_player (_player * player) draw_player (_player * player)
@ -371,6 +371,8 @@ player_drop_bomb (int pl_nr)
if (GT_MP_PTPS) if (GT_MP_PTPS)
bomb->to = bomb->to + ((2 * RESENDCACHE_RETRY) / TIME_FACTOR); bomb->to = bomb->to + ((2 * RESENDCACHE_RETRY) / TIME_FACTOR);
} }
snd_play (SND_bombdrop);
} }
}; };
@ -415,6 +417,8 @@ player_died (_player * player, signed char dead_by)
if (GT_MP_PTP) if (GT_MP_PTP)
net_game_send_player (bman.p_nr); net_game_send_player (bman.p_nr);
snd_play (SND_dead);
}; };

@ -1,4 +1,4 @@
/* $Id: single.c,v 1.19 2003/05/25 22:24:47 stpohle Exp $ */ /* $Id: single.c,v 1.20 2003/05/26 20:25:54 stpohle Exp $ */
/* single player */ /* single player */
#include "basic.h" #include "basic.h"
@ -282,7 +282,6 @@ ai_findnearbombs (_point pos)
while (!done) { while (!done) {
done = 1; done = 1;
printf (" c ");
/* check every direction again */ /* check every direction again */
for (d = 0; d < 4; d++) for (d = 0; d < 4; d++)
if (dist[d].x >= 0 && dist[d].x < bman.fieldsize.x && if (dist[d].x >= 0 && dist[d].x < bman.fieldsize.x &&

Loading…
Cancel
Save