]> git.jsancho.org Git - lugaru.git/commitdiff
Make sounds an enum
authorAlexander Monakov <amonakov@gmail.com>
Sun, 12 Dec 2010 16:14:37 +0000 (19:14 +0300)
committerAlexander Monakov <amonakov@gmail.com>
Sun, 12 Dec 2010 16:14:37 +0000 (19:14 +0300)
Source/Constants.h
Source/Game.h
Source/Person.cpp
Source/Sounds.def [new file with mode: 0644]
Source/Sounds.h [new file with mode: 0644]
Source/Weapons.cpp

index 1000a07b45b8e8982a9b4a2ca5a7d91e99170c7c..31738b9feb1f931391fccf90446db776cf4227ae 100644 (file)
@@ -137,69 +137,6 @@ const int stream_desertambient = 7;
 const int stream_firesound = 8;
 const int stream_wind = 9;
 
-const int footstepsound = 10;
-const int footstepsound2 = 11;
-const int footstepsound3 = 12;
-const int footstepsound4 = 13;
-const int jumpsound = 14;
-const int landsound = 15;
-const int whooshsound = 16;
-const int hawksound = 17;
-const int landsound1 = 18;
-const int landsound2 = 19;
-const int breaksound = 20;
-const int lowwhooshsound = 21;
-const int heavyimpactsound = 22;
-const int firestartsound = 23;
-const int fireendsound = 24;
-const int breaksound2 = 25;
-const int knifedrawsound = 26;
-const int knifesheathesound = 27;
-const int knifeswishsound = 28;
-const int knifeslicesound = 29;
-const int skidsound = 30;
-const int snowskidsound = 31;
-const int bushrustle = 32;
-const int midwhooshsound = 33;
-const int highwhooshsound = 34;
-const int movewhooshsound = 35;
-const int thudsound = 36;
-const int whooshhitsound = 37;
-const int clank1sound = 38;
-const int clank2sound = 39;
-const int clank3sound = 40;
-const int clank4sound = 41;
-const int consolefailsound = 42;
-const int consolesuccesssound = 43;
-const int swordslicesound = 44;
-const int metalhitsound = 45;
-const int clawslicesound = 46;
-const int splattersound = 47;
-const int growlsound = 48;
-const int growl2sound = 49;
-const int barksound = 50;
-const int snarlsound = 51;
-const int snarl2sound = 52;
-const int barkgrowlsound = 53;
-const int bark2sound = 54;
-const int bark3sound = 55;
-const int rabbitattacksound = 56;
-const int rabbitattack2sound = 57;
-const int rabbitattack3sound = 58;
-const int rabbitattack4sound = 59;
-const int rabbitpainsound = 60;
-const int rabbitpain1sound = 61;
-const int rabbitpain2sound = 62;
-const int rabbitchitter = 63;
-const int rabbitchitter2 = 64;
-const int fleshstabsound = 65;
-const int fleshstabremovesound = 66;
-const int swordstaffsound = 67;
-const int staffbodysound = 68;
-const int staffheadsound = 69;
-const int alarmsound = 70;
-const int staffbreaksound = 71;
-
 const int normalmode = 0;
 const int motionblurmode = 1;
 const int radialzoommode = 2;
index 6dd0836ee70da4b6b4bd8f35272711db487b3446..58b0a42870ddfd3b63e02604ad28ba0b74c794fa 100644 (file)
@@ -58,6 +58,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "gamegl.h"
 #include "Stereo.h"
 #include "Account.h"
+#include "Sounds.h"
 
 extern GLuint rabbittexture;
 
index dac3b59373087400aed546f5365be22813162ea3..c8f91191108d48455cf37d4f1dbf6fb9b4eeb6d6 100644 (file)
@@ -23,6 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "Person.h"
 #include "openal_wrapper.h"
 #include "Animation.h"
+#include "Sounds.h"
 
 extern float multiplier;
 extern OPENAL_SAMPLE   *samp[100];
