aboutsummaryrefslogtreecommitdiff
path: root/engines/sword1
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sword1')
-rw-r--r--engines/sword1/logic.cpp4
-rw-r--r--engines/sword1/router.cpp20
-rw-r--r--engines/sword1/screen.cpp6
-rw-r--r--engines/sword1/sound.cpp2
-rw-r--r--engines/sword1/sword1.cpp18
-rw-r--r--engines/sword1/text.cpp6
6 files changed, 32 insertions, 24 deletions
diff --git a/engines/sword1/logic.cpp b/engines/sword1/logic.cpp
index 35d8e14f27..ef54167d41 100644
--- a/engines/sword1/logic.cpp
+++ b/engines/sword1/logic.cpp
@@ -1017,7 +1017,7 @@ int Logic::fnNewScript(Object *cpt, int32 id, int32 script, int32 d, int32 e, in
int Logic::fnSubScript(Object *cpt, int32 id, int32 script, int32 d, int32 e, int32 f, int32 z, int32 x) {
cpt->o_tree.o_script_level++;
if (cpt->o_tree.o_script_level == TOTAL_script_levels)
- error("Compact %d: script level exceeded in fnSubScript.", id);
+ error("Compact %d: script level exceeded in fnSubScript", id);
cpt->o_tree.o_script_pc[cpt->o_tree.o_script_level] = script;
cpt->o_tree.o_script_id[cpt->o_tree.o_script_level] = script;
return SCRIPT_STOP;
@@ -1605,7 +1605,7 @@ int Logic::fnStopMusic(Object *cpt, int32 id, int32 a, int32 b, int32 c, int32 d
}
int Logic::fnInnerSpace(Object *cpt, int32 id, int32 a, int32 b, int32 c, int32 d, int32 z, int32 x) {
- error("fnInnerSpace() not working.");
+ error("fnInnerSpace() not working");
return SCRIPT_STOP; // for compilers that don't support NORETURN
}
diff --git a/engines/sword1/router.cpp b/engines/sword1/router.cpp
index 0da1cef6fe..84cc81cd0e 100644
--- a/engines/sword1/router.cpp
+++ b/engines/sword1/router.cpp
@@ -845,7 +845,7 @@ void Router::slidyWalkAnimator(WalkData *walkAnim) {
do {
walkAnim[frame].frame += 104;//turning left
frame += 1;
- } while (frame < lastCount );
+ } while (frame < lastCount);
}
if (((lastDir == 1) || (lastDir == -7)) || ((lastDir == 2) || (lastDir == -6))) {
// turn at the end of the current walk
@@ -853,7 +853,7 @@ void Router::slidyWalkAnimator(WalkData *walkAnim) {
do {
walkAnim[frame].frame += 200; //was 60 now 116
frame += 1;
- } while (frame < lastCount );
+ } while (frame < lastCount);
}
lastDir = currentDir;
}
@@ -1272,7 +1272,7 @@ int32 Router::solidWalkAnimator(WalkData *walkAnim) {
do {
walkAnim[frame].frame += 104;//turning left
frame += 1;
- } while (frame < lastCount );
+ } while (frame < lastCount);
}
if (((lastDir == 1) || (lastDir == -7)) || ((lastDir == 2) || (lastDir == -6))) {
// turn at the end of the current walk
@@ -1280,7 +1280,7 @@ int32 Router::solidWalkAnimator(WalkData *walkAnim) {
do {
walkAnim[frame].frame += 200; //was 60 now 116
frame += 1;
- } while (frame < lastCount );
+ } while (frame < lastCount);
}
}
// all turns checked
@@ -1305,7 +1305,7 @@ int32 Router::solidWalkAnimator(WalkData *walkAnim) {
do {
walkAnim[frame].frame += 278;//stopping right
frame += 1;
- } while (frame < lastCount );
+ } while (frame < lastCount);
walkAnim[stepCount].frame = 308;
walkAnim[stepCount].step = 7;
walkAnim[stepCount].dir = currentDir;
@@ -1316,7 +1316,7 @@ int32 Router::solidWalkAnimator(WalkData *walkAnim) {
do {
walkAnim[frame].frame += 279;//stopping right
frame += 1;
- } while (frame < lastCount );
+ } while (frame < lastCount);
walkAnim[stepCount].frame = 315;
walkAnim[stepCount].step = 7;
walkAnim[stepCount].dir = currentDir;
@@ -1332,7 +1332,7 @@ int32 Router::solidWalkAnimator(WalkData *walkAnim) {
do {
walkAnim[frame].frame += 244;//stopping left
frame += 1;
- } while (frame < lastCount );
+ } while (frame < lastCount);
walkAnim[stepCount].frame = 322;
walkAnim[stepCount].step = 7;
walkAnim[stepCount].dir = currentDir;
@@ -1343,7 +1343,7 @@ int32 Router::solidWalkAnimator(WalkData *walkAnim) {
do {
walkAnim[frame].frame += 245;//stopping left
frame += 1;
- } while (frame < lastCount );
+ } while (frame < lastCount);
walkAnim[stepCount].frame = 329;
walkAnim[stepCount].step = 7;
walkAnim[stepCount].dir = currentDir;
@@ -2097,9 +2097,9 @@ int whatTarget(int32 startX, int32 startY, int32 destX, int32 destY) {
int signY = (deltaY > 0);
int slope;
- if ((ABS(deltaY) * DIAGONALX ) < (ABS(deltaX) * DIAGONALY / 2))
+ if ((ABS(deltaY) * DIAGONALX) < (ABS(deltaX) * DIAGONALY / 2))
slope = 0;// its flat
- else if ((ABS(deltaY) * DIAGONALX / 2) > (ABS(deltaX) * DIAGONALY ) )
+ else if ((ABS(deltaY) * DIAGONALX / 2) > (ABS(deltaX) * DIAGONALY))
slope = 2;// its vertical
else
slope = 1;// its diagonal
diff --git a/engines/sword1/screen.cpp b/engines/sword1/screen.cpp
index 024b681acb..b07acf9a0b 100644
--- a/engines/sword1/screen.cpp
+++ b/engines/sword1/screen.cpp
@@ -366,7 +366,7 @@ void Screen::draw() {
if (_currentScreen == 54) {
// rm54 has a BACKGROUND parallax layer in parallax[0]
- if (_parallax[0] && !SwordEngine::isPsx() ) //Avoid drawing this parallax on PSX edition, it gets occluded by background
+ if (_parallax[0] && !SwordEngine::isPsx()) //Avoid drawing this parallax on PSX edition, it gets occluded by background
renderParallax(_parallax[0]);
uint8 *src = _layerBlocks[0];
uint8 *dest = _screenBuf;
@@ -539,7 +539,7 @@ void Screen::processImage(uint32 id) {
|| (compact->o_resource == LVSFLY) || (!(compact->o_resource == GEORGE_MEGA) && (sprSizeX < 260))))
drawSprite(sprData + incr, spriteX, spriteY, sprSizeX, sprSizeY, sprPitch);
else if (((sprSizeX >= 260) && (sprSizeX < 450)) || ((compact->o_resource == GMWRITH) && (sprSizeX < 515)) // a psx shrinked sprite (1/2 width)
- || ((compact->o_resource == GMPOWER) && (sprSizeX < 515)) ) // some needs to be hardcoded, headers don't give useful infos
+ || ((compact->o_resource == GMPOWER) && (sprSizeX < 515))) // some needs to be hardcoded, headers don't give useful infos
drawPsxHalfShrinkedSprite(sprData + incr, spriteX, spriteY, sprSizeX / 2, sprSizeY, sprPitch / 2);
else if (sprSizeX >= 450) // A PSX double shrinked sprite (1/3 width)
drawPsxFullShrinkedSprite(sprData + incr, spriteX, spriteY, sprSizeX / 3, sprSizeY, sprPitch / 3);
@@ -1187,7 +1187,7 @@ void Screen::spriteClipAndSet(uint16 *pSprX, uint16 *pSprY, uint16 *pSprWidth, u
gridW *= 2; // and masking problems when sprites are stretched in width
uint16 bottomSprPos = (*pSprY + (*pSprHeight) * 2); //Position of bottom line of sprite
- if ( bottomSprPos > _scrnSizeY ) { //Check that resized psx sprite isn't drawn outside of screen boundaries
+ if (bottomSprPos > _scrnSizeY) { //Check that resized psx sprite isn't drawn outside of screen boundaries
uint16 outScreen = bottomSprPos - _scrnSizeY;
*pSprHeight -= (outScreen % 2) ? (outScreen + 1) / 2 : outScreen / 2;
}
diff --git a/engines/sword1/sound.cpp b/engines/sword1/sound.cpp
index da9a83cdff..55600cfb63 100644
--- a/engines/sword1/sound.cpp
+++ b/engines/sword1/sound.cpp
@@ -535,7 +535,7 @@ void Sound::calcWaveVolume(int16 *data, uint32 length) {
_waveVolPos = 0;
for (uint32 blkCnt = 1; blkCnt < length / 918; blkCnt++) {
if (blkCnt >= WAVE_VOL_TAB_LENGTH) {
- warning("Wave vol tab too small.");
+ warning("Wave vol tab too small");
return;
}
int32 average = 0;
diff --git a/engines/sword1/sword1.cpp b/engines/sword1/sword1.cpp
index 26bb1d959b..0d4f5b7445 100644
--- a/engines/sword1/sword1.cpp
+++ b/engines/sword1/sword1.cpp
@@ -214,12 +214,20 @@ void SwordEngine::syncSoundSettings() {
sfxVolL = 255;
}
- _music->setVolume(musicVolL, musicVolR);
- _sound->setSpeechVol(speechVolL, speechVolR);
- _sound->setSfxVol(sfxVolL, sfxVolR);
+ bool mute = ConfMan.getBool("mute");
- _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
- _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume"));
+ if (mute) {
+ _music->setVolume(0, 0);
+ _sound->setSpeechVol(0, 0);
+ _sound->setSfxVol(0, 0);
+ } else {
+ _music->setVolume(musicVolL, musicVolR);
+ _sound->setSpeechVol(speechVolL, speechVolR);
+ _sound->setSfxVol(sfxVolL, sfxVolR);
+ }
+
+ _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, mute ? 0 : ConfMan.getInt("sfx_volume"));
+ _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, mute ? 0 : ConfMan.getInt("speech_volume"));
}
void SwordEngine::flagsToBool(bool *dest, uint8 flags) {
diff --git a/engines/sword1/text.cpp b/engines/sword1/text.cpp
index e8a20ec2b7..ef3e07fe74 100644
--- a/engines/sword1/text.cpp
+++ b/engines/sword1/text.cpp
@@ -49,7 +49,7 @@ Text::Text(ObjectMan *pObjMan, ResMan *pResMan, bool czechVersion) {
_fontId = (czechVersion) ? CZECH_GAME_FONT : GAME_FONT;
_font = (uint8*)_resMan->openFetchRes(_fontId);
- _joinWidth = charWidth( SPACE ) - 2 * OVERLAP;
+ _joinWidth = charWidth(SPACE) - 2 * OVERLAP;
_charHeight = _resMan->getUint16(_resMan->fetchFrame(_font, 0)->height); // all chars have the same height
for (int i = 0; i < MAX_TEXT_OBS; i++)
_textBlocks[i] = NULL;
@@ -145,12 +145,12 @@ uint16 Text::analyzeSentence(uint8 *text, uint16 maxWidth, LineInfo *line) {
// (with a separating space character - also overlapped)
uint16 spaceNeeded = _joinWidth + wordWidth;
- if (line[lineNo].width + spaceNeeded <= maxWidth ) {
+ if (line[lineNo].width + spaceNeeded <= maxWidth) {
line[lineNo].width += spaceNeeded;
line[lineNo].length += 1 + wordLength; // NB. space+word characters
} else { // put word (without separating SPACE) at start of next line
lineNo++;
- assert( lineNo < MAX_LINES );
+ assert(lineNo < MAX_LINES);
line[lineNo].width = wordWidth;
line[lineNo].length = wordLength;
}