tNow fully functional ESD sound support; sound files can be configured via. con… | |
git clone git://src.adamsgaard.dk/vaccinewars | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit d5b5c2968ece3a03f95623266d220c48b626cc84 | |
parent 78ae695cf08250d7a52cc01786a525de2836f8f9 | |
Author: Ben Webb <[email protected]> | |
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(-) | |
--- | |
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 Retu… | |
if (!CheckHighScoreFileConfig()) | |
return TRUE; | |
+ SoundOpen(NULL); | |
+ | |
/* Create the main player */ | |
ClientData.Play = g_new(Player, 1); | |
FirstClient = AddPlayer(0, ClientData.Play, FirstClient); | |
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 **AttackNam… | |
*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, | |
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 hPrevI… | |
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 hPrevI… | |
g_free(PidFile); | |
g_free(Log.File); | |
g_free(ConvertFile); | |
+ SoundClose(); | |
return 0; | |
} | |