# # This sound patch to xtank1.3d will only work on Suns workstations # with sound support. # # This patch will only work on an original xtank1.3d (as far as I know) # For sounds to work you must also have the rplay package installed # on all machines using xtank, this means the server and clients. # If rplay is not installed on a client machine that client will not # receive any of the sounds. # The rplay package along with the sound files are available via anonymous # ftp at sciences.sdsu.edu. The Imakefile in the Src directory also # is setup to link with the librplay.a in /usr/local/lib. If you changed # the directory where librplay.a lives you will have to edit the Imakefile # in Src. # # To apply the sound patch... # % cd your_xtank_directory (the one with Imakefile.Config) # % patch -p0 < sound-patches >& patchresults # # There is a new directory called Sound which contains a file # called list. This file contains a list of all the sound file names # that are to be used for the appropriate xtank sounds. # # Send problems/questions/comments to boyns@sciences.sdsu.edu. # # Mark # *** Src/setup.c Thu Jun 25 17:07:30 1992 --- xtank1.3d-sound/Src/setup.c Thu Jun 25 08:40:57 1992 *************** *** 55,60 **** --- 55,63 ---- #include "thread.h" #include "globals.h" #include "assert.h" + #ifdef SOUND + #include "sound.h" + #endif SOUND extern Map real_map; extern Boolean game_paused; *************** *** 279,287 **** --- 282,298 ---- game_running = True; + #ifdef SOUND + play_all(ATTENTION_SOUND); + #endif SOUND + do { status = animate(); } while (status == GAME_RUNNING); + + #ifdef SOUND + play_all(GOODBYE_SOUND); + #endif SOUND game_running = False; *** /dev/null Wed Jun 24 08:56:45 1992 --- Sounds/list Tue Jun 23 13:46:07 1992 *************** *** 0 **** --- 1,47 ---- + # + # This file contains the names of the sound files used for sounds. + # The numbers in the first column represent the number associated + # with the #defines in Src/Include/Sound.h. + # When adding new sounds changes must be made both to the Sound.h + # and this list. To change a sound just change the name here. + # + 0 click1.au # lmg + 1 click1.au # mg + 2 click1.au # hmg + 3 click1.au # lrifle + 4 click1.au # rifle + 5 click1.au # hrifle + 6 click1.au # lcannon + 7 click1.au # cannon + 8 click1.au # hcannon + 9 click1.au # lrocket + 10 click1.au # rocket + 11 click1.au # hrocket + 12 click1.au # acid + 13 click1.au # flame + 14 drip.au # mine + 15 Missle1.au # seeker + 16 click1.au # slick + 17 click1.au # procket + 18 click1.au # umissle + 19 click1.au # harm + 20 click1.au # disc + 21 boom.au # lightcyle explosion + 22 boom.au # hexo explosion + 23 boom.au # spider explosion + 24 boom.au # psycho explosion + 25 boom.au # tornado explosion + 26 boom.au # marauder explosion + 27 boom.au # tiger explosion + 28 boom.au # rhino explosion + 29 boom.au # medusa explosion + 30 boom.au # malice explosion + 31 boom.au # trike explosion + 32 boom.au # panzy explosion + 33 bong.au # vehicle hit wall + 34 better_boing.au # vehicle hit vehicle + 35 arrp.au # bullet hit vehicle + 36 tap2.au # bullet hit wall + 37 sub_dive_horn.au # attention + 38 game_over.au # goodbye + 39 Sonar.au # sonar *** /dev/null Tue Jun 23 13:51:37 1992 --- Src/Include/sound.h Mon Jun 22 16:28:47 1992 *************** *** 0 **** --- 1,67 ---- + #ifndef _sound_h + #define _sound_h + + /* + * This file contains the sound indexes into the sound table + * The indexes here must be consistent with those in the file Sounds/list + */ + + /* + * maximum number of sounds + */ + #define MAX_SOUNDS 128 + + /* + * sounds for all the types of weapons + */ + #define LMG_SOUND 0 + #define MG_SOUND 1 + #define HMG_SOUND 2 + #define LRIFLE_SOUND 3 + #define RIFLE_SOUND 4 + #define HRIFLE_SOUND 5 + #define LCANNON_SOUND 6 + #define CANNON_SOUND 7 + #define HCANNON_SOUND 8 + #define LROCKET_SOUND 9 + #define ROCKET_SOUND 10 + #define HROCKET_SOUND 11 + #define ACID_SOUND 12 + #define FLAME_SOUND 13 + #define MINE_SOUND 14 + #define SEEKER_SOUND 15 + #define SLICK_SOUND 16 + #define PROCKET_SOUND 17 + #define UMISSLE_SOUND 18 + #define HARM_SOUND 19 + #define DISC_SOUND 20 + /* + * explosion sounds for all tank bodies types + */ + #define LIGHTCYCLE_EXPLOSION_SOUND 21 + #define HEXO_EXPLOSION_SOUND 22 + #define SPIDER_EXPLOSION_SOUND 23 + #define PSYCHO_EXPLOSION_SOUND 24 + #define TORNADO_EXPLOSION_SOUND 25 + #define MARAUDER_EXPLOSION_SOUND 26 + #define TIGER_EXPLOSION_SOUND 27 + #define RHINO_EXPLOSION_SOUND 28 + #define MEDUSA_EXPLOSION_SOUND 29 + #define MALICE_EXPLOSION_SOUND 30 + #define TRIKE_EXPLOSION_SOUND 31 + #define PANZY_EXPLOSION_SOUND 32 + /* + * hit sounds + */ + #define VEHICLE_HIT_WALL_SOUND 33 + #define VEHICLE_HIT_VEHICLE_SOUND 34 + #define BULLET_HIT_VEHICLE_SOUND 35 + #define BULLET_HIT_WALL_SOUND 36 + /* + * misc sounds + */ + #define ATTENTION_SOUND 37 + #define GOODBYE_SOUND 38 + #define SONAR_SOUND 39 + + #endif _sound_h *** /dev/null Tue Jun 23 13:51:37 1992 --- Src/sound.c Thu Jun 18 14:12:45 1992 *************** *** 0 **** --- 1,140 ---- + #include "limits.h" + #include "xtank.h" + #include "graphics.h" + #include "gr.h" + #include "xtanklib.h" + #include "vehicle.h" + #include "globals.h" + #include "terminal.h" + #include "assert.h" + #include + #include + #include + #include + #include + #include + #ifdef SOUND + #include "sound.h" + + extern Terminal *terminal[]; + extern int num_terminals; + + /* + * the sound table + */ + int sound_table[MAX_TERMINALS][MAX_SOUNDS]; + + /* + * initialize sound for the given terminal + */ + init_terminal_sound(t) + Terminal *t; + { + int index, id, bind_fd; + char *p, *rindex(); + char host[MAXHOSTNAMELEN], buf[MAXPATHLEN], name[MAXPATHLEN]; + Video *vidptr; + extern char pathname[], soundsdir[]; + char filename[MAXPATHLEN]; + FILE *fp; + + draw_text_rc(ANIM_WIN, 0, 1, "Initializing Sounds...", M_FONT, WHITE); + sync_output(TRUE); + + /* + * get the display hostname + */ + vidptr = (Video *)t->video; + sprintf(host, "%s", vidptr->display_name); + p = rindex(host, ':'); + *p = '\0'; + if (*host == '\0') + strcat(host, "localhost"); + + /* + * initialize rplayd connection + */ + t->rplay_fd = rplay_init(host); + if (t->rplay_fd < 0) { + rplay_perror(host); + return -1; + } + + /* + * initialize rplaybindd connection + */ + bind_fd = rplaybind_init(host); + if (bind_fd < 0) { + rplay_perror(host); + close(t->rplay_fd); + t->rplay_fd = -1; + return -1; + } + + strcpy(filename, pathname); + strcat(filename, "/"); + strcat(filename, soundsdir); + strcat(filename, "/"); + strcat(filename, "list"); + + fp = fopen(filename, "r"); + if (fp == NULL) { + fprintf(stderr, "Could not open file %s.\n", filename); + exit(1); + } + + /* + * bind all the sounds in the sounds list to the host + * store the returned sound ids in the sound table + */ + while(fgets(buf, sizeof(buf), fp) != NULL) { + if (buf[0] == '#' || buf[0] == '\n') continue; + sscanf(buf, "%d %s", &index, name); + id = rplaybind(bind_fd, name); + if (id < 0) { + rplay_perror(host); + t->rplay_fd = -1; + return -1; + } + if (id == 0) { + fprintf(stderr, "%s not found at %s\n", name, host); + id = -1; + } + sound_table[t->num][index] = id; + } + + /* + * close the rplaybindd connection + */ + close(bind_fd); + + play_terminal(t, SONAR_SOUND); + + return 0; + } + + /* + * play a sound on a terminal + */ + play_terminal(t, index) + Terminal *t; + int index; + { + if (t->rplay_fd > 0 && sound_table[t->num][index] > 0) + rplay(t->rplay_fd, sound_table[t->num][index]); + } + + /* + * play a sound on all terminals + */ + play_all(index) + int index; + { + int x; + + for(x = 0; x < num_terminals; x++) + if (terminal[x]->rplay_fd > 0 && sound_table[terminal[x]->num][index] > 0) + rplay(terminal[x]->rplay_fd, sound_table[terminal[x]->num][index]); + } + + #endif SOUND Common subdirectories: ./Bin and ../xtank1.3d-sound/Bin Common subdirectories: ./Doc and ../xtank1.3d-sound/Doc Common subdirectories: ./Help and ../xtank1.3d-sound/Help diff -c -r ./Imakefile.Config ../xtank1.3d-sound/Imakefile.Config *** ./Imakefile.Config Sun Feb 9 21:28:45 1992 --- ../xtank1.3d-sound/Imakefile.Config Tue Jun 23 09:30:30 1992 *************** *** 152,162 **** /**/# recreate the bug!) /**/# Most sites should leave it undefined. /**/# /**/# Everybody needs to know the following global things about xtank DEFINES2 = -DX11 -DUNIX -DS1024x864 -DKEYPAD_DETECT \ -DSTINGY_REDRAW -DBATCH_LINES -DBATCH_POINTS \ ! -DCODE_SIZE=0x20000 -DSTACK_SIZE=0x8000 $(ARCH_DEFINES) DEFINES = -DXTANK_DIR=\"/src/pub/xtank\" $(DEFINES2) \ -DALLDEFINES="\"$(DEFINES2)\"" --- 152,167 ---- /**/# recreate the bug!) /**/# Most sites should leave it undefined. /**/# + /**/# -DSOUND + /**/# Enable only if you are using a Sun with sound support. + /**/# You must also have the rplay sound package for sound to work. + /**/# /**/# Everybody needs to know the following global things about xtank DEFINES2 = -DX11 -DUNIX -DS1024x864 -DKEYPAD_DETECT \ -DSTINGY_REDRAW -DBATCH_LINES -DBATCH_POINTS \ ! -DCODE_SIZE=0x20000 -DSTACK_SIZE=0x8000 $(ARCH_DEFINES) \ ! -DSOUND DEFINES = -DXTANK_DIR=\"/src/pub/xtank\" $(DEFINES2) \ -DALLDEFINES="\"$(DEFINES2)\"" Common subdirectories: ./Mazes and ../xtank1.3d-sound/Mazes Common subdirectories: ./Programs and ../xtank1.3d-sound/Programs Only in ../xtank1.3d-sound: Sounds Common subdirectories: ./Src and ../xtank1.3d-sound/Src Common subdirectories: ./Todo and ../xtank1.3d-sound/Todo Common subdirectories: ./Util and ../xtank1.3d-sound/Util Common subdirectories: ./Vehicles and ../xtank1.3d-sound/Vehicles diff -c -r ./Bin/xtank ../xtank1.3d-sound/Bin/xtank *** ./Bin/xtank Sat Feb 1 14:00:59 1992 --- ../xtank1.3d-sound/Bin/xtank Tue Jun 23 09:55:05 1992 *************** *** 3,8 **** --- 3,9 ---- XTANK_VEHICLES=Vehicles XTANK_MAZES=Mazes XTANK_PROGRAMS=Programs + XTANK_SOUNDS=Sounds # # rpotter thinks this is a kludge, I think it is funny! (lidl) Common subdirectories: ./Doc/Src and ../xtank1.3d-sound/Doc/Src Common subdirectories: ./Programs/Old and ../xtank1.3d-sound/Programs/Old Common subdirectories: ./Programs/Old/Old and ../xtank1.3d-sound/Programs/Old/Old Common subdirectories: ./Src/Fixed-Point and ../xtank1.3d-sound/Src/Fixed-Point diff -c -r ./Src/Imakefile ../xtank1.3d-sound/Src/Imakefile *** ./Src/Imakefile Sun Feb 9 21:46:14 1992 --- ../xtank1.3d-sound/Src/Imakefile Tue Jun 16 10:10:17 1992 *************** *** 17,23 **** objects.c program.c radar.c repair.c scroll.c setup.c \ setups.c status.c sysdep.c thread.c unix.c update.c \ util.c vdesign.c vehicle.c newfile.c vload.c \ ! version.c $(SRCS2) OBJS = 3d.o XMultiSync.o actions.o animate.o box.o collision.o \ console.o cosell.o display.o escher.o explosion.o \ file.o game.o gr.o graphics.o highlib.o hit.o icounter.o \ --- 17,23 ---- objects.c program.c radar.c repair.c scroll.c setup.c \ setups.c status.c sysdep.c thread.c unix.c update.c \ util.c vdesign.c vehicle.c newfile.c vload.c \ ! sound.c version.c $(SRCS2) OBJS = 3d.o XMultiSync.o actions.o animate.o box.o collision.o \ console.o cosell.o display.o escher.o explosion.o \ file.o game.o gr.o graphics.o highlib.o hit.o icounter.o \ *************** *** 26,32 **** objects.o program.o radar.o repair.o scroll.o setup.o \ setups.o status.o sysdep.o thread.o unix.o update.o \ util.o vdesign.o vehicle.o newfile.o vload.o \ ! version.o $(OBJS2) INCL = Include/bullet.h Include/common.h Include/cosell.h \ Include/disc.h Include/game.h Include/globals.h \ Include/gr.h Include/graphics.h Include/icounter.h \ --- 26,32 ---- objects.o program.o radar.o repair.o scroll.o setup.o \ setups.o status.o sysdep.o thread.o unix.o update.o \ util.o vdesign.o vehicle.o newfile.o vload.o \ ! sound.o version.o $(OBJS2) INCL = Include/bullet.h Include/common.h Include/cosell.h \ Include/disc.h Include/game.h Include/globals.h \ Include/gr.h Include/graphics.h Include/icounter.h \ *************** *** 40,46 **** Include/terminal.h Include/thread.h Include/tread-defs.h \ Include/types.h Include/vdesc.h Include/vehicle.h \ Include/vehicleparts.h Include/vstructs.h \ ! Include/weapon-defs.h Include/xtank.h Include/xtanklib.h XINCL = Include/Xlibos.h Include/x11.h /**/# Note that both x11.c and mazeconv.c are included in other .c files, --- 40,47 ---- Include/terminal.h Include/thread.h Include/tread-defs.h \ Include/types.h Include/vdesc.h Include/vehicle.h \ Include/vehicleparts.h Include/vstructs.h \ ! Include/weapon-defs.h Include/xtank.h Include/xtanklib.h \ ! Include/sound.h XINCL = Include/Xlibos.h Include/x11.h /**/# Note that both x11.c and mazeconv.c are included in other .c files, *************** *** 52,58 **** /**/# Everybody needs the following libraries ! EXTRA_LIBRARIES = -LPrograms -lxtankrobots -lm /**/# Start of System Dependent Things /**/# (e.g. libraries, linker flags and so forth) --- 53,59 ---- /**/# Everybody needs the following libraries ! EXTRA_LIBRARIES = -LPrograms -lxtankrobots -lm -L/usr/local/lib -lrplay /**/# Start of System Dependent Things /**/# (e.g. libraries, linker flags and so forth) *************** *** 89,95 **** #endif #ifdef SunArchitecture SYS_LIBRARIES = /usr/lib/debug/malloc.o -llwp ! CCOPTIONS = -Bstatic #ifdef SparcArchitecture /**/# Sun4 #else --- 90,96 ---- #endif #ifdef SunArchitecture SYS_LIBRARIES = /usr/lib/debug/malloc.o -llwp ! CCOPTIONS = /**/#-Bstatic #ifdef SparcArchitecture /**/# Sun4 #else Common subdirectories: ./Src/Include and ../xtank1.3d-sound/Src/Include Common subdirectories: ./Src/Objects and ../xtank1.3d-sound/Src/Objects Common subdirectories: ./Src/Old and ../xtank1.3d-sound/Src/Old Common subdirectories: ./Src/Programs and ../xtank1.3d-sound/Src/Programs diff -c -r ./Src/file.c ../xtank1.3d-sound/Src/file.c *** ./Src/file.c Sun Feb 9 21:45:41 1992 --- ../xtank1.3d-sound/Src/file.c Wed Jun 17 13:48:56 1992 *************** *** 120,125 **** --- 120,128 ---- char pathname[MAXPATHLEN]; char headersdir[MAXPATHLEN]; /* full name of directory to find headers in */ char vehiclesdir[MAXNAMLEN], mazesdir[MAXNAMLEN], programsdir[MAXNAMLEN]; + #ifdef SOUND + char soundsdir[MAXPATHLEN]; + #endif SOUND char username[MAX_STRING], displayname[256]; #ifdef NEED_AUX_FONT *************** *** 168,174 **** (void) strcpy(filename, "XVDIR:list"); #endif /* AMIGA */ ! draw_text_rc(ANIM_WIN, 0, 1, "Reading vehicle list...", M_FONT, WHITE); sync_output(TRUE); if ((file = fopen(filename, "r")) != NULL) { --- 171,177 ---- (void) strcpy(filename, "XVDIR:list"); #endif /* AMIGA */ ! draw_text_rc(ANIM_WIN, 0, 2, "Reading vehicle list...", M_FONT, WHITE); sync_output(TRUE); if ((file = fopen(filename, "r")) != NULL) { *************** *** 196,202 **** (void) strcpy(filename, "XMDIR:list"); #endif /* AMIGA */ ! draw_text_rc(ANIM_WIN, 0, 2, "Reading maze list...", M_FONT, WHITE); sync_output(TRUE); if ((file = fopen(filename, "r")) != NULL) { --- 199,205 ---- (void) strcpy(filename, "XMDIR:list"); #endif /* AMIGA */ ! draw_text_rc(ANIM_WIN, 0, 3, "Reading maze list...", M_FONT, WHITE); sync_output(TRUE); if ((file = fopen(filename, "r")) != NULL) { *************** *** 729,734 **** --- 732,740 ---- strcpy(vehiclesdir, (p = getenv("XTANK_VEHICLES")) ? p : "Vehicles"); strcpy(mazesdir, (p = getenv("XTANK_MAZES")) ? p : "Mazes"); strcpy(programsdir, (p = getenv("XTANK_PROGRAMS")) ? p : "Programs"); + #ifdef SOUND + strcpy(soundsdir, (p = getenv("XTANK_SOUNDS")) ? p : "Sounds"); + #endif SOUND if ((p = getenv("XTANK_HEADERS")) != NULL) { strcpy(headersdir, p); } else { diff -c -r ./Src/gr.c ../xtank1.3d-sound/Src/gr.c *** ./Src/gr.c Sun Feb 9 21:45:43 1992 --- ../xtank1.3d-sound/Src/gr.c Tue Jun 16 11:08:52 1992 *************** *** 134,139 **** --- 134,143 ---- /* Initialize 3D values for terminal */ init_terminal_3d(t); + #ifdef SOUND + init_terminal_sound(t); + #endif SOUND + return 0; } *************** *** 174,179 **** --- 178,188 ---- close_terminal(t) Terminal *t; { + #ifdef SOUND + if (t->rplay_fd > 0) { + close(t->rplay_fd); + } + #endif SOUND close_video((Video *) t->video); free((char *) t); } diff -c -r ./Src/hit.c ../xtank1.3d-sound/Src/hit.c *** ./Src/hit.c Sun Feb 9 21:45:45 1992 --- ../xtank1.3d-sound/Src/hit.c Tue Jun 16 10:02:49 1992 *************** *** 52,59 **** #include "terminal.h" #include "cosell.h" #include "globals.h" - extern Map real_map; extern Settings settings; --- 52,61 ---- #include "terminal.h" #include "cosell.h" #include "globals.h" + #ifdef SOUND + #include "sound.h" + #endif SOUND extern Map real_map; extern Settings settings; *************** *** 98,103 **** --- 100,109 ---- Side side; int has_ramplate1, has_ramplate2; + #ifdef SOUND + play_all(VEHICLE_HIT_VEHICLE_SOUND); + #endif SOUND + #ifdef GDEBUG int itemp1, itemp2; static FILE *statfile = NULL; *************** *** 196,201 **** --- 202,211 ---- int dx, dy, damage, damage1, damage2; int has_ramplate = FALSE; + #ifdef SOUND + play_all(VEHICLE_HIT_WALL_SOUND); + #endif SOUND + #ifdef GDEBUG int itemp1, itemp2; static FILE *statfile = NULL; *************** *** 335,340 **** --- 345,354 ---- FLOAT angle; int damage, height; + #ifdef SOUND + play_all(BULLET_HIT_VEHICLE_SOUND); + #endif SOUND + switch (b->type) { case DISC: *************** *** 469,474 **** --- 483,492 ---- { FLOAT dx, dy; int dam; + + #ifdef SOUND + play_all(BULLET_HIT_WALL_SOUND); + #endif SOUND /* Compute x and y distances from current location to point of contact */ switch (dir) diff -c -r ./Src/lowlib.c ../xtank1.3d-sound/Src/lowlib.c *** ./Src/lowlib.c Sun Feb 9 21:45:52 1992 --- ../xtank1.3d-sound/Src/lowlib.c Tue Jun 16 10:02:49 1992 *************** *** 73,78 **** --- 73,81 ---- #include "cosell.h" #include "outpost.h" #include "globals.h" + #ifdef SOUND + #include "sound.h" + #endif SOUND extern Weapon_stat weapon_stat[]; extern Armor_stat armor_stat[]; *************** *** 684,689 **** --- 687,761 ---- #endif /* !NO_NEW_RADAR */ make_bullet(cv, &bloc, w->type, angle + PI / 100 * (50 - rnd(101)) / 50); } + + #ifdef SOUND + switch(w->type) { + case LMG: + play_all(LMG_SOUND); + break; + case MG: + play_all(MG_SOUND); + break; + case HMG: + play_all(HMG_SOUND); + break; + case LRIFLE: + play_all(LRIFLE_SOUND); + break; + case RIFLE: + play_all(RIFLE_SOUND); + break; + case HRIFLE: + play_all(HRIFLE_SOUND); + break; + case LCANNON: + play_all(LCANNON_SOUND); + break; + case CANNON: + play_all(CANNON_SOUND); + break; + case HCANNON: + play_all(HCANNON_SOUND); + break; + case LROCKET: + play_all(LROCKET_SOUND); + break; + case ROCKET: + play_all(ROCKET_SOUND); + break; + case HROCKET: + play_all(HROCKET_SOUND); + break; + case ACID: + play_all(ACID_SOUND); + break; + case FLAME: + play_all(FLAME_SOUND); + break; + case MINE: + play_all(MINE_SOUND); + break; + case SEEKER: + play_all(SEEKER_SOUND); + break; + case SLICK: + play_all(SLICK_SOUND); + break; + case PROCKET: + play_all(PROCKET_SOUND); + break; + case UMISSLE: + play_all(UMISSLE_SOUND); + break; + case HARM: + play_all(HARM_SOUND); + break; + case DISC: + play_all(DISC_SOUND); + break; + } + #endif SOUND + } check_time(); diff -c -r ./Src/main.c ../xtank1.3d-sound/Src/main.c *** ./Src/main.c Sun Feb 9 21:45:53 1992 --- ../xtank1.3d-sound/Src/main.c Tue Jun 16 09:48:54 1992 *************** *** 252,257 **** --- 252,258 ---- debug("Opening graphics toolkit"); open_graphics(); + /* Parse command line for display names and make a terminal for each one */ debug("Making terminals"); if (argc - iNumOpts > 1) Only in ../xtank1.3d-sound/Src: sound.c diff -c -r ./Src/vehicle.c ../xtank1.3d-sound/Src/vehicle.c *** ./Src/vehicle.c Sun Feb 9 21:46:11 1992 --- ../xtank1.3d-sound/Src/vehicle.c Wed Jun 17 13:52:24 1992 *************** *** 19,24 **** --- 19,25 ---- * */ #include "xtank.h" + #include "graphics.h" #include "xtanklib.h" #include "vehicle.h" #include "globals.h" *************** *** 27,34 **** #include "disc.h" #include "vstructs.h" #include "assert.h" - extern int team_color_bright[]; extern char team_char[]; extern Map real_map; --- 28,37 ---- #include "disc.h" #include "vstructs.h" #include "assert.h" + #ifdef SOUND + #include "sound.h" + #endif SOUND extern int team_color_bright[]; extern char team_char[]; extern Map real_map; *************** *** 380,385 **** --- 383,446 ---- int dam; int i; WeaponType wt; + + /* + type size weight wghtlim space drag hndl trts cost + {"Lightcycle", 2, 200, 800, 600, .10, 8, 0, 3000}, + {"Hexo", 3, 1500, 5000, 4000, .25, 6, 1, 4000}, + {"Spider", 3, 2500, 8000, 3000, .40, 7, 1, 5000}, + {"Psycho", 4, 5000, 18000, 8000, .60, 4, 1, 5000}, + {"Tornado", 4, 7000, 22000, 12000, .80, 4, 1, 7000}, + {"Marauder", 5, 9000, 28000, 18000, 1.00, 3, 2, 10000}, + {"Tiger", 6, 11000, 35000, 22000, 1.50, 5, 1, 12000}, + {"Rhino", 7, 12000, 40000, 30000, 2.00, 3, 2, 10000}, + {"Medusa", 7, 14000, 40000, 25000, 1.20, 4, 3, 15000}, + {"Malice", 5, 4000, 20000, 15000, .40, 7, 1, 17000}, + {"Trike", 2, 400, 1600, 1200, .15, 6, 0, 4000}, + {"Panzy", 8, 22000, 70000, 45000, 3.00, 3, 4, 25000} + + The numbers below are taken from indexes into the above table + */ + #ifdef SOUND + switch(body) { + case 0: + play_all(LIGHTCYCLE_EXPLOSION_SOUND); + break; + case 1: + play_all(HEXO_EXPLOSION_SOUND); + break; + case 2: + play_all(SPIDER_EXPLOSION_SOUND); + break; + case 3: + play_all(PSYCHO_EXPLOSION_SOUND); + break; + case 4: + play_all(TORNADO_EXPLOSION_SOUND); + break; + case 5: + play_all(MARAUDER_EXPLOSION_SOUND); + break; + case 6: + play_all(TIGER_EXPLOSION_SOUND); + break; + case 7: + play_all(RHINO_EXPLOSION_SOUND); + break; + case 8: + play_all(MEDUSA_EXPLOSION_SOUND); + break; + case 9: + play_all(MALICE_EXPLOSION_SOUND); + break; + case 10: + play_all(TRIKE_EXPLOSION_SOUND); + break; + case 11: + play_all(PANZY_EXPLOSION_SOUND); + break; + } + #endif SOUND /* Make a tank explosion around the victim */ explode_location(victim->loc, 1, EXP_TANK); Only in ../xtank1.3d-sound/Src/Include: sound.h diff -c -r ./Src/Include/terminal.h ../xtank1.3d-sound/Src/Include/terminal.h *** ./Src/Include/terminal.h Sat Jan 25 21:02:03 1992 --- ../xtank1.3d-sound/Src/Include/terminal.h Tue Jun 16 10:04:40 1992 *************** *** 52,57 **** --- 52,60 ---- Line line[MAX_LINES]; /* lines drawn on the screen */ Boolean observer; /* True if this terminal is not controlling a vehicle */ + #ifdef SOUND + int rplay_fd; + #endif SOUND } Terminal;