From db2e2199f99aac924e695799551bf8fdbe164247 Mon Sep 17 00:00:00 2001 From: Alexander Monakov Date: Sun, 12 Dec 2010 19:14:37 +0300 Subject: [PATCH] Make sounds an enum --- Source/Constants.h | 63 ---------------------------------- Source/Game.h | 1 + Source/Person.cpp | 1 + Source/Sounds.def | 84 ++++++++++++++++++++++++++++++++++++++++++++++ Source/Sounds.h | 31 +++++++++++++++++ Source/Weapons.cpp | 1 + 6 files changed, 118 insertions(+), 63 deletions(-) create mode 100644 Source/Sounds.def create mode 100644 Source/Sounds.h diff --git a/Source/Constants.h b/Source/Constants.h index 1000a07..31738b9 100644 --- a/Source/Constants.h +++ b/Source/Constants.h @@ -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; diff --git a/Source/Game.h b/Source/Game.h index 6dd0836..58b0a42 100644 --- a/Source/Game.h +++ b/Source/Game.h @@ -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; diff --git a/Source/Person.cpp b/Source/Person.cpp index dac3b59..c8f9119 100644 --- a/Source/Person.cpp +++ b/Source/Person.cpp @@ -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 index 0000000..32c57cb --- /dev/null +++ b/Source/Sounds.def @@ -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 index 0000000..042afae --- /dev/null +++ b/Source/Sounds.h @@ -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 diff --git a/Source/Weapons.cpp b/Source/Weapons.cpp index cd35a47..d76103e 100644 --- a/Source/Weapons.cpp +++ b/Source/Weapons.cpp @@ -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]; -- 2.39.5