aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorEugene Sandulenko2005-07-30 21:11:48 +0000
committerEugene Sandulenko2005-07-30 21:11:48 +0000
commit6b4484472b79dc7ea7d1ce545a28fba7d3b7696f (patch)
treec44c4e61f18ddd537f7082cb48869cf33d422fbd /scumm
parent86ab70b149e5cd00cf54f2e41896e2c4e16795e4 (diff)
downloadscummvm-rg350-6b4484472b79dc7ea7d1ce545a28fba7d3b7696f.tar.gz
scummvm-rg350-6b4484472b79dc7ea7d1ce545a28fba7d3b7696f.tar.bz2
scummvm-rg350-6b4484472b79dc7ea7d1ce545a28fba7d3b7696f.zip
Remove trailing whitespaces.
svn-id: r18604
Diffstat (limited to 'scumm')
-rw-r--r--scumm/actor.cpp86
-rw-r--r--scumm/actor.h32
-rw-r--r--scumm/akos.cpp22
-rw-r--r--scumm/akos.h6
-rw-r--r--scumm/base-costume.cpp2
-rw-r--r--scumm/base-costume.h8
-rw-r--r--scumm/bomp.cpp14
-rw-r--r--scumm/boxes.cpp58
-rw-r--r--scumm/boxes.h2
-rw-r--r--scumm/charset.cpp38
-rw-r--r--scumm/charset.h22
-rw-r--r--scumm/costume.cpp20
-rw-r--r--scumm/costume.h2
-rw-r--r--scumm/cursor.cpp16
-rw-r--r--scumm/debugger.cpp6
-rw-r--r--scumm/debugger.h4
-rw-r--r--scumm/dialogs.cpp52
-rw-r--r--scumm/dialogs.h8
-rw-r--r--scumm/gfx.cpp122
-rw-r--r--scumm/gfx.h18
-rw-r--r--scumm/help.cpp4
-rw-r--r--scumm/imuse.cpp16
-rw-r--r--scumm/imuse_digi/dimuse_bndmgr.cpp2
-rw-r--r--scumm/imuse_digi/dimuse_bndmgr.h4
-rw-r--r--scumm/imuse_digi/dimuse_codecs.cpp32
-rw-r--r--scumm/imuse_digi/dimuse_music.cpp2
-rw-r--r--scumm/imuse_digi/dimuse_sndmgr.cpp6
-rw-r--r--scumm/imuse_digi/dimuse_sndmgr.h2
-rw-r--r--scumm/imuse_internal.h2
-rw-r--r--scumm/input.cpp18
-rw-r--r--scumm/insane/insane.cpp134
-rw-r--r--scumm/insane/insane.h32
-rw-r--r--scumm/insane/insane_ben.cpp52
-rw-r--r--scumm/insane/insane_enemy.cpp48
-rw-r--r--scumm/insane/insane_iact.cpp36
-rw-r--r--scumm/insane/insane_scenes.cpp100
-rw-r--r--scumm/instrument.cpp4
-rw-r--r--scumm/intern.h50
-rw-r--r--scumm/logic_he.cpp42
-rw-r--r--scumm/nut_renderer.cpp6
-rw-r--r--scumm/object.cpp26
-rw-r--r--scumm/palette.cpp22
-rw-r--r--scumm/palette_he.cpp2
-rw-r--r--scumm/player_mod.h2
-rw-r--r--scumm/player_nes.cpp16
-rw-r--r--scumm/player_v1.cpp34
-rw-r--r--scumm/player_v2.cpp66
-rw-r--r--scumm/player_v2.h6
-rw-r--r--scumm/player_v2a.cpp4
-rw-r--r--scumm/player_v3a.cpp2
-rw-r--r--scumm/resource.cpp36
-rw-r--r--scumm/resource.h2
-rw-r--r--scumm/resource_v2.cpp2
-rw-r--r--scumm/resource_v7he.cpp42
-rw-r--r--scumm/resource_v7he.h8
-rw-r--r--scumm/room.cpp12
-rw-r--r--scumm/saveload.cpp20
-rw-r--r--scumm/saveload.h8
-rw-r--r--scumm/script.cpp36
-rw-r--r--scumm/script_c64.cpp4
-rw-r--r--scumm/script_v100he.cpp24
-rw-r--r--scumm/script_v2.cpp30
-rw-r--r--scumm/script_v5.cpp52
-rw-r--r--scumm/script_v6.cpp46
-rw-r--r--scumm/script_v6he.cpp20
-rw-r--r--scumm/script_v72he.cpp36
-rw-r--r--scumm/script_v7he.cpp8
-rw-r--r--scumm/script_v8.cpp14
-rw-r--r--scumm/script_v80he.cpp8
-rw-r--r--scumm/script_v90he.cpp42
-rw-r--r--scumm/scumm.cpp104
-rw-r--r--scumm/scumm.h58
-rw-r--r--scumm/smush/channel.h4
-rw-r--r--scumm/smush/chunk.cpp14
-rw-r--r--scumm/smush/codec37.cpp2
-rw-r--r--scumm/smush/codec47.cpp4
-rw-r--r--scumm/smush/imuse_channel.cpp26
-rw-r--r--scumm/smush/saud_channel.cpp8
-rw-r--r--scumm/smush/smush_font.cpp10
-rw-r--r--scumm/smush/smush_font.h2
-rw-r--r--scumm/smush/smush_mixer.cpp4
-rw-r--r--scumm/smush/smush_player.cpp44
-rw-r--r--scumm/smush/smush_player.h4
-rw-r--r--scumm/sound.cpp160
-rw-r--r--scumm/sound.h2
-rw-r--r--scumm/sprite_he.cpp24
-rw-r--r--scumm/sprite_he.h4
-rw-r--r--scumm/string.cpp44
-rw-r--r--scumm/thumbnail.cpp14
-rw-r--r--scumm/usage_bits.cpp2
-rw-r--r--scumm/util.cpp28
-rw-r--r--scumm/util.h10
-rw-r--r--scumm/vars.cpp16
-rw-r--r--scumm/verbs.cpp14
-rw-r--r--scumm/wiz_he.cpp60
-rw-r--r--scumm/wiz_he.h10
96 files changed, 1216 insertions, 1216 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp
index 559e28571f..a4d72cd54e 100644
--- a/scumm/actor.cpp
+++ b/scumm/actor.cpp
@@ -75,7 +75,7 @@ void Actor::initActor(int mode) {
_walkdata.point3.x = 32000;
_walkScript = 0;
memset(_heTalkQueue, 0, sizeof(_heTalkQueue));
-
+
mode = 1;
}
@@ -250,7 +250,7 @@ int Actor::remapDirection(int dir, bool is_walking) {
// The Dig also checks if the actor is in the current room, but that's
// not necessary here because we never call the function unless the
// actor is in the current room anyway.
-
+
if (!_ignoreBoxes || (_vm->_gameId == GID_LOOM || _vm->_gameId == GID_LOOM256)) {
specdir = _vm->_extraBoxFlags[_walkbox];
if (specdir) {
@@ -337,7 +337,7 @@ int Actor::updateActorDirection(bool is_walking) {
if (_vm->_version >= 7)
// Direction interpolation interfers with walk scripts in Dig; they perform
// (much better) interpolation themselves.
- shouldInterpolate = false;
+ shouldInterpolate = false;
else
shouldInterpolate = (dir & 1024) ? true : false;
dir &= 1023;
@@ -686,7 +686,7 @@ AdjustBoxResult Actor::adjustXYToBeInBox(int dstX, int dstY) {
// Skip over invisible boxes
if (flags & kBoxInvisible && !(flags & kBoxPlayerOnly && !isPlayer()))
continue;
-
+
// For increased performance, we perform a quick test if
// the coordinates can even be within a distance of 'threshold'
// pixels of the box.
@@ -709,7 +709,7 @@ AdjustBoxResult Actor::adjustXYToBeInBox(int dstX, int dstY) {
if (tmpDist < bestDist) {
abr.x = tmpX;
abr.y = tmpY;
-
+
if (tmpDist == 0) {
abr.box = box;
return abr;
@@ -756,7 +756,7 @@ void Actor::adjustActorPos() {
void Actor::faceToObject(int obj) {
int x2, y2, dir;
-
+
if (!isInCurrentRoom())
return;
@@ -909,7 +909,7 @@ void ScummEngine::playActorSounds() {
Actor *ScummEngine::derefActor(int id, const char *errmsg) const {
if (id == 0)
- debugC(DEBUG_ACTORS, "derefActor(0, \"%s\") in script %d, opcode 0x%x",
+ debugC(DEBUG_ACTORS, "derefActor(0, \"%s\") in script %d, opcode 0x%x",
errmsg, vm.slot[_curExecScript].number, _opcode);
if (id < 0 || id >= _numActors || _actors[id]._number != id) {
@@ -923,7 +923,7 @@ Actor *ScummEngine::derefActor(int id, const char *errmsg) const {
Actor *ScummEngine::derefActorSafe(int id, const char *errmsg) const {
if (id == 0)
- debugC(DEBUG_ACTORS, "derefActorSafe(0, \"%s\") in script %d, opcode 0x%x",
+ debugC(DEBUG_ACTORS, "derefActorSafe(0, \"%s\") in script %d, opcode 0x%x",
errmsg, vm.slot[_curExecScript].number, _opcode);
if (id < 0 || id >= _numActors || _actors[id]._number != id) {
@@ -1006,7 +1006,7 @@ void ScummEngine::processActors() {
a->animateCostume();
}
}
-
+
if (_features & GF_NEW_COSTUMES)
akos_processQueue();
}
@@ -1063,7 +1063,7 @@ void Actor::drawActorCostume(bool hitTestMode) {
if (!hitTestMode) {
if (!_needRedraw)
return;
-
+
_needRedraw = false;
}
@@ -1142,7 +1142,7 @@ void Actor::drawActorCostume(bool hitTestMode) {
bcr->_skipLimbs = (_heSkipLimbs != 0);
bcr->_paletteNum = _hePaletteNum;
-
+
if (_vm->_heversion >= 80 && _heNoTalkAnimation == 0) {
_heCondMask &= 0xFFFFFC00;
_heCondMask |= 1;
@@ -1151,7 +1151,7 @@ void Actor::drawActorCostume(bool hitTestMode) {
// Otherwise just do rand animation
int rnd = _vm->_rnd.getRandomNumberRng(1, 10);
setTalkCondition(rnd);
- }
+ }
}
_heNoTalkAnimation = 0;
@@ -1180,7 +1180,7 @@ bool Actor::actorHitTest(int x, int y) {
drawActorCostume(true);
ar->_actorHitMode = false;
-
+
return ar->_actorHitResult;
}
#endif
@@ -1192,7 +1192,7 @@ void Actor::animateCostume() {
_animProgress++;
if (_animProgress >= _animSpeed) {
_animProgress = 0;
-
+
_vm->_costumeLoader->loadCostume(_costume);
if (_vm->_costumeLoader->increaseAnims(this)) {
_needRedraw = true;
@@ -1202,9 +1202,9 @@ void Actor::animateCostume() {
#ifndef DISABLE_SCUMM_7_8
void Actor::animateLimb(int limb, int f) {
- // This methods is very similiar to animateCostume().
+ // This methods is very similiar to animateCostume().
// However, instead of animating *all* the limbs, it only animates
- // the specified limb to be at the frame specified by "f".
+ // the specified limb to be at the frame specified by "f".
if (!f)
return;
@@ -1223,9 +1223,9 @@ void Actor::animateLimb(int limb, int f) {
aksq = _vm->findResourceData(MKID('AKSQ'), akos);
akfo = _vm->findResourceData(MKID('AKFO'), akos);
-
+
size = _vm->getResourceDataSize(akfo) / 2;
-
+
while (f--) {
if (_cost.active[limb] != 0)
_vm->akos_increaseAnim(this, limb, aksq, (const uint16 *)akfo, size);
@@ -1334,7 +1334,7 @@ void ScummEngine_v7::actorTalk(const byte *msg) {
Actor *a;
convertMessageToString(msg, _charsetBuffer, sizeof(_charsetBuffer));
-
+
// Play associated speech, if any
playSpeech((byte *)_lastStringTag);
@@ -1375,8 +1375,8 @@ void ScummEngine::actorTalk(const byte *msg) {
Actor *a;
convertMessageToString(msg, _charsetBuffer, sizeof(_charsetBuffer));
-
- // FIXME: Workaround for bugs #770039 and #770049
+
+ // FIXME: Workaround for bugs #770039 and #770049
if (_gameId == GID_LOOM || _gameId == GID_LOOM256) {
if (!*_charsetBuffer)
return;
@@ -1389,13 +1389,13 @@ void ScummEngine::actorTalk(const byte *msg) {
setTalkingActor(0xFF);
} else {
int oldact;
-
+
// FIXME: Workaround for bug #770724
if (_gameId == GID_LOOM && _roomResource == 23 &&
vm.slot[_currentScript].number == 232 && _actorToPrintStrFor == 0) {
_actorToPrintStrFor = 2; // Could be anything from 2 to 5. Maybe compare to original?
}
-
+
a = derefActor(_actorToPrintStrFor, "actorTalk");
if (!a->isInCurrentRoom() && (_version <= 6)) {
oldact = 0xFF;
@@ -1436,7 +1436,7 @@ void ScummEngine::actorTalk(const byte *msg) {
}
void Actor::runActorTalkScript(int f) {
- if (_vm->_version == 8 && _vm->VAR(_vm->VAR_HAVE_MSG) == 2)
+ if (_vm->_version == 8 && _vm->VAR(_vm->VAR_HAVE_MSG) == 2)
return;
if (_talkScript) {
@@ -1496,15 +1496,15 @@ void Actor::setActorCostume(int c) {
c &= 0xff;
_costumeNeedsInit = true;
-
+
if (_vm->_features & GF_NEW_COSTUMES) {
memset(_animVariable, 0, sizeof(_animVariable));
-
+
#ifndef DISABLE_HE
if (_vm->_heversion >= 71)
((ScummEngine_v71he *)_vm)->queueAuxBlock(this);
#endif
-
+
_costume = c;
_cost.reset();
_auxBlock.reset();
@@ -1698,7 +1698,7 @@ void Actor::walkActor() {
}
_walkdata.curbox = next_box;
-
+
if (findPathTowards(_walkbox, next_box, _walkdata.destbox, foundPath))
break;
@@ -1725,10 +1725,10 @@ void Actor::walkActorV12() {
_moving = 0;
return;
}
-
+
if (!_moving)
return;
-
+
if (_moving & MF_IN_LEG) {
actorWalkStep();
} else {
@@ -1746,7 +1746,7 @@ void Actor::walkActorV12() {
_moving |= MF_LAST_LEG;
return;
}
-
+
// Can't walk through locked boxes
int flags = _vm->getBoxFlags(next_box);
if (flags & kBoxLocked && !(flags & kBoxPlayerOnly && !isPlayer())) {
@@ -1770,7 +1770,7 @@ void Actor::walkActorOld() {
if (!_moving)
return;
-
+
if (!(_moving & MF_NEW_LEG)) {
if (_moving & MF_IN_LEG && actorWalkStep())
return;
@@ -1815,7 +1815,7 @@ void Actor::walkActorOld() {
next_box = _vm->getPathToDestBox(_walkbox, _walkdata.destbox);
- // WORKAROUND: To fully fix bug #774783, we add a special case
+ // WORKAROUND: To fully fix bug #774783, we add a special case
// here, resulting in a different next_box value for Hitler.
if ((_vm->_gameId == GID_INDY3) && _vm->_roomResource == 46 && _walkbox == 1 && _walkdata.destbox == 0 && _number == 9)
next_box = 1;
@@ -1824,7 +1824,7 @@ void Actor::walkActorOld() {
_moving |= MF_LAST_LEG;
return;
}
-
+
// Can't walk through locked boxes
int flags = _vm->getBoxFlags(next_box);
if (flags & kBoxLocked && !(flags & kBoxPlayerOnly && !isPlayer())) {
@@ -1847,7 +1847,7 @@ void Actor::walkActorOld() {
if (p2.x == 32000 && p3.x == 32000) {
break;
}
-
+
if (p2.x != 32000) {
if (calcMovementFactor(p2)) {
_walkdata.point3 = p3;
@@ -2014,10 +2014,10 @@ void Actor::setTalkCondition(int slot) {
} else {
_heCondMask |= 1;
}
- }
+ }
}
-bool Actor::isTalkConditionSet(int slot) const {
+bool Actor::isTalkConditionSet(int slot) const {
assert(slot >= 1 && slot <= 0x10);
return (_heCondMask & (1 << (slot - 1))) != 0;
}
@@ -2085,7 +2085,7 @@ void ScummEngine_v71he::postProcessAuxQueue() {
int x1 = (int16)READ_LE_UINT16(axur + 0) + dx;
int y1 = (int16)READ_LE_UINT16(axur + 2) + dy;
int x2 = (int16)READ_LE_UINT16(axur + 4) + dx;
- int y2 = (int16)READ_LE_UINT16(axur + 6) + dy;
+ int y2 = (int16)READ_LE_UINT16(axur + 6) + dy;
markRectAsDirty(kMainVirtScreen, x1, x2, y1, y2 + 1);
axur += 8;
}
@@ -2173,7 +2173,7 @@ const SaveLoadEntry *Actor::getSaveLoadEntries() {
// Actor palette grew from 64 to 256 bytes
MKARRAY_OLD(Actor, _palette[0], sleByte, 64, VER(8), VER(9)),
MKARRAY(Actor, _palette[0], sleByte, 256, VER(10)),
-
+
MK_OBSOLETE(Actor, _mask, sleByte, VER(8), VER(9)),
MKLINE(Actor, _shadowMode, sleByte, VER(8)),
MKLINE(Actor, _visible, sleByte, VER(8)),
@@ -2189,9 +2189,9 @@ const SaveLoadEntry *Actor::getSaveLoadEntries() {
MKLINE(Actor, _talkPosY, sleInt16, VER(8)),
MKLINE(Actor, _talkPosX, sleInt16, VER(8)),
MKLINE(Actor, _ignoreTurns, sleByte, VER(8)),
-
+
MKLINE(Actor, _layer, sleByte, VER(8)),
-
+
MKLINE(Actor, _talkScript, sleUint16, VER(8)),
MKLINE(Actor, _walkScript, sleUint16, VER(8)),
@@ -2211,7 +2211,7 @@ const SaveLoadEntry *Actor::getSaveLoadEntries() {
MKLINE(Actor, _walkdata.point3.x, sleUint16, VER(42)),
MKLINE(Actor, _walkdata.point3.y, sleUint16, VER(42)),
-
+
MKARRAY(Actor, _cost.active[0], sleByte, 16, VER(8)),
MKLINE(Actor, _cost.stopped, sleUint16, VER(8)),
MKARRAY(Actor, _cost.curpos[0], sleUint16, 16, VER(8)),
@@ -2220,7 +2220,7 @@ const SaveLoadEntry *Actor::getSaveLoadEntries() {
MKARRAY(Actor, _cost.frame[0], sleUint16, 16, VER(8)),
MKEND()
};
-
+
return actorEntries;
}
diff --git a/scumm/actor.h b/scumm/actor.h
index 6e45845bed..a858ec4e61 100644
--- a/scumm/actor.h
+++ b/scumm/actor.h
@@ -87,13 +87,13 @@ class Actor {
public:
static byte kInvalidBox;
-
+
static void initActorClass(ScummEngine *scumm);
public:
/** The position of the actor inside the virtual screen. */
Common::Point _pos;
-
+
/** HE specific: This rect is used to clip actor drawing. */
Common::Rect _clipOverride;
@@ -165,7 +165,7 @@ protected:
public:
Actor();
-
+
//protected:
void hideActor();
void showActor();
@@ -195,11 +195,11 @@ public:
void drawActorCostume(bool hitTestMode = false);
void animateCostume();
void setActorCostume(int c);
-
+
void animateLimb(int limb, int f);
-
+
bool actorHitTest(int x, int y);
-
+
byte *getActorName();
void startWalkActor(int x, int y, int dir);
void stopActorMoving();
@@ -217,20 +217,20 @@ public:
bool isInCurrentRoom() const {
return _room == _vm->_currentRoom;
}
-
+
int getActorXYPos(int &x, int &y) const;
int getRoom() const {
return _room;
}
-
+
int getFacing() const {
return _facing;
}
int getAnimVar(byte var) const;
void setAnimVar(byte var, int value);
-
+
void setAnimSpeed(byte newAnimSpeed) {
_animSpeed = newAnimSpeed;
_animProgress = 0;
@@ -247,19 +247,19 @@ public:
int getElevation() const {
return _elevation;
}
-
+
void setElevation(int newElevation) {
if (_elevation != newElevation) {
_elevation = newElevation;
_needRedraw = true;
}
}
-
+
void setPalette(int idx, int val) {
_palette[idx] = val;
_needRedraw = true;
}
-
+
void setScale(int sx, int sy) {
if (sx != -1)
_scalex = sx;
@@ -269,19 +269,19 @@ public:
}
void classChanged(int cls, bool value);
-
+
void setUserCondition(int slot, int set);
bool isUserConditionSet(int slot) const;
void setTalkCondition(int slot);
bool isTalkConditionSet(int slot) const;
-
+
// Used by the save/load syste:
static const SaveLoadEntry *getSaveLoadEntries();
-
+
protected:
bool isInClass(int cls);
-
+
bool isPlayer();
bool findPathTowards(byte box, byte box2, byte box3, Common::Point &foundPath);
diff --git a/scumm/akos.cpp b/scumm/akos.cpp
index 8ca603fc85..6c7cf10d8c 100644
--- a/scumm/akos.cpp
+++ b/scumm/akos.cpp
@@ -250,7 +250,7 @@ void AkosCostumeLoader::costumeDecodeData(Actor *a, int frame, uint usemask) {
}
if (!found) {
error("Sequence not found in actor 0x%X costume %d", a, a->_costume);
- }
+ }
}
}
@@ -276,7 +276,7 @@ void AkosCostumeLoader::costumeDecodeData(Actor *a, int frame, uint usemask) {
error("Sequence not found in actor 0x%X costume %d", a, a->_costume);
}
}
- }
+ }
break;
}
} else {
@@ -312,7 +312,7 @@ void AkosRenderer::setPalette(byte *new_palette) {
if (_vm->_heversion == 70) {
for (i = 0; i < size; i++)
palette[i] = _vm->_HEV7ActorPalette[palette[i]];
- }
+ }
if (size == 256) {
byte color = new_palette[0];
@@ -548,7 +548,7 @@ void AkosRenderer::codec1_genericDecode(Codec1 &v1) {
if (color && !masked && !skip_column) {
pcolor = palette[color];
if (_shadow_mode == 1) {
- if (pcolor == 13)
+ if (pcolor == 13)
pcolor = _shadow_table[*dst];
} else if (_shadow_mode == 2) {
warning("codec1_spec2"); // TODO
@@ -919,7 +919,7 @@ byte AkosRenderer::codec1(int xmoveCur, int ymoveCur) {
v1.destptr = (byte *)_out.pixels + v1.y * _out.pitch + v1.x;
codec1_genericDecode(v1);
-
+
return drawFlag;
}
@@ -983,7 +983,7 @@ byte AkosRenderer::codec5(int xmoveCur, int ymoveCur) {
_vm->drawBomp(bdd, !_mirror);
_vm->_bompActorPalettePtr = NULL;
-
+
return 0;
}
@@ -1020,7 +1020,7 @@ void AkosRenderer::akos16DecodeLine(byte *buf, int32 numbytes, int32 dir) {
*buf = akos16.color;
buf += dir;
}
-
+
if (akos16.unk5 == 0) {
AKOS16_FILL_BITS()
bits = akos16.bits & 3;
@@ -1075,7 +1075,7 @@ void AkosRenderer::akos16Decompress(byte *dest, int32 pitch, const byte *src, in
}
maskpitch = _numStrips;
-
+
maskptr = _vm->getMaskBuffer(maskLeft, maskTop, zBuf);
assert(t_height > 0);
@@ -1104,7 +1104,7 @@ byte AkosRenderer::codec16(int xmoveCur, int ymoveCur) {
warning("codec16: _actorHitMode not yet implemented");
return 0;
}
-
+
if (!_mirror) {
clip.left = (_actorX - xmoveCur - _width) + 1;
} else {
@@ -1249,7 +1249,7 @@ byte AkosRenderer::codec32(int xmoveCur, int ymoveCur) {
if (diff > 0) {
src.bottom -= diff;
dst.bottom -= diff;
- }
+ }
if (dst.isValidRect() == false)
return 0;
@@ -1352,7 +1352,7 @@ bool ScummEngine::akos_increaseAnim(Actor *a, int chan, const byte *aksq, const
curpos += 3;
break;
case AKC_SoundStuff:
- if (_heversion >= 61)
+ if (_heversion >= 61)
curpos += 6;
else
curpos += 8;
diff --git a/scumm/akos.h b/scumm/akos.h
index b616839940..2389463cc9 100644
--- a/scumm/akos.h
+++ b/scumm/akos.h
@@ -1,6 +1,6 @@
/* ScummVM - Scumm Interpreter
* Copyright (C) 2001 Ludvig Strigeus
- * Copyright (C) 2001-2005 The ScummVM project
+ * Copyright (C) 2001-2005 The ScummVM project
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -41,7 +41,7 @@ public:
void loadCostume(int id);
byte increaseAnims(Actor *a);
void costumeDecodeData(Actor *a, int frame, uint usemask);
-
+
//void animateLimb(int limb, int f);
bool hasManyDirections(int id) {
loadCostume(id);
@@ -113,7 +113,7 @@ protected:
void akos16SkipData(int32 numskip);
void akos16DecodeLine(byte *buf, int32 numbytes, int32 dir);
void akos16Decompress(byte *dest, int32 pitch, const byte *src, int32 t_width, int32 t_height, int32 dir, int32 numskip_before, int32 numskip_after, byte transparency, int maskLeft, int maskTop, int zBuf);
-
+
void markRectAsDirty(Common::Rect rect);
};
diff --git a/scumm/base-costume.cpp b/scumm/base-costume.cpp
index 7dde9af10a..b8861b35de 100644
--- a/scumm/base-costume.cpp
+++ b/scumm/base-costume.cpp
@@ -35,7 +35,7 @@ byte BaseCostumeRenderer::drawCostume(const VirtScreen &vs, int numStrips, const
_out.pixels = vs.getBackPixels(0, 0);
else
_out.pixels = vs.getPixels(0, 0);
-
+
_actorX += _vm->virtscr[0].xstart & 7;
_out.w = _out.pitch;
_out.pixels = (byte *)_out.pixels - (_vm->virtscr[0].xstart & 7);
diff --git a/scumm/base-costume.h b/scumm/base-costume.h
index 0a2fa63a30..e84433888b 100644
--- a/scumm/base-costume.h
+++ b/scumm/base-costume.h
@@ -1,6 +1,6 @@
/* ScummVM - Scumm Interpreter
* Copyright (C) 2001 Ludvig Strigeus
- * Copyright (C) 2001-2005 The ScummVM project
+ * Copyright (C) 2001-2005 The ScummVM project
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -65,7 +65,7 @@ protected:
public:
BaseCostumeLoader(ScummEngine *vm) : _vm(vm) {}
virtual ~BaseCostumeLoader() {}
-
+
virtual void loadCostume(int id) = 0;
virtual byte increaseAnims(Actor *a) = 0;
virtual void costumeDecodeData(Actor *a, int frame, uint usemask) = 0;
@@ -127,7 +127,7 @@ protected:
byte *destptr;
const byte *mask_ptr;
};
-
+
public:
BaseCostumeRenderer(ScummEngine *scumm) {
_actorID = 0;
@@ -137,7 +137,7 @@ public:
_zbuf = 0;
_scaleX = _scaleY = 0;
_draw_top = _draw_bottom = 0;
-
+
_vm = scumm;
_numStrips = -1;
_srcptr = 0;
diff --git a/scumm/bomp.cpp b/scumm/bomp.cpp
index 9a50eafa94..317ab2cb78 100644
--- a/scumm/bomp.cpp
+++ b/scumm/bomp.cpp
@@ -77,7 +77,7 @@ void bompDecodeLineReverse(byte *dst, const byte *src, int len) {
assert(len > 0);
dst += len;
-
+
int num;
byte code, color;
@@ -101,7 +101,7 @@ void bompDecodeLineReverse(byte *dst, const byte *src, int len) {
void bompApplyMask(byte *line_buffer, byte *mask, byte maskbit, int32 size, byte transparency) {
while (1) {
do {
- if (size-- == 0)
+ if (size-- == 0)
return;
if (*mask & maskbit) {
*line_buffer = transparency;
@@ -288,7 +288,7 @@ void ScummEngine::drawBomp(const BompDrawData &bd, bool mirror) {
if (bd.scale_y != 255) {
// A bit set means we should skip this line...
tmp = skip_y_new & skip_y_bits;
-
+
// Advance the scale-skip bit mask, if it's 0, get the next scale-skip byte
skip_y_bits /= 2;
if (skip_y_bits == 0) {
@@ -297,7 +297,7 @@ void ScummEngine::drawBomp(const BompDrawData &bd, bool mirror) {
}
// Skip the current line if the above check tells us to
- if (tmp != 0)
+ if (tmp != 0)
continue;
}
@@ -313,11 +313,11 @@ void ScummEngine::drawBomp(const BompDrawData &bd, bool mirror) {
// Replace the parts of the line which are masked with the transparency color
if (bd.maskPtr)
bompApplyMask(line_ptr, mask, maskbit, width, 255);
-
+
// Apply custom color map, if available
if (_bompActorPalettePtr)
bompApplyActorPalette(_bompActorPalettePtr, line_ptr, width);
-
+
// Finally, draw the decoded, scaled, masked and recolored line onto
// the target surface, using the specified shadow mode
bompApplyShadow(bd.shadowMode, _shadowPalette, line_ptr, dst, width, 255);
@@ -361,7 +361,7 @@ int32 setupBompScale(byte *scaling, int32 size, byte scale) {
count = (256 - size / 2);
assert(0 <= count && count < 768);
tmp_ptr = bigCostumeScaleTable + count;
-
+
count = (size + 7) / 8;
while (count--) {
a = 0;
diff --git a/scumm/boxes.cpp b/scumm/boxes.cpp
index 63ce7fcf12..88d5b9c193 100644
--- a/scumm/boxes.cpp
+++ b/scumm/boxes.cpp
@@ -85,7 +85,7 @@ static Common::Point closestPtOnLine(const Common::Point &start, const Common::P
byte ScummEngine::getMaskFromBox(int box) {
- // Fix for bug #740244 and #755863. This appears to have been a
+ // Fix for bug #740244 and #755863. This appears to have been a
// long standing bug in the original engine?
if (_version <= 3 && box == 255)
return 1;
@@ -163,7 +163,7 @@ int ScummEngine::getScale(int box, int x, int y) {
Box *ptr = getBoxBaseAddr(box);
if (!ptr)
return 255;
-
+
int slot , scale;
if (_version == 8) {
@@ -180,9 +180,9 @@ int ScummEngine::getScale(int box, int x, int y) {
// Was a scale slot specified? If so, we compute the effective scale
// from it, ignoring the box scale.
- if (slot)
+ if (slot)
scale = getScaleFromSlot(slot, x, y);
-
+
return scale;
}
@@ -219,7 +219,7 @@ int ScummEngine::getScaleFromSlot(int slot, int x, int y) {
scale = 1;
else if (scale > 255)
scale = 255;
-
+
return scale;
}
@@ -255,36 +255,36 @@ void ScummEngine::convertScaleTableToScaleSlot(int slot) {
byte *resptr = getResourceAddress(rtScaleTable, slot);
int lowerIdx, upperIdx;
float m, oldM;
-
+
// Do nothing if the given scale table doesn't exist
if (resptr == 0)
return;
-
+
if (resptr[0] == resptr[199]) {
// The scale is constant. This usually means we encountered one of the
- // "broken" cases. We set pseudo scale item values which lead to a
+ // "broken" cases. We set pseudo scale item values which lead to a
// constant scale of 255.
setScaleSlot(slot, 0, 0, 255, 0, 199, 255);
return;
}
-
+
/*
* Essentially, what we are doing here is some kind of "line fitting"
* algorithm. The data in the scale table represents a linear graph. What
* we want to find is the slope and (vertical) offset of this line. Things
* are complicated by the fact that the line is cut of vertically at 1 and
* 255. We have to be careful in handling this and some border cases.
- *
+ *
* Some typical graphs look like these:
* --- --- ---
- * / --- \
+ * / --- \
* ___/ --- \___
- *
+ *
* The method used here is to compute the slope of secants fixed at the
* left and right end. For most cases this detects the cut-over points
- * quite accurately.
+ * quite accurately.
*/
-
+
// Search for the bend on the left side
m = (resptr[199] - resptr[0]) / 199.0;
for (lowerIdx = 0; lowerIdx < 199 && (resptr[lowerIdx] == 1 || resptr[lowerIdx] == 255); lowerIdx++) {
@@ -298,7 +298,7 @@ void ScummEngine::convertScaleTableToScaleSlot(int slot) {
break;
}
}
-
+
// Search for the bend on the right side
m = (resptr[199] - resptr[0]) / 199.0;
for (upperIdx = 199; upperIdx > 1 && (resptr[upperIdx] == 1 || resptr[upperIdx] == 255); upperIdx--) {
@@ -322,7 +322,7 @@ void ScummEngine::convertScaleTableToScaleSlot(int slot) {
// The values of y1 and y2, as well as the scale, can now easily be computed
setScaleSlot(slot, 0, lowerIdx, resptr[lowerIdx], 0, upperIdx, resptr[upperIdx]);
-
+
// Compute the variance, for debugging. It shouldn't exceed 1
ScaleSlot &s = _scaleSlots[slot-1];
int y;
@@ -477,7 +477,7 @@ void ScummEngine::getBoxCoordinates(int boxnum, BoxCoords *box) {
box->ul.y = (short)FROM_LE_32(bp->v8.uly);
box->ur.x = (short)FROM_LE_32(bp->v8.urx);
box->ur.y = (short)FROM_LE_32(bp->v8.ury);
-
+
box->ll.x = (short)FROM_LE_32(bp->v8.llx);
box->ll.y = (short)FROM_LE_32(bp->v8.lly);
box->lr.x = (short)FROM_LE_32(bp->v8.lrx);
@@ -505,7 +505,7 @@ void ScummEngine::getBoxCoordinates(int boxnum, BoxCoords *box) {
box->ul.y = bp->v2.uy * 2;
box->ur.x = bp->v2.urx * 8;
box->ur.y = bp->v2.uy * 2;
-
+
box->ll.x = bp->v2.llx * 8;
box->ll.y = bp->v2.ly * 2;
box->lr.x = bp->v2.lrx * 8;
@@ -515,7 +515,7 @@ void ScummEngine::getBoxCoordinates(int boxnum, BoxCoords *box) {
box->ul.y = (int16)READ_LE_UINT16(&bp->old.uly);
box->ur.x = (int16)READ_LE_UINT16(&bp->old.urx);
box->ur.y = (int16)READ_LE_UINT16(&bp->old.ury);
-
+
box->ll.x = (int16)READ_LE_UINT16(&bp->old.llx);
box->ll.y = (int16)READ_LE_UINT16(&bp->old.lly);
box->lr.x = (int16)READ_LE_UINT16(&bp->old.lrx);
@@ -649,7 +649,7 @@ int ScummEngine::getClosestPtOnBox(int b, int x, int y, int16& outX, int16& outY
BoxCoords box;
getBoxCoordinates(b, &box);
-
+
pt = closestPtOnLine(box.ul, box.ur, x, y);
dist = distanceFromPt(x, y, pt.x, pt.y);
if (dist < bestdist) {
@@ -704,7 +704,7 @@ int ScummEngine::getPathToDestBox(byte from, byte to) {
byte i;
const int numOfBoxes = getNumBoxes();
int dest = -1;
-
+
if (from == to)
return to;
@@ -713,7 +713,7 @@ int ScummEngine::getPathToDestBox(byte from, byte to) {
if (from == Actor::kInvalidBox)
return to;
-
+
assert(from < numOfBoxes);
assert(to < numOfBoxes);
@@ -759,7 +759,7 @@ int ScummEngine::getPathToDestBox(byte from, byte to) {
dest = (int8)boxm[2];
boxm += 3;
}
-
+
if (boxm >= end)
warning("The box matrix apparently is truncated (room %d)", _roomResource);
@@ -986,7 +986,7 @@ void ScummEngine::createBoxMatrix() {
}
}
}
-
+
}
// "Compress" the distance matrix into the box matrix format used
@@ -995,12 +995,12 @@ void ScummEngine::createBoxMatrix() {
// followed by an arbitrary number of byte triples; the end is marked
// again by the lead 0xFF for the next "row". The meaning of the
// byte triples is as follows: the first two bytes define a range
- // of box numbers (e.g. 7-11), while the third byte defines an
- // itineray box. Assuming we are in the 5th "row" and encounter
+ // of box numbers (e.g. 7-11), while the third byte defines an
+ // itineray box. Assuming we are in the 5th "row" and encounter
// the triplet 7,11,15: this means to get from box 5 to any of
// the boxes 7,8,9,10,11 the shortest way is to go via box 15.
// See also getPathToDestBox.
-
+
byte *matrixStart = res.createResource(rtMatrix, 1, BOX_MATRIX_SIZE);
const byte *matrixEnd = matrixStart + BOX_MATRIX_SIZE;
@@ -1020,7 +1020,7 @@ void ScummEngine::createBoxMatrix() {
}
}
addToMatrix(0xFF);
-
+
#if BOX_DEBUG
printf("Itinerary matrix:\n");
@@ -1183,7 +1183,7 @@ void ScummEngine::getGates(int box1, int box2, Common::Point gateA[2], Common::P
Common::Point boxCorner[8];
int line1, line2;
- // For all corner coordinates of the first box, compute the point closest
+ // For all corner coordinates of the first box, compute the point closest
// to them on the second box (and also compute the distance of these points).
getBoxCoordinates(box1, &coords);
boxCorner[0] = coords.ul;
diff --git a/scumm/boxes.h b/scumm/boxes.h
index dc6941c36a..8d5aed3b5c 100644
--- a/scumm/boxes.h
+++ b/scumm/boxes.h
@@ -1,6 +1,6 @@
/* ScummVM - Scumm Interpreter
* Copyright (C) 2001 Ludvig Strigeus
- * Copyright (C) 2001-2005 The ScummVM project
+ * Copyright (C) 2001-2005 The ScummVM project
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/scumm/charset.cpp b/scumm/charset.cpp
index c614b82a88..43b691df80 100644
--- a/scumm/charset.cpp
+++ b/scumm/charset.cpp
@@ -159,7 +159,7 @@ static int SJIStoFMTChunk(int f, int s) { //converts sjis code to fmt font offse
warning("Invaild Char! f %x s %x base %x c %d p %d", f, s, base, c, p);
return 0;
}
-
+
debug(6, "Kanji: %c%c f 0x%x s 0x%x base 0x%x c %d p %d chunk %d cr %d index %d", f, s, f, s, base, c, p, chunk, cr, ((chunk_f + chunk) * 32 + (s - base)) + cr);
return ((chunk_f + chunk) * 32 + (s - base)) + cr;
}
@@ -286,7 +286,7 @@ int CharsetRendererClassic::getCharWidth(byte chr) {
if (offs) {
spacing = _fontPtr[offs] + (signed char)_fontPtr[offs + 2];
}
-
+
return spacing;
}
@@ -974,7 +974,7 @@ static byte italianCharsetDataV2[] = {
};
// Spanish Zak font.
-// FIXME: This is identical to germanCharsetDataV2 it seems?!
+// FIXME: This is identical to germanCharsetDataV2 it seems?!
static byte spanishCharsetDataV2[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x03, 0x06, 0x0c, 0x18, 0x3e, 0x03, 0x00,
@@ -1254,7 +1254,7 @@ void CharsetRendererV3::printChar(int chr) {
int drawTop = _top - vs->topline;
_vm->markRectAsDirty(vs->number, _left, _left + width, drawTop, drawTop + height);
-
+
if (!_ignoreCharsetMask) {
_hasMask = true;
_textScreenID = vs->number;
@@ -1303,13 +1303,13 @@ void CharsetRendererV3::drawChar(int chr, const Graphics::Surface &s, int x, int
void CharsetRenderer::translateColor() {
// Based on disassembly
if (_vm->_renderMode == Common::kRenderCGA) {
- static byte CGAtextColorMap[16] = {0, 3, 3, 3, 5, 5, 5, 15,
+ static byte CGAtextColorMap[16] = {0, 3, 3, 3, 5, 5, 5, 15,
15, 3, 3, 3, 5, 5, 15, 15};
_color = CGAtextColorMap[_color & 0x0f];
}
if (_vm->_renderMode == Common::kRenderHercA || _vm->_renderMode == Common::kRenderHercG) {
- static byte HercTextColorMap[16] = {0, 15, 2, 15, 15, 5, 15, 15,
+ static byte HercTextColorMap[16] = {0, 15, 2, 15, 15, 5, 15, 15,
8, 15, 15, 15, 15, 15, 15, 15};
_color = HercTextColorMap[_color & 0x0f];
}
@@ -1324,7 +1324,7 @@ void CharsetRendererClassic::printChar(int chr) {
int is2byte = (chr >= 0x80 && _vm->_useCJKMode) ? 1 : 0;
checkRange(_vm->_numCharsets - 1, 1, _curId, "Printing with bad charset %d");
-
+
if ((vs = _vm->findVirtScreen(_top)) == NULL && (vs = _vm->findVirtScreen(_top + getFontHeight())) == NULL)
return;
@@ -1348,7 +1348,7 @@ void CharsetRendererClassic::printChar(int chr) {
if (!charOffs)
return;
charPtr = _fontPtr + charOffs;
-
+
width = charPtr[0];
height = charPtr[1];
@@ -1357,14 +1357,14 @@ void CharsetRendererClassic::printChar(int chr) {
} else {
offsX = (signed char)charPtr[2];
}
-
+
offsY = (signed char)charPtr[3];
charPtr += 4; // Skip over char header
}
origWidth = width;
origHeight = height;
-
+
if (_shadowMode != kNoShadowMode) {
width++;
height++;
@@ -1412,7 +1412,7 @@ void CharsetRendererClassic::printChar(int chr) {
_hasMask = true;
_textScreenID = vs->number;
}
-
+
if ((_vm->_heversion >= 71 && type >= 8) || (_vm->_heversion >= 90 && type == 0)) {
#ifndef DISABLE_HE
if (_ignoreCharsetMask || !vs->hasTwoBuffers) {
@@ -1471,7 +1471,7 @@ void CharsetRendererClassic::printChar(int chr) {
if (_blitAlso && vs->hasTwoBuffers) {
// FIXME: Revisiting this code, I think the _blitAlso mode is likely broken
// right now -- we are copying stuff from "dstPtr" to "back", but "dstPtr" really
- // only conatains charset data...
+ // only conatains charset data...
// One way to fix this: don't copy etc.; rather simply render the char twice,
// once to each of the two buffers. That should hypothetically yield
// identical results, though I didn't try it and right now I don't know
@@ -1492,7 +1492,7 @@ void CharsetRendererClassic::printChar(int chr) {
back -= drawTop * backSurface.pitch;
dstPtr -= drawTop * dstSurface.pitch;
}
-
+
// Blit the image data
if (w > 0) {
while (h-- > 0) {
@@ -1502,7 +1502,7 @@ void CharsetRendererClassic::printChar(int chr) {
}
}
}
- }
+ }
_left += origWidth;
@@ -1535,7 +1535,7 @@ void CharsetRendererClassic::drawChar(int chr, const Graphics::Surface &s, int x
if (!charOffs)
return;
charPtr = _fontPtr + charOffs;
-
+
width = charPtr[0];
height = charPtr[1];
@@ -1563,7 +1563,7 @@ void CharsetRendererClassic::drawBitsN(const Graphics::Surface &s, byte *dst, co
for (y = 0; y < height && y + drawTop < s.h; y++) {
for (x = 0; x < width; x++) {
color = (bits >> (8 - bpp)) & 0xFF;
-
+
if (color && y + drawTop >= 0) {
*dst = _vm->_charsetColorMap[color];
}
@@ -1593,7 +1593,7 @@ void CharsetRendererCommon::drawBits1(const Graphics::Surface &s, byte *dst, con
*(dst + s.pitch) = _shadowColor;
if (_shadowMode != kFMTOWNSShadowMode)
*(dst + s.pitch + 1) = _shadowColor;
- }
+ }
*dst = _color;
}
dst++;
@@ -1688,7 +1688,7 @@ void CharsetRendererNut::printChar(int chr) {
_hasMask = true;
_textScreenID = kMainVirtScreen;
}
-
+
int drawTop = _top;
if (_ignoreCharsetMask) {
VirtScreen *vs = &_vm->virtscr[kMainVirtScreen];
@@ -1752,7 +1752,7 @@ void CharsetRendererNES::printChar(int chr) {
int drawTop = _top - vs->topline;
_vm->markRectAsDirty(vs->number, _left, _left + width, drawTop, drawTop + height);
-
+
if (!_ignoreCharsetMask) {
_hasMask = true;
_textScreenID = vs->number;
diff --git a/scumm/charset.h b/scumm/charset.h
index 932423c1ec..e6597d83df 100644
--- a/scumm/charset.h
+++ b/scumm/charset.h
@@ -52,7 +52,7 @@ static inline bool checkSJISCode(byte c) {
class CharsetRenderer {
public:
-
+
Common::Rect _str;
int _nextLeft, _nextTop;
@@ -98,14 +98,14 @@ public:
int getStringWidth(int a, const byte *str);
void addLinebreaks(int a, byte *str, int pos, int maxwidth);
void translateColor();
-
+
virtual void setCurID(byte id) = 0;
int getCurID() { return _curId; }
-
+
virtual int getFontHeight() = 0;
virtual int getCharHeight(byte chr) { return getFontHeight(); }
virtual int getCharWidth(byte chr) = 0;
-
+
virtual void setColor(byte color) { _color = color; translateColor(); }
};
@@ -130,7 +130,7 @@ public:
CharsetRendererCommon(ScummEngine *vm);
void setCurID(byte id);
-
+
int getFontHeight();
};
@@ -140,7 +140,7 @@ protected:
public:
CharsetRendererClassic(ScummEngine *vm) : CharsetRendererCommon(vm) {}
-
+
void printChar(int chr);
void drawChar(int chr, const Graphics::Surface &s, int x, int y);
@@ -155,7 +155,7 @@ protected:
public:
CharsetRendererNES(ScummEngine *vm) : CharsetRendererCommon(vm) {}
-
+
void setCurID(byte id) {}
void printChar(int chr);
void drawChar(int chr, const Graphics::Surface &s, int x, int y);
@@ -170,7 +170,7 @@ protected:
public:
CharsetRendererV3(ScummEngine *vm) : CharsetRendererCommon(vm) {}
-
+
void printChar(int chr);
void drawChar(int chr, const Graphics::Surface &s, int x, int y);
void setCurID(byte id);
@@ -182,7 +182,7 @@ public:
class CharsetRendererV2 : public CharsetRendererV3 {
public:
CharsetRendererV2(ScummEngine *vm, Common::Language language);
-
+
void setCurID(byte id) {}
int getCharWidth(byte chr) { return 8; }
};
@@ -196,11 +196,11 @@ protected:
public:
CharsetRendererNut(ScummEngine *vm);
~CharsetRendererNut();
-
+
void printChar(int chr);
void setCurID(byte id);
-
+
int getFontHeight();
int getCharHeight(byte chr);
int getCharWidth(byte chr);
diff --git a/scumm/costume.cpp b/scumm/costume.cpp
index f7d85b7971..25eee95183 100644
--- a/scumm/costume.cpp
+++ b/scumm/costume.cpp
@@ -78,7 +78,7 @@ static const int v1MMNESLookup[25] = {
0x02, 0x00, 0x07, 0x0C, 0x04,
0x09, 0x0A, 0x12, 0x0B, 0x14,
0x0D, 0x11, 0x0F, 0x0E, 0x10,
- 0x17, 0x00, 0x01, 0x05, 0x16
+ 0x17, 0x00, 0x01, 0x05, 0x16
};
@@ -92,7 +92,7 @@ byte ClassicCostumeRenderer::mainRoutine(int xmoveCur, int ymoveCur) {
int step;
Codec1 v1;
-
+
const int scaletableSize = 128;
const bool newAmiCost = (_vm->_version == 5) && (_vm->_platform == Common::kPlatformAmiga);
@@ -383,7 +383,7 @@ void ClassicCostumeRenderer::procC64(Codec1 &v1, int actor) {
while (len--) {
if (!rep)
color = *src++;
-
+
if (0 <= y && y < _out.h && 0 <= v1.x && v1.x < _out.w) {
if (!_mirror) {
LINE(0, 0); LINE(2, 2); LINE(4, 4); LINE(6, 6);
@@ -467,7 +467,7 @@ void ClassicCostumeRenderer::proc3(Codec1 &v1) {
do {
if (_scaleY == 255 || *scaleytab++ < _scaleY) {
masked = (y < 0 || y >= _out.h) || (v1.mask_ptr && (mask[0] & maskbit));
-
+
if (color && !masked) {
if (_shadow_mode & 0x20) {
pcolor = _shadow_table[*dst];
@@ -534,7 +534,7 @@ void ClassicCostumeRenderer::proc3_ami(Codec1 &v1) {
do {
if (_scaleY == 255 || v1.scaletable[_scaleIndexY] < _scaleY) {
masked = (y < 0 || y >= _out.h) || (v1.mask_ptr && (mask[0] & maskbit));
-
+
if (color && v1.x >= 0 && v1.x < _out.w && !masked) {
*dst = _palette[color];
}
@@ -608,8 +608,8 @@ void ClassicCostumeLoader::loadCostume(int id) {
error("Costume %d with format 0x%X is invalid", id, _format);
}
-
- // In GF_OLD_BUNDLE games, there is no actual palette, just a single color byte.
+
+ // In GF_OLD_BUNDLE games, there is no actual palette, just a single color byte.
// Don't forget, these games were designed around a fixed 16 color HW palette :-)
// In addition, all offsets are shifted by 2; we accomodate that via a separate
// _baseptr value (instead of adding tons of if's throughout the code).
@@ -729,7 +729,7 @@ byte ClassicCostumeRenderer::drawLimb(const Actor *a, int limb) {
// Determine the position the limb is at
i = cost.curpos[limb] & 0x7FFF;
-
+
// Get the frame pointer for that limb
frameptr = _loaded._baseptr + READ_LE_UINT16(_loaded._frameOffsets + limb * 2);
@@ -914,12 +914,12 @@ byte ClassicCostumeLoader::increaseAnim(Actor *a, int slot) {
i = a->_cost.curpos[slot] & 0x7FFF;
end = a->_cost.end[slot];
code = _animCmds[i] & 0x7F;
-
+
if (_vm->_version <= 3) {
if (_animCmds[i] & 0x80)
a->_cost.soundCounter++;
}
-
+
do {
if (!highflag) {
if (i++ >= end)
diff --git a/scumm/costume.h b/scumm/costume.h
index d770fe4f32..956041ce30 100644
--- a/scumm/costume.h
+++ b/scumm/costume.h
@@ -81,7 +81,7 @@ protected:
class ClassicCostumeRenderer : public BaseCostumeRenderer {
protected:
ClassicCostumeLoader _loaded;
-
+
byte _scaleIndexX; /* must wrap at 256 */
byte _scaleIndexY;
byte _palette[32];
diff --git a/scumm/cursor.cpp b/scumm/cursor.cpp
index 7bf81a3f3c..2ecf565d7c 100644
--- a/scumm/cursor.cpp
+++ b/scumm/cursor.cpp
@@ -133,7 +133,7 @@ void ScummEngine_v6::setCursorTransparency(int a) {
void ScummEngine::updateCursor() {
_system->setMouseCursor(_grabbedCursor, _cursor.width, _cursor.height,
- _cursor.hotspotX, _cursor.hotspotY,
+ _cursor.hotspotX, _cursor.hotspotY,
(_platform == Common::kPlatformNES ? _grabbedCursor[63] : 255),
(_heversion == 70 ? 2 : 1));
}
@@ -254,7 +254,7 @@ void ScummEngine_v6::setCursorFromImg(uint img, uint room, uint imgindex) {
size = READ_BE_UINT32(dataptr + 4);
if (size > sizeof(_grabbedCursor))
error("setCursorFromImg: Cursor image too large");
-
+
bomp = findResource(MKID('BOMP'), dataptr);
}
@@ -342,8 +342,8 @@ void ScummEngine_v5::redefineBuiltinCursorFromChar(int index, int chr) {
}
assert(index >= 0 && index < 4);
-
-// const int oldID = _charset->getCurID();
+
+// const int oldID = _charset->getCurID();
if (_version == 3) {
_charset->setCurID(0);
@@ -361,7 +361,7 @@ void ScummEngine_v5::redefineBuiltinCursorFromChar(int index, int chr) {
// s.h = 17 for FM-TOWNS Loom Japanese. Fixes bug #1166917
assert(s.w <= 16 && s.h <= 17);
s.bytesPerPixel = 1;
-
+
_charset->drawChar(chr, s, 0, 0);
uint16 *ptr = _cursorImages[index];
@@ -373,7 +373,7 @@ void ScummEngine_v5::redefineBuiltinCursorFromChar(int index, int chr) {
}
ptr++;
}
-
+
// _charset->setCurID(oldID);
}
@@ -495,7 +495,7 @@ void ScummEngine_v5::setBuiltinCursor(int idx) {
*(hotspot + (_cursor.width * 5) + 1) = color;
} else {
const uint16 *src;
-
+
_cursor.hotspotX = _cursorHotspots[2 * _currentCursor];
_cursor.hotspotY = _cursorHotspots[2 * _currentCursor + 1];
src = _cursorImages[_currentCursor];
@@ -505,7 +505,7 @@ void ScummEngine_v5::setBuiltinCursor(int idx) {
for (i = 0; i < 16; i++) {
for (j = 0; j < 16; j++) {
- if (src[i] & (1 << j))
+ if (src[i] & (1 << j))
_grabbedCursor[16 * i + 15 - j] = color;
}
}
diff --git a/scumm/debugger.cpp b/scumm/debugger.cpp
index dce0db11f3..7ee1252de0 100644
--- a/scumm/debugger.cpp
+++ b/scumm/debugger.cpp
@@ -68,7 +68,7 @@ void CDECL debugC(int channel, const char *s, ...) {
debug(buf);
}
-
+
ScummDebugger::ScummDebugger(ScummEngine *s)
: Common::Debugger<ScummDebugger>() {
_vm = s;
@@ -563,7 +563,7 @@ bool ScummDebugger::Cmd_Debug(int argc, const char **argv) {
if ((argc == 1) && (_vm->_debugFlags > 0)) {
for (int i = 0; i < numChannels; i++) {
if (_vm->_debugFlags & debugChannels[i].flag)
- DebugPrintf("%s - %s\n", debugChannels[i].channel,
+ DebugPrintf("%s - %s\n", debugChannels[i].channel,
debugChannels[i].desc);
}
return true;
@@ -629,7 +629,7 @@ bool ScummDebugger::Cmd_Camera(int argc, const char **argv) {
DebugPrintf("Camera: cur (%d,%d) - dest (%d,%d) - accel (%d,%d) -- last (%d,%d)\n",
_vm->camera._cur.x, _vm->camera._cur.y, _vm->camera._dest.x, _vm->camera._dest.y,
_vm->camera._accel.x, _vm->camera._accel.y, _vm->camera._last.x, _vm->camera._last.y);
-
+
return true;
}
diff --git a/scumm/debugger.h b/scumm/debugger.h
index 3402667936..184bf340d6 100644
--- a/scumm/debugger.h
+++ b/scumm/debugger.h
@@ -31,7 +31,7 @@ class ScummDebugger : public Common::Debugger<ScummDebugger> {
public:
ScummDebugger(ScummEngine *s);
virtual ~ScummDebugger(); // we need this here for __SYMBIAN32__
-
+
protected:
ScummEngine *_vm;
bool _old_soundsPaused;
@@ -67,7 +67,7 @@ protected:
bool Cmd_Hide(int argc, const char **argv);
bool Cmd_IMuse (int argc, const char **argv);
-
+
void printBox(int box);
void drawBox(int box);
};
diff --git a/scumm/dialogs.cpp b/scumm/dialogs.cpp
index 9125e5324b..17d92305e5 100644
--- a/scumm/dialogs.cpp
+++ b/scumm/dialogs.cpp
@@ -119,25 +119,25 @@ static ResString string_map_table_v7[] = {
{94, "text speed"}, //boot26
{95, "text display"}, //boot27
{96, "the dig v1.0"},*/
-
+
};
static ResString string_map_table_v6[] = {
- {117, "How may I serve you?"},
- {109, "Select a game to LOAD"},
- {108, "Name your SAVE game"},
- {96, "Save"},
- {97, "Load"},
- {98, "Play"},
- {99, "Cancel"},
- {100, "Quit"},
- {101, "OK"},
- {93, "Game paused"},
+ {117, "How may I serve you?"},
+ {109, "Select a game to LOAD"},
+ {108, "Name your SAVE game"},
+ {96, "Save"},
+ {97, "Load"},
+ {98, "Play"},
+ {99, "Cancel"},
+ {100, "Quit"},
+ {101, "OK"},
+ {93, "Game paused"},
{210, "Game version"}
};
static ResString string_map_table_v5[] = {
- {28, "How may I serve you?"},
+ {28, "How may I serve you?"},
{20, "Select a game to LOAD"},
{19, "Name your SAVE game"},
{7, "Save"},
@@ -181,7 +181,7 @@ const Common::String ScummDialog::queryResString(int stringno) {
// Convert to a proper string (take care of FF codes)
byte chr;
String tmp;
- while ((chr = *result++)) {
+ while ((chr = *result++)) {
if (chr == 0xFF) {
result += 3;
} else if (chr != '@') {
@@ -211,7 +211,7 @@ protected:
public:
SaveLoadChooser(const String &title, const String &buttonLabel, bool saveMode);
-
+
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
const String &getResultString() const;
void setList(const StringList& list) { GUI_ChooserDialog::setList(list); }
@@ -275,23 +275,23 @@ protected:
public:
SaveLoadChooserEx(const String &title, const String &buttonLabel, bool saveMode, ScummEngine *engine);
-
+
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
- const String &getResultString() const;
+ const String &getResultString() const;
void setList(const StringList& list);
int runModal();
};
SaveLoadChooserEx::SaveLoadChooserEx(const String &title, const String &buttonLabel, bool saveMode, ScummEngine *engine)
: Dialog(8, 8, engine->_system->getOverlayWidth() - 2 * 8, engine->_system->getOverlayHeight() - 16), _saveMode(saveMode), _list(0), _chooseButton(0), _gfxWidget(0), _scumm(engine) {
-
+
new StaticTextWidget(this, 10, 6, _w - 2 * 10, kLineHeight, title, kTextAlignCenter);
-
+
// Add choice list
_list = new GUI::ListWidget(this, 10, 18, _w - 2 * 10 - 180, _h - 14 - kBigButtonHeight - 18, GUI::kBigWidgetSize);
_list->setEditable(saveMode);
_list->setNumberingMode(saveMode ? GUI::kListNumberingOne : GUI::kListNumberingZero);
-
+
// Add the thumbnail display
_gfxWidget = new GUI::GraphicsWidget(this,
_w - (kThumbnailWidth + 22),
@@ -299,7 +299,7 @@ SaveLoadChooserEx::SaveLoadChooserEx(const String &title, const String &buttonLa
kThumbnailWidth + 8,
((_scumm->_system->getHeight() % 200 && _scumm->_system->getHeight() != 350) ? kThumbnailHeight2 : kThumbnailHeight1) + 8);
_gfxWidget->setFlags(GUI::WIDGET_BORDER);
-
+
// Buttons
addButton(this, _w - 2 * (kBigButtonWidth + 10), _h - kBigButtonHeight - 8, "Cancel", kCloseCmd, 0, GUI::kBigWidgetSize);
_chooseButton = addButton(this, _w - (kBigButtonWidth + 10), _h - kBigButtonHeight - 8, buttonLabel, kChooseCmd, 0, GUI::kBigWidgetSize);
@@ -391,7 +391,7 @@ MainMenuDialog::MainMenuDialog(ScummEngine *scumm)
const int screenW = g_system->getOverlayWidth();
const int screenH = g_system->getOverlayHeight();
-
+
int hOffset;
int vSpace;
int vAddOff;
@@ -417,7 +417,7 @@ MainMenuDialog::MainMenuDialog(ScummEngine *scumm)
}
int y = vSpace + vAddOff;
-
+
addBigButton("Resume", kPlayCmd, 'P');
y += vSpace;
@@ -640,7 +640,7 @@ void ConfigDialog::close() {
}
GUI_OptionsDialog::close();
-
+
_vm->setupVolumes();
}
@@ -851,12 +851,12 @@ ValueDisplayDialog::ValueDisplayDialog(const Common::String& label, int minVal,
void ValueDisplayDialog::drawDialog() {
g_gui.blendRect(_x, _y, _w, _h, g_gui._bgcolor);
g_gui.box(_x, _y, _w, _h, g_gui._color, g_gui._shadowcolor);
-
+
const int labelWidth = _w - 8 - _percentBarWidth;
// Draw the label
g_gui.drawString(_label, _x + 4, _y + 4, labelWidth, g_gui._textcolor);
-
+
// Draw the percentage bar
g_gui.fillRect(_x + 4 + labelWidth, _y + 4, _percentBarWidth * (_value - _min) / (_max - _min), _h - 8, g_gui._textcolorhi);
g_gui.frameRect(_x + 4 + labelWidth, _y + 4, _percentBarWidth, _h - 8, g_gui._textcolor);
@@ -876,7 +876,7 @@ void ValueDisplayDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers)
_value++;
else if (ascii == _decKey && _value > _min)
_value--;
-
+
setResult(_value);
_timer = getMillis() + kDisplayDelay;
draw();
diff --git a/scumm/dialogs.h b/scumm/dialogs.h
index 2a16a748cf..3508402391 100644
--- a/scumm/dialogs.h
+++ b/scumm/dialogs.h
@@ -43,7 +43,7 @@ class ScummDialog : public GUI::Dialog {
public:
ScummDialog(ScummEngine *scumm, int x, int y, int w, int h)
: GUI::Dialog(x, y, w, h), _vm(scumm) {}
-
+
protected:
typedef Common::String String;
@@ -60,7 +60,7 @@ class BaseSaveLoadChooser
{
public:
virtual ~BaseSaveLoadChooser() {};
-
+
virtual const Common::String &getResultString() const = 0;
virtual void setList(const Common::StringList& list) = 0;
virtual int runModal() = 0;
@@ -143,7 +143,7 @@ public:
// from resources
InfoDialog(ScummEngine *scumm, int res);
- virtual void handleMouseDown(int x, int y, int button, int clickCount) {
+ virtual void handleMouseDown(int x, int y, int button, int clickCount) {
setResult(0);
close();
}
@@ -187,7 +187,7 @@ public:
virtual void open();
virtual void drawDialog();
virtual void handleTickle();
- virtual void handleMouseDown(int x, int y, int button, int clickCount) {
+ virtual void handleMouseDown(int x, int y, int button, int clickCount) {
close();
}
virtual void handleKeyDown(uint16 ascii, int keycode, int modifiers);
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp
index 7342989f61..78524566df 100644
--- a/scumm/gfx.cpp
+++ b/scumm/gfx.cpp
@@ -100,7 +100,7 @@ static const TransitionEffect transitionEffects[6] = {
0, 0, 0, 24
}
},
-
+
// Box wipe (a box expands from the upper-left corner to the lower-right corner)
{
25, // Number of iterations
@@ -117,7 +117,7 @@ static const TransitionEffect transitionEffects[6] = {
255, 0, 0, 0
}
},
-
+
// Box wipe (a box expands from the lower-right corner to the upper-left corner)
{
25, // Number of iterations
@@ -134,7 +134,7 @@ static const TransitionEffect transitionEffects[6] = {
255, 0, 0, 0
}
},
-
+
// Inverse box wipe
{
25, // Number of iterations
@@ -185,7 +185,7 @@ static const TransitionEffect transitionEffects[6] = {
255, 0, 0, 0
}
}
-
+
};
#endif
@@ -241,7 +241,7 @@ void Gdi::roomChanged(byte *roomptr, uint32 IM00_offs, byte transparentColor) {
} else if (_vm->_version == 2) {
_roomStrips = generateStripTable(roomptr + IM00_offs, _vm->_roomWidth, _vm->_roomHeight, _roomStrips);
}
-
+
_transparentColor = transparentColor;
}
@@ -287,7 +287,7 @@ void ScummEngine::initScreens(int b, int h) {
initVirtScreen(kVerbVirtScreen, h + adj, _screenWidth, _screenHeight - h - adj, false, false);
_screenB = b;
_screenH = h;
-
+
gdi.init();
}
@@ -421,7 +421,7 @@ void ScummEngine::markRectAsDirty(VirtScreenNumber virt, int left, int right, in
void ScummEngine::drawDirtyScreenParts() {
// Update verbs
updateDirtyScreen(kVerbVirtScreen);
-
+
// Update the conversation area (at the top of the screen)
updateDirtyScreen(kTextVirtScreen);
@@ -521,7 +521,7 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
assert(x >= 0 && width <= vs->pitch);
assert(_charset->_textSurface.pixels);
assert(_compositeBuf);
-
+
if (width > vs->w - x)
width = vs->w - x;
@@ -534,7 +534,7 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
// Convert the vertical coordinates to real screen coords
int y = vs->topline + top - _screenTop;
int height = bottom - top;
-
+
// Compute screen etc. buffer pointers
const byte *src = vs->getPixels(x, top);
byte *dst = _compositeBuf + x + y * _screenWidth;
@@ -573,7 +573,7 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
if (_renderMode == Common::kRenderHercA || _renderMode == Common::kRenderHercG) {
ditherHerc(_compositeBuf + x + y * _screenWidth, _herculesBuf, _screenWidth, &x, &y, &width, &height);
// center image on the screen
- _system->copyRectToScreen(_herculesBuf + x + y * Common::kHercW,
+ _system->copyRectToScreen(_herculesBuf + x + y * Common::kHercW,
Common::kHercW, x + (Common::kHercW - _screenWidth * 2) / 2, y, width, height);
} else {
// Finally blit the whole thing to the screen
@@ -864,7 +864,7 @@ void ScummEngine::restoreBG(Common::Rect rect, byte backColor) {
const int height = rect.height();
const int width = rect.width();
-
+
if (!height)
return;
@@ -897,7 +897,7 @@ void CharsetRenderer::restoreCharsetBg() {
return;
_vm->markRectAsDirty(vs->number, Common::Rect(vs->w, vs->h), USAGE_BIT_RESTORED);
-
+
byte *screenBuf = vs->getPixels(0, 0);
if (vs->hasTwoBuffers && _vm->_currentRoom != 0 && _vm->isLightOn()) {
@@ -945,7 +945,7 @@ static void blit(byte *dst, int dstPitch, const byte *src, int srcPitch, int w,
assert(h > 0);
assert(src != NULL);
assert(dst != NULL);
-
+
if (w == srcPitch && w == dstPitch) {
memcpy(dst, src, w*h);
} else {
@@ -960,7 +960,7 @@ static void blit(byte *dst, int dstPitch, const byte *src, int srcPitch, int w,
static void fill(byte *dst, int dstPitch, byte color, int w, int h) {
assert(h > 0);
assert(dst != NULL);
-
+
if (w == dstPitch) {
memset(dst, color, w*h);
} else {
@@ -1016,7 +1016,7 @@ void ScummEngine::drawBox(int x, int y, int x2, int y2, int color) {
// Adjust for the topline of the VirtScreen
y -= vs->topline;
y2 -= vs->topline;
-
+
// Clip the coordinates
if (x < 0)
x = 0;
@@ -1037,7 +1037,7 @@ void ScummEngine::drawBox(int x, int y, int x2, int y2, int color) {
return;
else if (y2 > vs->h)
y2 = vs->h;
-
+
width = x2 - x;
height = y2 - y;
@@ -1084,7 +1084,7 @@ void ScummEngine::drawFlashlight() {
if (_flashlight.isDrawn) {
markRectAsDirty(kMainVirtScreen, _flashlight.x, _flashlight.x + _flashlight.w,
_flashlight.y, _flashlight.y + _flashlight.h, USAGE_BIT_DIRTY);
-
+
if (_flashlight.buffer) {
fill(_flashlight.buffer, vs->pitch, 0, _flashlight.w, _flashlight.h);
}
@@ -1152,7 +1152,7 @@ void ScummEngine::drawFlashlight() {
_flashlight.buffer[maxrow + maxcol - j] = 0;
}
}
-
+
_flashlight.isDrawn = true;
}
@@ -1211,7 +1211,7 @@ void Gdi::drawBitmapV2Helper(const byte *ptr, VirtScreen *vs, int x, int y, cons
theX = 0;
maxX = width;
}
-
+
// Decode and draw the image data.
assert(height <= 128);
for (; theX < maxX; theX++) {
@@ -1265,7 +1265,7 @@ void Gdi::drawBitmapV2Helper(const byte *ptr, VirtScreen *vs, int x, int y, cons
do {
if (!runFlag)
data = *src++;
-
+
if (left <= theX) {
*mask_ptr = data;
mask_ptr += _numStrips;
@@ -1303,7 +1303,7 @@ int Gdi::getZPlanes(const byte *ptr, const byte *zplane_list[9], bool bmapImage)
else {
numzbuf = _numZBuffer;
assert(numzbuf <= 9);
-
+
if (_vm->_features & GF_SMALL_HEADER) {
if (_vm->_features & GF_16COLOR)
zplane_list[1] = ptr + READ_LE_UINT16(ptr);
@@ -1320,7 +1320,7 @@ int Gdi::getZPlanes(const byte *ptr, const byte *zplane_list[9], bool bmapImage)
} else if (_vm->_version == 8) {
// Find the OFFS chunk of the ZPLN chunk
const byte *zplnOffsChunkStart = ptr + 24 + READ_BE_UINT32(ptr + 12);
-
+
// Each ZPLN contains a WRAP chunk, which has (as always) an OFFS subchunk pointing
// at ZSTR chunks. These once more contain a WRAP chunk which contains nothing but
// an OFFS chunk. The content of this OFFS chunk contains the offsets to the
@@ -1341,13 +1341,13 @@ int Gdi::getZPlanes(const byte *ptr, const byte *zplane_list[9], bool bmapImage)
MKID('ZP03'),
MKID('ZP04')
};
-
+
for (i = 1; i < numzbuf; i++) {
zplane_list[i] = _vm->findResource(zplane_tags[i], ptr);
}
}
}
-
+
return numzbuf;
}
@@ -1376,7 +1376,7 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, int y, const int wi
const bool lightsOn = _vm->isLightOn();
_objectMode = (flag & dbObjectMode) == dbObjectMode;
-
+
if (_objectMode && _vm->_version == 1) {
if (_vm->_platform == Common::kPlatformNES) {
decodeNESObject(ptr, x, y, width, height);
@@ -1397,7 +1397,7 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, int y, const int wi
assert(smap_ptr);
numzbuf = getZPlanes(ptr, zplane_list, false);
-
+
const byte *tmsk_ptr = NULL;
if (_vm->_heversion >= 72) {
tmsk_ptr = _vm->findResource(MKID('TMSK'), ptr);
@@ -1613,9 +1613,9 @@ void Gdi::drawBMAPBg(const byte *ptr, VirtScreen *vs) {
_decomp_shr = code % 10;
_decomp_mask = 0xFF >> (8 - _decomp_shr);
code /= 10;
-
+
switch (code) {
- case 13:
+ case 13:
drawStripHE(dst, vs->pitch, bmap_ptr, vs->w, vs->h, false);
break;
case 14:
@@ -1674,7 +1674,7 @@ void Gdi::drawBMAPObject(const byte *ptr, VirtScreen *vs, int obj, int x, int y,
rect1.right -= rect2.left;
rect1.top -= rect2.top;
rect1.bottom -= rect2.top;
-
+
copyVirtScreenBuffers(rect1);
}
#endif
@@ -1706,13 +1706,13 @@ void Gdi::copyVirtScreenBuffers(Common::Rect rect, int dirtybit) {
const int rw = rect.width();
const int rh = rect.height();
-
+
if (rw == 0 || rh == 0)
return;
src = _vm->virtscr[0].getBackPixels(rect.left, rect.top);
dst = _vm->virtscr[0].getPixels(rect.left, rect.top);
-
+
assert(rw <= _vm->_screenWidth && rw > 0);
assert(rh <= _vm->_screenHeight && rh > 0);
blit(dst, _vm->virtscr[0].pitch, src, _vm->virtscr[0].pitch, rw, rh);
@@ -1726,7 +1726,7 @@ void Gdi::resetBackground(int top, int bottom, int strip) {
VirtScreen *vs = &_vm->virtscr[0];
byte *backbuff_ptr, *bgbak_ptr;
int numLinesToProcess;
-
+
if (bottom >= vs->h)
bottom = vs->h;
@@ -1756,7 +1756,7 @@ void Gdi::resetBackground(int top, int bottom, int strip) {
bool Gdi::decompressBitmap(byte *dst, int dstPitch, const byte *src, int numLinesToProcess) {
assert(numLinesToProcess);
-
+
if (_vm->_features & GF_16COLOR) {
drawStripEGA(dst, dstPitch, src, numLinesToProcess);
return false;
@@ -1764,39 +1764,39 @@ bool Gdi::decompressBitmap(byte *dst, int dstPitch, const byte *src, int numLine
byte code = *src++;
bool useOrDecompress = false;
-
+
if (code <= 10) {
switch (code) {
case 1:
unkDecode7(dst, dstPitch, src, numLinesToProcess);
break;
-
+
case 2:
unkDecode8(dst, dstPitch, src, numLinesToProcess); /* Ender - Zak256/Indy256 */
break;
-
+
case 3:
unkDecode9(dst, dstPitch, src, numLinesToProcess); /* Ender - Zak256/Indy256 */
break;
-
+
case 4:
unkDecode10(dst, dstPitch, src, numLinesToProcess); /* Ender - Zak256/Indy256 */
break;
-
+
case 7:
unkDecode11(dst, dstPitch, src, numLinesToProcess); /* Ender - Zak256/Indy256 */
break;
-
+
case 8:
// Used in 3DO versions of HE games
useOrDecompress = true;
drawStrip3DO(dst, dstPitch, src, numLinesToProcess, true);
break;
-
+
case 9:
drawStrip3DO(dst, dstPitch, src, numLinesToProcess, false);
break;
-
+
case 10:
// Used in Amiga version of Monkey Island 1
drawStripEGA(dst, dstPitch, src, numLinesToProcess);
@@ -1809,51 +1809,51 @@ bool Gdi::decompressBitmap(byte *dst, int dstPitch, const byte *src, int numLine
_decomp_shr = code % 10;
_decomp_mask = 0xFF >> (8 - _decomp_shr);
code /= 10;
-
+
switch (code) {
case 1:
drawStripBasicV(dst, dstPitch, src, numLinesToProcess, false);
break;
-
+
case 2:
drawStripBasicH(dst, dstPitch, src, numLinesToProcess, false);
break;
-
+
case 3:
useOrDecompress = true;
drawStripBasicV(dst, dstPitch, src, numLinesToProcess, true);
break;
-
+
case 4:
useOrDecompress = true;
drawStripBasicH(dst, dstPitch, src, numLinesToProcess, true);
break;
-
+
case 6:
case 10:
drawStripComplex(dst, dstPitch, src, numLinesToProcess, false);
break;
-
+
case 8:
case 12:
useOrDecompress = true;
drawStripComplex(dst, dstPitch, src, numLinesToProcess, true);
break;
-
+
case 13:
drawStripHE(dst, dstPitch, src, 8, numLinesToProcess, false);
break;
-
+
case 14:
useOrDecompress = true;
drawStripHE(dst, dstPitch, src, 8, numLinesToProcess, true);
break;
-
+
default:
error("Gdi::decompressBitmap: default case %d", code);
}
}
-
+
return useOrDecompress;
}
@@ -1935,7 +1935,7 @@ void Gdi::decompressMaskImgOr(byte *dst, const byte *src, int height) const {
while (height) {
b = *src++;
-
+
if (b & 0x80) {
b &= 0x7F;
c = *src++;
@@ -2350,7 +2350,7 @@ StripTable *Gdi::generateStripTable(const byte *src, int width, int height, Stri
x = 0;
y = height;
width /= 8;
-
+
for (;;) {
length = *src++;
const byte runFlag = length & 0x80;
@@ -2384,7 +2384,7 @@ void Gdi::drawStripEGA(byte *dst, int dstPitch, const byte *src, int height) con
while (x < 8) {
color = *src++;
-
+
if (color & 0x80) {
run = color & 0x3f;
@@ -2423,7 +2423,7 @@ void Gdi::drawStripEGA(byte *dst, int dstPitch, const byte *src, int height) con
if (run == 0) {
run = *src++;
}
-
+
for (z = 0; z < run; z++) {
*(dst + y * dstPitch + x) = _roomPalette[color & 0xf];
@@ -2451,12 +2451,12 @@ void Gdi::drawStripHE(byte *dst, int dstPitch, const byte *src, int width, int h
uint32 dataBit, data;
byte color;
int shift;
-
+
color = *src++;
data = READ_LE_UINT24(src);
src += 3;
shift = 24;
-
+
int x = width;
while (1) {
if (!transpCheck || color != _transparentColor)
@@ -2889,10 +2889,10 @@ void ScummEngine::fadeOut(int effect) {
if (_screenEffectFlag && effect != 0) {
-
+
// Fill screen 0 with black
memset(vs->getPixels(0, 0), 0, vs->pitch * vs->h);
-
+
// Fade to black with the specified effect, if any.
switch (effect) {
case 1:
@@ -2996,7 +2996,7 @@ void ScummEngine::transitionEffect(int a) {
/**
* Update width*height areas of the screen, in random order, until the whole
* screen has been updated. For instance:
- *
+ *
* dissolveEffect(1, 1) produces a pixel-by-pixel dissolve
* dissolveEffect(8, 8) produces a square-by-square dissolve
* dissolveEffect(virtsrc[0].width, 1) produces a line-by-line dissolve
@@ -3089,7 +3089,7 @@ void ScummEngine::dissolveEffect(int width, int height) {
blits = 0;
blits_before_refresh = (3 * w * h) / 25;
-
+
// Speed up the effect for CD Loom since it uses it so often. I don't
// think the original had any delay at all, so on modern hardware it
// wasn't even noticeable.
diff --git a/scumm/gfx.h b/scumm/gfx.h
index 0c019cf6dc..b64fe96963 100644
--- a/scumm/gfx.h
+++ b/scumm/gfx.h
@@ -1,6 +1,6 @@
/* ScummVM - Scumm Interpreter
* Copyright (C) 2001 Ludvig Strigeus
- * Copyright (C) 2001-2005 The ScummVM project
+ * Copyright (C) 2001-2005 The ScummVM project
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -84,7 +84,7 @@ struct VirtScreen : Graphics::Surface {
* ScummEngine:virtscr array).
*/
VirtScreenNumber number;
-
+
/**
* Vertical position of the virtual screen. Tells how much the virtual
* screen is shifted along the y axis relative to the real screen.
@@ -94,7 +94,7 @@ struct VirtScreen : Graphics::Surface {
* horizontal scrolling in V7-V8 games.
*/
uint16 topline;
-
+
/**
* Horizontal scroll offset, tells how far the screen is scrolled to the
* right. Only used for the main screen. After all, verbs and the
@@ -111,7 +111,7 @@ struct VirtScreen : Graphics::Surface {
* and useIm01Cursor()), we keep it (at least for now).
*/
bool hasTwoBuffers;
-
+
/**
* Pointer to the screen's back buffer, if it has one (see also
* the hasTwoBuffers member).
@@ -154,7 +154,7 @@ struct VirtScreen : Graphics::Surface {
bdirty[i] = bottom;
}
}
-
+
byte *getPixels(int x, int y) const {
return (byte *)pixels + xstart + y * pitch + x;
}
@@ -184,7 +184,7 @@ struct BompDrawData {
uint16 shadowMode;
byte *maskPtr;
-
+
BompDrawData() { memset(this, 0, sizeof(*this)); }
};
@@ -199,7 +199,7 @@ public:
int _numZBuffer;
int _imgBufOffs[8];
int32 _numStrips;
-
+
Gdi(ScummEngine *vm);
~Gdi();
@@ -266,7 +266,7 @@ protected:
int getZPlanes(const byte *smap_ptr, const byte *zplane_list[9], bool bmapImage) const;
StripTable *generateStripTable(const byte *src, int width, int height, StripTable *table) const;
- void drawBitmapV2Helper(const byte *ptr, VirtScreen *vs, int x, int y, const int width, const int height,
+ void drawBitmapV2Helper(const byte *ptr, VirtScreen *vs, int x, int y, const int width, const int height,
int stripnr, int numstrip);
public:
@@ -281,7 +281,7 @@ public:
void drawBMAPBg(const byte *ptr, VirtScreen *vs);
void drawBMAPObject(const byte *ptr, VirtScreen *vs, int obj, int x, int y, int w, int h);
-
+
void copyVirtScreenBuffers(Common::Rect rect, int dirtybit = 0);
byte *getMaskBuffer(int x, int y, int z);
diff --git a/scumm/help.cpp b/scumm/help.cpp
index 493c867c96..d6fc697e9b 100644
--- a/scumm/help.cpp
+++ b/scumm/help.cpp
@@ -50,11 +50,11 @@ int ScummHelp::numPages(byte gameId) {
case GID_FT:
case GID_CMI:
return 3;
- break;
+ break;
/* TODO - I don't know the controls for these games
case GID_PUTTDEMO:
case GID_PUTTPUTT:
-*/
+*/
default:
return 2;
}
diff --git a/scumm/imuse.cpp b/scumm/imuse.cpp
index 5570e7c2e1..a024d79856 100644
--- a/scumm/imuse.cpp
+++ b/scumm/imuse.cpp
@@ -1226,7 +1226,7 @@ void IMuseInternal::initMT32(MidiDriver *midi) {
byte buffer[52];
char info[256] = "ScummVM ";
int len;
-
+
// Reset the MT-32
memcpy(&buffer[0], "\x41\x10\x16\x12\x7f\x00\x00\x01\x00", 9);
midi->sysEx(buffer, 9);
@@ -1255,7 +1255,7 @@ void IMuseInternal::initMT32(MidiDriver *midi) {
midi->sysEx(buffer, 31);
g_system->delayMillis(250);
- // Map percussion to notes 24 - 34 without reverb
+ // Map percussion to notes 24 - 34 without reverb
memcpy(&buffer[4], "\x03\x01\x10\x40\x64\x07\x00\x4a\x64\x06\x00\x41\x64\x07\x00\x4b\x64\x08\x00\x45\x64\x06\x00\x44\x64\x0b\x00\x51\x64\x05\x00\x43\x64\x08\x00\x50\x64\x07\x00\x42\x64\x03\x00\x4c\x64\x07\x00\x44", 48);
midi->sysEx(buffer, 52);
g_system->delayMillis(250);
@@ -1273,23 +1273,23 @@ void IMuseInternal::initGM(MidiDriver *midi) {
g_system->delayMillis(200);
if (_enable_gs) {
-
+
// All GS devices recognize the GS Reset command,
// even with Roland's ID. It is impractical to
- // support other manufacturers' devices for
+ // support other manufacturers' devices for
// further GS settings, as there are limitless
// numbers of them out there that would each
// require individual SysEx commands with unique IDs.
// Roland GS SysEx ID
memcpy(&buffer[0], "\xF0\x41\x10\x42\x12", 5);
-
+
// GS Reset
memcpy(&buffer[5], "\x40\x00\x7F\x00\x41\xF7", 6);
midi->sysEx(buffer, 11);
debug(2, "GS SysEx: GS Reset");
g_system->delayMillis(200);
-
+
if (_sc55) {
// This mode is for GS devices that support an MT-32-compatible
// Map, such as the Roland Sound Canvas line of modules. It
@@ -1334,7 +1334,7 @@ void IMuseInternal::initGM(MidiDriver *midi) {
midi->send(( 0 << 16) | (38 << 8) | (0xB0 | i));
midi->send(( 127 << 16) | (100 << 8) | (0xB0 | i));
midi->send(( 127 << 16) | (101 << 8) | (0xB0 | i));
- }
+ }
debug(2, "GM Controller 6 Change: Channels 1-16 Pitch Bend Sensitivity is 12 semitones");
// Set channels 1-16 Mod. LFO1 Pitch Depth to 4
@@ -1580,7 +1580,7 @@ int IMuseInternal::save_or_load(Serializer *ser, ScummEngine *scumm) {
ser->saveLoadEntries(this, mainEntries);
ser->saveLoadArrayOf(_cmd_queue, ARRAYSIZE(_cmd_queue), sizeof(_cmd_queue[0]), cmdQueueEntries);
- ser->saveLoadArrayOf(_snm_triggers, ARRAYSIZE(_snm_triggers), sizeof(_snm_triggers[0]), snmTriggerEntries);
+ ser->saveLoadArrayOf(_snm_triggers, ARRAYSIZE(_snm_triggers), sizeof(_snm_triggers[0]), snmTriggerEntries);
// The players
for (i = 0; i < ARRAYSIZE(_players); ++i)
diff --git a/scumm/imuse_digi/dimuse_bndmgr.cpp b/scumm/imuse_digi/dimuse_bndmgr.cpp
index f65ec2656a..6a8db5c10a 100644
--- a/scumm/imuse_digi/dimuse_bndmgr.cpp
+++ b/scumm/imuse_digi/dimuse_bndmgr.cpp
@@ -85,7 +85,7 @@ int BundleDirCache::matchFile(const char *filename) {
if (tag == 'LB23')
_budleDirCache[freeSlot].compressedBun = true;
offset = file.readUint32BE();
-
+
strcpy(_budleDirCache[freeSlot].fileName, filename);
_budleDirCache[freeSlot].numFiles = file.readUint32BE();
_budleDirCache[freeSlot].bundleTable = (AudioTable *) malloc(_budleDirCache[freeSlot].numFiles * sizeof(AudioTable));
diff --git a/scumm/imuse_digi/dimuse_bndmgr.h b/scumm/imuse_digi/dimuse_bndmgr.h
index 5ddab37ec2..d7b040d5ac 100644
--- a/scumm/imuse_digi/dimuse_bndmgr.h
+++ b/scumm/imuse_digi/dimuse_bndmgr.h
@@ -42,7 +42,7 @@ private:
int32 numFiles;
bool compressedBun;
} _budleDirCache[4];
-
+
public:
BundleDirCache();
~BundleDirCache();
@@ -75,7 +75,7 @@ private:
byte *_compInput;
int _outputSize;
int _lastBlock;
-
+
bool loadCompTable(int32 index);
public:
diff --git a/scumm/imuse_digi/dimuse_codecs.cpp b/scumm/imuse_digi/dimuse_codecs.cpp
index 40e3616b04..46dd0c6720 100644
--- a/scumm/imuse_digi/dimuse_codecs.cpp
+++ b/scumm/imuse_digi/dimuse_codecs.cpp
@@ -48,7 +48,7 @@ uint32 decode12BitsSample(const byte *src, byte **dst, uint32 size) {
* The "IMC" codec below (see cases 13 & 15 in decompressCodec) is actually a
* variant of the IMA codec, see also
* <http://home.pcisys.net/~melanson/codecs/simpleaudio.html>
- *
+ *
* It is somewhat different, though: the standard ADPCM codecs use a fixed
* size for their data packets (4 bits), while the codec implemented here
* varies the size of each "packet" between 2 and 7 bits.
@@ -80,27 +80,27 @@ static const byte imxOtherTable[6][64] = {
{
0xFF, 0x04
},
-
+
{
0xFF, 0xFF, 0x02, 0x08
},
-
+
{
0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x02, 0x04, 0x06
},
-
+
{
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0x01, 0x02, 0x04, 0x06, 0x08, 0x0C, 0x10, 0x20
},
-
+
{
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0x01, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x20
},
-
+
{
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
@@ -122,12 +122,12 @@ void releaseImcTables() {
void initializeImcTables() {
int pos;
-
+
#ifdef __PALM_OS__
if (!_destImcTable) _destImcTable = (byte *)calloc(89, sizeof(byte));
if (!_destImcTable2) _destImcTable2 = (uint32 *)calloc(89 * 64, sizeof(uint32));
#endif
-
+
for (pos = 0; pos <= 88; ++pos) {
byte put = 1;
int32 tableValue = ((imcTable[pos] * 4) / 7) / 2;
@@ -537,7 +537,7 @@ int32 decompressCodec(int32 codec, byte *comp_input, byte *comp_output, int32 in
// Decoder for the the IMA ADPCM variants used in COMI.
// Contrary to regular IMA ADPCM, this codec uses a variable
// bitsize for the encoded data.
-
+
const int MAX_CHANNELS = 2;
int32 outputSamplesLeft;
int32 destPos;
@@ -558,7 +558,7 @@ int32 decompressCodec(int32 codec, byte *comp_input, byte *comp_output, int32 in
outputSamplesLeft = 0x1000;
// Every data packet contains 0x2000 bytes of audio data
- // when extracted. In order to encode bigger data sets,
+ // when extracted. In order to encode bigger data sets,
// one has to split the data into multiple blocks.
//
// Every block starts with a 2 byte word. If that word is
@@ -604,7 +604,7 @@ int32 decompressCodec(int32 codec, byte *comp_input, byte *comp_output, int32 in
destPos = chan * 2;
const int bound = (channels == 1)
- ? outputSamplesLeft
+ ? outputSamplesLeft
: ((chan == 0)
? (outputSamplesLeft+1) / 2
: outputSamplesLeft / 2);
@@ -612,7 +612,7 @@ int32 decompressCodec(int32 codec, byte *comp_input, byte *comp_output, int32 in
// Determine the size (in bits) of the next data packet
const int32 curTableEntryBitCount = _destImcTable[curTablePos];
assert(2 <= curTableEntryBitCount && curTableEntryBitCount <= 7);
-
+
// Read the next data packet
const byte *readPos = src + (totalBitOffset >> 3);
const uint16 readWord = (uint16)(READ_BE_UINT16(readPos) << (totalBitOffset & 7));
@@ -620,7 +620,7 @@ int32 decompressCodec(int32 codec, byte *comp_input, byte *comp_output, int32 in
// Advance read position to the next data packet
totalBitOffset += curTableEntryBitCount;
-
+
// Decode the data packet into a delta value for the output signal.
const byte signBitMask = (1 << (curTableEntryBitCount - 1));
const byte dataBitMask = (signBitMask - 1);
@@ -629,13 +629,13 @@ int32 decompressCodec(int32 codec, byte *comp_input, byte *comp_output, int32 in
const int32 tmpA = (data << (7 - curTableEntryBitCount));
const int32 imcTableEntry = imcTable[curTablePos] >> (curTableEntryBitCount - 1);
int32 delta = imcTableEntry + _destImcTable2[tmpA + (curTablePos * 64)];
-
+
// The topmost bit in the data packet tells is a sign bit
if ((packet & signBitMask) != 0) {
delta = -delta;
}
-
- // Accumulate the delta onto the output data
+
+ // Accumulate the delta onto the output data
outputWord += delta;
// Clip outputWord to 16 bit signed, and write it into the destination stream
diff --git a/scumm/imuse_digi/dimuse_music.cpp b/scumm/imuse_digi/dimuse_music.cpp
index 0ee5ecd291..041da01b6f 100644
--- a/scumm/imuse_digi/dimuse_music.cpp
+++ b/scumm/imuse_digi/dimuse_music.cpp
@@ -93,7 +93,7 @@ void IMuseDigital::setDigMusicSequence(int seqId) {
break;
}
}
-
+
if (num == -1)
return;
diff --git a/scumm/imuse_digi/dimuse_sndmgr.cpp b/scumm/imuse_digi/dimuse_sndmgr.cpp
index 4c84afc108..4c47ddaf16 100644
--- a/scumm/imuse_digi/dimuse_sndmgr.cpp
+++ b/scumm/imuse_digi/dimuse_sndmgr.cpp
@@ -339,7 +339,7 @@ ImuseDigiSndMgr::soundStruct *ImuseDigiSndMgr::openSound(int32 soundId, const ch
const bool header_outside = ((_vm->_gameId == GID_CMI) && !(_vm->_features & GF_DEMO));
bool result = false;
byte *ptr = NULL;
-
+
switch (soundType) {
case IMUSE_RESOURCE:
assert(soundName[0] == 0); // Paranoia check
@@ -502,7 +502,7 @@ int ImuseDigiSndMgr::getJumpIdByRegionAndHookId(soundStruct *soundHandle, int re
return l;
}
}
-
+
return -1;
}
@@ -571,7 +571,7 @@ int32 ImuseDigiSndMgr::getDataFromRegion(soundStruct *soundHandle, int region, b
} else if (soundHandle->resPtr) {
*buf = (byte *)malloc(size);
memcpy(*buf, soundHandle->resPtr + start + offset + header_size, size);
- } else if ((soundHandle->bundle) && (soundHandle->compressed)) {
+ } else if ((soundHandle->bundle) && (soundHandle->compressed)) {
*buf = (byte *)malloc(size);
char fileName[24];
sprintf(fileName, "%s_reg%03d", soundHandle->name, region);
diff --git a/scumm/imuse_digi/dimuse_sndmgr.h b/scumm/imuse_digi/dimuse_sndmgr.h
index 2881316174..de833d2c8f 100644
--- a/scumm/imuse_digi/dimuse_sndmgr.h
+++ b/scumm/imuse_digi/dimuse_sndmgr.h
@@ -60,7 +60,7 @@ private:
int32 size; // size of sync
byte *ptr; // pointer to sync
};
-
+
public:
struct soundStruct {
diff --git a/scumm/imuse_internal.h b/scumm/imuse_internal.h
index 4615f7b6b2..4d665a3df5 100644
--- a/scumm/imuse_internal.h
+++ b/scumm/imuse_internal.h
@@ -332,7 +332,7 @@ struct Part {
void sendAll();
void sendPitchBend();
bool clearToTransmit();
-
+
Part() {
memset(this,0,sizeof(Part));
}
diff --git a/scumm/input.cpp b/scumm/input.cpp
index 3a3d0fe813..2b5871fdcf 100644
--- a/scumm/input.cpp
+++ b/scumm/input.cpp
@@ -183,12 +183,12 @@ void ScummEngine::parseEvents() {
case OSystem::EVENT_RBUTTONUP:
_rightBtnPressed &= ~msDown;
break;
-
+
// The following two cases enable dialog choices to be
// scrolled through in the SegaCD version of MI
// as nothing else uses the wheel don't bother
// checking the gameid
-
+
case OSystem::EVENT_WHEELDOWN:
_keyPressed = 55;
break;
@@ -196,14 +196,14 @@ void ScummEngine::parseEvents() {
case OSystem::EVENT_WHEELUP:
_keyPressed = 54;
break;
-
+
case OSystem::EVENT_QUIT:
if (_confirmExit)
confirmExitDialog();
else
_quit = true;
break;
-
+
default:
break;
}
@@ -238,8 +238,8 @@ void ScummEngine::processKbd(bool smushMode) {
// Convert F-Keys for V1/V2 games (they start at 1 instead of at 315)
_lastKeyHit -= 314;
}
-
-
+
+
//
// Clip the mouse coordinates, and compute _virtualMouse.x (and clip it, too)
//
@@ -348,9 +348,9 @@ void ScummEngine::processKbd(bool smushMode) {
else
if (vm.cutScenePtr[vm.cutSceneStackPointer])
_lastKeyHit = (uint)VAR(VAR_CUTSCENEEXIT_KEY);
- else
- // Skip talk
- if (VAR_TALKSTOP_KEY != 0xFF && _talkDelay > 0)
+ else
+ // Skip talk
+ if (VAR_TALKSTOP_KEY != 0xFF && _talkDelay > 0)
_lastKeyHit = (uint)VAR(VAR_TALKSTOP_KEY);
else
// Escape
diff --git a/scumm/insane/insane.cpp b/scumm/insane/insane.cpp
index 22133c0915..a1cc86fbdf 100644
--- a/scumm/insane/insane.cpp
+++ b/scumm/insane/insane.cpp
@@ -45,13 +45,13 @@
namespace Scumm {
-static const int actorAnimationData[21] = {20, 21, 22, 23, 24, 25, 26, 13, 14, 15, 16, 17,
+static const int actorAnimationData[21] = {20, 21, 22, 23, 24, 25, 26, 13, 14, 15, 16, 17,
18, 19, 6, 7, 8, 9, 10, 11, 12};
Insane::Insane(ScummEngine_v6 *scumm) {
_vm = scumm;
-
+
initvars();
if (!((_vm->_features & GF_DEMO) && (_vm->_platform == Common::kPlatformPC))) {
@@ -177,30 +177,30 @@ void Insane::initvars(void) {
for (i = 0; i < 0x80; i++)
_iactBits[i] = 0;
-
+
if ((_vm->_features & GF_DEMO) && (_vm->_platform == Common::kPlatformPC)) {
- init_enemyStruct(EN_ROTT1, EN_ROTT1, 0, 0, 160, 0, INV_MACE, 63, "endcrshr.san",
+ init_enemyStruct(EN_ROTT1, EN_ROTT1, 0, 0, 160, 0, INV_MACE, 63, "endcrshr.san",
25, 15, 16, 26, 11, 3);
} else {
- init_enemyStruct(EN_ROTT1, EN_ROTT1, 0, 0, 160, 0, INV_MACE, 90, "wr2_rott.san",
+ init_enemyStruct(EN_ROTT1, EN_ROTT1, 0, 0, 160, 0, INV_MACE, 90, "wr2_rott.san",
26, 16, 17, 27, 11, 3);
}
- init_enemyStruct(EN_ROTT2, EN_ROTT2, 1, 0, 250, 0, INV_2X4, 90, "wr2_rott.san",
+ init_enemyStruct(EN_ROTT2, EN_ROTT2, 1, 0, 250, 0, INV_2X4, 90, "wr2_rott.san",
28, 16, 17, 42, 11, 3);
- init_enemyStruct(EN_ROTT3, EN_ROTT3, 2, 0, 120, 0, INV_HAND, 90, "wr2_rott.san",
+ init_enemyStruct(EN_ROTT3, EN_ROTT3, 2, 0, 120, 0, INV_HAND, 90, "wr2_rott.san",
15, 16, 17, 43, 11, 3);
- init_enemyStruct(EN_VULTF1, EN_VULTF1, 3, 0, 60, 0, INV_HAND, 91, "wr2_vltp.san",
+ init_enemyStruct(EN_VULTF1, EN_VULTF1, 3, 0, 60, 0, INV_HAND, 91, "wr2_vltp.san",
29, 33, 32, 37, 12, 4);
- init_enemyStruct(EN_VULTM1, EN_VULTM1, 4, 0, 100, 0, INV_CHAIN, 91, "wr2_vltc.san",
+ init_enemyStruct(EN_VULTM1, EN_VULTM1, 4, 0, 100, 0, INV_CHAIN, 91, "wr2_vltc.san",
30, 33, 32, 36, 12, 4);
- init_enemyStruct(EN_VULTF2, EN_VULTF2, 5, 0, 250, 0, INV_CHAINSAW, 91, "wr2_vlts.san",
+ init_enemyStruct(EN_VULTF2, EN_VULTF2, 5, 0, 250, 0, INV_CHAINSAW, 91, "wr2_vlts.san",
31, 33, 32, 35, 12, 4);
- init_enemyStruct(EN_VULTM2, EN_VULTM2, 6, 0, 900, 0, INV_BOOT, 91, "wr2_rott.san",
+ init_enemyStruct(EN_VULTM2, EN_VULTM2, 6, 0, 900, 0, INV_BOOT, 91, "wr2_rott.san",
34, 33, 32, 45, 16, 4);
- init_enemyStruct(EN_CAVEFISH, EN_CAVEFISH, 7, 0, 60, 0, INV_DUST, 92, "wr2_cave.san",
+ init_enemyStruct(EN_CAVEFISH, EN_CAVEFISH, 7, 0, 60, 0, INV_DUST, 92, "wr2_cave.san",
39, 0, 0, 41, 13, 2);
- init_enemyStruct(EN_TORQUE, EN_TORQUE, 8, 0, 900, 0, INV_HAND, 93, "wr2_vltp.san",
+ init_enemyStruct(EN_TORQUE, EN_TORQUE, 8, 0, 900, 0, INV_HAND, 93, "wr2_vltp.san",
57, 0, 0, 37, 12, 1);
init_fluConfStruct(1, 1, &_smush_minedrivFlu, "minedriv.san", 235, 1300);
@@ -219,7 +219,7 @@ void Insane::initvars(void) {
init_fluConfStruct(18, 4, &_smush_tovista1Flu, "tovista1.san", 175, 230);
init_fluConfStruct(19, 6, &_smush_toranchFlu, "toranch.san", 115, 530);
init_fluConfStruct(20, 6, &_smush_toranchFlu, "toranch.san", 115, 530);
-
+
init_scenePropStruct( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1);
init_scenePropStruct( 1, 0, 1, 128, 2001, 0, 0, 0, 0, 56, 2);
init_scenePropStruct( 2, 0, 0, 125, 1002, 0, 0, 0, 0, 35, 3);
@@ -444,7 +444,7 @@ void Insane::initvars(void) {
_enemyState[i][j] = 0;
}
-void Insane::init_actStruct(int actornum, int actnum, int32 actorval, byte state,
+void Insane::init_actStruct(int actornum, int actnum, int32 actorval, byte state,
int32 room, int32 animTilt, int32 tilt, int32 frame) {
_actor[actornum].act[actnum].actor = actorval;
_actor[actornum].act[actnum].state = state;
@@ -477,7 +477,7 @@ void Insane::init_enemyStruct(int n, int32 handler, int32 initializer,
_enemy[n].apprAnim = apprAnim;
}
-void Insane::init_fluConfStruct(int n, int sceneId, byte **fluPtr,
+void Insane::init_fluConfStruct(int n, int sceneId, byte **fluPtr,
const char *filenamePtr, int startFrame, int numFrames) {
_fluConf[n].sceneId = sceneId;
_fluConf[n].fluPtr = fluPtr;
@@ -502,7 +502,7 @@ void Insane::init_scenePropStruct(int32 n, int32 n1, int32 actornum, int32 sound
void Insane::setBenAnimation(int32 actornum, int anim) {
if (anim <= 12)
- smlayer_setActorFacing(actornum, 1,
+ smlayer_setActorFacing(actornum, 1,
actorAnimationData[_actor[actornum].weaponClass * 7 + anim - 6], 180);
}
@@ -513,7 +513,7 @@ void Insane::setEnemyAnimation(int32 actornum, int anim) {
d = 14;
if (anim <= 12)
- smlayer_setActorFacing(actornum, 1,
+ smlayer_setActorFacing(actornum, 1,
actorAnimationData[_actor[actornum].weaponClass * 7 + anim - 6] + d, 180);
}
@@ -598,7 +598,7 @@ void Insane::readFileToMem(const char *name, byte **buf) {
in.read(*buf, len);
}
-void Insane::startVideo(const char *filename, int num, int argC, int frameRate,
+void Insane::startVideo(const char *filename, int num, int argC, int frameRate,
int doMainLoop, byte *fluPtr, int32 startFrame) {
int32 offset = 0;
@@ -679,13 +679,13 @@ void Insane::readState(void) { // PATCH
// Still it is unknown what leads to this state. Most probably it is memory
// overwrite
if (_enemy[EN_VULTM2].isEmpty != readArray(7)) {
- warning("Wrong INSANE parameters for EN_VULTM2 (%d %d)",
+ warning("Wrong INSANE parameters for EN_VULTM2 (%d %d)",
_enemy[EN_VULTM2].isEmpty, readArray(7));
_enemy[EN_VULTM2].isEmpty = readArray(7);
}
if (_enemy[EN_VULTF2].isEmpty != (_actor[0].inventory[INV_CHAINSAW] != 0)) {
- warning("Wrong INSANE parameters for EN_VULTF2 (%d %d)",
+ warning("Wrong INSANE parameters for EN_VULTF2 (%d %d)",
_enemy[EN_VULTF2].isEmpty, _actor[0].inventory[INV_CHAINSAW]);
_enemy[EN_VULTF2].isEmpty = (_actor[0].inventory[INV_CHAINSAW] != 0);
}
@@ -698,11 +698,11 @@ void Insane::readState(void) { // PATCH
// you won cavefish, don't have googles, don't have ramp
//
// So if you find out what how to check ramp presense, feel free to add check here
- // (beware of FT ver a and ver b. In version b var311 is inserted and all vars >311
+ // (beware of FT ver a and ver b. In version b var311 is inserted and all vars >311
// are shifted),
- //
+ //
//if (_enemy[EN_CAVEFISH].isEmpty != readArray(8))
- // error("Wrong INSANE parameters for EN_CAVEFISH (%d %d). Please, report this",
+ // error("Wrong INSANE parameters for EN_CAVEFISH (%d %d). Please, report this",
// _enemy[EN_CAVEFISH].isEmpty, readArray(8));
}
}
@@ -738,7 +738,7 @@ int32 Insane::idx1Tweak(void) {
_objArray1Idx++;
if (_objArray1Idx >= 100)
_objArray1Idx = 0;
-
+
return _objArray1[_objArray1Idx];
}
@@ -746,7 +746,7 @@ int32 Insane::idx2Tweak(void) {
if (!_idx2Exceeded)
if (_objArray2Idx >= _objArray2Idx2)
return false;
-
+
_objArray2Idx++;
if (_objArray2Idx >= 100) {
_idx2Exceeded = 0;
@@ -838,20 +838,20 @@ int Insane::smush_changeState(int state) {
return _smush_smushState;
}
-void Insane::queueSceneSwitch(int32 sceneId, byte *fluPtr, const char *filename,
+void Insane::queueSceneSwitch(int32 sceneId, byte *fluPtr, const char *filename,
int32 arg_C, int32 arg_10, int32 startFrame, int32 numFrames) {
int32 tmp;
-
+
debugC(DEBUG_INSANE, "queueSceneSwitch(%d, *, %s, %d, %d, %d, %d)", sceneId, filename, arg_C, arg_10,
startFrame, numFrames);
if (_needSceneSwitch || _sceneData1Loaded)
return;
-
+
if (fluPtr) {
tmp = ((int)startFrame/30+1)*30;
if (tmp >= numFrames)
tmp = 0;
-
+
smush_setupSanWithFlu(filename, arg_C|32, -1, -1, 0, fluPtr, tmp);
} else {
smush_setupSanFromStart(filename, arg_C|32, -1, -1, 0);
@@ -863,7 +863,7 @@ void Insane::queueSceneSwitch(int32 sceneId, byte *fluPtr, const char *filename,
void Insane::smush_rewindCurrentSan(int arg_0, int arg_4, int arg_8) {
debugC(DEBUG_INSANE, "smush_rewindCurrentSan(%d, %d, %d)", arg_0, arg_4, arg_8);
_smush_setupsan2 = arg_0;
-
+
smush_setupSanFile(0, 0, 0);
_smush_isSanFileSetup = 1;
smush_setFrameSteps(arg_4, arg_8);
@@ -876,7 +876,7 @@ int32 Insane::weaponMaxRange(int32 actornum) {
if (_actor[actornum].weapon == -1)
return 104;
-
+
return map[_actor[actornum].weapon];
}
@@ -885,7 +885,7 @@ int32 Insane::weaponMinRange(int32 actornum) {
if (_actor[actornum].weapon == -1)
return 40;
-
+
return map[_actor[actornum].weapon];
}
@@ -894,7 +894,7 @@ int32 Insane::weaponDamage(int32 actornum) {
if (_actor[actornum].weapon == -1)
return 10;
-
+
return map[_actor[actornum].weapon];
}
@@ -932,7 +932,7 @@ int Insane::calcTilt(int speed) {
const int tilt[7] = {-5, -4, -2, 0, 2, 4, 5};
if (speed + 3 > 6)
return 0;
-
+
return tilt[speed + 3];
}
@@ -942,7 +942,7 @@ bool Insane::actor1StateFlags(int state) {
const int spans[] = {0, 34, 39, 73, 89, 90, 92, 93, 99, 100, 117};
bool retvalue = 0;
unsigned int i;
-
+
for (i = 0; i < sizeof(spans); i++) {
retvalue = !retvalue;
if (spans[i] <= state)
@@ -975,7 +975,7 @@ void Insane::escapeKeyHandler(void) {
break;
case 2:
flu = &_fluConf[14 + _iactSceneId2];
- queueSceneSwitch(flu->sceneId, *flu->fluPtr, flu->filenamePtr, 64, 0,
+ queueSceneSwitch(flu->sceneId, *flu->fluPtr, flu->filenamePtr, 64, 0,
flu->startFrame, flu->numFrames);
break;
case 3:
@@ -984,7 +984,7 @@ void Insane::escapeKeyHandler(void) {
case 4:
if (_needSceneSwitch)
return;
-
+
if (readArray(6)) {
if (readArray(4)) {
queueSceneSwitch(14, 0, "hitdust2.san", 64, 0, 0, 0);
@@ -1026,12 +1026,12 @@ void Insane::escapeKeyHandler(void) {
break;
case 8:
flu = &_fluConf[7 + _iactSceneId2];
- queueSceneSwitch(flu->sceneId, *flu->fluPtr, flu->filenamePtr, 64, 0,
+ queueSceneSwitch(flu->sceneId, *flu->fluPtr, flu->filenamePtr, 64, 0,
flu->startFrame, flu->numFrames);
break;
case 7:
flu = &_fluConf[0 + _iactSceneId2];
- queueSceneSwitch(flu->sceneId, *flu->fluPtr, flu->filenamePtr, 64, 0,
+ queueSceneSwitch(flu->sceneId, *flu->fluPtr, flu->filenamePtr, 64, 0,
flu->startFrame, flu->numFrames);
break;
case 23:
@@ -1080,7 +1080,7 @@ bool Insane::actor0StateFlags1(int state) {
const int spans[] = {0, 2, 34, 35, 39, 69, 98, 100, 117};
bool retvalue = 1;
unsigned int i;
-
+
for (i = 0; i < sizeof(spans); i++) {
retvalue = !retvalue;
if (spans[i] >= state)
@@ -1100,7 +1100,7 @@ bool Insane::actor0StateFlags2(int state) {
866, 867, 872, 920, 922, 923, 926, 927, 931, 933, 950};
bool retvalue = 1;
unsigned int i;
-
+
for (i = 0; i < sizeof(spans); i++) {
retvalue = !retvalue;
if (spans[i] >= state)
@@ -1112,22 +1112,22 @@ bool Insane::actor0StateFlags2(int state) {
// smlayer_loadSound1 && smlayer_loadSound2
int Insane::smlayer_loadSound(int id, int flag, int phase) {
int resid;
-
+
if (phase == 1) {
if (_idx2Exceeded != 0)
if (_objArray2Idx >= _objArray2Idx2)
return 0;
}
resid = readArray(id);
-
+
if (!resid && phase == 2)
return 0;
-
+
if (phase == 2)
_vm->ensureResourceLoaded(rtSound, resid);
-
+
_vm->res.setResourceCounter(rtSound, resid, 1);
-
+
if (phase == 1) {
_objArray2Idx2++;
_objArray2[_objArray2Idx2] = id;
@@ -1143,22 +1143,22 @@ int Insane::smlayer_loadSound(int id, int flag, int phase) {
int Insane::smlayer_loadCostume(int id, int phase) {
int resid;
resid = readArray(id);
-
+
if (!resid)
return 0;
-
+
_vm->ensureResourceLoaded(rtCostume, resid);
_vm->res.setResourceCounter(rtCostume, resid, 1);
-
+
// smlayer_lock(rtCostume, resid); // FIXME
-
+
if (phase == 1) {
_objArray1Idx2++;
_objArray1[_objArray1Idx2] = id;
if (_objArray1Idx2 == 100)
_objArray1Idx2 = 0;
}
-
+
return resid;
}
@@ -1219,8 +1219,8 @@ void Insane::smlayer_soundSetPriority(int32 soundId, int32 priority) {
_vm->_imuseDigital->setPriority(soundId, priority);
}
-void Insane::smlayer_drawSomething(byte *renderBitmap, int32 codecparam,
- int32 x, int32 y, int32 arg_10, NutRenderer *nutfile,
+void Insane::smlayer_drawSomething(byte *renderBitmap, int32 codecparam,
+ int32 x, int32 y, int32 arg_10, NutRenderer *nutfile,
int32 c, int32 arg_1C, int32 arg_20) {
nutfile->drawFrame(renderBitmap, c, x, y);
}
@@ -1231,8 +1231,8 @@ void Insane::smlayer_overrideDrawActorAt(byte *arg_0, byte arg_4, byte arg_8) {
// noop in current implementation
}
-void Insane::smlayer_showStatusMsg(int32 arg_0, byte *renderBitmap, int32 codecparam,
- int32 pos_x, int32 pos_y, int32 arg_14, int32 arg_18,
+void Insane::smlayer_showStatusMsg(int32 arg_0, byte *renderBitmap, int32 codecparam,
+ int32 pos_x, int32 pos_y, int32 arg_14, int32 arg_18,
int32 flags, const char *formatString, const char *strng) {
SmushFont *sf = _player->_sf[0];
int color = 1;
@@ -1255,7 +1255,7 @@ void Insane::smlayer_showStatusMsg(int32 arg_0, byte *renderBitmap, int32 codecp
{
int id = str[3] - '0';
str += 4;
- sf = _player->_sf[id];
+ sf = _player->_sf[id];
}
break;
case 'c':
@@ -1278,7 +1278,7 @@ void Insane::smlayer_showStatusMsg(int32 arg_0, byte *renderBitmap, int32 codecp
// bit 2 - ??? 4
// bit 3 - wrap around 8
switch (flags) {
- case 0:
+ case 0:
sf->drawString(str, renderBitmap, _player->_width, _player->_height, pos_x, pos_y, false);
break;
case 1:
@@ -1358,11 +1358,11 @@ const char *Insane::handleTrsTag(int32 trsId) {
bool Insane::smush_eitherNotStartNewFrame(void) {
if (_smush_setupsan17)
return false;
-
+
if (_smush_isSanFileSetup) {
if (_smush_frameStep < 0)
return false;
-
+
if (_smush_curFrame > _smush_frameStep + _smush_frameNum2)
return true;
else
@@ -1370,7 +1370,7 @@ bool Insane::smush_eitherNotStartNewFrame(void) {
} else {
if (_smush_frameNum1 < 0)
return false;
-
+
if (_smush_curFrame >= _smush_frameNum1) {
_smush_frameNum1 = -1;
return false;
@@ -1397,23 +1397,23 @@ void Insane::writeArray(int item, int value) {
_vm->writeArray(_numberArray, 0, item, value);
}
-int32 Insane::smush_setupSanWithFlu(const char *filename, int32 setupsan2, int32 step1,
- int32 step2, int32 setupsan1, byte *fluPtr,
+int32 Insane::smush_setupSanWithFlu(const char *filename, int32 setupsan2, int32 step1,
+ int32 step2, int32 setupsan1, byte *fluPtr,
int32 numFrames) {
byte *tmp = fluPtr;
int32 offset;
-
+
debugC(DEBUG_INSANE, "smush_setupSanWithFlu(%s, %d, %d, %d, %d, %p, %d)", filename, setupsan2,
step1, step2, setupsan1, fluPtr, numFrames);
_smush_setupsan1 = setupsan1;
-
+
/* skip FLUP marker */
if (READ_BE_UINT32(fluPtr) == 'FLUP')
tmp += 8;
_smush_setupsan2 = setupsan2;
-
+
if (tmp[2] <= 1) {
/* 0x300 -- palette, 0x8 -- header */
offset = READ_LE_UINT32(tmp + 0x308 + numFrames*4);
@@ -1439,7 +1439,7 @@ int32 Insane::smush_setupSanWithFlu(const char *filename, int32 setupsan2, int32
return offset;
}
-void Insane::smush_setupSanFromStart(const char *filename, int32 setupsan2, int32 step1,
+void Insane::smush_setupSanFromStart(const char *filename, int32 setupsan2, int32 step1,
int32 step2, int32 setupsan1) {
debugC(DEBUG_INSANE, "Insane::smush_setupFromStart(%s)", filename);
_smush_setupsan1 = setupsan1;
diff --git a/scumm/insane/insane.h b/scumm/insane/insane.h
index 7e422d81ad..9087c1f4a9 100644
--- a/scumm/insane/insane.h
+++ b/scumm/insane/insane.h
@@ -68,13 +68,13 @@ class Insane {
void escapeKeyHandler(void);
private:
-
+
ScummEngine_v6 *_vm;
SmushPlayer *_player;
-
+
int32 _speed;
bool _insaneIsRunning;
-
+
int32 _numberArray;
int32 _emulTimerId;
int32 _emulateInterrupt;
@@ -193,9 +193,9 @@ class Insane {
int32 maxframe;
int32 apprAnim;
};
-
+
struct enemy _enemy[9];
-
+
struct fluConf {
int sceneId;
byte **fluPtr;
@@ -228,7 +228,7 @@ class Insane {
int32 tilt;
int32 frame;
};
-
+
struct actor {
int32 damage;
int32 maxdamage;
@@ -264,7 +264,7 @@ class Insane {
void initvars(void);
void readFileToMem(const char *name, byte **buf);
- void startVideo(const char *filename, int num, int argC, int frameRate,
+ void startVideo(const char *filename, int num, int argC, int frameRate,
int doMainLoop, byte *fluPtr = 0, int32 startFrame = 0);
void smush_warpMouse(int x, int y, int buttons);
void putActors(void);
@@ -330,7 +330,7 @@ class Insane {
int32 setupsan13, int32 curFrame, int32 maxFrame);
void switchSceneIfNeeded(void);
int smush_changeState(int state);
- void init_actStruct(int actornum, int actnum, int32 actorval, byte state,
+ void init_actStruct(int actornum, int actnum, int32 actorval, byte state,
int32 room, int32 animtilt, int32 tilt, int32 frame);
void init_enemyStruct(int n, int32 handler, int32 initializer,
int16 occurences, int32 maxdamage, int32 isEmpty,
@@ -363,18 +363,18 @@ class Insane {
bool smlayer_startVoice(int32 sound);
void smlayer_soundSetPan(int32 sound, int32 pan);
void smlayer_soundSetPriority(int32 sound, int32 priority);
- void smlayer_drawSomething(byte *renderBitmap, int32 codecparam,
- int32 arg_8, int32 arg_C, int32 arg_10, NutRenderer *nutfileptr,
+ void smlayer_drawSomething(byte *renderBitmap, int32 codecparam,
+ int32 arg_8, int32 arg_C, int32 arg_10, NutRenderer *nutfileptr,
int32 arg_18, int32 arg_1C, int32 arg_20);
void smlayer_overrideDrawActorAt(byte *, byte, byte);
- void queueSceneSwitch(int32 sceneId, byte *fluPtr, const char *filename,
+ void queueSceneSwitch(int32 sceneId, byte *fluPtr, const char *filename,
int32 arg_C, int32 arg_10, int32 startFrame, int32 numFrames);
void turnBen(bool battle);
void smush_rewindCurrentSan(int arg_0, int arg_4, int arg_8);
- void smlayer_showStatusMsg(int32 arg_0, byte *renderBitmap, int32 codecparam,
- int32 x, int32 y, int32 arg_14, int32 arg_18,
+ void smlayer_showStatusMsg(int32 arg_0, byte *renderBitmap, int32 codecparam,
+ int32 x, int32 y, int32 arg_14, int32 arg_18,
int32 arg_1C, const char *formatString, const char *str);
- void init_fluConfStruct(int n, int sceneId, byte **fluPtr,
+ void init_fluConfStruct(int n, int sceneId, byte **fluPtr,
const char *filenamePtr, int startFrame, int numFrames);
int32 processBenOnRoad(bool flag);
void mineChooseRoad(int32 arg_0);
@@ -409,9 +409,9 @@ class Insane {
void reinitActors(void);
const char *handleTrsTag(int32 trsId);
void ouchSoundBen(void);
- int32 smush_setupSanWithFlu(const char *filename, int32 setupsan2, int32 step1,
+ int32 smush_setupSanWithFlu(const char *filename, int32 setupsan2, int32 step1,
int32 step2, int32 setupsan1, byte *fluPtr, int32 numFrames);
- void smush_setupSanFromStart(const char *filename, int32 setupsan2, int32 step1,
+ void smush_setupSanFromStart(const char *filename, int32 setupsan2, int32 step1,
int32 step2, int32 setupsan1);
void smush_setFrameSteps(int32 step1, int32 step2);
void smush_setupSanFile(const char *filename, int32 offset, int32 contFrame);
diff --git a/scumm/insane/insane_ben.cpp b/scumm/insane/insane_ben.cpp
index 1184be452a..e5a59f2a14 100644
--- a/scumm/insane/insane_ben.cpp
+++ b/scumm/insane/insane_ben.cpp
@@ -33,7 +33,7 @@ int32 Insane::enemyBenHandler(int32 actor1, int32 actor2, int32 probability) {
int32 tmp;
retval = processMouse();
-
+
// Joystick support is skipped
retval |= processKeyboard();
@@ -48,13 +48,13 @@ int32 Insane::enemyBenHandler(int32 actor1, int32 actor2, int32 probability) {
_actor[actor1].cursorX = tmp;
smush_warpMouse(_enemyState[EN_BEN][0], _enemyState[EN_BEN][1], -1);
-
+
return (retval & 3);
}
void Insane::turnBen(bool controllable) {
int32 buttons;
-
+
switch (_currSceneId) {
case 21:
case 25:
@@ -70,7 +70,7 @@ void Insane::turnBen(bool controllable) {
_actor[0].act[1].room = 0;
_actor[0].act[0].state = 36;
_actor[0].act[0].room = 0;
-
+
if (smlayer_isSoundRunning(95))
smlayer_stopSound(95);
}
@@ -83,7 +83,7 @@ void Insane::turnBen(bool controllable) {
if (_currEnemy == EN_TORQUE)
buttons = 0;
}
- debug(5, "00:%d 01:%d 02:%d 03:%d", _actor[0].act[0].state,
+ debug(5, "00:%d 01:%d 02:%d 03:%d", _actor[0].act[0].state,
_actor[0].act[1].state, _actor[0].act[2].state, _actor[0].act[3].state);
actor01Reaction(buttons);
actor02Reaction(buttons);
@@ -176,7 +176,7 @@ int32 Insane::actionBen(void) {
} else {
if (smlayer_isSoundRunning(sound))
smlayer_stopSound(sound);
-
+
_val213d = 0;
}
} else {
@@ -256,7 +256,7 @@ void Insane::mineChooseRoad(int32 buttons) {
queueSceneSwitch(2, 0, "mineexit.san", 64, 0, 0, 0);
}
}
-
+
if ((buttons & 2) == 0 || _needSceneSwitch)
return;
@@ -292,9 +292,9 @@ void Insane::mineChooseRoad(int32 buttons) {
_actor[0].tilt = -7;
if (tmp > 7)
_actor[0].tilt = 7;
-
+
drawSpeedyActor(buttons);
-
+
if ((buttons & 1) == 0)
return;
@@ -308,7 +308,7 @@ void Insane::mineChooseRoad(int32 buttons) {
queueSceneSwitch(8, 0, "tomine.san", 64, 0, 0, 0);
}
}
-
+
if (_roadStop) {
writeArray(1, _posBrokenTruck);
writeArray(3, _val57d);
@@ -331,7 +331,7 @@ void Insane::mineChooseRoad(int32 buttons) {
_actor[0].tilt = 7;
drawSpeedyActor(buttons);
-
+
if ((buttons & 1) == 0)
return;
@@ -345,7 +345,7 @@ void Insane::mineChooseRoad(int32 buttons) {
queueSceneSwitch(7, 0, "tomine.san", 64, 0, 0, 0);
}
}
-
+
if (_roadStop) {
writeArray(1, _posBrokenTruck);
writeArray(3, _posVista);
@@ -499,7 +499,7 @@ int32 Insane::calcBenDamage(bool arg_0, bool arg_4) {
// Ben
void Insane::actor02Reaction(int32 buttons) {
int32 tmp, tmp2;
-
+
switch(_actor[0].act[2].state) {
case 1:
smlayer_setActorLayer(0, 2, 5);
@@ -585,7 +585,7 @@ void Insane::actor02Reaction(int32 buttons) {
smlayer_setActorFacing(0, 2, 20, 180);
_actor[0].act[2].state = 4;
}
-
+
_actor[0].kicking = true;
_actor[0].act[2].tilt = calcTilt(_actor[0].tilt);
break;
@@ -725,7 +725,7 @@ void Insane::actor02Reaction(int32 buttons) {
(_actor[1].x - _actor[0].x >= weaponMinRange(0)) &&
!_actor[0].field_54)
prepareScenePropScene(1, 0, 0);
-
+
}
smlayer_setActorFacing(0, 2, 21, 180);
_actor[0].act[2].state = 13;
@@ -766,7 +766,7 @@ void Insane::actor02Reaction(int32 buttons) {
smlayer_setActorFacing(0, 2, 20, 180);
_actor[0].act[2].state = 16;
}
- break;
+ break;
case INV_MACE:
if (!_actor[1].kicking || _actor[1].field_44)
if (actor1StateFlags(_actor[1].act[2].state)) {
@@ -1153,7 +1153,7 @@ void Insane::actor02Reaction(int32 buttons) {
case 34:
smlayer_setActorLayer(0, 2, 5);
_actor[0].kicking = false;
-
+
if (!smlayer_actorNeedRedraw(0, 2)) {
setBenState();
_actor[0].act[2].tilt = 0;
@@ -1165,7 +1165,7 @@ void Insane::actor02Reaction(int32 buttons) {
case 35:
smlayer_setActorLayer(0, 2, 5);
_actor[0].kicking = false;
-
+
if (!smlayer_actorNeedRedraw(0, 2)) {
switchBenWeapon();
_actor[0].act[2].tilt = 0;
@@ -1211,7 +1211,7 @@ void Insane::actor02Reaction(int32 buttons) {
smlayer_setActorLayer(0, 2, 25);
_actor[0].cursorX = 0;
_actor[0].kicking = false;
- if (_actor[0].act[2].frame >= 18 ||
+ if (_actor[0].act[2].frame >= 18 ||
(_actor[0].x < 50 && _actor[0].act[2].frame >= 10) ||
(_actor[0].x > 270 && _actor[0].act[2].frame >= 10)) {
if (_currSceneId == 21) {
@@ -1631,7 +1631,7 @@ void Insane::actor01Reaction(int32 buttons) {
setBenAnimation(0, 6);
_actor[0].act[1].state = 41;
}
-
+
if (_actor[0].cursorX >= -100) {
setBenAnimation(0, 7);
_actor[0].act[1].state = 40;
@@ -1654,7 +1654,7 @@ void Insane::actor01Reaction(int32 buttons) {
setBenAnimation(0, 8);
_actor[0].act[1].state = 39;
}
-
+
if (_actor[0].field_8 == 48)
_actor[0].tilt = 0;
else
@@ -1705,7 +1705,7 @@ void Insane::actor01Reaction(int32 buttons) {
setBenAnimation(0, 12);
_actor[0].act[1].state = 57;
}
-
+
if (_actor[0].cursorX <= 100) {
setBenAnimation(0, 11);
_actor[0].act[1].state = 56;
@@ -1714,7 +1714,7 @@ void Insane::actor01Reaction(int32 buttons) {
}
break;
}
-
+
if (_actor[0].field_38 != _actor[0].field_34) {
if (_actor[0].field_34 == 2)
smlayer_setActorFacing(0, 1, 28, 180);
@@ -1727,7 +1727,7 @@ void Insane::actor01Reaction(int32 buttons) {
if (_actor[0].act[1].room)
smlayer_putActor(0, 1, tmpx, tmpy, _smlayer_room2);
- else
+ else
smlayer_putActor(0, 1, tmpx, tmpy, _smlayer_room);
_actor[0].animWeaponClass = _actor[0].weaponClass;
@@ -1744,7 +1744,7 @@ void Insane::actor03Reaction(int32 buttons) {
case 52:
if (_actor[0].runningSound)
smlayer_stopSound(_actor[0].runningSound);
-
+
if (_currScenePropIdx)
shutCurrentScene();
@@ -1877,7 +1877,7 @@ void Insane::chooseBenWeaponAnim(int buttons) {
_actor[0].act[2].state = 0;
switchBenWeapon();
}
-
+
_weaponBenJustSwitched = true;
} else {
_weaponBenJustSwitched = false;
diff --git a/scumm/insane/insane_enemy.cpp b/scumm/insane/insane_enemy.cpp
index dadaba995c..42f9314c1a 100644
--- a/scumm/insane/insane_enemy.cpp
+++ b/scumm/insane/insane_enemy.cpp
@@ -114,7 +114,7 @@ int32 Insane::enemy0handler(int32 actor1, int32 actor2, int32 probability) {
act2damage = _actor[actor2].damage; // ebp
act1x = _actor[actor1].x; // esi
act2x = _actor[actor2].x; // edi
-
+
if (!_actor[actor1].defunct) {
if (_enHdlVar[EN_ROTT1][1] > _enHdlVar[EN_ROTT1][2]) {
if (act1damage - act2damage >= 30) {
@@ -278,7 +278,7 @@ int32 Insane::enemy1handler(int32 actor1, int32 actor2, int32 probability) {
act2damage = _actor[actor2].damage; // ebp
act1x = _actor[actor1].x; // esi
act2x = _actor[actor2].x; // edi
-
+
if (!_actor[actor1].defunct) {
if (_enHdlVar[EN_ROTT2][1] > _enHdlVar[EN_ROTT2][2]) {
if (act1damage - act2damage >= 30) {
@@ -572,7 +572,7 @@ int32 Insane::enemy3handler(int32 actor1, int32 actor2, int32 probability) {
act2damage = _actor[actor2].damage; // ebp
act1x = _actor[actor1].x; // esi
act2x = _actor[actor2].x; // edi
-
+
if (!_actor[actor1].defunct) {
if (_enHdlVar[EN_VULTF1][1] > _enHdlVar[EN_VULTF1][2]) {
if ((act1damage - act2damage >= 30) && (_vm->_rnd.getRandomNumber(probability - 1) != 1))
@@ -680,7 +680,7 @@ int32 Insane::enemy3handler(int32 actor1, int32 actor2, int32 probability) {
}
_enHdlVar[EN_VULTF1][7] = _enHdlVar[EN_VULTF1][8];
}
-
+
}
_enHdlVar[EN_VULTF1][1]++;
_enHdlVar[EN_VULTF1][3]++;
@@ -898,7 +898,7 @@ int32 Insane::enemy5handler(int32 actor1, int32 actor2, int32 probability) {
act1damage = _actor[actor1].damage; // ebx
act1x = _actor[actor1].x; // esi
act2x = _actor[actor2].x; // ebp
-
+
dist = ABS(act1x - act2x);
if (weaponMaxRange(actor1) >= dist) {
@@ -1203,7 +1203,7 @@ int32 Insane::enemy7handler(int32 actor1, int32 actor2, int32 probability) {
goto _labelA;
}
}
-
+
if (weaponMaxRange(actor1) <= dist) {
if (act2x < act1x)
_actor[actor1].cursorX = -101;
@@ -1358,7 +1358,7 @@ void Insane::turnEnemy(bool battle) {
if (battle)
buttons = actionEnemy();
- debug(5, "11:%d 12:%d 13:%d 10:%d", _actor[1].act[1].state,
+ debug(5, "11:%d 12:%d 13:%d 10:%d", _actor[1].act[1].state,
_actor[1].act[2].state, _actor[1].act[3].state, _actor[1].act[0].state);
actor11Reaction(buttons);
actor12Reaction(buttons);
@@ -1377,7 +1377,7 @@ void Insane::actor11Reaction(int32 buttons) {
setEnemyAnimation(1, 6);
_actor[1].act[1].state = 41;
}
-
+
if (_actor[1].cursorX >= -100) {
setEnemyAnimation(1, 7);
_actor[1].act[1].state = 40;
@@ -1404,7 +1404,7 @@ void Insane::actor11Reaction(int32 buttons) {
setEnemyAnimation(1, 8);
_actor[1].act[1].state = 39;
}
-
+
if (_actor[1].field_8 == 48)
_actor[1].tilt = 0;
else
@@ -1461,7 +1461,7 @@ void Insane::actor11Reaction(int32 buttons) {
setEnemyAnimation(1, 12);
_actor[1].act[1].state = 57;
}
-
+
if (_actor[1].cursorX <= 100) {
setEnemyAnimation(1, 11);
_actor[1].act[1].state = 56;
@@ -1472,13 +1472,13 @@ void Insane::actor11Reaction(int32 buttons) {
_actor[1].x += _actor[1].cursorX / 32;
break;
}
-
+
tmpx = _actor[1].x;
tmpy = _actor[1].y + _actor[1].y1;
if (_actor[1].act[1].room)
smlayer_putActor(1, 1, tmpx, tmpy, _smlayer_room2);
- else
+ else
smlayer_putActor(1, 1, tmpx, tmpy, _smlayer_room);
_actor[1].animWeaponClass = _actor[1].weaponClass;
@@ -1545,7 +1545,7 @@ void Insane::chooseEnemyWeaponAnim(int32 buttons) {
default:
switchEnemyWeapon();
}
-
+
_weaponEnemyJustSwitched = true;
} else {
_weaponEnemyJustSwitched = false;
@@ -1599,7 +1599,7 @@ void Insane::setEnemyState(void) {
_actor[1].act[2].state = 98;
else
_actor[1].act[2].state = 99;
-
+
return;
}
@@ -1818,7 +1818,7 @@ void Insane::actor12Reaction(int32 buttons) {
smlayer_setActorFacing(1, 2, 20, 180);
_actor[1].act[2].state = 16;
}
- break;
+ break;
default:
smlayer_setActorFacing(1, 2, 20, 180);
_actor[1].act[2].state = 16;
@@ -1986,7 +1986,7 @@ void Insane::actor12Reaction(int32 buttons) {
} else {
smlayer_setActorFacing(1, 2, 20, 180);
_actor[1].act[2].state = 24;
-
+
if (!_actor[1].field_54)
smlayer_startSfx(246);
}
@@ -2080,7 +2080,7 @@ void Insane::actor12Reaction(int32 buttons) {
case 34:
smlayer_setActorLayer(1, 2, 5);
_actor[1].kicking = false;
-
+
if (!smlayer_actorNeedRedraw(1, 2)) {
setEnemyState();
_actor[1].act[2].tilt = 0;
@@ -2092,7 +2092,7 @@ void Insane::actor12Reaction(int32 buttons) {
case 35:
smlayer_setActorLayer(1, 2, 5);
_actor[1].kicking = false;
-
+
if (!smlayer_actorNeedRedraw(1, 2)) {
switchEnemyWeapon();
_actor[1].act[2].tilt = 0;
@@ -2400,7 +2400,7 @@ void Insane::actor12Reaction(int32 buttons) {
smlayer_setActorLayer(1, 2, 4);
_actor[1].kicking = false;
if (_actor[1].act[2].frame >= 19) {
- queueSceneSwitch(1, _smush_minedrivFlu, "minedriv.san", 64, 0,
+ queueSceneSwitch(1, _smush_minedrivFlu, "minedriv.san", 64, 0,
_continueFrame1, 1300);
_actor[1].act[2].state = 96;
}
@@ -2464,7 +2464,7 @@ void Insane::actor12Reaction(int32 buttons) {
_actor[1].act[2].state = 103;
case 103:
_actor[1].kicking = false;
-
+
if (_actor[1].act[2].frame >= 18 || ((_actor[1].x < 50 || _actor[1].x > 270) &&
_actor[1].act[2].frame >= 9)) {
_enemy[EN_CAVEFISH].isEmpty = 1;
@@ -2541,7 +2541,7 @@ void Insane::actor12Reaction(int32 buttons) {
case 114:
smlayer_setActorLayer(1, 2, 25);
_actor[1].kicking = false;
-
+
if (_actor[1].act[2].frame >= 16 || ((_actor[1].x < 50 || _actor[1].x > 270)
&& (_actor[1].act[2].frame >= 8))) {
queueSceneSwitch(11, 0, _enemy[_currEnemy].filename, 64, 0, 0, 0);
@@ -2563,7 +2563,7 @@ void Insane::actor12Reaction(int32 buttons) {
case 116:
smlayer_setActorLayer(1, 2, 25);
_actor[1].kicking = false;
-
+
if (_actor[1].act[2].frame >= 17 || ((_actor[1].x < 50 || _actor[1].x > 270)
&& _actor[1].act[2].frame >= 8)) {
queueSceneSwitch(11, 0, _enemy[_currEnemy].filename, 64, 0, 0, 0);
@@ -2621,7 +2621,7 @@ void Insane::actor13Reaction(int32 buttons) {
case 52:
if (_actor[1].runningSound)
smlayer_stopSound(_actor[1].runningSound);
-
+
if (_currScenePropIdx)
shutCurrentScene();
@@ -2794,7 +2794,7 @@ int32 Insane::actionEnemy(void) {
if (_actor[0].x + 90 > _actor[1].x)
_actor[1].x = _actor[0].x + 90;
}
-
+
if (_actor[1].x < 0) {
_actor[1].x = 0;
_actor[1].x1 = -_actor[1].x1;
diff --git a/scumm/insane/insane_iact.cpp b/scumm/insane/insane_iact.cpp
index be341967fa..0909f1c7bc 100644
--- a/scumm/insane/insane_iact.cpp
+++ b/scumm/insane/insane_iact.cpp
@@ -118,7 +118,7 @@ void Insane::iactScene1(byte *renderBitmap, int32 codecparam, int32 setupsan12,
par11 = b.getWord(); // +20 cx
tmp = b.getWord(); // +22
par13 = b.getWord(); // +24 ax
-
+
if (par13 > _actor[0].x || par11 < _actor[0].x) {
_tiresRustle = true;
_actor[0].x1 = -_actor[0].x1;
@@ -133,12 +133,12 @@ void Insane::iactScene1(byte *renderBitmap, int32 codecparam, int32 setupsan12,
case 6:
switch (par2) {
case 38:
- smlayer_drawSomething(renderBitmap, codecparam, 50-19, 20-13, 3,
+ smlayer_drawSomething(renderBitmap, codecparam, 50-19, 20-13, 3,
_smush_iconsNut, 7, 0, 0);
_roadBranch = true;
_iactSceneId = par4;
break;
- case 25:
+ case 25:
_roadBumps = true;
_actor[0].y1 = -_actor[0].y1;
break;
@@ -177,7 +177,7 @@ void Insane::iactScene1(byte *renderBitmap, int32 codecparam, int32 setupsan12,
if (_approachAnim < 0 || _approachAnim > 4)
if (readArray(8)) {
- smlayer_drawSomething(renderBitmap, codecparam, 270-19, 20-18, 3,
+ smlayer_drawSomething(renderBitmap, codecparam, 270-19, 20-18, 3,
_smush_iconsNut, 20, 0, 0);
_benHasGoggles = true;
}
@@ -232,7 +232,7 @@ void Insane::chooseEnemy(void) {
}
if (!notfound) {
continue;
- }
+ }
} else {
j = 0;
do {
@@ -250,11 +250,11 @@ void Insane::chooseEnemy(void) {
} while (j < 9 && !notfound);
if (!notfound) {
_metEnemiesListTail = 0;
- count = 0;
+ count = 0;
continue;
}
}
-
+
++_metEnemiesListTail;
assert(_metEnemiesListTail < ARRAYSIZE(_metEnemiesList));
_metEnemiesList[_metEnemiesListTail] = en2;
@@ -362,8 +362,8 @@ void Insane::iactScene4(byte *renderBitmap, int32 codecparam, int32 setupsan12,
case 6:
switch (par2) {
case 38:
-
- smlayer_drawSomething(renderBitmap, codecparam, 270-19, 20-13, 3,
+
+ smlayer_drawSomething(renderBitmap, codecparam, 270-19, 20-13, 3,
_smush_icons2Nut, 10, 0, 0);
_roadBranch = true;
_iactSceneId = par4;
@@ -385,16 +385,16 @@ void Insane::iactScene4(byte *renderBitmap, int32 codecparam, int32 setupsan12,
smush_setToFinish();
break;
- case 25:
+ case 25:
if (readArray(5) == 0)
return;
-
+
_carIsBroken = true;
smlayer_drawSomething(renderBitmap, codecparam, 160-13, 20-10, 3, // QW
_smush_icons2Nut, 8, 0, 0);
break;
case 11:
- smlayer_drawSomething(renderBitmap, codecparam, 50-19, 20-13, 3,
+ smlayer_drawSomething(renderBitmap, codecparam, 50-19, 20-13, 3,
_smush_icons2Nut, 9, 0, 0);
_roadBranch = true;
_iactSceneId = par4;
@@ -454,7 +454,7 @@ void Insane::iactScene6(byte *renderBitmap, int32 codecparam, int32 setupsan12,
case 6:
switch (par2) {
case 38:
- smlayer_drawSomething(renderBitmap, codecparam, 270-19, 20-13, 3,
+ smlayer_drawSomething(renderBitmap, codecparam, 270-19, 20-13, 3,
_smush_icons2Nut, 10, 0, 0);
_roadBranch = true;
_iactSceneId = par4;
@@ -476,16 +476,16 @@ void Insane::iactScene6(byte *renderBitmap, int32 codecparam, int32 setupsan12,
smush_setToFinish();
break;
- case 25:
+ case 25:
if (readArray(5) == 0)
return;
-
+
_carIsBroken = true;
smlayer_drawSomething(renderBitmap, codecparam, 160-13, 20-10, 3, //QW
_smush_icons2Nut, 8, 0, 0);
break;
case 11:
- smlayer_drawSomething(renderBitmap, codecparam, 50-19, 20-13, 3,
+ smlayer_drawSomething(renderBitmap, codecparam, 50-19, 20-13, 3,
_smush_icons2Nut, 9, 0, 0);
_roadBranch = true;
_iactSceneId = par4;
@@ -517,7 +517,7 @@ void Insane::iactScene17(byte *renderBitmap, int32 codecparam, int32 setupsan12,
case 6:
switch (par2) {
case 38:
- smlayer_drawSomething(renderBitmap, codecparam, 28, 48, 1,
+ smlayer_drawSomething(renderBitmap, codecparam, 28, 48, 1,
_smush_iconsNut, 6, 0, 0);
_roadBranch = true;
_iactSceneId = par4;
@@ -531,7 +531,7 @@ void Insane::iactScene17(byte *renderBitmap, int32 codecparam, int32 setupsan12,
_objectDetected = true;
break;
case 10:
- smlayer_drawSomething(renderBitmap, codecparam, 28, 48, 1,
+ smlayer_drawSomething(renderBitmap, codecparam, 28, 48, 1,
_smush_iconsNut, 6, 0, 0);
if (_counter1 <= 4) {
if (_counter1 == 4)
diff --git a/scumm/insane/insane_scenes.cpp b/scumm/insane/insane_scenes.cpp
index 21806eed94..cb32a2aee6 100644
--- a/scumm/insane/insane_scenes.cpp
+++ b/scumm/insane/insane_scenes.cpp
@@ -164,7 +164,7 @@ void Insane::runScene(int arraynum) {
}
// insane_unlock(); // FIXME
_vm->_sound->stopAllSounds(); // IMUSE_StopAllSounds();
-
+
delete _player;
}
@@ -223,14 +223,14 @@ void Insane::stopSceneSounds(int sceneId) {
if (_actor[0].runningSound != 0)
smlayer_stopSound(_actor[0].runningSound);
_actor[0].runningSound = 0;
-
+
if (_actor[1].runningSound != 0)
smlayer_stopSound(_actor[1].runningSound);
_actor[1].runningSound = 0;
-
+
if (_currScenePropIdx != 0)
shutCurrentScene();
-
+
_currScenePropSubIdx = 0;
_currTrsMsg = 0;
_actor[0].defunct = 0;
@@ -283,7 +283,7 @@ void Insane::stopSceneSounds(int sceneId) {
smlayer_setActorCostume(1, 2, 0);
smlayer_setActorCostume(1, 0, 0);
smlayer_setActorCostume(1, 1, 0);
-
+
return;
}
@@ -295,7 +295,7 @@ void Insane::shutCurrentScene(void) {
_currScenePropSubIdx = 0;
_actor[1].scenePropSubIdx = 0;
_actor[1].defunct = 0;
-
+
if (_actor[1].runningSound != 0) {
smlayer_stopSound(_actor[1].runningSound);
_actor[1].runningSound = 0;
@@ -684,7 +684,7 @@ void Insane::setEnemyCostumes(void) {
smlayer_putActor(0, 2, _actor[0].x+11, _actor[0].y1+102, _smlayer_room2);
smlayer_putActor(0, 1, _actor[0].x, _actor[0].y1+200, _smlayer_room2);
smlayer_putActor(0, 0, _actor[0].x, _actor[0].y1+200, _smlayer_room2);
-
+
if (_currEnemy == EN_CAVEFISH) {
smlayer_setActorCostume(1, 2, readArray(_enemy[_currEnemy].costume4));
_actor[1].act[2].room = 1;
@@ -695,8 +695,8 @@ void Insane::setEnemyCostumes(void) {
_actor[1].act[2].state = 98;
_actor[1].act[0].state = 98;
_actor[1].act[1].state = 98;
-
- smlayer_putActor(1, 2, _actor[1].x + _actor[1].act[2].tilt - 17,
+
+ smlayer_putActor(1, 2, _actor[1].x + _actor[1].act[2].tilt - 17,
_actor[1].y + _actor[1].y1 - 98, _smlayer_room2);
} else if (_currEnemy == EN_TORQUE) {
smlayer_setActorCostume(1, 2, readArray(_enemy[_currEnemy].costume4));
@@ -707,45 +707,45 @@ void Insane::setEnemyCostumes(void) {
_actor[1].act[2].state = 1;
_actor[1].act[0].state = 1;
_actor[1].act[1].state = 1;
- smlayer_putActor(1, 2, _actor[1].x + _actor[1].act[2].tilt - 17,
+ smlayer_putActor(1, 2, _actor[1].x + _actor[1].act[2].tilt - 17,
_actor[1].y + _actor[1].y1 - 98, _smlayer_room2);
} else {
_actor[1].act[2].room = 1;
_actor[1].act[1].room = 1;
_actor[1].act[0].room = 1;
-
+
if (_enemy[_currEnemy].costume4)
smlayer_setActorCostume(1, 2, readArray(_enemy[_currEnemy].costume4));
-
+
if (_enemy[_currEnemy].costume5)
smlayer_setActorCostume(1, 0, readArray(_enemy[_currEnemy].costume5));
-
+
if (_enemy[_currEnemy].costume6)
smlayer_setActorCostume(1, 1, readArray(_enemy[_currEnemy].costume6));
-
+
_actor[1].field_8 = 1;
_actor[1].act[2].state = 1;
_actor[1].act[0].state = 1;
_actor[1].act[1].state = 1;
-
+
if (_actor[1].act[2].room != 0)
- smlayer_putActor(1, 2, _actor[1].x + _actor[1].act[2].tilt - 17,
- _actor[1].y + _actor[1].y1 - 98,
+ smlayer_putActor(1, 2, _actor[1].x + _actor[1].act[2].tilt - 17,
+ _actor[1].y + _actor[1].y1 - 98,
_smlayer_room2);
}
-
+
if (_actor[1].act[1].room != 0)
smlayer_putActor(1, 1, _actor[1].x, _actor[1].y + _actor[1].y1,
_smlayer_room2);
-
+
if (_actor[1].act[0].room != 0)
- smlayer_putActor(1, 0, _actor[1].x, _actor[1].y + _actor[1].y1,
+ smlayer_putActor(1, 0, _actor[1].x, _actor[1].y + _actor[1].y1,
_smlayer_room2);
-
+
smlayer_setActorLayer(1, 1, 1);
smlayer_setActorLayer(1, 2, 5);
smlayer_setActorLayer(1, 0, 10);
-
+
_actor[1].damage = 0;
_actor[1].x = 250;
_actor[1].y = 300;
@@ -795,7 +795,7 @@ void Insane::setEnemyCostumes(void) {
_actor[1].field_44 = false;
_actor[1].field_48 = false;
if (_enemy[_currEnemy].initializer != -1)
- enemyInitializer(_enemy[_currEnemy].initializer, _actor[1].damage,
+ enemyInitializer(_enemy[_currEnemy].initializer, _actor[1].damage,
_actor[0].damage, _actor[1].probability);
smush_warpMouse(160, 100, -1);
@@ -963,7 +963,7 @@ void Insane::procPostRendering(byte *renderBitmap, int32 codecparam, int32 setup
if (_currScenePropIdx)
postCaseAll(renderBitmap, codecparam, setupsan12, setupsan13, curFrame, maxFrame);
-
+
_actor[0].frame++;
_actor[0].act[3].frame++;
_actor[0].act[2].frame++;
@@ -975,21 +975,21 @@ void Insane::procPostRendering(byte *renderBitmap, int32 codecparam, int32 setup
_actor[1].act[1].frame++;
_actor[1].act[0].frame++;
}
-
+
if (!_val115_) {
smlayer_overrideDrawActorAt(&renderBitmap[0], renderBitmap[2], renderBitmap[3]);
_isBenCut = 0;
}
-
+
if (_isBenCut)
smlayer_drawSomething(renderBitmap, codecparam, 89, 56, 1, _smush_bencutNut, 0, 0, 0);
-
+
if (!_keyboardDisable)
_vm->processActors();
-
+
if (needMore)
postCaseMore(renderBitmap, codecparam, setupsan12, setupsan13, curFrame, maxFrame);
-
+
_lastKey = 0;
_tiresRustle = false;
}
@@ -1000,7 +1000,7 @@ void Insane::postCase11(byte *renderBitmap, int32 codecparam, int32 setupsan12,
if (_firstBattle) {
smush_setToFinish();
} else {
- queueSceneSwitch(1, _smush_minedrivFlu, "minedriv.san", 64, 0,
+ queueSceneSwitch(1, _smush_minedrivFlu, "minedriv.san", 64, 0,
_continueFrame, 1300);
}
}
@@ -1011,13 +1011,13 @@ void Insane::postCase11(byte *renderBitmap, int32 codecparam, int32 setupsan12,
void Insane::postCase0(byte *renderBitmap, int32 codecparam, int32 setupsan12,
int32 setupsan13, int32 curFrame, int32 maxFrame) {
turnBen(true);
-
+
if (!curFrame || curFrame == 420)
smlayer_setFluPalette(_smush_roadrashRip, 0);
-
+
if (curFrame >= maxFrame)
smush_rewindCurrentSan(1088, -1, -1);
-
+
_roadBumps = false;
_roadBranch = false;
_roadStop = false;
@@ -1030,7 +1030,7 @@ void Insane::postCase17(byte *renderBitmap, int32 codecparam, int32 setupsan12,
int32 setupsan13, int32 curFrame, int32 maxFrame) {
if (curFrame >= maxFrame && !_needSceneSwitch) {
if (_currSceneId == 18) {
- queueSceneSwitch(17, _smush_minedrivFlu, "minedriv.san", 64, 0,
+ queueSceneSwitch(17, _smush_minedrivFlu, "minedriv.san", 64, 0,
_continueFrame1, 1300);
writeArray(9, 1);
} else {
@@ -1047,31 +1047,31 @@ void Insane::postCase16(byte *renderBitmap, int32 codecparam, int32 setupsan12,
int32 setupsan13, int32 curFrame, int32 maxFrame) {
char buf[12];
int32 tmp;
-
+
turnBen(true);
sprintf(buf, "^f01%02o", curFrame & 0x3f);
smlayer_showStatusMsg(-1, renderBitmap, codecparam, 180, 168, 1, 2, 0, "%s", buf);
tmp = 400-curFrame;
-
+
if (tmp < 0)
tmp += 1300;
-
+
sprintf(buf, "^f01%04d", tmp);
smlayer_showStatusMsg(-1, renderBitmap, codecparam, 202, 168, 1, 2, 0, "%s", buf);
-
+
sprintf(buf, "^f01%02o", curFrame & 0xff);
smlayer_showStatusMsg(-1, renderBitmap, codecparam, 240, 168, 1, 2, 0, "%s", buf);
smlayer_showStatusMsg(-1, renderBitmap, codecparam, 170, 43, 1, 2, 0, "%s", buf);
smlayer_drawSomething(renderBitmap, codecparam, 0, 0, 1, _smush_bensgoggNut, 0, 0, 0);
-
+
if (!_objectDetected)
- smlayer_drawSomething(renderBitmap, codecparam, 24, 170, 1,
+ smlayer_drawSomething(renderBitmap, codecparam, 24, 170, 1,
_smush_iconsNut, 23, 0, 0);
-
+
if (!curFrame)
smlayer_setFluPalette(_smush_goglpaltRip, 0);
-
+
if (curFrame >= maxFrame) {
smush_rewindCurrentSan(1088, -1, -1);
smlayer_setFluPalette(_smush_goglpaltRip, 0);
@@ -1093,7 +1093,7 @@ void Insane::postCase1(byte *renderBitmap, int32 codecparam, int32 setupsan12,
if ((curFrame >= maxFrame) && !_needSceneSwitch) {
flu = &_fluConf[14 + _iactSceneId2];
- queueSceneSwitch(flu->sceneId, *flu->fluPtr, flu->filenamePtr, 64, 0,
+ queueSceneSwitch(flu->sceneId, *flu->fluPtr, flu->filenamePtr, 64, 0,
flu->startFrame, flu->numFrames);
}
_roadBranch = false;
@@ -1104,7 +1104,7 @@ void Insane::postCase2(byte *renderBitmap, int32 codecparam, int32 setupsan12,
int32 setupsan13, int32 curFrame, int32 maxFrame) {
turnBen(_battleScene != 0);
turnEnemy(true);
-
+
if (!curFrame)
smlayer_setFluPalette(_smush_roadrashRip, 0);
@@ -1121,10 +1121,10 @@ void Insane::postCase20(byte *renderBitmap, int32 codecparam, int32 setupsan12,
int32 setupsan13, int32 curFrame, int32 maxFrame) {
turnBen(true);
turnEnemy(true);
-
+
if (curFrame >= maxFrame)
smush_rewindCurrentSan(1088, -1, -1);
-
+
_roadBumps = false;
_roadBranch = false;
_roadStop = false;
@@ -1204,7 +1204,7 @@ void Insane::postCase5(byte *renderBitmap, int32 codecparam, int32 setupsan12,
}
}
}
-
+
_carIsBroken = false;
_roadStop = false;
_roadBranch = false;
@@ -1221,7 +1221,7 @@ void Insane::postCase6(byte *renderBitmap, int32 codecparam, int32 setupsan12,
else
flu = &_fluConf[0 + _iactSceneId2];
- queueSceneSwitch(flu->sceneId, *flu->fluPtr, flu->filenamePtr, 64, 0,
+ queueSceneSwitch(flu->sceneId, *flu->fluPtr, flu->filenamePtr, 64, 0,
flu->startFrame, flu->numFrames);
}
_roadBranch = false;
@@ -1245,7 +1245,7 @@ void Insane::postCase8(byte *renderBitmap, int32 codecparam, int32 setupsan12,
}
}
}
-
+
_roadBranch = false;
_roadStop = false;
}
@@ -1306,7 +1306,7 @@ void Insane::postCase10(byte *renderBitmap, int32 codecparam, int32 setupsan12,
}
}
}
-
+
_roadBranch = false;
_roadStop = false;
}
diff --git a/scumm/instrument.cpp b/scumm/instrument.cpp
index 2c86c53db0..6694eddad2 100644
--- a/scumm/instrument.cpp
+++ b/scumm/instrument.cpp
@@ -45,7 +45,7 @@ roland_to_gm_map [] = {
{ "foghorn ", 60 },
{ "glop ", 39 },
// { "jacob's la", ??? },
- { "LeshBass ", 33 },
+ { "LeshBass ", 33 },
// { "lowsnort ", ??? },
{ "ML explosn", 127 },
{ "ReggaeBass", 32 },
@@ -117,7 +117,7 @@ roland_to_gm_map [] = {
const byte Instrument::_gmRhythmMap[35] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 36, 37, 38, 39, 40, 41, 66, 47,
- 65, 48, 56};
+ 65, 48, 56};
// This emulates the percussion bank setup LEC used with the MT-32,
// where notes 24 - 34 were assigned instruments without reverb.
// It also fixes problems on GS devices that map sounds to these
diff --git a/scumm/intern.h b/scumm/intern.h
index 67031bb0b1..a42a936433 100644
--- a/scumm/intern.h
+++ b/scumm/intern.h
@@ -52,9 +52,9 @@ protected:
OpcodeProcV5 proc;
const char *desc;
};
-
+
const OpcodeEntryV5 *_opcodesV5;
-
+
uint16 _cursorImages[4][17];
byte _cursorHotspots[2 * 4];
@@ -294,7 +294,7 @@ protected:
virtual void ifNotStateCommon(byte type);
virtual void setStateCommon(byte type);
virtual void clearStateCommon(byte type);
-
+
void resetSentence();
void setUserState(byte state);
@@ -452,7 +452,7 @@ protected:
OpcodeProcV6 proc;
const char *desc;
};
-
+
enum ArrayType {
kBitArray = 1,
kNibbleArray = 2,
@@ -461,18 +461,18 @@ protected:
kIntArray = 5,
kDwordArray = 6
};
-
+
#if !defined(__GNUC__)
#pragma START_PACK_STRUCTS
- #endif
-
+ #endif
+
struct ArrayHeader {
int16 dim1;
int16 type;
int16 dim2;
byte data[1];
} GCC_PACK;
-
+
#if !defined(__GNUC__)
#pragma END_PACK_STRUCTS
#endif
@@ -490,7 +490,7 @@ protected:
uint16 mode;
};
- int _blastObjectQueuePos;
+ int _blastObjectQueuePos;
BlastObject _blastObjectQueue[128];
struct BlastText {
@@ -744,7 +744,7 @@ protected:
const OpcodeEntryv60he *_opcodesv60he;
Common::File _hFileTable[17];
-
+
public:
ScummEngine_v60he(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16], int substResFileNameIndex) : ScummEngine_v6(detector, syst, gs, md5sum, substResFileNameIndex) {}
@@ -795,7 +795,7 @@ protected:
OpcodeProcv70he proc;
const char *desc;
};
-
+
const OpcodeEntryv70he *_opcodesv70he;
ResExtractor *_resExtractor;
@@ -820,7 +820,7 @@ protected:
virtual void setupOpcodes();
virtual void executeOpcode(byte i);
virtual const char *getOpcodeDesc(byte i);
-
+
virtual void setupScummVars();
virtual void initScummVars();
@@ -881,7 +881,7 @@ protected:
void postProcessAuxQueue();
public:
- /* Actor AuxQueue stuff (HE) */
+ /* Actor AuxQueue stuff (HE) */
AuxBlock _auxBlocks[16];
uint16 _auxBlocksNum;
AuxEntry _auxEntries[16];
@@ -898,10 +898,10 @@ protected:
OpcodeProcV72he proc;
const char *desc;
};
-
+
#if !defined(__GNUC__)
#pragma START_PACK_STRUCTS
-#endif
+#endif
struct ArrayHeader {
int32 type; //0
@@ -945,10 +945,10 @@ protected:
ArrayHeader *defineArray(int array, int type, int dim2start, int dim2end, int dim1start, int dim1end);
virtual int readArray(int array, int idx2, int idx1);
virtual void writeArray(int array, int idx2, int idx1, int value);
- void redimArray(int arrayId, int newDim2start, int newDim2end,
+ void redimArray(int arrayId, int newDim2start, int newDim2end,
int newDim1start, int newDim1end, int type);
void checkArrayLimits(int array, int dim2start, int dim2end, int dim1start, int dim1end);
- void copyArray(int array1, int a1_dim2start, int a1_dim2end, int a1_dim1start, int a1_dim1end,
+ void copyArray(int array1, int a1_dim2start, int a1_dim2end, int a1_dim1start, int a1_dim1end,
int array2, int a2_dim2start, int a2_dim2end, int a2_dim1start, int a2_dim1end);
void copyArrayHelper(ArrayHeader *ah, int idx2, int idx1, int len1, byte **data, int *size, int *num);
virtual int setupStringArray(int size);
@@ -1037,7 +1037,7 @@ protected:
OpcodeProcV80he proc;
const char *desc;
};
-
+
const OpcodeEntryV80he *_opcodesV80he;
int32 _heSBNGId;
@@ -1058,7 +1058,7 @@ protected:
void drawLine(int x1, int y1, int x, int unk1, int unk2, int type, int id);
void drawPixel(int x, int y, int flags);
-
+
/* HE version 80 script opcodes */
void o80_loadSBNG();
void o80_getFileSize();
@@ -1142,7 +1142,7 @@ protected:
void getArrayDim(int array, int *dim2start, int *dim2end, int *dim1start, int *dim1end);
void sortArray(int array, int dim2start, int dim2end, int dim1start, int dim1end, int sortOrder);
-public:
+public:
int getGroupSpriteArray(int spriteGroupId);
protected:
@@ -1242,7 +1242,7 @@ protected:
virtual void setupOpcodes();
virtual void executeOpcode(byte i);
virtual const char *getOpcodeDesc(byte i);
-
+
virtual void saveOrLoad(Serializer *s, uint32 savegameVersion);
virtual void decodeParseString(int a, int b);
@@ -1331,7 +1331,7 @@ protected:
OpcodeProcV8 proc;
const char *desc;
};
-
+
const OpcodeEntryV8 *_opcodesV8;
struct ObjectNameId {
@@ -1359,7 +1359,7 @@ protected:
virtual uint fetchScriptWord();
virtual int fetchScriptWordSigned();
-
+
virtual int readVar(uint var);
virtual void writeVar(uint var, int value);
@@ -1384,7 +1384,7 @@ protected:
void o8_actorOps();
void o8_cameraOps();
void o8_verbOps();
-
+
void o8_systemOps();
void o8_startVideo();
void o8_kernelSetFunctions();
@@ -1398,7 +1398,7 @@ protected:
void o8_getObjectImageY();
void o8_getObjectImageWidth();
void o8_getObjectImageHeight();
-
+
void o8_getStringWidth();
};
diff --git a/scumm/logic_he.cpp b/scumm/logic_he.cpp
index 50db5c4a09..647fbaafaf 100644
--- a/scumm/logic_he.cpp
+++ b/scumm/logic_he.cpp
@@ -176,7 +176,7 @@ int32 LogicHErace::op_1100(int32 *args) {
op_sub1(_userData[520]);
_userData[521] = (float)args[5] / args[10];
-
+
op_sub2(_userData[521]);
_userData[532] = (float)args[10];
@@ -220,7 +220,7 @@ int32 LogicHErace::op_1101(int32 *args) {
op_sub3(temp);
retval = 1;
}
-
+
temp = args[1] / _userData[532];
if (_userData[520] != temp) {
@@ -269,7 +269,7 @@ int32 LogicHErace::op_1102(int32 *args) {
int32 LogicHErace::op_1103(int32 *args) {
double angle = args[0] / args[1] * DEG2RAD;
-
+
writeScummVar(108, (int32)(sin(angle) * args[2]));
writeScummVar(109, (int32)(cos(angle) * args[2]));
@@ -294,11 +294,11 @@ int32 LogicHErace::op_1120(int32 *args) {
expr = a2 * _userDataD[17] + a1 * _userDataD[14] + a0 * _userDataD[11];
- res1 = (atan2(a2 * _userDataD[15] + a1 * _userDataD[12] + a0 * _userDataD[9], expr) * RAD2DEG)
+ res1 = (atan2(a2 * _userDataD[15] + a1 * _userDataD[12] + a0 * _userDataD[9], expr) * RAD2DEG)
/ _userData[526];
res2 = (atan2(a2 * _userDataD[16] + a1 * _userDataD[13] + a0 * _userDataD[10], expr) * RAD2DEG
- _userData[528]) / _userData[527];
-
+
writeScummVar(108, (int32)res1);
writeScummVar(109, (int32)res2);
@@ -328,9 +328,9 @@ int32 LogicHErace::op_1140(int32 *args) {
res = (args[0] - 2 * (arg2 * args[0] + arg3 * args[1]) * arg2) * 0.86956525;
writeScummVar(108, (int32)res);
-
+
res = args[1] - 2 * (arg2 * args[0] + arg3 * args[1]) * arg3;
-
+
if (-args[3] * args[3] >= 0)
res *= 0.83333331f;
@@ -432,7 +432,7 @@ void LogicHEfunshop::op_1004(int32 *args) {
data[i] = cos(at + a1) * sq;
data[i + 1] = sin(at + a1) * sq;
}
-
+
int minx = 2;
int miny = 3;
@@ -468,7 +468,7 @@ void LogicHEfunshop::op_1005(int32 *args) {
data[2 * i] *= args1;
data[2 * i + 1] *= args2;
}
-
+
for (i = 520; i <= 526; i += 2) {
putInArray(args[0], 0, i - 1, scumm_round(data[i - 520]));
putInArray(args[0], 0, i, scumm_round(data[i - 520 + 1]));
@@ -520,7 +520,7 @@ int LogicHEfunshop::checkShape(int32 data0, int32 data1, int32 data4, int32 data
}
delta2 = diff2 * diff0_4 - diff1 * diff2_6;
-
+
if (delta2 < 0) {
delta2 -= data7;
} else {
@@ -647,7 +647,7 @@ int LogicHEfootball::op_1004(int32 *args) {
int LogicHEfootball::op_1006(int32 *args) {
double res;
- res = (1.0 - args[1] * 2.9411764e-4 * 5.3050399e-2) * args[0] * 1.2360656e-1 +
+ res = (1.0 - args[1] * 2.9411764e-4 * 5.3050399e-2) * args[0] * 1.2360656e-1 +
args[1] * 1.1764706e-2 + 46;
writeScummVar(108, (int32)res);
@@ -682,7 +682,7 @@ int LogicHEfootball::op_1010(int32 *args) {
double a1 = (640.0 - (double)args[1] - 26.0) * 8.6294413;
double res;
- res = ((double)args[0] - 46 - a1 * 1.1764706e-2) /
+ res = ((double)args[0] - 46 - a1 * 1.1764706e-2) /
((1.0 - a1 * 2.9411764e-4 * 5.3050399e-2) * 1.2360656e-1);
writeScummVar(108, (int32)res);
@@ -708,7 +708,7 @@ int LogicHEfootball::op_1022(int32 *args) {
writeScummVar(108, (int32)res);
writeScummVar(109, (int32)var10);
writeScummVar(110, (int32)var8);
-
+
return 1;
}
@@ -722,20 +722,20 @@ int LogicHEfootball::op_1023(int32 *args) {
var10 = (argf[3] - argf[1]) / (argf[2] - argf[0]);
var28 = var10 * var10 + 1;
var20 = argf[0] * var10;
- var18 = (argf[5] + argf[1] + var20) * argf[4] * var10 * 2 +
- argf[6] * argf[6] * var28 + argf[4] * argf[4] -
- argf[0] * argf[0] * var10 * var10 -
- argf[5] * argf[0] * var10 * 2 -
- argf[5] * argf[1] * 2 -
+ var18 = (argf[5] + argf[1] + var20) * argf[4] * var10 * 2 +
+ argf[6] * argf[6] * var28 + argf[4] * argf[4] -
+ argf[0] * argf[0] * var10 * var10 -
+ argf[5] * argf[0] * var10 * 2 -
+ argf[5] * argf[1] * 2 -
argf[1] * argf[1] - argf[5] * argf[5];
-
+
if (var18 >= 0) {
var18 = sqrt(var18);
var30_ = argf[4] + argf[5] * var10 + argf[1] * var10 + argf[0] * var10 * var10;
var30 = (var30_ - var18) / var28;
var18 = (var30_ + var18) / var28;
-
+
if ((argf[0] - var30 < 0) && (argf[0] - var18 < 0)) {
var30_ = var30;
var30 = var18;
@@ -754,7 +754,7 @@ int LogicHEfootball::op_1023(int32 *args) {
writeScummVar(109, (int32)var28);
writeScummVar(110, (int32)var30);
writeScummVar(111, (int32)var20);
-
+
return 1;
}
int LogicHEfootball::op_1024(int32 *args) {
diff --git a/scumm/nut_renderer.cpp b/scumm/nut_renderer.cpp
index 02aa594f2f..c7a9fd00c4 100644
--- a/scumm/nut_renderer.cpp
+++ b/scumm/nut_renderer.cpp
@@ -188,7 +188,7 @@ void NutRenderer::drawShadowChar(const Graphics::Surface &s, int c, int x, int y
int offsetY[7] = { 0, -1, 0, 1, 2, 1, 0 };
int cTable[7] = { 0, 0, 0, 0, 0, 0, color };
int i = 0;
-
+
if (!showShadow)
i = 6;
@@ -196,12 +196,12 @@ void NutRenderer::drawShadowChar(const Graphics::Surface &s, int c, int x, int y
x += offsetX[i];
y += offsetY[i];
color = cTable[i];
-
+
if (c >= 256 && _vm->_useCJKMode)
draw2byte(s, c, x, y, color);
else
drawChar(s, (byte)c, x, y, color);
-
+
x -= offsetX[i];
y -= offsetY[i];
}
diff --git a/scumm/object.cpp b/scumm/object.cpp
index a852b4f400..31316e6002 100644
--- a/scumm/object.cpp
+++ b/scumm/object.cpp
@@ -249,7 +249,7 @@ void ScummEngine::getObjectXYPos(int object, int &x, int &y, int &dir) {
switch (FROM_LE_32(imhd->v8.version)) {
case 800:
x = od.x_pos + (int32)READ_LE_UINT32((const byte *)imhd + 8 * state + 0x44);
- y = od.y_pos + (int32)READ_LE_UINT32((const byte *)imhd + 8 * state + 0x48);
+ y = od.y_pos + (int32)READ_LE_UINT32((const byte *)imhd + 8 * state + 0x48);
break;
case 801:
x = od.x_pos + (int32)READ_LE_UINT32(&imhd->v8.hotspot[state].x);
@@ -353,7 +353,7 @@ int ScummEngine::findObject(int x, int y) {
}
} while ((_objs[b].state & mask) == a);
}
-
+
return 0;
}
@@ -387,9 +387,9 @@ void ScummEngine::drawRoomObjects(int arg) {
if (_objs[i].obj_nr > 0 && (_objs[i].state & mask) && _objs[i].fl_object_index == 0)
drawRoomObject(i, arg);
}
- // HACK: Reverse order is required to draw inventory background and items
- // in correct order in putttime/puttzoo. Otherwise the inventory background
- // is drawn over the items. But this doesn't match original, maybe masking
+ // HACK: Reverse order is required to draw inventory background and items
+ // in correct order in putttime/puttzoo. Otherwise the inventory background
+ // is drawn over the items. But this doesn't match original, maybe masking
// issue somewhere?
for (i = 1; i < _numLocalObjects; i++) {
if (_objs[i].obj_nr > 0 && (_objs[i].state & mask) && _objs[i].fl_object_index != 0)
@@ -741,7 +741,7 @@ void ScummEngine::setupRoomObject(ObjectData *od, const byte *room, const byte *
else
searchptr = room;
}
-
+
cdhd = (const CodeHeader *)findResourceData(MKID('CDHD'), searchptr + od->OBCDoffset);
if (cdhd == NULL)
error("Room %d missing CDHD blocks(s)", _roomResource);
@@ -1087,7 +1087,7 @@ const byte *ScummEngine::getObjectImage(const byte *ptr, int state) {
} else {
ptr = findResource(IMxx_tags[state], ptr);
}
-
+
return ptr;
}
@@ -1205,7 +1205,7 @@ void ScummEngine::findObjectInRoom(FindObjectInRoom *fo, byte findWhat, uint id,
numobj = roomptr[20];
} else {
const RoomHeader *roomhdr = (const RoomHeader *)findResourceData(MKID('RMHD'), roomptr);
-
+
if (_version == 8)
numobj = READ_LE_UINT32(&(roomhdr->v8.numObjects));
else if (_version == 7)
@@ -1213,7 +1213,7 @@ void ScummEngine::findObjectInRoom(FindObjectInRoom *fo, byte findWhat, uint id,
else
numobj = READ_LE_UINT16(&(roomhdr->old.numObjects));
}
-
+
if (numobj == 0)
error("findObjectInRoom: No object found in room %d", room);
if (numobj > _numLocalObjects)
@@ -1480,7 +1480,7 @@ void ScummEngine_v6::enqueueObject(int objectNumber, int objectX, int objectY, i
warning("enqueueObject: overflow");
return;
}
-
+
int idx = getObjectIndex(objectNumber);
assert(idx >= 0);
@@ -1555,7 +1555,7 @@ void ScummEngine_v6::drawBlastObject(BlastObject *eo) {
bdd.srcwidth = READ_LE_UINT16(&((const BompHeader *)bomp)->old.width);
bdd.srcheight = READ_LE_UINT16(&((const BompHeader *)bomp)->old.height);
}
-
+
bdd.dst = *vs;
bdd.dst.pixels = vs->getPixels(0, 0);
// Skip the bomp header
@@ -1599,9 +1599,9 @@ void ScummEngine_v6::removeBlastObject(BlastObject *eo) {
int i;
r = eo->rect;
-
+
r.clip(Common::Rect(vs->w, vs->h));
-
+
if (r.width() <= 0 || r.height() <= 0)
return;
diff --git a/scumm/palette.cpp b/scumm/palette.cpp
index 0fa200c231..8827add97e 100644
--- a/scumm/palette.cpp
+++ b/scumm/palette.cpp
@@ -346,9 +346,9 @@ static void doCyclePalette(byte *palette, int cycleStart, int cycleEnd, int size
byte *end = palette + cycleEnd * size;
int num = cycleEnd - cycleStart;
byte tmp[6];
-
+
assert(size <= 6);
-
+
if (forward) {
memmove(tmp, end, size);
memmove(start + size, start, num * size);
@@ -375,13 +375,13 @@ static void doCycleIndirectPalette(byte *palette, int cycleStart, int cycleEnd,
int num = cycleEnd - cycleStart + 1;
int i;
int offset = forward ? 1 : num - 1;
-
+
for (i = 0; i < 256; i++) {
if (cycleStart <= palette[i] && palette[i] <= cycleEnd) {
palette[i] = (palette[i] - cycleStart + offset) % num + cycleStart;
}
}
-
+
doCyclePalette(palette, cycleStart, cycleEnd, 1, forward);
}
@@ -521,7 +521,7 @@ void ScummEngine::palManipulate() {
if (!_palManipCounter || !_palManipPalette || !_palManipIntermediatePal)
return;
-
+
target = _palManipPalette + _palManipStart * 3;
pal = _currentPalette + _palManipStart * 3;
between = _palManipIntermediatePal + _palManipStart * 6;
@@ -590,7 +590,7 @@ void ScummEngine::setupShadowPalette(int redScale, int greenScale, int blueScale
// There seems to be no explanation for why this function is called
// from within Room 23 (the big machine), as it has no shadow effects
// and thus doesn't result in any visual differences.
-
+
if (_gameId == GID_SAMNMAX) {
for (i = 0; i < 256; i++)
_shadowPalette[i] = i;
@@ -715,7 +715,7 @@ void ScummEngine_v8::desaturatePalette(int hueScale, int satScale, int lightScal
if (diff != 0) {
int H, S, L;
-
+
if (sum <= 255)
S = 255 * diff / sum;
else
@@ -732,13 +732,13 @@ void ScummEngine_v8::desaturatePalette(int hueScale, int satScale, int lightScal
H = H + 360;
// Scale the result
-
+
H = (H * hueScale) / 255;
S = (S * satScale) / 255;
L = (sum * lightScale) / 255;
-
+
// HLS to RGB (Foley and VanDam)
-
+
int m1, m2;
if (L <= 255)
m2 = L * (255 + S) / (255 * 2);
@@ -967,7 +967,7 @@ void ScummEngine::updatePalette() {
*p++ = 0;
}
}
-
+
_system->setPalette(palette_colors, first, num);
_palDirtyMax = -1;
diff --git a/scumm/palette_he.cpp b/scumm/palette_he.cpp
index ef27d832ce..7ccd51dfd3 100644
--- a/scumm/palette_he.cpp
+++ b/scumm/palette_he.cpp
@@ -306,7 +306,7 @@ void ScummEngine_v99he::updatePalette() {
*p++ = data[2];
*p++ = 0;
}
-
+
_system->setPalette(palette_colors, _palDirtyMin, num);
_palDirtyMax = -1;
diff --git a/scumm/player_mod.h b/scumm/player_mod.h
index 883b43b2d7..df7685e183 100644
--- a/scumm/player_mod.h
+++ b/scumm/player_mod.h
@@ -86,7 +86,7 @@ private:
uint8 _maxvol;
virtual void do_mix(int16 *buf, uint len);
-
+
ModUpdateProc *_playproc;
void *_playparam;
};
diff --git a/scumm/player_nes.cpp b/scumm/player_nes.cpp
index 6cf48fbc1d..b1d317b75e 100644
--- a/scumm/player_nes.cpp
+++ b/scumm/player_nes.cpp
@@ -122,7 +122,7 @@ inline void Square0_CheckActive(void) {
inline void Square0_Write(int Reg, byte Val) {
switch (Reg) {
- case 0:
+ case 0:
Square0.volume = Val & 0xF;
Square0.envelope = Val & 0x10;
Square0.wavehold = Val & 0x20;
@@ -130,7 +130,7 @@ inline void Square0_Write(int Reg, byte Val) {
Square0.Vol = Square0.envelope ? Square0.volume : Square0.Envelope;
break;
- case 1:
+ case 1:
Square0.swpstep = Val & 0x07;
Square0.swpdir = Val & 0x08;
Square0.swpspeed = (Val >> 4) & 0x7;
@@ -638,7 +638,7 @@ Player_NES::Player_NES(ScummEngine *scumm) {
APU_writeControl(0);
APUe::APU_Reset();
-
+
_mixer->setupPremix(this);
}
@@ -695,7 +695,7 @@ void Player_NES::startSound(int nr) {
int soundType = data[1];
int chan = data[0];
-
+
if (chan == 4) {
if (_slot[2].framesleft)
return;
@@ -841,7 +841,7 @@ top:
_mchan[x].envflags = 0x30;
_mchan[x].volume = 0x6F;
_mchan[x].voldelta = 0;
-
+
APU_writeChannel(x, 0, 0x00);
APU_writeChannel(x, 1, 0x7F);
APU_writeControl(APU_readStatus() | channelMask[x]);
@@ -956,7 +956,7 @@ top:
_mchan[x].envflags = 0x30;
_mchan[x].volume = 0x5F;
_mchan[x].voldelta = -22;
-
+
APU_writeChannel(x, 0, 0x00);
APU_writeControl(APU_readStatus() | channelMask[x]);
APU_writeChannel(x, 2, _mchan[x].pitch & 0xF);
@@ -970,7 +970,7 @@ top:
_mchan[x].envflags = 0x30;
_mchan[x].volume = 0x5F;
_mchan[x].voldelta = -6;
-
+
APU_writeChannel(x, 0, 0x00);
APU_writeControl(APU_readStatus() | channelMask[x]);
APU_writeChannel(x, 2, _mchan[x].pitch & 0xF);
@@ -1030,7 +1030,7 @@ top:
case 0x18:
_mchan[x].envflags = 0x70;
-
+
chainCommand(x);
break;
diff --git a/scumm/player_v1.cpp b/scumm/player_v1.cpp
index 6f57b9eb99..6b88f7cf58 100644
--- a/scumm/player_v1.cpp
+++ b/scumm/player_v1.cpp
@@ -33,7 +33,7 @@ namespace Scumm {
#define TIMER_BASE_FREQ 1193000
#define FIXP_SHIFT 16
-Player_V1::Player_V1(ScummEngine *scumm, bool pcjr) : Player_V2(scumm, pcjr) {
+Player_V1::Player_V1(ScummEngine *scumm, bool pcjr) : Player_V2(scumm, pcjr) {
// Initialize channel code
for (int i = 0; i < 4; ++i)
clear_channel(i);
@@ -132,7 +132,7 @@ void Player_V1::parseSpeakerChunk() {
parse_again:
_chunk_type = READ_LE_UINT16(_next_chunk);
- debug(6, "parseSpeakerChunk: sound %d, offset %4x, chunk %x",
+ debug(6, "parseSpeakerChunk: sound %d, offset %4x, chunk %x",
_current_nr, _next_chunk - _current_data, _chunk_type);
_next_chunk += 2;
@@ -169,7 +169,7 @@ void Player_V1::parseSpeakerChunk() {
_repeat_ctr = READ_LE_UINT16(_next_chunk + 8);
_channels[0].freq = _start;
_next_chunk += 10;
- debug(6, "chunk 1: mplex %d, freq %d -> %d step %d x %d",
+ debug(6, "chunk 1: mplex %d, freq %d -> %d step %d x %d",
_mplex, _start, _end, _delta, _repeat_ctr);
break;
case 2:
@@ -179,7 +179,7 @@ void Player_V1::parseSpeakerChunk() {
_channels[0].freq = 0;
_next_chunk += 6;
_forced_level = -1;
- debug(6, "chunk 2: %d -> %d step %d",
+ debug(6, "chunk 2: %d -> %d step %d",
_start, _end, _delta);
break;
case 3:
@@ -189,7 +189,7 @@ void Player_V1::parseSpeakerChunk() {
_channels[0].freq = 0;
_next_chunk += 6;
_forced_level = -1;
- debug(6, "chunk 3: %d -> %d step %d",
+ debug(6, "chunk 3: %d -> %d step %d",
_start, _end, _delta);
break;
}
@@ -208,7 +208,7 @@ void Player_V1::nextSpeakerCmd() {
_time_left = READ_LE_UINT16(_next_chunk);
_next_chunk += 2;
}
- debug(7, "nextSpeakerCmd: chunk %d, offset %4x: notelen %d",
+ debug(7, "nextSpeakerCmd: chunk %d, offset %4x: notelen %d",
_chunk_type, _next_chunk - 2 - _current_data, _time_left);
if (_time_left == 0) {
parseSpeakerChunk();
@@ -264,7 +264,7 @@ void Player_V1::parsePCjrChunk() {
parse_again:
_chunk_type = READ_LE_UINT16(_next_chunk);
- debug(6, "parsePCjrChunk: sound %d, offset %4x, chunk %x",
+ debug(6, "parsePCjrChunk: sound %d, offset %4x, chunk %x",
_current_nr, _next_chunk - _current_data, _chunk_type);
_next_chunk += 2;
@@ -350,7 +350,7 @@ parse_again:
}
*_value_ptr_2 = _start_2;
}
- debug(6, "chunk 1: %d: %d step %d for %d, %d: %d step %d for %d",
+ debug(6, "chunk 1: %d: %d step %d for %d, %d: %d step %d for %d",
_value_ptr - (uint*)_channels, _start, _delta, _time_left,
_value_ptr_2 - (uint*)_channels, _start_2, _delta_2, _time_left_2);
break;
@@ -362,10 +362,10 @@ parse_again:
_channels[0].freq = 0;
_next_chunk += 6;
_forced_level = -1;
- debug(6, "chunk 2: %d -> %d step %d",
+ debug(6, "chunk 2: %d -> %d step %d",
_start, _end, _delta);
break;
- case 3:
+ case 3:
set_mplex(READ_LE_UINT16(_next_chunk));
tmp = READ_LE_UINT16(_next_chunk + 2);
assert((tmp & 0xf0) == 0xe0);
@@ -407,7 +407,7 @@ void Player_V1::nextPCjrCmd() {
_channels[i].hull_counter = 1;
_channels[i].freq = dummy;
}
- debug(7, "chunk 0: channel %d play %d for %d",
+ debug(7, "chunk 0: channel %d play %d for %d",
i, dummy, _channels[i].notelen);
_channels[i].cmd_ptr += 4;
}
@@ -495,7 +495,7 @@ void Player_V1::nextPCjrCmd() {
_channels[3].volume = dummy;
break;
}
-
+
if (!--_repeat_ctr) {
parsePCjrChunk();
return;
@@ -566,7 +566,7 @@ void Player_V1::generatePCjrSamples(int16 *data, uint len) {
/* HACK: this channel is playing at
* the same frequency as another.
* Synchronize it to the same phase to
- * prevent interference.
+ * prevent interference.
*/
_timer_count[i] = _timer_count[j];
_timer_output ^= (1 << i) &
@@ -586,16 +586,16 @@ void Player_V1::generatePCjrSamples(int16 *data, uint len) {
} else if (i < 3) {
hasdata = true;
squareGenerator(i, freq, vol, 0, data, len);
- debug(9, "channel[%d]: %8x: freq %d %.1f ; volume %d",
+ debug(9, "channel[%d]: %8x: freq %d %.1f ; volume %d",
i, _tick_len, freq, 111860.0 / freq, vol);
} else {
int noiseFB = (freq & 4) ? FB_WNOISE : FB_PNOISE;
int n = (freq & 3);
-
+
freq = (n == 3) ? 2 * (_channels[2].freq) : 1 << (5 + n);
hasdata = true;
squareGenerator(i, freq, vol, noiseFB, data, len);
- debug(9, "channel[%d]: %x: noise freq %d %.1f ; volume %d",
+ debug(9, "channel[%d]: %x: noise freq %d %.1f ; volume %d",
i, _tick_len, freq, 111860.0 / freq, vol);
}
}
@@ -604,4 +604,4 @@ void Player_V1::generatePCjrSamples(int16 *data, uint len) {
lowPassFilter(data, len);
}
-} // End of namespace Scumm
+} // End of namespace Scumm
diff --git a/scumm/player_v2.cpp b/scumm/player_v2.cpp
index a70a4b9a1f..0d70944915 100644
--- a/scumm/player_v2.cpp
+++ b/scumm/player_v2.cpp
@@ -52,7 +52,7 @@ static const uint16 *spk_freq_table;
static const uint16 *pcjr_freq_table;
#else
const uint8 note_lengths[] = {
- 0,
+ 0,
0, 0, 2,
0, 3, 4,
5, 6, 8,
@@ -63,8 +63,8 @@ const uint8 note_lengths[] = {
};
static const uint16 hull_offsets[] = {
- 0, 12, 24, 36, 48, 60,
- 72, 88, 104, 120, 136, 256,
+ 0, 12, 24, 36, 48, 60,
+ 72, 88, 104, 120, 136, 256,
152, 164, 180
};
@@ -193,7 +193,7 @@ static const int8 freqmod_table[0x502] = {
-70, -67, -65, -62, -59, -57, -54, -51,
-48, -45, -42, -39, -36, -33, -30, -27,
-24, -21, -18, -15, -12, -9, -6, -3,
-
+
0, 1, 2, 3, 4, 5, 6, 7,
8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23,
@@ -226,9 +226,9 @@ static const int8 freqmod_table[0x502] = {
-24, -23, -22, -21, -20, -19, -18, -17,
-16, -15, -14, -13, -12, -11, -10, -9,
-8, -7, -6, -5, -4, -3, -2, -1,
-
+
-120, 120,
-
+
-120,-120,-120,-120,-120,-120,-120,-120,
-120,-120,-120,-120,-120,-120,-120,-120,
-120,-120,-120,-120,-120,-120,-120,-120,
@@ -330,12 +330,12 @@ static const int8 freqmod_table[0x502] = {
static const uint16 spk_freq_table[12] = {
- 36484, 34436, 32503, 30679, 28957, 27332,
+ 36484, 34436, 32503, 30679, 28957, 27332,
25798, 24350, 22983, 21693, 20476, 19326
};
static const uint16 pcjr_freq_table[12] = {
- 65472, 61760, 58304, 55040, 52032, 49024,
+ 65472, 61760, 58304, 55040, 52032, 49024,
46272, 43648, 41216, 38912, 36736, 34624
};
#endif
@@ -351,10 +351,10 @@ Player_V2::Player_V2(ScummEngine *scumm, bool pcjr) {
_header_len = (scumm->_features & GF_OLD_BUNDLE) ? 4 : 6;
- // Initialize sound queue
+ // Initialize sound queue
_current_nr = _next_nr = 0;
_current_data = _next_data = 0;
-
+
// Initialize channel code
for (i = 0; i < 4; ++i)
clear_channel(i);
@@ -419,7 +419,7 @@ void Player_V2::setMusicVolume (int vol) {
/* scale to int16, FIXME: find best value */
double out = vol * 128 / 3;
-
+
/* build volume table (2dB per step) */
for (int i = 0; i < 15; i++) {
/* limit volume to avoid clipping */
@@ -510,13 +510,13 @@ void Player_V2::startSound(int nr) {
data = tdata;
restartable = data ? *(data + _header_len + 1) : 0;
}
-
+
if (!_current_nr) {
nr = 0;
_next_nr = 0;
_next_data = 0;
}
-
+
if (nr != _current_nr
&& restartable
&& (!_next_nr
@@ -564,14 +564,14 @@ void Player_V2::execute_cmd(ChannelInfo *channel) {
if (opcode >= 0xf8) {
switch (opcode) {
case 0xf8: // set hull curve
- debug(7, "channels[%d]: hull curve %2d",
+ debug(7, "channels[%d]: hull curve %2d",
channel - _channels, *script_ptr);
channel->d.hull_curve = hull_offsets[*script_ptr / 2];
script_ptr++;
break;
case 0xf9: // set freqmod curve
- debug(7, "channels[%d]: freqmod curve %2d",
+ debug(7, "channels[%d]: freqmod curve %2d",
channel - _channels, *script_ptr);
channel->d.freqmod_table = freqmod_offsets[*script_ptr / 4];
channel->d.freqmod_modulo = freqmod_lengths[*script_ptr / 4];
@@ -642,7 +642,7 @@ void Player_V2::execute_cmd(ChannelInfo *channel) {
opcode = *script_ptr++;
value = READ_LE_UINT16 (script_ptr);
channel->array[opcode / 2] = value;
- debug(7, "channels[%d]: set param %2d = %5d",
+ debug(7, "channels[%d]: set param %2d = %5d",
channel - &_channels[0], opcode, value);
script_ptr += 2;
if (opcode == 14) {
@@ -670,7 +670,7 @@ void Player_V2::execute_cmd(ChannelInfo *channel) {
is_last_note = note & 0x80;
note &= 0x7f;
if (note == 0x7f) {
- debug(8, "channels[%d]: pause %d",
+ debug(8, "channels[%d]: pause %d",
channel - _channels, channel->d.time_left);
goto end;
}
@@ -679,7 +679,7 @@ void Player_V2::execute_cmd(ChannelInfo *channel) {
channel->d.time_left = ((opcode & 7) << 8) | *script_ptr++;
if ((opcode & 0x10)) {
- debug(8, "channels[%d]: pause %d",
+ debug(8, "channels[%d]: pause %d",
channel - _channels, channel->d.time_left);
goto end;
}
@@ -688,7 +688,7 @@ void Player_V2::execute_cmd(ChannelInfo *channel) {
note = (*script_ptr++) & 0x7f;
}
- debug(8, "channels[%d]: @%04x note: %3d+%d len: %2d hull: %d mod: %d/%d/%d %s",
+ debug(8, "channels[%d]: @%04x note: %3d+%d len: %2d hull: %d mod: %d/%d/%d %s",
dest_channel - channel, script_ptr ? script_ptr - _current_data - 2 : 0,
note, (signed short) dest_channel->d.transpose, channel->d.time_left,
dest_channel->d.hull_curve, dest_channel->d.freqmod_table,
@@ -697,7 +697,7 @@ void Player_V2::execute_cmd(ChannelInfo *channel) {
uint16 myfreq;
dest_channel->d.time_left = channel->d.time_left;
- dest_channel->d.note_length =
+ dest_channel->d.note_length =
channel->d.time_left - dest_channel->d.inter_note_pause;
note += dest_channel->d.transpose;
while (note < 0)
@@ -749,7 +749,7 @@ void Player_V2::next_freqs(ChannelInfo *channel) {
channel->d.freqmod_offset += channel->d.freqmod_incr;
if (channel->d.freqmod_offset > channel->d.freqmod_modulo)
channel->d.freqmod_offset -= channel->d.freqmod_modulo;
- channel->d.freq =
+ channel->d.freq =
(int) (freqmod_table[channel->d.freqmod_table + (channel->d.freqmod_offset >> 4)])
* (int) channel->d.freqmod_multiplier / 256
+ channel->d.base_freq;
@@ -770,7 +770,7 @@ void Player_V2::next_freqs(ChannelInfo *channel) {
}
#if 0
- debug(9, "channels[%d]: freq %d hull %d/%d/%d",
+ debug(9, "channels[%d]: freq %d hull %d/%d/%d",
channel - &_channels[0], channel->d.freq,
channel->d.hull_curve, channel->d.hull_offset,
channel->d.hull_counter);
@@ -849,10 +849,10 @@ void Player_V2::squareGenerator(int channel, int freq, int vol,
for (uint i = 0; i < len; i++) {
unsigned int duration = 0;
-
+
if (_timer_output & (1 << channel))
duration += _timer_count[channel];
-
+
_timer_count[channel] -= (1 << FIXP_SHIFT);
while (_timer_count[channel] <= 0) {
@@ -871,11 +871,11 @@ void Player_V2::squareGenerator(int channel, int freq, int vol,
_timer_count[channel] += period;
}
-
+
if (_timer_output & (1 << channel))
duration -= _timer_count[channel];
-
- nsample = *sample +
+
+ nsample = *sample +
(((signed long) (duration - (1 << (FIXP_SHIFT - 1)))
* (signed long) _volumetable[vol]) >> FIXP_SHIFT);
/* overflow: clip value */
@@ -902,12 +902,12 @@ void Player_V2::generateSpkSamples(int16 *data, uint len) {
memset(data, 0, 2 * sizeof(int16) * len);
if (winning_channel != -1) {
- squareGenerator(0, _channels[winning_channel].d.freq, 0,
+ squareGenerator(0, _channels[winning_channel].d.freq, 0,
0, data, len);
} else if (_level == 0)
/* shortcut: no sound is being played. */
return;
-
+
lowPassFilter(data, len);
}
@@ -928,7 +928,7 @@ void Player_V2::generatePCjrSamples(int16 *data, uint len) {
/* HACK: this channel is playing at
* the same frequency as another.
* Synchronize it to the same phase to
- * prevent interference.
+ * prevent interference.
*/
_timer_count[i] = _timer_count[j];
_timer_output ^= (1 << i) &
@@ -951,13 +951,13 @@ void Player_V2::generatePCjrSamples(int16 *data, uint len) {
} else {
int noiseFB = (freq & 4) ? FB_WNOISE : FB_PNOISE;
int n = (freq & 3);
-
+
freq = (n == 3) ? 2 * (_channels[2].d.freq>>6) : 1 << (5 + n);
hasdata = true;
squareGenerator(i, freq, vol, noiseFB, data, len);
}
#if 0
- debug(9, "channel[%d]: freq %d %.1f ; volume %d",
+ debug(9, "channel[%d]: freq %d %.1f ; volume %d",
i, freq, 111860.0 / freq, vol);
#endif
}
@@ -1001,4 +1001,4 @@ _GRELEASEPTR(GBVARS_SPKFREQTABLE_INDEX, GBVARS_SCUMM)
_GRELEASEPTR(GBVARS_PCJRFREQTABLE_INDEX, GBVARS_SCUMM)
_GEND
-#endif
+#endif
diff --git a/scumm/player_v2.h b/scumm/player_v2.h
index b87f9c3f7d..4c77e1c073 100644
--- a/scumm/player_v2.h
+++ b/scumm/player_v2.h
@@ -38,7 +38,7 @@ class ScummEngine;
#if !defined(__GNUC__)
#pragma START_PACK_STRUCTS
-#endif
+#endif
struct channel_data {
uint16 time_left; // 00
@@ -127,7 +127,7 @@ private:
channel_data d;
uint16 array[sizeof(channel_data)/2];
};
-
+
int _music_timer;
int _music_timer_ctr;
int _ticks_per_music_timer;
@@ -163,4 +163,4 @@ private:
} // End of namespace Scumm
-#endif
+#endif
diff --git a/scumm/player_v2a.cpp b/scumm/player_v2a.cpp
index 24ee173dc1..042ef2e3a4 100644
--- a/scumm/player_v2a.cpp
+++ b/scumm/player_v2a.cpp
@@ -905,7 +905,7 @@ public:
virtual void start(Player_MOD *mod, int id, const byte *data) {
_mod = mod;
_id = id;
-
+
char *tmp_data1 = (char *)malloc(_size);
char *tmp_data2 = (char *)malloc(_size);
char *tmp_data3 = (char *)malloc(_size);
@@ -1416,4 +1416,4 @@ int Player_V2A::getSoundStatus(int nr) const {
return 0;
}
-} // End of namespace Scumm
+} // End of namespace Scumm
diff --git a/scumm/player_v3a.cpp b/scumm/player_v3a.cpp
index 8a35f8bb61..7b2c6e8dc1 100644
--- a/scumm/player_v3a.cpp
+++ b/scumm/player_v3a.cpp
@@ -208,7 +208,7 @@ void Player_V3A::startSound(int nr) {
if (getSoundStatus(nr))
stopSound(nr); // if a sound is playing, restart it
-
+
if (data[26]) {
if (_curSong)
stopSound(_curSong);
diff --git a/scumm/resource.cpp b/scumm/resource.cpp
index 0a132c2fef..9fe7ba399a 100644
--- a/scumm/resource.cpp
+++ b/scumm/resource.cpp
@@ -152,7 +152,7 @@ void ScummEngine::openRoom(const int room) {
if (_gameId == GID_MANIAC)
_demoMode = true;
}
-
+
if (result) {
if (room == 0)
return;
@@ -230,18 +230,18 @@ bool ScummEngine::openFile(BaseScummFile &file, const char *filename) {
result = file.openSubFile(filename);
}
-
+
if (!result) {
file.close();
result = file.open(filename);
}
-
+
return result;
}
bool ScummEngine::openResourceFile(const char *filename, byte encByte) {
debugC(DEBUG_GENERAL, "openResourceFile(%s)", filename);
-
+
if (openFile(*_fileHandle, filename)) {
_fileHandle->setEnc(encByte);
return true;
@@ -269,7 +269,7 @@ void ScummEngine::askForDisk(const char *filename, int disknum) {
error("Cannot find file: '%s'", filename);
}
#endif
- } else {
+ } else {
sprintf(buf, "Cannot find file: '%s'", filename);
InfoDialog dialog(this, (char*)buf);
runDialog(dialog);
@@ -390,7 +390,7 @@ void ScummEngine::readIndexBlock(uint32 blocktype, uint32 itemsize) {
case MKID('DIRF'):
readResTypeList(rtCharset, MKID('CHAR'), "charset");
break;
-
+
case MKID('DOBJ'):
debug(9, "found DOBJ block, reading object table");
readGlobalObjects();
@@ -419,11 +419,11 @@ void ScummEngine::readIndexBlock(uint32 blocktype, uint32 itemsize) {
}
}
break;
-
+
case MKID('DIRM'):
readResTypeList(rtImage, MKID('AWIZ'), "images");
break;
-
+
case MKID('DIRT'):
readResTypeList(rtTalkie, MKID('TLKE'), "talkie");
break;
@@ -605,7 +605,7 @@ void ScummEngine::ensureResourceLoaded(int type, int i) {
// TODO: determine why the heck anything would try to load a costume
// with id 0. Is that "normal", or is it caused by yet another bug in
// our code base? After all we also have to add special cases for many
- // of our script opcodes that check for the (invalid) actor 0... so
+ // of our script opcodes that check for the (invalid) actor 0... so
// maybe both issues are related...
if (type != rtCharset && i == 0)
return;
@@ -716,7 +716,7 @@ int ScummEngine::getResourceRoomNr(int type, int idx) {
int ScummEngine::getResourceSize(int type, int idx) {
byte *ptr = getResourceAddress(type, idx);
MemBlkHeader *hdr = (MemBlkHeader *)(ptr - sizeof(MemBlkHeader));
-
+
return hdr->size;
}
@@ -1091,7 +1091,7 @@ void ScummEngine_v7::readMAXS(int blockSize) {
_objectRoomTable = (byte *)calloc(_numGlobalObjects, 1);
- if ((_gameId == GID_FT) && (_features & GF_DEMO) &&
+ if ((_gameId == GID_FT) && (_features & GF_DEMO) &&
(_platform == Common::kPlatformPC))
_numGlobalScripts = 300;
else
@@ -1171,7 +1171,7 @@ void ScummEngine_v8::readGlobalObjects() {
_classData[i] = _fileHandle->readUint32LE();
}
memset(_objectOwnerTable, 0xFF, num);
-
+
// Finally, sort the object name->ID map, so we can later use
// bsearch on it. For this we (ab)use strcmp, which works fine
// since the table entries start with a string.
@@ -1276,24 +1276,24 @@ ResourceIterator::ResourceIterator(const byte *searchin, bool smallHeader)
_pos = 8;
_ptr = searchin + 8;
}
-
+
}
const byte *ResourceIterator::findNext(uint32 tag) {
uint32 size = 0;
const byte *result = 0;
-
+
if (_smallHeader) {
uint16 smallTag = newTag2Old(tag);
do {
if (_pos >= _size)
return 0;
-
+
result = _ptr;
size = READ_LE_UINT32(result);
if ((int32)size <= 0)
return 0; // Avoid endless loop
-
+
_pos += size;
_ptr += size;
} while (READ_LE_UINT16(result + 4) != smallTag);
@@ -1301,12 +1301,12 @@ const byte *ResourceIterator::findNext(uint32 tag) {
do {
if (_pos >= _size)
return 0;
-
+
result = _ptr;
size = READ_BE_UINT32(result + 4);
if ((int32)size <= 0)
return 0; // Avoid endless loop
-
+
_pos += size;
_ptr += size;
} while (READ_UINT32(result) != tag);
diff --git a/scumm/resource.h b/scumm/resource.h
index 58498ca816..289494aa7c 100644
--- a/scumm/resource.h
+++ b/scumm/resource.h
@@ -26,7 +26,7 @@ namespace Scumm {
enum {
OF_OWNER_MASK = 0x0F,
OF_STATE_MASK = 0xF0,
-
+
OF_STATE_SHL = 4
};
diff --git a/scumm/resource_v2.cpp b/scumm/resource_v2.cpp
index ef89df7896..e956e37c8a 100644
--- a/scumm/resource_v2.cpp
+++ b/scumm/resource_v2.cpp
@@ -173,7 +173,7 @@ void ScummEngine_v2::readIndexFile() {
switch (magic) {
case 0x0100:
printf("Enhanced V2 game detected\n");
- readEnhancedIndexFile();
+ readEnhancedIndexFile();
break;
case 0x0A31:
printf("Classic V1 game detected\n");
diff --git a/scumm/resource_v7he.cpp b/scumm/resource_v7he.cpp
index 2240377a63..f4a722c0b9 100644
--- a/scumm/resource_v7he.cpp
+++ b/scumm/resource_v7he.cpp
@@ -122,7 +122,7 @@ const char *res_types[] = {
"fontdir", "font", "accelerator", "rcdata", "messagelist",
"group_cursor", NULL, "group_icon", NULL,
/* the following are not defined in winbase.h, but found in wrc. */
- /* 0x10: */
+ /* 0x10: */
"version", "dlginclude", NULL, "plugplay", "vxd",
"anicursor", "aniicon"
};
@@ -152,7 +152,7 @@ int Win32ResExtractor::extractResource_(const char *resType, char *resName, byte
arg_type = res_type_string_to_id(arg_type);
WinLibrary fi;
-
+
/* initiate stuff */
fi.memory = NULL;
fi.file = new Common::File;
@@ -290,7 +290,7 @@ byte *Win32ResExtractor::extract_resource(WinLibrary *fi, WinResource *wr, int *
bool *free_it, char *type, char *lang, bool raw) {
char *str;
int32 intval;
-
+
/* just return pointer to data if raw */
if (raw) {
*free_it = false;
@@ -374,7 +374,7 @@ byte *Win32ResExtractor::extract_group_icon_cursor_resource(WinLibrary *fi, WinR
continue;
}
if ((uint32)iconsize != icondir->entries[c].bytes_in_res) {
- debugC(DEBUG_RESOURCE, "%s: mismatch of size in icon resource `%s' and group (%d != %d)",
+ debugC(DEBUG_RESOURCE, "%s: mismatch of size in icon resource `%s' and group (%d != %d)",
fi->file->name(), name, iconsize, icondir->entries[c].bytes_in_res);
}
size += iconsize; /* size += icondir->entries[c].bytes_in_res; */
@@ -405,7 +405,7 @@ byte *Win32ResExtractor::extract_group_icon_cursor_resource(WinLibrary *fi, WinR
char name[14];
WinResource *fwr;
byte *data;
-
+
/* find the corresponding icon resource */
snprintf(name, sizeof(name)/sizeof(char), "-%d", icondir->entries[c].res_id);
fwr = find_resource(fi, (is_icon ? "-3" : "-1"), name, lang, &level);
@@ -505,7 +505,7 @@ int Win32ResExtractor::do_resources(WinLibrary *fi, const char *type, char *name
/* does the id of this entry match the specified id? */
#define LEVEL_MATCHES(x) (x == NULL || x ## _wr->id[0] == '\0' || compare_resource_id(x ## _wr, x))
-int Win32ResExtractor::do_resources_recurs(WinLibrary *fi, WinResource *base,
+int Win32ResExtractor::do_resources_recurs(WinLibrary *fi, WinResource *base,
WinResource *type_wr, WinResource *name_wr, WinResource *lang_wr,
const char *type, char *name, char *lang, int action, byte **data) {
int c, rescnt;
@@ -596,7 +596,7 @@ bool Win32ResExtractor::decode_pe_resource_id(WinLibrary *fi, WinResource *wr, u
wr->numeric_id = (value & IMAGE_RESOURCE_NAME_IS_STRING ? false:true);
return true;
}
-
+
byte *Win32ResExtractor::get_resource_entry(WinLibrary *fi, WinResource *wr, int *size) {
if (fi->is_PE_binary) {
Win32ImageResourceDataEntry *dataent;
@@ -1019,7 +1019,7 @@ int Win32ResExtractor::convertIcons(byte *data, int datasize, byte **cursor, int
width = bitmap.width;
height = ABS(bitmap.height)/2;
-
+
image_size = height * ROW_BYTES(width * bitmap.bit_count);
mask_size = height * ROW_BYTES(width);
@@ -1304,7 +1304,7 @@ int MacResExtractor::extractResource(int id, byte **buf) {
// And finally check if we have dumped resource fork
snprintf(_fileName, 128, "%s.rsrc", buf1);
if (!in.exists(_fileName)) {
- error("Cannot open file any of files '%s', '%s.bin', '%s.rsrc",
+ error("Cannot open file any of files '%s', '%s.bin', '%s.rsrc",
buf1, buf1, buf1);
}
}
@@ -1387,7 +1387,7 @@ bool MacResExtractor::init(Common::File in) {
return false;
}
- debug(7, "got header: data %d [%d] map %d [%d]",
+ debug(7, "got header: data %d [%d] map %d [%d]",
_dataOffset, _dataLength, _mapOffset, _mapLength);
readMap(in);
@@ -1401,7 +1401,7 @@ byte *MacResExtractor::getResource(Common::File in, const char *typeID, int16 re
int resNum = -1;
byte *buf;
int len;
-
+
for (i = 0; i < _resMap.numTypes; i++)
if (strcmp(_resTypes[i].id, typeID) == 0) {
typeNum = i;
@@ -1434,7 +1434,7 @@ byte *MacResExtractor::getResource(Common::File in, const char *typeID, int16 re
void MacResExtractor::readMap(Common::File in) {
int i, j, len;
-
+
in.seek(_mapOffset + 22);
_resMap.resAttr = in.readUint16BE();
@@ -1453,22 +1453,22 @@ void MacResExtractor::readMap(Common::File in) {
_resTypes[i].offset = in.readUint16BE();
_resTypes[i].items++;
}
-
+
_resLists = new ResPtr[_resMap.numTypes];
-
+
for (i = 0; i < _resMap.numTypes; i++) {
_resLists[i] = new Resource[_resTypes[i].items];
in.seek(_resTypes[i].offset + _mapOffset + _resMap.typeOffset);
for (j = 0; j < _resTypes[i].items; j++) {
ResPtr resPtr = _resLists[i] + j;
-
+
resPtr->id = in.readUint16BE();
resPtr->nameOffset = in.readUint16BE();
resPtr->dataOffset = in.readUint32BE();
in.readUint32BE();
resPtr->name = 0;
-
+
resPtr->attr = resPtr->dataOffset >> 24;
resPtr->dataOffset &= 0xFFFFFF;
}
@@ -1476,7 +1476,7 @@ void MacResExtractor::readMap(Common::File in) {
for (j = 0; j < _resTypes[i].items; j++) {
if (_resLists[i][j].nameOffset != -1) {
in.seek(_resLists[i][j].nameOffset + _mapOffset + _resMap.nameOffset);
-
+
len = in.readByte();
_resLists[i][j].name = new byte[len + 1];
_resLists[i][j].name[len] = 0;
@@ -1506,7 +1506,7 @@ int MacResExtractor::convertIcons(byte *data, int datasize, byte **cursor, int *
dis.readUint32BE(); // expanded cursor data
dis.readUint16BE(); // expanded data depth
dis.readUint32BE(); // reserved
-
+
// Grab B/W icon data
*cursor = (byte *)malloc(16 * 16);
for (i = 0; i < 32; i++) {
@@ -1534,10 +1534,10 @@ int MacResExtractor::convertIcons(byte *data, int datasize, byte **cursor, int *
dis.readUint32BE(); // reserved
dis.readUint32BE(); // cursorID
-
+
// Color version of cursor
dis.readUint32BE(); // baseAddr
-
+
// Keep only lowbyte for now
dis.readByte();
iconRowBytes = dis.readByte();
@@ -1638,7 +1638,7 @@ void ScummEngine_v70he::readRoomsOffsets() {
num = READ_LE_UINT16(_heV7RoomOffsets);
ptr = _heV7RoomOffsets + 2;
for (i = 0; i < num; i++) {
- res.roomoffs[rtRoom][i] = READ_LE_UINT32(ptr);
+ res.roomoffs[rtRoom][i] = READ_LE_UINT32(ptr);
ptr += 4;
}
}
diff --git a/scumm/resource_v7he.h b/scumm/resource_v7he.h
index 431de85e66..8f2766aff8 100644
--- a/scumm/resource_v7he.h
+++ b/scumm/resource_v7he.h
@@ -123,7 +123,7 @@ public:
virtual int extractResource(int id, byte **buf) { return 0; };
virtual int convertIcons(byte *data, int datasize, byte **cursor, int *w, int *h,
- int *hotspot_x, int *hotspot_y, int *keycolor,
+ int *hotspot_x, int *hotspot_y, int *keycolor,
byte **palette, int *palSize) { return 0; };
enum {
@@ -166,12 +166,12 @@ class Win32ResExtractor : public ResExtractor {
private:
int extractResource_(const char *resType, char *resName, byte **data);
/*
- * Structures
+ * Structures
*/
#if !defined(__GNUC__)
#pragma START_PACK_STRUCTS
-#endif
+#endif
struct WinLibrary {
Common::File *file;
@@ -546,7 +546,7 @@ private:
ResMap _resMap;
ResType *_resTypes;
ResPtr *_resLists;
-};
+};
} // End of namespace Scumm
diff --git a/scumm/room.cpp b/scumm/room.cpp
index 37d9b7ff6d..f5baf849f3 100644
--- a/scumm/room.cpp
+++ b/scumm/room.cpp
@@ -75,7 +75,7 @@ void ScummEngine::startScene(int room, Actor *a, int objectNr) {
if (_version >= 4 && _heversion <= 61)
stopCycle(0);
_sound->processSound();
-
+
clearDrawQueues();
// For HE80+ games
@@ -136,7 +136,7 @@ void ScummEngine::startScene(int room, Actor *a, int objectNr) {
loadRoomObjects();
-
+
if (VAR_ROOM_WIDTH != 0xFF && VAR_ROOM_HEIGHT != 0xFF) {
VAR(VAR_ROOM_WIDTH) = _roomWidth;
VAR(VAR_ROOM_HEIGHT) = _roomHeight;
@@ -207,7 +207,7 @@ void ScummEngine::startScene(int room, Actor *a, int objectNr) {
/**
* Init some static room data after a room has been loaded.
* E.g. the room dimension, the offset to the graphics data, the room scripts,
- * the offset to the room palette and other things which won't be changed
+ * the offset to the room palette and other things which won't be changed
* late on.
* So it is possible to call this after loading a savegame.
*/
@@ -234,7 +234,7 @@ void ScummEngine::loadRoomSubBlocks() {
// Determine the room dimensions (width/height)
//
rmhd = (const RoomHeader *)findResourceData(MKID('RMHD'), roomptr);
-
+
if (_version == 8) {
_roomWidth = READ_LE_UINT32(&(rmhd->v8.width));
_roomHeight = READ_LE_UINT32(&(rmhd->v8.height));
@@ -412,7 +412,7 @@ void ScummEngine::loadRoomSubBlocks() {
_HEV7ActorPalette[i] = i;
}
}
-
+
gdi.roomChanged(roomptr, _IM00_offs, trans);
}
@@ -554,7 +554,7 @@ void ScummEngine_v3old::loadRoomSubBlocks() {
// Determine the room dimensions (width/height)
//
rmhd = (const RoomHeader *)(roomptr + 4);
-
+
if (_version == 1) {
if (_platform == Common::kPlatformNES) {
_roomWidth = READ_LE_UINT16(&(rmhd->old.width)) * 8;
diff --git a/scumm/saveload.cpp b/scumm/saveload.cpp
index a8c3254cd1..e380423908 100644
--- a/scumm/saveload.cpp
+++ b/scumm/saveload.cpp
@@ -127,7 +127,7 @@ bool ScummEngine::loadState(int slot, bool compat) {
delete in;
return false;
}
-
+
// Since version 52 a thumbnail is saved directly after the header
if (hdr.ver >= VER(52)) {
uint32 type;
@@ -155,7 +155,7 @@ bool ScummEngine::loadState(int slot, bool compat) {
// state for temporary state saves - such as certain cutscenes in DOTT,
// FOA, Sam and Max, etc.
//
- // Thusly, we should probably not stop music when restoring from one of
+ // Thusly, we should probably not stop music when restoring from one of
// these saves. This change stops the Mole Man theme from going quiet in
// Sam & Max when Doug tells you about the Ball of Twine, as mentioned in
// patch #886058.
@@ -183,7 +183,7 @@ bool ScummEngine::loadState(int slot, bool compat) {
memset(_inventory, 0, sizeof(_inventory[0]) * _numInventory);
memset(_newNames, 0, sizeof(_newNames[0]) * _numNewNames);
-
+
// Because old savegames won't fill the entire gfxUsageBits[] array,
// clear it here just to be sure it won't hold any unforseen garbage.
memset(gfxUsageBits, 0, sizeof(gfxUsageBits));
@@ -207,7 +207,7 @@ bool ScummEngine::loadState(int slot, bool compat) {
Serializer ser(in, 0, hdr.ver);
saveOrLoad(&ser, hdr.ver);
delete in;
-
+
// Update volume settings
setupVolumes();
@@ -222,7 +222,7 @@ bool ScummEngine::loadState(int slot, bool compat) {
// it is not, hence we check & correct it here.
if (_screenTop < 0)
_screenTop = 0;
-
+
if (hdr.ver < VER(33) && _version >= 7) {
// For a long time, we didn't set these vars to default values.
VAR(VAR_DEFAULT_TALK_DELAY) = 60;
@@ -415,7 +415,7 @@ Graphics::Surface *ScummEngine::loadThumbnailFromSlot(int slot) {
Common::InSaveFile *in;
SaveGameHeader hdr;
int len;
-
+
makeSavegameName(filename, slot, false);
if (!(in = _saveFileMan->openForLoading(filename))) {
return 0;
@@ -531,7 +531,7 @@ void ScummEngine::saveOrLoad(Serializer *s, uint32 savegameVersion) {
MKARRAY(ScummEngine, _resourceMapper[0], sleByte, 128, VER(8)),
MKARRAY(ScummEngine, _charsetColorMap[0], sleByte, 16, VER(8)),
-
+
// _charsetData grew from 10*16 to 15*16 bytes
MKARRAY_OLD(ScummEngine, _charsetData[0][0], sleByte, 10 * 16, VER(8), VER(9)),
MKARRAY(ScummEngine, _charsetData[0][0], sleByte, 15 * 16, VER(10)),
@@ -647,7 +647,7 @@ void ScummEngine::saveOrLoad(Serializer *s, uint32 savegameVersion) {
MK_OBSOLETE(ScummEngine, _cd_loops, sleInt16, VER(9), VER(9)),
MK_OBSOLETE(ScummEngine, _cd_frame, sleInt16, VER(9), VER(9)),
MK_OBSOLETE(ScummEngine, _cd_end, sleInt16, VER(9), VER(9)),
-
+
MKEND()
};
@@ -789,7 +789,7 @@ void ScummEngine::saveOrLoad(Serializer *s, uint32 savegameVersion) {
}
s->saveLoadArrayOf(_actors, _numActors, sizeof(_actors[0]), actorEntries);
-
+
//
// Save/load sound data
//
@@ -920,7 +920,7 @@ void ScummEngine::saveOrLoad(Serializer *s, uint32 savegameVersion) {
s->saveLoadArrayOf(_palManipPalette, 0x300, 1, sleByte);
s->saveLoadArrayOf(_palManipIntermediatePal, 0x600, 1, sleByte);
}
-
+
// darkenPalette was not saved before V53
if (s->isLoading() && savegameVersion < VER(53)) {
memcpy(_darkenPalette, _currentPalette, 768);
diff --git a/scumm/saveload.h b/scumm/saveload.h
index faee798a9f..8c9a6987c7 100644
--- a/scumm/saveload.h
+++ b/scumm/saveload.h
@@ -34,7 +34,7 @@ namespace Scumm {
/**
* The current savegame format version.
- * Our save/load system uses an elaborate scheme to allow us to modify the
+ * Our save/load system uses an elaborate scheme to allow us to modify the
* savegame while keeping full backward compatibility, in the sense that newer
* ScummVM versions always are able to load old savegames.
* In order to achieve that, we store a version in the savegame files, and whenever
@@ -57,7 +57,7 @@ namespace Scumm {
/**
* The OFFS macro essentially provides the functionality of offsetof(), that
- * is, it determines the offset of a struct/class member within instances of
+ * is, it determines the offset of a struct/class member within instances of
* that class.
*
* This is a place where we cheat a bit and sacrifice some potential portability
@@ -68,7 +68,7 @@ namespace Scumm {
* versions have a heuristic built in to detect "offset-of" patterns - which is exactly
* what our OFFS macro does. Now, for non-POD types this is not really legal, because
* member need not be at a fixed offset relative to the variable, even if they are in
- * current reality (many of our complex structs are non-POD; for an explanation of
+ * current reality (many of our complex structs are non-POD; for an explanation of
* what POD means refer to http://www-cpd.fnal.gov/personal/wb/boost/ISOcxx/doc/POD.html)
*/
#define OFFS(type,item) (((long)(&((type*)42)->type::item))-42)
@@ -155,7 +155,7 @@ public:
void saveBytes(void *b, int len);
void loadBytes(void *b, int len);
-
+
protected:
Common::InSaveFile *_loadStream;
Common::OutSaveFile *_saveStream;
diff --git a/scumm/script.cpp b/scumm/script.cpp
index 96b7952d58..6e85a389b4 100644
--- a/scumm/script.cpp
+++ b/scumm/script.cpp
@@ -52,7 +52,7 @@ void ScummEngine::runScript(int script, bool freezeResistant, bool recursive, in
scriptOffs = _resourceHeaderSize;
scriptType = WIO_GLOBAL;
- debugC(DEBUG_SCRIPTS, "runScript(Global-%d) from %d-%d", script,
+ debugC(DEBUG_SCRIPTS, "runScript(Global-%d) from %d-%d", script,
vm.slot[_currentScript].number, _roomResource);
} else {
scriptOffs = _localScriptOffsets[script - _numGlobalScripts];
@@ -60,7 +60,7 @@ void ScummEngine::runScript(int script, bool freezeResistant, bool recursive, in
error("Local script %d is not in room %d", script, _roomResource);
scriptType = WIO_LOCAL;
- debugC(DEBUG_SCRIPTS, "runScript(%d) from %d-%d", script,
+ debugC(DEBUG_SCRIPTS, "runScript(%d) from %d-%d", script,
vm.slot[_currentScript].number, _roomResource);
}
@@ -104,7 +104,7 @@ void ScummEngine::runObjectScript(int object, int entry, bool freezeResistant, b
}
obcd = getOBCDOffs(object);
-
+
// Find a free object slot, unless one was specified
if (slot == -1)
slot = getScriptSlot();
@@ -189,7 +189,7 @@ int ScummEngine::getVerbEntrypoint(int obj, int entry) {
break;
verbptr += 2;
} while (1);
-
+
return *(verbptr + 1);
} else {
do {
@@ -199,7 +199,7 @@ int ScummEngine::getVerbEntrypoint(int obj, int entry) {
break;
verbptr += 3;
} while (1);
-
+
if (_features & GF_SMALL_HEADER)
return READ_LE_UINT16(verbptr + 1);
else
@@ -322,7 +322,7 @@ void ScummEngine::runScriptNested(int script) {
}
vm.numNestedScripts++;
-
+
if (vm.numNestedScripts > ARRAYSIZE(vm.nest))
error("Too many nested scripts");
@@ -420,7 +420,7 @@ void ScummEngine::getScriptBaseAddress() {
default:
error("Bad type while getting base address");
}
-
+
// The following fixes bug #1202487. Confirmed against disasm.
if (_version <= 2 && _scriptOrgPointer == NULL) {
ss->status = ssDead;
@@ -439,11 +439,11 @@ void ScummEngine::getScriptEntryPoint() {
void ScummEngine::executeScript() {
int c;
while (_currentScript != 0xFF) {
-
+
if (_showStack == 1) {
printf("Stack:");
for (c=0; c < _scummStackPos; c++) {
- printf(" %d", _vmStack[c]);
+ printf(" %d", _vmStack[c]);
}
printf("\n");
}
@@ -513,11 +513,11 @@ int ScummEngine::readVar(uint var) {
if (VAR_SUBTITLES != 0xFF && var == VAR_SUBTITLES) {
return ConfMan.getBool("subtitles");
- }
+ }
if (VAR_NOSUBTITLES != 0xFF && var == VAR_NOSUBTITLES) {
- return !ConfMan.getBool("subtitles");
+ return !ConfMan.getBool("subtitles");
}
-
+
checkRange(_numVariables - 1, 0, var, "Variable %d out of range(r)");
return _scummVars[var];
}
@@ -528,7 +528,7 @@ int ScummEngine::readVar(uint var) {
checkRange(_numRoomVariables - 1, 0, var, "Room variable %d out of range(w)");
return _roomVars[var];
- } else if ((_gameId == GID_ZAK256) || (_features & GF_OLD_BUNDLE) ||
+ } else if ((_gameId == GID_ZAK256) || (_features & GF_OLD_BUNDLE) ||
(_gameId == GID_LOOM && (_platform == Common::kPlatformFMTowns))) {
int bit = var & 0xF;
var = (var >> 4) & 0xFF;
@@ -629,7 +629,7 @@ void ScummEngine::writeVar(uint var, int value) {
} else {
var &= 0x7FFF;
checkRange(_numBitVariables - 1, 0, var, "Bit variable %d out of range(w)");
-
+
if (value)
_bitVars[var >> 3] |= (1 << (var & 7));
else
@@ -767,7 +767,7 @@ void ScummEngine::unfreezeScripts() {
}
return;
}
-
+
for (i = 0; i < NUM_SCRIPT_SLOT; i++) {
if (vm.slot[i].status & 0x80) {
if (!--vm.slot[i].freezeCount) {
@@ -933,7 +933,7 @@ void ScummEngine::doSentence(int verb, int objectA, int objectB) {
if (_sentenceNum) {
st = &_sentence[_sentenceNum - 1];
-
+
// Check if this doSentence request is identical to the previous one;
// if yes, ignore this invocation.
if (_sentenceNum && st->verb == verb && st->objectA == objectA && st->objectB == objectB)
@@ -1196,7 +1196,7 @@ void ScummEngine::beginOverride() {
// why we record the current script position in vm.cutScenePtr).
fetchScriptByte();
fetchScriptWord();
-
+
// This is based on disassembly
VAR(VAR_OVERRIDE) = 0;
}
@@ -1207,7 +1207,7 @@ void ScummEngine::endOverride() {
vm.cutScenePtr[idx] = 0;
vm.cutSceneScript[idx] = 0;
-
+
if (_version > 3)
VAR(VAR_OVERRIDE) = 0;
}
diff --git a/scumm/script_c64.cpp b/scumm/script_c64.cpp
index 8f182af6ea..c0c5fc2e51 100644
--- a/scumm/script_c64.cpp
+++ b/scumm/script_c64.cpp
@@ -557,10 +557,10 @@ void ScummEngine_c64::o_lights() {
// 1 Flashlight
// 2 Lighted area
if (a == 2)
- VAR(VAR_CURRENT_LIGHTS) = 11;
+ VAR(VAR_CURRENT_LIGHTS) = 11;
else if (a == 1)
VAR(VAR_CURRENT_LIGHTS) = 4;
- else
+ else
VAR(VAR_CURRENT_LIGHTS) = 0;
_fullRedraw = 1;
diff --git a/scumm/script_v100he.cpp b/scumm/script_v100he.cpp
index ea009a56b3..159ce4566f 100644
--- a/scumm/script_v100he.cpp
+++ b/scumm/script_v100he.cpp
@@ -413,7 +413,7 @@ void ScummEngine_v100he::o100_actorOps() {
a->_needRedraw = true;
a->_needBgReset = true;
break;
- case 9:
+ case 9:
a->drawActorToBackBuf(a->_pos.x, a->_pos.y);
break;
case 14:
@@ -742,7 +742,7 @@ void ScummEngine_v100he::o100_dim2dimArray() {
case 42: // SO_INT_ARRAY
data = kIntArray;
break;
- case 43:
+ case 43:
data = kDwordArray;
break;
case 44: // SO_NIBBLE_ARRAY
@@ -1621,7 +1621,7 @@ void ScummEngine_v100he::o100_roomOps() {
}
void ScummEngine_v100he::o100_startSound() {
- byte filename[260];
+ byte filename[260];
int var, value;
byte subOp = fetchScriptByte();
@@ -1699,7 +1699,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() {
case 0:
_curMaxSpriteId = pop();
_curSpriteId = pop();
-
+
if (_curSpriteId > _curMaxSpriteId)
SWAP(_curSpriteId, _curMaxSpriteId);
break;
@@ -1767,7 +1767,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() {
int code = *p;
if (code == 0) {
for (int i = _curSpriteId; i <= _curMaxSpriteId; ++i) {
- _sprite->setSpriteResetClass(i);
+ _sprite->setSpriteResetClass(i);
}
} else if (code & 0x80) {
for (int i = _curSpriteId; i <= _curMaxSpriteId; ++i) {
@@ -2410,7 +2410,7 @@ void ScummEngine_v100he::o100_getWizData() {
byte subOp = fetchScriptByte();
subOp -= 20;
-
+
switch (subOp) {
case 0:
y = pop();
@@ -2418,7 +2418,7 @@ void ScummEngine_v100he::o100_getWizData() {
state = pop();
resId = pop();
push(_wiz->getWizPixelColor(resId, state, x, y, 0));
- break;
+ break;
case 6:
resId = pop();
push(_wiz->getWizImageStates(resId));
@@ -2442,7 +2442,7 @@ void ScummEngine_v100he::o100_getWizData() {
pop();
push(0);
warning("o100_getWizData() case 34 unhandled");
- break;
+ break;
case 64:
state = pop();
resId = pop();
@@ -2454,7 +2454,7 @@ void ScummEngine_v100he::o100_getWizData() {
resId = pop();
_wiz->loadImgSpot(resId, state, x, y);
push(x);
- break;
+ break;
case 66:
state = pop();
resId = pop();
@@ -2479,8 +2479,8 @@ void ScummEngine_v100he::o100_getWizData() {
_wiz->getWizImageDim(resId, state, w, h);
x = 0;
y = 0;
- }
- push(computeWizHistogram(resId, state, x, y, w, h));
+ }
+ push(computeWizHistogram(resId, state, x, y, w, h));
break;
default:
error("o100_getWizData: Unknown case %d", subOp);
@@ -2870,7 +2870,7 @@ void ScummEngine_v100he::decodeParseString(int m, int n) {
colors = pop();
if (colors == 1) {
_string[m].color = pop();
- } else {
+ } else {
push(colors);
getStackList(args, ARRAYSIZE(args));
for (i = 0; i < 16; i++)
diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp
index cf7b55200d..a5b371929f 100644
--- a/scumm/script_v2.cpp
+++ b/scumm/script_v2.cpp
@@ -407,7 +407,7 @@ void ScummEngine_v2::decodeParseString() {
if (insertSpace)
*ptr++ = ' ';
-
+
}
*ptr = 0;
@@ -525,7 +525,7 @@ void ScummEngine_v2::o2_assignVarByte() {
void ScummEngine_v2::o2_setObjPreposition() {
int obj = getVarOrDirectWord(PARAM_1);
int unk = fetchScriptByte();
-
+
if (_platform == Common::kPlatformNES)
return;
@@ -663,7 +663,7 @@ void ScummEngine_v2::o2_waitForActor() {
}
void ScummEngine_v2::o2_waitForMessage() {
-
+
if (VAR(VAR_HAVE_MSG)) {
_scriptPointer--;
o5_breakHere();
@@ -800,7 +800,7 @@ void ScummEngine_v2::o2_resourceRoutines() {
void ScummEngine_v2::o2_verbOps() {
int verb = fetchScriptByte();
int slot, state;
-
+
switch (verb) {
case 0: // SO_DELETE_VERBS
slot = getVarOrDirectByte(PARAM_1) + 1;
@@ -809,14 +809,14 @@ void ScummEngine_v2::o2_verbOps() {
//printf("o2_verbOps delete slot = %d\n", slot);
killVerb(slot);
break;
-
+
case 0xFF: // Verb On/Off
verb = fetchScriptByte();
state = fetchScriptByte();
slot = getVerbSlot(verb, 0);
//printf("o2_verbOps Verb On/Off: verb = %d, slot = %d, state = %d\n", verb, slot, state);
-
+
_verbs[slot].curmode = state;
break;
@@ -861,7 +861,7 @@ void ScummEngine_v2::o2_verbOps() {
vs->center = 0;
vs->imgindex = 0;
vs->prep = prep;
-
+
vs->curRect.left = x;
vs->curRect.top = y;
@@ -919,7 +919,7 @@ void ScummEngine_v2::o2_doSentence() {
case 1:
// Execute the sentence
_sentenceNum--;
-
+
if (st->verb == 254) {
ScummEngine::stopObjectScript(st->objectA);
} else {
@@ -927,7 +927,7 @@ void ScummEngine_v2::o2_doSentence() {
bool isSpecialVerb;
if (st->verb != 253 && st->verb != 250) {
VAR(VAR_ACTIVE_VERB) = st->verb;
- VAR(VAR_ACTIVE_OBJECT1) = st->objectA;
+ VAR(VAR_ACTIVE_OBJECT1) = st->objectA;
VAR(VAR_ACTIVE_OBJECT2) = st->objectB;
isBackgroundScript = false;
@@ -997,7 +997,7 @@ void ScummEngine_v2::o2_drawSentence() {
strcat(sentence, " ");
strcat(sentence, (const char*)temp);
}
-
+
// For V1 games, the engine must compute the preposition.
// In all other Scumm versions, this is done by the sentence script.
if ((_gameId == GID_MANIAC && _version == 1 && !(_platform == Common::kPlatformNES)) && (VAR(VAR_SENTENCE_PREPOSITION) == 0)) {
@@ -1050,7 +1050,7 @@ void ScummEngine_v2::o2_drawSentence() {
_string[2].color = 0;
} else if (_version == 1)
_string[2].color = 16;
- else
+ else
_string[2].color = 13;
char *ptr = sentence;
@@ -1307,10 +1307,10 @@ void ScummEngine_v2::o2_lights() {
// 1 Flashlight
// 2 Lighted area
if (a == 2)
- VAR(VAR_CURRENT_LIGHTS) = 11;
+ VAR(VAR_CURRENT_LIGHTS) = 11;
else if (a == 1)
VAR(VAR_CURRENT_LIGHTS) = 4;
- else
+ else
VAR(VAR_CURRENT_LIGHTS) = 0;
} else
VAR(VAR_CURRENT_LIGHTS) = a;
@@ -1450,12 +1450,12 @@ void ScummEngine_v2::o2_endCutscene() {
VAR(VAR_OVERRIDE) = 0;
vm.cutSceneScript[0] = 0;
vm.cutScenePtr[0] = 0;
-
+
VAR(VAR_CURSORSTATE) = vm.cutSceneData[1];
// Reset user state to values before cutscene
setUserState(vm.cutSceneData[0] | 7);
-
+
if ((_gameId == GID_MANIAC) && !(_platform == Common::kPlatformNES)) {
camera._mode = (byte) vm.cutSceneData[3];
if (camera._mode == kFollowActorCameraMode) {
diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp
index 6abebf7fe6..83336c924e 100644
--- a/scumm/script_v5.cpp
+++ b/scumm/script_v5.cpp
@@ -607,7 +607,7 @@ void ScummEngine_v5::o5_animateActor() {
if (_gameId == GID_INDY4 && vm.slot[_currentScript].number == 206 && _currentRoom == 17 && (act == 31 || act == 86)) {
return;
}
-
+
Actor *a = derefActor(act, "o5_animateActor");
a->animateActor(anim);
}
@@ -860,14 +860,14 @@ void ScummEngine_v5::o5_drawObject() {
void ScummEngine_v5::o5_getStringWidth() {
int string, width = 0;
byte *ptr;
-
+
getResultPos();
string = getVarOrDirectByte(PARAM_1);
ptr = getResourceAddress(rtString, string);
assert(ptr);
width = _charset->getStringWidth(0, ptr);
-
+
setResult(width);
warning("o5_getStringWidth, result %d", width);
}
@@ -1056,14 +1056,14 @@ void ScummEngine_v5::o5_getActorRoom() {
setResult(0);
return;
}
-
+
Actor *a = derefActor(act, "o5_getActorRoom");
setResult(a->_room);
}
void ScummEngine_v5::o5_getActorScale() {
Actor *a;
-
+
// INDY3 uses this opcode for waitForActor
if (_gameId == GID_INDY3) {
const byte *oldaddr = _scriptPointer - 1;
@@ -1130,7 +1130,7 @@ void ScummEngine_v5::o5_saveLoadGame() {
byte a = getVarOrDirectByte(PARAM_1);
byte slot = (a & 0x1F) + 1;
byte result = 0;
-
+
if ((_gameId == GID_MANIAC) && (_version == 1)) {
// Convert older load/save screen
// 1 Load
@@ -1187,13 +1187,13 @@ void ScummEngine_v5::o5_saveLoadGame() {
setResult(result);
}
-
+
void ScummEngine_v5::o5_getAnimCounter() {
if (_version == 3) {
o5_saveLoadGame();
return;
}
-
+
getResultPos();
int act = getVarOrDirectByte(PARAM_1);
@@ -1477,7 +1477,7 @@ void ScummEngine_v5::o5_loadRoom() {
int room;
room = getVarOrDirectByte(PARAM_1);
-
+
if (!_copyProtection) {
// Skip copy protection scheme
if (_gameId == GID_INDY3 && (_features & GF_OLD_BUNDLE) && room == 92) {
@@ -1672,7 +1672,7 @@ void ScummEngine_v5::o5_putActorInRoom() {
int room = getVarOrDirectByte(PARAM_2);
a = derefActor(act, "o5_putActorInRoom");
-
+
if (a->_visible && _currentRoom != room && getTalkingActor() == a->_number) {
stopTalk();
}
@@ -1807,14 +1807,14 @@ void ScummEngine_v5::o5_resourceRoutines() {
warning("o5_resourceRoutines %d not yet handled (script %d)", op, vm.slot[_currentScript].number);
break;
case 36:
- // TODO: Sets the loudness of a sound resource. Used in Indy3 and Zak.
+ // TODO: Sets the loudness of a sound resource. Used in Indy3 and Zak.
foo = getVarOrDirectByte(PARAM_2);
bar = fetchScriptByte();
warning("o5_resourceRoutines %d not yet handled (script %d)", op, vm.slot[_currentScript].number);
break;
case 37:
// TODO: Sets the pitch of a sound resource (pitch = foo - center semitones.
- // "center" is at 0x32 in the sfx resource (always 0x3C in zak256, but sometimes different in Indy3).
+ // "center" is at 0x32 in the sfx resource (always 0x3C in zak256, but sometimes different in Indy3).
foo = getVarOrDirectByte(PARAM_2);
warning("o5_resourceRoutines %d not yet handled (script %d)", op, vm.slot[_currentScript].number);
break;
@@ -2158,8 +2158,8 @@ void ScummEngine_v5::o5_startMusic() {
break;
default:
// TODO: return track length in seconds. We'll have to extend Sound and OSystem for this.
- // To check scummvm returns the right track length you
- // can look at the global script #9 (0x888A in 49.LFL).
+ // To check scummvm returns the right track length you
+ // can look at the global script #9 (0x888A in 49.LFL).
break;
}
debugC(DEBUG_GENERAL,"o5_startMusic(%d)", b);
@@ -2570,7 +2570,7 @@ void ScummEngine_v5::o5_walkActorToActor() {
warning("Bypassing Indy4 bug");
return;
}
-
+
if (_gameId == GID_LOOM256 && nr == 1 && nr2 == 0 &&
dist == 255 && vm.slot[_currentScript].number == 98) {
// WORKAROUND bug #743615: LoomCD script 98 contains this:
@@ -2719,7 +2719,7 @@ void ScummEngine_v5::decodeParseString() {
// Slightly increase the delay (5 frames = 1/25 of a second).
// This noticably improves the experience in Loom CD.
delay = (int)(delay * 7.5 + 5);
-
+
_sound->playCDTrack(1, 0, offset, delay);
}
} else {
@@ -2779,7 +2779,7 @@ void ScummEngine_v5::o5_oldRoomEffect() {
// some stubs here, but somebody with a full IDA or more knowledge
// about this will have to fill in the gaps. At least now we know
// that something is missing here :-)
-
+
if (a == 4) {
printf("o5_oldRoomEffect ODDBALL: _opcode = 0x%x, a = 0x%x\n", _opcode, a);
// No idea what byte_2FCCF is, but it's a globale boolean flag.
@@ -2788,38 +2788,38 @@ void ScummEngine_v5::o5_oldRoomEffect() {
// how it is used? It might also correspond to _screenEffectFlag.
int byte_2FCCF = 0;
- // For now, we force a redraw of the screen background. This
+ // For now, we force a redraw of the screen background. This
// Makes the Zak end credits work more or less correctly.
VirtScreen *vs = &virtscr[0];
restoreBG(Common::Rect(0,vs->topline, vs->w, vs->topline + vs->h));
vs->setDirtyRange(0, vs->h);
updateDirtyScreen(kMainVirtScreen);
-
+
if (byte_2FCCF) {
// Here now "sub_1C44" is called, which sets byte_2FCCF to 0 then
// calls yet another sub (which also reads byte_2FCCF):
byte_2FCCF = 0;
//call sub_0BB3
-
-
- // Now sub_085C is called. This is quite simply: it sets
+
+
+ // Now sub_085C is called. This is quite simply: it sets
// 0xF000 bytes. starting at 0x40000 to 0. No idea what that
// buffer is, maybe a screen buffer, though. Note that
// 0xF000 = 320*192.
// Maybe this is also the charset mask being cleaned?
-
+
// call sub_085C
-
+
// And then sub_1C54 is called, which is almost identical to
// the above sub_1C44, only it sets byte_2FCCF to 1:
-
+
byte_2FCCF = 1;
// call sub_0BB3
} else {
- // Here only sub_085C is called (see comment above)
+ // Here only sub_085C is called (see comment above)
// call sub_085C
}
diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp
index 601471eefc..38b41bb668 100644
--- a/scumm/script_v6.cpp
+++ b/scumm/script_v6.cpp
@@ -399,10 +399,10 @@ ScummEngine_v6::ArrayHeader *ScummEngine_v6::defineArray(int array, int type, in
int id;
int size;
ArrayHeader *ah;
-
+
assert(0 <= type && type <= 5);
-
+
if (_heversion >= 61) {
if (type == kBitArray || type == kNibbleArray)
type = kByteArray;
@@ -424,7 +424,7 @@ ScummEngine_v6::ArrayHeader *ScummEngine_v6::defineArray(int array, int type, in
if (_version == 8) {
if (array & 0x40000000) {
}
-
+
if (array & 0x80000000) {
error("Can't define bit variable as array pointer");
}
@@ -433,7 +433,7 @@ ScummEngine_v6::ArrayHeader *ScummEngine_v6::defineArray(int array, int type, in
} else {
if (array & 0x4000) {
}
-
+
if (array & 0x8000) {
error("Can't define bit variable as array pointer");
}
@@ -486,7 +486,7 @@ ScummEngine_v6::ArrayHeader *ScummEngine_v6::getArray(int array) {
ArrayHeader *ah = (ArrayHeader *)getResourceAddress(rtString, readVar(array));
if (!ah)
return 0;
-
+
// Workaround for a long standing bug where we save array headers in native
// endianness, instead of a fixed endianness. We try to detect savegames
// which were created on a big endian system and convert them to little
@@ -496,7 +496,7 @@ ScummEngine_v6::ArrayHeader *ScummEngine_v6::getArray(int array) {
SWAP16(ah->dim2);
SWAP16(ah->type);
}
-
+
return ah;
}
@@ -505,7 +505,7 @@ int ScummEngine_v6::readArray(int array, int idx, int base) {
if (ah == NULL || ah->data == NULL)
error("readArray: invalid array %d (%d)", array, readVar(array));
-
+
// WORKAROUND bug #645711. This is clearly a script bug, as this script
// excerpt shows nicely:
// ...
@@ -814,10 +814,10 @@ void ScummEngine_v6::o6_startScript() {
getStackList(args, ARRAYSIZE(args));
script = pop();
flags = pop();
-
+
// WORKAROUND bug #556558: At Dino Bungee National Memorial, the buttons for
- // the Wally and Rex dinosaurs will always restart their speech, instead of
- // stopping and starting their speech. This was a script bug in the original
+ // the Wally and Rex dinosaurs will always restart their speech, instead of
+ // stopping and starting their speech. This was a script bug in the original
// game.
if (_gameId == GID_SAMNMAX && _roomResource == 59 &&
vm.slot[_currentScript].number == 201 && script == 48) {
@@ -841,7 +841,7 @@ void ScummEngine_v6::o6_startScript() {
return;
}
-
+
runScript(script, (flags & 1) != 0, (flags & 2) != 0, args);
}
@@ -1090,7 +1090,7 @@ void ScummEngine_v6::o6_startSound() {
#ifndef DISABLE_SCUMM_7_8
if (_features & GF_DIGI_IMUSE)
_imuseDigital->startSfx(pop(), 64);
- else
+ else
#endif
_sound->addSoundToQueue(pop(), offset);
}
@@ -2117,7 +2117,7 @@ void ScummEngine_v6::o6_saveRestoreVerbs() {
if (_version == 8) {
subOp = (subOp - 141) + 0xB4;
}
-
+
switch (subOp) {
case 141: // SO_SAVE_VERBS
while (a <= b) {
@@ -2298,7 +2298,7 @@ void ScummEngine_v6::o6_delaySeconds() {
// FIXME - are we really measuring minutes here?
delay = delay * 60;
else
- // FIXME - Is this the same in ComI? Seem to need a 1.5 minute
+ // FIXME - Is this the same in ComI? Seem to need a 1.5 minute
// multiplier for correct timing - see patch 664893
delay = delay * 90;
@@ -2495,7 +2495,7 @@ void ScummEngine_v6::o6_kernelSetFunctions() {
break;
#ifndef DISABLE_SCUMM_7_8
case 6: {
- if (_smushFrameRate == 0)
+ if (_smushFrameRate == 0)
_smushFrameRate = 14;
// SMUSH movie playback
@@ -2514,7 +2514,7 @@ void ScummEngine_v6::o6_kernelSetFunctions() {
sp->play((char *)getStringAddressVar(VAR_VIDEONAME));
delete sp;
} else if (_gameId == GID_FT) {
- const int insaneVarNum = ((_features & GF_DEMO) && (_platform == Common::kPlatformPC))
+ const int insaneVarNum = ((_features & GF_DEMO) && (_platform == Common::kPlatformPC))
? 232 : 233;
_insaneRunning = true;
@@ -2825,7 +2825,7 @@ int ScummEngine::getKeyState(int key) {
_keyDownMap[0x36]) ? 1 : 0;
break;
case 0x14E: // Gray+
- return (_keyDownMap[0x10e] ||
+ return (_keyDownMap[0x10e] ||
(_keyDownMap[0x13d] && _keyDownMap[0x12f])) ? 1 : 0;
break;
case 0x14F: // End
@@ -2927,7 +2927,7 @@ void ScummEngine_v6::o6_stampObject() {
a->drawActorCostume();
return;
}
-
+
if (state == 0)
state = 1;
@@ -2957,12 +2957,12 @@ void ScummEngine_v6::o6_findAllObjects() {
writeVar(0, 0);
defineArray(0, kIntArray, 0, _numLocalObjects + 1);
writeArray(0, 0, 0, _numLocalObjects);
-
+
while (i < _numLocalObjects) {
writeArray(0, 0, i, _objs[i].obj_nr);
i++;
}
-
+
push(readVar(0));
}
@@ -2975,7 +2975,7 @@ void ScummEngine_v6::shuffleArray(int num, int minIdx, int maxIdx) {
// Determine two random elements...
int rand1 = _rnd.getRandomNumber(range) + minIdx;
int rand2 = _rnd.getRandomNumber(range) + minIdx;
-
+
// ...and swap them
int val1 = readArray(num, 0, rand1);
int val2 = readArray(num, 0, rand2);
@@ -3035,7 +3035,7 @@ void ScummEngine_v6::o6_pickVarRandom() {
void ScummEngine_v6::o6_getDateTime() {
struct tm *t;
time_t now = time(NULL);
-
+
t = localtime(&now);
VAR(VAR_TIMEDATE_YEAR) = t->tm_year;
@@ -3043,7 +3043,7 @@ void ScummEngine_v6::o6_getDateTime() {
VAR(VAR_TIMEDATE_DAY) = t->tm_mday;
VAR(VAR_TIMEDATE_HOUR) = t->tm_hour;
VAR(VAR_TIMEDATE_MINUTE) = t->tm_min;
-
+
if (_version == 8)
VAR(VAR_TIMEDATE_SECOND) = t->tm_sec;
}
diff --git a/scumm/script_v6he.cpp b/scumm/script_v6he.cpp
index 174c5dadd8..2746a858ae 100644
--- a/scumm/script_v6he.cpp
+++ b/scumm/script_v6he.cpp
@@ -555,7 +555,7 @@ void ScummEngine_v60he::o60_roomOps() {
void ScummEngine_v60he::swapObjects(int object1, int object2) {
int idx1 = -1, idx2 = -1;
-
+
for (int i = 0; i < _numObjectsInRoom; i++) {
if (_objs[i].obj_nr == object1)
idx1 = i;
@@ -563,7 +563,7 @@ void ScummEngine_v60he::swapObjects(int object1, int object2) {
if (_objs[i].obj_nr == object2)
idx2 = i;
}
-
+
if (idx1 == -1 || idx2 == -1 || idx1 >= idx2)
return;
@@ -711,7 +711,7 @@ void ScummEngine_v60he::o60_actorOps() {
case 217: // SO_ACTOR_NEW
a->initActor(2);
break;
- case 218:
+ case 218:
a->drawActorToBackBuf(a->_pos.x, a->_pos.y);
break;
case 219:
@@ -881,7 +881,7 @@ int ScummEngine_v60he::virtScreenSave(byte *dst, int x1, int y1, int x2, int y2)
for (int j = y1; j <= y2; ++j) {
uint8 *p = vs.getBackPixels(x1, j - vs.topline);
-
+
int size = virtScreenSavePack(dst, p, x2 - x1 + 1, 0);
if (dst != 0) {
dst += size;
@@ -901,10 +901,10 @@ int virtScreenSavePack(byte *dst, byte *src, int len, int unk) {
int flag = 0;
int iend = 1;
int ibeg = 0;
-
+
for (--len; len != 0; --len, prevByte = curByte) {
bool pass = false;
-
+
assert(iend < 0x100);
ctx.buf[iend] = curByte = *src++;
++iend;
@@ -975,7 +975,7 @@ void virtScreenSavePackByte(vsPackCtx *ctx, uint8 *&dst, int len, uint8 b) {
if (dst) {
*dst++ = b;
}
- ++ctx->size;
+ ++ctx->size;
}
void ScummEngine_v60he::o60_openFile() {
@@ -986,12 +986,12 @@ void ScummEngine_v60he::o60_openFile() {
len = resStrLen(_scriptPointer);
_scriptPointer += len + 1;
-
+
for (r = strlen((char*)filename); r != 0; r--) {
if (filename[r - 1] == '\\')
break;
}
-
+
mode = pop();
slot = -1;
for (l = 0; l < 17; l++) {
@@ -1290,7 +1290,7 @@ void ScummEngine_v60he::decodeParseString(int m, int n) {
colors = pop();
if (colors == 1) {
_string[m].color = pop();
- } else {
+ } else {
push(colors);
getStackList(args, ARRAYSIZE(args));
for (i = 0; i < 16; i++)
diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp
index 061b23d2cc..db399abcdc 100644
--- a/scumm/script_v72he.cpp
+++ b/scumm/script_v72he.cpp
@@ -384,12 +384,12 @@ ScummEngine_v72he::ArrayHeader *ScummEngine_v72he::defineArray(int array, int ty
int id;
int size;
ArrayHeader *ah;
-
+
assert(dim2start >= 0 && dim2start <= dim2end);
assert(dim1start >= 0 && dim1start <= dim1end);
assert(0 <= type && type <= 6);
-
+
if (type == kBitArray || type == kNibbleArray)
type = kByteArray;
@@ -433,7 +433,7 @@ int ScummEngine_v72he::readArray(int array, int idx2, int idx1) {
if (ah == NULL || ah->data == NULL)
error("readArray: invalid array %d (%d)", array, readVar(array));
- if (idx2 < (int)FROM_LE_32(ah->dim2start) || idx2 > (int)FROM_LE_32(ah->dim2end) ||
+ if (idx2 < (int)FROM_LE_32(ah->dim2start) || idx2 > (int)FROM_LE_32(ah->dim2end) ||
idx1 < (int)FROM_LE_32(ah->dim1start) || idx1 > (int)FROM_LE_32(ah->dim1end)) {
error("readArray: array %d out of bounds: [%d, %d] exceeds [%d..%d, %d..%d]",
array, idx1, idx2, FROM_LE_32(ah->dim1start), FROM_LE_32(ah->dim1end),
@@ -469,7 +469,7 @@ void ScummEngine_v72he::writeArray(int array, int idx2, int idx1, int value) {
if (!ah)
error("writeArray: Invalid array (%d) reference", readVar(array));
- if (idx2 < (int)FROM_LE_32(ah->dim2start) || idx2 > (int)FROM_LE_32(ah->dim2end) ||
+ if (idx2 < (int)FROM_LE_32(ah->dim2start) || idx2 > (int)FROM_LE_32(ah->dim2end) ||
idx1 < (int)FROM_LE_32(ah->dim1start) || idx1 > (int)FROM_LE_32(ah->dim1end)) {
error("writeArray: array %d out of bounds: [%d, %d] exceeds [%d..%d, %d..%d]",
array, idx1, idx2, FROM_LE_32(ah->dim1start), FROM_LE_32(ah->dim1end),
@@ -555,7 +555,7 @@ int ScummEngine_v72he::convertFilePath(byte *dst, bool setFilePath) {
}
return r;
-}
+}
void ScummEngine_v72he::copyScriptString(byte *dst, int dstSize) {
byte string[1024];
@@ -709,7 +709,7 @@ byte *ScummEngine_v70he::findWrappedBlock(uint32 tag, byte *ptr, int state, bool
size = getResourceDataSize(offs) / 4;
assert((uint32)state <= (uint32)size);
-
+
offs += READ_LE_UINT32(offs + state * sizeof(uint32));
offs = heFindResourceData(tag, offs - 8);
@@ -859,7 +859,7 @@ void ScummEngine_v72he::o72_captureWizImage() {
grab.right = pop() + 1;
grab.top = pop();
grab.left = pop();
- _wiz->captureWizImage(pop(), grab, false, true);
+ _wiz->captureWizImage(pop(), grab, false, true);
}
void ScummEngine_v72he::o72_getTimer() {
@@ -1291,7 +1291,7 @@ void ScummEngine_v72he::o72_actorOps() {
case 217: // SO_ACTOR_NEW
a->initActor(2);
break;
- case 218:
+ case 218:
a->drawActorToBackBuf(a->_pos.x, a->_pos.y);
break;
case 219:
@@ -1680,7 +1680,7 @@ void ScummEngine_v72he::o72_dim2dimArray() {
case 5: // SO_INT_ARRAY
data = kIntArray;
break;
- case 6:
+ case 6:
data = kDwordArray;
break;
case 7: // SO_STRING_ARRAY
@@ -1894,11 +1894,11 @@ void ScummEngine_v72he::o72_findAllObjects() {
writeVar(0, 0);
defineArray(0, kDwordArray, 0, 0, 0, _numLocalObjects);
writeArray(0, 0, 0, _numLocalObjects);
-
+
for (i = 1; i < _numLocalObjects; i++) {
writeArray(0, 0, i, _objs[i].obj_nr);
}
-
+
push(readVar(0));
}
@@ -2009,7 +2009,7 @@ void ScummEngine_v72he::o72_redimArray() {
}
}
-void ScummEngine_v72he::redimArray(int arrayId, int newDim2start, int newDim2end,
+void ScummEngine_v72he::redimArray(int arrayId, int newDim2start, int newDim2end,
int newDim1start, int newDim1end, int type) {
int newSize, oldSize;
@@ -2055,7 +2055,7 @@ void ScummEngine_v72he::checkArrayLimits(int array, int dim2start, int dim2end,
}
}
-void ScummEngine_v72he::copyArray(int array1, int a1_dim2start, int a1_dim2end, int a1_dim1start, int a1_dim1end,
+void ScummEngine_v72he::copyArray(int array1, int a1_dim2start, int a1_dim2end, int a1_dim1start, int a1_dim1end,
int array2, int a2_dim2start, int a2_dim2end, int a2_dim1start, int a2_dim1end)
{
debug(5, "ScummEngine_v72he::copyArray(%d, [%d,%d,%d,%d], %d, [%d,%d,%d,%d])", array1, a1_dim2start, a1_dim2end, a1_dim1start, a1_dim1end, array2, a2_dim2start, a2_dim2end, a2_dim1start, a2_dim1end);
@@ -2065,12 +2065,12 @@ void ScummEngine_v72he::copyArray(int array1, int a1_dim2start, int a1_dim2end,
checkArrayLimits(array1, a1_dim2start, a1_dim2end, a1_dim1start, a1_dim1end);
checkArrayLimits(array2, a2_dim2start, a2_dim2end, a2_dim1start, a2_dim1end);
int a12_num = a1_dim2end - a1_dim2start + 1;
- int a11_num = a1_dim1end - a1_dim1start + 1;
+ int a11_num = a1_dim1end - a1_dim1start + 1;
int a22_num = a2_dim2end - a2_dim2start + 1;
int a21_num = a2_dim1end - a2_dim1start + 1;
if (a22_num != a12_num || a21_num != a11_num) {
warning("Operation size mismatch (%d vs %d)(%d vs %d)", a12_num, a22_num, a11_num, a21_num);
- }
+ }
if (array1 != array2) {
ArrayHeader *ah1 = (ArrayHeader *)getResourceAddress(rtString, readVar(array1));
@@ -2104,7 +2104,7 @@ void ScummEngine_v72he::copyArray(int array1, int a1_dim2start, int a1_dim2end,
copyArrayHelper(ah, a2_dim2start, a2_dim1start, a2_dim1end, &src, &srcPitch, &rowSize);
} else {
copyArrayHelper(ah, a1_dim2end, a1_dim1start, a1_dim1end, &dst, &dstPitch, &rowSize);
- copyArrayHelper(ah, a2_dim2end, a2_dim1start, a2_dim1end, &src, &srcPitch, &rowSize);
+ copyArrayHelper(ah, a2_dim2end, a2_dim1start, a2_dim1end, &src, &srcPitch, &rowSize);
}
for (; a1_dim2start <= a1_dim2end; ++a1_dim2start) {
memcpy(dst, src, rowSize);
@@ -2238,7 +2238,7 @@ void ScummEngine_v72he::o72_writeINI() {
if (!strcmp((char *)option, "DownLoadPath") || !strcmp((char *)option, "GameResourcePath") || !strcmp((char *)option, "SaveGamePath"))
return;
- ConfMan.set((char *)option, (char *)string);
+ ConfMan.set((char *)option, (char *)string);
break;
default:
error("o72_writeINI: default type %d", type);
@@ -2359,7 +2359,7 @@ void ScummEngine_v72he::decodeParseString(int m, int n) {
colors = pop();
if (colors == 1) {
_string[m].color = pop();
- } else {
+ } else {
push(colors);
getStackList(args, ARRAYSIZE(args));
for (i = 0; i < 16; i++)
diff --git a/scumm/script_v7he.cpp b/scumm/script_v7he.cpp
index 99ef7c0157..da2eef65e0 100644
--- a/scumm/script_v7he.cpp
+++ b/scumm/script_v7he.cpp
@@ -387,7 +387,7 @@ int ScummEngine_v70he::getStringCharWidth(byte chr) {
if (offs) {
spacing = ptr[offs] + (signed char)ptr[offs + 2];
}
-
+
return spacing;
}
@@ -946,7 +946,7 @@ void ScummEngine_v70he::o70_writeINI() {
int type, value;
byte option[256], string[256];
int len;
-
+
type = pop();
value = pop();
@@ -956,13 +956,13 @@ void ScummEngine_v70he::o70_writeINI() {
switch (type) {
case 1: // number
- ConfMan.set((char *)option, value);
+ ConfMan.set((char *)option, value);
break;
case 2: // string
convertMessageToString(_scriptPointer, string, sizeof(string));
len = resStrLen(_scriptPointer);
_scriptPointer += len + 1;
- ConfMan.set((char *)option, (char *)string);
+ ConfMan.set((char *)option, (char *)string);
break;
default:
error("o70_writeINI: default type %d", type);
diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp
index 33b9c18972..da6057548d 100644
--- a/scumm/script_v8.cpp
+++ b/scumm/script_v8.cpp
@@ -362,7 +362,7 @@ void ScummEngine_v8::setupOpcodes() {
OPCODE(o6_invalid),
OPCODE(o6_invalid),
};
-
+
_opcodesV8 = opcodes;
}
@@ -522,7 +522,7 @@ void ScummEngine_v8::readArrayFromIndexFile() {
while ((num = _fileHandle->readUint32LE()) != 0) {
a = _fileHandle->readUint32LE();
b = _fileHandle->readUint32LE();
-
+
if (b != 0)
defineArray(num, kIntArray, b, a);
else
@@ -591,7 +591,7 @@ void ScummEngine_v8::o8_wait() {
void ScummEngine_v8::o8_dimArray() {
byte subOp = fetchScriptByte();
int array = fetchScriptWord();
-
+
switch (subOp) {
case 0x0A: // SO_ARRAY_SCUMMVAR
defineArray(array, kIntArray, 0, pop());
@@ -610,7 +610,7 @@ void ScummEngine_v8::o8_dimArray() {
void ScummEngine_v8::o8_dim2dimArray() {
byte subOp = fetchScriptByte();
int array = fetchScriptWord(), a, b;
-
+
switch (subOp) {
case 0x0A: // SO_ARRAY_SCUMMVAR
b = pop();
@@ -636,7 +636,7 @@ void ScummEngine_v8::o8_arrayOps() {
int b, c, d, len;
ArrayHeader *ah;
int list[128];
-
+
switch (subOp) {
case 0x14: // SO_ASSIGN_STRING
b = pop();
@@ -822,7 +822,7 @@ void ScummEngine_v8::o8_resourceRoutines() {
void ScummEngine_v8::o8_roomOps() {
byte subOp = fetchScriptByte();
int a, b, c, d, e;
-
+
switch (subOp) {
case 0x52: // SO_ROOM_PALETTE Set room palette
d = pop();
@@ -1477,7 +1477,7 @@ void ScummEngine_v8::o8_getStringWidth() {
int width;
const byte *msg = _scriptPointer;
byte transBuf[512];
-
+
// Skip to the next instruction
_scriptPointer += resStrLen(_scriptPointer) + 1;
diff --git a/scumm/script_v80he.cpp b/scumm/script_v80he.cpp
index 91cfc947c5..b0960a0101 100644
--- a/scumm/script_v80he.cpp
+++ b/scumm/script_v80he.cpp
@@ -517,7 +517,7 @@ void ScummEngine_v80he::o80_writeConfigFile() {
Common::ConfigFile ConfFile;
ConfFile.loadFromFile((const char *)filename);
- ConfFile.setKey((char *)option, (char *)section, (char *)string);
+ ConfFile.setKey((char *)option, (char *)section, (char *)string);
ConfFile.saveToFile((const char *)filename);
debug(0,"o80_writeConfigFile: Filename %s Section %s Option %s String %s", filename, section, option, string);
}
@@ -595,7 +595,7 @@ void ScummEngine_v80he::o80_drawWizPolygon() {
wi.resNum = pop();
wi.state = 0;
wi.flags = kWIFIsPolygon;
- _wiz->displayWizImage(&wi);
+ _wiz->displayWizImage(&wi);
}
/**
@@ -611,7 +611,7 @@ void ScummEngine_v80he::o80_drawWizPolygon() {
* @param id the id of an actor, wizimage or color (low bit) & flag (high bit)
*/
void ScummEngine_v80he::drawLine(int x1, int y1, int x, int y, int step, int type, int id) {
- debug(0,"drawLine: x1 %d y1 %d x %d y %d, step %d type %d id %d", x1, y1, x, y, step, type, id);
+ debug(0,"drawLine: x1 %d y1 %d x %d y %d, step %d type %d id %d", x1, y1, x, y, step, type, id);
if (step < 0) {
step = -step;
@@ -697,7 +697,7 @@ void ScummEngine_v80he::drawLine(int x1, int y1, int x, int y, int step, int typ
} else {
drawPixel(x, y, id);
}
- }
+ }
}
void ScummEngine_v80he::drawPixel(int x, int y, int flags) {
diff --git a/scumm/script_v90he.cpp b/scumm/script_v90he.cpp
index e0ed6c81f4..cd48980d64 100644
--- a/scumm/script_v90he.cpp
+++ b/scumm/script_v90he.cpp
@@ -410,12 +410,12 @@ void ScummEngine_v90he::o90_max() {
void ScummEngine_v90he::o90_sin() {
double a = pop() * PI / 180.;
- push((int)(sin(a) * 100000));
+ push((int)(sin(a) * 100000));
}
void ScummEngine_v90he::o90_cos() {
double a = pop() * PI / 180.;
- push((int)(cos(a) * 100000));
+ push((int)(cos(a) * 100000));
}
void ScummEngine_v90he::o90_sqrt() {
@@ -846,7 +846,7 @@ void ScummEngine_v90he::o90_getDistanceBetweenPoints() {
push(d);
} else {
push((int)sqrt((double)(d + 1)));
- }
+ }
break;
default:
error("o90_getDistanceBetweenPoints: Unknown case %d", subOp);
@@ -1234,7 +1234,7 @@ void ScummEngine_v90he::o90_setSpriteInfo() {
if (_features & GF_HE_985 || _heversion >= 99) {
_curMaxSpriteId = pop();
_curSpriteId = pop();
-
+
if (_curSpriteId > _curMaxSpriteId)
SWAP(_curSpriteId, _curMaxSpriteId);
} else {
@@ -1373,7 +1373,7 @@ void ScummEngine_v90he::o90_setSpriteInfo() {
int code = *p;
if (code == 0) {
for (int i = _curSpriteId; i <= _curMaxSpriteId; ++i) {
- _sprite->setSpriteResetClass(i);
+ _sprite->setSpriteResetClass(i);
}
} else if (code & 0x80) {
for (int i = _curSpriteId; i <= _curMaxSpriteId; ++i) {
@@ -1740,14 +1740,14 @@ void ScummEngine_v90he::o90_getWizData() {
_wiz->getWizImageDim(resId, state, w, h);
x = 0;
y = 0;
- }
- push(computeWizHistogram(resId, state, x, y, w, h));
+ }
+ push(computeWizHistogram(resId, state, x, y, w, h));
break;
case 109:
pop();
pop();
push(0);
- break;
+ break;
case 111:
pop();
copyScriptString(filename, sizeof(filename));
@@ -1850,7 +1850,7 @@ void ScummEngine_v90he::o90_findAllObjectsWithClassOf() {
}
writeArray(0, 0, 0, numObjs);
-
+
push(readVar(0));
}
@@ -1890,7 +1890,7 @@ void ScummEngine_v90he::o90_getPolygonOverlap() {
{
Common::Rect r1(args1[0], args1[1], args1[2] + 1, args1[3] + 1);
Common::Rect r2(args2[0], args2[1], args2[2] + 1, args2[3] + 1);
- push(r2.intersects(r1) ? 1 : 0);
+ push(r2.intersects(r1) ? 1 : 0);
}
break;
case 4:
@@ -1934,13 +1934,13 @@ void ScummEngine_v90he::o90_getPolygonOverlap() {
break;
}
- if (n2 == 3) {
+ if (n2 == 3) {
r2.left += args2[1];
r2.right += args2[1];
r2.top += args2[2];
r2.bottom += args2[2];
}
- if (n1 == 3) {
+ if (n1 == 3) {
r1.left += args1[1];
r1.right += args1[1];
r1.top += args1[2];
@@ -1959,7 +1959,7 @@ void ScummEngine_v90he::o90_getPolygonOverlap() {
break;
}
- if (n2 == 3) {
+ if (n2 == 3) {
r2.left += args2[1];
r2.right += args2[1];
r2.top += args2[2];
@@ -1979,13 +1979,13 @@ void ScummEngine_v90he::o90_getPolygonOverlap() {
break;
}
- if (n2 == 3) {
+ if (n2 == 3) {
r2.left += args2[1];
r2.right += args2[1];
r2.top += args2[2];
r2.bottom += args2[2];
}
- if (n1 == 3) {
+ if (n1 == 3) {
r1.left += args1[1];
r1.right += args1[1];
r1.top += args1[2];
@@ -2004,7 +2004,7 @@ void ScummEngine_v90he::o90_getPolygonOverlap() {
break;
}
- if (n2 == 3) {
+ if (n2 == 3) {
r2.left += args2[1];
r2.right += args2[1];
r2.top += args2[2];
@@ -2105,14 +2105,14 @@ void ScummEngine_v90he::o90_getLinesIntersectionPoint() {
int line1_x2 = pop();
int line1_y1 = pop();
int line1_x1 = pop();
-
+
int result = 0;
int ix = 0;
int iy = 0;
-
+
bool isLine1Point = (line1_x1 == line1_x2 && line1_y1 == line1_y2);
bool isLine2Point = (line2_x1 == line2_x2 && line2_y1 == line2_y2);
-
+
if (isLine1Point) {
if (isLine2Point) {
if (line1_x1 == line2_x1 && line1_y1 == line2_y2) {
@@ -2179,7 +2179,7 @@ void ScummEngine_v90he::o90_getLinesIntersectionPoint() {
}
}
}
- }
+ }
} else {
// 2 lines
int dy1 = line1_y2 - line1_y1;
@@ -2316,7 +2316,7 @@ void ScummEngine_v90he::o90_sortArray() {
switch (subOp) {
case 129:
case 134: // HE100
- {
+ {
int array = fetchScriptWord();
int sortOrder = pop();
int dim1end = pop();
diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp
index b1188943ec..be7f52f4bb 100644
--- a/scumm/scumm.cpp
+++ b/scumm/scumm.cpp
@@ -271,7 +271,7 @@ static const ScummGameSettings scumm_settings[] = {
{"zoodemo", "Putt-Putt Saves the Zoo (Demo)", GID_HEGAME, 6, 72, MDT_NONE,
GF_USE_KEY | GF_NEW_COSTUMES, Common::kPlatformWindows, 0, 0},
- // Humongous Entertainment Scumm Version 8.0 ? Scummsrc.80
+ // Humongous Entertainment Scumm Version 8.0 ? Scummsrc.80
{"ff2-demo", "Freddi Fish 2: The Case of the Haunted Schoolhouse (Demo)", GID_FREDDI2, 6, 80, MDT_NONE,
GF_USE_KEY | GF_NEW_COSTUMES | GF_MULTIPLE_VERSIONS, Common::kPlatformWindows, 0, 0},
{"freddi2", "Freddi Fish 2: The Case of the Haunted Schoolhouse", GID_FREDDI2, 6, 80, MDT_NONE,
@@ -344,7 +344,7 @@ static const ScummGameSettings scumm_settings[] = {
{"f4-demo", "Freddi Fish 4: The Case of the Hogfish Rustlers of Briny Gulch (Demo)", GID_HEGAME, 6, 98, MDT_NONE,
GF_USE_KEY | GF_NEW_COSTUMES | GF_HE_985 | GF_MULTIPLE_VERSIONS, Common::kPlatformWindows, 0, 0},
- // Engine moved to c++
+ // Engine moved to c++
// Humongous Entertainment Scumm Version 9.9 ? Scummsys.99
{"smaller", "Pajama Sam's Lost & Found (Test)", GID_HEGAME, 6, 99, MDT_NONE,
GF_USE_KEY | GF_NEW_COSTUMES | GF_HE_CURSORLESS, Common::kPlatformWindows, 0, 0},
@@ -1277,7 +1277,7 @@ ScummEngine::~ScummEngine() {
free(_palManipPalette);
free(_palManipIntermediatePal);
-
+
res.freeResources();
free(_objectStateTable);
@@ -1299,7 +1299,7 @@ ScummEngine::~ScummEngine() {
delete _debugger;
}
-ScummEngine_v4::ScummEngine_v4(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16], int substResFileNameIndex)
+ScummEngine_v4::ScummEngine_v4(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16], int substResFileNameIndex)
: ScummEngine_v5(detector, syst, gs, md5sum, substResFileNameIndex) {
_resourceHeaderSize = 6;
}
@@ -1313,11 +1313,11 @@ ScummEngine_v3old::ScummEngine_v3old(GameDetector *detector, OSystem *syst, cons
_resourceHeaderSize = 4;
}
-ScummEngine_v2::ScummEngine_v2(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16], int substResFileNameIndex)
+ScummEngine_v2::ScummEngine_v2(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16], int substResFileNameIndex)
: ScummEngine_v3old(detector, syst, gs, md5sum, substResFileNameIndex) {
}
-ScummEngine_c64::ScummEngine_c64(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16], int substResFileNameIndex)
+ScummEngine_c64::ScummEngine_c64(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16], int substResFileNameIndex)
: ScummEngine_v2(detector, syst, gs, md5sum, substResFileNameIndex) {
}
@@ -1345,7 +1345,7 @@ ScummEngine_v6::ScummEngine_v6(GameDetector *detector, OSystem *syst, const Scum
#ifndef DISABLE_HE
ScummEngine_v70he::ScummEngine_v70he(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16], int substResFileNameIndex)
: ScummEngine_v60he(detector, syst, gs, md5sum, substResFileNameIndex) {
- if (_platform == Common::kPlatformMacintosh && (_heversion >= 72 && _heversion <= 73))
+ if (_platform == Common::kPlatformMacintosh && (_heversion >= 72 && _heversion <= 73))
_resExtractor = new MacResExtractor(this);
else
_resExtractor = new Win32ResExtractor(this);
@@ -1477,7 +1477,7 @@ int ScummEngine::init(GameDetector &detector) {
// Create the sound manager
_sound = new Sound(this);
-
+
// Setup the music engine
setupMusic(_midi);
@@ -1498,7 +1498,7 @@ int ScummEngine::init(GameDetector &detector) {
_charset = new CharsetRendererV2(this, _language);
else if (_version == 3)
_charset = new CharsetRendererV3(this);
-#ifndef DISABLE_SCUMM_7_8
+#ifndef DISABLE_SCUMM_7_8
else if (_version == 8)
_charset = new CharsetRendererNut(this);
#endif
@@ -1551,7 +1551,7 @@ int ScummEngine::init(GameDetector &detector) {
_numActors = 62;
else if (_heversion >= 72)
_numActors = 30;
- else
+ else
_numActors = 13;
if (_version >= 7)
@@ -1688,13 +1688,13 @@ void ScummEngine::scummInit() {
if (_version > 3 && _version < 8)
loadCharset(1);
-
+
if (_features & GF_OLD_BUNDLE)
loadCharset(0); // FIXME - HACK ?
setShake(0);
setupCursor();
-
+
// Allocate and Initialize actors
Actor::initActorClass(this);
_actors = new Actor[_numActors];
@@ -1702,7 +1702,7 @@ void ScummEngine::scummInit() {
for (i = 0; i < _numActors; i++) {
_actors[i]._number = i;
_actors[i].initActor(1);
-
+
// this is from IDB
if ((_version == 1) || (_gameId == GID_MANIAC && _demoMode))
_actors[i].setActorCostume(i);
@@ -1848,7 +1848,7 @@ void ScummEngine_v60he::scummInit() {
ScummEngine::scummInit();
// HACK cursor hotspot is wrong
- // Original games used
+ // Original games used
// setCursorHotspot(8, 7);
if (_gameId == GID_FUNPACK)
setCursorHotspot(16, 16);
@@ -1916,7 +1916,7 @@ void ScummEngine::setupMusic(int midi) {
// FIXME: MD_TOWNS should not be _midi_native in the first place!! iMuse code needs to be restructured.
if ((_gameId == GID_TENTACLE) || (_gameId == GID_SAMNMAX) || (_midiDriver == MD_TOWNS))
_enable_gs = false;
- else
+ else
_enable_gs = ConfMan.getBool("enable_gs");
#ifndef __GP32__ //ph0x FIXME, "quick dirty hack"
@@ -2013,7 +2013,7 @@ int ScummEngine::go() {
if (_saveLoadFlag != 2 || !loadState(_saveLoadSlot, _saveTemporaryState)) {
int args[16];
memset(args, 0, sizeof(args));
- args[0] = _bootParam;
+ args[0] = _bootParam;
_saveLoadFlag = 0;
#ifndef DISABLE_HE
@@ -2050,7 +2050,7 @@ int ScummEngine::go() {
// TODO: Maybe perform an autosave on exit?
}
}
-
+
return 0;
}
@@ -2217,7 +2217,7 @@ load_game:
// Display "Save successful" message, except for auto saves
char buf[256];
snprintf(buf, sizeof(buf), "Successfully saved game state in file:\n\n%s", filename);
-
+
GUI::TimedMessageDialog dialog(buf, 1500);
runDialog(dialog);
}
@@ -2274,7 +2274,7 @@ load_game:
if (_saveLoadFlag && _saveLoadFlag != 1) {
goto load_game;
}
-
+
if (_currentRoom == 0) {
if (_version > 3)
CHARSET_1();
@@ -2306,7 +2306,7 @@ load_game:
((ScummEngine_v90he *)this)->_sprite->sortActiveSprites();
}
#endif
-
+
setActorRedrawFlags();
resetActorBgs();
@@ -2318,7 +2318,7 @@ load_game:
}
processActors();
-
+
_fullRedraw = false;
if (_version >= 4 && _heversion <= 61)
@@ -2357,7 +2357,7 @@ load_game:
}
animateCursor();
-
+
/* show or hide mouse */
_system->showMouse(_cursor.state > 0);
@@ -2428,7 +2428,7 @@ void ScummEngine::restart() {
// Re-run bootscript
int args[16];
memset(args, 0, sizeof(args));
- args[0] = _bootParam;
+ args[0] = _bootParam;
if (_gameId == GID_MANIAC && _demoMode)
runScript(9, 0, 0, args);
else
@@ -2460,7 +2460,7 @@ int ScummEngine::runDialog(Dialog &dialog) {
// Resume sound & video
_sound->pauseSounds(old_soundsPaused);
_smushPaused = oldSmushPaused;
-
+
// Return the result
return result;
}
@@ -2577,7 +2577,7 @@ DetectedGameList Engine_SCUMM_detectGames(const FSList &fslist) {
StringSet fileSet;
for (g = scumm_settings; g->name; ++g) {
- // Determine the 'detectname' for this game, that is, the name of a
+ // Determine the 'detectname' for this game, that is, the name of a
// file that *must* be presented if the directory contains the data
// for this game. For example, FOA requires atlantis.000
const char *base = g->baseFilename ? g->baseFilename : g->name;
@@ -2622,15 +2622,15 @@ DetectedGameList Engine_SCUMM_detectGames(const FSList &fslist) {
if (!tmp.open(file->path().c_str()))
break;
tmp.read(buf, 6);
-
+
if (buf[0] == 0xCE && buf[1] == 0xF5) {
// Looks like V1. However, we currently do not distinguish between V1 and V2
// in the scumm_settings list.
if (g->version != 1 && g->version != 2)
break;
-
+
// Candidates: maniac clasic, zak classic
-
+
// TODO: Maybe we can use the filesize to distinguish these two?
// English V1 Zak: 1896 bytes
// English V1 MM: 1972 bytes
@@ -2644,35 +2644,35 @@ DetectedGameList Engine_SCUMM_detectGames(const FSList &fslist) {
/*
TODO: MIght be possible to distinguish those by the script count.
Specifically, my versions of these games have this in their headers:
-
+
Loom (en; de; en demo; en MAC):
_numGlobalObjects 1000
_numRooms 100
_numCostumes 200
_numScripts 200
_numSounds 80
-
+
Indy3EGA (en PC; en Mac; en demo):
_numGlobalObjects 1000
_numRooms 99
_numCostumes 129
_numScripts 139
_numSounds 84
-
+
MM (en; de):
_numGlobalObjects 780
_numRooms 61
_numCostumes 40
_numScripts 179
_numSounds 120
-
+
Zak (de; en demo):
_numGlobalObjects 780
_numRooms 61
_numCostumes 40
_numScripts 155
_numSounds 120
-
+
So, they all have a different number of scripts.
*/
} else if (buf[4] == '0' && buf[5] == 'R') {
@@ -2685,23 +2685,23 @@ DetectedGameList Engine_SCUMM_detectGames(const FSList &fslist) {
and know their MD5s, we could simply rely on this and
if we find something which has an unknown MD5, assume
that it is an (so far unknown) version of Indy3.
-
+
We can combin this with a look at the resource headers:
-
+
Indy3:
_numGlobalObjects 1000
_numRooms 99
_numCostumes 129
_numScripts 139
_numSounds 84
-
+
Indy3Towns, ZakTowns, ZakLoom demo:
_numGlobalObjects 1000
_numRooms 99
_numCostumes 199
_numScripts 199
_numSounds 199
-
+
Assuming that all the town variants look like the latter, we can
do the chceck like this:
if (numScripts == 139)
@@ -2746,25 +2746,25 @@ DetectedGameList Engine_SCUMM_detectGames(const FSList &fslist) {
break;
}
}
-
+
// Match found, add to list of candidates, then abort inner loop.
if (substLastIndex > 0 && // HE Mac versions.
(substResFileNameTable[substLastIndex].genMethod == kGenMac ||
substResFileNameTable[substLastIndex].genMethod == kGenMacNoParens)) {
- detectedGames.push_back(DetectedGame(g->toGameSettings(),
- Common::UNK_LANG,
+ detectedGames.push_back(DetectedGame(g->toGameSettings(),
+ Common::UNK_LANG,
Common::kPlatformMacintosh));
fileSet[file->path()] = true;
- } else if (substLastIndex == 0 && g->id == GID_MANIAC &&
+ } else if (substLastIndex == 0 && g->id == GID_MANIAC &&
(buf[0] == 0xbc || buf[0] == 0xa0)) {
- detectedGames.push_back(DetectedGame(g->toGameSettings(),
- Common::UNK_LANG,
+ detectedGames.push_back(DetectedGame(g->toGameSettings(),
+ Common::UNK_LANG,
Common::kPlatformNES));
- } else if ((g->id == GID_MANIAC || g->id == GID_ZAK) &&
+ } else if ((g->id == GID_MANIAC || g->id == GID_ZAK) &&
((buf[0] == 0x31 && buf[1] == 0x0a) ||
(buf[0] == 0xcd && buf[1] == 0xfe))) {
- detectedGames.push_back(DetectedGame(g->toGameSettings(),
- Common::UNK_LANG,
+ detectedGames.push_back(DetectedGame(g->toGameSettings(),
+ Common::UNK_LANG,
Common::kPlatformC64));
} else {
detectedGames.push_back(g->toGameSettings());
@@ -2824,13 +2824,13 @@ static int generateSubstResFileName_(const char *filename, char *buf, int bufsiz
return -1;
char num = filename[strlen(filename) - 1];
-
+
// In some cases we have .(a) and .(b) extensions
if (num == ')')
num = filename[strlen(filename) - 2];
const char *ext = strrchr(filename, '.');
- size_t len = (ext > 0) ? ext - filename : strlen(filename);
+ size_t len = (ext > 0) ? ext - filename : strlen(filename);
for (int i = index; i < ARRAYSIZE(substResFileNameTable); i++) {
if (!scumm_strnicmp(filename, substResFileNameTable[i].winName, len)) {
@@ -2843,7 +2843,7 @@ static int generateSubstResFileName_(const char *filename, char *buf, int bufsiz
} else {
if (substResFileNameTable[i].genMethod == kGenMac)
snprintf(buf, bufsize, "%s (%c)", substResFileNameTable[i].macName, num);
- else
+ else
snprintf(buf, bufsize, "%s %c", substResFileNameTable[i].macName, num);
}
break;
@@ -2870,7 +2870,7 @@ static int generateSubstResFileName_(const char *filename, char *buf, int bufsiz
Engine *Engine_SCUMM_create(GameDetector *detector, OSystem *syst) {
Engine *engine;
-
+
const ScummGameSettings *g = scumm_settings;
while (g->name) {
if (!scumm_stricmp(detector->_game.name, g->name))
@@ -2917,7 +2917,7 @@ Engine *Engine_SCUMM_create(GameDetector *detector, OSystem *syst) {
substLastIndex = generateSubstResFileName_(tempName, detectName, sizeof(detectName), substLastIndex + 1);
}
-
+
// Unable to locate game data
if (!found) {
return 0;
@@ -2937,7 +2937,7 @@ Engine *Engine_SCUMM_create(GameDetector *detector, OSystem *syst) {
}
// Use MD5 to determine specific game version, if required.
- if (game.features & GF_MULTIPLE_VERSIONS) {
+ if (game.features & GF_MULTIPLE_VERSIONS) {
g = multiple_versions_md5_settings;
while (g->name) {
if (!scumm_stricmp(gameMD5, g->name))
diff --git a/scumm/scumm.h b/scumm/scumm.h
index 989fd67084..389ca67f01 100644
--- a/scumm/scumm.h
+++ b/scumm/scumm.h
@@ -89,7 +89,7 @@ enum GameFeatures {
/** Games using XOR encrypted data files. */
GF_USE_KEY = 1 << 4,
-
+
/** Small header games (ScummEngine_v4 and subclasses). */
GF_SMALL_HEADER = 1 << 5,
@@ -120,7 +120,7 @@ enum GameFeatures {
/** HE games for which localized versions exist */
GF_HE_LOCALIZED = 1 << 13,
- /**
+ /**
* HE Games with more global scripts and different sprite handling
* i.e. read it as HE version 9.85. Used for HE98 only.
*/
@@ -131,7 +131,7 @@ enum GameFeatures {
/** Games with multiple versions */
GF_MULTIPLE_VERSIONS = 1 << 16,
-
+
/** A demo, not a full blown game. */
GF_DEMO = 1 << 17
};
@@ -296,14 +296,14 @@ struct LangIndexNode {
struct AuxBlock {
bool visible;
Common::Rect r;
-
+
void reset() {
visible = false;
r.left = r.top = 0;
r.right = r.bottom = -1;
}
};
-
+
struct AuxEntry {
int actorNum;
int subIndex;
@@ -334,7 +334,7 @@ public:
ResourceManager(ScummEngine *vm);
byte *createResource(int type, int index, uint32 size);
- void nukeResource(int type, int i);
+ void nukeResource(int type, int i);
void freeResources();
@@ -357,7 +357,7 @@ class ScummEngine : public Engine {
friend class Insane;
friend class CharsetRenderer;
friend class ResourceManager;
-
+
void errorString(const char *buf_input, char *buf_output);
public:
/* Put often used variables at the top.
@@ -385,7 +385,7 @@ public:
/** Graphics manager */
Gdi gdi;
-
+
/** Central resource data. */
ResourceManager res;
@@ -470,7 +470,7 @@ protected:
byte _numActors;
Actor *_actors; // Has _numActors elements
Actor **_sortedActors;
-
+
byte *_arraySlot;
uint16 *_inventory;
uint16 *_newNames;
@@ -521,7 +521,7 @@ public:
byte _NESPatTable[2][4096];
byte _NESPalette[2][16];
byte _NESBaseTiles;
-
+
int _NESStartStrip;
protected:
@@ -552,7 +552,7 @@ protected:
/** The bootparam, to be passed to the script 1, the bootscript. */
int _bootParam;
-
+
// Various options useful for debugging
bool _dumpScripts;
bool _hexdumpScripts;
@@ -578,7 +578,7 @@ protected:
public:
bool getSavegameName(int slot, char *desc);
void listSavegames(bool *marks, int num);
-
+
void requestSave(int slot, const char *name, bool temporary = false);
void requestLoad(int slot);
@@ -600,7 +600,7 @@ protected:
int _resultVarNumber, _scummStackPos;
int _vmStack[150];
int _keyScriptKey, _keyScriptNo;
-
+
virtual void setupOpcodes() = 0;
virtual void executeOpcode(byte i) = 0;
virtual const char *getOpcodeDesc(byte i) = 0;
@@ -655,7 +655,7 @@ protected:
int pop();
virtual int readVar(uint var);
virtual void writeVar(uint var, int value);
-
+
void beginCutscene(int *args);
void endCutscene();
void abortCutscene();
@@ -672,7 +672,7 @@ protected:
public:
/** The name of the (macintosh/rescumm style) container file, if any. */
Common::String _containerFile;
-
+
bool openFile(BaseScummFile &file, const char *filename);
protected:
@@ -698,7 +698,7 @@ protected:
void allocResTypeData(int id, uint32 tag, int num, const char *name, int mode);
// byte *createResource(int type, int index, uint32 size);
int loadResource(int type, int i);
-// void nukeResource(int type, int i);
+// void nukeResource(int type, int i);
int getResourceSize(int type, int idx);
public:
@@ -780,7 +780,7 @@ protected:
int getObjectImageCount(int object);
int whereIsObject(int object) const;
int findObject(int x, int y);
- void findObjectInRoom(FindObjectInRoom *fo, byte findWhat, uint object, uint room);
+ void findObjectInRoom(FindObjectInRoom *fo, byte findWhat, uint object, uint room);
public:
int getObjectOrActorXY(int object, int &x, int &y); // Used in actor.cpp, hence public
protected:
@@ -915,17 +915,17 @@ protected:
bool _doEffect;
byte *_scrollBuffer;
-
+
struct {
int x, y, w, h;
byte *buffer;
uint16 xStrips, yStrips;
bool isDrawn;
} _flashlight;
-
+
public:
bool isLightOn() const;
-
+
protected:
void initScreens(int b, int h);
void initVirtScreen(VirtScreenNumber slot, int top, int width, int height, bool twobufs, bool scrollable);
@@ -934,15 +934,15 @@ protected:
void decodeNESBaseTiles();
- void drawObject(int obj, int arg);
+ void drawObject(int obj, int arg);
void drawRoomObjects(int arg);
void drawRoomObject(int i, int arg);
void drawBox(int x, int y, int x2, int y2, int color);
void restoreBG(Common::Rect rect, byte backcolor = 0);
- void redrawBGStrip(int start, int num);
+ void redrawBGStrip(int start, int num);
virtual void redrawBGAreas();
-
+
void cameraMoved();
void setCameraAtEx(int at);
virtual void setCameraAt(int pos_x, int pos_y);
@@ -1006,7 +1006,7 @@ public:
protected:
void drawFlashlight();
-
+
void fadeIn(int effect);
void fadeOut(int effect);
@@ -1027,20 +1027,20 @@ protected:
int _drawObjectQueNr;
byte _drawObjectQue[200];
-
+
/* For each of the 410 screen strips, gfxUsageBits contains a
* bitmask. The lower 80 bits each correspond to one actor and
* signify if any part of that actor is currently contained in
* that strip.
- *
+ *
* If the leftmost bit is set, the strip (background) is dirty
* needs to be redrawn.
- *
+ *
* The second leftmost bit is set by removeBlastObject() and
* restoreBG(), but I'm not yet sure why.
*/
uint32 gfxUsageBits[410 * 3];
-
+
void upgradeGfxUsageBits();
void setGfxUsageBit(int strip, int bit);
void clearGfxUsageBit(int strip, int bit);
@@ -1092,7 +1092,7 @@ public:
bool inBoxQuickReject(int box, int x, int y, int threshold);
int getClosestPtOnBox(int box, int x, int y, int16& outX, int16& outY);
int getSpecialBox(int param1, int param2);
-
+
void setBoxFlags(int box, int val);
void setBoxScale(int box, int b);
diff --git a/scumm/smush/channel.h b/scumm/smush/channel.h
index dcd7c78cc0..797c679727 100644
--- a/scumm/smush/channel.h
+++ b/scumm/smush/channel.h
@@ -28,7 +28,7 @@ namespace Scumm {
class Chunk;
class ContChunk;
-
+
class SmushChannel {
public:
@@ -81,7 +81,7 @@ public:
void getSoundData(int16 *sound_buffer, int32 size);
void getSoundData(int8 *sound_buffer, int32 size) { error("8bit request for SAUD channel should never happen"); };
int32 getRate() { return _frequency; }
- bool getParameters(int32 &rate, bool &stereo, bool &is_16bit, int32 &vol, int32 &pan) {
+ bool getParameters(int32 &rate, bool &stereo, bool &is_16bit, int32 &vol, int32 &pan) {
rate = _frequency;
stereo = true;
is_16bit = true;
diff --git a/scumm/smush/chunk.cpp b/scumm/smush/chunk.cpp
index 888e0f9fce..5c290a83f0 100644
--- a/scumm/smush/chunk.cpp
+++ b/scumm/smush/chunk.cpp
@@ -39,26 +39,26 @@ const char *Chunk::ChunkString(Chunk::type t) {
return data;
}
-BaseChunk::BaseChunk() :
+BaseChunk::BaseChunk() :
_type(0),
_size(0),
_curPos(0) {
}
bool BaseChunk::eof() const {
- return _curPos >= _size;
+ return _curPos >= _size;
}
uint32 BaseChunk::tell() const {
- return _curPos;
+ return _curPos;
}
-Chunk::type BaseChunk::getType() const {
- return _type;
+Chunk::type BaseChunk::getType() const {
+ return _type;
}
-uint32 BaseChunk::getSize() const {
- return _size;
+uint32 BaseChunk::getSize() const {
+ return _size;
}
bool BaseChunk::seek(int32 delta, seek_type dir) {
diff --git a/scumm/smush/codec37.cpp b/scumm/smush/codec37.cpp
index c7ed741156..df578175ce 100644
--- a/scumm/smush/codec37.cpp
+++ b/scumm/smush/codec37.cpp
@@ -532,7 +532,7 @@ void Codec37Decoder::decode(byte *dst, const byte *src) {
if ((seq_nb & 1) || !(mask_flags & 1)) {
_curtable ^= 1;
}
- proc1(_deltaBufs[_curtable], src + 16, _deltaBufs[_curtable ^ 1] - _deltaBufs[_curtable],
+ proc1(_deltaBufs[_curtable], src + 16, _deltaBufs[_curtable ^ 1] - _deltaBufs[_curtable],
bw, bh, pitch, _offsetTable);
break;
case 2:
diff --git a/scumm/smush/codec47.cpp b/scumm/smush/codec47.cpp
index 9715a25a49..e0430256c5 100644
--- a/scumm/smush/codec47.cpp
+++ b/scumm/smush/codec47.cpp
@@ -212,7 +212,7 @@ void Codec47Decoder::makeTablesInterpolation(int param) {
} else {
b2 = 4;
}
-
+
memset(tableSmallBig, 0, param * param * 4);
variable2 = ABS(value_table47_2_2 - value_table47_2_1);
@@ -339,7 +339,7 @@ void Codec47Decoder::makeTables47(int width) {
_tableBig[128 + a + d * 2] = (byte)tmp;
_tableBig[128 + a + d * 2 + 1] = tmp >> 8;
}
-
+
a += 388;
c += 128;
} while (c < 32768);
diff --git a/scumm/smush/imuse_channel.cpp b/scumm/smush/imuse_channel.cpp
index 3adbe4a266..bc80cde6f7 100644
--- a/scumm/smush/imuse_channel.cpp
+++ b/scumm/smush/imuse_channel.cpp
@@ -27,24 +27,24 @@
namespace Scumm {
-ImuseChannel::ImuseChannel(int32 track, int32 freq) :
- _track(track),
- _tbuffer(0),
- _tbufferSize(0),
- _sbuffer(0),
- _sbufferSize(0),
- _frequency(freq),
+ImuseChannel::ImuseChannel(int32 track, int32 freq) :
+ _track(track),
+ _tbuffer(0),
+ _tbufferSize(0),
+ _sbuffer(0),
+ _sbufferSize(0),
+ _frequency(freq),
_dataSize(-1),
_inData(false) {
}
ImuseChannel::~ImuseChannel() {
if (_tbuffer) {
- delete []_tbuffer;
+ delete []_tbuffer;
}
if (_sbuffer) {
warning("_sbuffer should be 0 !!!");
- delete []_sbuffer;
+ delete []_sbuffer;
}
}
@@ -218,7 +218,7 @@ bool ImuseChannel::handleSubTags(int32 &offset) {
uint32 size = READ_BE_UINT32(_tbuffer + offset + 4);
uint32 available_size = _tbufferSize - offset;
switch(type) {
- case TYPE_MAP_:
+ case TYPE_MAP_:
_inData = false;
if (available_size >= (size + 8)) {
MemoryChunk c((byte *)_tbuffer + offset);
@@ -260,9 +260,9 @@ bool ImuseChannel::processBuffer() {
assert(_tbufferSize != 0);
assert(_sbuffer == 0);
assert(_sbufferSize == 0);
-
+
if (_inData) {
- if (_dataSize < _tbufferSize) {
+ if (_dataSize < _tbufferSize) {
int32 offset= _dataSize;
while (handleSubTags(offset));
_sbufferSize = _dataSize;
@@ -278,7 +278,7 @@ bool ImuseChannel::processBuffer() {
_tbufferSize = 0;
}
if (_sbufferSize == 0) {
- delete []_sbuffer;
+ delete []_sbuffer;
_sbuffer = 0;
}
} else {
diff --git a/scumm/smush/saud_channel.cpp b/scumm/smush/saud_channel.cpp
index a72d1c7fe7..3e18df42e5 100644
--- a/scumm/smush/saud_channel.cpp
+++ b/scumm/smush/saud_channel.cpp
@@ -94,7 +94,7 @@ bool SaudChannel::processBuffer() {
assert(_tbufferSize != 0);
assert(_sbuffer == 0);
assert(_sbufferSize == 0);
-
+
if (_keepSize) {
_sbufferSize = _tbufferSize;
_sbuffer = _tbuffer;
@@ -118,7 +118,7 @@ bool SaudChannel::processBuffer() {
_tbufferSize = 0;
}
if (_sbufferSize == 0) {
- delete []_sbuffer;
+ delete []_sbuffer;
_sbuffer = 0;
}
} else {
@@ -156,8 +156,8 @@ bool SaudChannel::processBuffer() {
return true;
}
-SaudChannel::SaudChannel(int32 track, int32 freq) :
- _track(track),
+SaudChannel::SaudChannel(int32 track, int32 freq) :
+ _track(track),
_nbframes(0),
_dataSize(-1),
_frequency(freq),
diff --git a/scumm/smush/smush_font.cpp b/scumm/smush/smush_font.cpp
index 3b3aed766e..2fc498c696 100644
--- a/scumm/smush/smush_font.cpp
+++ b/scumm/smush/smush_font.cpp
@@ -237,16 +237,16 @@ void SmushFont::drawStringWrap(const char *str, byte *buffer, int dst_width, int
if (y > dst_height - height) {
y = dst_height - height;
}
-
+
if (center) {
max_width = (max_width + 1) / 2;
x = left + width / 2;
-
+
if (x < left + max_width)
x = left + max_width;
if (x > right - max_width)
x = right - max_width;
-
+
for (i = 0; i < line_count; i++) {
drawSubstring(substrings[i], buffer, dst_width, x - substr_widths[i] / 2, y);
y += getStringHeight(substrings[i]);
@@ -254,13 +254,13 @@ void SmushFont::drawStringWrap(const char *str, byte *buffer, int dst_width, int
} else {
if (x > dst_width - max_width)
x = dst_width - max_width;
-
+
for (i = 0; i < line_count; i++) {
drawSubstring(substrings[i], buffer, dst_width, x, y);
y += getStringHeight(substrings[i]);
}
}
-
+
free(s);
}
diff --git a/scumm/smush/smush_font.h b/scumm/smush/smush_font.h
index 3cb0c4d19f..a2811c2530 100644
--- a/scumm/smush/smush_font.h
+++ b/scumm/smush/smush_font.h
@@ -32,7 +32,7 @@ protected:
int16 _color;
bool _new_colors;
bool _original;
-
+
int getStringWidth(const char *str);
int getStringHeight(const char *str);
diff --git a/scumm/smush/smush_mixer.cpp b/scumm/smush/smush_mixer.cpp
index dfb467d541..773e09a97e 100644
--- a/scumm/smush/smush_mixer.cpp
+++ b/scumm/smush/smush_mixer.cpp
@@ -81,8 +81,8 @@ void SmushMixer::addChannel(SmushChannel *c) {
}
for (i = 0; i < NUM_CHANNELS; i++) {
- warning("channel %d : %p(%d, %d)", i, (void *)_channels[i].chan,
- _channels[i].chan ? _channels[i].chan->getTrackIdentifier() : -1,
+ warning("channel %d : %p(%d, %d)", i, (void *)_channels[i].chan,
+ _channels[i].chan ? _channels[i].chan->getTrackIdentifier() : -1,
_channels[i].chan ? _channels[i].chan->isTerminated() : 1);
}
diff --git a/scumm/smush/smush_player.cpp b/scumm/smush/smush_player.cpp
index 68d36c71f2..9ce66eb44e 100644
--- a/scumm/smush/smush_player.cpp
+++ b/scumm/smush/smush_player.cpp
@@ -90,7 +90,7 @@ public:
assert(def_end != NULL);
char *id_end = def_end;
- while (id_end >= def_start && !isdigit(*(id_end-1))) {
+ while (id_end >= def_start && !isdigit(*(id_end-1))) {
id_end--;
}
@@ -238,7 +238,7 @@ SmushPlayer::SmushPlayer(ScummEngine_v6 *scumm, int speed) {
_base = NULL;
_frameBuffer = NULL;
_specialBuffer = NULL;
-
+
_seekPos = -1;
_skipNext = false;
@@ -273,7 +273,7 @@ void SmushPlayer::init() {
_vm->_smushVideoShouldFinish = false;
_vm->setDirtyColors(0, 255);
_dst = _vm->virtscr[0].getPixels(0, 0);
-
+
// HACK HACK HACK: This is an *evil* trick, beware!
// We do this to fix bug #1037052. A proper solution would change all the
// drawing code to use the pitch value specified by the virtual screen.
@@ -284,7 +284,7 @@ void SmushPlayer::init() {
_origNumStrips = _vm->gdi._numStrips;
_vm->virtscr[0].pitch = _vm->virtscr[0].w;
_vm->gdi._numStrips = _vm->virtscr[0].w / 8;
-
+
_smixer = new SmushMixer(_vm->_mixer);
Common::g_timer->installTimerProc(&timerCallback, 1000000 / _speed, this);
@@ -338,8 +338,8 @@ void SmushPlayer::release() {
// some explanation.
_vm->virtscr[0].pitch = _origPitch;
_vm->gdi._numStrips = _origNumStrips;
-
-
+
+
_initDone = false;
}
@@ -526,9 +526,9 @@ void SmushPlayer::handleIACT(Chunk &b) {
*(_IACToutput + _IACTpos) = *d_src++;
_IACTpos++;
bsize--;
- }
+ }
}
-
+
free(src);
}
}
@@ -586,7 +586,7 @@ void SmushPlayer::handleTextResource(Chunk &b) {
{
int id = str[3] - '0';
str += 4;
- sf = _sf[id];
+ sf = _sf[id];
}
break;
case 'c':
@@ -613,7 +613,7 @@ void SmushPlayer::handleTextResource(Chunk &b) {
// bit 2 - ??? 4
// bit 3 - wrap around 8
switch (flags & 9) {
- case 0:
+ case 0:
sf->drawString(str, _dst, _width, _height, pos_x, pos_y, false);
break;
case 1:
@@ -1020,25 +1020,25 @@ void SmushPlayer::setupAnim(const char *file) {
}
} else {
error("SmushPlayer::setupAnim() Unknown font setup for game");
- }
+ }
}
void SmushPlayer::parseNextFrame() {
Common::StackLock lock(_mutex);
-
+
Chunk *sub;
if (_vm->_smushPaused)
return;
-
+
if (_seekPos >= 0) {
if (_smixer)
_smixer->stop();
-
+
if (_seekFile.size() > 0) {
delete _base;
_base = new FileChunk(_seekFile);
-
+
if (_seekPos > 0) {
assert(_seekPos > 8);
// In this case we need to get palette and number of frames
@@ -1046,7 +1046,7 @@ void SmushPlayer::parseNextFrame() {
checkBlock(*sub, TYPE_AHDR);
handleAnimHeader(*sub);
delete sub;
-
+
_middleAudio = true;
_seekPos -= 8;
} else {
@@ -1058,10 +1058,10 @@ void SmushPlayer::parseNextFrame() {
} else {
_skipPalette = true;
}
-
+
_base->seek(_seekPos, FileChunk::seek_start);
_frame = _seekFrame;
-
+
_seekPos = -1;
}
@@ -1125,7 +1125,7 @@ void SmushPlayer::updateScreen() {
// change path below for dump png files
sprintf(fileName, "/path/to/somethere/%s%04d.png", _vm->getGameName(), _frame);
FILE *file = fopen(fileName, "wb");
- if (file == NULL)
+ if (file == NULL)
error("can't open file for writing png");
png_structp png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, 0, 0, 0);
@@ -1145,7 +1145,7 @@ void SmushPlayer::updateScreen() {
png_init_io(png_ptr, file);
- png_set_IHDR(png_ptr, info_ptr, _width, _height, 8, PNG_COLOR_TYPE_PALETTE, PNG_INTERLACE_NONE,
+ png_set_IHDR(png_ptr, info_ptr, _width, _height, 8, PNG_COLOR_TYPE_PALETTE, PNG_INTERLACE_NONE,
PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
png_colorp palette = (png_colorp)png_malloc(png_ptr, PNG_MAX_PALETTE_LENGTH * sizeof (png_color));
@@ -1241,7 +1241,7 @@ void SmushPlayer::play(const char *filename, int32 offset, int32 startFrame) {
_warpNeeded = false;
_palDirtyMin = 256;
_palDirtyMax = -1;
-
+
// Hide mouse
bool oldMouseState = _vm->_system->showMouse(false);
@@ -1281,7 +1281,7 @@ void SmushPlayer::play(const char *filename, int32 offset, int32 startFrame) {
}
if (_updateNeeded) {
uint32 end_time, start_time;
-
+
start_time = _vm->_system->getMillis();
_vm->_system->copyRectToScreen(_dst, _width, 0, 0, _width, _height);
_vm->_system->updateScreen();
diff --git a/scumm/smush/smush_player.h b/scumm/smush/smush_player.h
index a138962b7e..ef7c67a44d 100644
--- a/scumm/smush/smush_player.h
+++ b/scumm/smush/smush_player.h
@@ -102,7 +102,7 @@ public:
protected:
SmushFont *_sf[5];
int _width, _height;
-
+
int _origPitch, _origNumStrips;
void insanity(bool);
@@ -138,7 +138,7 @@ private:
void handleTextResource(Chunk &);
void handleDeltaPalette(Chunk &);
void readPalette(byte *, Chunk &);
-
+
static void timerCallback(void *ptr);
};
diff --git a/scumm/sound.cpp b/scumm/sound.cpp
index 22b3132b52..a3ea155c6f 100644
--- a/scumm/sound.cpp
+++ b/scumm/sound.cpp
@@ -78,7 +78,7 @@ Sound::Sound(ScummEngine *parent)
_soundsPaused(false),
_sfxMode(0),
_heMusicTracks(0) {
-
+
memset(_soundQue, 0, sizeof(_soundQue));
memset(_soundQue2, 0, sizeof(_soundQue2));
memset(_mouthSyncTimes, 0, sizeof(_mouthSyncTimes));
@@ -203,7 +203,7 @@ void Sound::setupHEMusicFile() {
} else {
musicFile.seek(+13, SEEK_CUR);
}
- }
+ }
musicFile.close();
}
@@ -277,7 +277,7 @@ void Sound::playSound(int soundID, int heOffset, int heChannel, int heFlags) {
// This pointer will be freed at the end of the function
mallocedPtr = ptr;
} else {
- debugC(DEBUG_SOUND, "playSound #%d (room %d)", soundID,
+ debugC(DEBUG_SOUND, "playSound #%d (room %d)", soundID,
_vm->getResourceRoomNr(rtSound, soundID));
ptr = _vm->getResourceAddress(rtSound, soundID);
@@ -337,7 +337,7 @@ void Sound::playSound(int soundID, int heOffset, int heChannel, int heFlags) {
// Occurs when making fireworks in puttmoon
warning("playSound: Invalid sound offset (%d) in sound %d", heOffset, soundID);
heOffset = 0;
- }
+ }
size -= heOffset;
if (_overrideFreq) {
@@ -372,17 +372,17 @@ void Sound::playSound(int soundID, int heOffset, int heChannel, int heFlags) {
_vm->_mixer->stopID(_currentMusic);
_currentMusic = soundID;
_vm->_mixer->playRaw(NULL, sound, size, rate, flags, soundID);
- }
+ }
// Support for sampled sound effects in Monkey Island 1 and 2
else if (READ_UINT32(ptr) == MKID('SBL ')) {
debugC(DEBUG_SOUND, "Using SBL sound effect");
-
+
// SBL resources essentially contain VOC sound data.
// There are at least two main variants: in one,
// there are two subchunks AUhd and AUdt, in the other
// the chunks are called WVhd and WVdt. Besides that,
// the two variants seem pretty similiar.
-
+
// The first subchunk (AUhd resp. WVhd) seems to always
// contain three bytes (00 00 80) of unknown meaning.
// After that, a second subchunk contains VOC data.
@@ -428,7 +428,7 @@ void Sound::playSound(int soundID, int heOffset, int heChannel, int heFlags) {
}
}
}
-
+
// TODO: It would be nice if we could use readVOCFromMemory() here.
// We'd have to add the 'Creative Voice File' header for this, though,
// or make readVOCFromMemory() less strict.
@@ -559,7 +559,7 @@ void Sound::playSound(int soundID, int heOffset, int heChannel, int heFlags) {
_vm->_mixer->playRaw(NULL, sound, size, rate, Audio::Mixer::FLAG_AUTOFREE, soundID, vol, 0);
}
else {
-
+
if (_vm->_gameId == GID_MONKEY_VGA || _vm->_gameId == GID_MONKEY_EGA
|| (_vm->_gameId == GID_MONKEY && _vm->_platform == Common::kPlatformMacintosh)) {
// Sound is currently not supported at all in the amiga versions of these games
@@ -581,7 +581,7 @@ void Sound::playSound(int soundID, int heOffset, int heChannel, int heFlags) {
}
return;
}
-
+
// Works around the fact that in some places in MonkeyEGA/VGA,
// the music is never explicitly stopped.
// Rather it seems that starting a new music is supposed to
@@ -591,7 +591,7 @@ void Sound::playSound(int soundID, int heOffset, int heChannel, int heFlags) {
_vm->_imuse->stopAllSounds();
}
}
-
+
if (_vm->_musicEngine) {
_vm->_musicEngine->startSound(soundID);
}
@@ -748,7 +748,7 @@ void Sound::startTalkSound(uint32 offset, uint32 b, int mode, Audio::SoundHandle
if (_offsetTable != NULL) {
MP3OffsetTable *result = NULL, key;
-
+
key.org_offset = offset;
result = (MP3OffsetTable *)bsearch(&key, _offsetTable, _numSoundEffects,
sizeof(MP3OffsetTable), compareMP3OffsetTable);
@@ -774,7 +774,7 @@ void Sound::startTalkSound(uint32 offset, uint32 b, int mode, Audio::SoundHandle
assert(num + 1 < (int)ARRAYSIZE(_mouthSyncTimes));
for (i = 0; i < num; i++)
_mouthSyncTimes[i] = _sfxFile->readUint16BE();
-
+
_mouthSyncTimes[i] = 0xFFFF;
_sfxMode |= mode;
_curSoundPos = 0;
@@ -783,7 +783,7 @@ void Sound::startTalkSound(uint32 offset, uint32 b, int mode, Audio::SoundHandle
if (!_soundsPaused && _vm->_mixer->isReady()) {
AudioStream *input = NULL;
-
+
switch (_soundMode) {
case kMP3Mode:
#ifdef USE_MAD
@@ -806,12 +806,12 @@ void Sound::startTalkSound(uint32 offset, uint32 b, int mode, Audio::SoundHandle
default:
input = makeVOCStream(*_sfxFile);
}
-
+
if (!input) {
error("startSfxSound failed to load sound");
return;
}
-
+
if (_vm->_imuseDigital) {
#ifndef DISABLE_SCUMM_7_8
//_vm->_imuseDigital->stopSound(kTalkSoundID);
@@ -1042,7 +1042,7 @@ void Sound::soundKludge(int *list, int num) {
processSound();
} else {
_soundQue[_soundQuePos++] = num;
-
+
for (i = 0; i < num; i++) {
_soundQue[_soundQuePos++] = list[i];
}
@@ -1118,7 +1118,7 @@ ScummFile *Sound::openSfxFile() {
const char *ext;
SoundMode mode;
};
-
+
static const SoundFileExtensions extensions[] = {
{ "sou", kVOCMode },
#ifdef USE_FLAC
@@ -1136,15 +1136,15 @@ ScummFile *Sound::openSfxFile() {
char buf[256];
ScummFile *file = new ScummFile();
_offsetTable = NULL;
-
+
/* Try opening the file <_gameName>.sou first, e.g. tentacle.sou.
* That way, you can keep .sou files for multiple games in the
* same directory */
-
+
const char *basename[3] = { 0, 0, 0 };
basename[0] = _vm->getGameName();
basename[1] = "monster";
-
+
for (int j = 0; basename[j] && !file->isOpen(); ++j) {
for (int i = 0; extensions[i].ext; ++i) {
sprintf(buf, "%s.%s", basename[j], extensions[i].ext);
@@ -1168,11 +1168,11 @@ ScummFile *Sound::openSfxFile() {
_vm->generateSubstResFileName(buf, buf1, sizeof(buf1));
strcpy(buf, buf1);
}
- if (file->open(buf) && _vm->_heversion <= 73)
+ if (file->open(buf) && _vm->_heversion <= 73)
file->setEnc(0x69);
_soundMode = kVOCMode;
}
-
+
if (_soundMode != kVOCMode) {
/* Now load the 'offset' index in memory to be able to find the MP3 data
@@ -1236,7 +1236,7 @@ void Sound::startCDTimer() {
if (_vm->_gameId == GID_LOOM256)
timer_interval = 100;
- else
+ else
timer_interval = 101;
_vm->_timer->removeTimerProc(&cd_timer_handler);
@@ -1290,7 +1290,7 @@ const SaveLoadEntry *Sound::getSaveLoadEntries() {
/*
* TODO: The way we handle sound/music resources really is one huge hack.
- * We probably should reconsider how we do this, and maybe come up with a
+ * We probably should reconsider how we do this, and maybe come up with a
* better/cleaner solution. Even if we keep the existing code, it really
* could stand a thorough cleanup!
*/
@@ -1415,7 +1415,7 @@ int ScummEngine::readSoundResource(int type, int idx) {
char buffer[128];
debugC(DEBUG_SOUND, "Found base tag FMUS in sound %d, size %d", idx, total_size);
debugC(DEBUG_SOUND, "It was at position %d", _fileHandle->pos());
-
+
_fileHandle->seek(4, SEEK_CUR);
// HSHD size
tmpsize = _fileHandle->readUint32BE();
@@ -1423,12 +1423,12 @@ int ScummEngine::readSoundResource(int type, int idx) {
_fileHandle->seek(tmpsize - 4, SEEK_CUR);
// SDAT size
tmpsize = _fileHandle->readUint32BE();
-
+
// SDAT contains name of file we want
_fileHandle->read(buffer, tmpsize - 8);
// files seem to be 11 chars (8.3) unused space is replaced by spaces
*(strstr(buffer, " ")) = '\0';
-
+
debugC(DEBUG_SOUND, "FMUS file %s", buffer);
if (dmuFile.open(buffer) == false) {
error("Can't open music file %s*", buffer);
@@ -1462,27 +1462,27 @@ int ScummEngine::readSoundResource(int type, int idx) {
static byte ADLIB_INSTR_MIDI_HACK[95] = {
0x00, 0xf0, 0x14, 0x7d, 0x00, // sysex 00: part on/off
0x00, 0x00, 0x03, // part/channel (offset 5)
- 0x00, 0x00, 0x07, 0x0f, 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x00, 0x07, 0x0f, 0x00, 0x00, 0x08, 0x00,
0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0xf7,
0x00, 0xf0, 0x41, 0x7d, 0x10, // sysex 16: set instrument
0x00, 0x01, // part/channel (offset 28)
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xf7,
0x00, 0xb0, 0x07, 0x64 // Controller 7 = 100 (offset 92)
};
-
+
static const byte map_param[7] = {
0, 2, 3, 4, 8, 9, 0,
};
static const byte freq2note[128] = {
- /*128*/ 6, 6, 6, 6,
+ /*128*/ 6, 6, 6, 6,
/*132*/ 7, 7, 7, 7, 7, 7, 7,
/*139*/ 8, 8, 8, 8, 8, 8, 8, 8, 8,
/*148*/ 9, 9, 9, 9, 9, 9, 9, 9, 9,
@@ -1496,7 +1496,7 @@ static const byte freq2note[128] = {
/*235*/ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
/*249*/ 18, 18, 18, 18, 18, 18, 18
};
-
+
static const uint16 num_steps_table[] = {
1, 2, 4, 5,
6, 7, 8, 9,
@@ -1531,7 +1531,7 @@ int ScummEngine::convert_extraflags(byte * ptr, byte * src_ptr) {
v1 = v1 * 2 + 31;
v2 = v2 * 2 + 31;
}
-
+
/* flags a */
if ((flags & 0x7) == 6)
ptr[0] = 0;
@@ -1561,13 +1561,13 @@ int ScummEngine::convert_extraflags(byte * ptr, byte * src_ptr) {
time = num_steps_table[t1] + num_steps_table[t2]
+ num_steps_table[t3 & 0x7f] + num_steps_table[t4];
if (flags & 0x20) {
- int playtime = ((src_ptr[4] >> 4) & 0xf) * 118 +
+ int playtime = ((src_ptr[4] >> 4) & 0xf) * 118 +
(src_ptr[4] & 0xf) * 8;
if (playtime > time)
time = playtime;
}
/*
- time = ((src_ptr[4] >> 4) & 0xf) * 118 +
+ time = ((src_ptr[4] >> 4) & 0xf) * 118 +
(src_ptr[4] & 0xf) * 8;
*/
return time;
@@ -1576,7 +1576,7 @@ int ScummEngine::convert_extraflags(byte * ptr, byte * src_ptr) {
#define kMIDIHeaderSize 46
static inline byte *writeMIDIHeader(byte *ptr, const char *type, int ppqn, int total_size) {
uint32 dw = TO_BE_32(total_size);
-
+
memcpy(ptr, type, 4); ptr += 4;
memcpy(ptr, &dw, 4); ptr += 4;
memcpy(ptr, "MDhd", 4); ptr += 4;
@@ -1588,7 +1588,7 @@ static inline byte *writeMIDIHeader(byte *ptr, const char *type, int ppqn, int t
ptr += 4;
ptr[0] = 0; ptr[1] = 0; ptr[2] = 0; ptr[3] = 1; // MIDI format 0 with 1 track
ptr += 4;
-
+
*ptr++ = ppqn >> 8;
*ptr++ = ppqn & 0xFF;
@@ -1640,28 +1640,28 @@ void ScummEngine::convertMac0Resource(int type, int idx, byte *src_ptr, int size
---
4 bytes - 'SOUN'
BE 4 bytes - block length
-
+
4 bytes - 'Mac0'
BE 4 bytes - (blockLength - 27)
28 bytes - ???
-
+
do this three times (once for each channel):
4 bytes - 'Chan'
BE 4 bytes - channel length
4 bytes - instrument name (e.g. 'MARI')
-
+
do this for ((chanLength-24)/4) times:
2 bytes - note duration
1 byte - note value
1 byte - note velocity
-
+
4 bytes - ???
4 bytes - 'Loop'/'Done'
4 bytes - ???
-
+
1 byte - 0x09
---
-
+
Instruments (General Midi):
"MARI" - Marimba (12)
"PLUC" - Pizzicato Strings (45)
@@ -1677,8 +1677,8 @@ void ScummEngine::convertMac0Resource(int type, int idx, byte *src_ptr, int size
"ORGA" - Drawbar Organ (16; but could also be 17-20)
"BONG" - Woodblock? (115)
"BASS" - Bass (32-39)
-
-
+
+
Now the task could be to convert this into MIDI, to be fed into iMuse.
Or we do something similiar to what is done in Player_V3, assuming
we can identify SFX in the MI datafiles for each of the instruments
@@ -1691,14 +1691,14 @@ void ScummEngine::convertMac0Resource(int type, int idx, byte *src_ptr, int size
#else
const int ppqn = 480;
byte *ptr, *start_ptr;
-
+
int total_size = 0;
total_size += kMIDIHeaderSize; // Header
total_size += 7; // Tempo META
total_size += 3 * 3; // Three program change mesages
total_size += 22; // Possible jump SysEx
total_size += 5; // EOT META
-
+
int i, len;
byte track_instr[3];
byte *track_data[3];
@@ -1719,17 +1719,17 @@ void ScummEngine::convertMac0Resource(int type, int idx, byte *src_ptr, int size
track_data[i] = src_ptr + 12;
src_ptr += len;
looped = (*((uint32*)(src_ptr - 8)) == MKID('Loop'));
-
+
// For each note event, we need up to 6 bytes for the
// Note On (3 VLQ, 3 event), and 6 bytes for the Note
// Off (3 VLQ, 3 event). So 12 bytes total.
total_size += 12 * track_len[i];
}
assert(*src_ptr == 0x09);
-
+
// Create sound resource
start_ptr = res.createResource(type, idx, total_size);
-
+
// Insert MIDI header
ptr = writeMIDIHeader(start_ptr, "GMD ", ppqn, total_size);
@@ -1751,7 +1751,7 @@ void ScummEngine::convertMac0Resource(int type, int idx, byte *src_ptr, int size
*ptr++ = 0; // VLQ
*ptr++ = 0xC2;
*ptr++ = track_instr[2];
-
+
// And now, the actual composition. Please turn all cell phones
// and pagers off during the performance. Thank you.
uint16 nextTime[3] = { 1, 1, 1 };
@@ -1815,9 +1815,9 @@ void ScummEngine::convertMac0Resource(int type, int idx, byte *src_ptr, int size
// Insert end of song META
memcpy(ptr, "\x00\xff\x2f\x00\x00", 5); ptr += 5;
-
+
assert(ptr <= start_ptr + total_size);
-
+
// Rewrite MIDI header, this time with true size
total_size = ptr - start_ptr;
ptr = writeMIDIHeader(start_ptr, "GMD ", ppqn, total_size);
@@ -1834,7 +1834,7 @@ void ScummEngine::convertADResource(int type, int idx, byte *src_ptr, int size)
byte *ptr;
int total_size = kMIDIHeaderSize + 7 + 8 * sizeof(ADLIB_INSTR_MIDI_HACK) + size;
total_size += 24; // Up to 24 additional bytes are needed for the jump sysex
-
+
ptr = res.createResource(type, idx, total_size);
src_ptr += 2;
@@ -1850,26 +1850,26 @@ void ScummEngine::convertADResource(int type, int idx, byte *src_ptr, int size)
// The "speed" of the song
ticks = *(src_ptr + 1);
-
+
// Flag that tells us whether we should loop the song (0) or play it only once (1)
play_once = *(src_ptr + 2);
-
+
// Number of instruments used
num_instr = *(src_ptr + 8); // Normally 8
-
+
// copy the pointer to instrument data
channel = src_ptr + 9;
instr = src_ptr + 0x11;
-
+
// skip over the rest of the header and copy the MIDI data into a buffer
src_ptr += 0x11 + 8 * 16;
size -= 0x11 + 8 * 16;
- CHECK_HEAP
-
+ CHECK_HEAP
+
track = src_ptr;
-
- // Convert the ticks into a MIDI tempo.
+
+ // Convert the ticks into a MIDI tempo.
// Unfortunate LOOM and INDY3 have different interpretation
// of the ticks value.
if (_gameId == GID_INDY3) {
@@ -1881,18 +1881,18 @@ void ScummEngine::convertADResource(int type, int idx, byte *src_ptr, int size)
dw = 500000 * 256 / ticks;
}
debugC(DEBUG_SOUND, " ticks = %d, speed = %ld", ticks, dw);
-
+
// Write a tempo change Meta event
memcpy(ptr, "\x00\xFF\x51\x03", 4); ptr += 4;
*ptr++ = (byte)((dw >> 16) & 0xFF);
*ptr++ = (byte)((dw >> 8) & 0xFF);
*ptr++ = (byte)(dw & 0xFF);
-
+
// Copy our hardcoded instrument table into it
// Then, convert the instrument table as given in this song resource
// And write it *over* the hardcoded table.
// Note: we deliberately.
-
+
/* now fill in the instruments */
for (i = 0; i < num_instr; i++) {
ch = channel[i] - 1;
@@ -1961,7 +1961,7 @@ void ScummEngine::convertADResource(int type, int idx, byte *src_ptr, int size)
*ptr++ = (ppqn / 3 >> 7) | 0x80;
*ptr++ = ppqn / 3 & 0x7f;
- // Now copy the actual music data
+ // Now copy the actual music data
memcpy(ptr, track, size);
ptr += size;
@@ -2054,7 +2054,7 @@ void ScummEngine::convertADResource(int type, int idx, byte *src_ptr, int size)
int mintime = -1;
ch = -1;
for (i = 0; i < 3; i++) {
- if (track_time[i] >= 0 &&
+ if (track_time[i] >= 0 &&
(mintime == -1 || mintime > track_time[i])) {
mintime = track_time[i];
ch = i;
@@ -2085,7 +2085,7 @@ void ScummEngine::convertADResource(int type, int idx, byte *src_ptr, int size)
case 2:
/* tone/parammodulation */
- memcpy(ptr, ADLIB_INSTR_MIDI_HACK,
+ memcpy(ptr, ADLIB_INSTR_MIDI_HACK,
sizeof(ADLIB_INSTR_MIDI_HACK));
ptr[5] += ch;
@@ -2175,14 +2175,14 @@ void ScummEngine::convertADResource(int type, int idx, byte *src_ptr, int size)
note = 0;
else
note += freq2note[freq - 0x80];
-
+
debugC(DEBUG_SOUND, "Note: %d", note);
if (note <= 0)
note = 1;
else if (note > 127)
note = 127;
- // Insert a note on event
+ // Insert a note on event
*ptr++ = 0x90 + ch; // key on channel
*ptr++ = note;
*ptr++ = 63;
@@ -2305,7 +2305,7 @@ int ScummEngine::readSoundResourceSmallHeader(int type, int idx) {
convertADResource(type, idx, ptr, ad_size - 6);
free(ptr);
return 1;
- }
+ }
} else if (((_midiDriver == MD_PCJR) || (_midiDriver == MD_PCSPK)) && wa_offs != 0) {
if (_features & GF_OLD_BUNDLE) {
_fileHandle->seek(wa_offs, SEEK_SET);
@@ -2412,7 +2412,7 @@ void AppendableMemoryStream<stereo, is16Bit, isUnsigned, isLE>::append(const byt
assert((len & 3) == 0);
else if (is16Bit || stereo)
assert((len & 1) == 0);
-
+
// Verify that the stream has not yet been finalized (by a call to finish())
assert(!_finalized);
@@ -2452,7 +2452,7 @@ AppendableAudioStream *makeAppendableAudioStream(int rate, byte _flags, uint32 l
const bool is16Bit = (_flags & Audio::Mixer::FLAG_16BITS) != 0;
const bool isUnsigned = (_flags & Audio::Mixer::FLAG_UNSIGNED) != 0;
const bool isLE = (_flags & Audio::Mixer::FLAG_LITTLE_ENDIAN) != 0;
-
+
if (isStereo) {
if (isUnsigned) {
MAKE_WRAPPED(true, true);
diff --git a/scumm/sound.h b/scumm/sound.h
index 308d966733..699058023f 100644
--- a/scumm/sound.h
+++ b/scumm/sound.h
@@ -70,7 +70,7 @@ protected:
} _soundQue2[10];
ScummFile *_sfxFile;
- SoundMode _soundMode;
+ SoundMode _soundMode;
MP3OffsetTable *_offsetTable; // For compressed audio
int _numSoundEffects; // For compressed audio
diff --git a/scumm/sprite_he.cpp b/scumm/sprite_he.cpp
index ca450bf258..8fe6df1aff 100644
--- a/scumm/sprite_he.cpp
+++ b/scumm/sprite_he.cpp
@@ -219,7 +219,7 @@ int Sprite::getSpriteClass(int spriteId, int num, int *args) {
int code, classId;
if (num == 0)
- return _spriteTable[spriteId].classFlags;
+ return _spriteTable[spriteId].classFlags;
for (int i = 0; i < num; i++) {
code = classId = args[i];
@@ -437,7 +437,7 @@ int ScummEngine_v90he::getGroupSpriteArray(int spriteGroupId) {
writeVar(0, 0);
defineArray(0, kDwordArray, 0, 0, 0, numSprites);
writeArray(0, 0, 0, numSprites);
-
+
numSprites = 1;
for (i = (_sprite->_varNumSprites - 1); i > 0; i--) {
if (_sprite->_spriteTable[i].group == spriteGroupId) {
@@ -445,7 +445,7 @@ int ScummEngine_v90he::getGroupSpriteArray(int spriteGroupId) {
numSprites++;
}
}
-
+
return readVar(0);
}
@@ -526,7 +526,7 @@ void Sprite::setSpriteImageState(int spriteId, int state) {
int imageStateCount = _spriteTable[spriteId].imageStateCount - 1;
state = MAX(0, state);
state = MIN(state, imageStateCount);
-
+
if (_spriteTable[spriteId].imageState != state) {
_spriteTable[spriteId].imageState = state;
_spriteTable[spriteId].flags |= kSFChanged | kSFNeedRedraw;
@@ -724,7 +724,7 @@ void Sprite::setSpriteAnimSpeed(int spriteId, int value) {
void Sprite::setSpriteSetClass(int spriteId, int classId, int toggle) {
checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d");
checkRange(32, 1, classId, "class %d out of range in statement");
-
+
if (toggle) {
_spriteTable[spriteId].classFlags |= (1 << (classId - 1));
} else {
@@ -1084,7 +1084,7 @@ void Sprite::resetTables(bool refreshScreen) {
void Sprite::resetBackground() {
int xmin, xmax, ymin, ymax;
xmin = ymin = 1234;
- xmax = ymax = -1234;
+ xmax = ymax = -1234;
bool firstLoop = true;
bool refreshScreen = false;
@@ -1166,12 +1166,12 @@ void Sprite::updateImages() {
spi->ty += spi->dy;
if (tx != spi->tx || ty != spi->ty) {
spi->flags |= kSFChanged | kSFNeedRedraw;
- }
+ }
}
if (spi->flags & kSFAutoAnim) {
if (spi->animSpeed) {
--spi->animProgress;
- if (spi->animProgress)
+ if (spi->animProgress)
continue;
spi->animProgress = spi->animSpeed;
@@ -1261,7 +1261,7 @@ void Sprite::processImages(bool arg) {
if (spi->zorder < 0)
continue;
}
-
+
spi->flags &= ~kSFNeedRedraw;
image = spi->image;
imageState = spi->imageState;
@@ -1360,7 +1360,7 @@ void Sprite::processImages(bool arg) {
}
wiz.processFlags |= kWPFNewFlags;
wiz.img.flags |= spi->imgFlags;
-
+
if (spr_flags & kSFRotated) {
wiz.processFlags |= kWPFRotate;
wiz.angle = spi->angle;
@@ -1370,7 +1370,7 @@ void Sprite::processImages(bool arg) {
wiz.scale = spi->scale;
}
spi->curImgFlags = wiz.img.flags;
-
+
if (spi->group && (_spriteGroups[spi->group].flags & kSGFClipBox)) {
Common::Rect &spgBbox = _spriteGroups[spi->group].bbox;
if (spgBbox.isValidRect() && spi->bbox.intersects(spgBbox)) {
@@ -1439,7 +1439,7 @@ void Sprite::saveOrLoadSpriteData(Serializer *s, uint32 savegameVersion) {
MKLINE(SpriteInfo, field_90, sleInt32, VER(48)),
MKEND()
};
-
+
static const SaveLoadEntry spriteGroupEntries[] = {
MKLINE(SpriteGroup, bbox.left, sleInt32, VER(48)),
MKLINE(SpriteGroup, bbox.top, sleInt32, VER(48)),
diff --git a/scumm/sprite_he.h b/scumm/sprite_he.h
index f9251968cf..c2aeafe684 100644
--- a/scumm/sprite_he.h
+++ b/scumm/sprite_he.h
@@ -1,6 +1,6 @@
/* ScummVM - Scumm Interpreter
* Copyright (C) 2001 Ludvig Strigeus
- * Copyright (C) 2001-2005 The ScummVM project
+ * Copyright (C) 2001-2005 The ScummVM project
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -128,7 +128,7 @@ public:
int getSpriteFlagActive(int spriteId);
int getSpriteFlagRemapPalette(int spriteId);
int getSpriteFlagAutoAnim(int spriteId);
- int getSpriteFlagUpdateType(int spriteId);
+ int getSpriteFlagUpdateType(int spriteId);
int getSpriteFlagEraseType(int spriteId);
int getSpriteImage(int spriteId);
int getSpriteImageState(int spriteId);
diff --git a/scumm/string.cpp b/scumm/string.cpp
index 07be806ce4..1ac7565e64 100644
--- a/scumm/string.cpp
+++ b/scumm/string.cpp
@@ -188,7 +188,7 @@ void ScummEngine::CHARSET_1() {
_talkDelay = 60;
else
_talkDelay = VAR(VAR_DEFAULT_TALK_DELAY);
-
+
if (!_keepText) {
_charset->restoreCharsetBg();
}
@@ -222,7 +222,7 @@ void ScummEngine::CHARSET_1() {
_keepText = false;
break;
}
-
+
// FIXME: This is a workaround for bug #864030: In COMI, some text
// contains ASCII character 11 = 0xB. It's not quite clear what it is
// good for; so for now we just ignore it, which seems to match the
@@ -333,7 +333,7 @@ void ScummEngine::CHARSET_1() {
case 9:
frme = *buffer++;
frme |= *buffer++ << 8;
- if (a)
+ if (a)
a->startAnimActor(frme);
break;
case 10:
@@ -341,7 +341,7 @@ void ScummEngine::CHARSET_1() {
talk_sound_a = buffer[0] | (buffer[1] << 8) | (buffer[4] << 16) | (buffer[5] << 24);
talk_sound_b = buffer[8] | (buffer[9] << 8) | (buffer[12] << 16) | (buffer[13] << 24);
buffer += 14;
-
+
if (_heversion >= 60) {
_sound->startHETalkSound(talk_sound_a);
} else {
@@ -374,7 +374,7 @@ void ScummEngine::CHARSET_1() {
break;
case 14: {
int oldy = _charset->getFontHeight();
-
+
_charset->setCurID(*buffer++);
buffer += 2;
for (i = 0; i < 4; i++)
@@ -410,7 +410,7 @@ loc_avoid_ks_fe:
// Special case for loomcd, since it only uses CD audio.for sound
} else if (!ConfMan.getBool("subtitles") && (_haveMsg == 0xFE || _mixer->isSoundHandleActive(_sound->_talkChannelHandle))) {
// Subtitles are turned off, and there is a voice version
- // of this message -> don't print it.
+ // of this message -> don't print it.
} else
_charset->printChar(c);
}
@@ -426,7 +426,7 @@ loc_avoid_ks_fe:
VAR(VAR_CHARCOUNT)++;
} else
_talkDelay += (int)VAR(VAR_CHARINC);
-
+
// Handle line breaks for V1-V3
if (_version <= 3 && _charset->_nextLeft > _screenWidth) {
goto newLine;
@@ -681,7 +681,7 @@ int ScummEngine::convertMessageToString(const byte *msg, byte *dst, int dstSize)
*dst++ = chr;
}
}
-
+
// Check for a buffer overflow
if (dst >= end)
error("convertMessageToString: buffer overflow!");
@@ -818,7 +818,7 @@ void ScummEngine_v6::drawBlastTexts() {
if (_charset->_left < 0)
_charset->_left = 0;
}
-
+
do {
c = *buf++;
if (c != 0 && c != 0xFF && c != '\n') {
@@ -874,7 +874,7 @@ void ScummEngine_v7::loadLanguageBundle() {
_existLanguageFile = false;
return;
}
-
+
_existLanguageFile = true;
size = file.size();
@@ -909,7 +909,7 @@ void ScummEngine_v7::loadLanguageBundle() {
int lineCount = _languageIndexSize;
const char *baseTag = "";
byte enc = 0; // Initially assume the language file is not encoded
-
+
// We'll determine the real index size as we go.
_languageIndexSize = 0;
for (i = 0; i < lineCount; i++) {
@@ -931,23 +931,23 @@ void ScummEngine_v7::loadLanguageBundle() {
idx = idx * 10 + (*ptr - '0');
ptr++;
}
-
+
// ...followed by a slash...
assert(*ptr == '/');
ptr++;
-
+
// ...and then the translated message, possibly encoded
_languageIndex[_languageIndexSize].offset = ptr - _languageBuffer;
-
+
// Decode string if necessary.
if (enc) {
while (*ptr != '\n' && *ptr != '\r')
*ptr++ ^= enc;
}
-
+
// The tag is the basetag, followed by a dot and then the index
sprintf(_languageIndex[_languageIndexSize].tag, "%s.%03d", baseTag, idx);
-
+
// That was another index entry
_languageIndexSize++;
} else {
@@ -968,14 +968,14 @@ void ScummEngine_v7::loadLanguageBundle() {
for (j = 0; j < 8 && !isspace(*ptr); j++, ptr++)
_languageIndex[i].tag[j] = toupper(*ptr);
_languageIndex[i].tag[j] = 0;
-
+
// After that follows a single space which we skip
assert(isspace(*ptr));
ptr++;
// Then comes the translated string: we record an offset to that.
_languageIndex[i].offset = ptr - _languageBuffer;
-
+
// Skip over newlines (and turn them into null bytes)
ptr = strpbrk(ptr, "\n\r");
if (ptr == NULL)
@@ -1023,7 +1023,7 @@ void ScummEngine_v7::translateText(const byte *text, byte *trans_buff) {
LangIndexNode target;
LangIndexNode *found = NULL;
int i;
-
+
trans_buff[0] = 0;
_lastStringTag[0] = 0;
@@ -1055,7 +1055,7 @@ void ScummEngine_v7::translateText(const byte *text, byte *trans_buff) {
text = (const byte *)"/NEW.014/lens slot";
}
-
+
if (_version >= 7 && text[0] == '/') {
// Extract the string tag from the text: /..../
for (i = 0; (i < 12) && (text[i + 1] != '/'); i++)
@@ -1072,7 +1072,7 @@ void ScummEngine_v7::translateText(const byte *text, byte *trans_buff) {
// we're supposed to use it, but at least in the
// English version things will work so much better if
// we can't find translations for these.
-
+
if (*text && strcmp(target.tag, "PU_M001") != 0 && strcmp(target.tag, "PU_M002") != 0)
found = (LangIndexNode *)bsearch(&target, _languageIndex, _languageIndexSize, sizeof(LangIndexNode), indexCompare);
}
@@ -1091,7 +1091,7 @@ void ScummEngine_v7::translateText(const byte *text, byte *trans_buff) {
while (*src && *src != 0xFF) {
src++;
}
-
+
// Replace the %___ by the special code. Luckily, we can do
// that in-place.
if (*src == 0xFF) {
diff --git a/scumm/thumbnail.cpp b/scumm/thumbnail.cpp
index 46fc9f2fc0..b558059bc1 100644
--- a/scumm/thumbnail.cpp
+++ b/scumm/thumbnail.cpp
@@ -19,7 +19,7 @@
* $Header$
*
*/
-
+
#include "common/stdafx.h"
#include "common/system.h"
#include "common/savefile.h"
@@ -74,13 +74,13 @@ Graphics::Surface *ScummEngine::loadThumbnail(Common::InSaveFile *file) {
header.width = file->readUint16BE();
header.height = file->readUint16BE();
header.bpp = file->readByte();
-
+
// TODO: support other bpp values than 2
if (header.bpp != 2) {
file->skip(header.size - 14);
return 0;
}
-
+
Graphics::Surface *thumb = new Graphics::Surface();
thumb->create(header.width, header.height, sizeof(uint16));
@@ -90,7 +90,7 @@ Graphics::Surface *ScummEngine::loadThumbnail(Common::InSaveFile *file) {
for (int x = 0; x < thumb->w; ++x) {
uint8 r, g, b;
colorToRGB(file->readUint16BE(), r, g, b);
-
+
// converting to current OSystem Color
*pixels++ = _system->RGBToColor(r, g, b);
}
@@ -101,12 +101,12 @@ Graphics::Surface *ScummEngine::loadThumbnail(Common::InSaveFile *file) {
void ScummEngine::saveThumbnail(Common::OutSaveFile *file) {
Graphics::Surface thumb;
-
+
#if !defined(DISABLE_SCALERS) && !defined(DISABLE_HQ_SCALERS) // fcn has dep on HQ_SCALERS: thumbnail gets created as empty
if (!createThumbnailFromScreen(&thumb))
#endif
thumb.create(kThumbnailWidth, kThumbnailHeight2, sizeof(uint16));
-
+
ThumbnailHeader header;
header.type = MKID('THMB');
header.size = sizeof(header) + thumb.w*thumb.h*thumb.bytesPerPixel;
@@ -121,7 +121,7 @@ void ScummEngine::saveThumbnail(Common::OutSaveFile *file) {
file->writeUint16BE(header.width);
file->writeUint16BE(header.height);
file->writeByte(header.bpp);
-
+
// TODO: for later this shouldn't be casted to uint16...
uint16* pixels = (uint16 *)thumb.pixels;
for (uint16 p = 0; p < thumb.w*thumb.h; ++p, ++pixels)
diff --git a/scumm/usage_bits.cpp b/scumm/usage_bits.cpp
index 2877ab4e53..8c7ad3f4cd 100644
--- a/scumm/usage_bits.cpp
+++ b/scumm/usage_bits.cpp
@@ -31,7 +31,7 @@ void ScummEngine::upgradeGfxUsageBits() {
for (i = 409; i >= 0; i--) {
bool dirty_bit = ((gfxUsageBits[i] & 0x80000000) != 0);
bool restored_bit = ((gfxUsageBits[i] & 0x40000000) != 0);
-
+
gfxUsageBits[3 * i] = gfxUsageBits[i] & 0x3FFFFFFF;
if (dirty_bit)
setGfxUsageBit(i, USAGE_BIT_DIRTY);
diff --git a/scumm/util.cpp b/scumm/util.cpp
index 20e4ad9ad0..3e9d1e990f 100644
--- a/scumm/util.cpp
+++ b/scumm/util.cpp
@@ -78,7 +78,7 @@ bool ScummFile::openSubFile(const char *filename) {
// Get the length of the data file to use for consistency checks
const uint32 data_file_len = size();
-
+
// Read offset and length to the file records */
const uint32 file_record_off = readUint32BE();
const uint32 file_record_len = readUint32BE();
@@ -104,12 +104,12 @@ bool ScummFile::openSubFile(const char *filename) {
assert(file_name[0]);
//debug(7, " extracting \'%s\'", file_name);
-
+
// Consistency check. make sure the file data is in the file
if (file_off + file_len > data_file_len) {
return false;
}
-
+
if (scumm_stricmp(file_name, filename) == 0) {
// We got a match!
setSubfileRange(file_off, file_len);
@@ -155,7 +155,7 @@ void ScummFile::seek(int32 offs, int whence) {
uint32 ScummFile::read(void *dataPtr, uint32 dataSize) {
uint32 realLen;
-
+
if (_subFileLen) {
// Limit the amount we read by the subfile boundaries.
const uint32 curPos = pos();
@@ -166,10 +166,10 @@ uint32 ScummFile::read(void *dataPtr, uint32 dataSize) {
_ioFailed = true;
}
}
-
+
realLen = File::read(dataPtr, dataSize);
-
-
+
+
// If an encryption byte was specified, XOR the data we just read by it.
// This simple kind of "encryption" was used by some of the older SCUMM
// games.
@@ -281,7 +281,7 @@ enum ResType {
NES_UNKNOWN,
NES_GLOBDATA,
NES_ROOM,
- NES_SCRIPT,
+ NES_SCRIPT,
NES_SOUND,
NES_COSTUME,
NES_ROOMGFX,
@@ -292,7 +292,7 @@ enum ResType {
NES_SPROFFS,
NES_SPRDATA,
NES_CHARSET,
- NES_PREPLIST
+ NES_PREPLIST
};
struct ScummNESFile::Resource {
@@ -936,7 +936,7 @@ uint16 ScummNESFile::extractResource(Common::WriteStream *output, Resource *res)
}
// based on structure of Classic PC Maniac Mansion LFL files
-// (roomgfx resources are arranged in order, one per file,
+// (roomgfx resources are arranged in order, one per file,
// after the room blocks) */
static ScummNESFile::Resource *lfl_01[] = { &res_rooms[1], &res_roomgfx[1], &res_scripts[57], &res_scripts[61], &res_scripts[76], &res_scripts[105], &res_scripts[111], &res_sounds[5], &res_scripts[132], &res_scripts[148], &res_scripts[155], &res_scripts[156], &res_sounds[39], NULL };
static ScummNESFile::Resource *lfl_02[] = { &res_rooms[2], &res_roomgfx[2], NULL };
@@ -1109,7 +1109,7 @@ bool ScummNESFile::generateIndex() {
for (j = 0; lfl->entries[j] != NULL; j++) {
Resource *entry = lfl->entries[j];
-
+
switch (entry->type) {
case NES_ROOM:
lfl_index.room_lfl[entry - res_rooms] = lfl->num;
@@ -1259,7 +1259,7 @@ bool ScummNESFile::openSubFile(const char *filename) {
const char *ext = strrchr(filename, '.');
char resNum[3];
int res;
-
+
// We always have file name in form of XX.lfl
resNum[0] = ext[-2];
resNum[1] = ext[-1];
@@ -1472,7 +1472,7 @@ uint16 ScummC64File::extractResource(Common::WriteStream *out, int res) {
};
int i;
uint16 reslen = 0;
-
+
openDisk(_roomDisks[res]);
File::seek((SectorOffset[_roomTracks[res]] + _roomSectors[res]) * 256);
@@ -1528,7 +1528,7 @@ bool ScummC64File::openSubFile(const char *filename) {
const char *ext = strrchr(filename, '.');
char resNum[3];
int res;
-
+
// We always have file name in form of XX.lfl
resNum[0] = ext[-2];
resNum[1] = ext[-1];
diff --git a/scumm/util.h b/scumm/util.h
index 989db6a001..21acb73f0f 100644
--- a/scumm/util.h
+++ b/scumm/util.h
@@ -32,7 +32,7 @@ namespace Scumm {
class BaseScummFile : public Common::File {
public:
virtual void setEnc(byte value) = 0;
-
+
virtual bool open(const char *filename, AccessMode mode = kFileReadMode) = 0;
virtual bool openSubFile(const char *filename) = 0;
@@ -52,7 +52,7 @@ private:
public:
ScummFile();
void setEnc(byte value);
-
+
void setSubfileRange(uint32 start, uint32 len);
void resetSubfile();
@@ -74,7 +74,7 @@ public:
kROMsetEurope,
kROMsetSweden,
kROMsetFrance,
- kROMsetNum
+ kROMsetNum
};
struct Resource;
@@ -97,7 +97,7 @@ private:
public:
ScummNESFile();
void setEnc(byte value);
-
+
bool open(const char *filename, AccessMode mode = kFileReadMode);
bool openSubFile(const char *filename);
@@ -143,7 +143,7 @@ private:
public:
ScummC64File(char *disk1, char *disk2, bool maniac);
void setEnc(byte value);
-
+
bool open(const char *filename, AccessMode mode = kFileReadMode);
bool openSubFile(const char *filename);
diff --git a/scumm/vars.cpp b/scumm/vars.cpp
index b2c90ea405..82d114d779 100644
--- a/scumm/vars.cpp
+++ b/scumm/vars.cpp
@@ -166,7 +166,7 @@ void ScummEngine_v6::setupScummVars() {
VAR_ROOM_WIDTH = 41;
VAR_ROOM_HEIGHT = 54;
- if (_heversion >= 60 && _heversion <= 61) {
+ if (_heversion >= 60 && _heversion <= 61) {
VAR_NOSUBTITLES = 60;
} else {
VAR_SUBTITLES = 60;
@@ -182,7 +182,7 @@ void ScummEngine_v6::setupScummVars() {
VAR_V6_EMSSPACE = 76;
VAR_RANDOM_NR = 118;
-
+
VAR_TIMEDATE_YEAR = 119;
VAR_TIMEDATE_MONTH = 129;
VAR_TIMEDATE_DAY = 128;
@@ -451,7 +451,7 @@ void ScummEngine_v8::setupScummVars() {
VAR_VOICE_MODE = 39; // 0 is voice, 1 is voice+text, 2 is text only
VAR_GAME_LOADED = 40;
VAR_LANGUAGE = 41;
-
+
VAR_CURRENTDISK = 42;
VAR_MUSIC_BUNDLE_LOADED = 45;
VAR_VOICE_BUNDLE_LOADED = 46;
@@ -523,7 +523,7 @@ void ScummEngine_v5::initScummVars() {
// Setup light
VAR(VAR_CURRENT_LIGHTS) = LIGHTMODE_actor_base | LIGHTMODE_actor_color | LIGHTMODE_screen;
}
-
+
if (_gameId == GID_MONKEY || _gameId == GID_MONKEY_SEGA)
_scummVars[74] = 1225;
}
@@ -607,7 +607,7 @@ void ScummEngine::initScummVars() {
case MD_PCSPK:
case MD_PCJR: VAR(VAR_SOUNDCARD) = 1; break;
case MD_ADLIB: VAR(VAR_SOUNDCARD) = 3; break;
- default:
+ default:
if ((_gameId == GID_MONKEY_EGA || _gameId == GID_MONKEY_VGA || _gameId == GID_LOOM)
&& (_platform == Common::kPlatformPC)) {
if (_gameId == GID_LOOM) {
@@ -667,7 +667,7 @@ void ScummEngine::initScummVars() {
VAR(39) = 80;
}
VAR(VAR_HEAPSPACE) = 1400;
- }
+ }
if (_version >= 4) {
VAR(VAR_HEAPSPACE) = 1400;
VAR(VAR_FIXEDDISK) = true;
@@ -677,10 +677,10 @@ void ScummEngine::initScummVars() {
if (_version == 6)
VAR(VAR_V6_EMSSPACE) = 10000;
}
-
+
if (VAR_FADE_DELAY != 0xFF)
VAR(VAR_FADE_DELAY) = 3;
-
+
VAR(VAR_CHARINC) = 4;
setTalkingActor(0);
}
diff --git a/scumm/verbs.cpp b/scumm/verbs.cpp
index eae9b5f3d1..a940ac489b 100644
--- a/scumm/verbs.cpp
+++ b/scumm/verbs.cpp
@@ -226,7 +226,7 @@ void ScummEngine_v2::checkV2Inventory(int x, int y) {
y -= virtscr[kVerbVirtScreen].topline;
- if ((y < inventoryArea) || !(_mouseAndKeyboardStat & MBS_LEFT_CLICK))
+ if ((y < inventoryArea) || !(_mouseAndKeyboardStat & MBS_LEFT_CLICK))
return;
if (_mouseOverBoxesV2[kInventoryUpArrow].rect.contains(x, y)) {
@@ -286,7 +286,7 @@ void ScummEngine_v2::redrawV2Inventory() {
int obj = findInventory(_scummVars[VAR_EGO], i + 1 + _inventoryOffset);
if (obj == 0)
break;
-
+
_string[1].ypos = _mouseOverBoxesV2[i].rect.top + vs->topline;
_string[1].xpos = _mouseOverBoxesV2[i].rect.left;
@@ -397,7 +397,7 @@ void ScummEngine::checkExecVerbs() {
}
}
}
-
+
if ((_gameId == GID_INDY4 || _gameId == GID_PASS) && _mouseAndKeyboardStat >= '0' && _mouseAndKeyboardStat <= '9') {
// To support keyboard fighting in FOA, we need to remap the number keys.
// FOA apparently expects PC scancode values (see script 46 if you want
@@ -412,7 +412,7 @@ void ScummEngine::checkExecVerbs() {
};
_mouseAndKeyboardStat = numpad[_mouseAndKeyboardStat - '0'];
}
-
+
// Generic keyboard input
runInputScript(4, _mouseAndKeyboardStat, 1);
} else if (_mouseAndKeyboardStat & MBS_MOUSE_MASK) {
@@ -521,7 +521,7 @@ void ScummEngine_v7::drawVerb(int verb, int mode) {
msg += 4;
enqueueText(msg, vs->curRect.left, vs->curRect.top, color, vs->charset_nr, vs->center);
-
+
// Set the specified charset id
_charset->setCurID(vs->charset_nr);
@@ -557,7 +557,7 @@ void ScummEngine::drawVerb(int verb, int mode) {
drawVerbBitmap(verb, vs->curRect.left, vs->curRect.top);
return;
}
-
+
restoreVerbBG(verb);
_string[4].charset = vs->charset_nr;
@@ -575,7 +575,7 @@ void ScummEngine::drawVerb(int verb, int mode) {
// FIXME For the future: Indy3 and under inv scrolling
/*
- if (verb >= 31 && verb <= 36)
+ if (verb >= 31 && verb <= 36)
verb += _inventoryOffset;
*/
diff --git a/scumm/wiz_he.cpp b/scumm/wiz_he.cpp
index d5ac53734b..dfcbc7103f 100644
--- a/scumm/wiz_he.cpp
+++ b/scumm/wiz_he.cpp
@@ -97,7 +97,7 @@ void Wiz::polygonStore(int id, bool flag, int vert1x, int vert1y, int vert2x, in
wp->vert[4].y = vert1y;
wp->id = id;
wp->numVerts = 5;
- wp->flag = flag;
+ wp->flag = flag;
polygonCalcBoundBox(wp->vert, wp->numVerts, wp->bound);
}
@@ -215,12 +215,12 @@ bool Wiz::polygonContains(const WizPolygon &pol, int x, int y) {
void Wiz::copyAuxImage(uint8 *dst1, uint8 *dst2, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch) {
Common::Rect dstRect(srcx, srcy, srcx + srcw, srcy + srch);
dstRect.clip(dstw, dsth);
-
+
int rw = dstRect.width();
int rh = dstRect.height();
if (rh <= 0 || rw <= 0)
return;
-
+
uint8 *dst1Ptr = dst1 + dstRect.left + dstRect.top * dstw;
uint8 *dst2Ptr = dst2 + dstRect.left + dstRect.top * dstw;
const uint8 *dataPtr = src;
@@ -413,7 +413,7 @@ void Wiz::decompressWizImage(uint8 *dst, int dstPitch, const Common::Rect &dstRe
uint8 databit;
int h, w, xoff;
uint16 off;
-
+
byte imagePal[256];
if (!palPtr) {
for (int i = 0; i < 256; i++) {
@@ -424,7 +424,7 @@ void Wiz::decompressWizImage(uint8 *dst, int dstPitch, const Common::Rect &dstRe
dstPtr = dst;
dataPtr = src;
-
+
// Skip over the first 'srcRect->top' lines in the data
h = srcRect.top;
while (h--) {
@@ -434,7 +434,7 @@ void Wiz::decompressWizImage(uint8 *dst, int dstPitch, const Common::Rect &dstRe
w = srcRect.width();
if (h <= 0 || w <= 0)
return;
-
+
while (h--) {
xoff = srcRect.left;
off = READ_LE_UINT16(dataPtr);
@@ -741,17 +741,17 @@ static int wizPackType1(uint8 *dst, const uint8 *src, int srcPitch, const Common
debug(1, "wizPackType1(%d, [%d,%d,%d,%d])", tColor, rCapt.left, rCapt.top, rCapt.right, rCapt.bottom);
wizPackCtx ctx;
memset(&ctx, 0, sizeof(ctx));
-
+
src += rCapt.top * srcPitch + rCapt.left;
int w = rCapt.width();
int h = rCapt.height();
-
+
uint8 *nextDstPtr, *curDstPtr;
uint8 curColor, prevColor;
int saveBufPos;
-
+
nextDstPtr = curDstPtr = 0;
-
+
int dataSize = 0;
while (h--) {
if (dst) {
@@ -761,7 +761,7 @@ static int wizPackType1(uint8 *dst, const uint8 *src, int srcPitch, const Common
}
dataSize += 2;
int numBytes = 0;
-
+
int i, code;
for (i = 0; i < w; ++i) {
if (src[i] != tColor)
@@ -993,7 +993,7 @@ uint8 *Wiz::drawWizImage(int resNum, int state, int x1, int y1, int zorder, int
uint32 width = READ_LE_UINT32(wizh + 0x4);
uint32 height = READ_LE_UINT32(wizh + 0x8);
debug(2, "wiz_header.comp = %d wiz_header.w = %d wiz_header.h = %d", comp, width, height);
-
+
uint8 *wizd = _vm->findWrappedBlock(MKID('WIZD'), dataPtr, state, 0);
assert(wizd);
@@ -1130,17 +1130,17 @@ struct PolygonDrawData {
Common::Point pto;
InterArea *ia;
int areasNum;
-
+
PolygonDrawData(int n) {
areasNum = n;
ia = new InterArea[areasNum];
memset(ia, 0, sizeof(InterArea) * areasNum);
}
-
+
~PolygonDrawData() {
delete[] ia;
}
-
+
void calcIntersection(const Common::Point *p1, const Common::Point *p2, const Common::Point *p3, const Common::Point *p4) {
int32 x1_acc = p1->x << 0x10;
int32 x3_acc = p3->x << 0x10;
@@ -1157,7 +1157,7 @@ struct PolygonDrawData {
int32 tx1 = x1_acc >> 0x10;
int32 tx3 = x3_acc >> 0x10;
int32 ty3 = y3_acc >> 0x10;
-
+
if (!pia->valid || pia->xmin > tx1) {
pia->xmin = tx1;
pia->x1 = tx3;
@@ -1173,12 +1173,12 @@ struct PolygonDrawData {
x1_acc += x1_step;
x3_acc += x3_step;
y3_acc += y3_step;
-
+
if (p2->y <= p1->y) {
--iaidx;
} else {
++iaidx;
- }
+ }
}
}
};
@@ -1309,7 +1309,7 @@ void Wiz::drawWizPolygon(int resNum, int state, int id, int flags, int shadow, i
ymin_p = MIN(wp->vert[i].y, ymin_p);
ymax_p = MAX(wp->vert[i].y, ymax_p);
}
-
+
int16 xmin_b, xmax_b, ymin_b, ymax_b;
xmin_b = 0;
xmax_b = wizW - 1;
@@ -1319,12 +1319,12 @@ void Wiz::drawWizPolygon(int resNum, int state, int id, int flags, int shadow, i
PolygonDrawData pdd(ymax_p - ymin_p + 1);
pdd.pto.x = xmin_p;
pdd.pto.y = ymin_p;
-
+
for (i = 0; i < 3; ++i) {
pdd.calcIntersection(&wp->vert[i], &wp->vert[i + 1], &bbox[i], &bbox[i + 1]);
}
pdd.calcIntersection(&wp->vert[3], &wp->vert[0], &bbox[3], &bbox[0]);
-
+
uint yoff = pdd.pto.y * pvs->w;
for (i = 0; i < pdd.areasNum; ++i) {
PolygonDrawData::InterArea *pia = &pdd.ia[i];
@@ -1396,7 +1396,7 @@ void Wiz::loadWizCursor(int resId) {
const Common::Rect *r = NULL;
uint8 *cursor = drawWizImage(resId, 0, 0, 0, 0, 0, 0, r, kWIFBlitToMemBuffer, 0, 0);
- int32 cw, ch;
+ int32 cw, ch;
getWizImageDim(resId, 0, cw, ch);
_vm->setCursorFromBuffer(cursor, cw, ch, cw);
_vm->setCursorHotspot(x, y);
@@ -1527,7 +1527,7 @@ void Wiz::createWizEmptyImage(const WizParameters *params) {
res_size += 0x10C;
}
res_size += 8 + img_w * img_h;
-
+
const uint8 *palPtr;
if (_vm->_heversion >= 99) {
palPtr = _vm->_hePalettes + 1024;
@@ -1549,7 +1549,7 @@ void Wiz::createWizEmptyImage(const WizParameters *params) {
if (flags & 1) {
WRITE_BE_UINT32(res_data, 'RGBS'); res_data += 4;
WRITE_BE_UINT32(res_data, 0x308); res_data += 4;
- memcpy(res_data, palPtr, 0x300); res_data += 0x300;
+ memcpy(res_data, palPtr, 0x300); res_data += 0x300;
}
if (flags & 2) {
WRITE_BE_UINT32(res_data, 'SPOT'); res_data += 4;
@@ -1576,7 +1576,7 @@ void Wiz::fillWizRect(const WizParameters *params) {
state = params->img.state;
}
uint8 *dataPtr = _vm->getResourceAddress(rtImage, params->img.resNum);
- if (dataPtr) {
+ if (dataPtr) {
uint8 *wizh = _vm->findWrappedBlock(MKID('WIZH'), dataPtr, state, 0);
assert(wizh);
int c = READ_LE_UINT32(wizh + 0x0);
@@ -1609,7 +1609,7 @@ void Wiz::fillWizRect(const WizParameters *params) {
}
}
-void Wiz::fillWizLine(const WizParameters *params) {
+void Wiz::fillWizLine(const WizParameters *params) {
if (params->processFlags & kWPFClipBox2) {
int state = 0;
if (params->processFlags & kWPFNewState) {
@@ -1640,7 +1640,7 @@ void Wiz::fillWizLine(const WizParameters *params) {
int y1 = params->box2.top;
int x2 = params->box2.right;
int y2 = params->box2.bottom;
-
+
int dx = x2 - x1;
int incx = 0;
if (dx > 0) {
@@ -1655,11 +1655,11 @@ void Wiz::fillWizLine(const WizParameters *params) {
} else if (dy < 0) {
incy = -1;
}
-
+
if (r1.contains(x1, y1)) {
*(wizd + y1 * w + x1) = color;
}
-
+
if (dx >= dy) {
int step1_y = (dy - dx) * 2;
int step2_y = dy * 2;
@@ -1690,7 +1690,7 @@ void Wiz::fillWizLine(const WizParameters *params) {
y1 += incy;
if (r1.contains(x1, y1)) {
*(wizd + y1 * w + x1) = color;
- }
+ }
}
}
}
diff --git a/scumm/wiz_he.h b/scumm/wiz_he.h
index 98ee502aa2..e388bc0e99 100644
--- a/scumm/wiz_he.h
+++ b/scumm/wiz_he.h
@@ -1,6 +1,6 @@
/* ScummVM - Scumm Interpreter
* Copyright (C) 2001 Ludvig Strigeus
- * Copyright (C) 2001-2005 The ScummVM project
+ * Copyright (C) 2001-2005 The ScummVM project
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -19,7 +19,7 @@
* $Header$
*
*/
-
+
#if !defined(WIZ_HE_H) && !defined(DISABLE_HE)
#define WIZ_HE_H
@@ -144,7 +144,7 @@ public:
WizImage _images[NUM_IMAGES];
uint16 _imagesNum;
WizPolygon _polygons[NUM_POLYGONS];
-
+
Wiz(ScummEngine_v70he *vm);
void clearWizBuffer();
@@ -166,7 +166,7 @@ public:
void fillWizLine(const WizParameters *params);
void getWizImageDim(int resNum, int state, int32 &w, int32 &h);
- int getWizImageStates(int resnum);
+ int getWizImageStates(int resnum);
int isWizPixelNonTransparent(int resnum, int state, int x, int y, int flags);
uint8 getWizPixelColor(int resnum, int state, int x, int y, int flags);
@@ -183,7 +183,7 @@ public:
void drawWizComplexPolygon(int resNum, int state, int po_x, int po_y, int shadow, int angle, int zoom, const Common::Rect *r, int flags, int dstResNum, int palette);
void processWizImage(const WizParameters *params);
- static void copyAuxImage(uint8 *dst1, uint8 *dst2, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch);
+ static void copyAuxImage(uint8 *dst1, uint8 *dst2, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch);
static void copyWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, const uint8 *palPtr = NULL);
static void copyRawWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, int transColor);
static void copyRaw16BitWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, int transColor);