[Moeng-cvs] BBRpg/src rpg.cpp,1.7,1.8 sound.cpp,1.7,1.8 sound.h,1.5,1.6
Status: Alpha
Brought to you by:
b_lindeijer
From: <b_l...@us...> - 2004-01-03 22:41:12
|
Update of /cvsroot/moeng/BBRpg/src In directory sc8-pr-cvs1:/tmp/cvs-serv32612/src Modified Files: rpg.cpp sound.cpp sound.h Log Message: - Seperate music and sample volumes. - Added music change to saving Brian. Index: rpg.cpp =================================================================== RCS file: /cvsroot/moeng/BBRpg/src/rpg.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** rpg.cpp 3 Jan 2004 21:56:19 -0000 1.7 --- rpg.cpp 3 Jan 2004 22:41:02 -0000 1.8 *************** *** 108,115 **** bVSync = get_config_int("Video", "VSync", 0); - #ifdef ENABLE_MUSIC sound_enabled = (get_config_int("Sound", "EnableMusic", 1)) ? 1 : 0; - #endif sfx_enabled = (get_config_int("Sound", "EnableSfx", 1)) ? 1 : 0; // Screen initialisation --- 108,115 ---- bVSync = get_config_int("Video", "VSync", 0); sound_enabled = (get_config_int("Sound", "EnableMusic", 1)) ? 1 : 0; sfx_enabled = (get_config_int("Sound", "EnableSfx", 1)) ? 1 : 0; + music_vol = get_config_int("Sound", "MusicVolume", 255); + sfx_vol = get_config_int("Sound", "SfxVolume", 255); // Screen initialisation Index: sound.cpp =================================================================== RCS file: /cvsroot/moeng/BBRpg/src/sound.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** sound.cpp 3 Jan 2004 21:56:19 -0000 1.7 --- sound.cpp 3 Jan 2004 22:41:02 -0000 1.8 *************** *** 26,29 **** --- 26,32 ---- int sound_enabled = 1; int sfx_enabled = 1; + int sfx_vol = 255; + int music_vol = 255; + #ifdef ENABLE_MUSIC *************** *** 109,112 **** --- 112,116 ---- } channels[channel].ass = alogg_get_audio_stream(channels[channel].stream); + voice_set_volume(channels[channel].ass->voice, music_vol); } *************** *** 152,156 **** if (error == NULL) { ! voice_set_volume(channels[channel].ass->voice, vol); //alogg_adjust_oggstream(ogg[channel]->s, vol, pan, speed); //console.log(CON_LOG | CON_CONSOLE, CON_ALWAYS, "Adjusted channel parameters (%d, %d, %d, %d)", channel, vol, pan, speed); --- 156,160 ---- if (error == NULL) { ! voice_set_volume(channels[channel].ass->voice, int(vol * (float(music_vol) / 255.0f))); //alogg_adjust_oggstream(ogg[channel]->s, vol, pan, speed); //console.log(CON_LOG | CON_CONSOLE, CON_ALWAYS, "Adjusted channel parameters (%d, %d, %d, %d)", channel, vol, pan, speed); *************** *** 245,249 **** if (found_object) { //int play_sample(const SAMPLE *spl, int vol, int pan, int freq, int loop); ! play_sample((SAMPLE*)found_object->dat, 255, 128, 1000, 0); } else { return luaL_error(L, "Error: Cannot find requested sample (%s)!", name); --- 249,253 ---- if (found_object) { //int play_sample(const SAMPLE *spl, int vol, int pan, int freq, int loop); ! play_sample((SAMPLE*)found_object->dat, sfx_vol, 128, 1000, 0); } else { return luaL_error(L, "Error: Cannot find requested sample (%s)!", name); Index: sound.h =================================================================== RCS file: /cvsroot/moeng/BBRpg/src/sound.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** sound.h 3 Jan 2004 21:56:19 -0000 1.5 --- sound.h 3 Jan 2004 22:41:02 -0000 1.6 *************** *** 23,26 **** --- 23,28 ---- extern int sound_enabled; extern int sfx_enabled; + extern int sfx_vol; + extern int music_vol; //#define DATASZ (1 << 15) /* (32768) amount of data to read from disk each time */ |