aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/illusions/actor.cpp32
-rw-r--r--engines/illusions/actor.h24
-rw-r--r--engines/illusions/bbdou/bbdou_bubble.cpp12
-rw-r--r--engines/illusions/bbdou/bbdou_credits.cpp14
-rw-r--r--engines/illusions/bbdou/bbdou_cursor.cpp6
-rw-r--r--engines/illusions/bbdou/bbdou_specialcode.cpp30
-rw-r--r--engines/illusions/bbdou/bbdou_specialcode.h4
-rw-r--r--engines/illusions/bbdou/bbdou_triggerfunctions.cpp2
-rw-r--r--engines/illusions/bbdou/illusions_bbdou.cpp6
-rw-r--r--engines/illusions/bbdou/illusions_bbdou.h10
-rw-r--r--engines/illusions/bbdou/scriptopcodes_bbdou.cpp40
-rw-r--r--engines/illusions/bbdou/scriptopcodes_bbdou.h4
-rw-r--r--engines/illusions/camera.cpp8
-rw-r--r--engines/illusions/detection.cpp2
-rw-r--r--engines/illusions/duckman/duckman_credits.cpp44
-rw-r--r--engines/illusions/duckman/duckman_credits.h2
-rw-r--r--engines/illusions/duckman/duckman_dialog.cpp2
-rw-r--r--engines/illusions/duckman/duckman_dialog.h2
-rw-r--r--engines/illusions/duckman/duckman_inventory.h2
-rw-r--r--engines/illusions/duckman/duckman_screenshakereffects.cpp4
-rw-r--r--engines/illusions/duckman/duckman_specialcode.cpp6
-rw-r--r--engines/illusions/duckman/duckman_specialcode.h2
-rw-r--r--engines/illusions/duckman/illusions_duckman.cpp16
-rw-r--r--engines/illusions/duckman/illusions_duckman.h14
-rw-r--r--engines/illusions/duckman/menusystem_duckman.cpp2
-rw-r--r--engines/illusions/duckman/scriptopcodes_duckman.cpp28
-rw-r--r--engines/illusions/duckman/scriptopcodes_duckman.h8
-rw-r--r--engines/illusions/fileresourcereader.cpp2
-rw-r--r--engines/illusions/gamarchive.cpp8
-rw-r--r--engines/illusions/gamresourcereader.cpp2
-rw-r--r--engines/illusions/graphics.cpp4
-rw-r--r--engines/illusions/illusions.cpp6
-rw-r--r--engines/illusions/illusions.h10
-rw-r--r--engines/illusions/menusystem.cpp44
-rw-r--r--engines/illusions/menusystem.h2
-rw-r--r--engines/illusions/pathfinder.cpp10
-rw-r--r--engines/illusions/pathfinder.h2
-rw-r--r--engines/illusions/resources/actorresource.cpp10
-rw-r--r--engines/illusions/resources/actorresource.h2
-rw-r--r--engines/illusions/resources/backgroundresource.cpp14
-rw-r--r--engines/illusions/resources/backgroundresource.h8
-rw-r--r--engines/illusions/resources/scriptresource.cpp20
-rw-r--r--engines/illusions/resourcesystem.cpp8
-rw-r--r--engines/illusions/resourcesystem.h6
-rw-r--r--engines/illusions/saveload.cpp2
-rw-r--r--engines/illusions/screen.cpp32
-rw-r--r--engines/illusions/screen.h2
-rw-r--r--engines/illusions/screentext.cpp8
-rw-r--r--engines/illusions/scriptopcodes.h2
-rw-r--r--engines/illusions/sequenceopcodes.h2
-rw-r--r--engines/illusions/textdrawer.cpp6
-rw-r--r--engines/illusions/textdrawer.h4
-rw-r--r--engines/illusions/thread.cpp4
-rw-r--r--engines/illusions/threads/abortablethread.cpp2
-rw-r--r--engines/illusions/threads/talkthread.cpp8
-rw-r--r--engines/illusions/threads/talkthread_duckman.cpp10
56 files changed, 283 insertions, 283 deletions
diff --git a/engines/illusions/actor.cpp b/engines/illusions/actor.cpp
index 7cbada1c7e..eaf603f70b 100644
--- a/engines/illusions/actor.cpp
+++ b/engines/illusions/actor.cpp
@@ -95,7 +95,7 @@ Actor::Actor(IllusionsEngine *vm)
_seqCodeValue1 = 0;
_seqCodeValue2 = 600;
_seqCodeValue3 = 0;
-
+
_notifyId3C = 0;
_controlRoutine = 0;
@@ -236,7 +236,7 @@ void Control::unpause() {
if (_objectId == Illusions::CURSOR_OBJECT_ID)
_vm->setCursorControl(this);
-
+
if (_actor && !(_actor->_flags & Illusions::ACTOR_FLAG_200)) {
SurfInfo surfInfo;
ActorType *actorType = _vm->_dict->findActorType(_actorTypeId);
@@ -619,7 +619,7 @@ void Control::sequenceActor() {
opCall._result = 0;
_actor->_seqCodeValue3 -= _actor->_seqCodeValue1;
-
+
while (_actor->_seqCodeValue3 <= 0 && !sequenceFinished) {
bool breakInner = false;
while (!breakInner) {
@@ -652,12 +652,12 @@ void Control::sequenceActor() {
}
//debug(1, "New frame OK");
}
-
+
if (sequenceFinished) {
//debug(1, "Sequence has finished");
_actor->_seqCodeIp = 0;
}
-
+
}
void Control::setActorIndex(int actorIndex) {
@@ -958,7 +958,7 @@ void Control::startSequenceActorIntern(uint32 sequenceId, int value, byte *entry
_actor->_notifyId3C = 0;
_actor->_walkCallerThreadId1 = 0;
_actor->_entryTblPtr = 0;
-
+
Sequence *sequence = _vm->_dict->findSequence(sequenceId);
if (!sequence && _vm->getGameId() == kGameIdDuckman) {
@@ -970,7 +970,7 @@ void Control::startSequenceActorIntern(uint32 sequenceId, int value, byte *entry
_actor->_seqCodeIp = sequence->_sequenceCode;
_actor->_frames = _vm->findActorSequenceFrames(sequence);
-
+
_actor->_seqCodeValue3 = 0;
_actor->_seqCodeValue1 = 0;
@@ -981,12 +981,12 @@ void Control::startSequenceActorIntern(uint32 sequenceId, int value, byte *entry
}
_actor->initSequenceStack();
-
+
if (_vm->getGameId() == kGameIdBBDOU)
stopSequenceActor();
-
+
_actor->_linkIndex2 = 0;
-
+
if (entryTblPtr) {
_actor->_flags |= Illusions::ACTOR_FLAG_80;
_actor->_entryTblPtr = entryTblPtr;
@@ -1034,7 +1034,7 @@ void Controls::placeActor(uint32 actorTypeId, Common::Point placePt, uint32 sequ
Control *control = newControl();
Actor *actor = newActor();
ActorType *actorType = _vm->_dict->findActorType(actorTypeId);
-
+
control->_objectId = objectId;
control->_flags = actorType->_flags;
control->_priority = actorType->_priority;
@@ -1044,7 +1044,7 @@ void Controls::placeActor(uint32 actorTypeId, Common::Point placePt, uint32 sequ
if (_vm->isCursorObject(actorTypeId, objectId))
_vm->setCursorControlRoutine(control);
-
+
if (actorType->_surfInfo._dimensions._width > 0 || actorType->_surfInfo._dimensions._height > 0) {
actor->createSurface(actorType->_surfInfo);
} else {
@@ -1074,19 +1074,19 @@ void Controls::placeActor(uint32 actorTypeId, Common::Point placePt, uint32 sequ
actor->_pathWalkRects = bgRes->getPathWalkRects(actorType->_pathWalkRectIndex - 1);
actor->_flags |= Illusions::ACTOR_FLAG_HAS_WALK_RECTS;
}
-
+
if (actorType->_priorityLayerIndex) {
actor->_priorityLayer = bgRes->getPriorityLayer(actorType->_priorityLayerIndex - 1);
actor->_flags |= Illusions::ACTOR_FLAG_PRIORITY;
}
-
+
if (actorType->_regionLayerIndex) {
actor->_regionLayer = bgRes->getRegionLayer(actorType->_regionLayerIndex - 1);
actor->_flags |= Illusions::ACTOR_FLAG_REGION;
}
-
+
actor->_pathCtrY = 140;
-
+
_controls.push_front(control);
_vm->_dict->setObjectControl(objectId, control);
diff --git a/engines/illusions/actor.h b/engines/illusions/actor.h
index 5a4dd4f389..0f76050d7c 100644
--- a/engines/illusions/actor.h
+++ b/engines/illusions/actor.h
@@ -110,7 +110,7 @@ public:
IllusionsEngine *_vm;
byte _drawFlags;
uint _spriteFlags;
-
+
int _pauseCtr;
uint _flags;
@@ -119,50 +119,50 @@ public:
int16 _newFrameIndex;
SurfInfo _surfInfo;
Graphics::Surface *_surface;
-
+
FramesList *_frames;
NamedPoints *_namedPoints;
-
+
ScaleLayer *_scaleLayer;
PriorityLayer *_priorityLayer;
RegionLayer *_regionLayer;
PathWalkPoints *_pathWalkPoints;
PathWalkRects *_pathWalkRects;
-
+
uint _seqStackCount;
int16 _seqStack[5];
-
+
Common::Point _position;
Common::Point _position2;
uint _facing;
int _regionIndex;
-
+
uint32 _fontId;
int16 _actorIndex;
-
+
DefaultSequences _defaultSequences;
uint32 _parentObjectId;
int _linkIndex;
int _linkIndex2;
uint32 _subobjects[kSubObjectsCount];
-
+
uint32 _notifyThreadId1;
uint32 _notifyId3C;
uint32 _notifyThreadId2;
byte *_entryTblPtr;
-
+
int _surfaceTextFlag;
-
+
ActorControlRoutine *_controlRoutine;
-
+
uint32 _sequenceId;
int _seqCodeValue2;
byte *_seqCodeIp;
int _seqCodeValue1;
int _seqCodeValue3;
-
+
int _pathCtrX, _pathCtrY;
int _pathAngle;
int32 _posXShl, _posYShl;
diff --git a/engines/illusions/bbdou/bbdou_bubble.cpp b/engines/illusions/bbdou/bbdou_bubble.cpp
index 62e7959830..c631a22109 100644
--- a/engines/illusions/bbdou/bbdou_bubble.cpp
+++ b/engines/illusions/bbdou/bbdou_bubble.cpp
@@ -101,7 +101,7 @@ void BbdouBubble::addItem0(uint32 sequenceId1, uint32 sequenceId2, uint32 progRe
}
void BbdouBubble::show() {
-
+
if (_prevItem0) {
hide();
}
@@ -110,14 +110,14 @@ void BbdouBubble::show() {
_currItem0 = 0;
calcBubbles(_pt1, _pt2);
-
+
Control *control = _vm->_dict->getObjectControl(_prevItem0->_objectId);
control->setActorPosition(_pt2);
control->startSequenceActor(0x60057, 2, 0);
control->startSequenceActor(_prevItem0->_sequenceId1, 2, 0);
control->appearActor();
control->deactivateObject();
-
+
for (uint i = 0; i < 32; ++i) {
if (_items[i]._enabled == 1) {
Control *subControl = _vm->_dict->getObjectControl(_items[i]._objectId);
@@ -125,7 +125,7 @@ void BbdouBubble::show() {
subControl->startSequenceActor(_items[i]._sequenceId, 2, 0);
}
}
-
+
}
void BbdouBubble::hide() {
@@ -156,7 +156,7 @@ void BbdouBubble::setup(int16 minCount, Common::Point pt1, Common::Point pt2, ui
if (item0->_count < maxCount && item0->_count >= minCount &&
(!progResKeywordId || item0->_progResKeywordId == progResKeywordId)) {
maxCount = item0->_count;
- _currItem0 = item0;
+ _currItem0 = item0;
}
}
_pt1 = pt1;
@@ -204,7 +204,7 @@ void BbdouBubble::calcBubbles(Common::Point &pt1, Common::Point &pt2) {
for (int i = 0; i < kSequenceIdsCount; ++i)
sequenceCounters[i] = 0;
-
+
if (pt2.y >= pt1.y) {
swapY = true;
if (pt1.x == pt2.x)
diff --git a/engines/illusions/bbdou/bbdou_credits.cpp b/engines/illusions/bbdou/bbdou_credits.cpp
index 393026e9f7..08f9900c4e 100644
--- a/engines/illusions/bbdou/bbdou_credits.cpp
+++ b/engines/illusions/bbdou/bbdou_credits.cpp
@@ -53,7 +53,7 @@ void BbdouCredits::stop() {
void BbdouCredits::drawNextLine() {
uint leftIndex, rightIndex;
-
+
if (!readNextLine(leftIndex, rightIndex)) {
_vm->_scriptResource->_properties.set(_endSignalPropertyId, true);
return;
@@ -81,13 +81,13 @@ void BbdouCredits::drawNextLine() {
void charToWChar(const char *text, uint16 *wtext, uint size) {
while (*text != 0 && size > 1) {
*wtext++ = (byte)*text++;
- /*
+ /*
byte c = (byte)*text++;
if (c > 127) c = 32;
*wtext = c;
- debug("%04X", *wtext);
+ debug("%04X", *wtext);
++wtext;
- */
+ */
--size;
}
*wtext++ = 0;
@@ -99,7 +99,7 @@ void BbdouCredits::drawTextToControl(uint32 objectId, const char *text, uint ali
// TODO Extract to Actor class
Control *control = _vm->getObjectControl(objectId);
- FontResource *font = _vm->_dict->findFont(_currFontId);
+ FontResource *font = _vm->_dict->findFont(_currFontId);
TextDrawer textDrawer;
WidthHeight dimensions;
uint16 *outText;
@@ -116,7 +116,7 @@ bool BbdouCredits::readNextLine(uint &leftIndex, uint &rightIndex) {
int textLines = 0;
leftIndex = 0;
rightIndex = 0;
-
+
do {
uint lineIndex = _currLineIndex++;
const char *text = getText(lineIndex);
@@ -147,7 +147,7 @@ bool BbdouCredits::readNextLine(uint &leftIndex, uint &rightIndex) {
}
}
} while (!done);
-
+
return textLines > 0;
}
diff --git a/engines/illusions/bbdou/bbdou_cursor.cpp b/engines/illusions/bbdou/bbdou_cursor.cpp
index 605919a29f..3a098b9f1e 100644
--- a/engines/illusions/bbdou/bbdou_cursor.cpp
+++ b/engines/illusions/bbdou/bbdou_cursor.cpp
@@ -50,7 +50,7 @@ void BbdouCursor::init(uint32 objectId, uint32 progResKeywordId) {
Control *control = _vm->_dict->getObjectControl(objectId);
// TODO? control->_actor->setControlRoutine(new Common::Functor2Mem<Control*, uint32, void, BbdouCursor>(this, &BbdouCursor::actorControlRoutine1));
control->_flags |= 8;
-
+
_data._mode = 1;
_data._mode2 = 0;
_data._verbId1 = 0x1B0000;
@@ -75,7 +75,7 @@ void BbdouCursor::init(uint32 objectId, uint32 progResKeywordId) {
_data._verbState._objectIds[1] = 0;
_data._verbState._index = 0;
_data._verbState._flag56 = false;
-
+
resetActiveVerbs();
control->setActorIndexTo1();
@@ -128,7 +128,7 @@ void BbdouCursor::reset(uint32 objectId) {
_bbdou->hideVerbBubble(control->_objectId, &_data._verbState);
// TODO? control->_actor->setControlRoutine(new Common::Functor2Mem<Control*, uint32, void, BbdouCursor>(this, &BbdouCursor::cursorInteractControlRoutine));
-
+
}
void BbdouCursor::addCursorSequenceId(uint32 objectId, uint32 sequenceId) {
diff --git a/engines/illusions/bbdou/bbdou_specialcode.cpp b/engines/illusions/bbdou/bbdou_specialcode.cpp
index 95e17fad2e..89f94419ef 100644
--- a/engines/illusions/bbdou/bbdou_specialcode.cpp
+++ b/engines/illusions/bbdou/bbdou_specialcode.cpp
@@ -492,7 +492,7 @@ void BbdouSpecialCode::playSoundEffect(int soundIndex) {
0x900C1, 2,
0, 3,
0x900C0, 4,
- 0x900C2, 5,
+ 0x900C2, 5,
0, 6
};
uint32 soundEffectId = kSoundEffectIds[2 * soundIndex];
@@ -535,11 +535,11 @@ Common::Point BbdouSpecialCode::getBackgroundCursorPos(Common::Point cursorPos)
void BbdouSpecialCode::showBubble(uint32 objectId, uint32 overlappedObjectId, uint32 holdingObjectId,
VerbState *verbState, uint32 progResKeywordId) {
-
+
Common::Rect collisionRect;
Control *overlappedControl, *control2, *control3;
Common::Point bubbleSourcePt(320, 240), bubbleDestPt, currPan;
-
+
overlappedControl = _vm->_dict->getObjectControl(overlappedObjectId);
overlappedControl->getCollisionRect(collisionRect);
@@ -564,7 +564,7 @@ void BbdouSpecialCode::showBubble(uint32 objectId, uint32 overlappedObjectId, ui
verbState->_objectIds[0] = _bubble->addItem(0, 0x6005A);
verbState->_objectIds[1] = _bubble->addItem(0, 0x6005A);
verbState->_index = 0;
-
+
int value = _objectInteractModeMap.getObjectInteractMode(overlappedControl->_objectId);
if (holdingObjectId) {
verbState->_verbId = 0x1B0003;
@@ -575,15 +575,15 @@ void BbdouSpecialCode::showBubble(uint32 objectId, uint32 overlappedObjectId, ui
} else {
verbState->_verbId = 0x1B0002;
}
-
+
uint32 sequenceId = kStruct10s[verbState->_verbId & 0xFFFF]._sequenceId2;
_bubble->show();
-
+
control3 = _vm->_dict->getObjectControl(verbState->_objectIds[0]);
control3->startSequenceActor(sequenceId, 2, 0);
control3->appearActor();
control3->deactivateObject();
-
+
verbState->_isBubbleVisible = true;
_vm->_input->discardAllEvents();
@@ -633,7 +633,7 @@ void BbdouSpecialCode::cursorInteractControlRoutine(Control *cursorControl, uint
cursorPos = getBackgroundCursorPos(cursorPos);
bool foundOverlapped = false;
Control *overlappedControl = 0;
-
+
if (cursorData._flags & 1) {
foundOverlapped = false;
} else if (_vm->getCurrentScene() == 0x1000D) {
@@ -643,7 +643,7 @@ void BbdouSpecialCode::cursorInteractControlRoutine(Control *cursorControl, uint
foundOverlapped = _vm->_controls->getOverlappedObject(cursorControl, cursorPos,
&overlappedControl, cursorData._verbState._minPriority);
}
-
+
if (foundOverlapped) {
if (overlappedControl->_objectId != cursorData._currOverlappedObjectId) {
if (cursorData._verbState._isBubbleVisible)
@@ -954,10 +954,10 @@ bool BbdouSpecialCode::testVerbId(uint32 verbId, uint32 holdingObjectId, uint32
static const uint32 kVerbIdsHE[] = {0x001B0003, 0x001B0001, 0};
static const uint32 kVerbIdsH9[] = {0x001B0003, 0};
static const uint32 kVerbIdsH8[] = {0x001B0003, 0x001B0001, 0};
-
+
const uint32 *verbIds;
int interactMode = _objectInteractModeMap.getObjectInteractMode(overlappedObjectId);
-
+
if (holdingObjectId) {
if (interactMode == 9)
verbIds = kVerbIdsH9;
@@ -973,7 +973,7 @@ bool BbdouSpecialCode::testVerbId(uint32 verbId, uint32 holdingObjectId, uint32
else
verbIds = kVerbIdsEE;
}
-
+
for (; *verbIds; ++verbIds)
if (*verbIds == verbId)
return true;
@@ -1019,7 +1019,7 @@ bool BbdouSpecialCode::runCause(Control *cursorControl, CursorData &cursorData,
uint32 sceneId = _vm->getCurrentScene();
uint32 outVerbId, outObjectId2, outObjectId;
bool success = false;
-
+
if (getCause(_vm->getCurrentScene(), verbId, objectId2, objectId, outVerbId, outObjectId2, outObjectId)) {
sceneId = _vm->getCurrentScene();
success = true;
@@ -1027,7 +1027,7 @@ bool BbdouSpecialCode::runCause(Control *cursorControl, CursorData &cursorData,
sceneId = 0x10003;
success = true;
}
-
+
if (!success)
return false;
@@ -1042,7 +1042,7 @@ bool BbdouSpecialCode::runCause(Control *cursorControl, CursorData &cursorData,
if (soundIndex)
playSoundEffect(soundIndex);
-
+
cursorData._causeThreadId1 = _vm->causeTrigger(sceneId, outVerbId, outObjectId2, outObjectId, threadId);
cursorData._causeThreadId2 = cursorData._causeThreadId1;
diff --git a/engines/illusions/bbdou/bbdou_specialcode.h b/engines/illusions/bbdou/bbdou_specialcode.h
index 5d11e3b369..df9b3f76c1 100644
--- a/engines/illusions/bbdou/bbdou_specialcode.h
+++ b/engines/illusions/bbdou/bbdou_specialcode.h
@@ -118,7 +118,7 @@ public:
BbdouCursor *_cursor;
BbdouBubble *_bubble;
BbdouInventory *_inventory;
-
+
BbdouCredits *_credits;
// Salad
@@ -130,7 +130,7 @@ public:
uint _shooterObjectIdIndex;
BbdouFoodCtl *_foodCtl;
-
+
ObjectInteractModeMap _objectInteractModeMap;
// Special code interface functions
diff --git a/engines/illusions/bbdou/bbdou_triggerfunctions.cpp b/engines/illusions/bbdou/bbdou_triggerfunctions.cpp
index 7c1ee4702e..6025d44de7 100644
--- a/engines/illusions/bbdou/bbdou_triggerfunctions.cpp
+++ b/engines/illusions/bbdou/bbdou_triggerfunctions.cpp
@@ -76,7 +76,7 @@ TriggerFunctions::ItemsIterator TriggerFunctions::findInternal(uint32 sceneId, u
triggerFunction->_objectId2 == objectId2 && triggerFunction->_objectId == objectId)
break;
}
- return it;
+ return it;
}
} // End of namespace Illusions
diff --git a/engines/illusions/bbdou/illusions_bbdou.cpp b/engines/illusions/bbdou/illusions_bbdou.cpp
index 06cfc2891a..0074036f56 100644
--- a/engines/illusions/bbdou/illusions_bbdou.cpp
+++ b/engines/illusions/bbdou/illusions_bbdou.cpp
@@ -154,7 +154,7 @@ Common::Error IllusionsEngine_BBDOU::run() {
_screen = new Screen16Bit(this, 640, 480);
_screenPalette = new NullScreenPalette();
_screenText = new ScreenText(this);
- _input = new Input();
+ _input = new Input();
_actorInstances = new ActorInstanceList(this);
_backgroundInstances = new BackgroundInstanceList(this);
_camera = new Camera(this);
@@ -176,7 +176,7 @@ Common::Error IllusionsEngine_BBDOU::run() {
_scriptOpcodes = new ScriptOpcodes_BBDOU(this);
_stack = new ScriptStack();
-
+
// TODO Move to own class
_resGetCtr = 0;
_unpauseControlActorFlag = false;
@@ -291,7 +291,7 @@ int IllusionsEngine_BBDOU::updateScript(uint flags) {
bool IllusionsEngine_BBDOU::causeIsDeclared(uint32 sceneId, uint32 verbId, uint32 objectId2, uint32 objectId) {
uint32 codeOffs;
- return
+ return
_triggerFunctions->find(sceneId, verbId, objectId2, objectId) ||
findTriggerCause(sceneId, verbId, objectId2, objectId, codeOffs);
}
diff --git a/engines/illusions/bbdou/illusions_bbdou.h b/engines/illusions/bbdou/illusions_bbdou.h
index c1bd22b1fd..ddbb8278a4 100644
--- a/engines/illusions/bbdou/illusions_bbdou.h
+++ b/engines/illusions/bbdou/illusions_bbdou.h
@@ -61,7 +61,7 @@ public:
protected:
virtual Common::Error run();
virtual bool hasFeature(EngineFeature f) const;
-public:
+public:
ScriptMan *_scriptMan;
TriggerFunctions *_triggerFunctions;
Cursor *_cursor;
@@ -94,8 +94,8 @@ public:
Common::Point getNamedPointPosition(uint32 namedPointId);
uint32 getPriorityFromBase(int16 priority);
uint32 getCurrentScene();
- uint32 getPrevScene();
-
+ uint32 getPrevScene();
+
bool isCursorObject(uint32 actorTypeId, uint32 objectId);
void setCursorControlRoutine(Control *control);
void placeCursorControl(Control *control, uint32 sequenceId);
@@ -117,7 +117,7 @@ public:
uint32 startTempScriptThread(byte *scriptCodeIp, uint32 callingThreadId,
uint32 value8, uint32 valueC, uint32 value10);
void resumeFromSavegame(uint32 callingThreadId);
-
+
void newScriptThread(uint32 threadId, uint32 callingThreadId, uint notifyFlags,
byte *scriptCodeIp, uint32 value8, uint32 valueC, uint32 value10);
uint32 newTimerThread(uint32 duration, uint32 callingThreadId, bool isAbortable);
@@ -135,7 +135,7 @@ public:
void setSceneIdThreadId(uint32 theSceneId, uint32 theThreadId);
bool findTriggerCause(uint32 sceneId, uint32 verbId, uint32 objectId2, uint32 objectId, uint32 &codeOffs);
void reset();
-
+
};
} // End of namespace Illusions
diff --git a/engines/illusions/bbdou/scriptopcodes_bbdou.cpp b/engines/illusions/bbdou/scriptopcodes_bbdou.cpp
index eb37025631..764dda9d38 100644
--- a/engines/illusions/bbdou/scriptopcodes_bbdou.cpp
+++ b/engines/illusions/bbdou/scriptopcodes_bbdou.cpp
@@ -100,7 +100,7 @@ void ScriptOpcodes_BBDOU::initOpcodes() {
OPCODE(45, opSetProperty);
OPCODE(46, opPlaceActor);
OPCODE(47, opFaceActor);
- OPCODE(48, opFaceActorToObject);
+ OPCODE(48, opFaceActorToObject);
OPCODE(49, opStartSequenceActor);
// 50 unused
OPCODE(51, opStartMoveActor);
@@ -219,9 +219,9 @@ void ScriptOpcodes_BBDOU::opStartTimerThread(ScriptThread *scriptThread, OpCall
ARG_INT16(maxDuration);
if (maxDuration)
duration += _vm->getRandom(maxDuration);
-
+
//duration = 1;//DEBUG Speeds up things
-
+
if (isAbortable)
_vm->startAbortableTimerThread(duration, opCall._threadId);
else
@@ -332,7 +332,7 @@ void ScriptOpcodes_BBDOU::opChangeScene(ScriptThread *scriptThread, OpCall &opCa
threadId = dthreadId;
dsceneId = 0;
}
-
+
// NOTE Skipped checking for stalled resources
_vm->_input->discardAllEvents();
_vm->_prevSceneId = _vm->getCurrentScene();
@@ -381,13 +381,13 @@ void ScriptOpcodes_BBDOU::opExitCloseUpScene(ScriptThread *scriptThread, OpCall
}
void ScriptOpcodes_BBDOU::opPanCenterObject(ScriptThread *scriptThread, OpCall &opCall) {
- ARG_INT16(speed);
+ ARG_INT16(speed);
ARG_UINT32(objectId);
_vm->_camera->panCenterObject(objectId, speed);
}
void ScriptOpcodes_BBDOU::opPanToObject(ScriptThread *scriptThread, OpCall &opCall) {
- ARG_INT16(speed);
+ ARG_INT16(speed);
ARG_UINT32(objectId);
Control *control = _vm->_dict->getObjectControl(objectId);
Common::Point pos = control->getActorPosition();
@@ -395,16 +395,16 @@ void ScriptOpcodes_BBDOU::opPanToObject(ScriptThread *scriptThread, OpCall &opCa
}
void ScriptOpcodes_BBDOU::opPanToNamedPoint(ScriptThread *scriptThread, OpCall &opCall) {
- ARG_INT16(speed);
+ ARG_INT16(speed);
ARG_UINT32(namedPointId);
Common::Point pos = _vm->getNamedPointPosition(namedPointId);
_vm->_camera->panToPoint(pos, speed, opCall._threadId);
}
void ScriptOpcodes_BBDOU::opPanToPoint(ScriptThread *scriptThread, OpCall &opCall) {
- ARG_INT16(speed);
- ARG_INT16(x);
- ARG_INT16(y);
+ ARG_INT16(speed);
+ ARG_INT16(x);
+ ARG_INT16(y);
_vm->_camera->panToPoint(Common::Point(x, y), speed, opCall._threadId);
}
@@ -432,7 +432,7 @@ void ScriptOpcodes_BBDOU::opSetCameraBoundsToMasterBg(ScriptThread *scriptThread
}
void ScriptOpcodes_BBDOU::opIncBlockCounter(ScriptThread *scriptThread, OpCall &opCall) {
- ARG_INT16(index);
+ ARG_INT16(index);
byte value = _vm->_scriptResource->_blockCounters.get(index) + 1;
if (value <= 63)
_vm->_scriptResource->_blockCounters.set(index, value);
@@ -444,8 +444,8 @@ void ScriptOpcodes_BBDOU::opClearBlockCounter(ScriptThread *scriptThread, OpCall
}
void ScriptOpcodes_BBDOU::opSetProperty(ScriptThread *scriptThread, OpCall &opCall) {
- ARG_INT16(value);
- ARG_UINT32(propertyId);
+ ARG_INT16(value);
+ ARG_UINT32(propertyId);
_vm->_scriptResource->_properties.set(propertyId, value != 0);
}
@@ -521,7 +521,7 @@ void ScriptOpcodes_BBDOU::opSetActorPosition(ScriptThread *scriptThread, OpCall
}
void ScriptOpcodes_BBDOU::opStartTalkThread(ScriptThread *scriptThread, OpCall &opCall) {
- ARG_INT16(duration);
+ ARG_INT16(duration);
ARG_UINT32(objectId);
ARG_UINT32(talkId);
ARG_UINT32(sequenceId1);
@@ -749,8 +749,8 @@ void ScriptOpcodes_BBDOU::opGetProperty(ScriptThread *scriptThread, OpCall &opCa
}
void ScriptOpcodes_BBDOU::opCompareBlockCounter(ScriptThread *scriptThread, OpCall &opCall) {
- ARG_INT16(index);
- ARG_INT16(compareOp);
+ ARG_INT16(index);
+ ARG_INT16(compareOp);
ARG_INT16(rvalue);
int16 lvalue = _vm->_scriptResource->_blockCounters.get(index);
bool compareResult = false;
@@ -793,19 +793,19 @@ void ScriptOpcodes_BBDOU::opPlayVideo(ScriptThread *scriptThread, OpCall &opCall
ARG_UINT32(videoId);
ARG_UINT32(priority);
// TODO _vm->playVideo(videoId, objectId, value, opCall._threadId);
-
+
//DEBUG Resume calling thread, later done by the video player
_vm->notifyThreadId(opCall._callerThreadId);
-
+
}
void ScriptOpcodes_BBDOU::opStackPop(ScriptThread *scriptThread, OpCall &opCall) {
- _vm->_stack->pop();
+ _vm->_stack->pop();
}
void ScriptOpcodes_BBDOU::opStackDup(ScriptThread *scriptThread, OpCall &opCall) {
int16 value = _vm->_stack->peek();
- _vm->_stack->push(value);
+ _vm->_stack->push(value);
}
void ScriptOpcodes_BBDOU::opLoadSpecialCodeModule(ScriptThread *scriptThread, OpCall &opCall) {
diff --git a/engines/illusions/bbdou/scriptopcodes_bbdou.h b/engines/illusions/bbdou/scriptopcodes_bbdou.h
index d8e0e39731..5385103a3e 100644
--- a/engines/illusions/bbdou/scriptopcodes_bbdou.h
+++ b/engines/illusions/bbdou/scriptopcodes_bbdou.h
@@ -71,7 +71,7 @@ protected:
void opPanToPoint(ScriptThread *scriptThread, OpCall &opCall);
void opPanStop(ScriptThread *scriptThread, OpCall &opCall);
void opSetDisplay(ScriptThread *scriptThread, OpCall &opCall);
- void opSetCameraBounds(ScriptThread *scriptThread, OpCall &opCall);
+ void opSetCameraBounds(ScriptThread *scriptThread, OpCall &opCall);
void opSetCameraBoundsToMasterBg(ScriptThread *scriptThread, OpCall &opCall);
void opIncBlockCounter(ScriptThread *scriptThread, OpCall &opCall);
void opClearBlockCounter(ScriptThread *scriptThread, OpCall &opCall);
@@ -134,7 +134,7 @@ protected:
void opSetFontId(ScriptThread *scriptThread, OpCall &opCall);
void opAddMenuKey(ScriptThread *scriptThread, OpCall &opCall);
void opChangeSceneAll(ScriptThread *scriptThread, OpCall &opCall);
-
+
};
} // End of namespace Illusions
diff --git a/engines/illusions/camera.cpp b/engines/illusions/camera.cpp
index 1f7ea32d64..7fdb219544 100644
--- a/engines/illusions/camera.cpp
+++ b/engines/illusions/camera.cpp
@@ -132,7 +132,7 @@ void Camera::panToPoint(Common::Point pt, int16 panSpeed, uint32 panNotifyId) {
_activeState._panTargetPoint = getPtOffset(pt);
clipPanTargetPoint();
-
+
if (panSpeed) {
_activeState._cameraMode = 5;
_activeState._panSpeed = panSpeed;
@@ -269,7 +269,7 @@ void Camera::update(uint32 currTime) {
updateMode3(currTime);
break;
}
-
+
if (_activeState._cameraMode != 6) {
if (!isPanFinished() && updatePan(currTime)) {
@@ -389,7 +389,7 @@ void Camera::updateMode1(uint32 currTime) {
_activeState._panStartTime = _activeState._time28;
recalcPan(oldPanTime);
}
-
+
}
void Camera::updateMode2(uint32 currTime) {
@@ -451,7 +451,7 @@ void Camera::updateMode3(uint32 currTime) {
recalcPan(currTime);
_activeState._cameraMode = 4;
}
-
+
}
bool Camera::updatePan(uint32 currTime) {
diff --git a/engines/illusions/detection.cpp b/engines/illusions/detection.cpp
index bbecdc0210..63aea79ba6 100644
--- a/engines/illusions/detection.cpp
+++ b/engines/illusions/detection.cpp
@@ -166,7 +166,7 @@ SaveStateDescriptor IllusionsMetaEngine::querySaveMetaInfos(const char *target,
Illusions::IllusionsEngine::kReadSaveHeaderError error;
error = Illusions::IllusionsEngine::readSaveHeader(in, true, header);
delete in;
- if (error == Illusions::IllusionsEngine::kRSHENoError) {
+ if (error == Illusions::IllusionsEngine::kRSHENoError) {
SaveStateDescriptor desc(slot, header.description);
// Slot 0 is used for the "Continue" save
desc.setDeletableFlag(slot != 0);
diff --git a/engines/illusions/duckman/duckman_credits.cpp b/engines/illusions/duckman/duckman_credits.cpp
index ccbde8daf3..804d55e4d3 100644
--- a/engines/illusions/duckman/duckman_credits.cpp
+++ b/engines/illusions/duckman/duckman_credits.cpp
@@ -100,7 +100,7 @@ int DuckmanCredits::update(uint flags) {
uint16 wtext[128];
charToWChar(text, wtext, ARRAYSIZE(wtext));
- FontResource *font = _vm->_dict->findFont(0x120001);
+ FontResource *font = _vm->_dict->findFont(0x120001);
TextDrawer textDrawer;
WidthHeight dimensions;
uint16 *outText;
@@ -158,28 +158,28 @@ char *DuckmanCredits::readNextLine() {
Common::Point DuckmanCredits::getItemPosition(int index) {
static const struct { int16 x, y; } kCreditsItemsPoints[] = {
- {159, 200}, {158, 195}, {157, 190}, {156, 185}, {156, 180}, {157, 176},
- {158, 172}, {159, 168}, {161, 164}, {162, 161}, {163, 158}, {163, 155},
- {162, 152}, {161, 149}, {159, 147}, {158, 144}, {157, 142}, {156, 140},
- {156, 138}, {157, 136}, {158, 134}, {159, 132}, {161, 130}, {162, 128},
- {163, 127}, {163, 126}, {162, 125}, {161, 124}, {159, 123}, {158, 122},
- {157, 121}, {156, 120}, {156, 119}, {157, 118}, {158, 117}, {159, 116},
- {161, 115}, {162, 114}, {163, 113}, {163, 112}, {162, 111}, {161, 110},
- {159, 109}, {158, 108}, {157, 107}, {156, 106}, {156, 105}, {157, 104},
- {158, 103}, {159, 102}, {161, 101}, {162, 100}, {163, 99}, {163, 98},
- {162, 97}, {161, 96}, {159, 95}, {158, 94}, {157, 93}, {156, 92},
- {156, 91}, {157, 90}, {158, 89}, {159, 88}, {161, 87}, {162, 86},
- {163, 85}, {163, 84}, {162, 83}, {161, 82}, {159, 81}, {158, 80},
+ {159, 200}, {158, 195}, {157, 190}, {156, 185}, {156, 180}, {157, 176},
+ {158, 172}, {159, 168}, {161, 164}, {162, 161}, {163, 158}, {163, 155},
+ {162, 152}, {161, 149}, {159, 147}, {158, 144}, {157, 142}, {156, 140},
+ {156, 138}, {157, 136}, {158, 134}, {159, 132}, {161, 130}, {162, 128},
+ {163, 127}, {163, 126}, {162, 125}, {161, 124}, {159, 123}, {158, 122},
+ {157, 121}, {156, 120}, {156, 119}, {157, 118}, {158, 117}, {159, 116},
+ {161, 115}, {162, 114}, {163, 113}, {163, 112}, {162, 111}, {161, 110},
+ {159, 109}, {158, 108}, {157, 107}, {156, 106}, {156, 105}, {157, 104},
+ {158, 103}, {159, 102}, {161, 101}, {162, 100}, {163, 99}, {163, 98},
+ {162, 97}, {161, 96}, {159, 95}, {158, 94}, {157, 93}, {156, 92},
+ {156, 91}, {157, 90}, {158, 89}, {159, 88}, {161, 87}, {162, 86},
+ {163, 85}, {163, 84}, {162, 83}, {161, 82}, {159, 81}, {158, 80},
{157, 79}, {156, 78}, {156, 77}, {157, 76}, {158, 75}, {159, 74},
- {161, 73}, {162, 72}, {163, 71}, {163, 70}, {162, 69}, {161, 68},
- {159, 67}, {158, 66}, {157, 64}, {156, 62}, {156, 60}, {157, 58},
- {158, 56}, {159, 54}, {161, 52}, {162, 50}, {163, 40}, {163, 40},
- {162, 40}, {161, 40}, {159, 40}, {158, 40}, {157, 40}, {156, 40},
- {156, 40}, {157, 40}, {158, 40}, {159, 40}, {161, 40}, {162, 40},
- {163, 40}, {163, 40}, {162, 40}, {161, 40}, {159, 40}, {158, 40},
- {157, 40}, {156, 40}, {156, 40}, {157, 40}, {158, 40}, {159, 40},
- {161, 40}, {162, 40}, {163, 40}, {163, 40}, {162, 40}, {161, 40},
- {159, 40}, {158, 40}, { -1, -1}
+ {161, 73}, {162, 72}, {163, 71}, {163, 70}, {162, 69}, {161, 68},
+ {159, 67}, {158, 66}, {157, 64}, {156, 62}, {156, 60}, {157, 58},
+ {158, 56}, {159, 54}, {161, 52}, {162, 50}, {163, 40}, {163, 40},
+ {162, 40}, {161, 40}, {159, 40}, {158, 40}, {157, 40}, {156, 40},
+ {156, 40}, {157, 40}, {158, 40}, {159, 40}, {161, 40}, {162, 40},
+ {163, 40}, {163, 40}, {162, 40}, {161, 40}, {159, 40}, {158, 40},
+ {157, 40}, {156, 40}, {156, 40}, {157, 40}, {158, 40}, {159, 40},
+ {161, 40}, {162, 40}, {163, 40}, {163, 40}, {162, 40}, {161, 40},
+ {159, 40}, {158, 40}, { -1, -1}
};
if (index < 0 || index >= ARRAYSIZE(kCreditsItemsPoints))
diff --git a/engines/illusions/duckman/duckman_credits.h b/engines/illusions/duckman/duckman_credits.h
index 039575ced5..ef52553efc 100644
--- a/engines/illusions/duckman/duckman_credits.h
+++ b/engines/illusions/duckman/duckman_credits.h
@@ -41,7 +41,7 @@ public:
DuckmanCredits(IllusionsEngine_Duckman *vm);
~DuckmanCredits();
void start();
-public:
+public:
typedef Common::Array<CreditsItem> CreditsItems;
IllusionsEngine_Duckman *_vm;
uint32 _lastUpdateTicks;
diff --git a/engines/illusions/duckman/duckman_dialog.cpp b/engines/illusions/duckman/duckman_dialog.cpp
index f624ed8d01..60da222ad9 100644
--- a/engines/illusions/duckman/duckman_dialog.cpp
+++ b/engines/illusions/duckman/duckman_dialog.cpp
@@ -131,7 +131,7 @@ void DuckmanDialogSystem::updateDialogState() {
Control *currOverlappedControl = _vm->_cursor._currOverlappedControl;
Control *newOverlappedControl;
-
+
if (_vm->_controls->getDialogItemAtPos(_vm->_cursor._control, mousePos, &newOverlappedControl)) {
if (currOverlappedControl != newOverlappedControl) {
newOverlappedControl->setActorIndex(2);
diff --git a/engines/illusions/duckman/duckman_dialog.h b/engines/illusions/duckman/duckman_dialog.h
index 9c7cfad484..cb4b4a1239 100644
--- a/engines/illusions/duckman/duckman_dialog.h
+++ b/engines/illusions/duckman/duckman_dialog.h
@@ -42,7 +42,7 @@ public:
void startDialog(int16 *choiceOfsPtr, uint32 actorTypeId, uint32 callerThreadId);
void updateDialogState();
public:
- IllusionsEngine_Duckman *_vm;
+ IllusionsEngine_Duckman *_vm;
Common::Array<DialogItem> _dialogItems;
};
diff --git a/engines/illusions/duckman/duckman_inventory.h b/engines/illusions/duckman/duckman_inventory.h
index e1abbebd14..05048f4eac 100644
--- a/engines/illusions/duckman/duckman_inventory.h
+++ b/engines/illusions/duckman/duckman_inventory.h
@@ -47,7 +47,7 @@ public:
DuckmanInventory(IllusionsEngine_Duckman *vm);
~DuckmanInventory();
public:
- IllusionsEngine_Duckman *_vm;
+ IllusionsEngine_Duckman *_vm;
Common::Array<DMInventorySlot> _inventorySlots;
Common::Array<DMInventoryItem> _inventoyItems;
void initInventory();
diff --git a/engines/illusions/duckman/duckman_screenshakereffects.cpp b/engines/illusions/duckman/duckman_screenshakereffects.cpp
index 66bfaeaae2..6ccb143bf0 100644
--- a/engines/illusions/duckman/duckman_screenshakereffects.cpp
+++ b/engines/illusions/duckman/duckman_screenshakereffects.cpp
@@ -36,8 +36,8 @@ static const ScreenShakeEffect kShakerEffect0 = {
};
static const ScreenShakerPoint kShakerPoints1[] = {
- {-4, -5}, {4, 5}, {-3, -4}, {3, 4}, {-2, -3}, {2, 3}, {-1, -2},
- { 1, 2}, {0, -1}
+ {-4, -5}, {4, 5}, {-3, -4}, {3, 4}, {-2, -3}, {2, 3}, {-1, -2},
+ { 1, 2}, {0, -1}
};
static const ScreenShakeEffect kShakerEffect1 = {
diff --git a/engines/illusions/duckman/duckman_specialcode.cpp b/engines/illusions/duckman/duckman_specialcode.cpp
index ec8578290f..c420bd500c 100644
--- a/engines/illusions/duckman/duckman_specialcode.cpp
+++ b/engines/illusions/duckman/duckman_specialcode.cpp
@@ -49,7 +49,7 @@ DuckmanSpecialCode::DuckmanSpecialCode(IllusionsEngine_Duckman *vm)
_propertyTimers = new PropertyTimers(_vm);
_inventory = new DuckmanInventory(_vm);
_credits = new DuckmanCredits(_vm);
-
+
_wasCursorHoldingElvisPoster = false;
_counter = 0;
_savedTempMasterSfxVolume = 16;
@@ -189,7 +189,7 @@ void DuckmanSpecialCode::spcUpdateTeleporterPosition(OpCall &opCall) {
int16 deltaX = 0;
int16 deltaY = 0;
uint32 sequenceId = 0;
-
+
Control *control = _vm->getObjectControl(0x400C0);
switch (direction) {
case 1:
@@ -219,7 +219,7 @@ void DuckmanSpecialCode::spcUpdateTeleporterPosition(OpCall &opCall) {
default:
break;
}
-
+
if (sequenceId) {
control->startSequenceActor(sequenceId, 2, opCall._threadId);
_teleporterPosition.x += deltaX;
diff --git a/engines/illusions/duckman/duckman_specialcode.h b/engines/illusions/duckman/duckman_specialcode.h
index a9fb7b9803..694086b0dc 100644
--- a/engines/illusions/duckman/duckman_specialcode.h
+++ b/engines/illusions/duckman/duckman_specialcode.h
@@ -42,7 +42,7 @@ public:
~DuckmanSpecialCode();
virtual void init();
virtual void run(uint32 specialCodeId, OpCall &opCall);
-public:
+public:
typedef Common::HashMap<uint32, SpecialCodeFunction*> SpecialCodeMap;
typedef SpecialCodeMap::iterator SpecialCodeMapIterator;
diff --git a/engines/illusions/duckman/illusions_duckman.cpp b/engines/illusions/duckman/illusions_duckman.cpp
index 7ffa312948..e08d1b0096 100644
--- a/engines/illusions/duckman/illusions_duckman.cpp
+++ b/engines/illusions/duckman/illusions_duckman.cpp
@@ -89,7 +89,7 @@ Common::Error IllusionsEngine_Duckman::run() {
SearchMan.addSubDirectoryMatching(gameDataDir, "voice");
_dict = new Dictionary();
-
+
_resReader = new ResourceReaderGamArchive("duckman.gam");
_resSys = new ResourceSystem(this);
@@ -106,7 +106,7 @@ Common::Error IllusionsEngine_Duckman::run() {
_screen = new Screen8Bit(this, 320, 200);
_screenPalette = new ScreenPalette(this);
_screenText = new ScreenText(this);
- _input = new Input();
+ _input = new Input();
_actorInstances = new ActorInstanceList(this);
_backgroundInstances = new BackgroundInstanceList(this);
_camera = new Camera(this);
@@ -119,7 +119,7 @@ Common::Error IllusionsEngine_Duckman::run() {
_gameState = new Duckman_GameState(this);
_fader = new Fader();
-
+
_dialogSys = new DuckmanDialogSystem(this);
_screen->setColorKey1(0);
@@ -130,7 +130,7 @@ Common::Error IllusionsEngine_Duckman::run() {
_scriptOpcodes = new ScriptOpcodes_Duckman(this);
_stack = new ScriptStack();
-
+
// TODO Move to own class
_resGetCtr = 0;
_unpauseControlActorFlag = false;
@@ -230,9 +230,9 @@ Common::Error IllusionsEngine_Duckman::run() {
delete _resSys;
delete _resReader;
delete _dict;
-
+
debug("Ok");
-
+
return Common::kNoError;
}
@@ -1015,7 +1015,7 @@ void IllusionsEngine_Duckman::updateGameState2() {
Control *overlappedControl;
_cursor._control->_actor->_position = cursorPos;
-
+
foundOverlapped = _controls->getOverlappedObject(_cursor._control, convMousePos, &overlappedControl, 0);
if (cursorPos.y < 8 && !_camera->isAtPanLimit(1)) {
@@ -1188,7 +1188,7 @@ uint32 IllusionsEngine_Duckman::runTriggerCause(uint32 verbId, uint32 objectId2,
if (!getTriggerCause(verbId, objectId2, objectId, triggerThreadId))
return 0;
-
+
playTriggerCauseSound(verbId, objectId2, objectId);
uint32 tempThreadId = newTempThreadId();
diff --git a/engines/illusions/duckman/illusions_duckman.h b/engines/illusions/duckman/illusions_duckman.h
index 87ca932ea8..feacd50cc1 100644
--- a/engines/illusions/duckman/illusions_duckman.h
+++ b/engines/illusions/duckman/illusions_duckman.h
@@ -94,16 +94,16 @@ public:
Cursor_Duckman _cursor;
Control *_currWalkOverlappedControl;
-
+
DuckmanDialogSystem *_dialogSys;
int _savedInventoryActorIndex;
ScreenShaker *_screenShaker;
DuckmanMenuSystem *_menuSystem;
-
+
void initInput();
-
+
void initUpdateFunctions();
int updateScript(uint flags);
@@ -156,7 +156,7 @@ public:
uint32 startTempScriptThread(byte *scriptCodeIp, uint32 callingThreadId,
uint32 value8, uint32 valueC, uint32 value10);
void resumeFromSavegame(uint32 callingThreadId);
-
+
void newScriptThread(uint32 threadId, uint32 callingThreadId, uint notifyFlags,
byte *scriptCodeIp);
uint32 newTimerThread(uint32 duration, uint32 callingThreadId, bool isAbortable);
@@ -180,9 +180,9 @@ public:
void setSceneIdThreadId(uint32 theSceneId, uint32 theThreadId);
bool findTriggerCause(uint32 sceneId, uint32 verbId, uint32 objectId2, uint32 objectId, uint32 &codeOffs);
void reset();
-
+
uint32 getObjectActorTypeId(uint32 objectId);
-
+
Common::Point convertMousePos(Common::Point mousePos);
void startCursorSequence();
int getCursorActorIndex();
@@ -191,7 +191,7 @@ public:
bool getTriggerCause(uint32 verbId, uint32 objectId2, uint32 objectId, uint32 &outThreadId);
uint32 runTriggerCause(uint32 verbId, uint32 objectId2, uint32 objectId);
void playTriggerCauseSound(uint32 verbId, uint32 objectId2, uint32 objectId);
-
+
bool loadSavegameFromScript(int16 slotNum, uint32 callingThreadId);
bool saveSavegameFromScript(int16 slotNum, uint32 callingThreadId);
void activateSavegame(uint32 callingThreadId);
diff --git a/engines/illusions/duckman/menusystem_duckman.cpp b/engines/illusions/duckman/menusystem_duckman.cpp
index 4d63147321..84f7974d95 100644
--- a/engines/illusions/duckman/menusystem_duckman.cpp
+++ b/engines/illusions/duckman/menusystem_duckman.cpp
@@ -42,7 +42,7 @@ DuckmanMenuSystem::~DuckmanMenuSystem() {
void DuckmanMenuSystem::runMenu(MenuChoiceOffsets menuChoiceOffsets, int16 *menuChoiceOffset,
uint32 menuId, uint32 duration, uint timeOutMenuChoiceIndex, uint32 menuCallerThreadId) {
-
+
debug(0, "DuckmanMenuSystem::runMenu(%08X)", menuId);
setTimeOutDuration(duration, timeOutMenuChoiceIndex);
diff --git a/engines/illusions/duckman/scriptopcodes_duckman.cpp b/engines/illusions/duckman/scriptopcodes_duckman.cpp
index 1876b13593..6b76a65686 100644
--- a/engines/illusions/duckman/scriptopcodes_duckman.cpp
+++ b/engines/illusions/duckman/scriptopcodes_duckman.cpp
@@ -202,11 +202,11 @@ void ScriptOpcodes_Duckman::opStartTimerThread(ScriptThread *scriptThread, OpCal
ARG_INT16(maxDuration);
if (maxDuration)
duration += _vm->getRandom(maxDuration);
-
+
//duration = 1;//DEBUG Speeds up things
//duration = 5;
//debug("duration: %d", duration);
-
+
if (isAbortable)
_vm->startAbortableTimerThread(duration, opCall._callerThreadId);
else
@@ -284,9 +284,9 @@ void ScriptOpcodes_Duckman::opChangeScene(ScriptThread *scriptThread, OpCall &op
ARG_UINT32(sceneId);
ARG_UINT32(threadId);
_vm->_input->discardAllEvents();
-
+
debug(1, "changeScene(%08X, %08X)", sceneId, threadId);
-
+
//DEBUG
#if 0
if (dsceneId) {
@@ -295,7 +295,7 @@ void ScriptOpcodes_Duckman::opChangeScene(ScriptThread *scriptThread, OpCall &op
dsceneId = 0;
}
#endif
-
+
if (_vm->_scriptResource->_properties.get(31)) {
_vm->changeScene(0x10002, 0x20001, opCall._callerThreadId);
} else {
@@ -584,10 +584,10 @@ void ScriptOpcodes_Duckman::opPlayVideo(ScriptThread *scriptThread, OpCall &opCa
ARG_UINT32(objectId);
// NOTE This has no attached objectId or priority
_vm->playVideo(0, objectId, 0, opCall._threadId);
-
+
//DEBUG Resume calling thread, later done by the video player
_vm->notifyThreadId(opCall._threadId);
-
+
}
void ScriptOpcodes_Duckman::opRunSpecialCode(ScriptThread *scriptThread, OpCall &opCall) {
@@ -653,7 +653,7 @@ void ScriptOpcodes_Duckman::opDisplayMenu(ScriptThread *scriptThread, OpCall &op
ARG_INT16(timeOutDuration);
ARG_UINT32(menuId);
ARG_UINT32(timeOutMenuChoiceIndex);
-
+
MenuChoiceOffsets menuChoiceOffsets;
// Load menu choices from the stack
@@ -661,11 +661,11 @@ void ScriptOpcodes_Duckman::opDisplayMenu(ScriptThread *scriptThread, OpCall &op
int16 choiceOffs = _vm->_stack->pop();
menuChoiceOffsets.push_back(choiceOffs);
} while (_vm->_stack->pop() == 0);
-
- _vm->_menuSystem->runMenu(menuChoiceOffsets, &_vm->_menuChoiceOfs,
+
+ _vm->_menuSystem->runMenu(menuChoiceOffsets, &_vm->_menuChoiceOfs,
menuId, timeOutDuration, timeOutMenuChoiceIndex,
opCall._callerThreadId);
-
+
//DEBUG Resume calling thread, later done by the video player
//_vm->notifyThreadId(opCall._callerThreadId);
@@ -713,7 +713,7 @@ void ScriptOpcodes_Duckman::opActivateButton(ScriptThread *scriptThread, OpCall
}
void ScriptOpcodes_Duckman::opIncBlockCounter(ScriptThread *scriptThread, OpCall &opCall) {
- ARG_INT16(index);
+ ARG_INT16(index);
byte value = _vm->_scriptResource->_blockCounters.get(index) + 1;
if (value <= 63)
_vm->_scriptResource->_blockCounters.set(index, value);
@@ -778,8 +778,8 @@ void ScriptOpcodes_Duckman::opGetProperty(ScriptThread *scriptThread, OpCall &op
}
void ScriptOpcodes_Duckman::opCompareBlockCounter(ScriptThread *scriptThread, OpCall &opCall) {
- ARG_INT16(index);
- ARG_INT16(compareOp);
+ ARG_INT16(index);
+ ARG_INT16(compareOp);
ARG_INT16(rvalue);
int16 lvalue = _vm->_scriptResource->_blockCounters.get(index);
bool compareResult = false;
diff --git a/engines/illusions/duckman/scriptopcodes_duckman.h b/engines/illusions/duckman/scriptopcodes_duckman.h
index 0fae4b7b26..521a7329b6 100644
--- a/engines/illusions/duckman/scriptopcodes_duckman.h
+++ b/engines/illusions/duckman/scriptopcodes_duckman.h
@@ -41,7 +41,7 @@ protected:
IllusionsEngine_Duckman *_vm;
// Opcodes
-
+
void opNop(ScriptThread *scriptThread, OpCall &opCall);
void opSuspend(ScriptThread *scriptThread, OpCall &opCall);
void opYield(ScriptThread *scriptThread, OpCall &opCall);
@@ -129,8 +129,8 @@ protected:
void opSetBlockCounter118(ScriptThread *scriptThread, OpCall &opCall);
void opDebug126(ScriptThread *scriptThread, OpCall &opCall);
void opDebug127(ScriptThread *scriptThread, OpCall &opCall);
-
-#if 0
+
+#if 0
void opStartTempScriptThread(ScriptThread *scriptThread, OpCall &opCall);
void opSetThreadSceneId(ScriptThread *scriptThread, OpCall &opCall);
void opEndTalkThreads(ScriptThread *scriptThread, OpCall &opCall);
@@ -157,7 +157,7 @@ protected:
void opSetFontId(ScriptThread *scriptThread, OpCall &opCall);
void opAddMenuKey(ScriptThread *scriptThread, OpCall &opCall);
void opChangeSceneAll(ScriptThread *scriptThread, OpCall &opCall);
-#endif
+#endif
};
} // End of namespace Illusions
diff --git a/engines/illusions/fileresourcereader.cpp b/engines/illusions/fileresourcereader.cpp
index c707c6535a..baa5e47384 100644
--- a/engines/illusions/fileresourcereader.cpp
+++ b/engines/illusions/fileresourcereader.cpp
@@ -30,7 +30,7 @@ namespace Illusions {
byte *ResourceReaderFileReader::readResource(uint32 sceneId, uint32 resId, uint32 &dataSize) {
debug("ResourceReaderFileReader::readResource(%08X, %08X)", sceneId, resId);
-
+
Common::String filename = buildResourceFilename(resId);
Common::File fd;
if (!fd.open(filename))
diff --git a/engines/illusions/gamarchive.cpp b/engines/illusions/gamarchive.cpp
index 098ad35154..5c0debb27e 100644
--- a/engines/illusions/gamarchive.cpp
+++ b/engines/illusions/gamarchive.cpp
@@ -49,20 +49,20 @@ void GamArchive::loadDictionary() {
_groupCount = _fd->readUint32LE();
_groups = new GamGroupEntry[_groupCount];
uint32 *groupOffsets = new uint32[_groupCount];
-
+
for (uint i = 0; i < _groupCount; ++i) {
_groups[i]._id = _fd->readUint32LE();
groupOffsets[i] = _fd->readUint32LE();
}
-
+
for (uint i = 0; i < _groupCount; ++i) {
_fd->seek(groupOffsets[i]);
uint32 fileCount = _fd->readUint32LE();
_groups[i]._fileCount = fileCount;
_groups[i]._files = new GamFileEntry[fileCount];
-
+
debug(8, "Group %08X, fileCount: %d", _groups[i]._id, _groups[i]._fileCount);
-
+
for (uint j = 0; j < fileCount; ++j) {
_groups[i]._files[j]._id = _fd->readUint32LE();
_groups[i]._files[j]._fileOffset = _fd->readUint32LE();
diff --git a/engines/illusions/gamresourcereader.cpp b/engines/illusions/gamresourcereader.cpp
index 18d16be0d6..55c51503d3 100644
--- a/engines/illusions/gamresourcereader.cpp
+++ b/engines/illusions/gamresourcereader.cpp
@@ -40,5 +40,5 @@ ResourceReaderGamArchive::~ResourceReaderGamArchive() {
byte *ResourceReaderGamArchive::readResource(uint32 sceneId, uint32 resId, uint32 &dataSize) {
return _gamArchive->readResource(sceneId, resId, dataSize);
}
-
+
} // End of namespace Illusions
diff --git a/engines/illusions/graphics.cpp b/engines/illusions/graphics.cpp
index eae605641e..24721375cf 100644
--- a/engines/illusions/graphics.cpp
+++ b/engines/illusions/graphics.cpp
@@ -29,7 +29,7 @@ namespace Illusions {
void WidthHeight::load(Common::SeekableReadStream &stream) {
_width = stream.readSint16LE();
_height = stream.readSint16LE();
-
+
debug(5, "WidthHeight::load() _width: %d; _height: %d",
_width, _height);
}
@@ -39,7 +39,7 @@ void WidthHeight::load(Common::SeekableReadStream &stream) {
void SurfInfo::load(Common::SeekableReadStream &stream) {
_pixelSize = stream.readUint32LE();
_dimensions.load(stream);
-
+
debug(5, "SurfInfo::load() _pixelSize: %d",
_pixelSize);
}
diff --git a/engines/illusions/illusions.cpp b/engines/illusions/illusions.cpp
index 01787405e9..14fddc50dc 100644
--- a/engines/illusions/illusions.cpp
+++ b/engines/illusions/illusions.cpp
@@ -76,11 +76,11 @@ char *debugW2I(byte *wstr) {
IllusionsEngine::IllusionsEngine(OSystem *syst, const IllusionsGameDescription *gd) :
Engine(syst), _gameDescription(gd) {
-
+
_random = new Common::RandomSource("illusions");
_rerunThreads = false;
-
+
_isSaveAllowed = true; // TODO
_resumeFromSavegameRequested = false;
_savegameSlotNum = -1;
@@ -167,7 +167,7 @@ int IllusionsEngine::updateGraphics(uint flags) {
Common::Point panPoint(0, 0);
uint32 currTime = getCurrentTime();
-
+
_camera->update(currTime);
updateFader();
diff --git a/engines/illusions/illusions.h b/engines/illusions/illusions.h
index 63983e158a..9cf1e0b83f 100644
--- a/engines/illusions/illusions.h
+++ b/engines/illusions/illusions.h
@@ -98,14 +98,14 @@ private:
const IllusionsGameDescription *_gameDescription;
Graphics::PixelFormat _pixelFormat;
public:
-
+
Common::RandomSource *_random;
Dictionary *_dict;
ResourceSystem *_resSys;
BaseResourceReader *_resReader;
UpdateFunctions *_updateFunctions;
GameState *_gameState;
-
+
void updateEvents();
Screen *_screen;
@@ -121,7 +121,7 @@ public:
SpecialCode *_specialCode;
ThreadList *_threads;
SoundMan *_soundMan;
-
+
uint32 _nextTempThreadId;
bool _doScriptThreadInit;
ScriptStack *_stack;
@@ -199,7 +199,7 @@ public:
virtual Control *getObjectControl(uint32 objectId) = 0;
virtual Common::Point getNamedPointPosition(uint32 namedPointId) = 0;
virtual uint32 getPriorityFromBase(int16 priority) = 0;
- virtual uint32 getPrevScene() = 0;
+ virtual uint32 getPrevScene() = 0;
virtual uint32 getCurrentScene() = 0;
virtual bool isCursorObject(uint32 actorTypeId, uint32 objectId) = 0;
virtual void setCursorControlRoutine(Control *control) = 0;
@@ -211,7 +211,7 @@ public:
virtual uint32 startTempScriptThread(byte *scriptCodeIp, uint32 callingThreadId,
uint32 value8, uint32 valueC, uint32 value10) = 0;
virtual void resumeFromSavegame(uint32 callingThreadId) = 0;
-
+
// Savegame API
enum kReadSaveHeaderError {
diff --git a/engines/illusions/menusystem.cpp b/engines/illusions/menusystem.cpp
index 79cbdd401d..816b17d14e 100644
--- a/engines/illusions/menusystem.cpp
+++ b/engines/illusions/menusystem.cpp
@@ -175,7 +175,7 @@ void BaseMenuSystem::setMouseCursorToMenuItem(int menuItemIndex) {
void BaseMenuSystem::calcMenuItemRect(uint menuItemIndex, WRect &rect) {
FontResource *font = _vm->_dict->findFont(_activeMenu->_fontId);
int charHeight = font->getCharHeight() + font->getLineIncr();
-
+
_vm->_screenText->getTextInfoPosition(rect._topLeft);
if (_activeMenu->_backgroundColor) {
rect._topLeft.y += 4;
@@ -203,7 +203,7 @@ bool BaseMenuSystem::calcMenuItemMousePos(uint menuItemIndex, Common::Point &pt)
bool BaseMenuSystem::calcMenuItemIndexAtPoint(Common::Point pt, uint &menuItemIndex) {
WRect rect;
calcMenuItemRect(1, rect);
-
+
uint index = _hoveredMenuItemIndex3 + (pt.y - rect._topLeft.y) / (rect._bottomRight.y - rect._topLeft.y);
if (pt.y < rect._topLeft.y || pt.x < rect._topLeft.x || pt.x > rect._bottomRight.x ||
@@ -248,12 +248,12 @@ void BaseMenuSystem::initActorHoverBackground() {
}
placeActorHoverBackground();
v0->appearActor();
-}
+}
void BaseMenuSystem::placeActorHoverBackground() {
Control *v0 = _vm->getObjectControl(0x4013E);
v0->fillActor(0);
-
+
WidthHeight textInfoDimensions;
_vm->_screenText->getTextInfoDimensions(textInfoDimensions);
@@ -303,12 +303,12 @@ void BaseMenuSystem::initActorTextColorRect() {
void BaseMenuSystem::placeActorTextColorRect() {
Control *v0 = _vm->getObjectControl(0x40143);
v0->fillActor(0);
-
+
Common::Point textInfoPosition;
WidthHeight textInfoDimensions;
_vm->_screenText->getTextInfoPosition(textInfoPosition);
_vm->_screenText->getTextInfoDimensions(textInfoDimensions);
-
+
if (_activeMenu->_backgroundColor && _activeMenu->_borderColor != _activeMenu->_backgroundColor) {
textInfoDimensions._width -= 2;
textInfoDimensions._height -= 6;
@@ -316,7 +316,7 @@ void BaseMenuSystem::placeActorTextColorRect() {
v0->setActorPosition(textInfoPosition);
v0->drawActorRect(Common::Rect(textInfoDimensions._width - 1, textInfoDimensions._height - 1), _activeMenu->_textColor);
-
+
}
void BaseMenuSystem::hideActorTextColorRect() {
@@ -326,23 +326,23 @@ void BaseMenuSystem::hideActorTextColorRect() {
}
void BaseMenuSystem::openMenu(BaseMenu *menu) {
-
+
_isActive = true;
_menuStack.clear();
-
+
_cursorInitialVisibleFlag = initMenuCursor();
_savedCursorPos = _vm->_input->getCursorPosition();
_savedGameState = getGameState();
Control *cursorControl = _vm->getObjectControl(Illusions::CURSOR_OBJECT_ID);
_savedCursorActorIndex = cursorControl->_actor->_actorIndex;
_savedCursorSequenceId = cursorControl->_actor->_sequenceId;
-
+
setMenuCursorNum(1);
-
+
setGameState(4);
-
+
activateMenu(menu);
-
+
_hoveredMenuItemIndex = _hoveredMenuItemIndex3;
_hoveredMenuItemIndex2 = _hoveredMenuItemIndex3;
setMouseCursorToMenuItem(_hoveredMenuItemIndex);
@@ -381,13 +381,13 @@ void BaseMenuSystem::handleClick(uint menuItemIndex, const Common::Point &mouseP
MenuItem *menuItem = _activeMenu->getMenuItem(menuItemIndex - 1);
menuItem->executeAction(mousePos);
-
+
}
uint BaseMenuSystem::drawMenuText(BaseMenu *menu) {
MenuTextBuilder *menuTextBuilder = new MenuTextBuilder();
uint lineCount = 0;
-
+
for (uint i = 0; i < menu->getHeaderLinesCount(); ++i) {
menuTextBuilder->appendString(menu->getHeaderLine(i));
menuTextBuilder->appendNewLine();
@@ -399,7 +399,7 @@ uint BaseMenuSystem::drawMenuText(BaseMenu *menu) {
menuTextBuilder->appendNewLine();
++lineCount;
}
-
+
menuTextBuilder->finalize();
uint16 *text = menuTextBuilder->getText();
@@ -414,11 +414,11 @@ uint BaseMenuSystem::drawMenuText(BaseMenu *menu) {
uint flags = TEXT_FLAG_LEFT_ALIGN;
if (menu->_backgroundColor != menu->_borderColor)
flags |= TEXT_FLAG_BORDER_DECORATION;
-
+
WidthHeight dimensions;
dimensions._width = 300;
dimensions._height = 180;
-
+
uint16 *outTextPtr;
if (!_vm->_screenText->insertText(text, menu->_fontId, dimensions, textPt, flags, menu->_backgroundColor, menu->_borderColor, 0xFF, 0xFF, 0xFF, outTextPtr)) {
--lineCount;
@@ -436,10 +436,10 @@ uint BaseMenuSystem::drawMenuText(BaseMenu *menu) {
void BaseMenuSystem::update(Control *cursorControl) {
Common::Point mousePos = _vm->_input->getCursorPosition();
setMousePos(mousePos);
-
+
uint newHoveredMenuItemIndex;
bool resetTimeOut = false;
-
+
if (calcMenuItemIndexAtPoint(mousePos, newHoveredMenuItemIndex)) {
if (newHoveredMenuItemIndex != _hoveredMenuItemIndex) {
if (_hoveredMenuItemIndex == 0)
@@ -487,7 +487,7 @@ void BaseMenuSystem::update(Control *cursorControl) {
updateActorHoverBackground();
playSoundEffect(0xC);
}
-
+
updateTimeOut(resetTimeOut);
}
@@ -534,7 +534,7 @@ void BaseMenuSystem::updateTimeOut(bool resetTimeOut) {
} else if (!_isTimeOutReached) {
_isTimeOutReached = true;
}
-
+
if (!_isTimeOutReached) {
if (resetTimeOut) {
_timeOutStartTime = getCurrentTime();
diff --git a/engines/illusions/menusystem.h b/engines/illusions/menusystem.h
index ff85ca60d3..dd4512900d 100644
--- a/engines/illusions/menusystem.h
+++ b/engines/illusions/menusystem.h
@@ -176,7 +176,7 @@ protected:
*/
-class MenuTextBuilder {
+class MenuTextBuilder {
public:
MenuTextBuilder();
void appendString(const Common::String &value);
diff --git a/engines/illusions/pathfinder.cpp b/engines/illusions/pathfinder.cpp
index 04ee493428..e3ea07b095 100644
--- a/engines/illusions/pathfinder.cpp
+++ b/engines/illusions/pathfinder.cpp
@@ -43,7 +43,7 @@ PointArray *PathFinder::findPathInternal(Common::Point sourcePt, Common::Point d
PointArray *foundPath = new PointArray();
line.p0 = sourcePt;
line.p1 = destPt;
-
+
if (_walkRects && _walkPoints && isLineBlocked(line)) {
Common::Point nextStartPt = sourcePt, outPt;
@@ -325,7 +325,7 @@ int PathFinder::calcLineStatus(PathLine &sourceLine, PathLine &destRect, Common:
(delta2 <= 0 && (delta3 > 0 || delta2 > delta3)) ||
(delta2 > 0 && (delta3 < 0 || delta2 < delta3)))
return 3;
-
+
if (!outPoint)
return 1;
@@ -335,7 +335,7 @@ int PathFinder::calcLineStatus(PathLine &sourceLine, PathLine &destRect, Common:
int v15 = sourceDeltaX * delta1, v18 = sourceDeltaY * delta1;
int v16 = 0;
int v17 = 0;
-
+
if ((v15 >= 0 && delta2 >= 0) || (v15 < 0 && delta2 < 0)) {
v16 = delta2 / 2;
v17 = delta2 / 2;
@@ -345,12 +345,12 @@ int PathFinder::calcLineStatus(PathLine &sourceLine, PathLine &destRect, Common:
}
outPoint->x = sourceLine.p0.x + (v15 + v16) / delta2;
-
+
if ((v18 >= 0 && delta2 < 0) || (v18 < 0 && delta2 >= 0))
v17 = -v17;
outPoint->y = sourceLine.p0.y + (v18 + v17) / delta2;
-
+
return 1;
}
diff --git a/engines/illusions/pathfinder.h b/engines/illusions/pathfinder.h
index 47cc0575c5..2b56b2df67 100644
--- a/engines/illusions/pathfinder.h
+++ b/engines/illusions/pathfinder.h
@@ -54,7 +54,7 @@ protected:
bool findValidDestLine(Common::Point &destPt);
void findValidDestPt(Common::Point &destPt);
WidthHeight calcRectDimensions(PathLine &rect);
- void adjustRectDimensions(WidthHeight &dimensions);
+ void adjustRectDimensions(WidthHeight &dimensions);
void swapDimensions(WidthHeight &dimensions);
void clipLineToBg(Common::Point &destPt, WidthHeight &rectDimensions, PathLine &outDestLine);
void findDeltaPt(Common::Point pt, Common::Point &outDeltaPt);
diff --git a/engines/illusions/resources/actorresource.cpp b/engines/illusions/resources/actorresource.cpp
index 42124573b8..13c8abc481 100644
--- a/engines/illusions/resources/actorresource.cpp
+++ b/engines/illusions/resources/actorresource.cpp
@@ -111,7 +111,7 @@ void ActorResource::load(Resource *resource) {
_totalSize = stream.readUint32LE();
- // Load actor types
+ // Load actor types
stream.seek(0x06);
uint actorTypesCount = stream.readUint16LE();
stream.seek(0x10);
@@ -137,7 +137,7 @@ void ActorResource::load(Resource *resource) {
_sequences.push_back(sequence);
}
- // Load frames
+ // Load frames
stream.seek(0x0A);
uint framesCount = stream.readUint16LE();
stream.seek(0x18);
@@ -149,7 +149,7 @@ void ActorResource::load(Resource *resource) {
frame.load(data, stream);
_frames.push_back(frame);
}
-
+
// Load named points
if (resource->_gameId == kGameIdBBDOU) {
// The count isn't stored explicitly so calculate it
@@ -157,7 +157,7 @@ void ActorResource::load(Resource *resource) {
stream.seek(0x20);
_namedPoints.load(namedPointsCount, stream);
}
-
+
debug(1, "ActorResource(%08X) framesCount: %d", resource->_resId, framesCount);
}
@@ -240,7 +240,7 @@ void ActorInstance::registerResources() {
Sequence *sequence = &_actorResource->_sequences[i];
_vm->_dict->addSequence(sequence->_sequenceId, sequence);
}
-}
+}
void ActorInstance::unregisterResources() {
for (uint i = 0; i < _actorResource->_actorTypes.size(); ++i)
diff --git a/engines/illusions/resources/actorresource.h b/engines/illusions/resources/actorresource.h
index 34b4702023..d4f798be79 100644
--- a/engines/illusions/resources/actorresource.h
+++ b/engines/illusions/resources/actorresource.h
@@ -107,7 +107,7 @@ public:
protected:
void initActorTypes(int gameId);
void registerResources();
- void unregisterResources();
+ void unregisterResources();
};
class ActorInstanceList {
diff --git a/engines/illusions/resources/backgroundresource.cpp b/engines/illusions/resources/backgroundresource.cpp
index a35f06e20f..27d73a70b9 100644
--- a/engines/illusions/resources/backgroundresource.cpp
+++ b/engines/illusions/resources/backgroundresource.cpp
@@ -223,10 +223,10 @@ BackgroundResource::~BackgroundResource() {
void BackgroundResource::load(byte *data, uint32 dataSize) {
Common::MemoryReadStream stream(data, dataSize, DisposeAfterUse::NO);
-
+
stream.seek(8);
_paletteIndex = stream.readUint16LE();
-
+
// Load background pixels
stream.seek(0x0A);
_bgInfosCount = stream.readUint16LE();
@@ -295,7 +295,7 @@ void BackgroundResource::load(byte *data, uint32 dataSize) {
stream.seek(backgroundObjectsOffs + i * 12);
_backgroundObjects[i].load(data, stream);
}
-
+
// Load path walk points
stream.seek(0x0E);
_pathWalkPointsCount = stream.readUint16LE();
@@ -392,11 +392,11 @@ void BackgroundInstance::load(Resource *resource) {
_bgRes = backgroundResource;
_sceneId = resource->_sceneId;
initSurface();
-
+
// Insert background objects
for (uint i = 0; i < backgroundResource->_backgroundObjectsCount; ++i)
_vm->_controls->placeBackgroundObject(&backgroundResource->_backgroundObjects[i]);
-
+
registerResources();
// TODO camera_fadeClear();
@@ -451,13 +451,13 @@ void BackgroundInstance::registerResources() {
_vm->_dict->addSequence(sequence->_sequenceId, sequence);
}
}
-
+
void BackgroundInstance::unregisterResources() {
for (uint i = 0; i < _bgRes->_regionSequencesCount; ++i) {
Sequence *sequence = &_bgRes->_regionSequences[i];
_vm->_dict->removeSequence(sequence->_sequenceId);
}
-}
+}
void BackgroundInstance::initSurface() {
for (uint i = 0; i < kMaxBackgroundItemSurfaces; ++i)
diff --git a/engines/illusions/resources/backgroundresource.h b/engines/illusions/resources/backgroundresource.h
index d0c0c76233..fba2e7ecfe 100644
--- a/engines/illusions/resources/backgroundresource.h
+++ b/engines/illusions/resources/backgroundresource.h
@@ -150,7 +150,7 @@ public:
uint _bgInfosCount;
BgInfo *_bgInfos;
-
+
uint _priorityLayersCount;
PriorityLayer *_priorityLayers;
@@ -173,7 +173,7 @@ public:
PathWalkRects *_pathWalkRects;
NamedPoints _namedPoints;
-
+
uint _palettesCount;
Palette *_palettes;
@@ -197,8 +197,8 @@ public:
Graphics::Surface *_surfaces[kMaxBackgroundItemSurfaces];
CameraState _savedCameraState;
byte *_savedPalette;
- void registerResources();
- void unregisterResources();
+ void registerResources();
+ void unregisterResources();
void initSurface();
void freeSurface();
void drawTiles(Graphics::Surface *surface, TileMap &tileMap, byte *tilePixels);
diff --git a/engines/illusions/resources/scriptresource.cpp b/engines/illusions/resources/scriptresource.cpp
index e2108a65c2..08433fe71c 100644
--- a/engines/illusions/resources/scriptresource.cpp
+++ b/engines/illusions/resources/scriptresource.cpp
@@ -155,7 +155,7 @@ void TriggerCause::load(Common::SeekableReadStream &stream) {
_verbId = stream.readUint32LE();
_objectId2 = stream.readUint32LE();
_codeOffs = stream.readUint32LE();
-
+
debug(2, "TriggerCause::load() _verbId: %08X; _objectId2: %08X; _codeOffs: %08X",
_verbId, _objectId2, _codeOffs);
}
@@ -283,10 +283,10 @@ void ScriptResource::load(Resource *resource) {
_dataSize = resource->_dataSize;
Common::MemoryReadStream stream(_data, _dataSize, DisposeAfterUse::NO);
-
+
uint32 objectMapOffs = 0, sceneInfosOffs = 0;
_objectMapCount = 0;
-
+
if (resource->_gameId == kGameIdBBDOU) {
sceneInfosOffs = 0x18;
} else if (resource->_gameId == kGameIdDuckman) {
@@ -294,7 +294,7 @@ void ScriptResource::load(Resource *resource) {
_soundIds[i] = stream.readUint32LE();
sceneInfosOffs = 0x8C;
}
-
+
stream.skip(4); // Skip unused
// Read item counts
@@ -313,17 +313,17 @@ void ScriptResource::load(Resource *resource) {
if (resource->_gameId == kGameIdDuckman)
objectMapOffs = stream.readUint32LE(); //TODO Is this needed for BBDOU?
uint32 codeTblOffs = stream.readUint32LE();
-
+
debug(2, "ScriptResource::load() propertiesCount: %d; blockCountersCount: %d; _codeCount: %d; _sceneInfosCount: %d; _objectMapCount: %d",
propertiesCount, blockCountersCount, _codeCount, _sceneInfosCount, _objectMapCount);
debug(2, "ScriptResource::load() propertiesOffs: %08X; blockCountersOffs: %08X; codeTblOffs: %08X; objectMapOffs: %08X",
propertiesOffs, blockCountersOffs, codeTblOffs, objectMapOffs);
// Init properties
_properties.init(propertiesCount, _data + propertiesOffs);
-
+
// Init blockcounters
_blockCounters.init(blockCountersCount, _data + blockCountersOffs);
-
+
_codeOffsets = new uint32[_codeCount];
stream.seek(codeTblOffs);
for (uint i = 0; i < _codeCount; ++i)
@@ -336,7 +336,7 @@ void ScriptResource::load(Resource *resource) {
stream.seek(sceneInfoOffs);
_sceneInfos[i].load(_data, stream);
}
-
+
if (_objectMapCount > 0) {
_objectMap = new uint32[_objectMapCount];
stream.seek(objectMapOffs);
@@ -345,7 +345,7 @@ void ScriptResource::load(Resource *resource) {
stream.skip(4);
}
}
-
+
if (resource->_gameId == kGameIdDuckman) {
stream.seek(0x6C);
_mainActorObjectId = stream.readUint32LE();
@@ -353,7 +353,7 @@ void ScriptResource::load(Resource *resource) {
stream.seek(0);
_mainActorObjectId = stream.readUint32LE();
}
-
+
if (resource->_gameId == kGameIdDuckman)
fixupSceneInfosDuckman();
diff --git a/engines/illusions/resourcesystem.cpp b/engines/illusions/resourcesystem.cpp
index 4f6644f49e..bf43db7204 100644
--- a/engines/illusions/resourcesystem.cpp
+++ b/engines/illusions/resourcesystem.cpp
@@ -89,14 +89,14 @@ void ResourceSystem::loadResource(uint32 resId, uint32 sceneId, uint32 threadId)
debug(1, "ResourceSystem::loadResource() kRlfLoadFile");
resource->loadData(_vm->_resReader);
}
-
+
resourceLoader->load(resource);
-
+
if (resourceLoader->isFlag(kRlfFreeDataAfterLoad)) {
debug(1, "ResourceSystem::loadResource() kRlfFreeDataAfterLoad");
resource->unloadData();
}
-
+
resource->_loaded = true;
_resources.push_back(resource);
@@ -105,7 +105,7 @@ void ResourceSystem::loadResource(uint32 resId, uint32 sceneId, uint32 threadId)
void ResourceSystem::unloadResourceById(uint32 resId) {
Resource *resource = getResource(resId);
- if (resource)
+ if (resource)
unloadResource(resource);
}
diff --git a/engines/illusions/resourcesystem.h b/engines/illusions/resourcesystem.h
index a54cda69e9..56e5f2dc22 100644
--- a/engines/illusions/resourcesystem.h
+++ b/engines/illusions/resourcesystem.h
@@ -91,14 +91,14 @@ public:
~ResourceSystem();
void addResourceLoader(uint32 resTypeId, BaseResourceLoader *resourceLoader);
-
+
// TODO Handle threadId in caller as well as pausing of timer
void loadResource(uint32 resId, uint32 sceneId, uint32 threadId);
void unloadResourceById(uint32 resId);
void unloadResourcesBySceneId(uint32 sceneId);
void unloadSceneResources(uint32 sceneId1, uint32 sceneId2);
Resource *getResource(uint32 resId);
-
+
protected:
typedef Common::HashMap<uint32, BaseResourceLoader*> ResourceLoadersMap;
typedef ResourceLoadersMap::iterator ResourceLoadersMapIterator;
@@ -143,7 +143,7 @@ protected:
};
void unloadResource(Resource *resource);
-
+
};
} // End of namespace Illusions
diff --git a/engines/illusions/saveload.cpp b/engines/illusions/saveload.cpp
index 50a728a065..cc63b18f90 100644
--- a/engines/illusions/saveload.cpp
+++ b/engines/illusions/saveload.cpp
@@ -92,7 +92,7 @@ bool IllusionsEngine::savegame(const char *filename, const char *description) {
out->writeUint32LE(saveTime);
out->writeUint32LE(playTime);
// Header end
-
+
_gameState->write(out);
out->finalize();
diff --git a/engines/illusions/screen.cpp b/engines/illusions/screen.cpp
index c234cde3ae..f935315535 100644
--- a/engines/illusions/screen.cpp
+++ b/engines/illusions/screen.cpp
@@ -75,7 +75,7 @@ SpriteDrawQueue::~SpriteDrawQueue() {
bool SpriteDrawQueue::draw(SpriteDrawQueueItem *item) {
// Check if the sprite has finished decompressing
- if (item->_kind != 0 && (*item->_drawFlags & 1)) {
+ if (item->_kind != 0 && (*item->_drawFlags & 1)) {
insert(item, item->_priority);
return false;
}
@@ -83,11 +83,11 @@ bool SpriteDrawQueue::draw(SpriteDrawQueueItem *item) {
if (!_screen->isDisplayOn()) {
if (item->_drawFlags)
*item->_drawFlags &= ~4;
- return true;
- }
+ return true;
+ }
Common::Rect srcRect, dstRect;
-
+
// Check if the sprite is on-screen
if (!calcItemRect(item, srcRect, dstRect))
return true;
@@ -172,12 +172,12 @@ bool SpriteDrawQueue::calcItemRect(SpriteDrawQueueItem *item, Common::Rect &srcR
srcRect.top = 0;
srcRect.right = item->_dimensions._width;
srcRect.bottom = item->_dimensions._height;
-
+
dstRect.left = item->_drawPosition.x - item->_scale * item->_controlPosition.x / 100;
dstRect.top = item->_drawPosition.y - item->_scale * item->_controlPosition.y / 100;
dstRect.right = item->_drawPosition.x + item->_scale * (item->_dimensions._width - item->_controlPosition.x) / 100;
dstRect.bottom = item->_drawPosition.y + item->_scale * (item->_dimensions._height - item->_controlPosition.y) / 100;
-
+
if (_screen->_isScreenOffsetActive) {
dstRect.left += _screen->_screenOffsetPt.x;
dstRect.right += _screen->_screenOffsetPt.x;
@@ -392,7 +392,7 @@ Screen::~Screen() {
Graphics::Surface *Screen::allocSurface(int16 width, int16 height) {
Graphics::Surface *surface = new Graphics::Surface();
surface->create(width, height, _vm->_system->getScreenFormat());
- return surface;
+ return surface;
}
Graphics::Surface *Screen::allocSurface(SurfInfo &surfInfo) {
@@ -457,7 +457,7 @@ void Screen8Bit::decompressSprite(SpriteDecompressQueueItem *item) {
int processedSize = 0;
int xincr, x, xstart;
int yincr, y;
-
+
*item->_drawFlags &= ~1;
// Safeguard
@@ -468,7 +468,7 @@ void Screen8Bit::decompressSprite(SpriteDecompressQueueItem *item) {
item->_surface->w, item->_surface->h);
return;
}
-
+
if (item->_flags & 1) {
x = xstart = item->_dimensions._width - 1;
xincr = -1;
@@ -577,7 +577,7 @@ void Screen8Bit::drawSurfaceUnscaled(int16 destX, int16 destY, Graphics::Surface
else
*dst = pixel;
}
- ++dst;
+ ++dst;
}
}
}
@@ -599,7 +599,7 @@ void Screen8Bit::drawSurfaceScaled(Common::Rect &dstRect, Graphics::Surface *sur
skipX = (dstWidth < srcWidth) ? 0 : dstWidth / (2*srcWidth) + 1;
w -= skipX;
byte *src = (byte*)surface->getBasePtr(srcRect.left, srcY);
- byte *dstRow = dst;
+ byte *dstRow = dst;
while (w-- > 0) {
const byte pixel = *src;
if (pixel != 0) {
@@ -646,7 +646,7 @@ void Screen16Bit::decompressSprite(SpriteDecompressQueueItem *item) {
int processedSize = 0;
int xincr, x, xstart;
int yincr, y;
-
+
*item->_drawFlags &= ~1;
// Safeguard
@@ -657,7 +657,7 @@ void Screen16Bit::decompressSprite(SpriteDecompressQueueItem *item) {
item->_surface->w, item->_surface->h);
return;
}
-
+
if (item->_flags & 1) {
x = xstart = item->_dimensions._width - 1;
xincr = -1;
@@ -673,9 +673,9 @@ void Screen16Bit::decompressSprite(SpriteDecompressQueueItem *item) {
y = 0;
yincr = 1;
}
-
+
byte *dst = (byte*)dstSurface->getBasePtr(x, y);
-
+
while (processedSize < dstSize) {
int16 op = READ_LE_UINT16(src);
src += 2;
@@ -858,7 +858,7 @@ void Screen16Bit::drawSurface21(Common::Rect &dstRect, Graphics::Surface *surfac
skipX = (dstWidth < srcWidth) ? 0 : dstWidth / (2*srcWidth) + 1;
w -= skipX;
byte *src = (byte*)surface->getBasePtr(srcRect.left, srcY);
- byte *dstRow = dst;
+ byte *dstRow = dst;
while (w-- > 0) {
uint16 pixel = READ_LE_UINT16(src);
if (pixel != _colorKey1)
diff --git a/engines/illusions/screen.h b/engines/illusions/screen.h
index 1da1d5bcaa..4a89c790a4 100644
--- a/engines/illusions/screen.h
+++ b/engines/illusions/screen.h
@@ -92,7 +92,7 @@ protected:
}
};
Screen *_screen;
- SpriteDrawQueueList _queue;
+ SpriteDrawQueueList _queue;
void insert(SpriteDrawQueueItem *item, uint32 priority);
bool calcItemRect(SpriteDrawQueueItem *item, Common::Rect &srcRect, Common::Rect &dstRect);
};
diff --git a/engines/illusions/screentext.cpp b/engines/illusions/screentext.cpp
index de664d635a..0f811df08d 100644
--- a/engines/illusions/screentext.cpp
+++ b/engines/illusions/screentext.cpp
@@ -101,13 +101,13 @@ bool ScreenText::refreshScreenText(FontResource *font, WidthHeight dimensions, C
bool ScreenText::insertText(uint16 *text, uint32 fontId, WidthHeight dimensions, Common::Point offsPt, uint flags,
uint16 backgroundColor, uint16 borderColor, byte colorR, byte colorG, byte colorB, uint16 *&outTextPtr) {
-
+
if (!_screenTexts.empty()) {
ScreenTextEntry *screenText = _screenTexts.back();
screenText->_info._position = _position;
freeTextSurface();
}
-
+
ScreenTextEntry *screenText = new ScreenTextEntry();
screenText->_info._fontId = fontId;
screenText->_info._dimensions = dimensions;
@@ -169,13 +169,13 @@ void ScreenText::removeText() {
}
void ScreenText::clearText() {
-
+
if (!_screenTexts.empty()) {
ScreenTextEntry *screenText = _screenTexts.back();
screenText->_info._position = _position;
freeTextSurface();
}
-
+
ScreenTextEntry *screenText = new ScreenTextEntry();
screenText->_info._fontId = 0;
_screenTexts.push_back(screenText);
diff --git a/engines/illusions/scriptopcodes.h b/engines/illusions/scriptopcodes.h
index 8ba2586946..9314a60e00 100644
--- a/engines/illusions/scriptopcodes.h
+++ b/engines/illusions/scriptopcodes.h
@@ -60,7 +60,7 @@ protected:
};
// Convenience macros
-#define ARG_SKIP(x) opCall.skip(x);
+#define ARG_SKIP(x) opCall.skip(x);
#define ARG_BYTE(name) byte name = opCall.readByte(); debug(5, "ARG_BYTE(" #name " = %d)", name);
#define ARG_INT16(name) int16 name = opCall.readSint16(); debug(5, "ARG_INT16(" #name " = %d)", name);
#define ARG_UINT32(name) uint32 name = opCall.readUint32(); debug(5, "ARG_UINT32(" #name " = %08X)", name);
diff --git a/engines/illusions/sequenceopcodes.h b/engines/illusions/sequenceopcodes.h
index 6c5b3ca41d..5fe528141d 100644
--- a/engines/illusions/sequenceopcodes.h
+++ b/engines/illusions/sequenceopcodes.h
@@ -51,7 +51,7 @@ protected:
void opEndSequence(Control *control, OpCall &opCall);
void opIncFrameDelay(Control *control, OpCall &opCall);
void opSetRandomFrameDelay(Control *control, OpCall &opCall);
- void opSetFrameSpeed(Control *control, OpCall &opCall);
+ void opSetFrameSpeed(Control *control, OpCall &opCall);
void opJump(Control *control, OpCall &opCall);
void opJumpRandom(Control *control, OpCall &opCall);
void opGotoSequence(Control *control, OpCall &opCall);
diff --git a/engines/illusions/textdrawer.cpp b/engines/illusions/textdrawer.cpp
index a5679b0440..31839e04fb 100644
--- a/engines/illusions/textdrawer.cpp
+++ b/engines/illusions/textdrawer.cpp
@@ -127,7 +127,7 @@ bool TextDrawer::wrapTextIntern(int16 x, int16 y, int16 maxWidth, int16 maxHeigh
currWordWidth = 0;
}
}
-
+
while (lineBreak) {
currLineWidth -= _font->_widthC;
@@ -143,7 +143,7 @@ bool TextDrawer::wrapTextIntern(int16 x, int16 y, int16 maxWidth, int16 maxHeigh
} else {
textPosX = x;
}
-
+
_textLines.push_back(TextLine(lineStartText, currLineLen, textPosX, textPosY));
if (*currText == 13) {
@@ -187,7 +187,7 @@ bool TextDrawer::wrapTextIntern(int16 x, int16 y, int16 maxWidth, int16 maxHeigh
}
}
-
+
_dimensions->_width = maxLineWidth;
_dimensions->_height = textPosY - _font->_lineIncr;
diff --git a/engines/illusions/textdrawer.h b/engines/illusions/textdrawer.h
index 68b28e0713..bbecd98d6a 100644
--- a/engines/illusions/textdrawer.h
+++ b/engines/illusions/textdrawer.h
@@ -54,9 +54,9 @@ protected:
Common::Point _offsPt;
uint _textFlags;
Graphics::Surface *_surface;
-
+
Common::Array<TextLine> _textLines;
-
+
bool textHasChar(uint16 c);
int16 getSpaceWidth();
int16 getCharWidth(uint16 c);
diff --git a/engines/illusions/thread.cpp b/engines/illusions/thread.cpp
index d984af2c67..3c327bab21 100644
--- a/engines/illusions/thread.cpp
+++ b/engines/illusions/thread.cpp
@@ -307,11 +307,11 @@ void ThreadList::killThread(uint32 threadId) {
if (!threadId)
return;
-
+
Thread *thread = findThread(threadId);
if (!thread)
return;
-
+
for (Iterator it = _threads.begin(); it != _threads.end(); ++it) {
Thread *childThread = *it;
if (childThread->_callingThreadId == threadId)
diff --git a/engines/illusions/threads/abortablethread.cpp b/engines/illusions/threads/abortablethread.cpp
index d2fc8076ff..84cd84090e 100644
--- a/engines/illusions/threads/abortablethread.cpp
+++ b/engines/illusions/threads/abortablethread.cpp
@@ -31,7 +31,7 @@ namespace Illusions {
AbortableThread::AbortableThread(IllusionsEngine *vm, uint32 threadId, uint32 callingThreadId, uint notifyFlags,
uint32 scriptThreadId, byte *scriptCodeIp)
- : Thread(vm, threadId, callingThreadId, notifyFlags), _scriptThreadId(scriptThreadId),
+ : Thread(vm, threadId, callingThreadId, notifyFlags), _scriptThreadId(scriptThreadId),
_scriptCodeIp(scriptCodeIp), _status(1) {
_type = kTTAbortableThread;
_sceneId = _vm->getCurrentScene();
diff --git a/engines/illusions/threads/talkthread.cpp b/engines/illusions/threads/talkthread.cpp
index 9e94ef64cc..d20f94a164 100644
--- a/engines/illusions/threads/talkthread.cpp
+++ b/engines/illusions/threads/talkthread.cpp
@@ -57,9 +57,9 @@ TalkThread::TalkThread(IllusionsEngine *vm, uint32 threadId, uint32 callingThrea
_status = 2;
else
_status = 3;
-
+
_flags = 0x0E;
-
+
_durationMult = _vm->clipTextDuration(_vm->getSubtitleDuration());
_textDuration = _durationMult;
_defDurationMult = _vm->clipTextDuration(240);
@@ -135,7 +135,7 @@ int TalkThread::onUpdate() {
return kTSYield;
_status = 5;
// Fallthrough to status 5
-
+
case 5:
if (!(_flags & 8))
refreshText();
@@ -239,7 +239,7 @@ if (true) {
return kTSTerminate;
}
-
+
return kTSTerminate;
}
diff --git a/engines/illusions/threads/talkthread_duckman.cpp b/engines/illusions/threads/talkthread_duckman.cpp
index fdfcc0ac4f..a2e9ebaec6 100644
--- a/engines/illusions/threads/talkthread_duckman.cpp
+++ b/engines/illusions/threads/talkthread_duckman.cpp
@@ -55,11 +55,11 @@ TalkThread_Duckman::TalkThread_Duckman(IllusionsEngine_Duckman *vm, uint32 threa
_status = 1;
else
_status = 2;
-
+
_durationMult = _vm->clipTextDuration(_vm->_subtitleDuration);
_textDuration = _durationMult;
_defDurationMult = _vm->clipTextDuration(240);
-
+
_sceneId = _vm->getCurrentScene();
}
@@ -101,14 +101,14 @@ int TalkThread_Duckman::onUpdate() {
if (_objectId == 0 || _durationMult == 0)
_flags |= 8;
_status = 3;
- // Fallthrough to status 3
+ // Fallthrough to status 3
case 3:
if (!(_flags & 4) && !_vm->_soundMan->isVoiceCued())
return kTSYield;
_status = 4;
// Fallthrough to status 4
-
+
case 4:
if (!(_flags & 8) ) {
uint32 actorTypeId = _vm->getObjectActorTypeId(_objectId);
@@ -196,7 +196,7 @@ int TalkThread_Duckman::onUpdate() {
_flags |= 2;
}
return kTSTerminate;
-
+
}
return kTSTerminate;