aboutsummaryrefslogtreecommitdiff
path: root/engines/sword1/sound.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2009-05-24 15:17:42 +0000
committerJohannes Schickel2009-05-24 15:17:42 +0000
commitb3c6751b9b7fc1401fd5e87a034cdaec92b67b20 (patch)
treeaa00dba58fb88ea2e095b886963370c7290c692b /engines/sword1/sound.cpp
parent7c1eb057146af11793c627327f3fefe309d27fbb (diff)
downloadscummvm-rg350-b3c6751b9b7fc1401fd5e87a034cdaec92b67b20.tar.gz
scummvm-rg350-b3c6751b9b7fc1401fd5e87a034cdaec92b67b20.tar.bz2
scummvm-rg350-b3c6751b9b7fc1401fd5e87a034cdaec92b67b20.zip
Strip trailing whitespaces in the whole code base.
svn-id: r40867
Diffstat (limited to 'engines/sword1/sound.cpp')
-rw-r--r--engines/sword1/sound.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/engines/sword1/sound.cpp b/engines/sword1/sound.cpp
index d03afa809a..1f2ad04f08 100644
--- a/engines/sword1/sound.cpp
+++ b/engines/sword1/sound.cpp
@@ -161,12 +161,12 @@ void Sound::playSample(QueueElement *elem) {
if (_fxList[elem->id].roomVolList[cnt].roomNo) {
if ((_fxList[elem->id].roomVolList[cnt].roomNo == (int)Logic::_scriptVars[SCREEN]) ||
(_fxList[elem->id].roomVolList[cnt].roomNo == -1)) {
-
+
uint8 volL = (_fxList[elem->id].roomVolList[cnt].leftVol * 10 * _sfxVolL) / 255;
uint8 volR = (_fxList[elem->id].roomVolList[cnt].rightVol * 10 * _sfxVolR) / 255;
int8 pan = (volR - volL) / 2;
uint8 volume = (volR + volL) / 2;
-
+
if (SwordEngine::isPsx()) { ;
uint32 size = READ_LE_UINT32(sampleData);
Audio::AudioStream *audStream = new Audio::VagStream(new Common::MemoryReadStream(sampleData + 4, size-4), _fxList[elem->id].type == FX_LOOP);
@@ -195,7 +195,7 @@ bool Sound::startSpeech(uint16 roomNo, uint16 localNo) {
warning("Sound::startSpeech: COW file isn't open");
return false;
}
-
+
uint32 locIndex = 0xFFFFFFFF;
uint32 sampleSize = 0;
uint32 index = 0;
@@ -203,49 +203,49 @@ bool Sound::startSpeech(uint16 roomNo, uint16 localNo) {
if (_cowMode == CowPSX) {
Common::File file;
uint16 i;
-
+
if (!file.open("speech.lis")) {
warning ("Could not open speech.lis");
return false;
}
- for (i = 0; !file.eos() && !file.err(); i++)
+ for (i = 0; !file.eos() && !file.err(); i++)
if (file.readUint16LE() == roomNo) {
locIndex = i;
break;
}
file.close();
-
+
if (locIndex == 0xFFFFFFFF) {
warning ("Could not find room %d in speech.lis", roomNo);
return false;
}
-
+
if (!file.open("speech.inf")) {
warning ("Could not open speech.inf");
return false;
}
-
+
file.seek(locIndex * 4 + 2); // 4 bytes per room, skip first 2 bytes
-
+
uint16 numLines = file.readUint16LE();
- uint16 roomOffset = file.readUint16LE();
+ uint16 roomOffset = file.readUint16LE();
file.seek(0x112 + roomOffset * 2); // The offset is in terms of uint16's, so multiply by 2. Skip the 0x112 byte header too.
-
+
locIndex = 0xFFFFFFFF;
-
+
for (i = 0; i < numLines; i++)
if (file.readUint16LE() == localNo) {
locIndex = i;
break;
}
-
+
if (locIndex == 0xFFFFFFFF) {
warning ("Could not find local number %d in room %d in speech.inf", roomNo, localNo);
return false;
}
-
+
file.close();
index = _cowHeader[(roomOffset + locIndex) * 2];
@@ -255,9 +255,9 @@ bool Sound::startSpeech(uint16 roomNo, uint16 localNo) {
sampleSize = _cowHeader[locIndex + (localNo * 2)];
index = _cowHeader[locIndex + (localNo * 2) - 1];
}
-
+
debug(6, "startSpeech(%d, %d): locIndex %d, sampleSize %d, index %d", roomNo, localNo, locIndex, sampleSize, index);
-
+
if (sampleSize) {
uint8 speechVol = (_speechVolR + _speechVolL) / 2;
int8 speechPan = (_speechVolR - _speechVolL) / 2;
@@ -493,7 +493,7 @@ void Sound::initCowSystem(void) {
debug(1, "Using uncompressed Speech Cluster");
_cowMode = CowWave;
}
-
+
if (SwordEngine::isPsx()) {
// There's only one file on the PSX, so set it to the current disc.
_currentCowFile = SwordEngine::_systemVars.currentCD;
@@ -503,16 +503,16 @@ void Sound::initCowSystem(void) {
_cowMode = CowPSX;
}
}
-
+
if (!_cowFile.isOpen())
_cowFile.open("speech.clu");
-
+
if (!_cowFile.isOpen()) {
_cowFile.open("cows.mad");
if (_cowFile.isOpen())
_cowMode = CowDemo;
}
-
+
if (_cowFile.isOpen()) {
if (SwordEngine::isPsx()) {
// Get data from the external table file