[Scummvm-cvs-logs] SF.net SVN: scummvm:[35303] scummvm/trunk/engines/kyra
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Thu Dec 11 14:54:19 CET 2008
Revision: 35303
http://scummvm.svn.sourceforge.net/scummvm/?rev=35303&view=rev
Author: lordhoto
Date: 2008-12-11 13:54:18 +0000 (Thu, 11 Dec 2008)
Log Message:
-----------
Whoops changed integer size of variables storing volume information, now volume of 256 should work as expected.
Modified Paths:
--------------
scummvm/trunk/engines/kyra/sound.h
scummvm/trunk/engines/kyra/sound_midi.cpp
Modified: scummvm/trunk/engines/kyra/sound.h
===================================================================
--- scummvm/trunk/engines/kyra/sound.h 2008-12-11 13:44:58 UTC (rev 35302)
+++ scummvm/trunk/engines/kyra/sound.h 2008-12-11 13:54:18 UTC (rev 35303)
@@ -348,8 +348,7 @@
static void onTimer(void *data);
// Our channel handling
- uint8 _musicVolume;
- uint8 _sfxVolume;
+ int _musicVolume, _sfxVolume;
uint32 _fadeStartTime;
bool _fadeMusicOut;
Modified: scummvm/trunk/engines/kyra/sound_midi.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound_midi.cpp 2008-12-11 13:44:58 UTC (rev 35302)
+++ scummvm/trunk/engines/kyra/sound_midi.cpp 2008-12-11 13:54:18 UTC (rev 35303)
@@ -36,7 +36,7 @@
MidiOutput(OSystem *system, MidiDriver *output, bool isMT32, bool defaultMT32);
~MidiOutput();
- void setSourceVolume(int source, uint8 volume, bool apply=false);
+ void setSourceVolume(int source, int volume, bool apply=false);
void initSource(int source);
void deinitSource(int source);
@@ -95,7 +95,7 @@
int _curSource;
struct SoundSource {
- byte volume;
+ int volume;
int8 channelMap[16];
byte channelProgram[16];
@@ -158,7 +158,7 @@
}
for (int i = 0; i < 4; ++i) {
- _sources[i].volume = 0xFF;
+ _sources[i].volume = 256;
initSource(i);
}
}
@@ -317,7 +317,7 @@
_output->metaEvent(type, data, length);
}
-void MidiOutput::setSourceVolume(int source, uint8 volume, bool apply) {
+void MidiOutput::setSourceVolume(int source, int volume, bool apply) {
_sources[source].volume = volume;
if (apply) {
@@ -532,7 +532,7 @@
if (!_output)
return;
- uint8 newMusVol = ConfMan.getInt("music_volume");
+ int newMusVol = ConfMan.getInt("music_volume");
_sfxVolume = ConfMan.getInt("sfx_volume");
_output->setSourceVolume(0, newMusVol, newMusVol != _musicVolume);
@@ -677,7 +677,7 @@
static const uint32 musicFadeTime = 1 * 1000;
if (midi->_fadeStartTime + musicFadeTime > midi->_vm->_system->getMillis()) {
- byte volume = (byte)((musicFadeTime - (midi->_vm->_system->getMillis() - midi->_fadeStartTime)) * midi->_musicVolume / musicFadeTime);
+ int volume = (byte)((musicFadeTime - (midi->_vm->_system->getMillis() - midi->_fadeStartTime)) * midi->_musicVolume / musicFadeTime);
midi->_output->setSourceVolume(0, volume, true);
} else {
for (int i = 0; i < 16; ++i)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list