X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FGameInitDispose.cpp;h=db565c2faf9d995705484362096a8a4b6f8a359a;hb=5c782b3db07f267af786942b6dd099624d7aa627;hp=da5516cb1abf2352a270386ba6660681a3770025;hpb=f4685cb5e78e8e8056448d1de1bb75edb9a4fb1b;p=lugaru.git diff --git a/Source/GameInitDispose.cpp b/Source/GameInitDispose.cpp index da5516c..db565c2 100644 --- a/Source/GameInitDispose.cpp +++ b/Source/GameInitDispose.cpp @@ -34,13 +34,11 @@ extern float gravity; extern Light light; extern Skeleton testskeleton; extern int numsounds; -extern int channels[100]; extern Terrain terrain; //extern Sprites sprites; extern int kTextureSize; extern float texdetail; extern float realtexdetail; -extern float terraindetail; extern float volume; extern Objects objects; extern int detail; @@ -51,9 +49,6 @@ extern bool ismotionblur; extern bool trilinear; extern bool osx; extern bool musictoggle; -extern Weapons weapons; -extern Person player[maxplayers]; -extern int numplayers; extern int environment; extern bool ambientsound; extern float multiplier; @@ -74,7 +69,6 @@ extern int whichjointendarray[26]; extern int difficulty; extern float tintr,tintg,tintb; extern float slomospeed; -extern char mapname[256]; extern bool gamestarted; extern int numdialogues; @@ -100,9 +94,6 @@ extern float accountcampaigntime[10]; extern int accountcampaignchoicesmade[10]; extern int accountcampaignchoices[10][5000]; -extern "C" void PlaySoundEx(int channel, OPENAL_SAMPLE *sptr, OPENAL_DSPUNIT *dsp, signed char startpaused); -extern "C" void PlayStreamEx(int chan, OPENAL_STREAM *sptr, OPENAL_DSPUNIT *dsp, signed char startpaused); - void LOG(const std::string &fmt, ...) { // !!! FIXME: write me. @@ -822,20 +813,14 @@ void Game::InitGame() if(detail==2){ texdetail=1; - terraindetail=1; } if(detail==1){ texdetail=2; - terraindetail=1; } if(detail==0){ texdetail=4; - terraindetail=1; - //terraindetail=2; } - memset(channels, 0xff, sizeof(channels)); - LOG("Initializing sound system..."); int output = -1; @@ -876,11 +861,8 @@ void Game::InitGame() OPENAL_SetSFXMasterVolume((int)(volume*255)); loadAllSounds(); - if(musictoggle){ - PlayStreamEx(stream_music3, samp[stream_music3], 0, true); - OPENAL_SetPaused(channels[stream_music3], false); - OPENAL_SetVolume(channels[stream_music3], 256); - } + if(musictoggle) + emit_stream_np(stream_music3); LoadTexture(":Data:Textures:Cursor.png",&cursortexture,0,1); @@ -929,11 +911,6 @@ void Game::LoadStuff() visibleloading=1; - /*musicvolume[3]=512; - PlaySoundEx( music4, samp[music4], NULL, true); - OPENAL_SetPaused(channels[music4], false); - OPENAL_SetVolume(channels[music4], 512); - */ loadtime=0; stillloading=1; @@ -972,16 +949,12 @@ void Game::LoadStuff() if(detail==2){ texdetail=1; - terraindetail=1; } if(detail==1){ texdetail=2; - terraindetail=1; } if(detail==0){ texdetail=4; - terraindetail=1; - //terraindetail=2; } realtexdetail=texdetail; @@ -1129,7 +1102,7 @@ void Game::LoadStuff() gravity=-10; texscale=.2/megascale/viewdistdetail; - terrain.scale=3*megascale*terraindetail*viewdistdetail; + terrain.scale=3*megascale*viewdistdetail; viewer.x=terrain.size/2*terrain.scale; viewer.z=terrain.size/2*terrain.scale; @@ -1263,12 +1236,7 @@ void Game::LoadStuff() } if(targetlevel!=7){ - float gLoc[3]={0,0,0}; - float vel[3]={0,0,0}; - PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - OPENAL_3D_SetAttributes(channels[fireendsound], gLoc, vel); - OPENAL_SetVolume(channels[fireendsound], 256); - OPENAL_SetPaused(channels[fireendsound], false); + emit_sound_at(fireendsound); } stillloading=0;