ADDED save/load gb_effects_config to/from ini file

git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@654 a31d4220-a93d-0410-bf67-fe4944624d44
This commit is contained in:
spacy51 2008-08-27 19:18:07 +00:00
parent 20b1f8852d
commit 42ddf91111
2 changed files with 13 additions and 5 deletions

View File

@ -92,7 +92,7 @@ static void flush_samples()
int const chan_count = 4;
gb_effects_config_t gb_effects_config;
gb_effects_config_t gb_effects_config = { false, 0.0f, 0.0f, false };
static gb_effects_config_t gb_effects_config_current;
static int prevSoundEnable = -1;
@ -181,10 +181,6 @@ static void remake_stereo_buffer()
void gbSoundReset()
{
gb_effects_config.echo = 0.20f;
gb_effects_config.stereo = 0.15f;
gb_effects_config.surround = false;
SOUND_CLOCK_TICKS = 20000;
remake_stereo_buffer();

View File

@ -47,6 +47,7 @@
#include "../Util.h"
#include "../dmg/gbGlobals.h"
#include "../dmg/gbPrinter.h"
#include "../dmg/gbSound.h"
/* Link
---------------------*/
@ -1595,6 +1596,11 @@ void VBA::loadSettings()
if(soundInterpolation < 0 || soundInterpolation > 1)
soundInterpolation = 0;
gb_effects_config.enabled = 1 == regQueryDwordValue( "gbSoundEffectsEnabled", 0 );
gb_effects_config.surround = 1 == regQueryDwordValue( "gbSoundEffectsSurround", 0 );
gb_effects_config.echo = (float)regQueryDwordValue( "gbSoundEffectsEcho", 0 ) / 100.0f;
gb_effects_config.stereo = (float)regQueryDwordValue( "gbSoundEffectsStereo", 0 ) / 100.0f;
tripleBuffering = regQueryDwordValue("tripleBuffering", false) ? true : false;
#ifndef NO_D3D
@ -2584,6 +2590,12 @@ void VBA::saveSettings()
regSetDwordValue("soundVolume", (DWORD)(soundGetVolume() * 100.0f));
regSetDwordValue("soundInterpolation", soundInterpolation);
regSetDwordValue( "gbSoundEffectsEnabled", gb_effects_config.enabled ? 1 : 0 );
regSetDwordValue( "gbSoundEffectsSurround", gb_effects_config.surround ? 1 : 0 );
regSetDwordValue( "gbSoundEffectsEcho", (DWORD)( gb_effects_config.echo * 100.0f ) );
regSetDwordValue( "gbSoundEffectsStereo", (DWORD)( gb_effects_config.stereo * 100.0f ) );
regSetDwordValue("tripleBuffering", tripleBuffering);
#ifndef NO_D3D