[Scummvm-git-logs] scummvm master -> 235ab0cc6a804616f920256bb3b77207373738c9
sev-
noreply at scummvm.org
Sat Oct 29 21:46:23 UTC 2022
This automated email contains information about 12 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
c76b8f1078 SAGA2: Rename enums in tcoords.h
1cdfdd72de SAGA2: Rename constants in terrain.h
90cc01996a SAGA2: Rename enums in tile.h
afc3aeec50 SAGA2: Rename enums in tileload.h
d8e24a16de SAGA2: Rename enums in towerwin.h
75dcb112c6 SAGA2: Rename enums in uidialog.h
a270ee4275 SAGA2: Rename constants in uimetrics.h
09eba1d77f SAGA2: Rename enums in videobox.h
a1c5dee320 SAGA2: Renamed some constants
3de1aaa517 SAGA2: Remove unused constants
2d3173b151 SAGA2: Rename rest of constants in the header files
235ab0cc6a SAGA2: Rename constants in audio.cpp
Commit: c76b8f1078d4165e3931501575f4a3b8ceee6c72
https://github.com/scummvm/scummvm/commit/c76b8f1078d4165e3931501575f4a3b8ceee6c72
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-10-29T23:45:58+02:00
Commit Message:
SAGA2: Rename enums in tcoords.h
Changed paths:
engines/saga2/actor.cpp
engines/saga2/motion.cpp
engines/saga2/objproto.cpp
engines/saga2/objproto.h
engines/saga2/path.cpp
engines/saga2/tcoords.h
engines/saga2/tile.cpp
diff --git a/engines/saga2/actor.cpp b/engines/saga2/actor.cpp
index 007cfa1f936..ac7c2e7e7be 100644
--- a/engines/saga2/actor.cpp
+++ b/engines/saga2/actor.cpp
@@ -961,7 +961,7 @@ void Actor::init(
_attitude = 0;
_mood = 0;
_disposition = 0;
- _currentFacing = dirDown;
+ _currentFacing = kDirDown;
_tetherLocU = 0;
_tetherLocV = 0;
_tetherDist = 0;
diff --git a/engines/saga2/motion.cpp b/engines/saga2/motion.cpp
index dbb5d08801c..0b1e4e7cf47 100644
--- a/engines/saga2/motion.cpp
+++ b/engines/saga2/motion.cpp
@@ -2649,20 +2649,20 @@ void MotionTask::walkAction() {
if (foundPath == false) {
if (targetVector.u > speed / 2
- && checkWalk(dirUpRight, speedScale, 0, newPos)) {
- movementDirection = dirUpRight;
+ && checkWalk(kDirUpRight, speedScale, 0, newPos)) {
+ movementDirection = kDirUpRight;
foundPath = true;
} else if (-targetVector.u > speed / 2
- && checkWalk(dirDownLeft, speedScale, 0, newPos)) {
- movementDirection = dirDownLeft;
+ && checkWalk(kDirDownLeft, speedScale, 0, newPos)) {
+ movementDirection = kDirDownLeft;
foundPath = true;
} else if (targetVector.v > speed / 2
- && checkWalk(dirUpLeft, speedScale, 0, newPos)) {
- movementDirection = dirUpLeft;
+ && checkWalk(kDirUpLeft, speedScale, 0, newPos)) {
+ movementDirection = kDirUpLeft;
foundPath = true;
} else if (-targetVector.v > speed / 2
- && checkWalk(dirDownRight, speedScale, 0, newPos)) {
- movementDirection = dirDownRight;
+ && checkWalk(kDirDownRight, speedScale, 0, newPos)) {
+ movementDirection = kDirDownRight;
foundPath = true;
}
}
diff --git a/engines/saga2/objproto.cpp b/engines/saga2/objproto.cpp
index a05e3a2b237..50529b9cf86 100644
--- a/engines/saga2/objproto.cpp
+++ b/engines/saga2/objproto.cpp
@@ -1692,7 +1692,7 @@ bool MeleeWeaponProto::canBlock() {
// Return a mask of bits indicating the directions relative to the
// wielders facing in which this object can defend
uint8 MeleeWeaponProto::defenseDirMask() {
- return 1 << dirUp;
+ return 1 << kDirUp;
}
//-----------------------------------------------------------------------
@@ -2313,7 +2313,7 @@ bool ShieldProto::canBlock() {
// Return a mask of bits indicating the directions relative to the
// wielders facing in which this object can defend
uint8 ShieldProto::defenseDirMask() {
- return (1 << dirUp) | (1 << dirUpLeft);
+ return (1 << kDirUp) | (1 << kDirUpLeft);
}
//-----------------------------------------------------------------------
diff --git a/engines/saga2/objproto.h b/engines/saga2/objproto.h
index 28250bcad8e..f02dc785ff0 100644
--- a/engines/saga2/objproto.h
+++ b/engines/saga2/objproto.h
@@ -156,7 +156,7 @@ public:
* ===================================================================== */
inline bool isFlipped(Direction d) {
- return (d > dirDown);
+ return (d > kDirDown);
}
/* ===================================================================== *
diff --git a/engines/saga2/path.cpp b/engines/saga2/path.cpp
index 5440759d58a..f7fd6fb3307 100644
--- a/engines/saga2/path.cpp
+++ b/engines/saga2/path.cpp
@@ -1576,7 +1576,7 @@ big_break:
quantizedCoords.z),
platform,
cost,
- dirInvalid,
+ kDirInvalid,
0);
}
}
@@ -1599,10 +1599,10 @@ void PathRequest::finish() {
cell = cellArray->getCell(_bestPlatform, _bestLoc.u, _bestLoc.v);
assert(cell != nullptr);
- if (cell->direction != dirInvalid) {
+ if (cell->direction != kDirInvalid) {
res = &tempResult[ARRAYSIZE(tempResult)];
- prevDir = dirInvalid;
+ prevDir = kDirInvalid;
for (;;) {
int16 reverseDir;
@@ -1610,7 +1610,7 @@ void PathRequest::finish() {
cell = cellArray->getCell(_bestPlatform, _bestLoc.u, _bestLoc.v);
assert(cell != nullptr);
- if (cell->direction != dirInvalid) {
+ if (cell->direction != kDirInvalid) {
if (cell->direction != prevDir
|| ABS(cell->height - prevHeight) > kMaxStepHeight) {
if (res <= tempResult) break;
@@ -1710,7 +1710,7 @@ PathResult PathRequest::findPath() {
centerTileCoords.v = qi.v + _baseTileCoords.v;
centerTileCoords.z = 0;
- if (qi.direction == dirInvalid) {
+ if (qi.direction == kDirInvalid) {
// If this is the starting position, check all directions
i = dir = 0;
tDir = tDirTable2;
@@ -1976,7 +1976,7 @@ PathResult PathRequest::findPath() {
cost += costTable[
7
+ dir
- - (qi.direction != dirInvalid
+ - (qi.direction != kDirInvalid
? qi.direction
: _actor->_currentFacing)];
@@ -2425,10 +2425,10 @@ posVMask = 0x0770,
negVMask = 0x0ee0;
uint16 sTerrainMasks[8] = {
- posUMask, negUMask, // dirUpLeft (U+)
- negVMask, posVMask, // dirDownLeft (V-)
- negUMask, posUMask, // dirDownRight (U-)
- posVMask, negVMask, // dirUpRight (V+)
+ posUMask, negUMask, // kDirUpLeft (U+)
+ negVMask, posVMask, // kDirDownLeft (V-)
+ negUMask, posUMask, // kDirDownRight (U-)
+ posVMask, negVMask, // kDirUpRight (V+)
};
TilePoint selectNearbySite(
@@ -2575,8 +2575,8 @@ TilePoint selectNearbySite(
if (distFromCenter >= maxDist) continue;
- for (dir = dirUpLeft;
- dir <= dirUpRight;
+ for (dir = kDirUpLeft;
+ dir <= kDirUpRight;
dir += 2) {
uint32 terrain;
uint8 *cell;
@@ -2804,8 +2804,8 @@ bool checkPath(
centerDistFromDest = (_centerPt - destCoords).quickHDistance();
- for (dir = dirUpLeft;
- dir <= dirUpRight;
+ for (dir = kDirUpLeft;
+ dir <= kDirUpRight;
dir += 2) {
uint32 terrain;
uint8 *cell;
diff --git a/engines/saga2/tcoords.h b/engines/saga2/tcoords.h
index 8c0f7c73fea..5c8a218bd73 100644
--- a/engines/saga2/tcoords.h
+++ b/engines/saga2/tcoords.h
@@ -32,16 +32,16 @@
namespace Saga2 {
enum facingDirections {
- dirUp = 0,
- dirUpLeft,
- dirLeft,
- dirDownLeft,
- dirDown,
- dirDownRight,
- dirRight,
- dirUpRight,
-
- dirInvalid
+ kDirUp = 0,
+ kDirUpLeft,
+ kDirLeft,
+ kDirDownLeft,
+ kDirDown,
+ kDirDownRight,
+ kDirRight,
+ kDirUpRight,
+
+ kDirInvalid
};
typedef uint8 Direction;
diff --git a/engines/saga2/tile.cpp b/engines/saga2/tile.cpp
index 661b5a96325..6765c8dff82 100644
--- a/engines/saga2/tile.cpp
+++ b/engines/saga2/tile.cpp
@@ -1724,11 +1724,11 @@ int16 TilePoint::quickDir() {
v2 = v * 2;
if (u < v2) {
- if (v > -u2) return (v > u2 ? dirUpLeft : dirUp);
- return (u > -v2 ? dirLeft : dirDownLeft);
+ if (v > -u2) return (v > u2 ? kDirUpLeft : kDirUp);
+ return (u > -v2 ? kDirLeft : kDirDownLeft);
} else {
- if (v > -u2) return (u > -v2 ? dirUpRight : dirRight);
- return (v > u2 ? dirDown : dirDownRight);
+ if (v > -u2) return (u > -v2 ? kDirUpRight : kDirRight);
+ return (v > u2 ? kDirDown : kDirDownRight);
}
}
Commit: 1cdfdd72de87185a52af9382ce87082fb37879fd
https://github.com/scummvm/scummvm/commit/1cdfdd72de87185a52af9382ce87082fb37879fd
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-10-29T23:45:58+02:00
Commit Message:
SAGA2: Rename constants in terrain.h
Changed paths:
engines/saga2/terrain.cpp
engines/saga2/terrain.h
diff --git a/engines/saga2/terrain.cpp b/engines/saga2/terrain.cpp
index 68500c7fe1c..9a14b1bb564 100644
--- a/engines/saga2/terrain.cpp
+++ b/engines/saga2/terrain.cpp
@@ -46,8 +46,8 @@ void drown(GameObject *obj) {
if (isActor(obj)) {
Actor *a = (Actor *) obj;
if (!a->hasEffect(kActorWaterBreathe)) {
- if (g_vm->_rnd->getRandomNumber(drowningDamageOddsYes + drowningDamageOddsNo - 1) > drowningDamageOddsNo - 1) {
- a->acceptDamage(a->thisID(), drowningDamagePerFrame);
+ if (g_vm->_rnd->getRandomNumber(kDrowningDamageOddsYes + kDrowningDamageOddsNo - 1) > kDrowningDamageOddsNo - 1) {
+ a->acceptDamage(a->thisID(), kDrowningDamagePerFrame);
}
}
}
@@ -60,8 +60,8 @@ void lavaDamage(GameObject *obj) {
if (a->resists(kResistHeat))
return;
}
- if (g_vm->_rnd->getRandomNumber(heatDamageOddsYes + heatDamageOddsNo - 1) > heatDamageOddsNo - 1) {
- obj->acceptDamage(obj->thisID(), heatDamagePerFrame, kDamageHeat, heatDamageDicePerFrame, 6);
+ if (g_vm->_rnd->getRandomNumber(kHeatDamageOddsYes + kHeatDamageOddsNo - 1) > kHeatDamageOddsNo - 1) {
+ obj->acceptDamage(obj->thisID(), kHeatDamagePerFrame, kDamageHeat, kHeatDamageDicePerFrame, 6);
}
}
@@ -71,20 +71,20 @@ void coldDamage(GameObject *obj) {
if (a->resists(kResistCold))
return;
}
- if (g_vm->_rnd->getRandomNumber(coldDamageOddsYes + coldDamageOddsNo - 1) > coldDamageOddsNo - 1) {
- obj->acceptDamage(obj->thisID(), coldDamagePerFrame, kDamageCold, coldDamageDicePerFrame, 6);
+ if (g_vm->_rnd->getRandomNumber(kColdDamageOddsYes + kColdDamageOddsNo - 1) > kColdDamageOddsNo - 1) {
+ obj->acceptDamage(obj->thisID(), kColdDamagePerFrame, kDamageCold, kColdDamageDicePerFrame, 6);
}
}
void terrainDamageSlash(GameObject *obj) {
- if (g_vm->_rnd->getRandomNumber(terrainDamageOddsYes + terrainDamageOddsNo - 1) > terrainDamageOddsNo - 1) {
- obj->acceptDamage(obj->thisID(), terrainDamagePerFrame, kDamageSlash, terrainDamageDicePerFrame, 6);
+ if (g_vm->_rnd->getRandomNumber(kTerrainDamageOddsYes + kTerrainDamageOddsNo - 1) > kTerrainDamageOddsNo - 1) {
+ obj->acceptDamage(obj->thisID(), kTerrainDamagePerFrame, kDamageSlash, kTerrainDamageDicePerFrame, 6);
}
}
void terrainDamageBash(GameObject *obj) {
- if (g_vm->_rnd->getRandomNumber(terrainDamageOddsYes + terrainDamageOddsNo - 1) > terrainDamageOddsNo - 1) {
- obj->acceptDamage(obj->thisID(), terrainDamagePerFrame, kDamageImpact, terrainDamageDicePerFrame, 6);
+ if (g_vm->_rnd->getRandomNumber(kTerrainDamageOddsYes + kTerrainDamageOddsNo - 1) > kTerrainDamageOddsNo - 1) {
+ obj->acceptDamage(obj->thisID(), kTerrainDamagePerFrame, kDamageImpact, kTerrainDamageDicePerFrame, 6);
}
}
@@ -92,7 +92,7 @@ void fallingDamage(GameObject *obj, int16 speed) {
if (isActor(obj)) {
Actor *a = (Actor *) obj;
if (!a->hasEffect(kActorSlowFall)) {
- a->acceptDamage(a->thisID(), (MAX(0, speed - 16)*fallingDamageMult) / fallingDamageDiv);
+ a->acceptDamage(a->thisID(), (MAX(0, speed - 16)*kFallingDamageMult) / kFallingDamageDiv);
}
}
diff --git a/engines/saga2/terrain.h b/engines/saga2/terrain.h
index 1cbe90c4319..6a9f554d230 100644
--- a/engines/saga2/terrain.h
+++ b/engines/saga2/terrain.h
@@ -35,40 +35,40 @@ struct TileRegion;
// the first two determine the chances of doing damage on a
// each screen refresh
// the third is the damage done
-#define drowningDamageOddsYes (1)
-#define drowningDamageOddsNo (3)
-#define drowningDamagePerFrame (1)
+#define kDrowningDamageOddsYes (1)
+#define kDrowningDamageOddsNo (3)
+#define kDrowningDamagePerFrame (1)
// these control damage taken by falling
// the magnatude of the velocity vector is multiplied by the first
// then divided by the second.
// as it turns out the velocity is a pretty reasonable damage amount
-#define fallingDamageMult (2)
-#define fallingDamageDiv (1)
+#define kFallingDamageMult (2)
+#define kFallingDamageDiv (1)
// these control the rate of lava damage
// the first two determine the chances of doing damage on a
// each screen refresh
// the last two are the damage done (absolute & d6)
-#define heatDamageOddsYes (1)
-#define heatDamageOddsNo (3)
-#define heatDamagePerFrame (1)
-#define heatDamageDicePerFrame (1)
+#define kHeatDamageOddsYes (1)
+#define kHeatDamageOddsNo (3)
+#define kHeatDamagePerFrame (1)
+#define kHeatDamageDicePerFrame (1)
// these control the rate of freezing damage
// the first two determine the chances of doing damage on a
// each screen refresh
// the last two are the damage done (absolute & d6)
-#define coldDamageOddsYes (1)
-#define coldDamageOddsNo (15)
-#define coldDamagePerFrame (1)
-#define coldDamageDicePerFrame (0)
-
-#define terrainDamageOddsYes (1)
-#define terrainDamageOddsNo (1)
-#define terrainDamagePerFrame (1)
-#define terrainDamageDicePerFrame (2)
+#define kColdDamageOddsYes (1)
+#define kColdDamageOddsNo (15)
+#define kColdDamagePerFrame (1)
+#define kColdDamageDicePerFrame (0)
+
+#define kTerrainDamageOddsYes (1)
+#define kTerrainDamageOddsNo (1)
+#define kTerrainDamagePerFrame (1)
+#define kTerrainDamageDicePerFrame (2)
/* ===================================================================== *
Classes referenced by this header
Commit: 90cc01996a8e515dcfa32402253733e672e48079
https://github.com/scummvm/scummvm/commit/90cc01996a8e515dcfa32402253733e672e48079
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-10-29T23:45:58+02:00
Commit Message:
SAGA2: Rename enums in tile.h
Changed paths:
engines/saga2/actor.cpp
engines/saga2/automap.cpp
engines/saga2/effects.cpp
engines/saga2/magic.cpp
engines/saga2/mapfeatr.cpp
engines/saga2/motion.cpp
engines/saga2/objects.cpp
engines/saga2/path.cpp
engines/saga2/property.cpp
engines/saga2/sensor.cpp
engines/saga2/spelcast.cpp
engines/saga2/speldefs.h
engines/saga2/terrain.cpp
engines/saga2/tile.cpp
engines/saga2/tile.h
engines/saga2/tilemode.cpp
diff --git a/engines/saga2/actor.cpp b/engines/saga2/actor.cpp
index ac7c2e7e7be..ba94f978c3f 100644
--- a/engines/saga2/actor.cpp
+++ b/engines/saga2/actor.cpp
@@ -2300,7 +2300,7 @@ void Actor::updateAppearance(int32) {
#if DEBUG*0
extern void ShowObjectSection(GameObject * obj);
if (this != getCenterActor())
- if (lineOfSight(getCenterActor(), this, terrainSurface))
+ if (lineOfSight(getCenterActor(), this, kTerrainSurface))
ShowObjectSection(this);
#endif
diff --git a/engines/saga2/automap.cpp b/engines/saga2/automap.cpp
index f01ecb008d7..abf4baf9f9f 100644
--- a/engines/saga2/automap.cpp
+++ b/engines/saga2/automap.cpp
@@ -491,10 +491,10 @@ void AutoMap::createSmallMap() {
v--, x += tileSumWidthHalved, y += 2) {
uint16 mtile = mapRow[v];
- if (mtile & metaTileVisited)
- if (_autoMapCheat || (mtile & metaTileVisited)) {
+ if (mtile & kMetaTileVisited)
+ if (_autoMapCheat || (mtile & kMetaTileVisited)) {
// get the tile data
- map._data = &_summaryData[(mtile & ~metaTileVisited) << 6];
+ map._data = &_summaryData[(mtile & ~kMetaTileVisited) << 6];
// blit this tile onto the temp surface
TBlit(_tPort._map,
diff --git a/engines/saga2/effects.cpp b/engines/saga2/effects.cpp
index c1cb94c7a7d..6767649443f 100644
--- a/engines/saga2/effects.cpp
+++ b/engines/saga2/effects.cpp
@@ -248,7 +248,7 @@ void ProtoTAGEffect::implement(GameObject *cst, SpellTarget *trg, int8) {
ActiveItem *tag = trg->getTAG();
assert(tag);
if (_affectBit == kSettagLocked) {
- //if ( tag->builtInBehavior()==ActiveItem::builtInDoor )
+ //if ( tag->builtInBehavior()==ActiveItem::kBuiltInDoor )
if (tag->isLocked() != _onOff)
tag->acceptLockToggle(cst->thisID(), tag->lockType());
} else if (_affectBit == kSettagOpen) {
diff --git a/engines/saga2/magic.cpp b/engines/saga2/magic.cpp
index 9a60f42f3ae..2206ad7080c 100644
--- a/engines/saga2/magic.cpp
+++ b/engines/saga2/magic.cpp
@@ -147,7 +147,7 @@ bool validTarget(GameObject *enactor, GameObject *target, ActiveItem *tag, Skill
if (target->IDParent() != enactor->IDParent()) {
return false;
}
- if (!lineOfSight(enactor, target, terrainTransparent))
+ if (!lineOfSight(enactor, target, kTerrainTransparent))
return false;
if (isActor(target)) {
@@ -318,7 +318,7 @@ bool implementSpell(GameObject *enactor, ActiveItem *target, SkillProto *spell)
return implementSpell(enactor, l, spell);
}
assert(sProto.shouldTarget(kSpellApplyTAG));
- assert(target->_data.itemType == activeTypeInstance);
+ assert(target->_data.itemType == kActiveTypeInstance);
ActorManaID ami = (ActorManaID)(sProto.getManaType());
diff --git a/engines/saga2/mapfeatr.cpp b/engines/saga2/mapfeatr.cpp
index fbdfb830f69..73e5d68fe3c 100644
--- a/engines/saga2/mapfeatr.cpp
+++ b/engines/saga2/mapfeatr.cpp
@@ -239,7 +239,7 @@ void updateMapFeatures(int16 cWorld) {
uint16 *mapRow;
mapRow = &mapData[(g_vm->_mapFeatures[i]->getU() >> (kTileUVShift + kPlatShift)) * wMap->mapSize];
uint16 mtile = mapRow[(g_vm->_mapFeatures[i]->getV() >> (kTileUVShift + kPlatShift))];
- g_vm->_mapFeatures[i]->expose(mtile & metaTileVisited);
+ g_vm->_mapFeatures[i]->expose(mtile & kMetaTileVisited);
}
}
}
diff --git a/engines/saga2/motion.cpp b/engines/saga2/motion.cpp
index 0b1e4e7cf47..d7f4ed473d1 100644
--- a/engines/saga2/motion.cpp
+++ b/engines/saga2/motion.cpp
@@ -182,7 +182,7 @@ void setObjectSurface(GameObject *obj, StandingTileInfo &sti) {
? sti.surfaceTAG->thisID()
: NoActiveItem;
- if (!(sti.surfaceRef.flags & trTileSensitive))
+ if (!(sti.surfaceRef.flags & kTrTileSensitive))
tagID = NoActiveItem;
if (obj->_data.currentTAG != tagID) {
@@ -1735,7 +1735,7 @@ void MotionTask::castSpell(Actor &a, SkillProto &spell, ActiveItem &target) {
if ((mt = g_vm->_mTaskList->newTask(&a)) != nullptr) {
if (mt->_motionType != type) {
Location loc;
- assert(target._data.itemType == activeTypeInstance);
+ assert(target._data.itemType == kActiveTypeInstance);
mt->_motionType = type;
mt->_spellObj = &spell;
mt->_targetTAG = ⌖
@@ -2747,7 +2747,7 @@ void MotionTask::walkAction() {
if (tHeight >= _object->_data.location.z - kMaxSmoothStep
* ((sti.surfaceTile != nullptr
- && (sti.surfaceTile->combinedTerrainMask() & terrainStair))
+ && (sti.surfaceTile->combinedTerrainMask() & kTerrainStair))
? 4
: 1)
&& tHeight < newPos.z)
@@ -2757,7 +2757,7 @@ void MotionTask::walkAction() {
int16 newAction;
if (sti.surfaceTile != nullptr
- && (sti.surfaceTile->combinedTerrainMask() & terrainStair)
+ && (sti.surfaceTile->combinedTerrainMask() & kTerrainStair)
&& a->isActionAvailable(kActionSpecial7)) {
Direction stairsDir;
uint8 *cornerHeight;
@@ -2874,7 +2874,7 @@ void MotionTask::upLadderAction() {
for (ti = iter.first(&tileLoc, &sti);
ti != nullptr;
ti = iter.next(&tileLoc, &sti)) {
- if (!(ti->combinedTerrainMask() & terrainLadder)) continue;
+ if (!(ti->combinedTerrainMask() & kTerrainLadder)) continue;
if (sti.surfaceHeight
+ ti->attrs.terrainHeight
@@ -2914,7 +2914,7 @@ void MotionTask::upLadderAction() {
footPrintMask &=
vMaxMasks[actorSubTileReg.max.v - subTileLoc.v];
- ladderMask = ti->attrs.fgdTerrain == terrNumLadder
+ ladderMask = ti->attrs.fgdTerrain == kTerrNumLadder
? ti->attrs.terrainMask
: ~ti->attrs.terrainMask;
@@ -2998,7 +2998,7 @@ void MotionTask::downLadderAction() {
for (ti = iter.first(&tileLoc, &sti);
ti != nullptr;
ti = iter.next(&tileLoc, &sti)) {
- if (!(ti->combinedTerrainMask() & terrainLadder)) continue;
+ if (!(ti->combinedTerrainMask() & kTerrainLadder)) continue;
if (sti.surfaceHeight + ti->attrs.terrainHeight <= loc.z
|| sti.surfaceHeight > loc.z)
@@ -3035,7 +3035,7 @@ void MotionTask::downLadderAction() {
footPrintMask &=
vMaxMasks[actorSubTileReg.max.v - subTileLoc.v];
- ladderMask = ti->attrs.fgdTerrain == terrNumLadder
+ ladderMask = ti->attrs.fgdTerrain == kTerrNumLadder
? ti->attrs.terrainMask
: ~ti->attrs.terrainMask;
@@ -3538,7 +3538,7 @@ void MotionTask::castSpellAction() {
if (actionCounter == 0) {
if (_spellObj) {
if (_flags & kMfTAGTarg) {
- assert(_targetTAG->_data.itemType == activeTypeInstance);
+ assert(_targetTAG->_data.itemType == kActiveTypeInstance);
_spellObj->implementAction(_spellObj->getSpellID(), a->thisID(), _targetTAG);
} else if (_flags & kMfLocTarg) {
_spellObj->implementAction(_spellObj->getSpellID(), a->thisID(), _targetLoc);
@@ -4707,7 +4707,7 @@ bool checkLadder(Actor *a, const TilePoint &loc) {
for (ti = iter.first(&tileLoc, &sti);
ti != nullptr;
ti = iter.next(&tileLoc, &sti)) {
- if (!(ti->combinedTerrainMask() & terrainLadder)) continue;
+ if (!(ti->combinedTerrainMask() & kTerrainLadder)) continue;
if (sti.surfaceHeight + ti->attrs.terrainHeight < loc.z
|| sti.surfaceHeight > loc.z + height)
@@ -4744,7 +4744,7 @@ bool checkLadder(Actor *a, const TilePoint &loc) {
footPrintMask &=
vMaxMasks[actorSubTileReg.max.v - subTileLoc.v];
- ladderMask = ti->attrs.fgdTerrain == terrNumLadder
+ ladderMask = ti->attrs.fgdTerrain == kTerrNumLadder
? ti->attrs.terrainMask
: ~ti->attrs.terrainMask;
diff --git a/engines/saga2/objects.cpp b/engines/saga2/objects.cpp
index 1bfb6870905..1dc266190c4 100644
--- a/engines/saga2/objects.cpp
+++ b/engines/saga2/objects.cpp
@@ -1494,7 +1494,7 @@ bool GameObject::isContaining(ObjectTarget *objTarget) {
return false;
}
-const int32 harmfulTerrain = terrainHot | terrainCold | terrainIce | terrainSlash | terrainBash;
+const int32 harmfulTerrain = kTerrainHot | kTerrainCold | kTerrainIce | kTerrainSlash | kTerrainBash;
void GameObject::updateState() {
int16 tHeight;
@@ -1518,13 +1518,13 @@ void GameObject::updateState() {
: 0;
if (isActor(this) && 0 != (subTileTerrain & harmfulTerrain)) {
- if (subTileTerrain & terrainHot)
+ if (subTileTerrain & kTerrainHot)
lavaDamage(this);
- if (subTileTerrain & (terrainCold | terrainIce))
+ if (subTileTerrain & (kTerrainCold | kTerrainIce))
coldDamage(this);
- if (subTileTerrain & terrainSlash)
+ if (subTileTerrain & kTerrainSlash)
terrainDamageSlash(this);
- if (subTileTerrain & terrainBash)
+ if (subTileTerrain & kTerrainBash)
terrainDamageBash(this);
}
// If terrain is HIGHER (or even sligtly lower) than we are
diff --git a/engines/saga2/path.cpp b/engines/saga2/path.cpp
index f7fd6fb3307..879b97c0515 100644
--- a/engines/saga2/path.cpp
+++ b/engines/saga2/path.cpp
@@ -127,7 +127,7 @@ struct PathTileInfo {
PathTileInfo() : surfaceTile(nullptr), surfaceHeight(0) {}
};
-typedef PathTileInfo PathTilePosInfo[maxPlatforms];
+typedef PathTileInfo PathTilePosInfo[kMaxPlatforms];
typedef PathTilePosInfo PathTilePosArray[searchDiameter + 4][searchDiameter + 4];
@@ -205,7 +205,7 @@ void PathTileRegion::init(
PathTilePosInfo *tiPtr = _array;
for (; _arraySize > 0; _arraySize--, tiPtr++) {
PathTilePosInfo &ptpi = *tiPtr;
- for (int i = 0; i < maxPlatforms; i++)
+ for (int i = 0; i < kMaxPlatforms; i++)
ptpi[i].surfaceTile = nullptr;
}
}
@@ -331,7 +331,7 @@ void PathTileRegion::fetchSubMeta(const TilePoint &subMeta) {
offset.u = ((subMeta.u >> 1) << kPlatShift) - _origin.u;
offset.v = ((subMeta.v >> 1) << kPlatShift) - _origin.v;
- for (int i = 0; i < maxPlatforms; i++) {
+ for (int i = 0; i < kMaxPlatforms; i++) {
uint16 tpFlags = 0;
Platform *p;
int u, v;
@@ -341,7 +341,7 @@ void PathTileRegion::fetchSubMeta(const TilePoint &subMeta) {
if ((p = mt->fetchPlatform(_mapNum, i)) == nullptr)
continue;
- if (!(p->flags & plVisible)) continue;
+ if (!(p->flags & kPlVisible)) continue;
for (u = tileReg.min.u; u < tileReg.max.u; u++) {
PathTilePosInfo *arrRow = &_array[(u + offset.u) * _area.v];
@@ -361,7 +361,7 @@ void PathTileRegion::fetchSubMeta(const TilePoint &subMeta) {
tr = &p->tiles[u][v];
height = tr->tileHeight << 3;
- if (tr->flags & trTileTAG) {
+ if (tr->flags & kTrTileTAG) {
ActiveItem *groupItem,
*instanceItem;
int16 state = 0;
@@ -477,7 +477,7 @@ private:
};
// Master array of chunk pointers
- PathArrayChunk *_array[maxPlatforms][regionChunkDiameter][regionChunkDiameter];
+ PathArrayChunk *_array[kMaxPlatforms][regionChunkDiameter][regionChunkDiameter];
public:
// Exception class
@@ -510,7 +510,7 @@ public:
PathArray::PathArray() {
int plat, chunkU, chunkV;
- for (plat = 0; plat < maxPlatforms; plat++) {
+ for (plat = 0; plat < kMaxPlatforms; plat++) {
for (chunkU = 0; chunkU < regionChunkDiameter; chunkU++) {
for (chunkV = 0; chunkV < regionChunkDiameter; chunkV++)
_array[plat][chunkU][chunkV] = nullptr;
@@ -529,7 +529,7 @@ PathArray::~PathArray() {
// be true. If it fails to allocate a new cell it will throw
// a CellAllocationFailure.
PathCell *PathArray::makeCell(int plat, int uCoord, int vCoord, bool *newCell) {
- assert(plat >= 0 && plat < maxPlatforms);
+ assert(plat >= 0 && plat < kMaxPlatforms);
assert(uCoord >= 0 && uCoord < searchDiameter);
assert(vCoord >= 0 && vCoord < searchDiameter);
assert(newCell != nullptr);
@@ -569,7 +569,7 @@ PathCell *PathArray::makeCell(int plat, int uCoord, int vCoord, bool *newCell) {
// Get a pointer to an existing cell. If the specified cell has
// not been created, it will return nullptr.
PathCell *PathArray::getCell(int plat, int uCoord, int vCoord) {
- assert(plat >= 0 && plat < maxPlatforms);
+ assert(plat >= 0 && plat < kMaxPlatforms);
assert(uCoord >= 0 && uCoord < searchDiameter);
assert(vCoord >= 0 && vCoord < searchDiameter);
@@ -597,7 +597,7 @@ PathCell *PathArray::getCell(int plat, int uCoord, int vCoord) {
}
void PathArray::deleteCell(int plat, int uCoord, int vCoord) {
- assert(plat >= 0 && plat < maxPlatforms);
+ assert(plat >= 0 && plat < kMaxPlatforms);
assert(uCoord >= 0 && uCoord < searchDiameter);
assert(vCoord >= 0 && vCoord < searchDiameter);
@@ -626,7 +626,7 @@ void PathArray::deleteCell(int plat, int uCoord, int vCoord) {
void PathArray::reset() {
int plat, chunkU, chunkV;
- for (plat = 0; plat < maxPlatforms; plat++) {
+ for (plat = 0; plat < kMaxPlatforms; plat++) {
for (chunkU = 0; chunkU < regionChunkDiameter; chunkU++) {
for (chunkV = 0; chunkV < regionChunkDiameter; chunkV++) {
PathArrayChunk **chunkPtrPtr;
@@ -894,7 +894,7 @@ uint32 tileTerrain(
int16 maxZ) {
uint32 terrain = 0;
- for (int i = 0; i < maxPlatforms; i++) {
+ for (int i = 0; i < kMaxPlatforms; i++) {
int32 height, tileMinZ, tileMaxZ;
TileInfo *ti;
@@ -906,9 +906,9 @@ uint32 tileTerrain(
tileMinZ = tileMaxZ = height;
int32 combinedMask = ti->combinedTerrainMask();
- if (combinedMask & terrainRaised)
+ if (combinedMask & kTerrainRaised)
tileMaxZ += attrs.terrainHeight;
- if (combinedMask & terrainWater)
+ if (combinedMask & kTerrainWater)
tileMinZ -= attrs.terrainHeight;
if (tileMinZ < maxZ
@@ -920,10 +920,10 @@ uint32 tileTerrain(
// If only checking the top of raised terrain treat it
// as if it were normal terrain.
if (minZ + kMaxStepHeight >= tileMaxZ) {
- if (tileFgdTerrain & terrainSupportingRaised)
- tileFgdTerrain = terrainNormal;
- if (tileBgdTerrain & terrainSupportingRaised)
- tileBgdTerrain = terrainNormal;
+ if (tileFgdTerrain & kTerrainSupportingRaised)
+ tileFgdTerrain = kTerrainNormal;
+ if (tileBgdTerrain & kTerrainSupportingRaised)
+ tileBgdTerrain = kTerrainNormal;
}
if (mask & attrs.terrainMask)
@@ -935,9 +935,9 @@ uint32 tileTerrain(
// This prevents actors from walking through
// catwalks and other surfaces which have no bottom.
- if ((terrainResult & terrainSolidSurface)
+ if ((terrainResult & kTerrainSolidSurface)
&& height > minZ + kMaxStepHeight) {
- terrainResult |= terrainStone;
+ terrainResult |= kTerrainStone;
}
terrain |= terrainResult;
@@ -948,7 +948,7 @@ uint32 tileTerrain(
}
-const uint32 terrainSink = terrainInsubstantial | terrainSupportingRaised | terrainWater;
+const uint32 terrainSink = kTerrainInsubstantial | kTerrainSupportingRaised | kTerrainWater;
int16 tileSlopeHeight(
PathTileRegion &tileArr,
@@ -984,7 +984,7 @@ int16 tileSlopeHeight(
// Search each platform until we find a tile which is under
// the character.
- for (int i = 0; i < maxPlatforms; i++) {
+ for (int i = 0; i < kMaxPlatforms; i++) {
PathTileInfo *pti = ((PathTileInfo *)(&tilePosInfo)) + i; // &tilePosInfo[i];
TileInfo *ti = pti->surfaceTile;
@@ -996,9 +996,9 @@ int16 tileSlopeHeight(
attrs.testTerrain(calcSubTileMask(subTile.u,
subTile.v));
if (subTileTerrain & terrainSink) {
- if (subTileTerrain & terrainInsubstantial)
+ if (subTileTerrain & kTerrainInsubstantial)
continue;
- else if (subTileTerrain & terrainSupportingRaised)
+ else if (subTileTerrain & kTerrainSupportingRaised)
// calculate height of raised surface
supportHeight = height +
attrs.terrainHeight;
@@ -1019,14 +1019,14 @@ int16 tileSlopeHeight(
// See if the tile is a potential supporting surface
if (tileBase < pt.z + objProtHt
&& supportHeight >= highestSupportHeight
- && (ti->combinedTerrainMask() & (terrainSurface | terrainRaised))) {
+ && (ti->combinedTerrainMask() & (kTerrainSurface | kTerrainRaised))) {
highestTileFlag = true;
highestTile = *pti;
highestSupportHeight = supportHeight;
highestSupportPlatform = i;
} else if (!highestTileFlag &&
supportHeight <= lowestSupportHeight &&
- (ti->combinedTerrainMask() & (terrainSurface | terrainRaised))) {
+ (ti->combinedTerrainMask() & (kTerrainSurface | kTerrainRaised))) {
lowestTileFlag = true;
lowestTile = *pti;
lowestSupportHeight = supportHeight;
@@ -1635,7 +1635,7 @@ void PathRequest::finish() {
assert(_bestLoc.u >= 0 && _bestLoc.u < searchDiameter);
assert(_bestLoc.v >= 0 && _bestLoc.v < searchDiameter);
_bestPlatform -= cell->platformDelta;
- assert(_bestPlatform < maxPlatforms);
+ assert(_bestPlatform < kMaxPlatforms);
} else
break;
}
@@ -1893,16 +1893,16 @@ PathResult PathRequest::findPath() {
}
}
- if (terrain & (terrainImpassable | terrainRaised)) continue;
+ if (terrain & (kTerrainImpassable | kTerrainRaised)) continue;
// determine the height of the center of the tile
// that we're testing.
// Assign costs based on the direction of travel
- if (terrain & terrainSlow) {
+ if (terrain & kTerrainSlow) {
cost = dir & 1 ? straightHardCost : diagHardCost;
- } else if (terrain & terrainAverage) {
+ } else if (terrain & kTerrainAverage) {
cost = dir & 1 ? straightNormalCost : diagNormalCost;
} else {
cost = dir & 1 ? straightEasyCost : diagEasyCost;
@@ -1911,7 +1911,7 @@ PathResult PathRequest::findPath() {
// We must treat stairs as a special case
if (pti.surfaceTile != nullptr
- && (pti.surfaceTile->combinedTerrainMask() & terrainStair)) {
+ && (pti.surfaceTile->combinedTerrainMask() & kTerrainStair)) {
uint8 *cornerHeight = pti.surfaceTile->attrs.cornerHeight;
uint8 stairDir;
int16 stairHeight;
@@ -2606,7 +2606,7 @@ TilePoint selectNearbySite(
_centerPt.z + 68);
// Reject if we can't move
- if (terrain & (terrainImpassable | terrainRaised)) {
+ if (terrain & (kTerrainImpassable | kTerrainRaised)) {
// But only if this is isn't the center point
if (distFromCenter > 0) continue;
}
@@ -2646,7 +2646,7 @@ TilePoint selectNearbySite(
testPt.z + 68);
// Reject if terrain allows no entry
- if (terrain & (terrainImpassable | terrainRaised)) continue;
+ if (terrain & (kTerrainImpassable | kTerrainRaised)) continue;
#if VISUAL6
TPLine(_centerPt, testPt);
@@ -2844,7 +2844,7 @@ bool checkPath(
_centerPt.z + height);
// Reject if we can't move
- if (terrain & (terrainImpassable | terrainRaised)) continue;
+ if (terrain & (kTerrainImpassable | kTerrainRaised)) continue;
// Get the height of the terrain at the new point
testPt.z = tileSlopeHeight(testPt, _mapNum, height, &sti);
@@ -2878,7 +2878,7 @@ bool checkPath(
testPt.z + height);
// Reject if terrain allows no entry
- if (terrain & (terrainImpassable | terrainRaised)) continue;
+ if (terrain & (kTerrainImpassable | kTerrainRaised)) continue;
#if VISUAL7
TPLine(_centerPt, testPt);
diff --git a/engines/saga2/property.cpp b/engines/saga2/property.cpp
index f3e345e31a3..89c8107b629 100644
--- a/engines/saga2/property.cpp
+++ b/engines/saga2/property.cpp
@@ -103,7 +103,7 @@ bool actorIsEnemy(Actor *a) {
// Determine if this tile has water
bool tileHasWater(TileInfo *ti) {
- return (ti->combinedTerrainMask() & terrainWater) ? true : false;
+ return (ti->combinedTerrainMask() & kTerrainWater) ? true : false;
}
/* ===================================================================== *
@@ -193,7 +193,7 @@ bool metaTileHasWater(
tCoords;
tCoords.z = 0;
- for (int i = 0; i < maxPlatforms; i++) {
+ for (int i = 0; i < kMaxPlatforms; i++) {
Platform *p = mt->fetchPlatform(mapNum, i);
if (p) {
@@ -209,7 +209,7 @@ bool metaTileHasWater(
origin,
height,
trFlags);
- if (ti->combinedTerrainMask() & terrainWater)
+ if (ti->combinedTerrainMask() & kTerrainWater)
return true;
}
}
diff --git a/engines/saga2/sensor.cpp b/engines/saga2/sensor.cpp
index 4301680e9a2..0938ece3840 100644
--- a/engines/saga2/sensor.cpp
+++ b/engines/saga2/sensor.cpp
@@ -451,7 +451,7 @@ bool ProtaganistSensor::check(SenseInfo &info, uint32 senseFlags) {
// not in sight or not under the same roof
if (objIsActor
&& (!underSameRoof(getObject(), protag)
- || !lineOfSight(getObject(), protag, terrainTransparent)))
+ || !lineOfSight(getObject(), protag, kTerrainTransparent)))
continue;
info.sensedObject = protag;
@@ -515,7 +515,7 @@ bool ObjectSensor::check(SenseInfo &info, uint32 senseFlags) {
// not in sight or not under the same roof
if (objIsActor
&& (!underSameRoof(getObject(), objToTest)
- || !lineOfSight(getObject(), objToTest, terrainTransparent)))
+ || !lineOfSight(getObject(), objToTest, kTerrainTransparent)))
continue;
info.sensedObject = objToTest;
@@ -592,7 +592,7 @@ bool SpecificObjectSensor::check(SenseInfo &info, uint32 senseFlags) {
if (objIsActor
&& (!underSameRoof(getObject(), soughtObject)
- || !lineOfSight(getObject(), soughtObject, terrainTransparent)))
+ || !lineOfSight(getObject(), soughtObject, kTerrainTransparent)))
return false;
info.sensedObject = soughtObject;
@@ -719,7 +719,7 @@ bool SpecificActorSensor::check(SenseInfo &info, uint32 senseFlags) {
if (objIsActor
&& (!underSameRoof(getObject(), _soughtActor)
- || !lineOfSight(getObject(), _soughtActor, terrainTransparent)))
+ || !lineOfSight(getObject(), _soughtActor, kTerrainTransparent)))
return false;
info.sensedObject = _soughtActor;
@@ -832,7 +832,7 @@ bool EventSensor::evaluateEvent(const GameEvent &event) {
&& lineOfSight(
getObject(),
event.directObject,
- terrainTransparent)));
+ kTerrainTransparent)));
}
} // end of namespace Saga2
diff --git a/engines/saga2/spelcast.cpp b/engines/saga2/spelcast.cpp
index 8e6d8fdd5f4..4d289620e52 100644
--- a/engines/saga2/spelcast.cpp
+++ b/engines/saga2/spelcast.cpp
@@ -885,12 +885,12 @@ blockageType checkNontact(
obj->hgtCall());
// Check for intersection with a wall or obstacle
- if (terrain & terrainRaised)
+ if (terrain & kTerrainRaised)
return kBlockageTerrain;
// Check for intersection with slope of the terrain.
- if (((terrain & terrainSurface)
- || (!(terrain & terrainWater) && loc.z <= 0))
+ if (((terrain & kTerrainSurface)
+ || (!(terrain & kTerrainWater) && loc.z <= 0))
&& loc.z < tileNopeHeight(loc, obj))
return kBlockageTerrain;
@@ -943,13 +943,13 @@ int16 tileNopeHeight(
// Search each platform until we find a tile which is under
// the character.
- for (int i = 0; i < maxPlatforms; i++) {
+ for (int i = 0; i < kMaxPlatforms; i++) {
Platform *p;
if ((p = metaPtr->fetchPlatform(mapNum, i)) == nullptr)
continue;
- if (p->flags & plVisible) {
+ if (p->flags & kPlVisible) {
TileInfo *ti;
StandingTileInfo sti;
@@ -964,13 +964,13 @@ int16 tileNopeHeight(
int32 subTileTerrain =
ti->attrs.testTerrain(calcSubTileMask(subTile.u,
subTile.v));
- if (subTileTerrain & terrainInsubstantial)
+ if (subTileTerrain & kTerrainInsubstantial)
continue;
- else if (subTileTerrain & terrainRaised)
+ else if (subTileTerrain & kTerrainRaised)
// calculate height of raised surface
supportHeight = sti.surfaceHeight +
ti->attrs.terrainHeight;
- else if (subTileTerrain & terrainWater)
+ else if (subTileTerrain & kTerrainWater)
// calculate depth of water
supportHeight = sti.surfaceHeight -
ti->attrs.terrainHeight;
@@ -986,13 +986,13 @@ int16 tileNopeHeight(
if (supportHeight <= pt.z + obj->hgtCall()
&& supportHeight >= highestSupportHeight
&& (ti->combinedTerrainMask() &
- (terrainSurface | terrainRaised))) {
+ (kTerrainSurface | kTerrainRaised))) {
highestTile = sti;
highestSupportHeight = supportHeight;
} else if (highestTile.surfaceTile == nullptr &&
supportHeight <= lowestSupportHeight &&
(ti->combinedTerrainMask() &
- (terrainSurface | terrainRaised))) {
+ (kTerrainSurface | kTerrainRaised))) {
lowestTile = sti;
lowestSupportHeight = supportHeight;
}
diff --git a/engines/saga2/speldefs.h b/engines/saga2/speldefs.h
index 0242d1bb9db..e1990faae76 100644
--- a/engines/saga2/speldefs.h
+++ b/engines/saga2/speldefs.h
@@ -114,7 +114,7 @@ typedef GameObject SpellCaster;
inline TilePoint TAGPos(ActiveItem *ai) {
if (ai == NULL) return Nowhere;
- assert(ai->_data.itemType == activeTypeInstance);
+ assert(ai->_data.itemType == kActiveTypeInstance);
return TilePoint(
ai->_data.instance.u << kTileUVShift,
ai->_data.instance.v << kTileUVShift,
diff --git a/engines/saga2/terrain.cpp b/engines/saga2/terrain.cpp
index 9a14b1bb564..52e4f9ad458 100644
--- a/engines/saga2/terrain.cpp
+++ b/engines/saga2/terrain.cpp
@@ -134,13 +134,13 @@ uint32 tileTerrain(
if (metaPtr == nullptr) return 0L;
- for (int i = 0; i < maxPlatforms; i++) {
+ for (int i = 0; i < kMaxPlatforms; i++) {
Platform *p;
if ((p = metaPtr->fetchPlatform(mapNum, i)) == nullptr)
continue;
- if (p->flags & plVisible) {
+ if (p->flags & kPlVisible) {
int16 height;
TileInfo *ti;
int16 trFlags;
@@ -157,9 +157,9 @@ uint32 tileTerrain(
tileMaxZ = height;
int32 combinedMask = ti->combinedTerrainMask();
- if (combinedMask & terrainRaised)
+ if (combinedMask & kTerrainRaised)
tileMaxZ += ti->attrs.terrainHeight;
- if (combinedMask & terrainWater)
+ if (combinedMask & kTerrainWater)
tileMinZ -= ti->attrs.terrainHeight;
if (tileMinZ < maxZ
@@ -171,16 +171,16 @@ uint32 tileTerrain(
// If only checking the top of raised terrain treat it
// as if it were normal terrain.
if (minZ >= tileMaxZ) {
- if (tileFgdTerrain & terrainSupportingRaised)
- tileFgdTerrain = terrainNormal;
- if (tileBgdTerrain & terrainSupportingRaised)
- tileBgdTerrain = terrainNormal;
+ if (tileFgdTerrain & kTerrainSupportingRaised)
+ tileFgdTerrain = kTerrainNormal;
+ if (tileBgdTerrain & kTerrainSupportingRaised)
+ tileBgdTerrain = kTerrainNormal;
}
// If this tile is sensitive to being walked on,
// set the "sensitive" flag.
- if (trFlags & trTileSensitive)
- terrainResult |= terrainActive;
+ if (trFlags & kTrTileSensitive)
+ terrainResult |= kTerrainActive;
if (mask & ti->attrs.terrainMask)
terrainResult |= tileFgdTerrain;
@@ -191,9 +191,9 @@ uint32 tileTerrain(
// This prevents actors from walking through
// catwalks and other surfaces which have no bottom.
- if ((terrainResult & terrainSolidSurface)
+ if ((terrainResult & kTerrainSolidSurface)
&& height > minZ + kMaxStepHeight) {
- terrainResult |= terrainStone;
+ terrainResult |= kTerrainStone;
}
terrain |= terrainResult;
@@ -618,13 +618,13 @@ int16 tileSlopeHeight(
// Search each platform until we find a tile which is under
// the character.
- for (i = 0; i < maxPlatforms; i++) {
+ for (i = 0; i < kMaxPlatforms; i++) {
Platform *p;
if ((p = metaPtr->fetchPlatform(mapNum, i)) == nullptr)
continue;
- if (p->flags & plVisible) {
+ if (p->flags & kPlVisible) {
TileInfo *ti;
StandingTileInfo sti;
@@ -640,13 +640,13 @@ int16 tileSlopeHeight(
int32 subTileTerrain =
ti->attrs.testTerrain(calcSubTileMask(subTile.u,
subTile.v));
- if (subTileTerrain & terrainInsubstantial)
+ if (subTileTerrain & kTerrainInsubstantial)
continue;
- else if (subTileTerrain & terrainSupportingRaised)
+ else if (subTileTerrain & kTerrainSupportingRaised)
// calculate height of raised surface
supportHeight = sti.surfaceHeight +
ti->attrs.terrainHeight;
- else if (subTileTerrain & terrainWater) {
+ else if (subTileTerrain & kTerrainWater) {
// calculate depth of water
supportHeight = sti.surfaceHeight -
ti->attrs.terrainHeight;
@@ -663,14 +663,14 @@ int16 tileSlopeHeight(
if (tileBase < pt.z + objectHeight
&& supportHeight >= highestSupportHeight
&& (ti->combinedTerrainMask() &
- (terrainSurface | terrainRaised))) {
+ (kTerrainSurface | kTerrainRaised))) {
highestTile = sti;
highestSupportHeight = supportHeight;
highestSupportPlatform = i;
} else if (highestTile.surfaceTile == nullptr &&
supportHeight <= lowestSupportHeight &&
(ti->combinedTerrainMask() &
- (terrainSurface | terrainRaised))) {
+ (kTerrainSurface | kTerrainRaised))) {
lowestTile = sti;
lowestSupportHeight = supportHeight;
lowestSupportPlatform = i;
@@ -754,7 +754,7 @@ uint32 objectTerrain(GameObject *obj, StandingTileInfo &sti) {
// If one of the tiles we're standing on is active,
// double check to see if we're really standing on it.
- if (terrain & terrainActive) {
+ if (terrain & kTerrainActive) {
int16 tHeight;
// Determine the height of the landscape we're on
@@ -766,10 +766,10 @@ uint32 objectTerrain(GameObject *obj, StandingTileInfo &sti) {
if (sti.surfaceTile == nullptr
|| sti.surfaceTAG == nullptr
- || !(sti.surfaceRef.flags & trTileSensitive)
+ || !(sti.surfaceRef.flags & kTrTileSensitive)
|| loc.z >= tHeight + 2
/* || loc.z >= standingTile->attrs.terrainHeight */) {
- terrain &= ~terrainActive;
+ terrain &= ~kTerrainActive;
}
}
@@ -803,7 +803,7 @@ int16 checkBlocked(
height);
// Check for intersection with a wall or obstacle
- if (terrain & terrainRaised) return kBlockageTerrain;
+ if (terrain & kTerrainRaised) return kBlockageTerrain;
}
// See if object collided with an object
@@ -853,7 +853,7 @@ int16 checkWalkable(
mask = 1 << ((subTileU << kSubTileShift) + subTileV);
// If the suporting subtile is funiture consider this blocked
- if (sti.surfaceTile->attrs.testTerrain(mask) & terrainFurniture)
+ if (sti.surfaceTile->attrs.testTerrain(mask) & kTerrainFurniture)
return kBlockageTerrain;
}
@@ -879,12 +879,12 @@ int16 checkContact(
proto->height);
// Check for intersection with a wall or obstacle
- if (terrain & terrainRaised) return kBlockageTerrain;
+ if (terrain & kTerrainRaised) return kBlockageTerrain;
// Check for intersection with slope of the terrain.
- if (((terrain & terrainSurface)
+ if (((terrain & kTerrainSurface)
&& loc.z <= tileSlopeHeight(loc, obj))
- || (!(terrain & terrainWater)
+ || (!(terrain & kTerrainWater)
&& loc.z <= 0))
return kBlockageTerrain;
diff --git a/engines/saga2/tile.cpp b/engines/saga2/tile.cpp
index 6765c8dff82..a18e7e055dc 100644
--- a/engines/saga2/tile.cpp
+++ b/engines/saga2/tile.cpp
@@ -457,11 +457,11 @@ bool ActiveItem::use(ActiveItem *ins, ObjectID enactor) {
switch (ins->builtInBehavior()) {
- case builtInLamp:
+ case kBuiltInLamp:
ins->setInstanceState(_mapNum, !state);
break;
- case builtInDoor:
+ case kBuiltInDoor:
if (state < 3) {
if (!ins->isLocked()) {
TileActivityTask::openDoor(*ins);
@@ -495,7 +495,7 @@ bool ActiveItem::trigger(ActiveItem *ins, ObjectID enactor, ObjectID objID) {
scriptCallFrame scf;
// Trap transporters to only react to the center actor
- if (ins->builtInBehavior() == builtInTransporter
+ if (ins->builtInBehavior() == kBuiltInTransporter
&& (!isActor(obj) || (Actor *)obj != getCenterActor()))
return true;
@@ -569,7 +569,7 @@ bool ActiveItem::trigger(ActiveItem *ins, ObjectID enactor, ObjectID objID) {
switch (ins->builtInBehavior()) {
- case builtInTransporter:
+ case kBuiltInTransporter:
//playTAGNoise(BEAM_ME_UP);
{
Actor *a;
@@ -685,7 +685,7 @@ bool ActiveItem::acceptLockToggle(ActiveItem *ins, ObjectID enactor, uint8 keyCo
switch (ins->builtInBehavior()) {
- case builtInDoor:
+ case kBuiltInDoor:
if (keyCode == ins->lockType()) {
playTAGNoise(ins, UNLOCK_RIGHT_KEY);
if (ins->isLocked())
@@ -709,7 +709,7 @@ bool ActiveItem::acceptLockToggle(ActiveItem *ins, ObjectID enactor, uint8 keyCo
//-----------------------------------------------------------------------
TilePoint getClosestPointOnTAI(ActiveItem *TAI, GameObject *obj) {
- assert(TAI->_data.itemType == activeTypeInstance);
+ assert(TAI->_data.itemType == kActiveTypeInstance);
TilePoint objLoc = obj->getLocation(),
TAILoc;
@@ -784,7 +784,7 @@ void saveActiveItemStates(Common::OutSaveFile *outS) {
ActiveItem *activeItem = activeItemList->_items[j];
uint8 *statePtr;
- if (activeItem->_data.itemType != activeTypeInstance)
+ if (activeItem->_data.itemType != kActiveTypeInstance)
continue;
// Get a pointer to the current active item's state
@@ -838,7 +838,7 @@ void loadActiveItemStates(Common::InSaveFile *in) {
ActiveItem *activeItem = activeItemList->_items[j];
uint8 *statePtr;
- if (activeItem->_data.itemType != activeTypeInstance)
+ if (activeItem->_data.itemType != kActiveTypeInstance)
continue;
// Get a pointer to the current active item's state
@@ -974,7 +974,7 @@ TileActivityTask *TileActivityTaskList::newTask(ActiveItem *activeInstance) {
tat = new TileActivityTask;
tat->_tai = activeInstance;
- tat->_activityType = TileActivityTask::activityTypeNone;
+ tat->_activityType = TileActivityTask::kActivityTypeNone;
tat->_script = NoThread;
tat->_targetState = 0;
@@ -1013,7 +1013,7 @@ void TileActivityTask::openDoor(ActiveItem &activeInstance) {
TileActivityTask *tat;
if ((tat = g_vm->_aTaskList->newTask(&activeInstance)) != nullptr)
- tat->_activityType = activityTypeOpen;
+ tat->_activityType = kActivityTypeOpen;
}
//-----------------------------------------------------------------------
@@ -1024,7 +1024,7 @@ void TileActivityTask::closeDoor(ActiveItem &activeInstance) {
TileActivityTask *tat;
if ((tat = g_vm->_aTaskList->newTask(&activeInstance)) != nullptr)
- tat->_activityType = activityTypeClose;
+ tat->_activityType = kActivityTypeClose;
}
//-----------------------------------------------------------------------
@@ -1038,7 +1038,7 @@ void TileActivityTask::doScript(ActiveItem &activeInstance, uint8 finalState, Th
if (scr)
debugC(3, kDebugTasks, "TAT Assign Script!");
- tat->_activityType = activityTypeScript;
+ tat->_activityType = kActivityTypeScript;
tat->_targetState = finalState;
tat->_script = scr;
} else {
@@ -1069,21 +1069,21 @@ void TileActivityTask::updateActiveItems() {
switch (tat->_activityType) {
- case activityTypeOpen:
+ case kActivityTypeOpen:
if (state < 3)
activityInstance->setInstanceState(_mapNum, state + 1);
else
activityTaskDone = true;
break;
- case activityTypeClose:
+ case kActivityTypeClose:
if (state > 0)
activityInstance->setInstanceState(_mapNum, state - 1);
else
activityTaskDone = true;
break;
- case activityTypeScript:
+ case kActivityTypeScript:
if (state > tat->_targetState)
activityInstance->setInstanceState(_mapNum, state - 1);
else if (state < tat->_targetState)
@@ -1245,7 +1245,7 @@ MetaTile::MetaTile(MetaTileList *parent, int ind, Common::SeekableReadStream *st
_banksNeeded._b[0] = stream->readUint32LE();
_banksNeeded._b[1] = stream->readUint32LE();
- for (int i = 0; i < maxPlatforms; ++i)
+ for (int i = 0; i < kMaxPlatforms; ++i)
_stack[i] = stream->readUint16LE();
_properties = stream->readUint32LE();
@@ -1542,7 +1542,7 @@ void initAutoMap() {
// Clear the high bit for each map position
for (mapIndex = 0; mapIndex < mapSize; mapIndex++)
- mapData[mapIndex] &= ~metaTileVisited;
+ mapData[mapIndex] &= ~kMetaTileVisited;
}
}
@@ -1590,7 +1590,7 @@ void saveAutoMap(Common::OutSaveFile *outS) {
mapData = map->mapData;
for (mapIndex = 0; mapIndex < mapSize; mapIndex++) {
- if (mapData[mapIndex] & metaTileVisited) {
+ if (mapData[mapIndex] & kMetaTileVisited) {
// Set the bit in the archive buffer
archiveBuffer[totalMapIndex >> 3] |=
(1 << (totalMapIndex & 7));
@@ -1643,9 +1643,9 @@ void loadAutoMap(Common::InSaveFile *in, int32 chunkSize) {
// bit in the map data
if (archiveBuffer[totalMapIndex >> 3]
& (1 << (totalMapIndex & 7)))
- mapData[mapIndex] |= metaTileVisited;
+ mapData[mapIndex] |= kMetaTileVisited;
else
- mapData[mapIndex] &= ~metaTileVisited;
+ mapData[mapIndex] &= ~kMetaTileVisited;
totalMapIndex++;
}
@@ -1776,7 +1776,7 @@ TileInfo *Platform::fetchTile(
int16 h = tr->tileHeight * 8;
- if (tr->flags & trTileTAG) {
+ if (tr->flags & kTrTileTAG) {
ActiveItem *groupItem,
*instanceItem;
int16 state = 0;
@@ -1857,7 +1857,7 @@ TileInfo *Platform::fetchTAGInstance(
int16 h = tr->tileHeight * 8;
- if (tr->flags & trTileTAG) {
+ if (tr->flags & kTrTileTAG) {
ActiveItem *groupItem,
*instanceItem;
int16 state = 0;
@@ -1933,7 +1933,7 @@ TileInfo *Platform::fetchTile(
int16 h = tr->tileHeight * 8;
- if (tr->flags & trTileTAG) {
+ if (tr->flags & kTrTileTAG) {
ActiveItem *groupItem,
*instanceItem;
int16 state = 0;
@@ -2015,7 +2015,7 @@ TileInfo *Platform::fetchTAGInstance(
int16 h = tr->tileHeight * 8;
- if (tr->flags & trTileTAG) {
+ if (tr->flags & kTrTileTAG) {
ActiveItem *groupItem,
*instanceItem;
int16 state = 0;
@@ -2170,7 +2170,7 @@ Platform *MetaTile::fetchPlatform(int16 _mapNum, int16 layer) {
if (pce->metaID != NoMetaTile) {
MetaTile *oldMeta = metaTileAddress(pce->metaID);
- assert(pce->layerNum < maxPlatforms);
+ assert(pce->layerNum < kMaxPlatforms);
assert(oldMeta->_stack[pce->layerNum] == (cacheFlag | cacheIndex));
oldMeta->_stack[pce->layerNum] = pce->platformNum;
}
@@ -2242,22 +2242,22 @@ MetaTilePtr WorldMapData::lookupMeta(TilePoint coords) {
if (coords != clipCoords) {
switch (mapEdgeType) {
- case edgeTypeBlack: // continue;
- case edgeTypeFill0:
+ case kEdgeTypeBlack: // continue;
+ case kEdgeTypeFill0:
mtile = 0;
break;
- case edgeTypeFill1:
+ case kEdgeTypeFill1:
mtile = 1;
break;
- case edgeTypeRepeat:
+ case kEdgeTypeRepeat:
coords.u = clamp(0, coords.u, mapSizeMask);
coords.v = clamp(0, coords.v, mapSizeMask);
mtile = mapData[clipCoords.u * mapSize + clipCoords.v];
break;
- case edgeTypeWrap:
+ case kEdgeTypeWrap:
mtile = mapData[clipCoords.u * mapSize + clipCoords.v];
break;
}
@@ -2276,7 +2276,7 @@ MetaTilePtr WorldMapData::lookupMeta(TilePoint coords) {
} else {
// When getting the metatile number, make sure to mask off the
// bit indicating that this map square has been visited.
- mtile = mapData[coords.u * mapSize + coords.v] & ~metaTileVisited;
+ mtile = mapData[coords.u * mapSize + coords.v] & ~kMetaTileVisited;
}
#endif
@@ -2300,7 +2300,7 @@ void WorldMapData::buildInstanceHash() {
for (i = 0, ail = activeItemList->_items; i < activeCount; i++, ail++) {
ActiveItem *ai = *ail;
- if (ai->_data.itemType == activeTypeInstance) {
+ if (ai->_data.itemType == kActiveTypeInstance) {
hashVal = (((ai->_data.instance.u + ai->_data.instance.h) << 4)
+ ai->_data.instance.v + (ai->_data.instance.groupID << 2))
% ARRAYSIZE(instHash);
@@ -2383,7 +2383,7 @@ bool TileIterator::iterate() {
if (++_tCoords.u >= _tCoordsReg.max.u) {
do {
_platIndex++;
- if (_platIndex >= maxPlatforms) {
+ if (_platIndex >= kMaxPlatforms) {
if ((_mt = _metaIter.next(&_origin)) != nullptr) {
_tCoordsReg.min.u = _tCoordsReg.min.v = 0;
_tCoordsReg.max.u = _tCoordsReg.max.v = kPlatformWidth;
@@ -2426,7 +2426,7 @@ TileInfo *TileIterator::first(TilePoint *loc, StandingTileInfo *stiResult) {
_platform = _mt->fetchPlatform(_metaIter.getMapNum(), _platIndex = 0);
while (_platform == nullptr) {
_platIndex++;
- if (_platIndex >= maxPlatforms) {
+ if (_platIndex >= kMaxPlatforms) {
if ((_mt = _metaIter.next(&_origin)) == nullptr) return nullptr;
_platIndex = 0;
}
@@ -2497,7 +2497,7 @@ inline void drawMetaRow(gPixelMap &drawMap, TilePoint coords, Point16 pos) {
int16 uOrg = coords.u * kPlatformWidth,
vOrg = coords.v * kPlatformWidth;
- Platform *drawList[maxPlatforms + 1],
+ Platform *drawList[kMaxPlatforms + 1],
**put = drawList;
int16 mapSizeMask = curMap->mapSize - 1,
@@ -2526,26 +2526,26 @@ inline void drawMetaRow(gPixelMap &drawMap, TilePoint coords, Point16 pos) {
if (coords != clipCoords) {
switch (mapEdgeType) {
- case edgeTypeBlack: // continue;
- case edgeTypeFill0:
+ case kEdgeTypeBlack: // continue;
+ case kEdgeTypeFill0:
mtile = 0;
break;
- case edgeTypeFill1:
+ case kEdgeTypeFill1:
mtile = 1;
break;
- case edgeTypeRepeat:
+ case kEdgeTypeRepeat:
coords.u = CLIP(coords.u, (int16)0, mapSizeMask);
coords.v = CLIP(coords.v, (int16)0, mapSizeMask);
- mtile = mapData[clipCoords.u * curMap->mapSize + clipCoords.v] & ~metaTileVisited;
+ mtile = mapData[clipCoords.u * curMap->mapSize + clipCoords.v] & ~kMetaTileVisited;
break;
- case edgeTypeWrap:
- mtile = mapData[clipCoords.u * curMap->mapSize + clipCoords.v] & ~metaTileVisited;
+ case kEdgeTypeWrap:
+ mtile = mapData[clipCoords.u * curMap->mapSize + clipCoords.v] & ~kMetaTileVisited;
break;
}
- } else mtile = mapData[clipCoords.u * curMap->mapSize + clipCoords.v] & ~metaTileVisited;
+ } else mtile = mapData[clipCoords.u * curMap->mapSize + clipCoords.v] & ~kMetaTileVisited;
if (mtile >= curMap->metaCount) mtile = curMap->metaCount - 1;
@@ -2557,7 +2557,7 @@ inline void drawMetaRow(gPixelMap &drawMap, TilePoint coords, Point16 pos) {
// REM: Reject whole metatiles based on coords, based on
// max height
- layerLimit = maxPlatforms;
+ layerLimit = kMaxPlatforms;
for (int i = 0; i < layerLimit; i++) {
Platform *p;
@@ -2569,7 +2569,7 @@ inline void drawMetaRow(gPixelMap &drawMap, TilePoint coords, Point16 pos) {
if (p->roofRipID() == rippedRoofID && rippedRoofID > 0) break;
- if (p->flags & plVisible) {
+ if (p->flags & kPlVisible) {
// REM: precompute this later, by scanning the platform
// for individual altitudes
@@ -2619,14 +2619,14 @@ void buildRipTable(
// calculate object ripping altitude
int16 tilesToGo = kPlatformWidth * kPlatformWidth;
- for (uint i = 0; i < maxPlatforms; i++) {
+ for (uint i = 0; i < kMaxPlatforms; i++) {
Platform *p;
if ((p = mt->fetchPlatform(g_vm->_currentMapNum, i)) == nullptr) continue;
if (p->roofRipID() != ripID) continue;
- for (; i < maxPlatforms && tilesToGo > 0; i++) {
+ for (; i < kMaxPlatforms && tilesToGo > 0; i++) {
if ((p = mt->fetchPlatform(g_vm->_currentMapNum, i)) == nullptr)
continue;
@@ -3074,7 +3074,7 @@ void maskMetaRow(
int16 uOrg = coords.u * kPlatformWidth,
vOrg = coords.v * kPlatformWidth;
- Platform *drawList[maxPlatforms + 1],
+ Platform *drawList[kMaxPlatforms + 1],
**put = drawList;
int16 mapSizeMask = curMap->mapSize - 1,
@@ -3105,27 +3105,27 @@ void maskMetaRow(
if (coords != clipCoords) {
switch (mapEdgeType) {
- case edgeTypeBlack: // continue;
- case edgeTypeFill0:
+ case kEdgeTypeBlack: // continue;
+ case kEdgeTypeFill0:
mtile = 0;
break;
- case edgeTypeFill1:
+ case kEdgeTypeFill1:
mtile = 1;
break;
- case edgeTypeRepeat:
+ case kEdgeTypeRepeat:
coords.u = clamp(0, coords.u, mapSizeMask);
coords.v = clamp(0, coords.v, mapSizeMask);
- mtile = mapData[clipCoords.u * curMap->mapSize + clipCoords.v] & ~metaTileVisited;
+ mtile = mapData[clipCoords.u * curMap->mapSize + clipCoords.v] & ~kMetaTileVisited;
break;
- case edgeTypeWrap:
- mtile = mapData[clipCoords.u * curMap->mapSize + clipCoords.v] & ~metaTileVisited;
+ case kEdgeTypeWrap:
+ mtile = mapData[clipCoords.u * curMap->mapSize + clipCoords.v] & ~kMetaTileVisited;
break;
}
} else
- mtile = mapData[clipCoords.u * curMap->mapSize + clipCoords.v] & ~metaTileVisited;
+ mtile = mapData[clipCoords.u * curMap->mapSize + clipCoords.v] & ~kMetaTileVisited;
if (mtile >= curMap->metaCount)
mtile = curMap->metaCount - 1;
@@ -3138,7 +3138,7 @@ void maskMetaRow(
// REM: Reject whole metatiles based on coords, based on
// max height
- layerLimit = maxPlatforms;
+ layerLimit = kMaxPlatforms;
for (int i = 0; i < layerLimit; i++) {
Platform *p;
@@ -3148,7 +3148,7 @@ void maskMetaRow(
if (p->roofRipID() == roofID && roofID > 0) break;
- if (p->flags & plVisible) {
+ if (p->flags & kPlVisible) {
// REM: precompute this later, by scanning the platform
// for individual altitudes
@@ -3310,15 +3310,15 @@ void showAbstractTile(const TilePoint &tp, TileInfo *ti) {
uint8 *chPtr;
uint8 raisedCornerHeight[4] = { 0, 0, 0, 0 };
- if (ti->combinedTerrainMask() & terrainRaised) {
- if ((1L << ti->attrs.bgdTerrain) & terrainRaised) {
+ if (ti->combinedTerrainMask() & kTerrainRaised) {
+ if ((1L << ti->attrs.bgdTerrain) & kTerrainRaised) {
workTp.z += ti->attrs.terrainHeight;
chPtr = raisedCornerHeight;
} else
chPtr = ti->attrs.cornerHeight;
drawSubTiles(workTp, ~ti->attrs.terrainMask, chPtr);
workTp.z = tp.z;
- if ((1L << ti->attrs.fgdTerrain) & terrainRaised) {
+ if ((1L << ti->attrs.fgdTerrain) & kTerrainRaised) {
workTp.z += ti->attrs.terrainHeight;
chPtr = raisedCornerHeight;
} else
@@ -3426,7 +3426,7 @@ SurfaceType pointOnTile(TileInfo *ti,
relPos.x = clamp(-kTileDX + 2, relPos.x, kTileDX - 1);
// If the tile has no raised terrain
- if (!(combinedMask & terrainRaised)) {
+ if (!(combinedMask & kTerrainRaised)) {
// Calculate the position of the first point on tile to check.
if (relPos.x > 0) {
subUVPoint.u = relPos.x >> 1;
@@ -3502,7 +3502,7 @@ SurfaceType pointOnTile(TileInfo *ti,
while (subTileRel.y >= 0
&& subTile.u < 4
&& subTile.v < 4) {
- if (ti->attrs.testTerrain(sMask) & terrainRaised) {
+ if (ti->attrs.testTerrain(sMask) & kTerrainRaised) {
lastRaisedSubTile = subTile;
// mouse is on side of raised section
@@ -3526,7 +3526,7 @@ SurfaceType pointOnTile(TileInfo *ti,
calcSubTileMask(
subTile.u - 1,
subTile.v))
- & terrainRaised))
+ & kTerrainRaised))
subTileToLeft = true;
if (subTile.v > 0
@@ -3534,7 +3534,7 @@ SurfaceType pointOnTile(TileInfo *ti,
calcSubTileMask(
subTile.u,
subTile.v - 1))
- & terrainRaised))
+ & kTerrainRaised))
subTileToRight = true;
if ((subTileToRight && subTileToLeft)
@@ -3699,7 +3699,7 @@ SurfaceType pointOnTile(TileInfo *ti,
else
colMask = 0x8421 >> ((-rightSubTileCol) << 2);
- if (ti->attrs.testTerrain(colMask) & terrainRaised) {
+ if (ti->attrs.testTerrain(colMask) & kTerrainRaised) {
raisedCol = rightSubTileCol;
subTileRel.x = -kSubTileDX + 2;
break;
@@ -3715,7 +3715,7 @@ testLeft:
else
colMask = 0x8421 >> ((-leftSubTileCol) << 2);
- if (ti->attrs.testTerrain(colMask) & terrainRaised) {
+ if (ti->attrs.testTerrain(colMask) & kTerrainRaised) {
raisedCol = leftSubTileCol;
subTileRel.x = kSubTileDX - 1;
break;
@@ -3744,7 +3744,7 @@ testLeft:
// test each subtile in column for first raised
// subtile
- while (subsInCol && !(ti->attrs.testTerrain(colMask) & terrainRaised)) {
+ while (subsInCol && !(ti->attrs.testTerrain(colMask) & kTerrainRaised)) {
subsInCol--;
subTile.u++;
subTile.v++;
@@ -3821,7 +3821,7 @@ bool pointOnHiddenSurface(
int i;
- for (i = 0; i < maxPlatforms; i++) {
+ for (i = 0; i < kMaxPlatforms; i++) {
Platform *p;
int16 h,
trFlags;
@@ -3829,7 +3829,7 @@ bool pointOnHiddenSurface(
if ((p = mt->fetchPlatform(g_vm->_currentMapNum, i)) == nullptr)
continue;
- if (!(p->flags & plVisible) || platformRipped(p)) continue;
+ if (!(p->flags & kPlVisible) || platformRipped(p)) continue;
// Fetch the tile at this location
adjTile = p->fetchTile(
@@ -3848,14 +3848,14 @@ bool pointOnHiddenSurface(
continue;
// If adjacent subtile is not raised, skip this tile
- if (!(adjTile->attrs.testTerrain(adjSubMask) & terrainRaised))
+ if (!(adjTile->attrs.testTerrain(adjSubMask) & kTerrainRaised))
continue;
break;
}
// If all platforms have been checked, the pick point is valid
- if (i >= maxPlatforms) return false;
+ if (i >= kMaxPlatforms) return false;
return true;
}
@@ -3956,7 +3956,7 @@ StaticTilePoint pickTile(Point32 pos,
// If there is a metatile on this spot
if (mt != nullptr) {
// Iterate through all platforms
- for (i = 0; i < maxPlatforms; i++) {
+ for (i = 0; i < kMaxPlatforms; i++) {
Platform *p;
StandingTileInfo sti;
@@ -3964,7 +3964,7 @@ StaticTilePoint pickTile(Point32 pos,
continue;
if (platformRipped(p)) break;
- if (!(p->flags & plVisible)) continue;
+ if (!(p->flags & kPlVisible)) continue;
// Fetch the tile at this location
@@ -4236,7 +4236,7 @@ uint16 objRoofID(GameObject *obj, int16 objMapNum, const TilePoint &objCoords) {
int i,
tilePlatNum = -1;
- for (i = 0; i < maxPlatforms; i++) {
+ for (i = 0; i < kMaxPlatforms; i++) {
Platform *p;
TileInfo *t;
int16 height;
@@ -4245,7 +4245,7 @@ uint16 objRoofID(GameObject *obj, int16 objMapNum, const TilePoint &objCoords) {
if ((p = meta->fetchPlatform(objMapNum, i)) == nullptr)
continue;
- if (!(p->flags & plVisible) || p->roofRipID() <= 0)
+ if (!(p->flags & kPlVisible) || p->roofRipID() <= 0)
continue;
t = p->fetchTile(
@@ -4487,7 +4487,7 @@ void markMetaAsVisited(const TilePoint &pt) {
for (u = minU; u <= maxU; u++) {
for (v = minV; v <= maxV; v++) {
if ((u == minU || u == maxU) && (v == minV || v == maxV)) continue;
- mapData[u * curMap->mapSize + v] |= metaTileVisited;
+ mapData[u * curMap->mapSize + v] |= kMetaTileVisited;
}
}
}
diff --git a/engines/saga2/tile.h b/engines/saga2/tile.h
index 8d37879f2d1..3e4630c4a96 100644
--- a/engines/saga2/tile.h
+++ b/engines/saga2/tile.h
@@ -114,17 +114,17 @@ struct TileAttrs {
enum tile_flags {
// This tile has been used in at least one activity group
- tileInGroup = (1 << 0),
+ kTileInGroup = (1 << 0),
// Indicates that an activity group should be placed in lieu
// of the tile.
- tileAutoGroup = (1 << 1),
+ kTileAutoGroup = (1 << 1),
// Indicates that the tile is sensitive to being walked on
- tileWalkSense = (1 << 2),
+ kTileWalkSense = (1 << 2),
// Indicates that tile has been recently modified
- tileModified = (1 << 3)
+ kTileModified = (1 << 3)
};
/* ===================================================================== *
@@ -132,104 +132,104 @@ enum tile_flags {
* ===================================================================== */
enum terrainTypes {
- terrNumNormal = 0,
- terrNumEasy,
- terrNumRough,
- terrNumStone,
- terrNumWood,
- terrNumHedge,
- terrNumTree,
- terrNumWater,
- terrNumFall,
- terrNumRamp,
- terrNumStair,
- terrNumLadder,
- terrNumObject,
- terrNumActive,
- terrNumSlash,
- terrNumBash,
- terrNumIce,
- terrNumCold,
- terrNumHot,
- terrNumFurniture
+ kTerrNumNormal = 0,
+ kTerrNumEasy,
+ kTerrNumRough,
+ kTerrNumStone,
+ kTerrNumWood,
+ kTerrNumHedge,
+ kTerrNumTree,
+ kTerrNumWater,
+ kTerrNumFall,
+ kTerrNumRamp,
+ kTerrNumStair,
+ kTerrNumLadder,
+ kTerrNumObject,
+ kTerrNumActive,
+ kTerrNumSlash,
+ kTerrNumBash,
+ kTerrNumIce,
+ kTerrNumCold,
+ kTerrNumHot,
+ kTerrNumFurniture
};
enum terrainBits {
- terrainNormal = (1 << terrNumNormal), // clear terrain
- terrainEasy = (1 << terrNumEasy), // easy terrain (path)
- terrainRough = (1 << terrNumRough), // rough terrain (shrub)
- terrainStone = (1 << terrNumStone), // stone obstacle
- terrainWood = (1 << terrNumWood), // wood obstacle
- terrainHedge = (1 << terrNumHedge), // penetrable obstacle
- terrainTree = (1 << terrNumTree), // tree obstacle
- terrainWater = (1 << terrNumWater), // water (depth given by height)
- terrainFall = (1 << terrNumFall), // does not support things
- terrainRamp = (1 << terrNumRamp), // low friction slope
- terrainStair = (1 << terrNumStair), // high friction slope
- terrainLadder = (1 << terrNumLadder), // vertical climb
- terrainObject = (1 << terrNumObject), // collision with other object
- terrainActive = (1 << terrNumActive), // tile is sensitive to walking on
- terrainSlash = (1 << terrNumSlash), // Slide Down Slope Left
- terrainBash = (1 << terrNumBash), // Slide Down Slope Left
- terrainIce = (1 << terrNumIce),
- terrainCold = (1 << terrNumCold),
- terrainHot = (1 << terrNumHot),
- terrainFurniture = (1 << terrNumFurniture)
+ kTerrainNormal = (1 << kTerrNumNormal), // clear terrain
+ kTerrainEasy = (1 << kTerrNumEasy), // easy terrain (path)
+ kTerrainRough = (1 << kTerrNumRough), // rough terrain (shrub)
+ kTerrainStone = (1 << kTerrNumStone), // stone obstacle
+ kTerrainWood = (1 << kTerrNumWood), // wood obstacle
+ kTerrainHedge = (1 << kTerrNumHedge), // penetrable obstacle
+ kTerrainTree = (1 << kTerrNumTree), // tree obstacle
+ kTerrainWater = (1 << kTerrNumWater), // water (depth given by height)
+ kTerrainFall = (1 << kTerrNumFall), // does not support things
+ kTerrainRamp = (1 << kTerrNumRamp), // low friction slope
+ kTerrainStair = (1 << kTerrNumStair), // high friction slope
+ kTerrainLadder = (1 << kTerrNumLadder), // vertical climb
+ kTerrainObject = (1 << kTerrNumObject), // collision with other object
+ kTerrainActive = (1 << kTerrNumActive), // tile is sensitive to walking on
+ kTerrainSlash = (1 << kTerrNumSlash), // Slide Down Slope Left
+ kTerrainBash = (1 << kTerrNumBash), // Slide Down Slope Left
+ kTerrainIce = (1 << kTerrNumIce),
+ kTerrainCold = (1 << kTerrNumCold),
+ kTerrainHot = (1 << kTerrNumHot),
+ kTerrainFurniture = (1 << kTerrNumFurniture)
};
// A combination mask of all the terrain types which can have
// sloped surfaces. (Water is a negative sloped surface)
-const int terrainSurface = terrainNormal
- | terrainEasy
- | terrainRough
- | terrainWater
- | terrainRamp
- | terrainCold
- | terrainStair;
-
-const int terrainSolidSurface
- = terrainNormal
- | terrainEasy
- | terrainRough
- | terrainRamp
- | terrainCold
- | terrainStair;
+const int kTerrainSurface = kTerrainNormal
+ | kTerrainEasy
+ | kTerrainRough
+ | kTerrainWater
+ | kTerrainRamp
+ | kTerrainCold
+ | kTerrainStair;
+
+const int kTerrainSolidSurface
+ = kTerrainNormal
+ | kTerrainEasy
+ | kTerrainRough
+ | kTerrainRamp
+ | kTerrainCold
+ | kTerrainStair;
// A combination mask of all terrain types which can have
// raised surfaces.
-const int terrainRaised = terrainStone
- | terrainWood
- | terrainTree
- | terrainHedge
- | terrainFurniture;
+const int kTerrainRaised = kTerrainStone
+ | kTerrainWood
+ | kTerrainTree
+ | kTerrainHedge
+ | kTerrainFurniture;
-const int terrainSupportingRaised = terrainStone
- | terrainWood
- | terrainFurniture;
+const int kTerrainSupportingRaised = kTerrainStone
+ | kTerrainWood
+ | kTerrainFurniture;
-const int terrainImpassable = terrainStone
- | terrainWood
- | terrainTree
- | terrainHedge
- | terrainFurniture;
+const int kTerrainImpassable = kTerrainStone
+ | kTerrainWood
+ | kTerrainTree
+ | kTerrainHedge
+ | kTerrainFurniture;
-const int terrainSlow = terrainRough
- | terrainWater
- | terrainLadder;
+const int kTerrainSlow = kTerrainRough
+ | kTerrainWater
+ | kTerrainLadder;
-const int terrainAverage = terrainNormal
- | terrainRamp
- | terrainStair;
+const int kTerrainAverage = kTerrainNormal
+ | kTerrainRamp
+ | kTerrainStair;
-const int terrainInsubstantial = terrainFall
- | terrainLadder
- | terrainSlash
- | terrainBash;
+const int kTerrainInsubstantial = kTerrainFall
+ | kTerrainLadder
+ | kTerrainSlash
+ | kTerrainBash;
-const int terrainTransparent = terrainSurface
- | terrainInsubstantial;
+const int kTerrainTransparent = kTerrainSurface
+ | kTerrainInsubstantial;
/* ===================================================================== *
@@ -287,10 +287,10 @@ struct TileRef {
};
enum tileRefFlags {
- trTileTAG = (1 << 0), // this tile part of a TAG
- trTileHidden = (1 << 1), // tile hidden when covered
- trTileFlipped = (1 << 2), // draw tile flipped horizontal
- trTileSensitive = (1 << 3) // tile is triggerable (TAG only)
+ kTrTileTAG = (1 << 0), // this tile part of a TAG
+ kTrTileHidden = (1 << 1), // tile hidden when covered
+ kTrTileFlipped = (1 << 2), // draw tile flipped horizontal
+ kTrTileSensitive = (1 << 3) // tile is triggerable (TAG only)
};
typedef TileRef *TileRefPtr, **TileRefHandle;
@@ -327,7 +327,7 @@ public:
typedef TileCycleData *CyclePtr, // pointer to cycle data
**CycleHandle; // handle to cycle data
-const int maxCycleRanges = 128; // 128 should do for now...
+const int kMaxCycleRanges = 128; // 128 should do for now...
/* ===================================================================== *
ActiveTileItem: This is the base class for all of the behavioral
@@ -335,8 +335,8 @@ const int maxCycleRanges = 128; // 128 should do for now...
* ===================================================================== */
enum ActiveItemTypes {
- activeTypeGroup = 0,
- activeTypeInstance
+ kActiveTypeGroup = 0,
+ kActiveTypeInstance
};
// A pointer to the array of active item state arrays
@@ -393,9 +393,9 @@ public:
ActiveItemData _data;
enum {
- activeItemLocked = (1 << 8), // The door is locked
- activeItemOpen = (1 << 9), // The door is open (not used)
- activeItemExclusive = (1 << 10) // Script semaphore
+ kActiveItemLocked = (1 << 8), // The door is locked
+ kActiveItemOpen = (1 << 9), // The door is open (not used)
+ kActiveItemExclusive = (1 << 10) // Script semaphore
};
ActiveItem(ActiveItemList *parent, int ind, Common::SeekableReadStream *stream);
@@ -414,15 +414,15 @@ public:
// Return a pointer to this TAI's group
ActiveItem *getGroup() {
- assert(_data.itemType == activeTypeInstance);
+ assert(_data.itemType == kActiveTypeInstance);
return activeItemAddress(ActiveItemID(getMapNum(), _data.instance.groupID));
}
enum BuiltInBehaviorType {
- builtInNone = 0, // TAG handled by SAGA
- builtInLamp, // TAG has lamp behavior
- builtInDoor, // TAG has door behavior
- builtInTransporter // TAG has transporter behavior
+ kBuiltInNone = 0, // TAG handled by SAGA
+ kBuiltInLamp, // TAG has lamp behavior
+ kBuiltInDoor, // TAG has door behavior
+ kBuiltInTransporter // TAG has transporter behavior
};
// Return the state number of this active item instance
@@ -441,24 +441,24 @@ public:
// Access to the locked bit
bool isLocked() {
- return (bool)(_data.instance.scriptFlags & activeItemLocked);
+ return (bool)(_data.instance.scriptFlags & kActiveItemLocked);
}
void setLocked(bool val) {
if (val)
- _data.instance.scriptFlags |= activeItemLocked;
+ _data.instance.scriptFlags |= kActiveItemLocked;
else
- _data.instance.scriptFlags &= ~activeItemLocked;
+ _data.instance.scriptFlags &= ~kActiveItemLocked;
}
// Access to the exclusion semaphore
bool isExclusive() {
- return (bool)(_data.instance.scriptFlags & activeItemExclusive);
+ return (bool)(_data.instance.scriptFlags & kActiveItemExclusive);
}
void setExclusive(bool val) {
if (val)
- _data.instance.scriptFlags |= activeItemExclusive;
+ _data.instance.scriptFlags |= kActiveItemExclusive;
else
- _data.instance.scriptFlags &= ~activeItemExclusive;
+ _data.instance.scriptFlags &= ~kActiveItemExclusive;
}
uint8 lockType() {
@@ -574,12 +574,12 @@ class TileActivityTask {
ThreadID _script; // script to wake up when task done
enum activityTypes {
- activityTypeNone, // no activity
+ kActivityTypeNone, // no activity
- activityTypeOpen, // open door
- activityTypeClose, // close door
+ kActivityTypeOpen, // open door
+ kActivityTypeClose, // close door
- activityTypeScript // scriptable activity
+ kActivityTypeScript // scriptable activity
};
void remove(); // tile activity task is finished.
@@ -642,7 +642,7 @@ struct StandingTileInfo {
Platform struct
* ======================================================================= */
-const int maxPlatforms = 8;
+const int kMaxPlatforms = 8;
struct Platform {
uint16 height, // height above ground
@@ -711,32 +711,32 @@ typedef Platform *PlatformPtr,
* *PlatformHandle;
enum platformFlags {
- plCutaway = (1 << 0), // remove when player underneath
+ kPlCutaway = (1 << 0), // remove when player underneath
// Cutaway directions: When platform is cut away, also cut
// away any adjacent platforms in these directions.
- plVisible = (1 << 15), // platform is visible
- plModified = (1 << 14), // platform has been changed
- plCutUPos = (1 << 13),
- plCutUNeg = (1 << 13),
- plCutVPos = (1 << 13),
- plCutVNeg = (1 << 13)
+ kPlVisible = (1 << 15), // platform is visible
+ kPlModified = (1 << 14), // platform has been changed
+ kPlCutUPos = (1 << 13),
+ kPlCutUNeg = (1 << 13),
+ kPlCutVPos = (1 << 13),
+ kPlCutVNeg = (1 << 13)
};
#ifdef OLDPLATFLAAGS
enum platformFlags {
- plCutaway = (1 << 0), // remove when player underneath
+ kPlCutaway = (1 << 0), // remove when player underneath
// Cutaway directions: When platform is cut away, also cut
// away any adjacent platforms in these directions.
- plCutUPos = (1 << 1),
- plCutUNeg = (1 << 2),
- plCutVPos = (1 << 3),
- plCutVNeg = (1 << 4),
+ kPlCutUPos = (1 << 1),
+ kPlCutUNeg = (1 << 2),
+ kPlCutVPos = (1 << 3),
+ kPlCutVNeg = (1 << 4),
- plVisible = (1 << 5), // platform is visible
- plEnabled = (1 << 6) // enforce platform terrain.
+ kPlVisible = (1 << 5), // platform is visible
+ kPlEnabled = (1 << 6) // enforce platform terrain.
};
#endif
@@ -805,7 +805,7 @@ class MetaTile {
public:
uint16 _highestPixel; // more drawing optimization
BankBits _banksNeeded; // which banks are needed
- uint16 _stack[maxPlatforms]; // pointer to platforms
+ uint16 _stack[kMaxPlatforms]; // pointer to platforms
uint32 _properties; // more drawing optimization
int _index;
MetaTileList *_parent;
@@ -864,11 +864,11 @@ struct MapHeader {
};
enum mapEdgeTypes {
- edgeTypeBlack = 0,
- edgeTypeFill0,
- edgeTypeFill1,
- edgeTypeRepeat,
- edgeTypeWrap
+ kEdgeTypeBlack = 0,
+ kEdgeTypeFill0,
+ kEdgeTypeFill1,
+ kEdgeTypeRepeat,
+ kEdgeTypeWrap
};
typedef MapHeader *MapPtr,
@@ -878,7 +878,7 @@ typedef MapHeader *MapPtr,
WorldMapData struct
* ===================================================================== */
-const uint16 metaTileVisited = (1 << 15);
+const uint16 kMetaTileVisited = (1 << 15);
struct WorldMapData {
ObjectID worldID; // The number of this map
diff --git a/engines/saga2/tilemode.cpp b/engines/saga2/tilemode.cpp
index 9daaf166eca..819d0114a39 100644
--- a/engines/saga2/tilemode.cpp
+++ b/engines/saga2/tilemode.cpp
@@ -436,7 +436,7 @@ static void evalMouseState() {
obj->getLocation(),
mObj)
&& (a->inRange(obj->getLocation(), 8)
- || lineOfSight(a, obj, terrainTransparent)))));
+ || lineOfSight(a, obj, kTerrainTransparent)))));
}
}
} else {
@@ -456,7 +456,7 @@ static void evalMouseState() {
// to the picked object
if (a->inAttackRange(obj->getLocation())
&& (a->inRange(obj->getLocation(), 8)
- || lineOfSight(a, obj, terrainTransparent)))
+ || lineOfSight(a, obj, kTerrainTransparent)))
g_vm->_mouseInfo->setIntent(GrabInfo::kIntAttack);
else {
g_vm->_mouseInfo->setIntent(GrabInfo::kIntWalkTo);
@@ -502,7 +502,7 @@ static void evalMouseState() {
// to the object
if (a->inAttackRange(obj->getLocation())
&& (a->inRange(obj->getLocation(), 8)
- || lineOfSight(a, obj, terrainTransparent))) {
+ || lineOfSight(a, obj, kTerrainTransparent))) {
g_vm->_mouseInfo->setIntent(GrabInfo::kIntAttack);
g_vm->_mouseInfo->setDoable(true);
} else {
@@ -535,7 +535,7 @@ static void evalMouseState() {
interruptable
&& a->inReach(obj->getLocation())
&& (a->inRange(obj->getLocation(), 8)
- || lineOfSight(a, obj, terrainTransparent)));
+ || lineOfSight(a, obj, kTerrainTransparent)));
}
}
} else
@@ -1121,7 +1121,7 @@ static APPFUNC(cmdClickTileMap) {
|| lineOfSight(
centerActorPtr,
TAILoc,
- terrainTransparent)))
+ kTerrainTransparent)))
MotionTask::useObjectOnTAI(
*centerActorPtr,
*mouseObject,
@@ -1284,7 +1284,7 @@ static APPFUNC(cmdClickTileMap) {
if (a->inRange(TAILoc, 32)
&& (a->inRange(TAILoc, 8)
- || lineOfSight(a, TAILoc, terrainTransparent)))
+ || lineOfSight(a, TAILoc, kTerrainTransparent)))
MotionTask::useTAI(*a, *pickedTAI);
} else {
tileMapControl->setSticky(true);
Commit: afc3aeec50d2561781f9b28ac1f43175360f96b4
https://github.com/scummvm/scummvm/commit/afc3aeec50d2561781f9b28ac1f43175360f96b4
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-10-29T23:45:58+02:00
Commit Message:
SAGA2: Rename enums in tileload.h
Changed paths:
engines/saga2/tile.cpp
engines/saga2/tileload.h
diff --git a/engines/saga2/tile.cpp b/engines/saga2/tile.cpp
index a18e7e055dc..a2f6c37de80 100644
--- a/engines/saga2/tile.cpp
+++ b/engines/saga2/tile.cpp
@@ -94,7 +94,7 @@ void setAreaSound(const TilePoint &baseCoords);
Bank switching interface
* ===================================================================== */
-TileBankPtr tileBanks[maxBanks];
+TileBankPtr tileBanks[kMaxBanks];
void updateHandleRefs(const TilePoint &pt); //, StandingTileInfo *stiResult )
void updateFrameCount();
@@ -1323,7 +1323,7 @@ void initMaps() {
const int activeItemSize = 28;
// Load all of the tile terrain banks
- for (i = 0; i < maxBanks; i++) {
+ for (i = 0; i < kMaxBanks; i++) {
stream = loadResourceToStream(tileRes, tileTerrainID + i, "tile terrain bank");
tileBanks[i] = new TileBank(stream);
delete stream;
@@ -1498,7 +1498,7 @@ void cleanupMaps() {
delete[] mapList;
// Dump all of the tile terrain banks
- for (i = 0; i < maxBanks; i++) {
+ for (i = 0; i < kMaxBanks; i++) {
if (tileBanks[i] != nullptr) {
delete tileBanks[i];
tileBanks[i] = nullptr;
diff --git a/engines/saga2/tileload.h b/engines/saga2/tileload.h
index 205d6dab206..b58f74cabad 100644
--- a/engines/saga2/tileload.h
+++ b/engines/saga2/tileload.h
@@ -28,7 +28,7 @@
namespace Saga2 {
-const int maxBanks = 64; // 64 banks maximum
+const int kMaxBanks = 64; // 64 banks maximum
/* ============================================================================ *
TileBank request bits
@@ -40,7 +40,7 @@ const int maxBanks = 64; // 64 banks maximum
class BankBits {
public:
- uint32 _b[maxBanks / 32];
+ uint32 _b[kMaxBanks / 32];
// constructors
BankBits() {}
@@ -132,7 +132,7 @@ public:
template<int size> class FixedBitArray {
private:
enum {
- lWords = ((size + 31) / 32)
+ klWords = ((size + 31) / 32)
};
int16 WORDNUM(int n) {
@@ -145,7 +145,7 @@ private:
return (1 << (n & 31));
}
- uint32 _b[lWords];
+ uint32 _b[klWords];
void clear() {
memset(&_b, 0, sizeof _b);
@@ -181,7 +181,7 @@ public:
friend FixedBitArray operator& (FixedBitArray c, FixedBitArray d) {
FixedBitArray t;
- for (uint16 i = 0; i < lWords; i++)
+ for (uint16 i = 0; i < klWords; i++)
t._b[i] = c._b[i] & d._b[i];
return t;
}
@@ -189,19 +189,19 @@ public:
friend FixedBitArray operator| (FixedBitArray c, FixedBitArray d) {
FixedBitArray t;
- for (uint16 i = 0; i < lWords; i++)
+ for (uint16 i = 0; i < klWords; i++)
t._b[i] = c._b[i] | d._b[i];
return t;
}
friend FixedBitArray &operator|= (FixedBitArray c, FixedBitArray d) {
- for (uint16 i = 0; i < lWords; i++)
+ for (uint16 i = 0; i < klWords; i++)
c._b[i] |= d._b[i];
return c;
}
friend bool operator!= (FixedBitArray c, FixedBitArray d) {
- for (uint16 i = 0; i < lWords; i++)
+ for (uint16 i = 0; i < klWords; i++)
if (c._b[i] != d._b[i]) return true;
return false;
}
@@ -209,7 +209,7 @@ public:
friend FixedBitArray operator^ (FixedBitArray c, FixedBitArray d) {
FixedBitArray t;
- for (uint16 i = 0; i < lWords; i++)
+ for (uint16 i = 0; i < klWords; i++)
t._b[i] = c._b[i] ^ d._b[i];
return t;
}
Commit: d8e24a16de308524974def2c04928d6311465284
https://github.com/scummvm/scummvm/commit/d8e24a16de308524974def2c04928d6311465284
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-10-29T23:45:58+02:00
Commit Message:
SAGA2: Rename enums in towerwin.h
Changed paths:
engines/saga2/towerfta.cpp
engines/saga2/towerwin.h
diff --git a/engines/saga2/towerfta.cpp b/engines/saga2/towerfta.cpp
index abc9eb6126b..ff603c24e80 100644
--- a/engines/saga2/towerfta.cpp
+++ b/engines/saga2/towerfta.cpp
@@ -48,41 +48,41 @@ namespace Saga2 {
FTA initialization & cleanup records
* ===================================================================== */
-int maxInitState = fullyInitialized;
-
-TowerLayer tower[fullyInitialized] = {
- { nothingInitialized, &initTowerBase, &termTowerBase },
- { errHandlersInitialized, &initErrorManagers, &termErrorManagers },
- { delayedErrInitialized, &initDelayedErrors, &termDelayedErrors },
- { activeErrInitialized, &initActiveErrors, &termActiveErrors },
- { configTestInitialized, &initSystemConfig, &termTowerBase },
- { introInitialized, &initPlayIntro, &termPlayOutro },
- { timerInitialized, &initSystemTimer, &termSystemTimer },
- { audioInitialized, &initAudio, &termAudio},
- { resourcesInitialized, &initResourceFiles, &termResourceFiles },
- { serversInitialized, &initResourceServers, &termResourceServers },
- { pathFinderInitialized, &initPathFinders, &termPathFinders },
- { scriptsInitialized, &initSAGAInterpreter, &termSAGAInterpreter },
- { audStartInitialized, &initAudioChannels, &termAudioChannels },
- { tileResInitialized, &initResourceHandles, &termResourceHandles },
- { palettesInitialized, &initPalettes, &termPalettes },
- { mainWindowInitialized, &initDisplayPort, &termDisplayPort },
- { panelsInitialized, &initPanelSystem, &termPanelSystem },
- { mainWindowOpenInitialized, &initMainWindow, &termMainWindow },
- { guiMessInitialized, &initGUIMessagers, &termGUIMessagers },
- { mouseImageInitialized, &initMousePointer, &termMousePointer },
- { displayInitialized, &initDisplay, &termDisplay },
- { mapsInitialized, &initGameMaps, &termGameMaps },
- { patrolsInitialized, &initRouteData, &termRouteData },
- { spritesInitialized, &initActorSprites, &termActorSprites },
- { weaponsInitialized, &initWeaponData, &termWeaponData },
- { magicInitialized, &initSpellData, &termSpellData },
- { objectSoundFXInitialized, &initObjectSoundFX, &termObjectSoundFX },
- { prototypesInitialized, &initObjectPrototypes, &termObjectPrototypes },
- { gameStateInitialized, &initDynamicGameData, &termDynamicGameData },
- { gameModeInitialized, &initGameMode, &termGameMode },
- { gameDisplayEnabled, &initTop, &termTop },
- { procResEnabled, &initProcessResources, &termProcessResources }
+int maxInitState = kFullyInitialized;
+
+TowerLayer tower[kFullyInitialized] = {
+ { kNothingInitialized, &initTowerBase, &termTowerBase },
+ { kErrHandlersInitialized, &initErrorManagers, &termErrorManagers },
+ { kDelayedErrInitialized, &initDelayedErrors, &termDelayedErrors },
+ { kActiveErrInitialized, &initActiveErrors, &termActiveErrors },
+ { kConfigTestInitialized, &initSystemConfig, &termTowerBase },
+ { kIntroInitialized, &initPlayIntro, &termPlayOutro },
+ { kTimerInitialized, &initSystemTimer, &termSystemTimer },
+ { kAudioInitialized, &initAudio, &termAudio},
+ { kResourcesInitialized, &initResourceFiles, &termResourceFiles },
+ { kServersInitialized, &initResourceServers, &termResourceServers },
+ { kPathFinderInitialized, &initPathFinders, &termPathFinders },
+ { kScriptsInitialized, &initSAGAInterpreter, &termSAGAInterpreter },
+ { kAudStartInitialized, &initAudioChannels, &termAudioChannels },
+ { kTileResInitialized, &initResourceHandles, &termResourceHandles },
+ { kPalettesInitialized, &initPalettes, &termPalettes },
+ { kMainWindowInitialized, &initDisplayPort, &termDisplayPort },
+ { kPanelsInitialized, &initPanelSystem, &termPanelSystem },
+ { kMainWindowOpenInitialized, &initMainWindow, &termMainWindow },
+ { kGuiMessInitialized, &initGUIMessagers, &termGUIMessagers },
+ { kMouseImageInitialized, &initMousePointer, &termMousePointer },
+ { kDisplayInitialized, &initDisplay, &termDisplay },
+ { kMapsInitialized, &initGameMaps, &termGameMaps },
+ { kPatrolsInitialized, &initRouteData, &termRouteData },
+ { kSpritesInitialized, &initActorSprites, &termActorSprites },
+ { kWeaponsInitialized, &initWeaponData, &termWeaponData },
+ { kMagicInitialized, &initSpellData, &termSpellData },
+ { kObjectSoundFXInitialized, &initObjectSoundFX, &termObjectSoundFX },
+ { kPrototypesInitialized, &initObjectPrototypes, &termObjectPrototypes },
+ { kGameStateInitialized, &initDynamicGameData, &termDynamicGameData },
+ { kGameModeInitialized, &initGameMode, &termGameMode },
+ { kGameDisplayEnabled, &initTop, &termTop },
+ { kProcResEnabled, &initProcessResources, &termProcessResources }
};
/* ===================================================================== *
diff --git a/engines/saga2/towerwin.h b/engines/saga2/towerwin.h
index 02ede787c84..e07f8c087d0 100644
--- a/engines/saga2/towerwin.h
+++ b/engines/saga2/towerwin.h
@@ -29,46 +29,46 @@
namespace Saga2 {
enum initializationStates {
- nothingInitialized = 0,
- errHandlersInitialized,
- messagersInitialized,
- errLoggersInitialized,
- breakHandlerInitialized,
- configTestInitialized,
- delayedErrInitialized,
- graphicsSystemInitialized,
- procResEnabled,
- memoryInitialized,
- audioInitialized,
- videoInitialized,
- resourcesInitialized,
- serversInitialized,
- pathFinderInitialized,
- scriptsInitialized,
- audStartInitialized,
- tileResInitialized,
- timerInitialized,
- palettesInitialized,
- panelsInitialized,
- mainWindowInitialized,
- mainWindowOpenInitialized,
- guiMessInitialized,
- //mouseImageInitialized,
- introInitialized,
- mapsInitialized,
- mouseImageInitialized,
- patrolsInitialized,
- spritesInitialized,
- weaponsInitialized,
- magicInitialized,
- objectSoundFXInitialized,
- prototypesInitialized,
- displayInitialized,
- gameStateInitialized,
- gameModeInitialized,
- gameDisplayEnabled,
- activeErrInitialized,
- fullyInitialized
+ kNothingInitialized = 0,
+ kErrHandlersInitialized,
+ kMessagersInitialized,
+ kErrLoggersInitialized,
+ kBreakHandlerInitialized,
+ kConfigTestInitialized,
+ kDelayedErrInitialized,
+ kGraphicsSystemInitialized,
+ kProcResEnabled,
+ kMemoryInitialized,
+ kAudioInitialized,
+ kVideoInitialized,
+ kResourcesInitialized,
+ kServersInitialized,
+ kPathFinderInitialized,
+ kScriptsInitialized,
+ kAudStartInitialized,
+ kTileResInitialized,
+ kTimerInitialized,
+ kPalettesInitialized,
+ kPanelsInitialized,
+ kMainWindowInitialized,
+ kMainWindowOpenInitialized,
+ kGuiMessInitialized,
+ //kMouseImageInitialized,
+ kIntroInitialized,
+ kMapsInitialized,
+ kMouseImageInitialized,
+ kPatrolsInitialized,
+ kSpritesInitialized,
+ kWeaponsInitialized,
+ kMagicInitialized,
+ kObjectSoundFXInitialized,
+ kPrototypesInitialized,
+ kDisplayInitialized,
+ kGameStateInitialized,
+ kGameModeInitialized,
+ kGameDisplayEnabled,
+ kActiveErrInitialized,
+ kFullyInitialized
};
} // end of namespace Saga2
Commit: 75dcb112c6f8146746997be117d44ef9032a33a6
https://github.com/scummvm/scummvm/commit/75dcb112c6f8146746997be117d44ef9032a33a6
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-10-29T23:45:59+02:00
Commit Message:
SAGA2: Rename enums in uidialog.h
Changed paths:
engines/saga2/uidialog.cpp
engines/saga2/uidialog.h
diff --git a/engines/saga2/uidialog.cpp b/engines/saga2/uidialog.cpp
index fd318483ed8..a724a6dbbef 100644
--- a/engines/saga2/uidialog.cpp
+++ b/engines/saga2/uidialog.cpp
@@ -678,7 +678,7 @@ int16 FileDialog(int16 fileProcess) {
}
#endif
// init the resource context handle
- decRes = resFile->newContext(dialogGroupID, "dialog resources");
+ decRes = resFile->newContext(kDialogGroupID, "dialog resources");
// get the graphics associated with the buttons
@@ -823,7 +823,7 @@ int16 OptionsDialog(bool disableSaveResume) {
if (!fullInitialized) return -1;
// init the resource context handle
- decRes = resFile->newContext(dialogGroupID, "dialog resources");
+ decRes = resFile->newContext(kDialogGroupID, "dialog resources");
// get the graphics associated with the buttons
dialogPushImag = loadButtonRes(decRes, dialogPushResNum, numBtnImages);
@@ -1003,7 +1003,7 @@ bool initUserDialog() {
const int16 dialogPushResNum = 4;
// init the resource context handle
- udDecRes = resFile->newContext(dialogGroupID, "dialog resources");
+ udDecRes = resFile->newContext(kDialogGroupID, "dialog resources");
// get the graphics associated with the buttons
@@ -1176,7 +1176,7 @@ int16 userDialog(const char *title, const char *msg, const char *bMsg1,
return -1;
// init the resource context handle
- decRes = resFile->newContext(dialogGroupID, "dialog resources");
+ decRes = resFile->newContext(kDialogGroupID, "dialog resources");
// get the graphics associated with the buttons
@@ -1277,7 +1277,7 @@ void CPlacardWindow::positionText(
Common::sprintf_s(_titleBuf, "%s", windowText);
// break up the title text string
- _titleCount = SplitString(_titleBuf, _titleStrings, maxLines, '\n');
+ _titleCount = SplitString(_titleBuf, _titleStrings, kMaxLines, '\n');
yPos = textArea.y +
((textArea.height - _titleCount * fontHeight) >> 1);
@@ -1388,7 +1388,7 @@ void CPlacardPanel::positionText(const char *windowText, const Rect16 &textArea)
Common::sprintf_s(_titleBuf, "%s", windowText);
// break up the title text string
- _titleCount = SplitString(_titleBuf, _titleStrings, maxLines, '\n');
+ _titleCount = SplitString(_titleBuf, _titleStrings, kMaxLines, '\n');
yPos = textArea.y +
((textArea.height - _titleCount * fontHeight) >> 1);
diff --git a/engines/saga2/uidialog.h b/engines/saga2/uidialog.h
index 2b0270b3a90..0189eb3b38e 100644
--- a/engines/saga2/uidialog.h
+++ b/engines/saga2/uidialog.h
@@ -31,10 +31,10 @@ namespace Saga2 {
struct SaveFileHeader;
// constants
-const uint32 dialogGroupID = MKTAG('D', 'I', 'A', 'L');
+const uint32 kDialogGroupID = MKTAG('D', 'I', 'A', 'L');
// this should eventually point to the script that contains the credits
-const uint16 creditsScriptNum = 0; // this has a scripts now
+const uint16 kCreditsScriptNum = 0; // this has a scripts now
// >>> need to make resource for defining
// script numbers
@@ -77,14 +77,14 @@ class CPlacardWindow : public ModalWindow {
private:
enum {
- maxLines = 16,
- maxText = 512
+ kMaxLines = 16,
+ kMaxText = 512
};
int16 _titleCount;
- Point16 _titlePos[maxLines];
- char *_titleStrings[maxLines];
- char _titleBuf[maxText];
+ Point16 _titlePos[kMaxLines];
+ char *_titleStrings[kMaxLines];
+ char _titleBuf[kMaxText];
textPallete _textPal;
gFont *_textFont;
@@ -118,14 +118,14 @@ public:
class CPlacardPanel : public CPlaqText {
enum {
- maxLines = 16,
- maxText = 512
+ kMaxLines = 16,
+ kMaxText = 512
};
int16 _titleCount;
- Point16 _titlePos[maxLines];
- char *_titleStrings[maxLines];
- char _titleBuf[maxText];
+ Point16 _titlePos[kMaxLines];
+ char *_titleStrings[kMaxLines];
+ char _titleBuf[kMaxText];
void positionText(const char *windowText, const Rect16 &textArea);
@@ -142,7 +142,7 @@ public:
const Point16 &,
const Rect16 &);
-} ;
+};
} // end of namespace Saga2
Commit: a270ee4275de2593e0fc31adb578c8396a12f4a3
https://github.com/scummvm/scummvm/commit/a270ee4275de2593e0fc31adb578c8396a12f4a3
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-10-29T23:45:59+02:00
Commit Message:
SAGA2: Rename constants in uimetrics.h
Changed paths:
engines/saga2/contain.cpp
engines/saga2/intrface.cpp
engines/saga2/objects.cpp
engines/saga2/uimetrcs.h
diff --git a/engines/saga2/contain.cpp b/engines/saga2/contain.cpp
index cd8e744c030..87b48122541 100644
--- a/engines/saga2/contain.cpp
+++ b/engines/saga2/contain.cpp
@@ -157,8 +157,8 @@ static const ContainerAppearanceDef readyContainerAppearance = {
{0, 0, 0, 0},
{ 0, 0 },
{ 0, 0 },
- {iconOriginX - 1, iconOriginY - 1 - 8},
- {iconSpacingX, iconSpacingY},
+ {kIconOriginX - 1, kIconOriginY - 1 - 8},
+ {kIconSpacingX, kIconSpacingY},
1, 3,
3
};
@@ -350,17 +350,17 @@ void ContainerView::drawClipped(
y = originY
+ (objLoc.u - _scrollPosition)
- * (_iconSpacing.y + iconHeight);
+ * (_iconSpacing.y + kIconHeight);
x = originX
+ objLoc.v
- * (_iconSpacing.x + iconWidth);
+ * (_iconSpacing.x + kIconWidth);
// Get the address of the sprite.
spr = proto->getSprite(item, ProtoObj::kObjInContainerView).sp;
- sprPos.x = x + ((iconWidth - spr->size.x) >> 1)
+ sprPos.x = x + ((kIconWidth - spr->size.x) >> 1)
- spr->offset.x;
- sprPos.y = y + ((iconHeight - spr->size.y) >> 1)
+ sprPos.y = y + ((kIconHeight - spr->size.y) >> 1)
- spr->offset.y;
// Build the color table.
@@ -375,8 +375,8 @@ void ContainerView::drawClipped(
// check to see if selecting amount for this objec
if (g_vm->_cnm->_objToGet == item) {
- Point16 selectorPos = Point16(x + ((iconWidth - kSelectorX) >> 1),
- y + ((iconHeight - kSelectorY) >> 1));
+ Point16 selectorPos = Point16(x + ((kIconWidth - kSelectorX) >> 1),
+ y + ((kIconHeight - kSelectorY) >> 1));
// draw the selector thingy
drawSelector(port, selectorPos);
@@ -454,8 +454,8 @@ TilePoint ContainerView::pickObjectSlot(const Point16 &pickPos) {
// Compute the u/v of the slot that they clicked on.
temp = pickPos + _iconSpacing / 2 - _iconOrigin;
- slot.v = clamp(0, temp.x / (iconWidth + _iconSpacing.x), _visibleCols - 1);
- slot.u = clamp(0, temp.y / (iconHeight + _iconSpacing.y), _visibleRows - 1) + _scrollPosition;
+ slot.v = clamp(0, temp.x / (kIconWidth + _iconSpacing.x), _visibleCols - 1);
+ slot.u = clamp(0, temp.y / (kIconHeight + _iconSpacing.y), _visibleRows - 1) + _scrollPosition;
slot.z = 1;
return slot;
}
@@ -947,18 +947,18 @@ void ReadyContainerView::drawClipped(
if (_backImages) {
int16 i;
- Point16 drawOrg(_extent.x - offset.x + backOriginX,
- _extent.y - offset.y + backOriginY);
+ Point16 drawOrg(_extent.x - offset.x + kBackOriginX,
+ _extent.y - offset.y + kBackOriginY);
for (y = drawOrg.y, row = 0;
row < _visibleRows;
- row++, y += _iconSpacing.y + iconHeight) {
+ row++, y += _iconSpacing.y + kIconHeight) {
// reset y for background image stuff
//y = drawOrg.y;
for (i = 0, x = drawOrg.x, col = 0;
col < _visibleCols;
- i++, col++, x += _iconSpacing.x + iconWidth) {
+ i++, col++, x += _iconSpacing.x + kIconWidth) {
Point16 pos(x, y);
if (isGhosted()) drawCompressedImageGhosted(port, pos, _backImages[i % _numIm]);
@@ -969,16 +969,16 @@ void ReadyContainerView::drawClipped(
} else {
for (y = originY, row = 0;
row < _visibleRows;
- row++, y += _iconSpacing.y + iconHeight) {
+ row++, y += _iconSpacing.y + kIconHeight) {
for (x = originX, col = 0;
col < _visibleCols;
- col++, x += _iconSpacing.x + iconWidth) {
+ col++, x += _iconSpacing.x + kIconWidth) {
// REM: We need to come up with some way of
// indicating how to render the pattern data which
// is behind the object...
port.setColor(14);
- port.fillRect(x, y, iconWidth, iconHeight);
+ port.fillRect(x, y, kIconWidth, kIconHeight);
}
@@ -1009,15 +1009,15 @@ void ReadyContainerView::drawClipped(
ProtoObj *proto = item->proto();
Point16 sprPos;
- y = originY + (objLoc.u - _scrollPosition) * (_iconSpacing.y + iconHeight);
- x = originX + objLoc.v * (_iconSpacing.x + iconWidth);
+ y = originY + (objLoc.u - _scrollPosition) * (_iconSpacing.y + kIconHeight);
+ x = originX + objLoc.v * (_iconSpacing.x + kIconWidth);
// Get the address of the sprite.
spr = proto->getSprite(item, ProtoObj::kObjInContainerView).sp;
- sprPos.x = x + ((iconWidth - spr->size.x) >> 1)
+ sprPos.x = x + ((kIconWidth - spr->size.x) >> 1)
- spr->offset.x;
- sprPos.y = y + ((iconHeight - spr->size.y) >> 1)
+ sprPos.y = y + ((kIconHeight - spr->size.y) >> 1)
- spr->offset.y;
if (isGhosted()) return;
@@ -1040,8 +1040,8 @@ void ReadyContainerView::drawClipped(
// check to see if selecting amount for this objec
if (g_vm->_cnm->_objToGet == item) {
- Point16 selectorPos = Point16(x + ((iconWidth - kSelectorX) >> 1),
- y + ((iconHeight - kSelectorY) >> 1));
+ Point16 selectorPos = Point16(x + ((kIconWidth - kSelectorX) >> 1),
+ y + ((kIconHeight - kSelectorY) >> 1));
// draw the selector thingy
drawSelector(port, selectorPos);
diff --git a/engines/saga2/intrface.cpp b/engines/saga2/intrface.cpp
index 1e181426368..15ad23de78c 100644
--- a/engines/saga2/intrface.cpp
+++ b/engines/saga2/intrface.cpp
@@ -230,37 +230,37 @@ APPFUNC(cmdManaInd);
* ===================================================================== */
// position arrays for all _buttons on the individual panels
-static const StaticRect topBox[numButtons] = {
- /* portrait */ { 489, 22 + (yContOffset * 0), 65, 72 },
- /* agress */ { 559, 86 + (yContOffset * 0), 28, 27 },
- /* jump */ { 592, 86 + (yContOffset * 0), 28, 27 },
- /* center */ { 559, 56 + (yContOffset * 0), 28, 27 },
- /* banding */ { 592, 56 + (yContOffset * 0), 28, 27 },
- /* namePlates */ { 488, 94 + (yFaceOffset * 0), 65, 15 },
- /* namePlateFrames */ { 487, 20 + (yFaceOffset * 0), 69, 92 }
+static const StaticRect topBox[kNumButtons] = {
+ /* portrait */ { 489, 22 + (kYContOffset * 0), 65, 72 },
+ /* agress */ { 559, 86 + (kYContOffset * 0), 28, 27 },
+ /* jump */ { 592, 86 + (kYContOffset * 0), 28, 27 },
+ /* center */ { 559, 56 + (kYContOffset * 0), 28, 27 },
+ /* banding */ { 592, 56 + (kYContOffset * 0), 28, 27 },
+ /* namePlates */ { 488, 94 + (kYFaceOffset * 0), 65, 15 },
+ /* namePlateFrames */ { 487, 20 + (kYFaceOffset * 0), 69, 92 }
};
-static const StaticRect midBox[numButtons] = {
- { 489, 22 + (yContOffset * 1), 65, 72 },
- { 559, 86 + (yContOffset * 1), 28, 27 },
- { 592, 86 + (yContOffset * 1), 28, 27 },
- { 559, 56 + (yContOffset * 1), 28, 27 },
- { 592, 56 + (yContOffset * 1), 28, 27 },
- { 488, 94 + (yFaceOffset * 1), 65, 15 },
- { 487, 20 + (yFaceOffset * 1), 69, 92 }
+static const StaticRect midBox[kNumButtons] = {
+ { 489, 22 + (kYContOffset * 1), 65, 72 },
+ { 559, 86 + (kYContOffset * 1), 28, 27 },
+ { 592, 86 + (kYContOffset * 1), 28, 27 },
+ { 559, 56 + (kYContOffset * 1), 28, 27 },
+ { 592, 56 + (kYContOffset * 1), 28, 27 },
+ { 488, 94 + (kYFaceOffset * 1), 65, 15 },
+ { 487, 20 + (kYFaceOffset * 1), 69, 92 }
};
-static const StaticRect botBox[numButtons] = {
- { 489, 22 + (yContOffset * 2), 65, 72 },
- { 559, 86 + (yContOffset * 2), 28, 27 },
- { 592, 86 + (yContOffset * 2), 28, 27 },
- { 559, 56 + (yContOffset * 2), 28, 27 },
- { 592, 56 + (yContOffset * 2), 28, 27 },
- { 488, 94 + (yFaceOffset * 2), 65, 15 },
- { 487, 20 + (yFaceOffset * 2), 69, 92 }
+static const StaticRect botBox[kNumButtons] = {
+ { 489, 22 + (kYContOffset * 2), 65, 72 },
+ { 559, 86 + (kYContOffset * 2), 28, 27 },
+ { 592, 86 + (kYContOffset * 2), 28, 27 },
+ { 559, 56 + (kYContOffset * 2), 28, 27 },
+ { 592, 56 + (kYContOffset * 2), 28, 27 },
+ { 488, 94 + (kYFaceOffset * 2), 65, 15 },
+ { 487, 20 + (kYFaceOffset * 2), 69, 92 }
};
diff --git a/engines/saga2/objects.cpp b/engines/saga2/objects.cpp
index 1dc266190c4..0fd4a784536 100644
--- a/engines/saga2/objects.cpp
+++ b/engines/saga2/objects.cpp
@@ -4416,8 +4416,8 @@ void readyContainerSetup() {
*trioControls,
Rect16(trioReadyContInfo[i].xPos,
trioReadyContInfo[i].yPos + 8,
- iconOriginX * 2 + iconWidth * trioReadyContInfo[i].cols + iconSpacingY * (trioReadyContInfo[i].cols - 1),
- iconOriginY + (iconOriginY * trioReadyContInfo[i].rows) + (trioReadyContInfo[i].rows * iconHeight) - 23),
+ kIconOriginX * 2 + kIconWidth * trioReadyContInfo[i].cols + kIconSpacingY * (trioReadyContInfo[i].cols - 1),
+ kIconOriginY + (kIconOriginY * trioReadyContInfo[i].rows) + (trioReadyContInfo[i].rows * kIconHeight) - 23),
*g_vm->_playerList[i]->_readyNode,
backImages,
numReadyContRes,
@@ -4432,8 +4432,8 @@ void readyContainerSetup() {
indivCviewTop = new ReadyContainerView(*indivControls,
Rect16(indivReadyContInfoTop.xPos,
indivReadyContInfoTop.yPos + 8,
- iconOriginX * 2 + iconWidth * indivReadyContInfoTop.cols + iconSpacingY * (indivReadyContInfoTop.cols - 1),
- iconOriginY + (iconOriginY * indivReadyContInfoTop.rows) + (indivReadyContInfoTop.rows * iconHeight) - 23),
+ kIconOriginX * 2 + kIconWidth * indivReadyContInfoTop.cols + kIconSpacingY * (indivReadyContInfoTop.cols - 1),
+ kIconOriginY + (kIconOriginY * indivReadyContInfoTop.rows) + (indivReadyContInfoTop.rows * kIconHeight) - 23),
*indivReadyNode,
backImages,
numReadyContRes,
@@ -4447,8 +4447,8 @@ void readyContainerSetup() {
indivCviewBot = new ReadyContainerView(*indivControls,
Rect16(indivReadyContInfoBot.xPos,
indivReadyContInfoBot.yPos + 8,
- iconOriginX * 2 + iconWidth * indivReadyContInfoBot.cols + iconSpacingY * (indivReadyContInfoBot.cols - 1),
- iconOriginY + (iconOriginY * indivReadyContInfoBot.rows) + (indivReadyContInfoBot.rows * iconHeight) - 24),
+ kIconOriginX * 2 + kIconWidth * indivReadyContInfoBot.cols + kIconSpacingY * (indivReadyContInfoBot.cols - 1),
+ kIconOriginY + (kIconOriginY * indivReadyContInfoBot.rows) + (indivReadyContInfoBot.rows * kIconHeight) - 24),
*indivReadyNode,
backImages,
numReadyContRes,
diff --git a/engines/saga2/uimetrcs.h b/engines/saga2/uimetrcs.h
index 4721c02c563..47ae85f76c0 100644
--- a/engines/saga2/uimetrcs.h
+++ b/engines/saga2/uimetrcs.h
@@ -28,26 +28,26 @@
namespace Saga2 {
-const int iconWidth = 32,
- iconHeight = 32,
- iconSpacingX = 14,
- iconSpacingY = 14,
- iconOriginX = iconWidth / 2,
- iconOriginY = iconHeight / 2;
-
-const int backWidth = 42,
- backHeight = 42,
- backSpacingX = 12,
- backSpacingY = 12,
- backOriginX = backWidth / 4,
- backOriginY = backHeight / 4 - 8;
+const int kIconWidth = 32,
+ kIconHeight = 32,
+ kIconSpacingX = 14,
+ kIconSpacingY = 14,
+ kIconOriginX = kIconWidth / 2,
+ kIconOriginY = kIconHeight / 2;
+
+const int kBackWidth = 42,
+ kBackHeight = 42,
+ kBackSpacingX = 12,
+ kBackSpacingY = 12,
+ kBackOriginX = kBackWidth / 4,
+ kBackOriginY = kBackHeight / 4 - 8;
// control button position defines
-const int16 numButtons = 7;
-const int16 yContOffset = 150;
+const int16 kNumButtons = 7;
+const int16 kYContOffset = 150;
// facial button position defines
-const int16 yFaceOffset = 150;
+const int16 kYFaceOffset = 150;
extern Rect16 julFrameBox, phiFrameBox,
kevFrameBox, julPlateBox,
Commit: 09eba1d77f2a6742398effed3bc7930281c351aa
https://github.com/scummvm/scummvm/commit/09eba1d77f2a6742398effed3bc7930281c351aa
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-10-29T23:45:59+02:00
Commit Message:
SAGA2: Rename enums in videobox.h
Changed paths:
engines/saga2/videobox.cpp
engines/saga2/videobox.h
diff --git a/engines/saga2/videobox.cpp b/engines/saga2/videobox.cpp
index 66e1a5cc6af..40f1ac44c7a 100644
--- a/engines/saga2/videobox.cpp
+++ b/engines/saga2/videobox.cpp
@@ -41,12 +41,12 @@ CVideoBox::CVideoBox(const Rect16 &box,
uint16 ident,
AppFunc *cmd) : ModalWindow(box, ident, cmd) {
// set the size of the window panes
- _vidPanRects[0] = Rect16(x, y, xBrushSize, yBrushSize);
- _vidPanRects[1] = Rect16(x, y + yBrushSize, xBrushSize, yBrushSize);
+ _vidPanRects[0] = Rect16(kVBx, kVBy, kVBxBrushSize, kVByBrushSize);
+ _vidPanRects[1] = Rect16(kVBx, kVBy + kVByBrushSize, kVBxBrushSize, kVByBrushSize);
// options dialog window decorations
- _vidDec[0].set(_vidPanRects[0], vidPan1ResID);
- _vidDec[1].set(_vidPanRects[1], vidPan2ResID);
+ _vidDec[0].set(_vidPanRects[0], kVBvidPan1ResID);
+ _vidDec[1].set(_vidPanRects[1], kVBvidPan2ResID);
// null out the _decRes pointer
_decRes = nullptr;
@@ -156,7 +156,7 @@ int16 CVideoBox::openVidBox(char *fileName) {
ModalWindow::open();
// start the video playback
- g_vm->startVideo(fileName, x + borderWidth, y + borderWidth);
+ g_vm->startVideo(fileName, kVBx + kVBborderWidth, kVBy + kVBborderWidth);
// run this modal event loop
//EventLoop( _rInfo.running, true );
diff --git a/engines/saga2/videobox.h b/engines/saga2/videobox.h
index e00a78ab455..5245622bb6c 100644
--- a/engines/saga2/videobox.h
+++ b/engines/saga2/videobox.h
@@ -35,26 +35,26 @@ namespace Saga2 {
class CVideoBox : public ModalWindow {
public:
enum {
- xSize = 340,
- ySize = 220,
- x = (640 - xSize) / 2,
- y = (480 - ySize) / 3
+ kVBxSize = 340,
+ kVBySize = 220,
+ kVBx = (640 - kVBxSize) / 2,
+ kVBy = (480 - kVBySize) / 3
};
private:
enum brush {
- xBrushSize = 340, // size of each brush 'chunk'.
- yBrushSize = 110,
- numBrushes = 2 // number of chunks
+ kVBxBrushSize = 340, // size of each brush 'chunk'.
+ kVByBrushSize = 110,
+ kVBnumBrushes = 2 // number of chunks
};
enum borderWidth {
- borderWidth = 6
+ kVBborderWidth = 6
};
enum {
- vidPan1ResID = 0,
- vidPan2ResID
+ kVBvidPan1ResID = 0,
+ kVBvidPan2ResID
};
public:
@@ -69,11 +69,11 @@ public:
Rect16 _vidBoxRect;
// rect for the window panes
- Rect16 _vidPanRects[numBrushes];
+ Rect16 _vidPanRects[kVBnumBrushes];
public:
// decoration declarations
- WindowDecoration _vidDec[numBrushes];
+ WindowDecoration _vidDec[kVBnumBrushes];
protected:
@@ -101,7 +101,7 @@ public:
// returns the active area of this video box
static Rect16 getAreaRect() {
- return Rect16(x, y, xSize, ySize);
+ return Rect16(kVBx, kVBy, kVBxSize, kVBySize);
}
// initializes the resources for this object
Commit: a1c5dee320ec3f7dc014fb8d88edd53c0913ad4c
https://github.com/scummvm/scummvm/commit/a1c5dee320ec3f7dc014fb8d88edd53c0913ad4c
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-10-29T23:45:59+02:00
Commit Message:
SAGA2: Renamed some constants
Changed paths:
engines/saga2/actor.cpp
engines/saga2/actor.h
engines/saga2/contain.cpp
engines/saga2/display.cpp
engines/saga2/dispnode.cpp
engines/saga2/dispnode.h
engines/saga2/document.h
engines/saga2/floating.cpp
engines/saga2/fta.h
engines/saga2/gamemode.cpp
engines/saga2/main.cpp
engines/saga2/modal.cpp
engines/saga2/modal.h
engines/saga2/mouseimg.cpp
engines/saga2/msgbox.h
engines/saga2/objects.cpp
engines/saga2/path.cpp
engines/saga2/playmode.cpp
engines/saga2/speech.cpp
engines/saga2/tilemode.cpp
engines/saga2/towerfta.cpp
diff --git a/engines/saga2/actor.cpp b/engines/saga2/actor.cpp
index ba94f978c3f..d81dd711fdc 100644
--- a/engines/saga2/actor.cpp
+++ b/engines/saga2/actor.cpp
@@ -860,9 +860,9 @@ uint16 ActorProto::massCapacity(GameObject *container) {
Actor *a = (Actor *)container;
ActorAttributes *effStats = a->getStats();
- return baseCarryingCapacity
+ return kBaseCarryingCapacity
+ effStats->getSkillLevel(kSkillIDBrawn)
- * carryingCapacityBonusPerBrawn;
+ * kCarryingCapacityBonusPerBrawn;
}
// ------------------------------------------------------------------------
@@ -921,7 +921,7 @@ struct ActorArchive {
BandID followersID;
ObjectID _armorObjects[ARMOR_COUNT];
ObjectID currentTargetID;
- int16 scriptVar[actorScriptVars];
+ int16 scriptVar[kActorScriptVars];
};
/* ===================================================================== *
@@ -1016,7 +1016,7 @@ void Actor::init(
for (int i = 0; i < ARMOR_COUNT; i++)
_armorObjects[i] = Nothing;
_currentTarget = nullptr;
- for (int i = 0; i < actorScriptVars; i++)
+ for (int i = 0; i < kActorScriptVars; i++)
_scriptVar[i] = 0;
evalActorEnchantments(this);
@@ -1087,7 +1087,7 @@ Actor::Actor() {
_armorObjects[i] = Nothing;
_currentTarget = nullptr;
_currentTargetID = Nothing;
- for (int i = 0; i < actorScriptVars; i++)
+ for (int i = 0; i < kActorScriptVars; i++)
_scriptVar[i] = 0;
}
@@ -1158,7 +1158,7 @@ Actor::Actor(const ResourceActor &res) : GameObject(res) {
_armorObjects[i] = Nothing;
_currentTarget = nullptr;
_currentTargetID = Nothing;
- for (int i = 0; i < actorScriptVars; i++)
+ for (int i = 0; i < kActorScriptVars; i++)
_scriptVar[i] = 0;
evalActorEnchantments(this);
diff --git a/engines/saga2/actor.h b/engines/saga2/actor.h
index 9848f118b0d..759efc0c860 100644
--- a/engines/saga2/actor.h
+++ b/engines/saga2/actor.h
@@ -36,8 +36,8 @@ class Band;
class MotionTask;
class TaskStack;
-const int bandingDist = kSectorSize * 2;
-const int actorScriptVars = 4;
+const int kBandingDist = kSectorSize * 2;
+const int kActorScriptVars = 4;
/* ===================================================================== *
Actor character attributes
@@ -220,8 +220,8 @@ struct ActorAttributes {
}; // 28 bytes
-const int baseCarryingCapacity = 100;
-const int carryingCapacityBonusPerBrawn = 200 / ActorAttributes::kSkillLevels;
+const int kBaseCarryingCapacity = 100;
+const int kCarryingCapacityBonusPerBrawn = 200 / ActorAttributes::kSkillLevels;
/* ===================================================================== *
ResourceActorProtoExtension structure
@@ -707,7 +707,7 @@ public:
GameObject *_currentTarget;
ObjectID _currentTargetID;
- int16 _scriptVar[actorScriptVars]; // scratch variables for scripter use
+ int16 _scriptVar[kActorScriptVars]; // scratch variables for scripter use
// Member functions
@@ -978,7 +978,7 @@ public:
return _leader->IDParent() == IDParent()
&& (_leader->getLocation() - getLocation()).quickHDistance()
- <= bandingDist;
+ <= kBandingDist;
}
private:
diff --git a/engines/saga2/contain.cpp b/engines/saga2/contain.cpp
index 87b48122541..a3d4f8ed4c5 100644
--- a/engines/saga2/contain.cpp
+++ b/engines/saga2/contain.cpp
@@ -843,7 +843,7 @@ void ContainerView::updateMouseText(Point16 &pickPos) {
g_vm->_cnm->_objTextAlarm = false;
// set the hint alarm
- containerObjTextAlarm.set(ticksPerSecond / 2);
+ containerObjTextAlarm.set(kTicksPerSecond / 2);
// put the normalized text into mouseText
slotObject->objCursorText(g_vm->_cnm->_mouseText, ContainerManager::kBufSize);
diff --git a/engines/saga2/display.cpp b/engines/saga2/display.cpp
index 05b3c636525..3b32f9ab16a 100644
--- a/engines/saga2/display.cpp
+++ b/engines/saga2/display.cpp
@@ -121,7 +121,7 @@ void initBackPanel() {
return;
mainWindow = new BackWindow(
- Rect16(0, 0, screenWidth, screenHeight),
+ Rect16(0, 0, kScreenWidth, kScreenHeight),
0,
cmdWindowFunc);
if (mainWindow == nullptr)
diff --git a/engines/saga2/dispnode.cpp b/engines/saga2/dispnode.cpp
index 2339fdaa87b..eda478f02b6 100644
--- a/engines/saga2/dispnode.cpp
+++ b/engines/saga2/dispnode.cpp
@@ -184,8 +184,8 @@ void DisplayNodeList::draw() {
// objects or actors which are closest to the center view point.
void DisplayNodeList::buildObjects(bool fromScratch) {
- GameObject *sortList[maxDisplayed + 1];
- int16 distList[maxDisplayed + 1];
+ GameObject *sortList[kMaxDisplayed + 1];
+ int16 distList[kMaxDisplayed + 1];
int16 sortCount = 0;
int16 i;
int16 viewSize = kTileRectHeight;
@@ -270,11 +270,11 @@ void DisplayNodeList::buildObjects(bool fromScratch) {
sortList[i + 1] = sortList[i];
}
- if (i < maxDisplayed) {
+ if (i < kMaxDisplayed) {
distList[i] = dist;
sortList[i] = obj;
- if (sortCount < maxDisplayed) sortCount++;
+ if (sortCount < kMaxDisplayed) sortCount++;
}
}
}
diff --git a/engines/saga2/dispnode.h b/engines/saga2/dispnode.h
index dceb0d1174b..530910ca76e 100644
--- a/engines/saga2/dispnode.h
+++ b/engines/saga2/dispnode.h
@@ -81,7 +81,7 @@ public:
// This class is used to form a list of objects to display on
// the screen.
-const int maxDisplayed = 100;
+const int kMaxDisplayed = 100;
class DisplayNodeList {
friend ObjectID pickObject(const StaticPoint32 &mouse, StaticTilePoint &objPos);
@@ -97,8 +97,8 @@ public:
_count = 0;
}
DisplayNodeList() {
- _displayList = (DisplayNode *)malloc(sizeof(DisplayNode) * maxDisplayed);
- init(maxDisplayed);
+ _displayList = (DisplayNode *)malloc(sizeof(DisplayNode) * kMaxDisplayed);
+ init(kMaxDisplayed);
_count = 0;
}
~DisplayNodeList() {
diff --git a/engines/saga2/document.h b/engines/saga2/document.h
index 393e526e886..8245fcd00d8 100644
--- a/engines/saga2/document.h
+++ b/engines/saga2/document.h
@@ -40,9 +40,9 @@ int16 openParchment(uint16);
// constants
-const uint32 bookGroupID = MKTAG('B', 'O', 'O', 'K');
+const uint32 kBookGroupID = MKTAG('B', 'O', 'O', 'K');
-const int maxVisiblePages = 2;
+const int kMaxVisiblePages = 2;
enum {
kPageLeft = 0,
@@ -61,7 +61,7 @@ struct CDocumentAppearance {
int16 numPages; // Number of visible pages
int16 orientation; // Orientation of pages
uint8 *textColors; // Text color array
- StaticRect pageRect[maxVisiblePages];// Array of visible page rects
+ StaticRect pageRect[kMaxVisiblePages];// Array of visible page rects
StaticRect closeRect; // Close-box rectangle
StaticWindow *decoList; // List of decorator panels
int16 numDecos; // Number of decorator panels
diff --git a/engines/saga2/floating.cpp b/engines/saga2/floating.cpp
index 0e4eb9397d6..0b0254adbac 100644
--- a/engines/saga2/floating.cpp
+++ b/engines/saga2/floating.cpp
@@ -629,7 +629,7 @@ void updateWindowSection(const Rect16 &r) {
// Since the floating windows can be dragged partly offscreen
// we should make sure we're rendering only to on-screen pixels.
- clip = intersect(r, Rect16(0, 0, screenWidth, screenHeight));
+ clip = intersect(r, Rect16(0, 0, kScreenWidth, kScreenHeight));
// Allocate a temporary pixel map and gPort
diff --git a/engines/saga2/fta.h b/engines/saga2/fta.h
index 13512f89a61..43c260815df 100644
--- a/engines/saga2/fta.h
+++ b/engines/saga2/fta.h
@@ -38,19 +38,19 @@ class hResource;
* ===================================================================== */
// For GameMode Stack
-const int Max_Modes = 8, //Max Game Mode Objects
- End_List = 0; //Variable To Indicate End Of Arg List
+const int kMax_Modes = 8, //Max Game Mode Objects
+ kEnd_List = 0; //Variable To Indicate End Of Arg List
// Width and height of full screen
-const int screenWidth = 640,
- screenHeight = 480;
+const int kScreenWidth = 640,
+ kScreenHeight = 480;
// Number of ticks per second
-const int ticksPerSecond = 72; // 72 ticks per second
+const int kTicksPerSecond = 72; // 72 ticks per second
// Desired frame rate of game (fps)
-const int frameRate = 10,
- framePeriod = ticksPerSecond / frameRate;
+const int kFrameRate = 10,
+ kFramePeriod = kTicksPerSecond / kFrameRate;
/* ====================================================================== *
Overall game modes
@@ -78,9 +78,9 @@ public:
GameMode *_prev; // previous nested mode
int16 _nestable; // true if mode nests
- static GameMode *_modeStackPtr[Max_Modes]; // Array Of Current Mode Stack Pointers to Game Objects
+ static GameMode *_modeStackPtr[kMax_Modes]; // Array Of Current Mode Stack Pointers to Game Objects
static int _modeStackCtr; // Counter For Array Of Mode Stack Pointers to Game Objects
- static GameMode *_newmodeStackPtr[Max_Modes]; // Array Of New Mode Stack Pointers to Game Objects
+ static GameMode *_newmodeStackPtr[kMax_Modes]; // Array Of New Mode Stack Pointers to Game Objects
static int _newmodeStackCtr; // Counter For Array Of Mode Stack Pointers to Game Objects
static int _newmodeFlag; // Flag Telling EventLoop Theres A New Mode So Update
static GameMode *_currentMode, // pointer to current mode.
diff --git a/engines/saga2/gamemode.cpp b/engines/saga2/gamemode.cpp
index ac4885c8cd2..254eebc61e6 100644
--- a/engines/saga2/gamemode.cpp
+++ b/engines/saga2/gamemode.cpp
@@ -37,8 +37,8 @@ namespace Saga2 {
GameMode *GameMode::_currentMode = nullptr; // pointer to current mode.
GameMode *GameMode::_newMode = nullptr; // next mode to run
-GameMode *GameMode::_modeStackPtr[Max_Modes] = { nullptr };
-GameMode *GameMode::_newmodeStackPtr[Max_Modes] = { nullptr };
+GameMode *GameMode::_modeStackPtr[kMax_Modes] = { nullptr };
+GameMode *GameMode::_newmodeStackPtr[kMax_Modes] = { nullptr };
int GameMode::_modeStackCtr = 0;
int GameMode::_newmodeStackCtr = 0;
int GameMode::_newmodeFlag = false;
diff --git a/engines/saga2/main.cpp b/engines/saga2/main.cpp
index 7a20417f4d3..d5cd19b4376 100644
--- a/engines/saga2/main.cpp
+++ b/engines/saga2/main.cpp
@@ -214,7 +214,7 @@ static void mainLoop(bool &cleanExit_, int argc, char *argv[]) {
// Game setup function
bool setupGame() {
- g_vm->_frate = new frameSmoother(frameRate, TICKSPERSECOND, gameTime);
+ g_vm->_frate = new frameSmoother(kFrameRate, TICKSPERSECOND, gameTime);
g_vm->_lrate = new frameCounter(TICKSPERSECOND, gameTime);
return programInit();
@@ -808,10 +808,10 @@ int32 currentGamePerformance() {
int32 framePer = 100;
int32 lval = int(g_vm->_lrate->frameStat());
int32 fval = int(g_vm->_lrate->frameStat(kGRFramesPerSecond));
- if (fval >= frameRate && lval > fval) {
+ if (fval >= kFrameRate && lval > fval) {
framePer += (50 * ((lval - fval) / fval));
} else {
- framePer = (100 * g_vm->_frate->frameStat(kGRFramesPerSecond)) / frameRate;
+ framePer = (100 * g_vm->_frate->frameStat(kGRFramesPerSecond)) / kFrameRate;
}
framePer = clamp(10, framePer, 240);
return framePer;
@@ -826,12 +826,12 @@ int32 eloopsPerSecond = 0;
int32 framesPerSecond = 0;
int32 gamePerformance() {
- if (framesPerSecond < frameRate) {
- return (100 * framesPerSecond) / frameRate;
+ if (framesPerSecond < kFrameRate) {
+ return (100 * framesPerSecond) / kFrameRate;
}
- if (framesPerSecond == frameRate)
+ if (framesPerSecond == kFrameRate)
return 100;
- return 100 + 50 * (eloopsPerSecond - frameRate) / frameRate;
+ return 100 + 50 * (eloopsPerSecond - kFrameRate) / kFrameRate;
}
diff --git a/engines/saga2/modal.cpp b/engines/saga2/modal.cpp
index c2dde9491b0..f0e6a0812c4 100644
--- a/engines/saga2/modal.cpp
+++ b/engines/saga2/modal.cpp
@@ -60,7 +60,7 @@ ModalWindow::ModalWindow(const Rect16 &r, uint16 ident, AppFunc *cmd)
: DecoratedWindow(r, ident, "DialogWindow", cmd) {
_prevModeStackCtr = 0;
- for (int i = 0; i < Max_Modes; i++)
+ for (int i = 0; i < kMax_Modes; i++)
_prevModeStackPtr[i] = nullptr;
}
diff --git a/engines/saga2/modal.h b/engines/saga2/modal.h
index b92075875df..4e8b777e993 100644
--- a/engines/saga2/modal.h
+++ b/engines/saga2/modal.h
@@ -44,7 +44,7 @@ extern GameMode ModalMode;
* ===================================================================== */
class ModalWindow : public DecoratedWindow {
- GameMode *_prevModeStackPtr[Max_Modes];
+ GameMode *_prevModeStackPtr[kMax_Modes];
int _prevModeStackCtr;
public:
diff --git a/engines/saga2/mouseimg.cpp b/engines/saga2/mouseimg.cpp
index 2dbf7a652d3..4a265f743a5 100644
--- a/engines/saga2/mouseimg.cpp
+++ b/engines/saga2/mouseimg.cpp
@@ -329,8 +329,8 @@ void setNewText(char *text) {
textImageCenteredCol = textImage->_size.x / 2;
if (mouseImageCenter - textImageCenteredCol < 5) {
textImageCenteredCol = mouseImageCenter - 5;
- } else if (mouseImageCenter + (textImage->_size.x - textImageCenteredCol) >= screenWidth - 5) {
- textImageCenteredCol = textImage->_size.x - ((screenWidth - 5) - mouseImageCenter);
+ } else if (mouseImageCenter + (textImage->_size.x - textImageCenteredCol) >= kScreenWidth - 5) {
+ textImageCenteredCol = textImage->_size.x - ((kScreenWidth - 5) - mouseImageCenter);
}
}
diff --git a/engines/saga2/msgbox.h b/engines/saga2/msgbox.h
index 7f5963e58ea..a153825c68e 100644
--- a/engines/saga2/msgbox.h
+++ b/engines/saga2/msgbox.h
@@ -42,7 +42,7 @@ extern GameMode ModalMode;
class SimpleWindow : public gWindow {
- GameMode *_prevModeStackPtr[Max_Modes];
+ GameMode *_prevModeStackPtr[kMax_Modes];
int _prevModeStackCtr;
public:
diff --git a/engines/saga2/objects.cpp b/engines/saga2/objects.cpp
index 0fd4a784536..0673920708c 100644
--- a/engines/saga2/objects.cpp
+++ b/engines/saga2/objects.cpp
@@ -4527,8 +4527,8 @@ APPFUNC(cmdControl) {
// actor or object to be visited
// Let's assume that we want each object and/or actor
// to be updated once every 10 seconds.
-const int32 objectCycleTime = (10 * frameRate),
- actorCycleTime = (5 * frameRate);
+const int32 objectCycleTime = (10 * kFrameRate),
+ actorCycleTime = (5 * kFrameRate);
// Indexes into the array of actors and objects
int32 objectIndex,
diff --git a/engines/saga2/path.cpp b/engines/saga2/path.cpp
index 879b97c0515..1b5f52e83f9 100644
--- a/engines/saga2/path.cpp
+++ b/engines/saga2/path.cpp
@@ -1405,7 +1405,7 @@ void PathRequest::initialize() {
uint8 pCross = proto->crossSection;
_firstTick = gameTime,
- _timeLimit = /*flags & run ? ticksPerSecond / 4 :*/ ticksPerSecond;
+ _timeLimit = /*flags & run ? kTicksPerSecond / 4 :*/ kTicksPerSecond;
_fetchRadius =
((kTileUVSize / 2 + pCross) >> kTileUVShift) + 1;
diff --git a/engines/saga2/playmode.cpp b/engines/saga2/playmode.cpp
index 1d608948034..5ba3eb62420 100644
--- a/engines/saga2/playmode.cpp
+++ b/engines/saga2/playmode.cpp
@@ -181,7 +181,7 @@ void PlayModeSetup() {
// Create a control covering the map area.
speakButtonPanel = new gGenericControl(*speakButtonControls,
- Rect16(0, 0, screenWidth, screenHeight),
+ Rect16(0, 0, kScreenWidth, kScreenHeight),
0,
cmdClickSpeech);
speakButtonControls->enable(false);
diff --git a/engines/saga2/speech.cpp b/engines/saga2/speech.cpp
index e039affc272..4d9d5e74a66 100644
--- a/engines/saga2/speech.cpp
+++ b/engines/saga2/speech.cpp
@@ -284,7 +284,7 @@ bool Speech::setupActive() {
_speechFlags |= kSpActive;
- speechFinished.set((_charCount * 4 / 2) + ticksPerSecond);
+ speechFinished.set((_charCount * 4 / 2) + kTicksPerSecond);
//Turn Actor Towards Person They Are Talking To
// MotionTask::turnObject( *obj, GameObject::objectAddress(32794)->getLocation());
diff --git a/engines/saga2/tilemode.cpp b/engines/saga2/tilemode.cpp
index 819d0114a39..63eb1f0d958 100644
--- a/engines/saga2/tilemode.cpp
+++ b/engines/saga2/tilemode.cpp
@@ -570,7 +570,7 @@ static void evalMouseState() {
mt->changeDirectTarget(
walkToPos,
runFlag);
- updateAlarm.set(ticksPerSecond / 2);
+ updateAlarm.set(kTicksPerSecond / 2);
}
}
} else if (g_vm->_mouseInfo->getIntent() == GrabInfo::kIntAttack) {
@@ -819,7 +819,7 @@ void TileModeHandleTask() {
// If mouse in on object set alarm to determine when
// to display the object's name
if (pickedObject != Nothing)
- dispObjNameAlarm.set(ticksPerSecond / 2);
+ dispObjNameAlarm.set(kTicksPerSecond / 2);
}
if (pickedObject != Nothing) {
@@ -872,7 +872,7 @@ void TileModeHandleTask() {
moveActiveTerrain(0); // for terrain with activity tasks.
// Set the time of the next frame
- frameAlarm.set(framePeriod);
+ frameAlarm.set(kFramePeriod);
updateMainDisplay();
if (inCombat || postDisplayFrame++ > 2)
@@ -1206,9 +1206,9 @@ static APPFUNC(cmdClickTileMap) {
navigationDelayed = true;
delayedNavigation.walkToPos = walkToPos;
delayedNavigation.pathFindFlag = false;
- delayedNavigation.delay.set(ticksPerSecond / 2);
+ delayedNavigation.delay.set(kTicksPerSecond / 2);
}
- pathFindAlarm.set(ticksPerSecond / 2);
+ pathFindAlarm.set(kTicksPerSecond / 2);
}
}
}
@@ -1233,7 +1233,7 @@ static APPFUNC(cmdClickTileMap) {
if (navigationDelayed) {
delayedNavigation.walkToPos = walkToPos;
delayedNavigation.pathFindFlag = true;
- delayedNavigation.delay.set(ticksPerSecond / 2);
+ delayedNavigation.delay.set(kTicksPerSecond / 2);
} else {
Actor *a = getCenterActor();
@@ -1305,7 +1305,7 @@ void navigateDirect(TilePoint pick, bool runFlag_) {
Actor *a = getCenterActor(); // addr of actor we control
if (a) {
- updateAlarm.set(ticksPerSecond / 2);
+ updateAlarm.set(kTicksPerSecond / 2);
// REM: Do running here...
diff --git a/engines/saga2/towerfta.cpp b/engines/saga2/towerfta.cpp
index ff603c24e80..304dd1652e6 100644
--- a/engines/saga2/towerfta.cpp
+++ b/engines/saga2/towerfta.cpp
@@ -260,7 +260,7 @@ INITIALIZER(initPanelSystem) {
initPanels(g_vm->_mainPort);
if (g_vm->_mainPort._map == nullptr) {
gPixelMap *tmap = new gPixelMap;
- tmap->_size = Point16(screenWidth, screenHeight);
+ tmap->_size = Point16(kScreenWidth, kScreenHeight);
tmap->_data = new uint8[tmap->bytes()];
g_vm->_mainPort.setMap(tmap);
}
Commit: 3de1aaa517f16da20bb57c464ac38a4d20621de6
https://github.com/scummvm/scummvm/commit/3de1aaa517f16da20bb57c464ac38a4d20621de6
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-10-29T23:45:59+02:00
Commit Message:
SAGA2: Remove unused constants
Changed paths:
engines/saga2/input.h
diff --git a/engines/saga2/input.h b/engines/saga2/input.h
index 3e30e304850..4e34348c981 100644
--- a/engines/saga2/input.h
+++ b/engines/saga2/input.h
@@ -39,70 +39,6 @@ enum keyQualifiers {
kSpQualifierFunc = (1 << 7) // indicates function key
};
-const int homeKey = (0x47 << 8),
- endKey = (0x4F << 8),
-
- upArrowKey = (0x48 << 8),
- leftArrowKey = (0x4B << 8),
- rightArrowKey = (0x4D << 8),
- downArrowKey = (0x50 << 8),
-
- pageUpKey = (0x49 << 8),
- pageDownKey = (0x51 << 8),
- insertKey = (0x52 << 8),
- deleteKey = (0x53 << 8),
- funcKey1 = (0x3B << 8),
- funcKey2 = (0x3C << 8),
- funcKey3 = (0x3D << 8),
- funcKey4 = (0x3E << 8),
- funcKey5 = (0x3F << 8),
- funcKey6 = (0x40 << 8),
- funcKey7 = (0x41 << 8),
- funcKey8 = (0x42 << 8),
- funcKey9 = (0x43 << 8),
- funcKey10 = (0x44 << 8),
- funcKey11 = (0x85 << 8),
- funcKey12 = (0x86 << 8),
-
- shFuncKey1 = (0x54 << 8),
- shFuncKey2 = (0x55 << 8),
- shFuncKey3 = (0x56 << 8),
- shFuncKey4 = (0x57 << 8),
- shFuncKey5 = (0x58 << 8),
- shFuncKey6 = (0x59 << 8),
- shFuncKey7 = (0x5A << 8),
- shFuncKey8 = (0x5B << 8),
- shFuncKey9 = (0x5C << 8),
- shFuncKey10 = (0x5D << 8),
- shFuncKey11 = (0x87 << 8),
- shFuncKey12 = (0x88 << 8),
-
- altFuncKey1 = (0x68 << 8),
- altFuncKey2 = (0x69 << 8),
- altFuncKey3 = (0x6A << 8),
- altFuncKey4 = (0x6B << 8),
- altFuncKey5 = (0x6C << 8),
- altFuncKey6 = (0x6D << 8),
- altFuncKey7 = (0x6E << 8),
- altFuncKey8 = (0x6F << 8),
- altFuncKey9 = (0x70 << 8),
- altFuncKey10 = (0x71 << 8),
- altFuncKey11 = (0x8B << 8),
- altFuncKey12 = (0x8C << 8),
-
- ctlFuncKey1 = (0x5E << 8),
- ctlFuncKey2 = (0x5F << 8),
- ctlFuncKey3 = (0x60 << 8),
- ctlFuncKey4 = (0x61 << 8),
- ctlFuncKey5 = (0x62 << 8),
- ctlFuncKey6 = (0x63 << 8),
- ctlFuncKey7 = (0x64 << 8),
- ctlFuncKey8 = (0x65 << 8),
- ctlFuncKey9 = (0x66 << 8),
- ctlFuncKey10 = (0x67 << 8),
- ctlFuncKey11 = (0x89 << 8),
- ctlFuncKey12 = (0x8A << 8);
-
struct gMouseState {
Point16 pos;
uint8 right,
Commit: 2d3173b1516d792d181023ad29e7609d2e30fea7
https://github.com/scummvm/scummvm/commit/2d3173b1516d792d181023ad29e7609d2e30fea7
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-10-29T23:46:00+02:00
Commit Message:
SAGA2: Rename rest of constants in the header files
Changed paths:
engines/saga2/actor.cpp
engines/saga2/automap.cpp
engines/saga2/dispnode.cpp
engines/saga2/document.cpp
engines/saga2/gtextbox.cpp
engines/saga2/gtextbox.h
engines/saga2/idtypes.h
engines/saga2/intrface.cpp
engines/saga2/intrface.h
engines/saga2/motion.cpp
engines/saga2/motion.h
engines/saga2/objects.cpp
engines/saga2/path.cpp
engines/saga2/sensor.cpp
engines/saga2/sensor.h
engines/saga2/setup.h
engines/saga2/task.cpp
engines/saga2/tile.cpp
engines/saga2/uidialog.cpp
diff --git a/engines/saga2/actor.cpp b/engines/saga2/actor.cpp
index d81dd711fdc..9389bdb927d 100644
--- a/engines/saga2/actor.cpp
+++ b/engines/saga2/actor.cpp
@@ -2414,11 +2414,11 @@ void Actor::evaluateNeeds() {
if (canSenseActorProperty(
info,
- maxSenseRange,
+ kMaxSenseRange,
kActorPropIDEnemy)
|| canSenseActorPropertyIndirectly(
info,
- maxSenseRange,
+ kMaxSenseRange,
kActorPropIDEnemy)) {
PlayerActorID playerID = _disposition - kDispositionPlayer;
@@ -2478,10 +2478,10 @@ void Actor::evaluateNeeds() {
&& (getAssignment() == nullptr
|| canSenseProtaganist(
info,
- maxSenseRange)
+ kMaxSenseRange)
|| canSenseProtaganistIndirectly(
info,
- maxSenseRange))) {
+ kMaxSenseRange))) {
setGoal(kActorGoalAttackEnemy);
} else {
setGoal(kActorGoalFollowAssignment);
@@ -3099,11 +3099,11 @@ uint8 Actor::evaluateFollowerNeeds(Actor *follower) {
SenseInfo info;
if ((_disposition == kDispositionEnemy
- && follower->canSenseProtaganist(info, maxSenseRange))
+ && follower->canSenseProtaganist(info, kMaxSenseRange))
|| (_disposition >= kDispositionPlayer
&& follower->canSenseActorProperty(
info,
- maxSenseRange,
+ kMaxSenseRange,
kActorPropIDEnemy)))
return kActorGoalAttackEnemy;
diff --git a/engines/saga2/automap.cpp b/engines/saga2/automap.cpp
index abf4baf9f9f..621d924dc2a 100644
--- a/engines/saga2/automap.cpp
+++ b/engines/saga2/automap.cpp
@@ -554,14 +554,14 @@ int16 openAutoMap() {
_summaryData = LoadResource(decRes, MKTAG('S', 'U', 'M', g_vm->_currentMapNum), "summary data");
// get the graphics associated with the buttons
- closeBtnImage = loadButtonRes(decRes, closeButtonResID, numBtnImages);
+ closeBtnImage = loadButtonRes(decRes, closeButtonResID, kNumBtnImages);
scrollBtnImage = loadButtonRes(decRes, scrollButtonResID, 2);
pAutoMap = new AutoMap(autoMapRect, (uint8 *)_summaryData, 0, nullptr);
- new GfxCompButton(*pAutoMap, closeAutoMapBtnRect, closeBtnImage, numBtnImages, 0, cmdAutoMapQuit);
+ new GfxCompButton(*pAutoMap, closeAutoMapBtnRect, closeBtnImage, kNumBtnImages, 0, cmdAutoMapQuit);
- new GfxCompButton(*pAutoMap, scrollBtnRect, scrollBtnImage, numBtnImages, 0, cmdAutoMapScroll);
+ new GfxCompButton(*pAutoMap, scrollBtnRect, scrollBtnImage, kNumBtnImages, 0, cmdAutoMapScroll);
pAutoMap->setDecorations(autoMapDecorations,
ARRAYSIZE(autoMapDecorations),
@@ -579,7 +579,7 @@ int16 openAutoMap() {
// delete stuff
delete pAutoMap;
- unloadImageRes(closeBtnImage, numBtnImages);
+ unloadImageRes(closeBtnImage, kNumBtnImages);
unloadImageRes(scrollBtnImage, 2);
free(_summaryData);
resFile->disposeContext(decRes);
diff --git a/engines/saga2/dispnode.cpp b/engines/saga2/dispnode.cpp
index eda478f02b6..3e25084b2e9 100644
--- a/engines/saga2/dispnode.cpp
+++ b/engines/saga2/dispnode.cpp
@@ -421,7 +421,7 @@ void DisplayNode::drawObject() {
obj->setOnScreen(true);
- if (getCenterActor()->canSenseSpecificObject(info, maxSenseRange, obj->thisID()))
+ if (getCenterActor()->canSenseSpecificObject(info, kMaxSenseRange, obj->thisID()))
obj->setSightedByCenter(true);
else {
obj->setSightedByCenter(false);
@@ -433,7 +433,7 @@ void DisplayNode::drawObject() {
if (--obj->_data.sightCtr == 0) {
SenseInfo info;
- if (getCenterActor()->canSenseSpecificObject(info, maxSenseRange, obj->thisID()))
+ if (getCenterActor()->canSenseSpecificObject(info, kMaxSenseRange, obj->thisID()))
obj->setSightedByCenter(true);
else {
obj->setSightedByCenter(false);
@@ -535,7 +535,7 @@ void DisplayNode::drawObject() {
a->setOnScreen(true);
- if (getCenterActor()->canSenseSpecificActor(info, maxSenseRange, a))
+ if (getCenterActor()->canSenseSpecificActor(info, kMaxSenseRange, a))
a->setSightedByCenter(true);
else {
a->setSightedByCenter(false);
@@ -547,7 +547,7 @@ void DisplayNode::drawObject() {
if (--a->_data.sightCtr == 0) {
SenseInfo info;
- if (getCenterActor()->canSenseSpecificActor(info, maxSenseRange, a))
+ if (getCenterActor()->canSenseSpecificActor(info, kMaxSenseRange, a))
a->setSightedByCenter(true);
else {
a->setSightedByCenter(false);
diff --git a/engines/saga2/document.cpp b/engines/saga2/document.cpp
index 45c0d8a9b96..ce570a1d2eb 100644
--- a/engines/saga2/document.cpp
+++ b/engines/saga2/document.cpp
@@ -738,13 +738,13 @@ int16 openScroll(uint16 textScript) {
decRes = resFile->newContext(MKTAG('S', 'C', 'R', 'L'), "book resources");
// get the graphics associated with the buttons
- closeBtnImage = loadButtonRes(decRes, buttonResID, numBtnImages);
+ closeBtnImage = loadButtonRes(decRes, buttonResID, kNumBtnImages);
// create the window
win = new CDocument(scrollAppearance, bookText, &Script10Font, 0, nullptr);
// make the quit button
- closeScroll = new GfxCompButton(*win, scrollAppearance.closeRect, closeBtnImage, numBtnImages, 0, cmdDocumentQuit);
+ closeScroll = new GfxCompButton(*win, scrollAppearance.closeRect, closeBtnImage, kNumBtnImages, 0, cmdDocumentQuit);
closeScroll->_accelKey = 0x1B;
@@ -759,7 +759,7 @@ int16 openScroll(uint16 textScript) {
delete win;
// unload all image arrays
- unloadImageRes(closeBtnImage, numBtnImages);
+ unloadImageRes(closeBtnImage, kNumBtnImages);
// remove the resource handle
if (decRes)
diff --git a/engines/saga2/gtextbox.cpp b/engines/saga2/gtextbox.cpp
index 3a29c84b713..2eb34279a29 100644
--- a/engines/saga2/gtextbox.cpp
+++ b/engines/saga2/gtextbox.cpp
@@ -188,7 +188,7 @@ gTextBox::gTextBox(
_fontColorBackHilite = BGHLColor;
_cursorColor = CRColor;
_linesPerPage = (box.height / _fontOffset);
- _endLine = clamp(0, (_index + _linesPerPage), numEditLines);
+ _endLine = clamp(0, (_index + _linesPerPage), kNumEditLines);
_oldMark = -1;
_displayOnly = noEditing;
@@ -210,10 +210,10 @@ gTextBox::gTextBox(
_fieldStrings = stringBufs;
// get the size of each string
- for (i = 0; i < numEditLines; i++) {
+ for (i = 0; i < kNumEditLines; i++) {
_exists[i] = ((stringBufs[i][0] & 0x80) == 0);
stringBufs[i][0] &= 0x7F;
- _currentLen[i] = MIN<int>(editLen, strlen(stringBufs[i]));
+ _currentLen[i] = MIN<int>(kEditLen, strlen(stringBufs[i]));
}
_internalBuffer = false;
@@ -427,7 +427,7 @@ void gTextBox::scroll(int8 req) {
int16 visBase = _endLine;
int16 visIndex;
- indexReq = clamp(0, indexReq, numEditLines);
+ indexReq = clamp(0, indexReq, kNumEditLines);
visIndex = (indexReq - (visBase - _linesPerPage));
if (ABS(oldIndex - indexReq) < 2) {
if (visIndex < 0) {
@@ -439,11 +439,11 @@ void gTextBox::scroll(int8 req) {
}
} else {
while (visIndex >= _linesPerPage) {
- visBase = clamp(_linesPerPage, visBase + _linesPerPage, numEditLines);
+ visBase = clamp(_linesPerPage, visBase + _linesPerPage, kNumEditLines);
visIndex = (indexReq - (visBase - _linesPerPage));
}
while (visIndex < 0) {
- visBase = clamp(_linesPerPage, visBase - _linesPerPage, numEditLines);
+ visBase = clamp(_linesPerPage, visBase - _linesPerPage, kNumEditLines);
visIndex = (indexReq - (visBase - _linesPerPage));
}
}
@@ -509,12 +509,12 @@ void gTextBox::reSelect(int which) {
void gTextBox::selectionMove(int howMany) {
int8 newIndex;
- newIndex = clamp(0, _index + howMany, numEditLines - 1);
+ newIndex = clamp(0, _index + howMany, kNumEditLines - 1);
#ifndef ALLOW_BAD_LOADS
if (_displayOnly) {
int i = newIndex;
if (howMany > 0) {
- while (!_exists[i] && i < numEditLines - 1) i++;
+ while (!_exists[i] && i < kNumEditLines - 1) i++;
if (!_exists[i]) {
i = newIndex;
while (!_exists[i] && i > 0) i--;
@@ -525,7 +525,7 @@ void gTextBox::selectionMove(int howMany) {
while (!_exists[i] && i > 0) i--;
if (!_exists[i]) {
i = newIndex;
- while (!_exists[i] && i < numEditLines - 1) i++;
+ while (!_exists[i] && i < kNumEditLines - 1) i++;
}
if (_exists[i])
newIndex = i;
@@ -850,15 +850,15 @@ void gTextBox::handleTimerTick(int32 tick) {
_blinkStart = tick;
return;
}
- if (tick - _blinkStart > blinkTime) {
+ if (tick - _blinkStart > kBlinkTime) {
gPort &port = _window._windowPort;
SAVE_GPORT_STATE(port); // save pen color, etc.
g_vm->_pointer->hide(port, _extent); // hide mouse pointer
port.setPenMap(port._penMap);
port.setStyle(0);
- port.setColor(_blinkState ? blinkColor0 : blinkColor1);
- port.fillRect(_editRect.x + _blinkX - ((blinkWide + 1) / 2), _editRect.y + 1, blinkWide, _editRect.height - 1);
+ port.setColor(_blinkState ? kBlinkColor0 : kBlinkColor1);
+ port.fillRect(_editRect.x + _blinkX - ((kBlinkWide + 1) / 2), _editRect.y + 1, kBlinkWide, _editRect.height - 1);
g_vm->_pointer->show(port, _extent); // show mouse pointer
@@ -898,10 +898,10 @@ void gTextBox::drawContents() {
anchorX = 0,
_hiliteX,
_hiliteWidth,
- textHeight_;
+ kTextHeight_;
- textHeight_ = _fontHeight;
+ kTextHeight_ = _fontHeight;
if (_hilit || _editing) {
@@ -968,7 +968,7 @@ void gTextBox::drawContents() {
tPort.setFont(_textFont);
tPort.setColor(_fontColorHilite);
- tPort.moveTo(-_scrollPixels, (_editRect.height - textHeight_ + 1) / 2);
+ tPort.moveTo(-_scrollPixels, (_editRect.height - kTextHeight_ + 1) / 2);
tPort.drawText(_fieldStrings[_index], _currentLen[_index]);
// Blit the pixelmap to the main screen
@@ -1066,13 +1066,13 @@ void gTextBox::drawAll(gPort &port,
for (i = (_endLine - _linesPerPage); i < _endLine; i++) {
- assert(i >= 0 && i <= numEditLines);
+ assert(i >= 0 && i <= kNumEditLines);
// move to new text pos
tempPort.moveTo(workRect.x, workRect.y);
// pen color black
- tempPort.setColor(((i != _index) && _exists[i]) ? _fontColorFore : textDisable);
+ tempPort.setColor(((i != _index) && _exists[i]) ? _fontColorFore : kTextDisable);
// draw the text
tempPort.drawText(_fieldStrings[i]);
diff --git a/engines/saga2/gtextbox.h b/engines/saga2/gtextbox.h
index 12401ed8097..e054b20e3a0 100644
--- a/engines/saga2/gtextbox.h
+++ b/engines/saga2/gtextbox.h
@@ -38,20 +38,20 @@ enum textBoxFlags {
};
// edit box defines
-const int editLen = 35;
-const int numEditLines = 50;
-const int textPen = 12;
-const int textDisable = 14;
-const int textHilite = 11;
-const int textBackground = 87;
-const int textBackHilite = 211;
-const int cursorColor = 174;
-const int textHeight = 10;
-
-const int32 blinkTime = 72 / 6;
-const int16 blinkColor0 = 137;
-const int16 blinkColor1 = 232;
-const int16 blinkWide = 1;
+const int kEditLen = 35;
+const int kNumEditLines = 50;
+const int kTextPen = 12;
+const int kTextDisable = 14;
+const int kTextHilite = 11;
+const int kTextBackground = 87;
+const int kTextBackHilite = 211;
+const int kCursorColor = 174;
+const int kTextHeight = 10;
+
+const int32 kBlinkTime = 72 / 6;
+const int16 kBlinkColor0 = 137;
+const int16 kBlinkColor1 = 232;
+const int16 kBlinkWide = 1;
extern StaticRect editBaseRect;
@@ -70,8 +70,8 @@ private:
// editor values
uint16 _maxLen,
- _currentLen[numEditLines],
- _exists[numEditLines],
+ _currentLen[kNumEditLines],
+ _exists[kNumEditLines],
_undoLen,
_cursorPos,
_anchorPos,
diff --git a/engines/saga2/idtypes.h b/engines/saga2/idtypes.h
index 3ca045fe9b6..6882374ce46 100644
--- a/engines/saga2/idtypes.h
+++ b/engines/saga2/idtypes.h
@@ -110,11 +110,11 @@ extern const StaticMetaTileID NoMetaTile;
ActiveItemID struct
* ===================================================================== */
-const int activeItemIndexMask = 0x1FFF;
-const int activeItemMapMask = 0xE000;
-const int activeItemMapShift = 13;
+const int kActiveItemIndexMask = 0x1FFF;
+const int kActiveItemMapMask = 0xE000;
+const int kActiveItemMapShift = 13;
-const int16 activeItemIndexNullID = 0x1FFF;
+const int16 kActiveItemIndexNullID = 0x1FFF;
struct StaticActiveItemID {
int16 val;
@@ -138,7 +138,7 @@ struct ActiveItemID {
// Constructor
ActiveItemID(int16 m, int16 i) :
- val((m << activeItemMapShift) | (i & activeItemIndexMask)) {
+ val((m << kActiveItemMapShift) | (i & kActiveItemIndexMask)) {
}
ActiveItemID(StaticActiveItemID a) {
@@ -168,21 +168,21 @@ struct ActiveItemID {
}
void setMapNum(int16 m) {
- val &= ~activeItemMapMask;
- val |= (m << activeItemMapShift);
+ val &= ~kActiveItemMapMask;
+ val |= (m << kActiveItemMapShift);
}
int16 getMapNum() {
- return (uint16)val >> activeItemMapShift;
+ return (uint16)val >> kActiveItemMapShift;
}
void setIndexNum(int16 i) {
- val &= ~activeItemIndexMask;
- val |= i & activeItemIndexMask;
+ val &= ~kActiveItemIndexMask;
+ val |= i & kActiveItemIndexMask;
}
int16 getIndexNum() {
- return val & activeItemIndexMask;
+ return val & kActiveItemIndexMask;
}
} PACKED_STRUCT;
#include "common/pack-end.h"
diff --git a/engines/saga2/intrface.cpp b/engines/saga2/intrface.cpp
index 15ad23de78c..421bce8f528 100644
--- a/engines/saga2/intrface.cpp
+++ b/engines/saga2/intrface.cpp
@@ -700,14 +700,14 @@ CMassWeightIndicator::CMassWeightIndicator(gPanelList *panel, const Point16 &pos
// setup mass/bulk indicator imagery
if (death) {
- _massBulkImag = g_vm->_imageCache->requestImage(_containerRes, MKTAG('D', 'J', 'B', massBulkResNum));
+ _massBulkImag = g_vm->_imageCache->requestImage(_containerRes, MKTAG('D', 'J', 'B', kMassBulkResNum));
- _pieIndImag = loadImageRes(_containerRes, pieIndResNum, numPieIndImages, 'D', 'A', 'J');
+ _pieIndImag = loadImageRes(_containerRes, kPieIndResNum, kNumPieIndImages, 'D', 'A', 'J');
} else {
- _massBulkImag = g_vm->_imageCache->requestImage(_containerRes, MKTAG('G', 'J', 'B', massBulkResNum));
+ _massBulkImag = g_vm->_imageCache->requestImage(_containerRes, MKTAG('G', 'J', 'B', kMassBulkResNum));
- _pieIndImag = loadImageRes(_containerRes, pieIndResNum, numPieIndImages, 'G', 'A', 'J');
+ _pieIndImag = loadImageRes(_containerRes, kPieIndResNum, kNumPieIndImages, 'G', 'A', 'J');
}
// attach controls to the indivControls panel
@@ -715,7 +715,7 @@ CMassWeightIndicator::CMassWeightIndicator(gPanelList *panel, const Point16 &pos
_pieMass = new GfxCompImage(*panel,
Rect16(_massPiePos.x, _massPiePos.y, kPieXSize, kPieYSize),
_pieIndImag,
- numPieIndImages,
+ kNumPieIndImages,
0,
type,
cmdMassInd);
@@ -723,7 +723,7 @@ CMassWeightIndicator::CMassWeightIndicator(gPanelList *panel, const Point16 &pos
_pieBulk = new GfxCompImage(*panel,
Rect16(_bulkPiePos.x, _bulkPiePos.y, kPieXSize, kPieYSize),
_pieIndImag,
- numPieIndImages,
+ kNumPieIndImages,
0,
type,
cmdBulkInd);
@@ -757,7 +757,7 @@ CMassWeightIndicator::CMassWeightIndicator(gPanelList *panel, const Point16 &pos
CMassWeightIndicator::~CMassWeightIndicator() {
g_vm->_indList.remove(this);
- unloadImageRes(_pieIndImag, numPieIndImages);
+ unloadImageRes(_pieIndImag, kNumPieIndImages);
g_vm->_imageCache->releaseImage(_massBulkImag);
}
@@ -1536,19 +1536,19 @@ void SetupUserControls() {
// set up the control button images
- aggressImag = loadButtonRes(imageRes, aggressResNum, numBtnImages);
+ aggressImag = loadButtonRes(imageRes, kAggressResNum, kNumBtnImages);
- centerImag = loadButtonRes(imageRes, centerResNum, numBtnImages);
- bandingImag = loadButtonRes(imageRes, bandingResNum, numBtnImages);
- menConBtnImag = loadButtonRes(imageRes, menConBtnResNum, numBtnImages);
+ centerImag = loadButtonRes(imageRes, kCenterResNum, kNumBtnImages);
+ bandingImag = loadButtonRes(imageRes, kBandingResNum, kNumBtnImages);
+ menConBtnImag = loadButtonRes(imageRes, kMenConBtnResNum, kNumBtnImages);
// setup the options button imagery
- optBtnImag = loadButtonRes(imageRes, optBtnResNum, numBtnImages);
+ optBtnImag = loadButtonRes(imageRes, kOptBtnResNum, kNumBtnImages);
// setup the brother selector button imagery and button frame
- julBtnImag = loadButtonRes(imageRes, julBtnResNum, numBtnImages);
- phiBtnImag = loadButtonRes(imageRes, phiBtnResNum, numBtnImages);
- kevBtnImag = loadButtonRes(imageRes, kevBtnResNum, numBtnImages);
+ julBtnImag = loadButtonRes(imageRes, kJulBtnResNum, kNumBtnImages);
+ phiBtnImag = loadButtonRes(imageRes, kPhiBtnResNum, kNumBtnImages);
+ kevBtnImag = loadButtonRes(imageRes, kKevBtnResNum, kNumBtnImages);
broBtnFrameImag = g_vm->_imageCache->requestImage(imageRes, MKTAG('F', 'R', 'A', 'M'));
@@ -1570,12 +1570,12 @@ void SetupUserControls() {
// set up the portrait button images
for (n = 0; n < kNumViews; n++) {
- portImag[n] = loadButtonRes(imageRes, portResNum[n], numPortImages, broNames[n].a, broNames[n].b, broNames[n].c);
+ portImag[n] = loadButtonRes(imageRes, portResNum[n], kNumPortImages, broNames[n].a, broNames[n].b, broNames[n].c);
}
// setup stand alone controls
- optBtn = new GfxCompButton(*playControls, optBtnRect, optBtnImag, numBtnImages, 0, cmdOptions);
+ optBtn = new GfxCompButton(*playControls, optBtnRect, optBtnImag, kNumBtnImages, 0, cmdOptions);
enchDisp = new gEnchantmentDisplay(*playControls, 0);
@@ -1583,13 +1583,13 @@ void SetupUserControls() {
for (n = 0; n < kNumViews; n++) {
// portrait button
portBtns[n] = new GfxMultCompButton(*trioControls, views[n][index++],
- portImag[n], numPortImages, 0, false, brotherIDs[n], cmdPortrait);
+ portImag[n], kNumPortImages, 0, false, brotherIDs[n], cmdPortrait);
portBtns[n]->setMousePoll(true);
// aggressive button
aggressBtns[n] = new GfxOwnerSelCompButton(*trioControls, views[n][index++],
- aggressImag, numBtnImages, brotherIDs[n], cmdAggressive);
+ aggressImag, kNumBtnImages, brotherIDs[n], cmdAggressive);
// name plates that go under the portraits
armorInd[n] = new gArmorIndicator(*trioControls, views[n][index++],
@@ -1597,11 +1597,11 @@ void SetupUserControls() {
// center on brother
centerBtns[n] = new GfxOwnerSelCompButton(*trioControls, views[n][index++],
- centerImag, numBtnImages, brotherIDs[n], cmdCenter);
+ centerImag, kNumBtnImages, brotherIDs[n], cmdCenter);
// banding
bandingBtns[n] = new GfxOwnerSelCompButton(*trioControls, views[n][index++],
- bandingImag, numBtnImages, brotherIDs[n], cmdBand);
+ bandingImag, kNumBtnImages, brotherIDs[n], cmdBand);
// name plates that go under the portraits
namePlates[n] = new GfxCompImage(*trioControls, views[n][index++],
@@ -1618,22 +1618,22 @@ void SetupUserControls() {
// portrait button
indivPortBtn = new GfxMultCompButton(*indivControls, views[0][index++],
- portImag[0], numPortImages, 0, false, kUiIndiv, cmdPortrait);
+ portImag[0], kNumPortImages, 0, false, kUiIndiv, cmdPortrait);
indivPortBtn->setMousePoll(true);
// aggressive button
indivAggressBtn = new GfxOwnerSelCompButton(*indivControls, views[0][index++],
- aggressImag, numBtnImages, kUiIndiv, cmdAggressive);
+ aggressImag, kNumBtnImages, kUiIndiv, cmdAggressive);
indivArmorInd = new gArmorIndicator(*indivControls, views[0][index++],
armorImag, kUiIndiv, cmdArmor);
// center on brother
indivCenterBtn = new GfxOwnerSelCompButton(*indivControls, views[0][index++],
- centerImag, numBtnImages, kUiIndiv, cmdCenter);
+ centerImag, kNumBtnImages, kUiIndiv, cmdCenter);
// banding
indivBandingBtn = new GfxOwnerSelCompButton(*indivControls, views[0][index++],
- bandingImag, numBtnImages, kUiIndiv, cmdBand);
+ bandingImag, kNumBtnImages, kUiIndiv, cmdBand);
// name plates that go under the portraits
indivNamePlate = new GfxCompImage(*indivControls, views[0][index++],
@@ -1646,17 +1646,17 @@ void SetupUserControls() {
// setup the portrait object
Portrait = new CPortrait(portBtns, // portrait _buttons
indivPortBtn,
- numPortImages,// num of images per button
+ kNumPortImages,// num of images per button
kNumViews); // number of brothers
// mental container button
- menConBtn = new GfxCompButton(*indivControls, menConBtnRect, menConBtnImag, numBtnImages, kUiIndiv, cmdBrain);
+ menConBtn = new GfxCompButton(*indivControls, menConBtnRect, menConBtnImag, kNumBtnImages, kUiIndiv, cmdBrain);
// brother selection _buttons >>> need to replace these with sticky _buttons
- julBtn = new GfxOwnerSelCompButton(*indivControls, julBtnRect, julBtnImag, numBtnImages, kUiJulian, cmdBroChange);
- phiBtn = new GfxOwnerSelCompButton(*indivControls, phiBtnRect, phiBtnImag, numBtnImages, kUiPhillip, cmdBroChange);
- kevBtn = new GfxOwnerSelCompButton(*indivControls, kevBtnRect, kevBtnImag, numBtnImages, kUiKevin, cmdBroChange);
+ julBtn = new GfxOwnerSelCompButton(*indivControls, julBtnRect, julBtnImag, kNumBtnImages, kUiJulian, cmdBroChange);
+ phiBtn = new GfxOwnerSelCompButton(*indivControls, phiBtnRect, phiBtnImag, kNumBtnImages, kUiPhillip, cmdBroChange);
+ kevBtn = new GfxOwnerSelCompButton(*indivControls, kevBtnRect, kevBtnImag, kNumBtnImages, kUiKevin, cmdBroChange);
// frame for brother _buttons
broBtnFrame = new GfxCompImage(*indivControls, broBtnRect, broBtnFrameImag, kUiIndiv, nullptr);
@@ -1696,25 +1696,25 @@ void CleanupButtonImages() {
int16 i;
// deallocates the images in the array and the arrays themselves
- unloadImageRes(aggressImag, numBtnImages);
-// unloadImageRes( jumpImag , numBtnImages );
- unloadImageRes(centerImag, numBtnImages);
- unloadImageRes(bandingImag, numBtnImages);
- unloadImageRes(menConBtnImag, numBtnImages);
+ unloadImageRes(aggressImag, kNumBtnImages);
+// unloadImageRes( jumpImag , kNumBtnImages );
+ unloadImageRes(centerImag, kNumBtnImages);
+ unloadImageRes(bandingImag, kNumBtnImages);
+ unloadImageRes(menConBtnImag, kNumBtnImages);
// dealloc the imag for the option button
- unloadImageRes(optBtnImag, numBtnImages);
+ unloadImageRes(optBtnImag, kNumBtnImages);
// dealloc brother's indiv mode _buttons
- unloadImageRes(julBtnImag, numBtnImages);
- unloadImageRes(phiBtnImag, numBtnImages);
- unloadImageRes(kevBtnImag, numBtnImages);
+ unloadImageRes(julBtnImag, kNumBtnImages);
+ unloadImageRes(phiBtnImag, kNumBtnImages);
+ unloadImageRes(kevBtnImag, kNumBtnImages);
// portraits
for (i = 0; i < kNumViews; i++) {
- unloadImageRes(portImag[i], numPortImages);
+ unloadImageRes(portImag[i], kNumPortImages);
}
// name plate frame
diff --git a/engines/saga2/intrface.h b/engines/saga2/intrface.h
index 52635f3658e..2c5daadb639 100644
--- a/engines/saga2/intrface.h
+++ b/engines/saga2/intrface.h
@@ -148,28 +148,28 @@ enum uiBrotherName {
};
// compressed button resource indexes
-const int16 aggressResNum = 0;
-const int16 jumpResNum = 6;
-const int16 centerResNum = 4;
-const int16 bandingResNum = 2;
-const int16 menConBtnResNum = 18;
-const int16 massBulkResNum = 0;
-const int16 pieIndResNum = 0;
-const int16 julBtnResNum = 22;
-const int16 phiBtnResNum = 24;
-const int16 kevBtnResNum = 26;
-const int16 optBtnResNum = 20;
+const int16 kAggressResNum = 0;
+const int16 kJumpResNum = 6;
+const int16 kCenterResNum = 4;
+const int16 kBandingResNum = 2;
+const int16 kMenConBtnResNum = 18;
+const int16 kMassBulkResNum = 0;
+const int16 kPieIndResNum = 0;
+const int16 kJulBtnResNum = 22;
+const int16 kPhiBtnResNum = 24;
+const int16 kKevBtnResNum = 26;
+const int16 kOptBtnResNum = 20;
// standard number of images for push-buttons
-const int16 numBtnImages = 2;
+const int16 kNumBtnImages = 2;
// standard number of images for portraits
-const uint16 numPortImages = 8;
+const uint16 kNumPortImages = 8;
// number for pie indicators
-const uint16 numPieIndImages = 16;
+const uint16 kNumPieIndImages = 16;
// object pointers
extern CPortrait *Portrait;
diff --git a/engines/saga2/motion.cpp b/engines/saga2/motion.cpp
index d7f4ed473d1..51b52bdd285 100644
--- a/engines/saga2/motion.cpp
+++ b/engines/saga2/motion.cpp
@@ -1144,7 +1144,7 @@ void MotionTask::calcVelocity(const TilePoint &vector, int16 turns) {
_uErrorTerm = 0;
_vErrorTerm = 0;
- veloc.z = ((gravity * turns) >> 1) + vector.z / turns;
+ veloc.z = ((kGravity * turns) >> 1) + vector.z / turns;
_velocity = veloc;
}
@@ -2052,10 +2052,10 @@ void MotionTask::ballisticAction() {
// Add the force of gravity to the acceleration.
if (!(_flags & kMfInWater)) {
- _velocity.z -= gravity;
+ _velocity.z -= kGravity;
} else {
_velocity.u = _velocity.v = 0;
- _velocity.z = -gravity;
+ _velocity.z = -kGravity;
}
location = obj->getLocation();
@@ -2374,10 +2374,10 @@ bool MotionTask::checkWalk(
void MotionTask::walkAction() {
enum WalkType {
- walkNormal = 0,
- walkSlow,
- walkRun,
- walkStairs
+ kWalkNormal = 0,
+ kWalkSlow,
+ kWalkRun,
+ kWalkStairs
};
TilePoint immediateTarget = getImmediateTarget(),
@@ -2387,7 +2387,7 @@ void MotionTask::walkAction() {
int16 movementDirection,
directionAngle;
int16 moveBlocked,
- speed = walkSpeed,
+ speed = kWalkSpeed,
speedScale = 2;
Actor *a;
ActorAppearance *aa;
@@ -2395,7 +2395,7 @@ void MotionTask::walkAction() {
bool moveTaskWaiting = false,
moveTaskDone = false;
- WalkType walkType = walkNormal;
+ WalkType walkType = kWalkNormal;
assert(isActor(_object));
a = (Actor *)_object;
@@ -2414,31 +2414,31 @@ void MotionTask::walkAction() {
if (_flags & kMfRequestRun
&& _runCount == 0
&& !(_flags & (kMfInWater | kMfOnStairs))) {
- speed = runSpeed;
+ speed = kRunSpeed;
speedScale = 4;
- walkType = walkRun;
+ walkType = kWalkRun;
// If we can see this actor, and the actor's run frames
// have not been loaded, then downgrade this action to
// a walk (but request the run frames).
if (aa && !aa->isBankLoaded(kSprRunBankNum)) {
- walkType = walkNormal;
+ walkType = kWalkNormal;
aa->requestBank(kSprRunBankNum);
}
}
// If for some reason we cannot run at this time, then
// set up for a walk instead.
- if (walkType != walkRun) {
+ if (walkType != kWalkRun) {
if (!(_flags & kMfOnStairs)) {
if (!(_flags & kMfInWater)) {
- speed = walkSpeed;
+ speed = kWalkSpeed;
speedScale = 2;
- walkType = walkNormal;
+ walkType = kWalkNormal;
} else {
- speed = slowWalkSpeed;
+ speed = kSlowWalkSpeed;
speedScale = 1;
- walkType = walkSlow;
+ walkType = kWalkSlow;
// reset run count if actor walking slowly
_runCount = MAX<int16>(_runCount, 8);
@@ -2452,9 +2452,9 @@ void MotionTask::walkAction() {
return;
}
} else {
- speed = slowWalkSpeed;
+ speed = kSlowWalkSpeed;
speedScale = 1;
- walkType = walkStairs;
+ walkType = kWalkStairs;
// reset run count if actor walking on stairs
_runCount = MAX<int16>(_runCount, 8);
@@ -2783,13 +2783,13 @@ void MotionTask::walkAction() {
_flags |= kMfOnStairs;
} else {
_flags &= ~kMfOnStairs;
- if (walkType == walkStairs) walkType = walkNormal;
- newAction = (walkType == walkRun) ? kActionRun : kActionWalk;
+ if (walkType == kWalkStairs) walkType = kWalkNormal;
+ newAction = (walkType == kWalkRun) ? kActionRun : kActionWalk;
}
} else {
_flags &= ~kMfOnStairs;
- if (walkType == walkStairs) walkType = walkNormal;
- newAction = (walkType == walkRun) ? kActionRun : kActionWalk;
+ if (walkType == kWalkStairs) walkType = kWalkNormal;
+ newAction = (walkType == kWalkRun) ? kActionRun : kActionWalk;
}
@@ -2801,7 +2801,7 @@ void MotionTask::walkAction() {
if (a->_currentAnimation == newAction) {
// If we are already doing that action, then
// just continue doing it.
- if (walkType != walkSlow)
+ if (walkType != kWalkSlow)
a->nextAnimationFrame();
else {
if (_flags & kMfNextAnim)
@@ -2818,7 +2818,7 @@ void MotionTask::walkAction() {
a->setAction(newAction,
kAnimateRepeat | kAnimateNoRestart);
- if (walkType != walkSlow)
+ if (walkType != kWalkSlow)
a->nextAnimationFrame();
else {
if (_flags & kMfNextAnim)
@@ -2829,7 +2829,7 @@ void MotionTask::walkAction() {
// If we weren't walking or running before, then start
// walking/running and reset the sequence.
a->setAction(newAction, kAnimateRepeat);
- if (walkType == walkSlow) _flags |= kMfNextAnim;
+ if (walkType == kWalkSlow) _flags |= kMfNextAnim;
}
if (_runCount > 0) _runCount--;
@@ -4560,7 +4560,7 @@ bool MotionTask::freeFall(TilePoint &newPos, StandingTileInfo &sti) {
// If terrain is HIGHER (or even sligtly lower) than we are
// currently at, then try climbing it.
- if (tHeight >= newPos.z - gravity * 4) {
+ if (tHeight >= newPos.z - kGravity * 4) {
supported:
if (_motionType != kMotionTypeWalk
|| tHeight <= newPos.z
@@ -4591,7 +4591,7 @@ supported:
if (checkContact(_object, tPos) == kBlockageNone) {
falling:
if (_motionType != kMotionTypeWalk
- || newPos.z > gravity * 4
+ || newPos.z > kGravity * 4
|| tHeight >= 0) {
_motionType = kMotionTypeThrown;
@@ -4637,7 +4637,7 @@ falling:
tPos.u += objCrossSection;
tHeight = tileSlopeHeight(tPos, _object, &sti);
if (tHeight <= tPos.z + kMaxStepHeight
- && tHeight >= tPos.z - gravity * 4) {
+ && tHeight >= tPos.z - kGravity * 4) {
newPos = tPos;
goto supported;
}
@@ -4645,7 +4645,7 @@ falling:
tPos.u -= objCrossSection * 2;
tHeight = tileSlopeHeight(tPos, _object, &sti);
if (tHeight <= tPos.z + kMaxStepHeight
- && tHeight >= tPos.z - gravity * 4) {
+ && tHeight >= tPos.z - kGravity * 4) {
newPos = tPos;
goto supported;
}
@@ -4654,7 +4654,7 @@ falling:
tPos.v += objCrossSection;
tHeight = tileSlopeHeight(tPos, _object, &sti);
if (tHeight <= tPos.z + kMaxStepHeight
- && tHeight >= tPos.z - gravity * 4) {
+ && tHeight >= tPos.z - kGravity * 4) {
newPos = tPos;
goto supported;
}
@@ -4662,7 +4662,7 @@ falling:
tPos.v -= objCrossSection * 2;
tHeight = tileSlopeHeight(tPos, _object, &sti);
if (tHeight <= tPos.z + kMaxStepHeight
- && tHeight >= tPos.z - gravity * 4) {
+ && tHeight >= tPos.z - kGravity * 4) {
newPos = tPos;
goto supported;
}
diff --git a/engines/saga2/motion.h b/engines/saga2/motion.h
index 49b8b96d38c..0fea8bbd647 100644
--- a/engines/saga2/motion.h
+++ b/engines/saga2/motion.h
@@ -37,13 +37,13 @@ extern const StaticTilePoint dirTable[];
extern const StaticTilePoint incDirTable[];
-const int gravity = 2;
-const int walkSpeed = 4;
-const int slowWalkSpeed = 2;
-const int runSpeed = 8;
-const int walkSpeedDiag = 3;
-const int runSpeedDiag = 6;
-const int angleThresh = 24;
+const int kGravity = 2;
+const int kWalkSpeed = 4;
+const int kSlowWalkSpeed = 2;
+const int kRunSpeed = 8;
+const int kWalkSpeedDiag = 3;
+const int kRunSpeedDiag = 6;
+const int kAngleThresh = 24;
enum MotionThreadReturnValues {
kMotionInterrupted, // MotionTask has been rudely
diff --git a/engines/saga2/objects.cpp b/engines/saga2/objects.cpp
index 0673920708c..3852cd8836b 100644
--- a/engines/saga2/objects.cpp
+++ b/engines/saga2/objects.cpp
@@ -1537,7 +1537,7 @@ void GameObject::updateState() {
unstickObject(this);
tHeight = tileSlopeHeight(_data.location, this, &sti);
}
- if (tHeight >= _data.location.z - gravity * 4) {
+ if (tHeight >= _data.location.z - kGravity * 4) {
setObjectSurface(this, sti);
_data.location.z = tHeight;
return;
@@ -1846,7 +1846,7 @@ void GameObject::senseEvent(
// Add a new timer to this objects's timer list
bool GameObject::addTimer(TimerID id) {
- return addTimer(id, sensorCheckRate);
+ return addTimer(id, kSensorCheckRate);
}
//-----------------------------------------------------------------------
@@ -2127,7 +2127,7 @@ bool GameObject::canSenseProtaganist(SenseInfo &info, int16 range) {
Actor *a = (Actor *) this;
return sensor.check(info, a->_enchantmentFlags);
}
- return sensor.check(info, nonActorSenseFlags);
+ return sensor.check(info, kNonActorSenseFlags);
}
//-----------------------------------------------------------------------
@@ -2144,7 +2144,7 @@ bool GameObject::canSenseSpecificActor(
Actor *ac = (Actor *)this;
return sensor.check(info, ac->_enchantmentFlags);
}
- return sensor.check(info, nonActorSenseFlags);
+ return sensor.check(info, kNonActorSenseFlags);
}
//-----------------------------------------------------------------------
@@ -2161,7 +2161,7 @@ bool GameObject::canSenseSpecificObject(
Actor *a = (Actor *) this;
return sensor.check(info, a->_enchantmentFlags);
}
- return sensor.check(info, nonActorSenseFlags);
+ return sensor.check(info, kNonActorSenseFlags);
}
//-----------------------------------------------------------------------
@@ -2178,7 +2178,7 @@ bool GameObject::canSenseActorProperty(
Actor *a = (Actor *) this;
return sensor.check(info, a->_enchantmentFlags);
}
- return sensor.check(info, nonActorSenseFlags);
+ return sensor.check(info, kNonActorSenseFlags);
}
//-----------------------------------------------------------------------
@@ -2195,7 +2195,7 @@ bool GameObject::canSenseObjectProperty(
Actor *a = (Actor *) this;
return sensor.check(info, a->_enchantmentFlags);
}
- return sensor.check(info, nonActorSenseFlags);
+ return sensor.check(info, kNonActorSenseFlags);
}
//-------------------------------------------------------------------
diff --git a/engines/saga2/path.cpp b/engines/saga2/path.cpp
index 1b5f52e83f9..a3b96a02f3d 100644
--- a/engines/saga2/path.cpp
+++ b/engines/saga2/path.cpp
@@ -371,7 +371,7 @@ void PathTileRegion::fetchSubMeta(const TilePoint &subMeta) {
TileRegion subMetaTag;
TileRef *stateData;
- assert((uint16)tr->tile <= activeItemIndexNullID);
+ assert((uint16)tr->tile <= kActiveItemIndexNullID);
groupItem = ActiveItem::activeItemAddress(
ActiveItemID(_mapNum, tr->tile));
diff --git a/engines/saga2/sensor.cpp b/engines/saga2/sensor.cpp
index 0938ece3840..2c0505d899f 100644
--- a/engines/saga2/sensor.cpp
+++ b/engines/saga2/sensor.cpp
@@ -59,7 +59,7 @@ void deleteSensorList(SensorList *s) {
void newSensor(Sensor *s) {
g_vm->_sensorList.push_back(s);
- s->_checkCtr = sensorCheckRate;
+ s->_checkCtr = kSensorCheckRate;
}
//----------------------------------------------------------------------
@@ -153,7 +153,7 @@ void checkSensors() {
SenseInfo info;
GameObject *senseobj = sensor->getObject();
- uint32 sFlags = nonActorSenseFlags;
+ uint32 sFlags = kNonActorSenseFlags;
if (isActor(senseobj)) {
Actor *a = (Actor *)senseobj;
sFlags = a->_enchantmentFlags;
@@ -166,7 +166,7 @@ void checkSensors() {
sensor->getObject()->senseObject(sensor->thisID(), info.sensedObject->thisID());
}
- sensor->_checkCtr = sensorCheckRate;
+ sensor->_checkCtr = kSensorCheckRate;
}
}
@@ -200,12 +200,12 @@ void assertEvent(const GameEvent &ev) {
void initSensors() {
// Nothing to do
- assert(sizeof(ProtaganistSensor) <= maxSensorSize);
- assert(sizeof(SpecificObjectSensor) <= maxSensorSize);
- assert(sizeof(ObjectPropertySensor) <= maxSensorSize);
- assert(sizeof(SpecificActorSensor) <= maxSensorSize);
- assert(sizeof(ActorPropertySensor) <= maxSensorSize);
- assert(sizeof(EventSensor) <= maxSensorSize);
+ assert(sizeof(ProtaganistSensor) <= kMaxSensorSize);
+ assert(sizeof(SpecificObjectSensor) <= kMaxSensorSize);
+ assert(sizeof(ObjectPropertySensor) <= kMaxSensorSize);
+ assert(sizeof(SpecificActorSensor) <= kMaxSensorSize);
+ assert(sizeof(ActorPropertySensor) <= kMaxSensorSize);
+ assert(sizeof(EventSensor) <= kMaxSensorSize);
}
static int getSensorListID(SensorList *t) {
diff --git a/engines/saga2/sensor.h b/engines/saga2/sensor.h
index ad5b6683c6f..3ad801b5ae2 100644
--- a/engines/saga2/sensor.h
+++ b/engines/saga2/sensor.h
@@ -28,14 +28,14 @@
namespace Saga2 {
-const uint32 nonActorSenseFlags = kActorSeeInvis;
+const uint32 kNonActorSenseFlags = kActorSeeInvis;
//const size_t maxSensorSize = 24;
-const size_t maxSensorSize = 48;
+const size_t kMaxSensorSize = 48;
// This constant represents the maximum sense range for an object.
// Zero means an infinite range.
-const int16 maxSenseRange = 0;
+const int16 kMaxSenseRange = 0;
// Integers representing sensor types
enum SensorType {
@@ -48,7 +48,7 @@ enum SensorType {
};
// Sensors will be checked every 5 frames
-const int16 sensorCheckRate = 5;
+const int16 kSensorCheckRate = 5;
/* ===================================================================== *
Function prototypes
diff --git a/engines/saga2/setup.h b/engines/saga2/setup.h
index b2aae35eb16..aa6746eee36 100644
--- a/engines/saga2/setup.h
+++ b/engines/saga2/setup.h
@@ -82,9 +82,6 @@ enum borderIDs {
kMWRightBorder3
};
-const int extraObjects = 512,
- extraActors = 64;
-
} // end of namespace Saga2
#endif
diff --git a/engines/saga2/task.cpp b/engines/saga2/task.cpp
index d4969df20ed..eac253a7c35 100644
--- a/engines/saga2/task.cpp
+++ b/engines/saga2/task.cpp
@@ -1462,11 +1462,11 @@ bool GotoObjectTargetTask::lineOfSight() {
|| ABS(_targetLoc.z - _lastTestedLoc.z) > 25) {
if (a->canSenseSpecificObject(
info,
- maxSenseRange,
+ kMaxSenseRange,
targetID)
|| a->canSenseSpecificObjectIndirectly(
info,
- maxSenseRange,
+ kMaxSenseRange,
targetID))
_flags |= kInSight;
else
@@ -1480,11 +1480,11 @@ bool GotoObjectTargetTask::lineOfSight() {
_sightCtr = kSightRate;
if (a->canSenseSpecificObject(
info,
- maxSenseRange,
+ kMaxSenseRange,
targetID)
|| a->canSenseSpecificObjectIndirectly(
info,
- maxSenseRange,
+ kMaxSenseRange,
targetID))
_flags |= kInSight;
else
@@ -2409,11 +2409,11 @@ void HuntToBeNearObjectTask::evaluateTarget() {
if (a->canSenseSpecificObject(
info,
- maxSenseRange,
+ kMaxSenseRange,
objID)
|| a->canSenseSpecificObjectIndirectly(
info,
- maxSenseRange,
+ kMaxSenseRange,
objID)) {
_currentTarget = objArray[i];
break;
@@ -2538,11 +2538,11 @@ void HuntToPossessTask::evaluateTarget() {
if (a->canSenseSpecificObject(
info,
- maxSenseRange,
+ kMaxSenseRange,
objID)
|| a->canSenseSpecificObjectIndirectly(
info,
- maxSenseRange,
+ kMaxSenseRange,
objID)) {
_currentTarget = objArray[i];
break;
@@ -2793,11 +2793,11 @@ void HuntToBeNearActorTask::evaluateTarget() {
if (tracking()
|| a->canSenseSpecificActor(
info,
- maxSenseRange,
+ kMaxSenseRange,
_actorArray[i])
|| a->canSenseSpecificActorIndirectly(
info,
- maxSenseRange,
+ kMaxSenseRange,
_actorArray[i])) {
if (_currentTarget != _actorArray[i]) {
if (atTarget()) atTargetabortTask();
@@ -3033,11 +3033,11 @@ void HuntToKillTask::evaluateTarget() {
if (tracking()
|| a->canSenseSpecificActor(
info,
- maxSenseRange,
+ kMaxSenseRange,
_actorArray[i])
|| a->canSenseSpecificActorIndirectly(
info,
- maxSenseRange,
+ kMaxSenseRange,
_actorArray[i])) {
bestTarget = _actorArray[i];
break;
@@ -3054,11 +3054,11 @@ void HuntToKillTask::evaluateTarget() {
if (tracking()
|| a->canSenseSpecificActor(
info,
- maxSenseRange,
+ kMaxSenseRange,
_actorArray[i])
|| a->canSenseSpecificActorIndirectly(
info,
- maxSenseRange,
+ kMaxSenseRange,
_actorArray[i])) {
int16 score;
@@ -3083,11 +3083,11 @@ void HuntToKillTask::evaluateTarget() {
if (tracking()
|| a->canSenseSpecificActor(
info,
- maxSenseRange,
+ kMaxSenseRange,
_actorArray[i])
|| a->canSenseSpecificActorIndirectly(
info,
- maxSenseRange,
+ kMaxSenseRange,
_actorArray[i])) {
int16 score;
@@ -3112,11 +3112,11 @@ void HuntToKillTask::evaluateTarget() {
if (tracking()
|| a->canSenseSpecificActor(
info,
- maxSenseRange,
+ kMaxSenseRange,
_actorArray[i])
|| a->canSenseSpecificActorIndirectly(
info,
- maxSenseRange,
+ kMaxSenseRange,
_actorArray[i])) {
int16 score;
diff --git a/engines/saga2/tile.cpp b/engines/saga2/tile.cpp
index a2f6c37de80..8411ab39670 100644
--- a/engines/saga2/tile.cpp
+++ b/engines/saga2/tile.cpp
@@ -78,7 +78,7 @@ const int slowScrollSpeed = 6,
const StaticTilePoint Nowhere = {(int16)minint16, (int16)minint16, (int16)minint16};
const StaticMetaTileID NoMetaTile = {nullID, nullID};
-const StaticActiveItemID NoActiveItem = {activeItemIndexNullID};
+const StaticActiveItemID NoActiveItem = {kActiveItemIndexNullID};
enum SurfaceType {
surfaceHoriz, // Level surface
@@ -327,7 +327,7 @@ Location ActiveItem::getInstanceLocation() {
// Return the address of an active item, given its ID
ActiveItem *ActiveItem::activeItemAddress(ActiveItemID id) {
- return id.getIndexNum() != activeItemIndexNullID
+ return id.getIndexNum() != kActiveItemIndexNullID
? mapList[id.getMapNum()].activeItemList->_items[id.getIndexNum()]
: nullptr;
}
diff --git a/engines/saga2/uidialog.cpp b/engines/saga2/uidialog.cpp
index a724a6dbbef..d61b9cbd1db 100644
--- a/engines/saga2/uidialog.cpp
+++ b/engines/saga2/uidialog.cpp
@@ -554,20 +554,20 @@ char **initFileFields() {
uint16 i;
SaveFileHeader header; // The save file header.
- char **strings = new (char *[numEditLines]);
+ char **strings = new (char *[kNumEditLines]);
- for (i = 0; i < numEditLines; i++) {
- strings[i] = new char[editLen + 1];
+ for (i = 0; i < kNumEditLines; i++) {
+ strings[i] = new char[kEditLen + 1];
if (getSaveName(i, header)) {
- Common::strlcpy(strings[i], header.saveName.c_str(), editLen);
+ Common::strlcpy(strings[i], header.saveName.c_str(), kEditLen);
} else {
- Common::strlcpy(strings[i], FILE_DIALOG_NONAME, editLen);
+ Common::strlcpy(strings[i], FILE_DIALOG_NONAME, kEditLen);
strings[i][0] |= 0x80;
}
// make sure this thing is caped
- strings[i][editLen] = '\0';
+ strings[i][kEditLen] = '\0';
}
return strings;
@@ -575,7 +575,7 @@ char **initFileFields() {
int numValid(char **names) {
int v = 0;
- for (int i = 0; i < numEditLines; i++) {
+ for (int i = 0; i < kNumEditLines; i++) {
if ((names[i][0] & 0x80) == 0) v++;
}
return v;
@@ -584,7 +584,7 @@ int numValid(char **names) {
void destroyFileFields(char **strings) {
uint16 i;
- for (i = 0; i < numEditLines; i++) {
+ for (i = 0; i < kNumEditLines; i++) {
if (strings[i])
delete[] strings[i];
strings[i] = nullptr;
@@ -615,7 +615,7 @@ bool getSaveName(int8 saveNo, SaveFileHeader &header) {
* ===================================================================== */
int16 FileDialog(int16 fileProcess) {
- //const int strLen = editLen;
+ //const int strLen = kEditLen;
char **fieldStrings;
uint16 stringIndex;
bool displayOnly;
@@ -682,26 +682,26 @@ int16 FileDialog(int16 fileProcess) {
// get the graphics associated with the buttons
- pushBtnIm = loadButtonRes(decRes, dialogPushResNum, numBtnImages);
- arrowUpIm = loadButtonRes(decRes, upArrowResNum, numBtnImages);
- arrowDnIm = loadButtonRes(decRes, dnArrowResNum, numBtnImages);
+ pushBtnIm = loadButtonRes(decRes, dialogPushResNum, kNumBtnImages);
+ arrowUpIm = loadButtonRes(decRes, upArrowResNum, kNumBtnImages);
+ arrowDnIm = loadButtonRes(decRes, dnArrowResNum, kNumBtnImages);
// create the window
win = new ModalWindow(saveLoadWindowRect, 0, nullptr);
// make the quit button
- new GfxCompButton(*win, *saveLoadButtonRects[0], pushBtnIm, numBtnImages, btnStrings[stringIndex][0], pal, 0, cmdDialogQuit);
+ new GfxCompButton(*win, *saveLoadButtonRects[0], pushBtnIm, kNumBtnImages, btnStrings[stringIndex][0], pal, 0, cmdDialogQuit);
//t->_accelKey=0x1B;
// make the Save/Load button
- new GfxCompButton(*win, *saveLoadButtonRects[1], pushBtnIm, numBtnImages, btnStrings[stringIndex][1], pal, fileProcess, fileCommands[fileProcess]);
+ new GfxCompButton(*win, *saveLoadButtonRects[1], pushBtnIm, kNumBtnImages, btnStrings[stringIndex][1], pal, fileProcess, fileCommands[fileProcess]);
//t->_accelKey=0x0D;
// make the up arrow
- new GfxCompButton(*win, *saveLoadButtonRects[2], arrowUpIm, numBtnImages, 0, cmdSaveDialogUp);
+ new GfxCompButton(*win, *saveLoadButtonRects[2], arrowUpIm, kNumBtnImages, 0, cmdSaveDialogUp);
//t->_accelKey=33+0x80;
// make the down arrow
- new GfxCompButton(*win, *saveLoadButtonRects[3], arrowDnIm, numBtnImages, 0, cmdSaveDialogDown);
+ new GfxCompButton(*win, *saveLoadButtonRects[3], arrowDnIm, kNumBtnImages, 0, cmdSaveDialogDown);
//t->_accelKey=34+0x80;
// attach the title
new CPlaqText(*win, *saveLoadTextRects[0], textStrings[stringIndex][0], &Plate18Font, 0, pal, 0, nullptr);
@@ -710,8 +710,8 @@ int16 FileDialog(int16 fileProcess) {
// attach the text box editing field object
textBox = new gTextBox(*win, editBaseRect, &Onyx10Font,
- textHeight, textPen, textBackground, textHilite, textBackHilite, cursorColor,
- nullptr, "Error out", fieldStrings, editLen, 0, (uint16) - 1, displayOnly, nullptr,
+ kTextHeight, kTextPen, kTextBackground, kTextHilite, kTextBackHilite, kCursorColor,
+ nullptr, "Error out", fieldStrings, kEditLen, 0, (uint16) - 1, displayOnly, nullptr,
fileCommands[fileProcess], cmdDialogQuit);
@@ -735,9 +735,9 @@ int16 FileDialog(int16 fileProcess) {
win = nullptr;
// unload all image arrays
- unloadImageRes(arrowUpIm, numBtnImages);
- unloadImageRes(arrowDnIm, numBtnImages);
- unloadImageRes(pushBtnIm, numBtnImages);
+ unloadImageRes(arrowUpIm, kNumBtnImages);
+ unloadImageRes(arrowDnIm, kNumBtnImages);
+ unloadImageRes(pushBtnIm, kNumBtnImages);
// remove the resource handle
@@ -826,8 +826,8 @@ int16 OptionsDialog(bool disableSaveResume) {
decRes = resFile->newContext(kDialogGroupID, "dialog resources");
// get the graphics associated with the buttons
- dialogPushImag = loadButtonRes(decRes, dialogPushResNum, numBtnImages);
- checkImag = loadButtonRes(decRes, checkResNum, numBtnImages);
+ dialogPushImag = loadButtonRes(decRes, dialogPushResNum, kNumBtnImages);
+ checkImag = loadButtonRes(decRes, checkResNum, kNumBtnImages);
slideFaceImag = loadButtonRes(decRes, slideFaceResNum, numSlideFace);
// create the window
@@ -837,44 +837,44 @@ int16 OptionsDialog(bool disableSaveResume) {
// buttons
if (!disableSaveResume) {
t = new GfxCompButton(*win, *optionsButtonRects[0],
- dialogPushImag, numBtnImages, btnStrings[0], pal, 0, cmdDialogQuit);
+ dialogPushImag, kNumBtnImages, btnStrings[0], pal, 0, cmdDialogQuit);
t->_accelKey = 0x1B;
t = new GfxCompButton(*win, *optionsButtonRects[1],
- dialogPushImag, numBtnImages, btnStrings[1], pal, 0, cmdOptionsSaveGame); // make the quit button
+ dialogPushImag, kNumBtnImages, btnStrings[1], pal, 0, cmdOptionsSaveGame); // make the quit button
t->_accelKey = 'S';
} else {
t = new GfxCompButton(*win, *optionsButtonRects[1],
- dialogPushImag, numBtnImages, OPTN_DIALOG_BUTTON6, pal, 0, cmdOptionsNewGame);
+ dialogPushImag, kNumBtnImages, OPTN_DIALOG_BUTTON6, pal, 0, cmdOptionsNewGame);
t->_accelKey = 'N';
}
t = new GfxCompButton(*win, *optionsButtonRects[2],
- dialogPushImag, numBtnImages, btnStrings[2], pal, 0, cmdOptionsLoadGame); // make the quit button
+ dialogPushImag, kNumBtnImages, btnStrings[2], pal, 0, cmdOptionsLoadGame); // make the quit button
t->_accelKey = 'L';
t = new GfxCompButton(*win, *optionsButtonRects[3],
- dialogPushImag, numBtnImages, btnStrings[3], pal, 0, cmdQuitGame);
+ dialogPushImag, kNumBtnImages, btnStrings[3], pal, 0, cmdQuitGame);
t->_accelKey = 'Q';
t = new GfxCompButton(*win, *optionsButtonRects[4],
- dialogPushImag, numBtnImages, btnStrings[4], pal, 0, cmdCredits);
+ dialogPushImag, kNumBtnImages, btnStrings[4], pal, 0, cmdCredits);
t->_accelKey = 'C';
autoAggressBtn = new GfxOwnerSelCompButton(*win, *optionsButtonRects[5],
- checkImag, numBtnImages, 0, cmdAutoAggression);
+ checkImag, kNumBtnImages, 0, cmdAutoAggression);
autoAggressBtn->select(isAutoAggressionSet());
autoWeaponBtn = new GfxOwnerSelCompButton(*win, *optionsButtonRects[6],
- checkImag, numBtnImages, 0, cmdAutoWeapon);
+ checkImag, kNumBtnImages, 0, cmdAutoWeapon);
autoWeaponBtn->select(isAutoWeaponSet());
speechTextBtn = new GfxOwnerSelCompButton(*win, *optionsButtonRects[7],
- checkImag, numBtnImages, 0, cmdSpeechText);
+ checkImag, kNumBtnImages, 0, cmdSpeechText);
speechTextBtn->select(g_vm->_speechText);
nightBtn = new GfxOwnerSelCompButton(*win, *optionsButtonRects[8],
- checkImag, numBtnImages, 0, cmdNight);
+ checkImag, kNumBtnImages, 0, cmdNight);
nightBtn->select(g_vm->_showNight);
new GfxSlider(*win, optTopSliderRect, optTopFaceRect, 0,
@@ -914,8 +914,8 @@ int16 OptionsDialog(bool disableSaveResume) {
// unload all image arrays
unloadImageRes(slideFaceImag, numSlideFace);
- unloadImageRes(checkImag, numBtnImages);
- unloadImageRes(dialogPushImag, numBtnImages);
+ unloadImageRes(checkImag, kNumBtnImages);
+ unloadImageRes(dialogPushImag, kNumBtnImages);
// remove the resource handle
if (decRes) resFile->disposeContext(decRes);
@@ -1007,7 +1007,7 @@ bool initUserDialog() {
// get the graphics associated with the buttons
- udDialogPushImag = loadButtonRes(udDecRes, dialogPushResNum, numBtnImages);
+ udDialogPushImag = loadButtonRes(udDecRes, dialogPushResNum, kNumBtnImages);
// create the window
udWin = new ModalWindow(messageWindowRect, 0 nullptr);
@@ -1037,7 +1037,7 @@ void cleanupUserDialog() {
udWin = nullptr;
// unload all image arrays
- unloadImageRes(udDialogPushImag, numBtnImages);
+ unloadImageRes(udDialogPushImag, kNumBtnImages);
}
@@ -1075,21 +1075,21 @@ int16 userDialog(const char *title, const char *msg, const char *bMsg1,
// button one
if (numBtns >= 1) {
t = new GfxCompButton(*udWin, messageButtonRects[0],
- udDialogPushImag, numBtnImages, btnMsg1, pal, 10, cmdDialogQuit);
+ udDialogPushImag, kNumBtnImages, btnMsg1, pal, 10, cmdDialogQuit);
t->accel = k1;
}
// button two
if (numBtns >= 2) {
t = new GfxCompButton(*udWin, messageButtonRects[1],
- udDialogPushImag, numBtnImages, btnMsg2, pal, 11, cmdDialogQuit);
+ udDialogPushImag, kNumBtnImages, btnMsg2, pal, 11, cmdDialogQuit);
t->accel = k2;
}
// button three
if (numBtns >= 3) {
t = new GfxCompButton(*udWin, messageButtonRects[2],
- udDialogPushImag, numBtnImages, btnMsg3, pal, 12, cmdDialogQuit);
+ udDialogPushImag, kNumBtnImages, btnMsg3, pal, 12, cmdDialogQuit);
t->accel = k3;
}
@@ -1180,7 +1180,7 @@ int16 userDialog(const char *title, const char *msg, const char *bMsg1,
// get the graphics associated with the buttons
- dialogPushImag = loadButtonRes(decRes, dialogPushResNum, numBtnImages);
+ dialogPushImag = loadButtonRes(decRes, dialogPushResNum, kNumBtnImages);
// create the window
win = new ModalWindow(messageWindowRect, 0, nullptr);
@@ -1190,21 +1190,21 @@ int16 userDialog(const char *title, const char *msg, const char *bMsg1,
// button one
if (numBtns >= 1) {
t = new GfxCompButton(*win, *messageButtonRects[0],
- dialogPushImag, numBtnImages, btnMsg1, pal, 10, cmdDialogQuit);
+ dialogPushImag, kNumBtnImages, btnMsg1, pal, 10, cmdDialogQuit);
t->_accelKey = k1;
}
// button two
if (numBtns >= 2) {
t = new GfxCompButton(*win, *messageButtonRects[1],
- dialogPushImag, numBtnImages, btnMsg2, pal, 11, cmdDialogQuit);
+ dialogPushImag, kNumBtnImages, btnMsg2, pal, 11, cmdDialogQuit);
t->_accelKey = k2;
}
// button three
if (numBtns >= 3) {
t = new GfxCompButton(*win, *messageButtonRects[2],
- dialogPushImag, numBtnImages, btnMsg3, pal, 12, cmdDialogQuit);
+ dialogPushImag, kNumBtnImages, btnMsg3, pal, 12, cmdDialogQuit);
t->_accelKey = k3;
}
@@ -1230,7 +1230,7 @@ int16 userDialog(const char *title, const char *msg, const char *bMsg1,
delete win;
// unload all image arrays
- unloadImageRes(dialogPushImag, numBtnImages);
+ unloadImageRes(dialogPushImag, kNumBtnImages);
// remove the resource handle
if (decRes) resFile->disposeContext(decRes);
Commit: 235ab0cc6a804616f920256bb3b77207373738c9
https://github.com/scummvm/scummvm/commit/235ab0cc6a804616f920256bb3b77207373738c9
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-10-29T23:46:00+02:00
Commit Message:
SAGA2: Rename constants in audio.cpp
Changed paths:
engines/saga2/audio.cpp
diff --git a/engines/saga2/audio.cpp b/engines/saga2/audio.cpp
index 7539b980c9c..bae657aca11 100644
--- a/engines/saga2/audio.cpp
+++ b/engines/saga2/audio.cpp
@@ -40,10 +40,10 @@
namespace Saga2 {
-static const StaticPoint32 VeryFarAway = {32767, 32766};
+static const StaticPoint32 kVeryFarAway = {32767, 32766};
-const uint32 fullVolumeDist = 75;
-const uint32 offVolumeDist = 200;
+const uint32 kFullVolumeDist = 75;
+const uint32 kOffVolumeDist = 200;
const uint32 baseMusicID = MKTAG('M', 'I', 'L', 'O'),
goodMusicID = MKTAG('M', 'I', 'H', 'I'),
@@ -76,10 +76,10 @@ bool hResCheckResID(hResContext *hrc, uint32 s[]);
static byte volumeFromDist(Point32 loc, byte maxVol) {
TilePoint tp(loc.x, loc.y, 0);
uint32 dist = tp.quickHDistance();
- if (dist < fullVolumeDist) {
+ if (dist < kFullVolumeDist) {
return ABS(maxVol);
- } else if (dist < offVolumeDist) {
- return ABS((int)(maxVol * ((int)((offVolumeDist - fullVolumeDist) - (dist - fullVolumeDist))) / (offVolumeDist - fullVolumeDist)));
+ } else if (dist < kOffVolumeDist) {
+ return ABS((int)(maxVol * ((int)((kOffVolumeDist - kFullVolumeDist) - (dist - kFullVolumeDist))) / (kOffVolumeDist - kFullVolumeDist)));
}
return 0;
}
@@ -269,7 +269,7 @@ Point32 translateLocation(Location playAt) {
Point32 p = Point32(playAt.u - cal.u, playAt.v - cal.v);
return p;
}
- return VeryFarAway;
+ return kVeryFarAway;
}
//-----------------------------------------------------------------------
@@ -391,7 +391,7 @@ void playSoundAt(uint32 s, Point32 p) {
void playSoundAt(uint32 s, Location playAt) {
Point32 p = translateLocation(playAt);
- if (p != VeryFarAway)
+ if (p != kVeryFarAway)
playSoundAt(s, p);
}
@@ -413,7 +413,7 @@ bool sayVoiceAt(uint32 s[], Point32 p) {
bool sayVoiceAt(uint32 s[], Location playAt) {
Point32 p = translateLocation(playAt);
- if (p != VeryFarAway)
+ if (p != kVeryFarAway)
return sayVoiceAt(s, p);
return false;
}
@@ -453,7 +453,7 @@ void moveLoop(Point32 loc) {
void moveLoop(Location loc) {
Point32 p = translateLocation(loc);
- if (p != VeryFarAway) {
+ if (p != kVeryFarAway) {
moveLoop(p);
}
}
More information about the Scummvm-git-logs
mailing list