tNow fully functional ESD sound support; sound files can be configured via. configuration files (Sound.Jet etc.) - vaccinewars - be a doctor and try to vaccinate the world
(HTM) git clone git://src.adamsgaard.dk/vaccinewars
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit d5b5c2968ece3a03f95623266d220c48b626cc84
(DIR) parent 78ae695cf08250d7a52cc01786a525de2836f8f9
(HTM) Author: Ben Webb <ben@salilab.org>
Date: Sat, 4 May 2002 17:47:11 +0000
Now fully functional ESD sound support; sound files can be configured via.
configuration files (Sound.Jet etc.)
Diffstat:
M src/gui_client/gtk_client.c | 4 ++++
M src/message.c | 15 +++++++++++++++
M src/winmain.c | 3 +++
3 files changed, 22 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/src/gui_client/gtk_client.c b/src/gui_client/gtk_client.c
t@@ -33,6 +33,7 @@
#include "message.h"
#include "nls.h"
#include "serverside.h"
+#include "sound.h"
#include "tstring.h"
#include "util.h"
#include "gtkport/gtkport.h"
t@@ -495,6 +496,7 @@ void HandleClientMessage(char *pt, Player *Play)
Location[(int)Play->IsAt].Name);
PrintMessage(text, "jet");
g_free(text);
+ SoundPlay(Sounds.Jet);
break;
case C_ENDLIST:
MenuItem = gtk_item_factory_get_widget(ClientData.Menu,
t@@ -2219,6 +2221,8 @@ gboolean GtkLoop(int *argc, char **argv[], gboolean ReturnOnFail)
if (!CheckHighScoreFileConfig())
return TRUE;
+ SoundOpen(NULL);
+
/* Create the main player */
ClientData.Play = g_new(Player, 1);
FirstClient = AddPlayer(0, ClientData.Play, FirstClient);
(DIR) diff --git a/src/message.c b/src/message.c
t@@ -41,6 +41,7 @@
#include "network.h"
#include "nls.h"
#include "serverside.h"
+#include "sound.h"
#include "tstring.h"
#include "util.h"
t@@ -1167,6 +1168,20 @@ void ReceiveFightMessage(gchar *Data, gchar **AttackName,
*CanRunHere = *Loot = *CanFire = FALSE;
}
*Message = pt;
+
+ switch (*fp) {
+ case F_HIT:
+ SoundPlay(Sounds.FightHit);
+ break;
+ case F_MISS:
+ SoundPlay(Sounds.FightMiss);
+ break;
+ case F_RELOAD:
+ SoundPlay(Sounds.FightReload);
+ break;
+ default:
+ break;
+ }
}
void SendFightMessage(Player *Attacker, Player *Defender,
(DIR) diff --git a/src/winmain.c b/src/winmain.c
t@@ -38,6 +38,7 @@
#include "AIPlayer.h"
#include "message.h"
#include "serverside.h"
+#include "sound.h"
#include "winmain.h"
#ifdef CURSES_CLIENT
t@@ -261,6 +262,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
while (split[argc] && split[argc][0])
argc++;
+ SoundInit();
GeneralStartup(argc, split);
OpenLog();
if (WantVersion || WantHelp) {
t@@ -351,6 +353,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
g_free(PidFile);
g_free(Log.File);
g_free(ConvertFile);
+ SoundClose();
return 0;
}