aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction
diff options
context:
space:
mode:
Diffstat (limited to 'engines/parallaction')
-rw-r--r--engines/parallaction/dialogue.cpp28
-rw-r--r--engines/parallaction/exec_br.cpp6
-rw-r--r--engines/parallaction/gfxbase.cpp10
-rw-r--r--engines/parallaction/graphics.cpp6
-rw-r--r--engines/parallaction/graphics.h1
-rw-r--r--engines/parallaction/gui_br.cpp4
-rw-r--r--engines/parallaction/gui_ns.cpp22
-rw-r--r--engines/parallaction/objects.cpp8
-rw-r--r--engines/parallaction/parallaction.cpp10
-rw-r--r--engines/parallaction/parallaction_ns.cpp4
-rw-r--r--engines/parallaction/parser_br.cpp16
-rw-r--r--engines/parallaction/parser_ns.cpp10
-rw-r--r--engines/parallaction/sound.h4
-rw-r--r--engines/parallaction/sound_ns.cpp8
-rw-r--r--engines/parallaction/walk.cpp6
15 files changed, 72 insertions, 71 deletions
diff --git a/engines/parallaction/dialogue.cpp b/engines/parallaction/dialogue.cpp
index 880d41a8a3..a908152bf8 100644
--- a/engines/parallaction/dialogue.cpp
+++ b/engines/parallaction/dialogue.cpp
@@ -52,7 +52,7 @@ struct BalloonPositions {
class DialogueManager {
-
+
Parallaction *_vm;
Dialogue *_dialogue;
@@ -81,10 +81,10 @@ protected:
bool _isKeyDown;
uint16 _downKey;
-protected:
+protected:
Gfx *_gfx;
BalloonManager *_balloonMan;
-
+
public:
DialogueManager(Parallaction *vm, ZonePtr z);
virtual ~DialogueManager();
@@ -108,11 +108,11 @@ protected:
NEXT_ANSWER,
DIALOGUE_OVER
} _state;
-
+
static const int NO_ANSWER_SELECTED = -1;
void transitionToState(DialogueState newState);
-
+
bool displayQuestion();
void displayAnswers();
bool testAnswerFlags(Answer *a);
@@ -132,7 +132,7 @@ protected:
DialogueManager::DialogueManager(Parallaction *vm, ZonePtr z) : _vm(vm), _z(z) {
_gfx = _vm->_gfx;
_balloonMan = _vm->_balloonMan;
-
+
_dialogue = _z->u._speakDialogue;
isNpc = !_z->u._filename.empty() && _z->u._filename.compareToIgnoreCase("yourself");
_questioner = isNpc ? _vm->_disk->loadTalk(_z->u._filename.c_str()) : _vm->_char._talk;
@@ -166,11 +166,11 @@ void DialogueManager::transitionToState(DialogueState newState) {
"nextanswer",
"over"
};
-
+
if (_state != newState) {
debugC(3, kDebugDialogue, "DialogueManager moved to state '%s'", dialogueStates[newState]);
- if (DebugMan.isDebugChannelEnabled(kDebugDialogue) && gDebugLevel == 9) {
+ if (DebugMan.isDebugChannelEnabled(kDebugDialogue) && gDebugLevel == 9) {
switch (newState) {
case RUN_QUESTION:
debug(" Q : %s", _q->_text.c_str());
@@ -188,7 +188,7 @@ void DialogueManager::transitionToState(DialogueState newState) {
_state = newState;
}
-
+
bool DialogueManager::testAnswerFlags(Answer *a) {
uint32 flags = _vm->getLocationFlags();
if (a->_yesFlags & kFlagsGlobal)
@@ -240,7 +240,7 @@ int16 DialogueManager::selectAnswerN() {
VisibleAnswer *oldAnswer = &_visAnswers[_oldSelection];
VisibleAnswer *answer = &_visAnswers[_selection];
-
+
if (_selection != _oldSelection) {
if (_oldSelection != NO_ANSWER_SELECTED) {
_balloonMan->setBalloonText(oldAnswer->_balloon, oldAnswer->_a->_text, BalloonManager::kUnselectedColor);
@@ -286,7 +286,7 @@ void DialogueManager::nextAnswer() {
return;
}
- // try and check if there are any suitable answers,
+ // try and check if there are any suitable answers,
// given the current game state.
addVisibleAnswers(_q);
if (!_numVisAnswers) {
@@ -294,9 +294,9 @@ void DialogueManager::nextAnswer() {
transitionToState(DIALOGUE_OVER);
return;
}
-
+
if (_visAnswers[0]._a->textIsNull()) {
- // if the first answer is null (it's implied that it's the
+ // if the first answer is null (it's implied that it's the
// only one because we already called addVisibleAnswers),
// then jump to the next question
_answerId = _visAnswers[0]._index;
@@ -547,7 +547,7 @@ void Parallaction::runDialogueFrame() {
if (_input->_inputMode != Input::kInputModeDialogue) {
return;
}
-
+
_dialogueMan->run();
if (_dialogueMan->isOver()) {
diff --git a/engines/parallaction/exec_br.cpp b/engines/parallaction/exec_br.cpp
index 0ec1675c48..658ef5af82 100644
--- a/engines/parallaction/exec_br.cpp
+++ b/engines/parallaction/exec_br.cpp
@@ -530,11 +530,11 @@ DECLARE_INSTRUCTION_OPCODE(endif) {
DECLARE_INSTRUCTION_OPCODE(stop) {
ZonePtr z = ctxt._inst->_z;
-
- // Prevent execution if zone is missing. The known case is "PART2/insegui.scr", which has
+
+ // Prevent execution if zone is missing. The known case is "PART2/insegui.scr", which has
// "STOP insegui", which doesn't exist (see ticket #3021744 for the gory details)
if (!z) return;
-
+
if (ACTIONTYPE(z) == kZoneHear) {
warning("Parallaction_br::instOp_stop not yet implemented for HEAR zones");
// TODO: stop music or sound effects generated by a zone.
diff --git a/engines/parallaction/gfxbase.cpp b/engines/parallaction/gfxbase.cpp
index 24544f46dd..48d84ed101 100644
--- a/engines/parallaction/gfxbase.cpp
+++ b/engines/parallaction/gfxbase.cpp
@@ -296,19 +296,19 @@ void Gfx::bltMaskScale(const Common::Rect& r, byte *data, Graphics::Surface *sur
// clipped scaled destination rectangle
Common::Rect dstRect(scaledWidth, scaledHeight);
dstRect.moveTo(scaledLeft, scaledTop);
-
- Common::Rect clipper(surf->w, surf->h);
+
+ Common::Rect clipper(surf->w, surf->h);
dstRect.clip(clipper);
if (!dstRect.isValidRect()) return;
-
-
+
+
// clipped source rectangle
Common::Rect srcRect;
srcRect.left = (dstRect.left - scaledLeft) * 100 / scale;
srcRect.top = (dstRect.top - scaledTop) * 100 / scale;
srcRect.setWidth(dstRect.width() * 100 / scale);
srcRect.setHeight(dstRect.height() * 100 / scale);
- if (!srcRect.isValidRect()) return;
+ if (!srcRect.isValidRect()) return;
Common::Point dp;
dp.x = dstRect.left;
diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp
index cf0cf13333..1da61b68ae 100644
--- a/engines/parallaction/graphics.cpp
+++ b/engines/parallaction/graphics.cpp
@@ -565,7 +565,7 @@ void Gfx::showFloatingLabel(GfxObj *label) {
label->x = -1000;
label->y = -1000;
label->setFlags(kGfxObjVisible);
-
+
_floatingLabel = label;
_labels.push_back(label);
}
@@ -673,7 +673,7 @@ void Gfx::showLabel(GfxObj *label, int16 x, int16 y) {
label->x = x;
label->y = y;
-
+
_labels.push_back(label);
}
@@ -695,7 +695,7 @@ void Gfx::unregisterLabel(GfxObj *label) {
_labels.remove_at(i);
break;
}
- }
+ }
}
diff --git a/engines/parallaction/graphics.h b/engines/parallaction/graphics.h
index 2f86f3693b..3eea1e871a 100644
--- a/engines/parallaction/graphics.h
+++ b/engines/parallaction/graphics.h
@@ -28,6 +28,7 @@
#include "common/hashmap.h"
#include "common/hash-str.h"
#include "common/stream.h"
+#include "common/array.h"
#include "graphics/surface.h"
diff --git a/engines/parallaction/gui_br.cpp b/engines/parallaction/gui_br.cpp
index c520ad4f25..d1361a6e8c 100644
--- a/engines/parallaction/gui_br.cpp
+++ b/engines/parallaction/gui_br.cpp
@@ -223,10 +223,10 @@ public:
}
break;
- default:
+ default:
_vm->_nextPart = _firstLocation[selection].part;
_vm->scheduleLocationSwitch(_firstLocation[selection].location);
-
+
}
_vm->_system->showMouse(false);
diff --git a/engines/parallaction/gui_ns.cpp b/engines/parallaction/gui_ns.cpp
index ef1a8a6e7e..3794aeae29 100644
--- a/engines/parallaction/gui_ns.cpp
+++ b/engines/parallaction/gui_ns.cpp
@@ -122,7 +122,7 @@ public:
_dosLanguageSelectBlocks[1] = Common::Rect( 129, 85, 177, 155 ); // French
_dosLanguageSelectBlocks[2] = Common::Rect( 178, 60, 226, 130 ); // English
_dosLanguageSelectBlocks[3] = Common::Rect( 227, 35, 275, 105 ); // German
-
+
_amigaLanguageSelectBlocks[0] = Common::Rect( -1, -1, -1, -1 ); // Italian: not supported by Amiga multi-lingual version
_amigaLanguageSelectBlocks[1] = Common::Rect( 129, 85, 177, 155 ); // French
_amigaLanguageSelectBlocks[2] = Common::Rect( 178, 60, 226, 130 ); // English
@@ -149,7 +149,7 @@ public:
_language = -1;
_allowChoice = true;
}
-
+
~ChooseLanguageInputState_NS() {
destroyLabels();
}
@@ -222,15 +222,15 @@ public:
_nextState[0] = "newgame";
_nextState[1] = "loadgame";
-
+
_labels[0] = 0;
_labels[1] = 0;
}
-
+
~SelectGameInputState_NS() {
destroyLabels();
}
-
+
void destroyLabels() {
_vm->_gfx->unregisterLabel(_labels[0]);
_vm->_gfx->unregisterLabel(_labels[1]);
@@ -326,7 +326,7 @@ public:
_labels[2] = 0;
_labels[3] = 0;
}
-
+
~NewGameInputState_NS() {
destroyLabels();
}
@@ -475,7 +475,7 @@ public:
_block.create(BLOCK_WIDTH, BLOCK_HEIGHT, Graphics::PixelFormat::createFormatCLUT8());
_labels[0] = 0;
_labels[1] = 0;
-
+
_codeSelectBlocks[0] = Common::Rect( 111, 129, 127, 153 ); // na
_codeSelectBlocks[1] = Common::Rect( 128, 120, 144, 144 ); // wa
_codeSelectBlocks[2] = Common::Rect( 145, 111, 161, 135 ); // ra
@@ -698,7 +698,7 @@ public:
_vm->_gfx->unregisterLabel(_labels[0]);
_vm->_gfx->unregisterLabel(_labels[1]);
delete _labels[0];
- delete _labels[1];
+ delete _labels[1];
_labels[0] = 0;
_labels[1] = 0;
}
@@ -827,18 +827,18 @@ public:
_labels[2] = 0;
_labels[3] = 0;
}
-
+
void destroyLabels() {
_vm->_gfx->unregisterLabel(_labels[0]);
_vm->_gfx->unregisterLabel(_labels[1]);
_vm->_gfx->unregisterLabel(_labels[2]);
_vm->_gfx->unregisterLabel(_labels[3]);
-
+
delete _labels[0];
delete _labels[1];
delete _labels[2];
delete _labels[3];
-
+
_labels[0] = 0;
_labels[1] = 0;
_labels[2] = 0;
diff --git a/engines/parallaction/objects.cpp b/engines/parallaction/objects.cpp
index 3750602076..22406013a1 100644
--- a/engines/parallaction/objects.cpp
+++ b/engines/parallaction/objects.cpp
@@ -264,7 +264,7 @@ bool Answer::textIsNull() {
int Answer::speakerMood() {
return _mood & 0xF;
}
-
+
Question::Question(const Common::String &name) : _name(name), _mood(0) {
memset(_answers, 0, sizeof(_answers));
}
@@ -278,16 +278,16 @@ Question::~Question() {
bool Question::textIsNull() {
return (_text.equalsIgnoreCase("NULL"));
}
-
+
int Question::speakerMood() {
return _mood & 0xF;
}
int Question::balloonWinding() {
- return _mood & 0x10;
+ return _mood & 0x10;
}
-
+
Instruction::Instruction() {
_index = 0;
_flags = 0;
diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp
index 9bbc7d0c57..a37c4439a1 100644
--- a/engines/parallaction/parallaction.cpp
+++ b/engines/parallaction/parallaction.cpp
@@ -627,7 +627,7 @@ bool Parallaction::checkSpecialZoneBox(ZonePtr z, uint32 type, uint x, uint y) {
return false;
}
}
-
+
// WORKAROUND: this huge condition is needed because we made TypeData a collection of structs
// instead of an union. So, merge->_obj1 and get->_icon were just aliases in the original engine,
// but we need to check it separately here. The same workaround is applied in freeZones.
@@ -659,14 +659,14 @@ bool Parallaction::checkZoneType(ZonePtr z, uint32 type) {
if (_gameType == GType_BRA) {
if (type == 0) {
- if (ITEMTYPE(z) == 0) {
+ if (ITEMTYPE(z) == 0) {
if (ACTIONTYPE(z) != kZonePath) {
return true;
}
- }
+ }
if (ACTIONTYPE(z) == kZoneDoor) {
return true;
- }
+ }
}
}
@@ -751,7 +751,7 @@ ZonePtr Parallaction::hitZone(uint32 type, uint16 x, uint16 y) {
AnimationPtr a = *ait;
_a = (a->_flags & kFlagsActive) ? 1 : 0; // _a: active Animation
-
+
if (!_a) {
if (_gameType == GType_BRA && ACTIONTYPE(a) != kZoneTrap) {
continue;
diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp
index 64cf1b437d..0b92db1f0a 100644
--- a/engines/parallaction/parallaction_ns.cpp
+++ b/engines/parallaction/parallaction_ns.cpp
@@ -351,7 +351,7 @@ void Parallaction_ns::changeLocation() {
// prevent music changes during the introduction
_soundManI->playLocationMusic(location);
}
-
+
_input->stopHovering();
// this is still needed to remove the floatingLabel
_gfx->freeLabels();
@@ -471,7 +471,7 @@ void Parallaction_ns::changeCharacter(const char *name) {
// prevent music changes during the introduction
_soundManI->playCharacterMusic(_char.getBaseName());
}
-
+
// The original engine used to reload 'common' only on loadgames. We are reloading here since 'common'
// contains character specific stuff. This causes crashes like bug #1816899, because parseLocation tries
// to reload scripts but the data archive selected is occasionally wrong. This has been solved by having
diff --git a/engines/parallaction/parser_br.cpp b/engines/parallaction/parser_br.cpp
index e4be53022e..df53ecca3f 100644
--- a/engines/parallaction/parser_br.cpp
+++ b/engines/parallaction/parser_br.cpp
@@ -524,14 +524,14 @@ DECLARE_COMMAND_PARSER(location) {
ctxt.cmd->_startPos.x = -1000;
ctxt.cmd->_startPos2.x = -1000;
if (_tokens[ctxt.nextToken][0] != '\0') {
- if (isdigit(_tokens[ctxt.nextToken][0]) || _tokens[ctxt.nextToken][0] == '-') {
+ if (isdigit(static_cast<unsigned char>(_tokens[ctxt.nextToken][0])) || _tokens[ctxt.nextToken][0] == '-') {
ctxt.cmd->_startPos.x = atoi(_tokens[ctxt.nextToken]);
ctxt.nextToken++;
ctxt.cmd->_startPos.y = atoi(_tokens[ctxt.nextToken]);
ctxt.nextToken++;
}
- if (isdigit(_tokens[ctxt.nextToken][0]) || _tokens[ctxt.nextToken][0] == '-') {
+ if (isdigit(static_cast<unsigned char>(_tokens[ctxt.nextToken][0])) || _tokens[ctxt.nextToken][0] == '-') {
ctxt.cmd->_startPos2.x = atoi(_tokens[ctxt.nextToken]);
ctxt.nextToken++;
ctxt.cmd->_startPos2.y = atoi(_tokens[ctxt.nextToken]);
@@ -677,7 +677,7 @@ DECLARE_COMMAND_PARSER(text) {
createCommand(_parser->_lookup);
- if (isdigit(_tokens[1][1])) {
+ if (isdigit(static_cast<unsigned char>(_tokens[1][1]))) {
ctxt.cmd->_zeta0 = atoi(_tokens[1]);
ctxt.nextToken++;
} else {
@@ -714,7 +714,7 @@ DECLARE_COMMAND_PARSER(unary) {
DECLARE_ZONE_PARSER(limits) {
debugC(7, kDebugParser, "ZONE_PARSER(limits) ");
- if (isalpha(_tokens[1][1])) {
+ if (isalpha(static_cast<unsigned char>(_tokens[1][1]))) {
ctxt.z->_flags |= kFlagsAnimLinked;
ctxt.z->_linkedName = _tokens[1];
} else {
@@ -824,12 +824,12 @@ void LocationParser_br::parseHearData(ZonePtr z) {
}
void LocationParser_br::parseNoneData(ZonePtr z) {
- /* the only case we have to handle here is that of "scende2", which is the only Animation with
+ /* the only case we have to handle here is that of "scende2", which is the only Animation with
a command list following the type marker.
*/
if (!scumm_stricmp(_tokens[0], "commands")) {
parseCommands(z->_commands);
- }
+ }
}
@@ -1003,7 +1003,7 @@ DECLARE_INSTRUCTION_PARSER(text) {
int _si = 1;
- if (isdigit(_tokens[1][1])) {
+ if (isdigit(static_cast<unsigned char>(_tokens[1][1]))) {
ctxt.inst->_y = atoi(_tokens[1]);
_si = 2;
} else {
@@ -1066,7 +1066,7 @@ DECLARE_INSTRUCTION_PARSER(endif) {
void ProgramParser_br::parseRValue(ScriptVar &v, const char *str) {
- if (isdigit(str[0]) || str[0] == '-') {
+ if (isdigit(static_cast<unsigned char>(str[0])) || str[0] == '-') {
v.setImmediate(atoi(str));
return;
}
diff --git a/engines/parallaction/parser_ns.cpp b/engines/parallaction/parser_ns.cpp
index 69763affc8..100b608172 100644
--- a/engines/parallaction/parser_ns.cpp
+++ b/engines/parallaction/parser_ns.cpp
@@ -534,7 +534,7 @@ DECLARE_INSTRUCTION_PARSER(endscript) {
void ProgramParser_ns::parseRValue(ScriptVar &v, const char *str) {
- if (isdigit(str[0]) || str[0] == '-') {
+ if (isdigit(static_cast<unsigned char>(str[0])) || str[0] == '-') {
v.setImmediate(atoi(str));
return;
}
@@ -1412,9 +1412,9 @@ void LocationParser_ns::parseSpeakData(ZonePtr z) {
}
void LocationParser_ns::parseNoneData(ZonePtr z) {
- // "None" zones should have no content, but some
- // inconsistently define their command list after
- // the TYPE marker. This routine catches these
+ // "None" zones should have no content, but some
+ // inconsistently define their command list after
+ // the TYPE marker. This routine catches these
// command lists that would be lost otherwise.
if (!scumm_stricmp(_tokens[0], "commands")) {
parseCommands(z->_commands);
@@ -1423,7 +1423,7 @@ void LocationParser_ns::parseNoneData(ZonePtr z) {
_script->readLineToken(true);
_parser->parseStatement();
} while (!ctxt.endcommands);
-
+
// no need to parse one more line here, as
// it is done by the caller
}
diff --git a/engines/parallaction/sound.h b/engines/parallaction/sound.h
index baca5a7213..d0b5e5c175 100644
--- a/engines/parallaction/sound.h
+++ b/engines/parallaction/sound.h
@@ -131,11 +131,11 @@ class DosSoundMan_ns : public SoundMan_ns {
MidiPlayer *_midiPlayer;
bool _playing;
-
+
bool isLocationSilent(const char *locationName);
bool locationHasOwnSoftMusic(const char *locationName);
-
+
public:
DosSoundMan_ns(Parallaction_ns *vm);
~DosSoundMan_ns();
diff --git a/engines/parallaction/sound_ns.cpp b/engines/parallaction/sound_ns.cpp
index 917d310738..b5d4c72ea4 100644
--- a/engines/parallaction/sound_ns.cpp
+++ b/engines/parallaction/sound_ns.cpp
@@ -140,7 +140,7 @@ void DosSoundMan_ns::playMusic() {
Common::SeekableReadStream *stream = _vm->_disk->loadMusic(_musicFile);
_midiPlayer->play(stream);
_midiPlayer->setVolume(255);
-
+
_playing = true;
}
@@ -159,7 +159,7 @@ void DosSoundMan_ns::pause(bool p) {
bool DosSoundMan_ns::locationHasOwnSoftMusic(const char *locationName) {
return !scumm_stricmp(locationName, "night") || !scumm_stricmp(locationName, "intsushi");
}
-
+
void DosSoundMan_ns::playCharacterMusic(const char *character) {
if (!character || locationHasOwnSoftMusic(_vm->_location._name)) {
return;
@@ -167,7 +167,7 @@ void DosSoundMan_ns::playCharacterMusic(const char *character) {
char *name = const_cast<char*>(character);
const char *newMusicFile = 0;
-
+
if (!scumm_stricmp(name, _dinoName)) {
newMusicFile = "dino";
} else
@@ -200,7 +200,7 @@ void DosSoundMan_ns::playLocationMusic(const char *location) {
debugC(2, kDebugExec, "changeLocation: music stopped");
} else {
playCharacterMusic(_vm->_char.getBaseName());
- }
+ }
}
diff --git a/engines/parallaction/walk.cpp b/engines/parallaction/walk.cpp
index 21ee5ee5d9..5d5695ace4 100644
--- a/engines/parallaction/walk.cpp
+++ b/engines/parallaction/walk.cpp
@@ -590,14 +590,14 @@ void PathWalker_BR::doWalk(State &s) {
int xStep = (scale * 16) / 100 + 1;
int yStep = (scale * 10) / 100 + 1;
- /* WORKAROUND: in the balloon scene, the position of the balloon (which is implemented as a
+ /* WORKAROUND: in the balloon scene, the position of the balloon (which is implemented as a
Character) is controlled by the user (for movement, via this walking code) and by the scripts
(to simulate the balloon floating in the air, in a neverending loop that alters the position
coordinates).
When the two step sizes are equal in magnitude and opposite in direction, then the walk code
enters an infinite loop without giving control back to the user (this happens quite frequently
- when navigating the balloon near the borders of the screen, where the calculated step is
- forcibly small because of clipping). Since the "floating" script (part1/scripts/mongolo.scr)
+ when navigating the balloon near the borders of the screen, where the calculated step is
+ forcibly small because of clipping). Since the "floating" script (part1/scripts/mongolo.scr)
uses increments of 3 for both x and y, we tweak the calculated steps accordingly here. */
if (xStep == 3) xStep--;
if (yStep == 3) yStep--;