diff --git a/Source/Sounds.def b/Source/Sounds.def
new file mode 100644 (file)
index 0000000..32c57cb
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+Copyright (C) 2010 - Lugaru authors
+
+This file is part of Lugaru.
+
+Lugaru is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+*/
+
+DECLARE_SOUND(footstepsound)
+DECLARE_SOUND(footstepsound2)
+DECLARE_SOUND(footstepsound3)
+DECLARE_SOUND(footstepsound4)
+DECLARE_SOUND(jumpsound)
+DECLARE_SOUND(landsound)
+DECLARE_SOUND(whooshsound)
+DECLARE_SOUND(hawksound)
+DECLARE_SOUND(landsound1)
+DECLARE_SOUND(landsound2)
+DECLARE_SOUND(breaksound)
+DECLARE_SOUND(lowwhooshsound)
+DECLARE_SOUND(heavyimpactsound)
+DECLARE_SOUND(firestartsound)
+DECLARE_SOUND(fireendsound)
+DECLARE_SOUND(breaksound2)
+DECLARE_SOUND(knifedrawsound)
+DECLARE_SOUND(knifesheathesound)
+DECLARE_SOUND(knifeswishsound)
+DECLARE_SOUND(knifeslicesound)
+DECLARE_SOUND(skidsound)
+DECLARE_SOUND(snowskidsound)
+DECLARE_SOUND(bushrustle)
+DECLARE_SOUND(midwhooshsound)
+DECLARE_SOUND(highwhooshsound)
+DECLARE_SOUND(movewhooshsound)
+DECLARE_SOUND(thudsound)
+DECLARE_SOUND(whooshhitsound)
+DECLARE_SOUND(clank1sound)
+DECLARE_SOUND(clank2sound)
+DECLARE_SOUND(clank3sound)
+DECLARE_SOUND(clank4sound)
+DECLARE_SOUND(consolefailsound)
+DECLARE_SOUND(consolesuccesssound)
+DECLARE_SOUND(swordslicesound)
+DECLARE_SOUND(metalhitsound)
+DECLARE_SOUND(clawslicesound)
+DECLARE_SOUND(splattersound)
+DECLARE_SOUND(growlsound)
+DECLARE_SOUND(growl2sound)
+DECLARE_SOUND(barksound)
+DECLARE_SOUND(snarlsound)
+DECLARE_SOUND(snarl2sound)
+DECLARE_SOUND(barkgrowlsound)
+DECLARE_SOUND(bark2sound)
+DECLARE_SOUND(bark3sound)
+DECLARE_SOUND(rabbitattacksound)
+DECLARE_SOUND(rabbitattack2sound)
+DECLARE_SOUND(rabbitattack3sound)
+DECLARE_SOUND(rabbitattack4sound)
+DECLARE_SOUND(rabbitpainsound)
+DECLARE_SOUND(rabbitpain1sound)
+DECLARE_SOUND(rabbitpain2sound)
+DECLARE_SOUND(rabbitchitter)
+DECLARE_SOUND(rabbitchitter2)
+DECLARE_SOUND(fleshstabsound)
+DECLARE_SOUND(fleshstabremovesound)
+DECLARE_SOUND(swordstaffsound)
+DECLARE_SOUND(staffbodysound)
+DECLARE_SOUND(staffheadsound)
+DECLARE_SOUND(alarmsound)
+DECLARE_SOUND(staffbreaksound)
+
diff --git a/Source/Sounds.h b/Source/Sounds.h
new file mode 100644 (file)
index 0000000..042afae
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+Copyright (C) 2010 - Lugaru authors
+
+This file is part of Lugaru.
+
+Lugaru is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+*/
+
+#ifndef SOUNDS_H
+#define SOUNDS_H
+
+enum sound_types {
+#define DECLARE_SOUND(id) id,
+#include "Sounds.def"
+#undef DECLARE_SOUND
+};
+
+#endif
index cd35a47ad2b65d1060755a48d2cc7174b8cfc71b..d76103e9db81d427e662aa239c4ce0dd22243296 100644 (file)
@@ -23,6 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "Weapons.h"
 #include "openal_wrapper.h"
 #include "Animation.h"
+#include "Sounds.h"
 
 extern float multiplier;
 extern OPENAL_SAMPLE   *samp[100];