From 0cd7c9a5ae846f12d50ee888fb2cdabe98e6e5e2 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 13 Dec 2019 18:28:58 +0100 Subject: [PATCH] - removed the "configuration" Exhumed came with. Seriously, what's the point of emulating something this worthless? All settings have been remapped to the global CVARs. --- source/exhumed/src/exhumed.cpp | 16 --------- source/exhumed/src/exhumed.h | 2 -- source/exhumed/src/init.cpp | 50 --------------------------- source/exhumed/src/menu.cpp | 63 +++------------------------------- source/exhumed/src/movie.cpp | 2 +- source/exhumed/src/sound.cpp | 37 ++++---------------- 6 files changed, 11 insertions(+), 159 deletions(-) diff --git a/source/exhumed/src/exhumed.cpp b/source/exhumed/src/exhumed.cpp index 8026271c3..71b869897 100644 --- a/source/exhumed/src/exhumed.cpp +++ b/source/exhumed/src/exhumed.cpp @@ -1041,20 +1041,6 @@ void CheckKeys() buttonMap.ClearButton(gamefunc_Enlarge_Screen); } - // F11? -#if 0 - if (buttonMap.ButtonDown(gamefunc_Gamma_Correction)) - { - nGamma++; - - if (nGamma > 4) - nGamma = 0; - - mysetbrightness((uint8_t)nGamma); - buttonMap.ClearButton(gamefunc_Gamma_Correction); - } -#endif - if (buttonMap.ButtonDown(gamefunc_Shrink_Screen)) { if (bFullScreen) @@ -2005,7 +1991,6 @@ int GameInterface::app_main() myloadconfig(); InitFX(); LoadFX(); - setCDaudiovolume(gMusicVolume); seq_LoadSequences(); InitStatus(); InitTimer(); @@ -2240,7 +2225,6 @@ LOOP3: ClearSerialInbuf(); } - mysetbrightness((uint8_t)nGamma); //int edi = totalclock; tclocks2 = totalclock; CONTROL_BindsEnabled = 1; diff --git a/source/exhumed/src/exhumed.h b/source/exhumed/src/exhumed.h index 2dd1ca62d..66713abd6 100644 --- a/source/exhumed/src/exhumed.h +++ b/source/exhumed/src/exhumed.h @@ -229,8 +229,6 @@ extern short screensize; extern int totalmoves; -extern short nGamma; - extern int lCountDown; extern short bSlipMode; diff --git a/source/exhumed/src/init.cpp b/source/exhumed/src/init.cpp index 12c14f3e9..ec6920283 100644 --- a/source/exhumed/src/init.cpp +++ b/source/exhumed/src/init.cpp @@ -1031,62 +1031,12 @@ void LoadObjects() int myloadconfig() { - FILE *fp = fopen("psa.ini", "rb"); - - if (fp == NULL) - { - gFXVolume = 200; - nGamma = 2; - gMusicVolume = 200; - bFullScreen = 0; - mysetbrightness((uint8_t)nGamma); - - lMouseSens = 8; - return -1; - } - - fread(&gFXVolume, sizeof(gFXVolume), 1, fp); - fread(&gMusicVolume, sizeof(gMusicVolume), 1, fp); - fread(&screensize, sizeof(screensize), 1, fp); - fread(&bFullScreen, sizeof(bFullScreen), 1, fp); - fread(&nGamma, sizeof(nGamma), 1, fp); - fread(&lMouseSens, sizeof(lMouseSens), 1, fp); - - if (screensize < 0 || screensize > 15) { - screensize = 0; - } - - fclose(fp); - - if (gFXVolume > 255) { - gFXVolume = 125; - } - - if (gMusicVolume > 255) { - gMusicVolume = 125; - } return 1; } int mysaveconfig() { - FILE *fp = fopen("psa.ini", "wb"); - if (fp == NULL) { - return -1; - } - - fwrite(&gFXVolume, sizeof(gFXVolume), 1, fp); - fwrite(&gMusicVolume, sizeof(gMusicVolume), 1, fp); - - short nSize = screensize; - - fwrite(&nSize, sizeof(nSize), 1, fp); - fwrite(&bFullScreen, sizeof(bFullScreen), 1, fp); - fwrite(&nGamma, sizeof(nGamma), 1, fp); - fwrite(&lMouseSens, sizeof(lMouseSens), 1, fp); - - fclose(fp); return 1; } END_PS_NS diff --git a/source/exhumed/src/menu.cpp b/source/exhumed/src/menu.cpp index f3a22a6ea..2c8529a4a 100644 --- a/source/exhumed/src/menu.cpp +++ b/source/exhumed/src/menu.cpp @@ -852,21 +852,22 @@ void menu_AdjustVolume() overwritesprite(80, 50, kMenuMusicTile, (Sin((int)totalclock << 4) >> 9) * (nOption == 0), 2, kPalNormal); overwritesprite(55, 75, kMenuBlankTitleTile, 0, 2, kPalNormal); + /* seq_DrawGunSequence( SeqOffsets[kSeqSlider], // eax gMusicVolume % 3, // pick one of 3 frames? (gMusicVolume >> 1) - 93, // ebx. must be x??? -22, 0, - 0); + 0);*/ overwritesprite(80, 110, kMenuSoundFxTile, (Sin((int)totalclock << 4) >> 9) * (nOption == 1), 2, kPalNormal); overwritesprite(55, 135, kMenuBlankTitleTile, 0, 2, kPalNormal); seq_DrawGunSequence( SeqOffsets[kSeqSlider], - gFXVolume % 3, - (gFXVolume / 2) - 93, + snd_fxvolume % 3, + (snd_fxvolume / 2) - 93, 38, 0, 0); @@ -914,67 +915,11 @@ void menu_AdjustVolume() if (I_MenuLeft()) { I_MenuLeftClear(); - switch (nOption) - { - case 0: - { - if (gMusicVolume > 3) { - gMusicVolume -= 4; - } - -// TODO SetMusicVolume(); - setCDaudiovolume(gMusicVolume); - continue; - } - - case 1: - { - if (gFXVolume > 3) { - gFXVolume -= 4; - } - - if (LocalSoundPlaying()) { - UpdateLocalSound(); - } - else { - PlayLocalSound(StaticSound[kSound23], 0); - } - continue; - } - } } if (I_MenuRight()) { I_MenuRightClear(); - switch (nOption) - { - case 0: - { - if (gMusicVolume < 252) { - gMusicVolume += 4; - } - -// SetMusicVolume(); - setCDaudiovolume(gMusicVolume); - continue; - } - - case 1: - { - if (gFXVolume < 252) { - gFXVolume += 4; - } - - if (LocalSoundPlaying()) { - UpdateLocalSound(); - } - else { - PlayLocalSound(StaticSound[kSound23], 0); - } - continue; - } - } } if (GetLocalSound() != 23) { diff --git a/source/exhumed/src/movie.cpp b/source/exhumed/src/movie.cpp index 8b37e13d3..e6ca04b71 100644 --- a/source/exhumed/src/movie.cpp +++ b/source/exhumed/src/movie.cpp @@ -261,7 +261,7 @@ void PlayMovie(const char* fileName) if (ReadFrame(fp)) { // start audio playback - hFx = FX_StartDemandFeedPlayback(ServeSample, kSampleRate, 0, gMusicVolume, gMusicVolume, gMusicVolume, FX_MUSIC_PRIORITY, fix16_one, -1); + hFx = FX_StartDemandFeedPlayback(ServeSample, kSampleRate, 0, mus_volume, mus_volume, mus_volume, FX_MUSIC_PRIORITY, fix16_one, -1); while (!inputState.keyBufferWaiting()) { diff --git a/source/exhumed/src/sound.cpp b/source/exhumed/src/sound.cpp index 2c6d57c8c..e3bff7884 100644 --- a/source/exhumed/src/sound.cpp +++ b/source/exhumed/src/sound.cpp @@ -50,8 +50,6 @@ extern "C" { } #endif -short gMusicVolume = 200; -short gFXVolume = 200; short nSoundsPlaying = 0; short nAmbientChannel = -1; @@ -738,7 +736,7 @@ void UpdateSounds() return; } - int nVolume = gFXVolume+10-(Sin(nDist<<1)>>6); + int nVolume = snd_fxvolume+10-(Sin(nDist<<1)>>6); if (nVolume < 0) nVolume = 0; if (nVolume > 255) @@ -827,7 +825,7 @@ void UpdateLocalSound(void) return; if (sActiveSound[nLocalChan].f_e >= 0) - FX_SetPan(sActiveSound[nLocalChan].f_e, gFXVolume, gFXVolume, gFXVolume); + FX_SetPan(sActiveSound[nLocalChan].f_e, snd_fxvolume, snd_fxvolume, snd_fxvolume); } void StopLocalSound(void) @@ -863,18 +861,7 @@ void PlaySound(int nSound) if (handle >= 0) FX_StopSound(handle); - handle = FX_Play(SoundBuf[nSound], SoundLen[nSound], bLoop ? 0 : -1, 0, 0, gFXVolume, gFXVolume, gFXVolume, 0, fix16_one, -1); - -#if 0 - AIL_init_sample(handle); - AIL_set_sample_file(handle, SoundBuf[nSound], -1); - AIL_set_sample_volume(handle, gFXVolume>>1); - - if (SoundBuf[nSound][26] == 6) - AIL_set_sample_loop_count(handle, 0); - - AIL_start_sample(handle); -#endif + handle = FX_Play(SoundBuf[nSound], SoundLen[nSound], bLoop ? 0 : -1, 0, 0, snd_fxvolume, snd_fxvolume, snd_fxvolume, 0, fix16_one, -1); } void PlayLocalSound(short nSound, short nRate) @@ -897,7 +884,7 @@ void PlayLocalSound(short nSound, short nRate) if (pASound->f_e >= 0) FX_StopSound(pASound->f_e); - pASound->f_e = FX_Play(SoundBuf[nSound], SoundLen[nSound], bLoop ? 0 : -1, 0, 0, gFXVolume, gFXVolume, gFXVolume, 0, fix16_one, nLocalChan); + pASound->f_e = FX_Play(SoundBuf[nSound], SoundLen[nSound], bLoop ? 0 : -1, 0, 0, snd_fxvolume, snd_fxvolume, snd_fxvolume, 0, fix16_one, nLocalChan); if (nRate) { @@ -905,19 +892,7 @@ void PlayLocalSound(short nSound, short nRate) FX_GetFrequency(pASound->f_e, &nFreq); FX_SetFrequency(pASound->f_e, nFreq+nRate); } -#if 0 - AIL_init_sample(pASound->f_e); - AIL_set_sample_file(pASound->f_e, SoundBuf[nSound], -1); - AIL_set_sample_volume(pASound->f_e, gFXVolume>>1); - if (nRate) - AIL_set_sample_playback_rate(pASound->f_e, AIL_sample_playback_rate(pASound->f_e)+nRate); - - if (SoundBuf[nSound][26] == 6) - AIL_set_sample_loop_count(pASound->f_e, 0); - - AIL_start_sample(pASound->f_e); -#endif pASound->f_2 = nSound; SetLocalChan(0); } @@ -993,7 +968,7 @@ short PlayFX2(unsigned short nSound, short nSprite) if (!v1c) { - nVolume = gFXVolume+10-(Sin(nDist<<1)>>6)-10; + nVolume = snd_fxvolume+10-(Sin(nDist<<1)>>6)-10; if (nVolume <= 0) { if ((int16_t)nSound > -1) @@ -1004,7 +979,7 @@ short PlayFX2(unsigned short nSound, short nSprite) nVolume = 255; } else - nVolume = gFXVolume; + nVolume = snd_fxvolume; short vc = nSound & (~0x1ff); short v4 = nSound & 0x2000;