aboutsummaryrefslogtreecommitdiff
path: root/src/GameInitDispose.cpp
diff options
context:
space:
mode:
authorNguyễn Gia Phong <mcsinyx@disroot.org>2021-06-22 11:49:43 +0700
committerNguyễn Gia Phong <mcsinyx@disroot.org>2021-06-22 11:49:43 +0700
commit865c51c497f776cce046a04915563f730a54d411 (patch)
tree783f20abf11031d1784d9b5940070e6eac2627a4 /src/GameInitDispose.cpp
parentf8d2b2ce4c4827059089ec7cd0a5414b167e673e (diff)
downloadblackshades-865c51c497f776cce046a04915563f730a54d411.tar.gz
Require OGG and clean up
Diffstat (limited to 'src/GameInitDispose.cpp')
-rw-r--r--src/GameInitDispose.cpp942
1 files changed, 38 insertions, 904 deletions
diff --git a/src/GameInitDispose.cpp b/src/GameInitDispose.cpp
index 69396c5..c11f3c1 100644
--- a/src/GameInitDispose.cpp
+++ b/src/GameInitDispose.cpp
@@ -1,1014 +1,398 @@
#include <ctype.h>
#include <time.h>
+#include <AL/alut.h>
+
#include "Textures.h"
#include "Game.h"
extern unsigned int gSourceID[100];
-
extern unsigned int gSampleSet[100];
-
extern Camera camera;
-
extern Skeleton testskeleton;
-
extern Sprites sprites;
-
extern Decals decals;
/*********************> InitGame()<*****/
-
extern Model skeletonmodels[10];
-
extern Model gunmodels[10];
-
extern Costume costume[10];
-
extern Animation animation[30];
-
extern int visions;
-
extern float rad2deg;
-
extern Fog fog;
-
extern bool blood;
-
extern float fogcolorr;
-
extern float fogcolorg;
-
extern float fogcolorb;
-
extern int environment;
-
extern float precipitationhorz;
-
extern float precipitationvert;
-
extern float precipitationdensity;
-
extern float soundscalefactor;
-
extern int slomo;
-
extern int forwardskey;
-
extern int backwardskey;
-
extern int leftkey;
-
extern int rightkey;
-
extern int aimkey;
-
extern int psychicaimkey;
-
extern int psychickey;
-void LoadSounds(bool musictoggle);
-
void LoadSounds(bool musictoggle)
-
{
char *pBuffer1;
-
long lBuffer1Len;
-
ALenum formatBuffer1;
-
ALsizei freqBuffer1;
-
SInt16 iNumSources, iNumSampleSets;
// initialize OpenAL
-
alutInit(NULL, 0);
// load up some audio data...
-
// generate ten OpenAL sample sets and two sources
-
iNumSources = 37;
-
iNumSampleSets = 37;
-
alGenSources(iNumSources, &gSourceID[0]);
-
alGenBuffers(iNumSampleSets, &gSampleSet[0]);
-
-#ifdef NOOGG
- alutLoadWAVFile((char *)":Data:Sounds:underwater.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[visionsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[visionsound], AL_BUFFER, gSampleSet[visionsound]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:soulin.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[soulinsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[soulinsound], AL_BUFFER, gSampleSet[soulinsound]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:soulout.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[souloutsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[souloutsound], AL_BUFFER, gSampleSet[souloutsound]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:footstep1.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[footstepsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[footstepsound], AL_BUFFER, gSampleSet[footstepsound]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:footstep2.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[footstepsound+1], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[footstepsound+1], AL_BUFFER, gSampleSet[footstepsound+1]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:footstep3.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[footstepsound+2], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[footstepsound+2], AL_BUFFER, gSampleSet[footstepsound+2]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:footstep4.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[footstepsound+3], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[footstepsound+3], AL_BUFFER, gSampleSet[footstepsound+3]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:footstep5.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[footstepsound+4], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[footstepsound+4], AL_BUFFER, gSampleSet[footstepsound+4]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:bodyland.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[bodylandsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[bodylandsound], AL_BUFFER, gSampleSet[bodylandsound]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:headland.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[headlandsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[headlandsound], AL_BUFFER, gSampleSet[headlandsound]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:sniperrifle.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[riflesound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[riflesound], AL_BUFFER, gSampleSet[riflesound]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:BodyHit.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[bodyhitsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[bodyhitsound], AL_BUFFER, gSampleSet[bodyhitsound]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:WallHit.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[wallhitsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[wallhitsound], AL_BUFFER, gSampleSet[wallhitsound]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:machinegun.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[machinegunsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[machinegunsound], AL_BUFFER, gSampleSet[machinegunsound]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:Nearbullet.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[nearbulletsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[nearbulletsound], AL_BUFFER, gSampleSet[nearbulletsound]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:riflewhack.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[headwhacksound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[headwhacksound], AL_BUFFER, gSampleSet[headwhacksound]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:headshot.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[headshotsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[headshotsound], AL_BUFFER, gSampleSet[headshotsound]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:reload.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[reloadsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[reloadsound], AL_BUFFER, gSampleSet[reloadsound]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:click.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[clicksound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[clicksound], AL_BUFFER, gSampleSet[clicksound]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:SW.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[pistol1sound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[pistol1sound], AL_BUFFER, gSampleSet[pistol1sound]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:glock.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[pistol2sound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[pistol2sound], AL_BUFFER, gSampleSet[pistol2sound]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:pinpull.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[pinpullsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[pinpullsound], AL_BUFFER, gSampleSet[pinpullsound]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:pinreplace.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[pinreplacesound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[pinreplacesound], AL_BUFFER, gSampleSet[pinreplacesound]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:handlerelease.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[grenadethrowsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[grenadethrowsound], AL_BUFFER, gSampleSet[grenadethrowsound]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:bounce.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[bouncesound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[bouncesound], AL_BUFFER, gSampleSet[bouncesound]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:bounce2.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[bounce2sound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[bounce2sound], AL_BUFFER, gSampleSet[bounce2sound]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:explosion.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[explosionsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[explosionsound], AL_BUFFER, gSampleSet[explosionsound]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:headland.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[bodywhacksound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[bodywhacksound], AL_BUFFER, gSampleSet[bodywhacksound]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:rain.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[rainsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[rainsound], AL_BUFFER, gSampleSet[rainsound]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:Lose.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[losesound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[losesound], AL_BUFFER, gSampleSet[losesound]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:Disguisekill.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[disguisekillsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[disguisekillsound], AL_BUFFER, gSampleSet[disguisekillsound]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:knifeslash.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[knifeslashsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[knifeslashsound], AL_BUFFER, gSampleSet[knifeslashsound]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:shotgun.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[shotgunsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[shotgunsound], AL_BUFFER, gSampleSet[shotgunsound]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- if(musictoggle){
- alutLoadWAVFile((char *)":Data:Sounds:mainmenusong.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[mainmenusong], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[mainmenusong], AL_BUFFER, gSampleSet[mainmenusong]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:shootsong.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[shootsong], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[shootsong], AL_BUFFER, gSampleSet[shootsong]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:zombiesong.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[zombiesong], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[zombiesong], AL_BUFFER, gSampleSet[zombiesong]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alutLoadWAVFile((char *)":Data:Sounds:knifesong.wav",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[knifesong], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[knifesong], AL_BUFFER, gSampleSet[knifesong]);
-
- alutUnloadWAV(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
- }
-#else
LoadOGG_CFH((char *)":Data:Sounds:underwater.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
alBufferData(gSampleSet[visionsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
alSourcei(gSourceID[visionsound], AL_BUFFER, gSampleSet[visionsound]);
-
FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
LoadOGG_CFH((char *)":Data:Sounds:soulin.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
alBufferData(gSampleSet[soulinsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
alSourcei(gSourceID[soulinsound], AL_BUFFER, gSampleSet[soulinsound]);
-
FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
LoadOGG_CFH((char *)":Data:Sounds:soulout.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
alBufferData(gSampleSet[souloutsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
alSourcei(gSourceID[souloutsound], AL_BUFFER, gSampleSet[souloutsound]);
-
FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
LoadOGG_CFH((char *)":Data:Sounds:footstep1.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
alBufferData(gSampleSet[footstepsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
alSourcei(gSourceID[footstepsound], AL_BUFFER, gSampleSet[footstepsound]);
-
FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
LoadOGG_CFH((char *)":Data:Sounds:footstep2.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
alBufferData(gSampleSet[footstepsound+1], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
alSourcei(gSourceID[footstepsound+1], AL_BUFFER, gSampleSet[footstepsound+1]);
-
FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
LoadOGG_CFH((char *)":Data:Sounds:footstep3.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
alBufferData(gSampleSet[footstepsound+2], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
alSourcei(gSourceID[footstepsound+2], AL_BUFFER, gSampleSet[footstepsound+2]);
-
FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
LoadOGG_CFH((char *)":Data:Sounds:footstep4.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
alBufferData(gSampleSet[footstepsound+3], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
alSourcei(gSourceID[footstepsound+3], AL_BUFFER, gSampleSet[footstepsound+3]);
-
FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
LoadOGG_CFH((char *)":Data:Sounds:footstep5.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
alBufferData(gSampleSet[footstepsound+4], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
alSourcei(gSourceID[footstepsound+4], AL_BUFFER, gSampleSet[footstepsound+4]);
-
FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
LoadOGG_CFH((char *)":Data:Sounds:bodyland.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
alBufferData(gSampleSet[bodylandsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
alSourcei(gSourceID[bodylandsound], AL_BUFFER, gSampleSet[bodylandsound]);
-
FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
LoadOGG_CFH((char *)":Data:Sounds:headland.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
alBufferData(gSampleSet[headlandsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
alSourcei(gSourceID[headlandsound], AL_BUFFER, gSampleSet[headlandsound]);
-
FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
LoadOGG_CFH((char *)":Data:Sounds:sniperrifle.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
alBufferData(gSampleSet[riflesound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
alSourcei(gSourceID[riflesound], AL_BUFFER, gSampleSet[riflesound]);
-
FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
LoadOGG_CFH((char *)":Data:Sounds:BodyHit.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
alBufferData(gSampleSet[bodyhitsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
alSourcei(gSourceID[bodyhitsound], AL_BUFFER, gSampleSet[bodyhitsound]);
-
FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
LoadOGG_CFH((char *)":Data:Sounds:WallHit.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
alBufferData(gSampleSet[wallhitsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
alSourcei(gSourceID[wallhitsound], AL_BUFFER, gSampleSet[wallhitsound]);
-
FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
LoadOGG_CFH((char *)":Data:Sounds:machinegun.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
alBufferData(gSampleSet[machinegunsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
alSourcei(gSourceID[machinegunsound], AL_BUFFER, gSampleSet[machinegunsound]);
-
FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
LoadOGG_CFH((char *)":Data:Sounds:Nearbullet.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
alBufferData(gSampleSet[nearbulletsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
alSourcei(gSourceID[nearbulletsound], AL_BUFFER, gSampleSet[nearbulletsound]);
-
FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
LoadOGG_CFH((char *)":Data:Sounds:riflewhack.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
alBufferData(gSampleSet[headwhacksound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
alSourcei(gSourceID[headwhacksound], AL_BUFFER, gSampleSet[headwhacksound]);
-
FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
LoadOGG_CFH((char *)":Data:Sounds:headshot.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
alBufferData(gSampleSet[headshotsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
alSourcei(gSourceID[headshotsound], AL_BUFFER, gSampleSet[headshotsound]);
-
FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
LoadOGG_CFH((char *)":Data:Sounds:reload.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
alBufferData(gSampleSet[reloadsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
alSourcei(gSourceID[reloadsound], AL_BUFFER, gSampleSet[reloadsound]);
-
FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
LoadOGG_CFH((char *)":Data:Sounds:click.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
alBufferData(gSampleSet[clicksound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
alSourcei(gSourceID[clicksound], AL_BUFFER, gSampleSet[clicksound]);
-
FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
LoadOGG_CFH((char *)":Data:Sounds:SW.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
alBufferData(gSampleSet[pistol1sound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
alSourcei(gSourceID[pistol1sound], AL_BUFFER, gSampleSet[pistol1sound]);
-
FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
LoadOGG_CFH((char *)":Data:Sounds:glock.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
alBufferData(gSampleSet[pistol2sound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
alSourcei(gSourceID[pistol2sound], AL_BUFFER, gSampleSet[pistol2sound]);
-
FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
LoadOGG_CFH((char *)":Data:Sounds:pinpull.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
alBufferData(gSampleSet[pinpullsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
alSourcei(gSourceID[pinpullsound], AL_BUFFER, gSampleSet[pinpullsound]);
-
FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
LoadOGG_CFH((char *)":Data:Sounds:pinreplace.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
alBufferData(gSampleSet[pinreplacesound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
alSourcei(gSourceID[pinreplacesound], AL_BUFFER, gSampleSet[pinreplacesound]);
-
FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
LoadOGG_CFH((char *)":Data:Sounds:handlerelease.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
alBufferData(gSampleSet[grenadethrowsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
alSourcei(gSourceID[grenadethrowsound], AL_BUFFER, gSampleSet[grenadethrowsound]);
-
FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
LoadOGG_CFH((char *)":Data:Sounds:bounce.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
alBufferData(gSampleSet[bouncesound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
alSourcei(gSourceID[bouncesound], AL_BUFFER, gSampleSet[bouncesound]);
-
FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
LoadOGG_CFH((char *)":Data:Sounds:bounce2.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
alBufferData(gSampleSet[bounce2sound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
alSourcei(gSourceID[bounce2sound], AL_BUFFER, gSampleSet[bounce2sound]);
-
FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
LoadOGG_CFH((char *)":Data:Sounds:explosion.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
alBufferData(gSampleSet[explosionsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
alSourcei(gSourceID[explosionsound], AL_BUFFER, gSampleSet[explosionsound]);
-
FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
LoadOGG_CFH((char *)":Data:Sounds:headland.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
alBufferData(gSampleSet[bodywhacksound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
alSourcei(gSourceID[bodywhacksound], AL_BUFFER, gSampleSet[bodywhacksound]);
-
FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
LoadOGG_CFH((char *)":Data:Sounds:rain.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
alBufferData(gSampleSet[rainsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
alSourcei(gSourceID[rainsound], AL_BUFFER, gSampleSet[rainsound]);
-
FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
LoadOGG_CFH((char *)":Data:Sounds:Lose.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
alBufferData(gSampleSet[losesound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
alSourcei(gSourceID[losesound], AL_BUFFER, gSampleSet[losesound]);
-
FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
LoadOGG_CFH((char *)":Data:Sounds:Disguisekill.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
alBufferData(gSampleSet[disguisekillsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
alSourcei(gSourceID[disguisekillsound], AL_BUFFER, gSampleSet[disguisekillsound]);
-
FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
LoadOGG_CFH((char *)":Data:Sounds:knifeslash.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
alBufferData(gSampleSet[knifeslashsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
alSourcei(gSourceID[knifeslashsound], AL_BUFFER, gSampleSet[knifeslashsound]);
-
FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
LoadOGG_CFH((char *)":Data:Sounds:shotgun.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
alBufferData(gSampleSet[shotgunsound], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
alSourcei(gSourceID[shotgunsound], AL_BUFFER, gSampleSet[shotgunsound]);
-
- FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- if(musictoggle){
-
- LoadOGG_CFH((char *)":Data:Sounds:mainmenusong.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[mainmenusong], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[mainmenusong], AL_BUFFER, gSampleSet[mainmenusong]);
-
- FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- LoadOGG_CFH((char *)":Data:Sounds:shootsong.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[shootsong], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[shootsong], AL_BUFFER, gSampleSet[shootsong]);
-
- FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- LoadOGG_CFH((char *)":Data:Sounds:zombiesong.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[zombiesong], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[zombiesong], AL_BUFFER, gSampleSet[zombiesong]);
-
- FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- LoadOGG_CFH((char *)":Data:Sounds:knifesong.ogg",&formatBuffer1, (void **) &pBuffer1,(unsigned int *)&lBuffer1Len,&freqBuffer1);
-
- alBufferData(gSampleSet[knifesong], formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
-
- alSourcei(gSourceID[knifesong], AL_BUFFER, gSampleSet[knifesong]);
-
FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
+ if (musictoggle) {
+ LoadOGG_CFH((char *) ":Data:Sounds:mainmenusong.ogg",
+ &formatBuffer1, (void **) &pBuffer1,
+ (unsigned int *) &lBuffer1Len, &freqBuffer1);
+ alBufferData(gSampleSet[mainmenusong], formatBuffer1, pBuffer1,
+ lBuffer1Len, freqBuffer1);
+ alSourcei(gSourceID[mainmenusong], AL_BUFFER,
+ gSampleSet[mainmenusong]);
+ FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
+
+ LoadOGG_CFH((char *) ":Data:Sounds:shootsong.ogg",
+ &formatBuffer1, (void **) &pBuffer1,
+ (unsigned int *) &lBuffer1Len, &freqBuffer1);
+ alBufferData(gSampleSet[shootsong], formatBuffer1, pBuffer1,
+ lBuffer1Len, freqBuffer1);
+ alSourcei(gSourceID[shootsong], AL_BUFFER,
+ gSampleSet[shootsong]);
+ FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
+
+ LoadOGG_CFH((char *) ":Data:Sounds:zombiesong.ogg",
+ &formatBuffer1, (void **) &pBuffer1,
+ (unsigned int *) &lBuffer1Len, &freqBuffer1);
+ alBufferData(gSampleSet[zombiesong], formatBuffer1, pBuffer1,
+ lBuffer1Len, freqBuffer1);
+ alSourcei(gSourceID[zombiesong], AL_BUFFER,
+ gSampleSet[zombiesong]);
+ FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
+
+ LoadOGG_CFH((char *) ":Data:Sounds:knifesong.ogg",
+ &formatBuffer1, (void **) &pBuffer1,
+ (unsigned int *) &lBuffer1Len, &freqBuffer1);
+ alBufferData(gSampleSet[knifesong], formatBuffer1, pBuffer1,
+ lBuffer1Len, freqBuffer1);
+ alSourcei(gSourceID[knifesong], AL_BUFFER,
+ gSampleSet[knifesong]);
+ FreeOGG(formatBuffer1, pBuffer1, lBuffer1Len, freqBuffer1);
}
-#endif
-
float gLoc[3];
-
gLoc[0]=0;
-
gLoc[1]=0;
-
gLoc[2]=0;
alSourcefv(gSourceID[visionsound], AL_POSITION, gLoc);
-
alSourcei(gSourceID[visionsound], AL_LOOPING, 1);
-
alSourcef(gSourceID[visionsound], AL_MIN_GAIN, 1);
-
alSourcefv(gSourceID[soulinsound], AL_POSITION, gLoc);
-
alSourcei(gSourceID[soulinsound], AL_LOOPING, 0);
-
alSourcef(gSourceID[soulinsound], AL_MIN_GAIN, 1);
-
alSourcefv(gSourceID[souloutsound], AL_POSITION, gLoc);
-
alSourcei(gSourceID[souloutsound], AL_LOOPING, 0);
-
alSourcef(gSourceID[souloutsound], AL_MIN_GAIN, 1);
for(int i=0;i<5;i++){
-
alSourcefv(gSourceID[footstepsound+i], AL_POSITION, gLoc);
-
alSourcei(gSourceID[footstepsound+i], AL_LOOPING, 0);
-
alSourcef(gSourceID[footstepsound+i], AL_MIN_GAIN, 0);
-
}
alSourcefv(gSourceID[bodylandsound], AL_POSITION, gLoc);
-
alSourcei(gSourceID[bodylandsound], AL_LOOPING, 0);
-
alSourcef(gSourceID[bodylandsound], AL_MIN_GAIN, 0);
-
alSourcefv(gSourceID[headlandsound], AL_POSITION, gLoc);
-
alSourcei(gSourceID[headlandsound], AL_LOOPING, 0);
-
alSourcef(gSourceID[headlandsound], AL_MIN_GAIN, 0);
-
alSourcefv(gSourceID[riflesound], AL_POSITION, gLoc);
-
alSourcei(gSourceID[riflesound], AL_LOOPING, 0);
-
alSourcef(gSourceID[riflesound], AL_MIN_GAIN, 0);
-
alSourcefv(gSourceID[bodyhitsound], AL_POSITION, gLoc);
-
alSourcei(gSourceID[bodyhitsound], AL_LOOPING, 0);
-
alSourcef(gSourceID[bodyhitsound], AL_MIN_GAIN, .1);
-
alSourcefv(gSourceID[wallhitsound], AL_POSITION, gLoc);
-
alSourcei(gSourceID[wallhitsound], AL_LOOPING, 0);
-
alSourcef(gSourceID[wallhitsound], AL_MIN_GAIN, 0);
-
alSourcef(gSourceID[wallhitsound], AL_MAX_GAIN, .6);
-
alSourcefv(gSourceID[machinegunsound], AL_POSITION, gLoc);
-
alSourcei(gSourceID[machinegunsound], AL_LOOPING, 0);
-
alSourcef(gSourceID[machinegunsound], AL_MIN_GAIN,0);
-
alSourcefv(gSourceID[nearbulletsound], AL_POSITION, gLoc);
-
alSourcei(gSourceID[nearbulletsound], AL_LOOPING, 0);
-
alSourcef(gSourceID[nearbulletsound], AL_MIN_GAIN,0);
-
alSourcefv(gSourceID[headwhacksound], AL_POSITION, gLoc);
-
alSourcei(gSourceID[headwhacksound], AL_LOOPING, 0);
-
alSourcef(gSourceID[headwhacksound], AL_MIN_GAIN,0);
-
alSourcefv(gSourceID[headshotsound], AL_POSITION, gLoc);
-
alSourcei(gSourceID[headshotsound], AL_LOOPING, 0);
-
alSourcef(gSourceID[headshotsound], AL_MIN_GAIN, 0);
-
alSourcefv(gSourceID[reloadsound], AL_POSITION, gLoc);
-
alSourcei(gSourceID[reloadsound], AL_LOOPING, 0);
-
alSourcef(gSourceID[reloadsound], AL_MIN_GAIN, 0);
-
alSourcefv(gSourceID[clicksound], AL_POSITION, gLoc);
-
alSourcei(gSourceID[clicksound], AL_LOOPING, 0);
-
alSourcef(gSourceID[clicksound], AL_MIN_GAIN, 0);
-
alSourcefv(gSourceID[pistol1sound], AL_POSITION, gLoc);
-
alSourcei(gSourceID[pistol1sound], AL_LOOPING, 0);
-
alSourcef(gSourceID[pistol1sound], AL_MIN_GAIN, 0);
-
alSourcefv(gSourceID[pistol2sound], AL_POSITION, gLoc);
-
alSourcei(gSourceID[pistol2sound], AL_LOOPING, 0);
-
alSourcef(gSourceID[pistol2sound], AL_MIN_GAIN, 0);
-
alSourcefv(gSourceID[pinpullsound], AL_POSITION, gLoc);
-
alSourcei(gSourceID[pinpullsound], AL_LOOPING, 0);
-
alSourcef(gSourceID[pinpullsound], AL_MIN_GAIN,0);
-
alSourcefv(gSourceID[pinreplacesound], AL_POSITION, gLoc);
-
alSourcei(gSourceID[pinreplacesound], AL_LOOPING, 0);
-
alSourcef(gSourceID[pinreplacesound], AL_MIN_GAIN,0);
-
alSourcefv(gSourceID[grenadethrowsound], AL_POSITION, gLoc);
-
alSourcei(gSourceID[grenadethrowsound], AL_LOOPING, 0);
-
alSourcef(gSourceID[grenadethrowsound], AL_MIN_GAIN,0);
-
alSourcefv(gSourceID[bouncesound], AL_POSITION, gLoc);
-
alSourcei(gSourceID[bouncesound], AL_LOOPING, 0);
-
alSourcef(gSourceID[bouncesound], AL_MIN_GAIN,0);
-
alSourcefv(gSourceID[bounce2sound], AL_POSITION, gLoc);
-
alSourcei(gSourceID[bounce2sound], AL_LOOPING, 0);
-
alSourcef(gSourceID[bounce2sound], AL_MIN_GAIN,0);
-
alSourcefv(gSourceID[explosionsound], AL_POSITION, gLoc);
-
alSourcei(gSourceID[explosionsound], AL_LOOPING, 0);
-
alSourcef(gSourceID[explosionsound], AL_MIN_GAIN,0);
-
alSourcefv(gSourceID[bodywhacksound], AL_POSITION, gLoc);
-
alSourcei(gSourceID[bodywhacksound], AL_LOOPING, 0);
-
alSourcef(gSourceID[bodywhacksound], AL_MIN_GAIN, 0);
-
alSourcefv(gSourceID[rainsound], AL_POSITION, gLoc);
-
alSourcei(gSourceID[rainsound], AL_LOOPING, 1);
-
alSourcef(gSourceID[rainsound], AL_MIN_GAIN, .3);
-
alSourcefv(gSourceID[losesound], AL_POSITION, gLoc);
-
alSourcei(gSourceID[losesound], AL_LOOPING, 0);
-
alSourcef(gSourceID[losesound], AL_MIN_GAIN, 1);
-
alSourcefv(gSourceID[disguisekillsound], AL_POSITION, gLoc);
-
alSourcei(gSourceID[disguisekillsound], AL_LOOPING, 0);
-
alSourcef(gSourceID[disguisekillsound], AL_MIN_GAIN, 1);
-
alSourcefv(gSourceID[knifeslashsound], AL_POSITION, gLoc);
-
alSourcei(gSourceID[knifeslashsound], AL_LOOPING, 0);
-
alSourcef(gSourceID[knifeslashsound], AL_MIN_GAIN,0);
-
alSourcefv(gSourceID[shotgunsound], AL_POSITION, gLoc);
-
alSourcei(gSourceID[shotgunsound], AL_LOOPING, 0);
-
alSourcef(gSourceID[shotgunsound], AL_MIN_GAIN, 0);
-
alSourcefv(gSourceID[knifesong], AL_POSITION, gLoc);
-
alSourcei(gSourceID[knifesong], AL_LOOPING, 1);
-
alSourcef(gSourceID[knifesong], AL_MIN_GAIN, 1);
-
alSourcefv(gSourceID[mainmenusong], AL_POSITION, gLoc);
-
alSourcei(gSourceID[mainmenusong], AL_LOOPING, 1);
-
alSourcef(gSourceID[mainmenusong], AL_MIN_GAIN, 1);
-
alSourcefv(gSourceID[zombiesong], AL_POSITION, gLoc);
-
alSourcei(gSourceID[zombiesong], AL_LOOPING, 1);
-
alSourcef(gSourceID[zombiesong], AL_MIN_GAIN, 1);
-
alSourcefv(gSourceID[shootsong], AL_POSITION, gLoc);
-
alSourcei(gSourceID[shootsong], AL_LOOPING, 1);
-
alSourcef(gSourceID[shootsong], AL_MIN_GAIN, 1);
-
}
void Game::LoadingScreen(float percent)
-
{
glLoadIdentity();
//Clear to black
glClearColor(0,0,0,1);
-
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
//Background
glDisable(GL_TEXTURE_2D);
-
glDisable(GL_DEPTH_TEST); // Disables Depth Testing
-
glDisable(GL_CULL_FACE);
-
glDisable(GL_LIGHTING);
-
glDepthMask(0);
-
glMatrixMode(GL_PROJECTION); // Select The Projection Matrix
-
glPushMatrix(); // Store The Projection Matrix
-
glLoadIdentity(); // Reset The Projection Matrix
-
glOrtho(0,640,0,480,-100,100); // Set Up An Ortho Screen
-
glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
-
glPushMatrix(); // Store The Modelview Matrix
for(int i=19;i>=0;i--){
-
glLoadIdentity(); // Reset The Modelview Matrix
-
glTranslatef(120-i*1,190-i*1,0);
-
glScalef(400+i*2,30+i*2,1);
-
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
-
glEnable(GL_BLEND);
-
if(i)glColor4f(1-(float)i/20-percent/100,1-(float)i/20-percent/100,1-(float)i/20-percent/100,1);
-
if(!i)glColor4f(0,0,0,1);
-
glBegin(GL_QUADS);
-
glVertex3f(0, 0, 0.0f);
-
glVertex3f(1, 0, 0.0f);
-
glVertex3f(1, 1, 0.0f);
-
glVertex3f(0, 1, 0.0f);
-
glEnd();
-
}
glMatrixMode(GL_PROJECTION); // Select The Projection Matrix
-
glPopMatrix(); // Restore The Old Projection Matrix
-
glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
-
glPopMatrix(); // Restore The Old Projection Matrix
-
glDisable(GL_BLEND);
-
glDepthMask(1);
//Progress
-
glDisable(GL_DEPTH_TEST); // Disables Depth Testing
-
glDisable(GL_CULL_FACE);
-
glDisable(GL_LIGHTING);
-
glDisable(GL_TEXTURE_2D);
-
glDepthMask(0);
-
glMatrixMode(GL_PROJECTION); // Select The Projection Matrix
-
glPushMatrix(); // Store The Projection Matrix
-
glLoadIdentity(); // Reset The Projection Matrix
-
glOrtho(0,640,0,480,-100,100); // Set Up An Ortho Screen
-
glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
-
glPushMatrix(); // Store The Modelview Matrix
for(int i=19;i>=0;i--){
@@ -1055,13 +439,9 @@ void Game::LoadingScreen(float percent)
sprintf (string, "LOADING...");
text.glPrint(280,195,string,1,1,640,480);
SDL_GL_SwapBuffers( );
-
}
-void LoadPersonSpriteTexture(char *fileName, GLuint *textureid);
-
void LoadPersonSpriteTexture(char *fileName, GLuint *textureid)
-
{
*textureid = loadTexture(fileName);
glBindTexture(GL_TEXTURE_2D, *textureid);
@@ -1069,45 +449,29 @@ void LoadPersonSpriteTexture(char *fileName, GLuint *textureid)
}
void Game::InitGame()
-
{
-
//Setup loading screen
-
float loadingscreenamount=0;
-
float loadingscreenamounttotal=200;
-
if(initialized)loadingscreenamounttotal=20;
-
if(!initialized)LoadingScreen(loadingscreenamount/loadingscreenamounttotal*100);
//Set up rain and snow
-
precipitationhorz=60;
-
precipitationvert=40;
-
precipitationdensity=25;
//Bodyguard stats
-
person[0].playercoords=camera.position;
-
person[0].oldplayercoords=person[0].playercoords;
-
person[0].type=playertype;
-
person[0].existing=1;
for(int i=0;i<10;i++){
-
person[0].reloads[i]=0;
-
}
//Level setup
-
killedinnocent=0; //Haven't shot any civilians yet...
if(customlevels){ //Load custom levels
@@ -1223,339 +587,184 @@ void Game::InitGame()
if(!customlevels){ //Setup hardcoded default levels
if(mission==0){
-
environment=sunny_environment;
-
type=randomshoot_type;
-
possiblegun[0]=handgun1;
-
possiblegun[1]=handgun2;
-
possiblegun[2]=shotgun;
-
numpossibleguns=3;
-
evilprobability=6;
-
person[0].whichgun=assaultrifle;
-
person[0].reloads[person[0].whichgun]=6;
-
if(!gameinprogress)score=0;
-
timeremaining=50;
-
difficulty=.6;
-
}
if(mission==1){
-
environment=snowy_environment;
-
type=randomshoot_type;
-
possiblegun[0]=knife;
-
possiblegun[1]=assaultrifle;
-
numpossibleguns=2;
-
evilprobability=5;
-
person[0].whichgun=handgun2;
-
person[0].reloads[person[0].whichgun]=3;
-
if(!gameinprogress)score=0;
-
timeremaining=40;
-
difficulty=.6;
-
}
if(mission==2){
-
environment=foggy_environment;
-
type=randomshoot_type;
-
possiblegun[0]=sniperrifle;
-
numpossibleguns=1;
-
evilprobability=5;
-
person[0].whichgun=sniperrifle;
-
person[0].reloads[person[0].whichgun]=4;
-
if(!gameinprogress)score=0;
-
timeremaining=50;
-
difficulty=0.9;
-
}
if(mission==3){
-
environment=firey_environment;
-
type=zombie_type;
-
numpossibleguns=0;
-
evilprobability=5;
-
person[0].whichgun=shotgun;
-
person[0].reloads[person[0].whichgun]=5;
-
if(!gameinprogress)score=0;
-
timeremaining=35;
-
difficulty=.7;
-
}
if(mission==4){
-
environment=snowy_environment;
-
type=randomshoot_type;
-
possiblegun[0]=sniperrifle;
-
possiblegun[1]=assaultrifle;
-
numpossibleguns=2;
-
evilprobability=5;
-
person[0].whichgun=grenade;
-
person[0].reloads[person[0].whichgun]=20;
-
if(!gameinprogress)score=0;
-
timeremaining=30;
-
difficulty=.5;
-
}
if(mission==5){
-
environment=rainy_environment;
-
type=randomshoot_type;
-
possiblegun[0]=handgun1;
-
possiblegun[1]=shotgun;
-
possiblegun[2]=assaultrifle;
-
numpossibleguns=3;
-
evilprobability=6;
-
person[0].whichgun=knife;
-
person[0].reloads[person[0].whichgun]=3;
-
if(!gameinprogress)score=0;
-
timeremaining=40;
-
difficulty=.8;
-
}
if(mission==6){
-
environment=night_environment;
-
type=randomshoot_type;
-
possiblegun[1]=handgun1;
-
possiblegun[2]=handgun2;
-
possiblegun[3]=shotgun;
-
numpossibleguns=3;
-
evilprobability=5;
-
person[0].whichgun=handgun1;
-
person[0].reloads[person[0].whichgun]=4;
-
if(!gameinprogress)score=0;
-
timeremaining=30;
-
difficulty=1;
-
}
if(mission==7){
-
environment=firey_environment;
-
type=zombie_type;
-
person[0].whichgun=assaultrifle;
-
person[0].reloads[person[0].whichgun]=5;
-
if(!gameinprogress)score=0;
-
timeremaining=30;
-
difficulty=1;
-
}
if(mission==8){
-
environment=rainy_environment;
-
type=randomshoot_type;
-
possiblegun[0]=handgun1;
-
possiblegun[1]=handgun2;
-
possiblegun[2]=shotgun;
-
possiblegun[3]=sniperrifle;
-
possiblegun[4]=assaultrifle;
-
numpossibleguns=5;
-
evilprobability=5;
-
person[0].whichgun=nogun;
-
person[0].reloads[person[0].whichgun]=3;
-
if(!gameinprogress)score=0;
-
timeremaining=40;
-
difficulty=.8;
-
}
if(mission==9){
-
environment=snowy_environment;
-
type=randomshoot_type;
-
possiblegun[0]=knife;
-
possiblegun[1]=handgun1;
-
possiblegun[2]=handgun2;
-
possiblegun[3]=shotgun;
-
possiblegun[4]=sniperrifle;
-
possiblegun[5]=assaultrifle;
-
numpossibleguns=6;
-
evilprobability=4;
-
person[0].whichgun=handgun1;
-
person[0].reloads[person[0].whichgun]=3;
-
if(!gameinprogress)score=0;
-
timeremaining=90;
-
difficulty=1;
-
}
if(mission==10){
-
environment=night_environment;
-
type=randomshoot_type;
-
possiblegun[0]=sniperrifle;
-
numpossibleguns=1;
-
evilprobability=5;
-
person[0].whichgun=sniperrifle;
-
person[0].reloads[person[0].whichgun]=4;
-
if(!gameinprogress)score=0;
-
timeremaining=30;
-
difficulty=1.3;
-
}
if(mission==11){
-
environment=sunny_environment;
-
type=randomshoot_type;
-
possiblegun[0]=knife;
-
possiblegun[1]=sniperrifle;
-
numpossibleguns=2;
-
evilprobability=4;
-
person[0].whichgun=knife;
-
if(!gameinprogress)score=0;
-
timeremaining=30;
-
difficulty=1.5;
-
}
if(mission==12){
-
environment=firey_environment;
-
type=zombie_type;
-
possiblegun[0]=knife;
-
possiblegun[1]=sniperrifle;
-
person[0].whichgun=handgun2;
-
person[0].reloads[person[0].whichgun]=10;
-
if(!gameinprogress)score=0;
-
timeremaining=60;
-
difficulty=1.5;
-
}
nummissions=13;
@@ -1563,113 +772,72 @@ void Game::InitGame()
}
//Setup fast radian to degree conversion
-
rad2deg= 56.54866776;
-
visions=0;
//Setup bounding cylinder model
-
float boundingscale=3;
if(!initialized){
-
boundingpoints[0]=0;
-
boundingpoints[0].z=boundingscale;
-
boundingpoints[0].y=0;
for(int i=1;i<8;i++){
-
boundingpoints[i]=DoRotation(boundingpoints[0],0,i*360/7,0);
-
}
-
}
civkills=0;
-
badkills=0;
-
goodkills=0;
-
enemystate=2;
if(!initialized){
-
if(!azertykeyboard){
-
forwardskey=MAC_W_KEY;
-
backwardskey=MAC_S_KEY;
-
leftkey=MAC_A_KEY;
-
rightkey=MAC_D_KEY;
-
aimkey=MAC_Q_KEY;
-
psychicaimkey=MAC_E_KEY;
-
psychickey=MAC_Z_KEY;
-
}
if(azertykeyboard){
-
forwardskey=MAC_Z_KEY;
-
backwardskey=MAC_S_KEY;
-
leftkey=MAC_Q_KEY;
-
rightkey=MAC_D_KEY;
-
aimkey=MAC_A_KEY;
-
psychicaimkey=MAC_E_KEY;
-
psychickey=MAC_W_KEY;
-
}
soundscalefactor=soundscalefactordefault; //Setup sound falloff
-
gQuit=false;
//Sounds
-
LoadSounds(musictoggle);
//Play correct song
-
if(environment==rainy_environment)alSourcePlay(gSourceID[rainsound]);
-
if(environment!=rainy_environment)alSourcePause(gSourceID[rainsound]);
alSourceStop(gSourceID[whichsong]);
-
alSourcef(gSourceID[whichsong], AL_MIN_GAIN, 0);
-
alSourcef(gSourceID[whichsong], AL_MAX_GAIN, 0);
whichsong=mainmenusong;
-
alSourceStop(gSourceID[whichsong]);
-
alSourcef(gSourceID[whichsong], AL_PITCH, 1);
-
alSourcePlay(gSourceID[whichsong]);
-
alSourcef(gSourceID[whichsong], AL_MIN_GAIN, 1);
-
alSourcef(gSourceID[whichsong], AL_MAX_GAIN, 1);
}
loadingscreenamount+=5;
-
if(!initialized)LoadingScreen(loadingscreenamount/loadingscreenamounttotal*100);
//Setup random seed
@@ -1696,91 +864,57 @@ void Game::InitGame()
person[0].speedmult=1.3;
//Add vip
-
person[numpeople].playerrotation=0;
-
person[numpeople].whichcostume=vipcostume;
-
person[numpeople].whichblockx=((person[0].playercoords.x+block_spacing/2)/block_spacing);
-
person[numpeople].whichblocky=((person[0].playercoords.x+block_spacing/2)/block_spacing);
-
person[numpeople].pathnum=-1;
-
person[numpeople].oldpathnum=-1;
-
person[numpeople].oldoldpathnum=-1;
-
person[numpeople].oldoldoldpathnum=-1;
while(person[numpeople].pathnum<0||person[numpeople].pathnum>=path.vertexNum||person[numpeople].pathnum==1){
-
person[numpeople].pathnum=Random()%path.vertexNum;
-
}
person[numpeople].pathtarget.x=path.vertex[person[numpeople].pathnum].x;
-
person[numpeople].pathtarget.z=path.vertex[person[numpeople].pathnum].z;
-
person[numpeople].pathsize=.98+float(abs(Random()%20))/400;
-
person[numpeople].pathtarget*=person[numpeople].pathsize;
-
person[numpeople].pathtarget.x+=person[numpeople].whichblockx*block_spacing;
-
person[numpeople].pathtarget.z+=person[numpeople].whichblocky*block_spacing;
-
person[numpeople].playercoords=person[numpeople].pathtarget;
-
person[numpeople].oldplayercoords=person[numpeople].playercoords;
person[0].playercoords=person[numpeople].playercoords;
-
person[0].playercoords.x+=1;
-
person[0].playercoords.z+=1;
-
person[0].oldplayercoords=person[0].playercoords;
person[numpeople].skeleton.free=0;
-
person[numpeople].targetanimation=walkanim;
-
person[numpeople].speed=1;
-
person[numpeople].existing=0;
-
person[numpeople].speedmult=1;
-
if(type==zombie_type)person[numpeople].speedmult=.8;
person[numpeople].health=100;
-
person[numpeople].playerrotation2=0;//20;
-
person[numpeople].lastdistancevictim=200000;
if(person[numpeople].skeleton.broken)person[numpeople].skeleton.Load((char *)":Data:Skeleton:Basic Figure");
person[numpeople].type=viptype;
-
person[numpeople].whichgun=nogun; person[numpeople].aiming=0; person[numpeople].killtarget=-1;
-
person[numpeople].existing=1;
citypeoplenum[person[numpeople].whichblockx][person[numpeople].whichblocky]++;
-
numpeople++;
-
spawndelay=.1;
XYZ vipdistance;
-
vipdistance=0;
-
vipdistance.x=10000000;
-
vipgoal=person[1].playercoords+DoRotation(vipdistance,0,Random()%360,0);
//Setup block models