[Scummvm-git-logs] scummvm master -> ca1a6e8f255b3640cc755ad4a75fbfa30eabab88
sev-
noreply at scummvm.org
Sat Oct 29 13:09:06 UTC 2022
This automated email contains information about 17 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
e6aab8c586 SAGA2: Rename enums in objects.h
7896855b10 SAGA2: Rename enums in objproto.h
bd03133ec7 SAGA2: Rename enums in panel.h
e54108a15c SAGA2: Rename enums in patrol.h
b46e166050 SAGA2: Rename enums in player.h
e00bdadfd2 SAGA2: Rename enums in property.h
7f4dd6aaaa SAGA2: Rename enums in script.h
4d6ca3173b SAGA2: Rename enums in sensor.h, setup.h and speech.h
d2e7c34fa4 SAGA2: Rename enums in speldefs.h
cc93020cb5 SAGA2: Renamed enums in spelbuk.h
aec2d5afc6 SAGA2: Rename enums in spells.h
9b049d0afb SAGA2: Rename enums in spelshow.h
a185be3b64 SAGA2: Rename constants in spelvals.h
98508c2bfb SAGA2: Rename enums in sprite.h
6a9dfb21d5 SAGA2: Rename enums in stimtype.h
1a7c063c94 SAGA2: Rename enums in target.h
ca1a6e8f25 SAGA2: Rename enums in task.h
Commit: e6aab8c58644bc6cf88ff45e7f1193d5f967595e
https://github.com/scummvm/scummvm/commit/e6aab8c58644bc6cf88ff45e7f1193d5f967595e
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-10-29T13:04:15+02:00
Commit Message:
SAGA2: Rename enums in objects.h
Changed paths:
engines/saga2/actor.cpp
engines/saga2/actor.h
engines/saga2/effects.cpp
engines/saga2/magic.cpp
engines/saga2/motion.cpp
engines/saga2/objects.cpp
engines/saga2/objects.h
engines/saga2/objproto.cpp
engines/saga2/player.cpp
engines/saga2/player.h
engines/saga2/spelcast.cpp
engines/saga2/terrain.cpp
diff --git a/engines/saga2/actor.cpp b/engines/saga2/actor.cpp
index 8f3d41423c2..f294dc9be0e 100644
--- a/engines/saga2/actor.cpp
+++ b/engines/saga2/actor.cpp
@@ -3330,7 +3330,7 @@ bool Actor::takeMana(ActorManaID i, int8 dMana) {
if (!isPlayerActor(this))
return true;
#endif
- assert(i >= manaIDRed && i <= manaIDViolet);
+ assert(i >= kManaIDRed && i <= kManaIDViolet);
if ((&_effectiveStats.redMana)[i] < dMana)
return false;
(&_effectiveStats.redMana)[i] -= dMana;
@@ -3343,7 +3343,7 @@ bool Actor::hasMana(ActorManaID i, int8 dMana) {
if (!isPlayerActor(this))
return true;
#endif
- assert(i >= manaIDRed && i <= manaIDViolet);
+ assert(i >= kManaIDRed && i <= kManaIDViolet);
if ((&_effectiveStats.redMana)[i] < dMana)
return false;
return true;
diff --git a/engines/saga2/actor.h b/engines/saga2/actor.h
index 04d5c408bfd..9848f118b0d 100644
--- a/engines/saga2/actor.h
+++ b/engines/saga2/actor.h
@@ -156,12 +156,12 @@ struct ActorAttributes {
}
int16 &mana(int16 id) {
switch (id) {
- case manaIDRed: return redMana;
- case manaIDOrange: return orangeMana;
- case manaIDYellow: return yellowMana;
- case manaIDGreen: return greenMana;
- case manaIDBlue: return blueMana;
- case manaIDViolet: return violetMana;
+ case kManaIDRed: return redMana;
+ case kManaIDOrange: return orangeMana;
+ case kManaIDYellow: return yellowMana;
+ case kManaIDGreen: return greenMana;
+ case kManaIDBlue: return blueMana;
+ case kManaIDViolet: return violetMana;
}
error("Incorrect mana id: %d", id);
}
diff --git a/engines/saga2/effects.cpp b/engines/saga2/effects.cpp
index 0ff953738de..ea180b316f4 100644
--- a/engines/saga2/effects.cpp
+++ b/engines/saga2/effects.cpp
@@ -135,7 +135,7 @@ void ProtoDrainage::drainLevel(GameObject *cst, Actor *a, effectDrainsTypes edt,
case kDrainsManaBlue:
case kDrainsManaViolet:
{
- ActorManaID aType = (ActorManaID)(edt + (manaIDRed - kDrainsManaRed));
+ ActorManaID aType = (ActorManaID)(edt + (kManaIDRed - kDrainsManaRed));
(&a->_effectiveStats.redMana)[aType] =
clamp(
0,
diff --git a/engines/saga2/magic.cpp b/engines/saga2/magic.cpp
index b0d995906c9..a51a107a52a 100644
--- a/engines/saga2/magic.cpp
+++ b/engines/saga2/magic.cpp
@@ -190,12 +190,12 @@ bool canCast(GameObject *enactor, SkillProto *spell) {
ActorManaID ami = (ActorManaID)(sProto.getManaType());
int amt = sProto.getManaAmt();
- if (ami == numManas)
+ if (ami == kNumManas)
return true;
#if NPC_MANA_CHECK
if (isActor(enactor)) {
Actor *a = (Actor *) enactor;
- assert(ami >= manaIDRed && ami <= manaIDViolet);
+ assert(ami >= kManaIDRed && ami <= kManaIDViolet);
if ((&a->effectiveStats.redMana)[ami] < amt)
return false;
return true;
diff --git a/engines/saga2/motion.cpp b/engines/saga2/motion.cpp
index da201b6fa05..e8a7d186e21 100644
--- a/engines/saga2/motion.cpp
+++ b/engines/saga2/motion.cpp
@@ -225,7 +225,7 @@ bool unstickObject(GameObject *obj) {
mapNum = obj->getMapNum();
outside = objRoofID(obj, mapNum, obj->getLocation()) == 0;
- if (checkBlocked(obj, obj->getLocation()) == blockageNone)
+ if (checkBlocked(obj, obj->getLocation()) == kBlockageNone)
return false;
#if 1
@@ -262,7 +262,7 @@ bool unstickObject(GameObject *obj) {
// If under the same roof, and no blockages...
if (outside == (objRoofID(obj, mapNum, pos) == 0)
- && checkBlocked(obj, pos) == blockageNone) {
+ && checkBlocked(obj, pos) == kBlockageNone) {
int32 newRadius;
// Then this is the best one found so far.
@@ -305,7 +305,7 @@ bool unstickObject(GameObject *obj) {
pos.z += height;
if (outside == (objRoofID(obj, mapNum, pos) == 0)
- && checkBlocked(obj, pos) == blockageNone) {
+ && checkBlocked(obj, pos) == kBlockageNone) {
int16 tHeight;
tHeight = tileSlopeHeight(pos, obj);
@@ -1197,7 +1197,7 @@ void MotionTask::throwObject(GameObject &obj, const TilePoint &velocity) {
MotionTask *mt;
if ((mt = g_vm->_mTaskList->newTask(&obj)) != nullptr) {
- if (obj.isMissile()) obj._data.missileFacing = missileNoFacing;
+ if (obj.isMissile()) obj._data.missileFacing = kMissileNoFacing;
mt->_velocity = velocity;
mt->_motionType = kMotionTypeThrown;
}
@@ -1215,7 +1215,7 @@ void MotionTask::throwObjectTo(GameObject &obj, const TilePoint &where) {
const int16 turns = 15;
if ((mt = g_vm->_mTaskList->newTask(&obj)) != nullptr) {
- if (obj.isMissile()) obj._data.missileFacing = missileNoFacing;
+ if (obj.isMissile()) obj._data.missileFacing = kMissileNoFacing;
mt->calcVelocity(where - obj.getLocation(), turns);
mt->_motionType = kMotionTypeThrown;
}
@@ -2571,7 +2571,7 @@ void MotionTask::walkAction() {
if ((blockageType = checkWalkable(_object, newPos)) != false) {
// Try stepping up to a higher terrain too.
newPos.z = _object->_data.location.z + kMaxStepHeight;
- if (checkWalkable(_object, newPos) != blockageNone) {
+ if (checkWalkable(_object, newPos) != kBlockageNone) {
// If there is a path find task pending, put the walk action
// on hold until it finishes, else, abort the walk action.
if (_pathFindTask)
@@ -4588,7 +4588,7 @@ supported:
// by checking the contact of what he's about to fall on.
if (tPos.z > tHeight) tPos.z--;
// See if we fell on something.
- if (checkContact(_object, tPos) == blockageNone) {
+ if (checkContact(_object, tPos) == kBlockageNone) {
falling:
if (_motionType != kMotionTypeWalk
|| newPos.z > gravity * 4
diff --git a/engines/saga2/objects.cpp b/engines/saga2/objects.cpp
index 581d95cd17e..ee67c000524 100644
--- a/engines/saga2/objects.cpp
+++ b/engines/saga2/objects.cpp
@@ -192,7 +192,7 @@ GameObject::GameObject() {
_data.hitPoints = 0;
_data.bParam = 0;
_data.massCount = 0;
- _data.missileFacing = missileRt;
+ _data.missileFacing = kMissileRt;
_data.currentTAG = NoActiveItem;
_data.sightCtr = 0;
memset(&_data.reserved, 0, sizeof(_data.reserved));
@@ -219,7 +219,7 @@ GameObject::GameObject(const ResourceGameObject &res) {
_data.hitPoints = res.hitPoints;
_data.bParam = _prototype->getChargeType() ? _prototype->maxCharges : 0;
_data.massCount = res.misc; //_prototype->getInitialItemCount();
- _data.missileFacing = missileRt;
+ _data.missileFacing = kMissileRt;
_data.currentTAG = NoActiveItem;
_data.sightCtr = 0;
memset(&_data.reserved, 0, sizeof(_data.reserved));
@@ -1577,7 +1577,7 @@ TilePoint GameObject::getFirstEmptySlot(GameObject *obj) {
ContainerIterator iter(this);
//This Is The Largest The Row Column Can Be
- static bool slotTable[maxRow][maxCol];
+ static bool slotTable[kMaxRow][kMaxCol];
memset(&slotTable, '\0', sizeof(slotTable)); //Initialize Table To false
@@ -1659,7 +1659,7 @@ bool GameObject::getAvailableSlot(
// Iterate through the objects in this container
while (iter.next(&inventoryObj) != Nothing) {
if (canStackOrMerge(obj, inventoryObj)
- != cannotStackOrMerge) {
+ != kCannotStackOrMerge) {
*tp = inventoryObj->getLocation();
*mergeObj = inventoryObj;
return true;
@@ -1733,7 +1733,7 @@ void GameObject::dropInventoryObject(GameObject *obj, int16 count) {
probeLoc.z = tileSlopeHeight(probeLoc, _mapNum, obj, &sti);
// If _data.location is not blocked, drop the object
- if (checkBlocked(obj, _mapNum, probeLoc) == blockageNone) {
+ if (checkBlocked(obj, _mapNum, probeLoc) == kBlockageNone) {
// If we're dropping the object on a TAI, make sure
// we call the correct drop function
if (sti.surfaceTAG == nullptr) {
@@ -2277,17 +2277,17 @@ int32 GameObject::canStackOrMerge(GameObject *dropObj, GameObject *target) {
if (((dropObj->_data.objectFlags & noMergeFlags) == (target->_data.objectFlags & noMergeFlags))
&& dropObj->IDChild() == Nothing
&& target->IDChild() == Nothing) {
- return canMerge;
+ return kCanMerge;
}
} else if (!(cSet & (ProtoObj::isWearable | ProtoObj::isWeapon | ProtoObj::isArmor))
|| !isActor(target->IDParent())) {
// We can stack if the pile we are stacking on is in a container.
if (!isWorld(target->IDParent())
&& target->getLocation().z != 0)
- return canStack;
+ return kCanStack;
}
}
- return cannotStackOrMerge;
+ return kCannotStackOrMerge;
}
void GameObject::mergeWith(GameObject *dropObj, GameObject *target, int16 count) {
diff --git a/engines/saga2/objects.h b/engines/saga2/objects.h
index 346772a56b7..c766a0362c7 100644
--- a/engines/saga2/objects.h
+++ b/engines/saga2/objects.h
@@ -40,21 +40,21 @@ class GameWorld;
const uint16 unlimitedCapacity = maxuint16;
enum ActorManaID {
- manaIDRed = 0,
- manaIDOrange,
- manaIDYellow,
- manaIDGreen,
- manaIDBlue,
- manaIDViolet,
-
- numManas
+ kManaIDRed = 0,
+ kManaIDOrange,
+ kManaIDYellow,
+ kManaIDGreen,
+ kManaIDBlue,
+ kManaIDViolet,
+
+ kNumManas
};
// Used to indicate if objects can be stacked or merged
enum {
- cannotStackOrMerge = 0,
- canStack,
- canMerge
+ kCannotStackOrMerge = 0,
+ kCanStack,
+ kCanMerge
};
// The ResourceGameObject structure represents the game object data as
@@ -150,8 +150,8 @@ private:
// container info
enum {
- maxRow = 20,
- maxCol = 4
+ kMaxRow = 20,
+ kMaxCol = 4
};
public:
@@ -1303,29 +1303,29 @@ struct ObjectSoundFXs {
// Defines values for sixteen missile facings, plus a value for no
// missile facing.
enum MissileFacings {
- missileUp,
- missileUpUpLf,
- missileUpLf,
- missileUpLfLf,
- missileLf,
- missileDnLfLf,
- missileDnLf,
- missileDnDnLf,
- missileDn,
- missileDnDnRt,
- missileDnRt,
- missileDnRtRt,
- missileRt,
- missileUpRtRt,
- missileUpRt,
- missileUpUpRt,
- missileNoFacing
+ kMissileUp,
+ kMissileUpUpLf,
+ kMissileUpLf,
+ kMissileUpLfLf,
+ kMissileLf,
+ kMissileDnLfLf,
+ kMissileDnLf,
+ kMissileDnDnLf,
+ kMissileDn,
+ kMissileDnDnRt,
+ kMissileDnRt,
+ kMissileDnRtRt,
+ kMissileRt,
+ kMissileUpRtRt,
+ kMissileUpRt,
+ kMissileUpUpRt,
+ kMissileNoFacing
};
enum blockageType {
- blockageNone = 0,
- blockageTerrain,
- blockageObject
+ kBlockageNone = 0,
+ kBlockageTerrain,
+ kBlockageObject
};
uint32 objectTerrain(GameObject *obj);
diff --git a/engines/saga2/objproto.cpp b/engines/saga2/objproto.cpp
index 25fe9e78b08..04fed78ace9 100644
--- a/engines/saga2/objproto.cpp
+++ b/engines/saga2/objproto.cpp
@@ -1104,7 +1104,7 @@ bool InventoryProto::dropAction(
testDir = (vectorDir + dirOffsetTable[i]) & 0x7;
testPt = enactorLoc + incDirTable[testDir] * offsetDist;
testPt.z += enactorProto->height >> 1;
- if (checkBlocked(dObjPtr, mapNum, testPt) == blockageNone) {
+ if (checkBlocked(dObjPtr, mapNum, testPt) == kBlockageNone) {
startPt = testPt;
break;
}
@@ -1168,9 +1168,9 @@ bool InventoryProto::acceptDropAction(
GameObject *targetObject = GameObject::objectAddress(dObj);
int mergeState = GameObject::canStackOrMerge(dropObject, targetObject);
- if (mergeState == canMerge)
+ if (mergeState == kCanMerge)
return targetObject->merge(enactor, droppedObj, count);
- else if (mergeState == canStack)
+ else if (mergeState == kCanStack)
return targetObject->stack(enactor, droppedObj);
return ProtoObj::acceptDropAction(dObj, enactor, droppedObj, count);
diff --git a/engines/saga2/player.cpp b/engines/saga2/player.cpp
index 4f292bc7063..7dc2a3551cc 100644
--- a/engines/saga2/player.cpp
+++ b/engines/saga2/player.cpp
@@ -178,14 +178,14 @@ void PlayerActor::stdAttribUpdate(uint8 &stat, uint8 baseStat, int16 index) {
}
void PlayerActor::manaUpdate() {
- const int numManas = 6;
+ const int kNumManas = 6;
const int minMana = 0;
// get the actor pointer for this character
Actor *actor = getActor();
// get indirections for each of the effective mana types
- int16 *effectiveMana[numManas] = { &actor->_effectiveStats.redMana,
+ int16 *effectiveMana[kNumManas] = { &actor->_effectiveStats.redMana,
&actor->_effectiveStats.orangeMana,
&actor->_effectiveStats.yellowMana,
&actor->_effectiveStats.greenMana,
@@ -194,7 +194,7 @@ void PlayerActor::manaUpdate() {
};
// get indirections for each of the base mana types
- int16 *baseMana[numManas] = { &_baseStats.redMana,
+ int16 *baseMana[kNumManas] = { &_baseStats.redMana,
&_baseStats.orangeMana,
&_baseStats.yellowMana,
&_baseStats.greenMana,
@@ -205,7 +205,7 @@ void PlayerActor::manaUpdate() {
uint16 diff;
// do each mana type
- for (int16 i = 0; i < numManas; i++) {
+ for (int16 i = 0; i < kNumManas; i++) {
int levelBump;
int recRate;
@@ -885,7 +885,7 @@ struct PlayerActorArchive {
int16 _portraitType;
uint16 flags;
ActorAttributes _baseStats;
- int16 _manaMemory[numManas];
+ int16 _manaMemory[kNumManas];
uint8 _attribRecPools[kNumSkills];
uint8 _attribMemPools[kNumSkills];
uint8 _vitalityMemory;
@@ -961,7 +961,7 @@ void savePlayerActors(Common::OutSaveFile *outS) {
p->_baseStats.write(out);
// Store accumulation arrays
- for (int j = 0; j < numManas; ++j)
+ for (int j = 0; j < kNumManas; ++j)
out->writeSint16LE(p->_manaMemory[j]);
for (int j = 0; j < kNumSkills; ++j)
@@ -1002,7 +1002,7 @@ void loadPlayerActors(Common::InSaveFile *in) {
p->_baseStats.read(in);
// Restore the accumulation arrays
- for (int j = 0; j < numManas; ++j)
+ for (int j = 0; j < kNumManas; ++j)
p->_manaMemory[j] = in->readSint16LE();
for (int j = 0; j < kNumSkills; ++j)
diff --git a/engines/saga2/player.h b/engines/saga2/player.h
index bc9b2150b21..61d9ae570a3 100644
--- a/engines/saga2/player.h
+++ b/engines/saga2/player.h
@@ -75,7 +75,7 @@ public:
ContainerNode *_readyNode;
// mana 'experience' pool
- int16 _manaMemory[numManas];
+ int16 _manaMemory[kNumManas];
// attrib recovery pools
uint8 _attribRecPools[kNumSkills];
@@ -98,7 +98,7 @@ public:
memset(&_baseStats, 0, sizeof(_baseStats));
- for (int i = 0; i < numManas; i++)
+ for (int i = 0; i < kNumManas; i++)
_manaMemory[i] = 0;
for (int i = 0; i < kNumSkills; i++) {
diff --git a/engines/saga2/spelcast.cpp b/engines/saga2/spelcast.cpp
index f905bc3cfab..e8f1774c005 100644
--- a/engines/saga2/spelcast.cpp
+++ b/engines/saga2/spelcast.cpp
@@ -764,7 +764,7 @@ TilePoint collideTo(Effectron *e, TilePoint nloc) {
GameObject *bumpy;
blockageType bt = checkNontact(e, nloc, &bumpy);
- if (bt == blockageTerrain) {
+ if (bt == kBlockageTerrain) {
e->bump();
}
@@ -886,22 +886,22 @@ blockageType checkNontact(
// Check for intersection with a wall or obstacle
if (terrain & terrainRaised)
- return blockageTerrain;
+ return kBlockageTerrain;
// Check for intersection with slope of the terrain.
if (((terrain & terrainSurface)
|| (!(terrain & terrainWater) && loc.z <= 0))
&& loc.z < tileNopeHeight(loc, obj))
- return blockageTerrain;
+ return kBlockageTerrain;
// See if object collided with an object
blockObj = objectNollision(obj, loc);
if (blockObj) {
if (blockResultObj) *blockResultObj = blockObj;
- return blockageObject;
+ return kBlockageObject;
}
- return blockageNone;
+ return kBlockageNone;
}
int16 tileNopeHeight(
diff --git a/engines/saga2/terrain.cpp b/engines/saga2/terrain.cpp
index f7c94d7cfac..68500c7fe1c 100644
--- a/engines/saga2/terrain.cpp
+++ b/engines/saga2/terrain.cpp
@@ -803,7 +803,7 @@ int16 checkBlocked(
height);
// Check for intersection with a wall or obstacle
- if (terrain & terrainRaised) return blockageTerrain;
+ if (terrain & terrainRaised) return kBlockageTerrain;
}
// See if object collided with an object
@@ -811,10 +811,10 @@ int16 checkBlocked(
blockObj = objectCollision(obj, world, loc);
if (blockObj) {
if (blockResultObj) *blockResultObj = blockObj;
- return blockageObject;
+ return kBlockageObject;
}
- return blockageNone;
+ return kBlockageNone;
}
// return terrain that object is currently interacting with
@@ -835,13 +835,13 @@ int16 checkWalkable(
int16 supportHeight;
StandingTileInfo sti;
- if ((result = checkBlocked(obj, loc, blockResultObj)) != blockageNone)
+ if ((result = checkBlocked(obj, loc, blockResultObj)) != kBlockageNone)
return result;
supportHeight = tileSlopeHeight(loc, obj, &sti);
if (supportHeight < loc.z - kMaxStepHeight * 4)
- return blockageTerrain;
+ return kBlockageTerrain;
if (sti.surfaceTile != nullptr) {
int16 subTileU,
@@ -854,10 +854,10 @@ int16 checkWalkable(
// If the suporting subtile is funiture consider this blocked
if (sti.surfaceTile->attrs.testTerrain(mask) & terrainFurniture)
- return blockageTerrain;
+ return kBlockageTerrain;
}
- return blockageNone;
+ return kBlockageNone;
}
// return terrain that object is currently interacting with
@@ -879,24 +879,24 @@ int16 checkContact(
proto->height);
// Check for intersection with a wall or obstacle
- if (terrain & terrainRaised) return blockageTerrain;
+ if (terrain & terrainRaised) return kBlockageTerrain;
// Check for intersection with slope of the terrain.
if (((terrain & terrainSurface)
&& loc.z <= tileSlopeHeight(loc, obj))
|| (!(terrain & terrainWater)
&& loc.z <= 0))
- return blockageTerrain;
+ return kBlockageTerrain;
// See if object collided with an object
world = (GameWorld *)GameObject::objectAddress(mapList[mapNum].worldID);
blockObj = objectCollision(obj, world, loc);
if (blockObj) {
if (blockResultObj) *blockResultObj = blockObj;
- return blockageObject;
+ return kBlockageObject;
}
- return blockageNone;
+ return kBlockageNone;
}
} // end of namespace Saga2
Commit: 7896855b10e4046902655dbe6302f883adc3cb38
https://github.com/scummvm/scummvm/commit/7896855b10e4046902655dbe6302f883adc3cb38
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-10-29T13:36:38+02:00
Commit Message:
SAGA2: Rename enums in objproto.h
Changed paths:
engines/saga2/actor.cpp
engines/saga2/button.cpp
engines/saga2/contain.cpp
engines/saga2/dispnode.cpp
engines/saga2/effects.cpp
engines/saga2/enchant.cpp
engines/saga2/grabinfo.cpp
engines/saga2/intrface.cpp
engines/saga2/motion.cpp
engines/saga2/objects.cpp
engines/saga2/objects.h
engines/saga2/objproto.cpp
engines/saga2/objproto.h
engines/saga2/sagafunc.cpp
engines/saga2/task.cpp
engines/saga2/tilemode.cpp
diff --git a/engines/saga2/actor.cpp b/engines/saga2/actor.cpp
index f294dc9be0e..7756a872bc9 100644
--- a/engines/saga2/actor.cpp
+++ b/engines/saga2/actor.cpp
@@ -75,7 +75,7 @@ extern bool massAndBulkCount;
uint16 ActorProto::containmentSet() {
// All actors may also be weapons (indicating natural attacks)
- return ProtoObj::containmentSet() | isWeapon;
+ return ProtoObj::containmentSet() | kIsWeapon;
}
//-----------------------------------------------------------------------
@@ -89,7 +89,7 @@ bool ActorProto::canContain(ObjectID dObj, ObjectID item) {
// Actors can contain any object, except worlds and other actors
return isObject(item)
- && ((itemPtr->containmentSet() & ProtoObj::isIntangible) == 0
+ && ((itemPtr->containmentSet() & ProtoObj::kIsIntangible) == 0
|| itemPtr->possessor() == dObj);
}
@@ -109,7 +109,7 @@ bool ActorProto::canContainAt(
// Actors can contain any object, except worlds and other actors
// REM: must add test to determine if specified slot is valid.
return isObject(item)
- && ((itemPtr->containmentSet() & ProtoObj::isIntangible) == 0
+ && ((itemPtr->containmentSet() & ProtoObj::kIsIntangible) == 0
|| itemPtr->possessor() == dObj);
}
@@ -283,18 +283,18 @@ bool ActorProto::acceptDropAction(
scf.directObject = droppedID;
scf.indirectObject = dObj;
- if (dropType & isIntangible) {
+ if (dropType & kIsIntangible) {
// Set up the arguments we want to pass to the script
scf.value = droppedObj->proto()->lockType + senseIdeaGreeting;
// Invoke the script...
- if (dropType & isConcept) {
+ if (dropType & kIsConcept) {
runObjectMethod(dObj, Method_Actor_onTalkTo, scf);
- } else if (dropType & isPsych) {
+ } else if (dropType & kIsPsych) {
// What to do???
- } else if (dropType & (isSpell | isSkill)) {
+ } else if (dropType & (kIsSpell | kIsSkill)) {
// What to do???
// Cast the spell on the actor?
}
@@ -401,7 +401,7 @@ bool ActorProto::acceptDamageAction(
if (vitality > 0) {
Location al = Location(a->getLocation(), a->IDParent());
if (gruntStyle > 0
- && ((flags & ResourceObjectPrototype::objPropNoSurface)
+ && ((flags & ResourceObjectPrototype::kObjPropNoSurface)
|| (damageScore > 2 && (int16)g_vm->_rnd->getRandomNumber(vitality - 1) < (damageScore * 2))))
makeGruntSound(gruntStyle, al);
@@ -505,7 +505,7 @@ bool ActorProto::acceptStrikeAction(
ActorAttributes *effStats = a->getStats();
GameObject *weapon = GameObject::objectAddress(strikingObj);
- assert(weapon->proto()->containmentSet() & ProtoObj::isWeapon);
+ assert(weapon->proto()->containmentSet() & ProtoObj::kIsWeapon);
Actor *enactorPtr = (Actor *)GameObject::objectAddress(enactor);
ArmorAttributes armorAttribs;
@@ -721,8 +721,8 @@ void ActorProto::initiateAttack(ObjectID attacker, ObjectID target) {
// when this object is damaged
uint8 ActorProto::getDamageSound(const ObjectSoundFXs &soundFXs) {
- return !(flags & ResourceObjectPrototype::objPropNoSurface)
- ? !(flags & ResourceObjectPrototype::objPropHardSurface)
+ return !(flags & ResourceObjectPrototype::kObjPropNoSurface)
+ ? !(flags & ResourceObjectPrototype::kObjPropHardSurface)
? soundFXs.soundFXHitFlesh
: soundFXs.soundFXHitHard
: 0;
@@ -1798,7 +1798,7 @@ GameObject *Actor::offensiveObject() {
GameObject *obj = GameObject::objectAddress(_rightHandObject);
// Any object in an actor's right hand should be a weapon
- assert(obj->containmentSet() & ProtoObj::isWeapon);
+ assert(obj->containmentSet() & ProtoObj::kIsWeapon);
return obj;
}
@@ -1808,7 +1808,7 @@ GameObject *Actor::offensiveObject() {
GameObject *obj = GameObject::objectAddress(_leftHandObject);
- if (obj->containmentSet() & ProtoObj::isWeapon)
+ if (obj->containmentSet() & ProtoObj::kIsWeapon)
return obj;
}
@@ -2224,7 +2224,7 @@ void Actor::dropInventory() {
: nullptr;
// Delete intangible objects and drop tangible objects
- if (obj->containmentSet() & ProtoObj::isIntangible)
+ if (obj->containmentSet() & ProtoObj::kIsIntangible)
obj->deleteObjectRecursive();
else
dropInventoryObject(obj, obj->isMergeable() ? obj->getExtra() : 1);
@@ -2268,7 +2268,7 @@ void Actor::wear(ObjectID objID, uint8 where) {
GameObject *obj = GameObject::objectAddress(objID);
- assert(obj->proto()->containmentSet() & ProtoObj::isArmor);
+ assert(obj->proto()->containmentSet() & ProtoObj::kIsArmor);
}
#endif
@@ -2451,7 +2451,7 @@ void Actor::evaluateNeeds() {
while (iter.next(&obj) != Nothing) {
ProtoObj *proto = obj->proto();
- if ((proto->containmentSet() & ProtoObj::isWeapon)
+ if ((proto->containmentSet() & ProtoObj::kIsWeapon)
&& isActionAvailable(proto->fightStanceAction(thisID()))) {
foundWeapon = true;
break;
diff --git a/engines/saga2/button.cpp b/engines/saga2/button.cpp
index 07fe3fb3402..346f5a3f81e 100644
--- a/engines/saga2/button.cpp
+++ b/engines/saga2/button.cpp
@@ -304,7 +304,7 @@ GfxSpriteImage::GfxSpriteImage(gPanelList &list, const Rect16 &box, GameObject *
object->getColorTranslation(_objColors);
// assing the sprite pointer
- _sprPtr = proto->getSprite(object, ProtoObj::objInContainerView).sp;
+ _sprPtr = proto->getSprite(object, ProtoObj::kObjInContainerView).sp;
}
// getCurrentCompImage() is virtual function that should return
diff --git a/engines/saga2/contain.cpp b/engines/saga2/contain.cpp
index 875335c904a..58787247b10 100644
--- a/engines/saga2/contain.cpp
+++ b/engines/saga2/contain.cpp
@@ -65,19 +65,19 @@ void grabObject(ObjectID pickedObject); // turn object into mouse ptr
void releaseObject(); // restore mouse pointer
/* Reference Types
-ProtoObj::isTangible
-ProtoObj::isContainer
-ProtoObj::isBottle
-ProtoObj::isFood
-ProtoObj::isWearable
-ProtoObj::isWeapon
-ProtoObj::isDocument
-ProtoObj::isIntangible
-ProtoObj::isConcept
-ProtoObj::isMemory
-ProtoObj::isPsych
-ProtoObj::isSpell
-ProtoObj::isEnchantment
+ProtoObj::kIsTangible
+ProtoObj::kIsContainer
+ProtoObj::kIsBottle
+ProtoObj::kIsFood
+ProtoObj::kIsWearable
+ProtoObj::kIsWeapon
+ProtoObj::kIsDocument
+ProtoObj::kIsIntangible
+ProtoObj::kIsConcept
+ProtoObj::kIsMemory
+ProtoObj::kIsPsych
+ProtoObj::kIsSpell
+ProtoObj::kIsEnchantment
*/
//-----------------------------------------------------------------------
@@ -235,11 +235,11 @@ ContainerView::~ContainerView() {
bool ContainerView::isVisible(GameObject *item) {
ProtoObj *proto = item->proto();
- if (proto->containmentSet() & ProtoObj::isEnchantment)
+ if (proto->containmentSet() & ProtoObj::kIsEnchantment)
return false;
// If Intangible Container then don't show it.
- if ((proto->containmentSet() & (ProtoObj::isContainer | ProtoObj::isIntangible)) == (ProtoObj::isContainer | ProtoObj::isIntangible))
+ if ((proto->containmentSet() & (ProtoObj::kIsContainer | ProtoObj::kIsIntangible)) == (ProtoObj::kIsContainer | ProtoObj::kIsIntangible))
return true;
return true;
@@ -272,7 +272,7 @@ void ContainerView::totalObjects() {
// if it's mergeable calc using the getExtra method of
// quantity calculation
// if not, then use the objLoc.z method
- if (proto->flags & ResourceObjectPrototype::objPropMergeable)
+ if (proto->flags & ResourceObjectPrototype::kObjPropMergeable)
numItems = item->getExtra();
else numItems = 1;
@@ -356,7 +356,7 @@ void ContainerView::drawClipped(
* (_iconSpacing.x + iconWidth);
// Get the address of the sprite.
- spr = proto->getSprite(item, ProtoObj::objInContainerView).sp;
+ spr = proto->getSprite(item, ProtoObj::kObjInContainerView).sp;
sprPos.x = x + ((iconWidth - spr->size.x) >> 1)
- spr->offset.x;
@@ -419,7 +419,7 @@ void ContainerView::drawQuantity(
int16 y) {
int16 quantity;
- quantity = (objProto->flags & ResourceObjectPrototype::objPropMergeable)
+ quantity = (objProto->flags & ResourceObjectPrototype::kObjPropMergeable)
? item->getExtra()
: item->getLocation().z;
@@ -478,7 +478,7 @@ GameObject *ContainerView::getObject(const TilePoint &slot) {
(loc.u == slot.u) &&
(loc.v == slot.v) &&
//Skip The Enchantments
- (!(proto->containmentSet() & ProtoObj::isEnchantment))
+ (!(proto->containmentSet() & ProtoObj::kIsEnchantment))
) {
return item;
}
@@ -579,25 +579,25 @@ bool ContainerView::pointerHit(gPanelMessage &msg) {
g_vm->_cnm->_alreadyDone = true; // if object then no doubleClick
if (g_vm->_mouseInfo->getIntent() == GrabInfo::kIntDrop) {
- if (mouseSet & ProtoObj::isTangible) {
+ if (mouseSet & ProtoObj::kIsTangible) {
dropPhysical(msg, mouseObject, slotObject, g_vm->_mouseInfo->getMoveCount());
}
// intangibles are used by dropping them
- else if ((mouseSet & ProtoObj::isConcept) ||
- (mouseSet & ProtoObj::isPsych) ||
- (mouseSet & ProtoObj::isSpell) ||
- (mouseSet & ProtoObj::isSkill)) {
+ else if ((mouseSet & ProtoObj::kIsConcept) ||
+ (mouseSet & ProtoObj::kIsPsych) ||
+ (mouseSet & ProtoObj::kIsSpell) ||
+ (mouseSet & ProtoObj::kIsSkill)) {
useConcept(msg, mouseObject, slotObject);
} else {
// !!!! bad state, reset cursor
g_vm->_mouseInfo->replaceObject();
}
} else if (g_vm->_mouseInfo->getIntent() == GrabInfo::kIntUse) {
- if (mouseSet & ProtoObj::isTangible) {
+ if (mouseSet & ProtoObj::kIsTangible) {
usePhysical(msg, mouseObject, slotObject);
- } else if ((mouseSet & ProtoObj::isSpell) ||
- (mouseSet & ProtoObj::isSkill)) {
+ } else if ((mouseSet & ProtoObj::kIsSpell) ||
+ (mouseSet & ProtoObj::kIsSkill)) {
g_vm->_mouseInfo->replaceObject();
} else {
useConcept(msg, mouseObject, slotObject);
@@ -670,7 +670,7 @@ void ContainerView::clickOn(
GameObject *,
GameObject *cObj) {
if (cObj != nullptr) {
- if (cObj->proto()->flags & ResourceObjectPrototype::objPropMergeable) {
+ if (cObj->proto()->flags & ResourceObjectPrototype::kObjPropMergeable) {
if (!rightButtonState()) {
// just get the object into the cursor
cObj->take(getCenterActorID(), cObj->getExtra());
@@ -724,7 +724,7 @@ void ContainerView::dropPhysical(
GameObject *cObj,
int16 num) {
assert(g_vm->_mouseInfo->getObject() == mObj);
- assert(mObj->containmentSet() & ProtoObj::isTangible);
+ assert(mObj->containmentSet() & ProtoObj::kIsTangible);
// Place object back where it came from, temporarily
g_vm->_mouseInfo->replaceObject();
@@ -755,7 +755,7 @@ void ContainerView::usePhysical(
GameObject *mObj,
GameObject *cObj) {
assert(g_vm->_mouseInfo->getObject() == mObj);
- assert(mObj->containmentSet() & ProtoObj::isTangible);
+ assert(mObj->containmentSet() & ProtoObj::kIsTangible);
if (cObj == nullptr) {
dropPhysical(msg, mObj, cObj);
@@ -772,7 +772,7 @@ void ContainerView::useConcept(
GameObject *mObj,
GameObject *cObj) {
assert(g_vm->_mouseInfo->getObject() == mObj);
- assert(mObj->containmentSet() & ProtoObj::isIntangible);
+ assert(mObj->containmentSet() & ProtoObj::kIsIntangible);
g_vm->_mouseInfo->replaceObject();
@@ -993,7 +993,7 @@ void ReadyContainerView::drawClipped(
ProtoObj *objProto = item->proto();
// If Intangible Container then don't show it.
- if ((objProto->containmentSet() & (ProtoObj::isContainer | ProtoObj::isIntangible)) == (ProtoObj::isContainer | ProtoObj::isIntangible))
+ if ((objProto->containmentSet() & (ProtoObj::kIsContainer | ProtoObj::kIsIntangible)) == (ProtoObj::kIsContainer | ProtoObj::kIsIntangible))
continue;
objLoc = item->getLocation();
@@ -1013,7 +1013,7 @@ void ReadyContainerView::drawClipped(
x = originX + objLoc.v * (_iconSpacing.x + iconWidth);
// Get the address of the sprite.
- spr = proto->getSprite(item, ProtoObj::objInContainerView).sp;
+ spr = proto->getSprite(item, ProtoObj::kObjInContainerView).sp;
sprPos.x = x + ((iconWidth - spr->size.x) >> 1)
- spr->offset.x;
@@ -1170,7 +1170,7 @@ void TangibleContainerWindow::setContainerSprite() {
char dummy = '\0';
// Get the address of the sprite.
- spr = proto->getSprite(_view->_containerObject, ProtoObj::objInContainerView).sp;
+ spr = proto->getSprite(_view->_containerObject, ProtoObj::kObjInContainerView).sp;
sprPos.x = _objRect.x - (spr->size.x >> 1); //_objRect.x + ( spr->size.x >> 1 );
sprPos.y = _objRect.y - (spr->size.y >> 1);
diff --git a/engines/saga2/dispnode.cpp b/engines/saga2/dispnode.cpp
index 7608a54e012..b53e0f5e7d0 100644
--- a/engines/saga2/dispnode.cpp
+++ b/engines/saga2/dispnode.cpp
@@ -445,7 +445,7 @@ void DisplayNode::drawObject() {
}
// Figure out which sprite to show
- sprInfo = proto->getSprite(obj, ProtoObj::objOnGround);
+ sprInfo = proto->getSprite(obj, ProtoObj::kObjOnGround);
// Build the color translation table for the object
obj->getColorTranslation(mainColors);
@@ -837,7 +837,7 @@ ObjectID pickObject(const StaticPoint32 &mouse, StaticTilePoint &objPos) {
if (isObject(obj)) {
ObjectSpriteInfo sprInfo;
- sprInfo = obj->proto()->getSprite(obj, ProtoObj::objOnGround);
+ sprInfo = obj->proto()->getSprite(obj, ProtoObj::kObjOnGround);
spr = sprInfo.sp;
flipped = sprInfo.flipped;
} else {
diff --git a/engines/saga2/effects.cpp b/engines/saga2/effects.cpp
index ea180b316f4..577f9789478 100644
--- a/engines/saga2/effects.cpp
+++ b/engines/saga2/effects.cpp
@@ -488,7 +488,7 @@ SPECIALSPELL(DispellProtections) {
while (iter.next(&obj) != Nothing) {
ProtoObj *proto = obj->proto();
- if (proto->containmentSet() & ProtoObj::isEnchantment) {
+ if (proto->containmentSet() & ProtoObj::kIsEnchantment) {
uint16 enchantmentID = obj->getExtra();
if (!isHarmful(enchantmentID)) {
DispelObjectEnchantment(a->thisID(), enchantmentID);
@@ -510,7 +510,7 @@ SPECIALSPELL(DispellCurses) {
while (iter.next(&obj) != Nothing) {
ProtoObj *proto = obj->proto();
- if (proto->containmentSet() & ProtoObj::isEnchantment) {
+ if (proto->containmentSet() & ProtoObj::kIsEnchantment) {
uint16 enchantmentID = obj->getExtra();
if (isHarmful(enchantmentID)) {
if (ToBeDeleted) ToBeDeleted->deleteObject();
diff --git a/engines/saga2/enchant.cpp b/engines/saga2/enchant.cpp
index 0d5884dcf44..0bc70747bfe 100644
--- a/engines/saga2/enchant.cpp
+++ b/engines/saga2/enchant.cpp
@@ -76,8 +76,8 @@ ObjectID EnchantObject(
// Now, change the object base on enchantments
obj->evalEnchantments();
- assert(enchProto->containmentSet() & ProtoObj::isEnchantment);
- assert((ench->protoAddress(ench->thisID()))->containmentSet() & ProtoObj::isEnchantment);
+ assert(enchProto->containmentSet() & ProtoObj::kIsEnchantment);
+ assert((ench->protoAddress(ench->thisID()))->containmentSet() & ProtoObj::kIsEnchantment);
return ench->thisID();
}
@@ -118,7 +118,7 @@ ObjectID FindObjectEnchantment(
while ((objID = iter.next(&containedObj)) != Nothing) {
ProtoObj *proto = containedObj->proto();
- if ((proto->containmentSet() & ProtoObj::isEnchantment)
+ if ((proto->containmentSet() & ProtoObj::kIsEnchantment)
&& ((containedObj->getExtra() & 0xFF00) == (enchantmentType & 0xFF00))) {
return objID;
}
@@ -196,7 +196,7 @@ void evalActorEnchantments(Actor *a) {
for (id = iter.first(&obj); id != Nothing; id = iter.next(&obj)) {
ProtoObj *proto = obj->proto();
- if (proto->containmentSet() & ProtoObj::isEnchantment) {
+ if (proto->containmentSet() & ProtoObj::kIsEnchantment) {
uint16 enchantmentID = obj->getExtra();
addEnchantment(a, enchantmentID);
}
@@ -206,7 +206,7 @@ void evalActorEnchantments(Actor *a) {
ProtoObj *proto = obj->proto();
uint16 cSet = proto->containmentSet();
- if ((cSet & (ProtoObj::isArmor | ProtoObj::isWeapon | ProtoObj::isWearable))
+ if ((cSet & (ProtoObj::kIsArmor | ProtoObj::kIsWeapon | ProtoObj::kIsWearable))
&& proto->isObjectBeingUsed(obj)) {
a->_effectiveResistance |= proto->resistance;
a->_effectiveImmunity |= proto->immunity;
@@ -278,7 +278,7 @@ ObjectID EnchantmentIterator::next(GameObject **obj) {
ProtoObj *proto = object->proto();
uint16 cSet = proto->containmentSet();
- if ((cSet & (ProtoObj::isArmor | ProtoObj::isWeapon | ProtoObj::isWearable))
+ if ((cSet & (ProtoObj::kIsArmor | ProtoObj::kIsWeapon | ProtoObj::kIsWearable))
&& _wornObject == nullptr
&& proto->isObjectBeingUsed(object)) {
_wornObject = object;
@@ -288,7 +288,7 @@ ObjectID EnchantmentIterator::next(GameObject **obj) {
_nextID = object->IDNext();
- if (cSet & ProtoObj::isEnchantment) break;
+ if (cSet & ProtoObj::kIsEnchantment) break;
}
if (obj) *obj = object;
diff --git a/engines/saga2/grabinfo.cpp b/engines/saga2/grabinfo.cpp
index 808a3a9ebce..7678b061bb4 100644
--- a/engines/saga2/grabinfo.cpp
+++ b/engines/saga2/grabinfo.cpp
@@ -64,7 +64,7 @@ GrabInfo::~GrabInfo() {
// mergeable or not.
void GrabInfo::setMoveCount(int16 val) {
if (_grabObj) {
- if (_grabObj->proto()->flags & ResourceObjectPrototype::objPropMergeable) {
+ if (_grabObj->proto()->flags & ResourceObjectPrototype::kObjPropMergeable) {
_moveCount = val;
} else {
_moveCount = 1;
@@ -189,7 +189,7 @@ void GrabInfo::setIcon() {
proto = _grabObj->proto();
// Get address of sprite
- spr = proto->getSprite(_grabObj, ProtoObj::objAsMousePtr, _moveCount).sp;
+ spr = proto->getSprite(_grabObj, ProtoObj::kObjAsMousePtr, _moveCount).sp;
mapBytes = spr->size.x * spr->size.y;
if ((mapData
diff --git a/engines/saga2/intrface.cpp b/engines/saga2/intrface.cpp
index 2570fb198e6..1157add22fa 100644
--- a/engines/saga2/intrface.cpp
+++ b/engines/saga2/intrface.cpp
@@ -2086,7 +2086,7 @@ APPFUNC(cmdPortrait) {
// If we are using an intangible object (spell) then consider
// the owner of the spell to be the center actor for the rest
// of this action.
- if (mouseObject->proto()->containmentSet() & ProtoObj::isIntangible) {
+ if (mouseObject->proto()->containmentSet() & ProtoObj::kIsIntangible) {
ObjectID possessor = mouseObject->possessor();
if (possessor != Nothing) {
@@ -2851,7 +2851,7 @@ void gEnchantmentDisplay::setValue(PlayerActorID pID) {
ProtoObj *proto = obj->proto();
uint16 cSet = proto->containmentSet();
- if ((cSet & (ProtoObj::isArmor | ProtoObj::isWeapon | ProtoObj::isWearable))
+ if ((cSet & (ProtoObj::kIsArmor | ProtoObj::kIsWeapon | ProtoObj::kIsWearable))
&& proto->isObjectBeingUsed(obj)) {
if (proto->immunity & (1 << kResistImpact)) newIconFlags[iconResistImpact] = 255;
else if (proto->resistance & (1 << kResistImpact)) newIconFlags[iconResistImpact] = 255;
diff --git a/engines/saga2/motion.cpp b/engines/saga2/motion.cpp
index e8a7d186e21..be5f07f0a6a 100644
--- a/engines/saga2/motion.cpp
+++ b/engines/saga2/motion.cpp
@@ -1584,7 +1584,7 @@ void MotionTask::dropObjectOnObject(
if (isActor(&target)
&& isPlayerActor((Actor *)&target)
&& dObj.IDParent() == target.thisID()
- && !(dObj.proto()->containmentSet() & ProtoObj::isContainer)) {
+ && !(dObj.proto()->containmentSet() & ProtoObj::kIsContainer)) {
useObject(a, dObj);
return;
}
@@ -3956,7 +3956,7 @@ void MotionTask::useMagicWeaponAction() {
spell = GameObject::objectAddress(magicWeapon->IDChild());
spellProto = (SkillProto *)spell->proto();
- assert(spellProto->containmentSet() & ProtoObj::isSkill);
+ assert(spellProto->containmentSet() & ProtoObj::kIsSkill);
// use the spell
spellProto->implementAction(
diff --git a/engines/saga2/objects.cpp b/engines/saga2/objects.cpp
index ee67c000524..548ea08769f 100644
--- a/engines/saga2/objects.cpp
+++ b/engines/saga2/objects.cpp
@@ -616,7 +616,7 @@ void GameObject::objCursorText(char nameBuf[], const int8 size, int16 count) {
// check to see if this item is a physical object
// if so, then give the count of the item ( if stacked )
- if (_prototype->containmentSet() & ProtoObj::isTangible) {
+ if (_prototype->containmentSet() & ProtoObj::kIsTangible) {
// display charges if item is a chargeable item
if (_prototype->chargeType != 0
&& _prototype->maxCharges != Permanent
@@ -630,7 +630,7 @@ void GameObject::objCursorText(char nameBuf[], const int8 size, int16 count) {
}
}
- if (_prototype->flags & ResourceObjectPrototype::objPropMergeable) {
+ if (_prototype->flags & ResourceObjectPrototype::kObjPropMergeable) {
// make a buffer that contains the name of
// the object and it's count
// add only if a mergable item
@@ -649,7 +649,7 @@ void GameObject::objCursorText(char nameBuf[], const int8 size, int16 count) {
int16 manaCost = 0;
// figure out if it's a skill or spell
- if (_prototype->containmentSet() & (ProtoObj::isSkill | ProtoObj::isSpell)) {
+ if (_prototype->containmentSet() & (ProtoObj::kIsSkill | ProtoObj::kIsSpell)) {
// get skill proto for this spell or skill
SkillProto *sProto = skillProtoFromID(thisID());
@@ -698,7 +698,7 @@ void GameObject::objCursorText(char nameBuf[], const int8 size, int16 count) {
bool GameObject::isTrueSkill() {
// figure out if it's a skill or spell
- if (_prototype->containmentSet() & (ProtoObj::isSkill | ProtoObj::isSpell)) {
+ if (_prototype->containmentSet() & (ProtoObj::kIsSkill | ProtoObj::kIsSpell)) {
// get skill proto for this spell or skill
SkillProto *sProto = skillProtoFromID(thisID());
@@ -766,7 +766,7 @@ int32 GameObject::getSprOffset(int16 num) {
}
// if this is a mergeable object
- if (_prototype->flags & ResourceObjectPrototype::objPropMergeable) {
+ if (_prototype->flags & ResourceObjectPrototype::kObjPropMergeable) {
if (units >= spriteNumFew) {
value = 1;
}
@@ -798,7 +798,7 @@ bool GameObject::unstack() {
|| IDParent() == Nothing
|| _data.location.z == 1
|| _prototype == nullptr
- || (_prototype->containmentSet() & ProtoObj::isIntangible)) return false;
+ || (_prototype->containmentSet() & ProtoObj::kIsIntangible)) return false;
ContainerIterator iter(parent());
@@ -1089,7 +1089,7 @@ ObjectID GameObject::extractMerged(const Location &loc, int16 num) {
// determine whether this object can be merged
// with duplicates of it's kind
- if (_prototype->flags & ResourceObjectPrototype::objPropMergeable) {
+ if (_prototype->flags & ResourceObjectPrototype::kObjPropMergeable) {
// get the number requested or all that's there...
int16 moveCount = MIN<uint16>(num, _data.massCount);
@@ -1117,7 +1117,7 @@ GameObject *GameObject::extractMerged(int16 num) {
// determine whether this object can be merged
// with duplicates of it's kind
- if (_prototype->flags & ResourceObjectPrototype::objPropMergeable) {
+ if (_prototype->flags & ResourceObjectPrototype::kObjPropMergeable) {
Location loc(0, 0, 0, 0);
// get the number requested or all that's there...
@@ -1354,7 +1354,7 @@ void GameObject::deleteObjectRecursive() {
// If this is an important object let's not delete it but try to drop
// it on the ground instead.
if (isImportant()) {
- assert((_prototype->containmentSet() & ProtoObj::isTangible) != 0);
+ assert((_prototype->containmentSet() & ProtoObj::kIsTangible) != 0);
// If the object is already in a world there's nothing to do.
if (isWorld(_data.parentID))
@@ -1558,7 +1558,7 @@ const char *GameObject::nameText(uint16 index) {
return g_vm->_nameList[index];
}
-#define INTANGIBLE_MASK (ProtoObj::isEnchantment|ProtoObj::isSpell|ProtoObj::isSkill)
+#define INTANGIBLE_MASK (ProtoObj::kIsEnchantment|ProtoObj::kIsSpell|ProtoObj::kIsSkill)
TilePoint GameObject::getFirstEmptySlot(GameObject *obj) {
ObjectID objID;
@@ -1637,8 +1637,8 @@ bool GameObject::getAvailableSlot(
// Determine if the specified object is an intagible container
if ((objProto->containmentSet()
- & (ProtoObj::isContainer | ProtoObj::isIntangible))
- == (ProtoObj::isContainer | ProtoObj::isIntangible)) {
+ & (ProtoObj::kIsContainer | ProtoObj::kIsIntangible))
+ == (ProtoObj::kIsContainer | ProtoObj::kIsIntangible)) {
// assert( isActor( obj ) );
// Set intangible container _data.locations to -1, -1.
@@ -1649,7 +1649,7 @@ bool GameObject::getAvailableSlot(
// Only actors or containers may contain other objects
if (isActor(this)
- || (_prototype->containmentSet() & ProtoObj::isContainer)) {
+ || (_prototype->containmentSet() & ProtoObj::kIsContainer)) {
TilePoint firstEmptySlot;
if (canMerge) {
@@ -2269,9 +2269,9 @@ int32 GameObject::canStackOrMerge(GameObject *dropObj, GameObject *target) {
if (dropObj->getNameIndex() == target->getNameIndex()
&& dropObj->proto() == target->proto()
- && !(cSet & (ProtoObj::isIntangible | ProtoObj::isContainer))) {
+ && !(cSet & (ProtoObj::kIsIntangible | ProtoObj::kIsContainer))) {
// If it is a mergeable object
- if (dropObj->proto()->flags & ResourceObjectPrototype::objPropMergeable) {
+ if (dropObj->proto()->flags & ResourceObjectPrototype::kObjPropMergeable) {
// If the flags are the same, and neither object has children,
// then we can merge
if (((dropObj->_data.objectFlags & noMergeFlags) == (target->_data.objectFlags & noMergeFlags))
@@ -2279,7 +2279,7 @@ int32 GameObject::canStackOrMerge(GameObject *dropObj, GameObject *target) {
&& target->IDChild() == Nothing) {
return kCanMerge;
}
- } else if (!(cSet & (ProtoObj::isWearable | ProtoObj::isWeapon | ProtoObj::isArmor))
+ } else if (!(cSet & (ProtoObj::kIsWearable | ProtoObj::kIsWeapon | ProtoObj::kIsArmor))
|| !isActor(target->IDParent())) {
// We can stack if the pile we are stacking on is in a container.
if (!isWorld(target->IDParent())
@@ -2359,7 +2359,7 @@ uint16 GameObject::totalContainedMass() {
while (iter.next(&childObj) != Nothing) {
uint16 objMass;
- if (!(childObj->containmentSet() & ProtoObj::isTangible))
+ if (!(childObj->containmentSet() & ProtoObj::kIsTangible))
continue;
objMass = childObj->_prototype->mass;
@@ -2385,7 +2385,7 @@ uint16 GameObject::totalContainedBulk() {
while (iter.next(&childObj) != Nothing) {
uint16 objBulk;
- if (!(childObj->containmentSet() & ProtoObj::isTangible))
+ if (!(childObj->containmentSet() & ProtoObj::kIsTangible))
continue;
objBulk = childObj->_prototype->bulk;
@@ -4328,7 +4328,7 @@ bool objObscured(GameObject *testObj) {
drawPos.x += fineScroll.x;
drawPos.y += fineScroll.y;
- objSprInfo = proto->getSprite(testObj, ProtoObj::objOnGround);
+ objSprInfo = proto->getSprite(testObj, ProtoObj::kObjOnGround);
testObj->getColorTranslation(objColors);
diff --git a/engines/saga2/objects.h b/engines/saga2/objects.h
index c766a0362c7..14727cc5a6f 100644
--- a/engines/saga2/objects.h
+++ b/engines/saga2/objects.h
@@ -504,11 +504,11 @@ public:
}
bool isGhosted() {
return (_data.objectFlags & kObjectGhosted)
- || (_prototype->flags & ResourceObjectPrototype::objPropGhosted);
+ || (_prototype->flags & ResourceObjectPrototype::kObjPropGhosted);
}
bool isInvisible() {
return (_data.objectFlags & kObjectInvisible)
- || (_prototype->flags & ResourceObjectPrototype::objPropHidden);
+ || (_prototype->flags & ResourceObjectPrototype::kObjPropHidden);
}
bool isMoving() {
return (int16)(_data.objectFlags & kObjectMoving);
@@ -645,7 +645,7 @@ public:
}
bool isMergeable() {
- return (_prototype->flags & ResourceObjectPrototype::objPropMergeable) != 0;
+ return (_prototype->flags & ResourceObjectPrototype::kObjPropMergeable) != 0;
}
// A timer for this object has ticked
diff --git a/engines/saga2/objproto.cpp b/engines/saga2/objproto.cpp
index 04fed78ace9..1c2bee0dff7 100644
--- a/engines/saga2/objproto.cpp
+++ b/engines/saga2/objproto.cpp
@@ -790,11 +790,11 @@ uint16 ProtoObj::containmentSet() {
// return the sprite data
ObjectSpriteInfo ProtoObj::getSprite(GameObject *obj, enum spriteTypes spr, int16 count) {
- ObjectSpriteInfo sprInfo = { nullptr, static_cast<bool>((flags & objPropFlipped) != 0) };
- int16 openOffset = ((flags & objPropVisOpen) && obj->isOpen()) ? 1 : 0;
+ ObjectSpriteInfo sprInfo = { nullptr, static_cast<bool>((flags & kObjPropFlipped) != 0) };
+ int16 openOffset = ((flags & kObjPropVisOpen) && obj->isOpen()) ? 1 : 0;
switch (spr) {
- case objOnGround:
+ case kObjOnGround:
// If the object is a moving missile return the correct missile
// sprite
@@ -814,17 +814,17 @@ ObjectSpriteInfo ProtoObj::getSprite(GameObject *obj, enum spriteTypes spr, int1
} else {
sprInfo.sp = objectSprites->sprite(groundSprite + openOffset + obj->getSprOffset(count));
sprInfo.flipped =
- (flags & ResourceObjectPrototype::objPropFlipped) != 0;
+ (flags & ResourceObjectPrototype::kObjPropFlipped) != 0;
}
break;
- case objInContainerView:
- case objAsMousePtr:
+ case kObjInContainerView:
+ case kObjAsMousePtr:
sprInfo.sp = objectSprites->sprite(iconSprite + openOffset + obj->getSprOffset(count));
sprInfo.flipped =
- (flags & ResourceObjectPrototype::objPropFlipped) != 0;
+ (flags & ResourceObjectPrototype::kObjPropFlipped) != 0;
break;
}
return sprInfo;
@@ -1004,7 +1004,7 @@ uint16 ProtoObj::bulkCapacity(GameObject *) {
* ==================================================================== */
uint16 InventoryProto::containmentSet() {
- return isTangible;
+ return kIsTangible;
}
bool InventoryProto::takeAction(ObjectID dObj, ObjectID enactor, int16 num) {
@@ -1201,7 +1201,7 @@ bool InventoryProto::acceptStrikeAction(
// };
uint16 PhysicalContainerProto::containmentSet() {
- return InventoryProto::containmentSet() | isContainer;
+ return InventoryProto::containmentSet() | kIsContainer;
}
bool PhysicalContainerProto::canContain(ObjectID dObj, ObjectID item) {
@@ -1216,7 +1216,7 @@ bool PhysicalContainerProto::canContain(ObjectID dObj, ObjectID item) {
}
return dObj != item
- && (itemPtr->containmentSet() & ProtoObj::isTangible);
+ && (itemPtr->containmentSet() & ProtoObj::kIsTangible);
}
bool PhysicalContainerProto::canContainAt(
@@ -1465,7 +1465,7 @@ bool KeyProto::useOnAction(ObjectID dObj, ObjectID enactor, ActiveItem *withTAI)
* ==================================================================== */
uint16 BottleProto::containmentSet() {
- return InventoryProto::containmentSet() | isBottle;
+ return InventoryProto::containmentSet() | kIsBottle;
}
bool BottleProto::useAction(ObjectID dObj, ObjectID enactor) {
@@ -1479,7 +1479,7 @@ bool BottleProto::useAction(ObjectID dObj, ObjectID enactor) {
* ==================================================================== */
uint16 FoodProto::containmentSet() {
- return InventoryProto::containmentSet() | isFood;
+ return InventoryProto::containmentSet() | kIsFood;
}
bool FoodProto::useAction(ObjectID dObj, ObjectID enactor) {
@@ -1491,7 +1491,7 @@ bool FoodProto::useAction(ObjectID dObj, ObjectID enactor) {
* ==================================================================== */
uint16 WearableProto::containmentSet() {
- return InventoryProto::containmentSet() | isWearable;
+ return InventoryProto::containmentSet() | kIsWearable;
}
/* ==================================================================== *
@@ -1503,7 +1503,7 @@ weaponID WeaponProto::getWeaponID() {
}
uint16 WeaponProto::containmentSet() {
- return InventoryProto::containmentSet() | isWeapon;
+ return InventoryProto::containmentSet() | kIsWeapon;
}
// return the address of the sprite when held in hand
@@ -1717,7 +1717,7 @@ uint8 MeleeWeaponProto::weaponRating(
int16 dist = (target->getLocation() - wielder->getLocation()).quickHDistance();
uint8 rating = 0;
- if (dist < maximumRange) rating += inRangeRatingBonus;
+ if (dist < maximumRange) rating += kInRangeRatingBonus;
// Add in the value of the appropriate skill1
rating += getSkillValue(wielderID);
@@ -1943,7 +1943,7 @@ uint8 BowProto::weaponRating(
uint8 rating = 0;
if (dist < maximumRange && !wielder->inReach(target->getLocation()))
- rating += inRangeRatingBonus;
+ rating += kInRangeRatingBonus;
rating += wielder->getStats()->getSkillLevel(kSkillIDArchery);
return rating;
@@ -2043,7 +2043,7 @@ uint8 WeaponWandProto::weaponRating(
return 0;
if (dist < maximumRange && !wielder->inReach(target->getLocation()))
- rating += inRangeRatingBonus;
+ rating += kInRangeRatingBonus;
rating += wielder->getStats()->getSkillLevel(kSkillIDSpellcraft);
return rating;
@@ -2170,7 +2170,7 @@ void ArrowProto::applySkillGrowth(ObjectID enactor, uint8 points) {
* ==================================================================== */
uint16 ArmorProto::containmentSet() {
- return InventoryProto::containmentSet() | isWearable | isArmor;
+ return InventoryProto::containmentSet() | kIsWearable | kIsArmor;
}
// Compute how much damage this defensive object will absorb
@@ -2246,7 +2246,7 @@ bool ArmorProto::useAction(ObjectID dObj, ObjectID enactor) {
* ==================================================================== */
uint16 ShieldProto::containmentSet() {
- return InventoryProto::containmentSet() | isWearable | isArmor;
+ return InventoryProto::containmentSet() | kIsWearable | kIsArmor;
}
// Place shield into left hand
@@ -2417,7 +2417,7 @@ bool ToolProto::useOnAction(ObjectID, ObjectID, ObjectID) {
* ==================================================================== */
uint16 DocumentProto::containmentSet() {
- return InventoryProto::containmentSet() | isDocument;
+ return InventoryProto::containmentSet() | kIsDocument;
}
/* ==================================================================== *
@@ -2468,7 +2468,7 @@ bool AutoMapProto::openAction(ObjectID, ObjectID) {
* ==================================================================== */
uint16 IntangibleObjProto::containmentSet() {
- return isIntangible;
+ return kIsIntangible;
}
bool IntangibleObjProto::useAction(ObjectID dObj, ObjectID enactor) {
@@ -2576,12 +2576,12 @@ ObjectSpriteInfo IntangibleObjProto::getSprite(
ObjectSpriteInfo sprInfo = { nullptr, false };
switch (spr) {
- case objOnGround:
+ case kObjOnGround:
sprInfo.sp = mentalSprites->sprite(groundSprite);
break;
- case objInContainerView:
- case objAsMousePtr:
+ case kObjInContainerView:
+ case kObjAsMousePtr:
sprInfo.sp = mentalSprites->sprite(iconSprite);
}
return sprInfo;
@@ -2594,7 +2594,7 @@ ObjectSpriteInfo IntangibleObjProto::getSprite(
uint16 IdeaProto::containmentSet() {
//Maybe I Could Use This ID And Call IntanobjProt For Setting IsIntangible
- return isConcept | isIntangible;
+ return kIsConcept | kIsIntangible;
}
/* ==================================================================== *
@@ -2603,7 +2603,7 @@ uint16 IdeaProto::containmentSet() {
uint16 MemoryProto::containmentSet() {
//Maybe I Could Use This ID And Call IntanobjProt For Setting IsIntangible
- return isConcept | isIntangible;
+ return kIsConcept | kIsIntangible;
}
/* ==================================================================== *
@@ -2612,7 +2612,7 @@ uint16 MemoryProto::containmentSet() {
uint16 PsychProto::containmentSet() {
//Maybe I Could Use This ID And Call IntanobjProt For Setting IsIntangible
- return isPsych | isIntangible;
+ return kIsPsych | kIsIntangible;
}
/* ==================================================================== *
@@ -2622,7 +2622,7 @@ uint16 PsychProto::containmentSet() {
uint16 SkillProto::containmentSet() {
//Maybe I Could Use This ID And Call IntanobjProt For Setting IsIntangible
- return isSkill | isIntangible;
+ return kIsSkill | kIsIntangible;
}
bool SkillProto::useAction(ObjectID dObj, ObjectID enactor) {
@@ -2737,7 +2737,7 @@ bool SkillProto::implementAction(SpellID dObj, ObjectID enactor, Location &loc)
* ==================================================================== */
uint16 EnchantmentProto::containmentSet() {
- return isEnchantment;
+ return kIsEnchantment;
}
// ------------------------------------------------------------------------
@@ -2788,7 +2788,7 @@ void EnchantmentProto::doBackgroundUpdate(GameObject *obj) {
* ======================================================================== */
uint16 GeneratorProto::containmentSet() {
- return isIntangible;
+ return kIsIntangible;
}
/* ======================================================================== *
@@ -2891,7 +2891,7 @@ bool IntangibleContainerProto::canContain(ObjectID dObj, ObjectID item) {
GameObject *itemPtr = GameObject::objectAddress(item);
- return (itemPtr->containmentSet() & (isSkill | isConcept)) != 0;
+ return (itemPtr->containmentSet() & (kIsSkill | kIsConcept)) != 0;
}
bool IntangibleContainerProto::useAction(ObjectID dObj, ObjectID enactor) {
@@ -2937,7 +2937,7 @@ bool IntangibleContainerProto::closeAction(ObjectID dObj, ObjectID) {
}
uint16 IntangibleContainerProto::containmentSet() {
- return isContainer | isIntangible;
+ return kIsContainer | kIsIntangible;
}
/* ==================================================================== *
IdeaContainerProto class
diff --git a/engines/saga2/objproto.h b/engines/saga2/objproto.h
index 049bb0b6af3..28250bcad8e 100644
--- a/engines/saga2/objproto.h
+++ b/engines/saga2/objproto.h
@@ -226,20 +226,20 @@ struct ResourceObjectPrototype {
// Flag definitions
enum protoFlags {
- objPropMergeable = (1 << 0), // merge with similar objects
- objPropRound = (1 << 1), // rolls easily down stairs
- objPropFlammable = (1 << 2), // object can burn
- objPropWeapon = (1 << 3), // can be wielded as weapon
- objPropThrownWpn = (1 << 4), // it's a throwable weapon
- objPropMissileWpn = (1 << 5), // it's a missile weapon
- objPropCharges = (1 << 6), // it's a missile weapon
- objPropEdible = (1 << 7), // can be eaten
- objPropFlipped = (1 << 8), // flipped left/right on ground
- objPropVisOpen = (1 << 9), // Object has separate "visible" sprite
- objPropHidden = (1 << 10), // "How not to be seen".
- objPropGhosted = (1 << 11), // Object permanently ghosted
- objPropHardSurface = (1 << 12), // Object makes hard sound when struck
- objPropNoSurface = (1 << 13) // Object makes no sound when struck (may grunt however)
+ kObjPropMergeable = (1 << 0), // merge with similar objects
+ kObjPropRound = (1 << 1), // rolls easily down stairs
+ kObjPropFlammable = (1 << 2), // object can burn
+ kObjPropWeapon = (1 << 3), // can be wielded as weapon
+ kObjPropThrownWpn = (1 << 4), // it's a throwable weapon
+ kObjPropMissileWpn = (1 << 5), // it's a missile weapon
+ kObjPropCharges = (1 << 6), // it's a missile weapon
+ kObjPropEdible = (1 << 7), // can be eaten
+ kObjPropFlipped = (1 << 8), // flipped left/right on ground
+ kObjPropVisOpen = (1 << 9), // Object has separate "visible" sprite
+ kObjPropHidden = (1 << 10), // "How not to be seen".
+ kObjPropGhosted = (1 << 11), // Object permanently ghosted
+ kObjPropHardSurface = (1 << 12), // Object makes hard sound when struck
+ kObjPropNoSurface = (1 << 13) // Object makes no sound when struck (may grunt however)
};
int16 price; // object's price
@@ -387,32 +387,32 @@ private:
public:
enum containmentType {
- isTangible = (1 << 0),
- isContainer = (1 << 1),
- isBottle = (1 << 2),
- isFood = (1 << 3),
- isWearable = (1 << 4),
- isWeapon = (1 << 5),
- isArmor = (1 << 6),
- isDocument = (1 << 7),
- isIntangible = (1 << 8),
- isConcept = (1 << 9),
- isPsych = (1 << 10),
- isSpell = (1 << 11),
- isSkill = (1 << 12),
- isEnchantment = (1 << 13),
- isTargetable = (1 << 14)
+ kIsTangible = (1 << 0),
+ kIsContainer = (1 << 1),
+ kIsBottle = (1 << 2),
+ kIsFood = (1 << 3),
+ kIsWearable = (1 << 4),
+ kIsWeapon = (1 << 5),
+ kIsArmor = (1 << 6),
+ kIsDocument = (1 << 7),
+ kIsIntangible = (1 << 8),
+ kIsConcept = (1 << 9),
+ kIsPsych = (1 << 10),
+ kIsSpell = (1 << 11),
+ kIsSkill = (1 << 12),
+ kIsEnchantment = (1 << 13),
+ kIsTargetable = (1 << 14)
};
// kludge: define earlier, incorrectly spelled names to correct spelling
// REM: Later, do a global search and replace...
-#define isTangable isTangible
-#define isIntangable isIntangible
+#define isTangable kIsTangible
+#define isIntangable kIsIntangible
enum spriteTypes {
- objOnGround = 0,
- objInContainerView,
- objAsMousePtr
+ kObjOnGround = 0,
+ kObjInContainerView,
+ kObjAsMousePtr
};
// Memeber functions
@@ -647,7 +647,7 @@ public:
virtual void getColorTranslation(ColorTable map);
// return the sprite data of amount 'count'
- virtual ObjectSpriteInfo getSprite(GameObject *obj, enum spriteTypes spr, int16 count = -1);
+ virtual ObjectSpriteInfo getSprite(GameObject *obj, spriteTypes spr, int16 count = -1);
// return the address of the sprite when held in hand
virtual Sprite *getOrientedSprite(GameObject *obj, int16 offset);
@@ -798,10 +798,10 @@ public:
class PhysicalContainerProto : public InventoryProto {
private:
enum {
- ViewableRows = 4,
- ViewableCols = 4,
- maxRows = 8,
- maxCols = 4
+ kViewableRows = 4,
+ kViewableCols = 4,
+ kMaxRows = 8,
+ kMaxCols = 4
};
public:
@@ -850,16 +850,16 @@ public:
public:
virtual uint16 getViewableRows() {
- return ViewableRows;
+ return kViewableRows;
}
virtual uint16 getViewableCols() {
- return ViewableCols;
+ return kViewableCols;
}
virtual uint16 getMaxRows() {
- return maxRows;
+ return kMaxRows;
}
virtual uint16 getMaxCols() {
- return maxCols;
+ return kMaxCols;
}
virtual bool canFitBulkwise(GameObject *container, GameObject *obj);
@@ -956,7 +956,7 @@ class WeaponProto : public InventoryProto {
protected:
enum {
- inRangeRatingBonus = 4
+ kInRangeRatingBonus = 4
};
public:
@@ -1427,7 +1427,7 @@ public:
virtual void getColorTranslation(ColorTable map);
// return the sprite data
- virtual ObjectSpriteInfo getSprite(GameObject *obj, enum spriteTypes spr, int16);
+ virtual ObjectSpriteInfo getSprite(GameObject *obj, spriteTypes spr, int16);
};
/* ======================================================================== *
diff --git a/engines/saga2/sagafunc.cpp b/engines/saga2/sagafunc.cpp
index 226476f659c..bdd2d2d4072 100644
--- a/engines/saga2/sagafunc.cpp
+++ b/engines/saga2/sagafunc.cpp
@@ -231,7 +231,7 @@ int16 scriptActorTransfer(int16 *args) {
// Move the object to a new location
if ((isObject(args[0])
&& (GameObject::protoAddress(args[0])->containmentSet()
- & ProtoObj::isContainer))
+ & ProtoObj::kIsContainer))
|| isActor(args[0])) {
ObjectID targetID = args[0];
GameObject *target = GameObject::objectAddress(targetID);
@@ -243,8 +243,8 @@ int16 scriptActorTransfer(int16 *args) {
uint16 cSet = target->proto()->containmentSet();
obj->move(Location(targetSlot, targetID));
- if ((cSet & (ProtoObj::isIntangible | ProtoObj::isContainer))
- == (ProtoObj::isIntangible | ProtoObj::isContainer))
+ if ((cSet & (ProtoObj::kIsIntangible | ProtoObj::kIsContainer))
+ == (ProtoObj::kIsIntangible | ProtoObj::kIsContainer))
g_vm->_cnm->setUpdate(targetID);
}
} else {
@@ -966,7 +966,7 @@ int16 scriptGameObjectGetMass(int16 *) {
OBJLOG(GetMass);
GameObject *obj = ((ObjectData *)thisThread->_thisObject)->obj;
- return (obj->proto()->flags & ResourceObjectPrototype::objPropMergeable)
+ return (obj->proto()->flags & ResourceObjectPrototype::kObjPropMergeable)
? obj->getExtra() : 1;
}
@@ -978,9 +978,9 @@ int16 scriptGameObjectSetMass(int16 *args) {
OBJLOG(SetMass);
GameObject *obj = ((ObjectData *)thisThread->_thisObject)->obj;
- if (obj->proto()->flags & ResourceObjectPrototype::objPropMergeable) {
+ if (obj->proto()->flags & ResourceObjectPrototype::kObjPropMergeable) {
obj->setExtra(args[0]);
- if (obj->proto()->flags & ResourceObjectPrototype::objPropMergeable) {
+ if (obj->proto()->flags & ResourceObjectPrototype::kObjPropMergeable) {
g_vm->_cnm->setUpdate(obj->IDParent());
}
return true;
@@ -2068,7 +2068,7 @@ int16 scriptActorDeductPayment(int16 *args) {
GameObject *obj, *delObj = nullptr;
ObjectID id;
bool mergeable =
- currencyProto->flags & ResourceObjectPrototype::objPropMergeable;
+ currencyProto->flags & ResourceObjectPrototype::kObjPropMergeable;
RecursiveContainerIterator iter(a);
@@ -2145,7 +2145,7 @@ int16 scriptActorCountPayment(int16 *args) {
GameObject *obj = nullptr;
ObjectID id;
bool mergeable =
- currencyProto->flags & ResourceObjectPrototype::objPropMergeable;
+ currencyProto->flags & ResourceObjectPrototype::kObjPropMergeable;
RecursiveContainerIterator iter(a);
@@ -2923,7 +2923,7 @@ int16 scriptMakeObject(int16 *args) {
obj->setScript(args[2]);
// If it's a mergeable object, have it's mass count default to 1.
- if (obj->proto()->flags & ResourceObjectPrototype::objPropMergeable)
+ if (obj->proto()->flags & ResourceObjectPrototype::kObjPropMergeable)
obj->setExtra(1);
return obj->thisID();
diff --git a/engines/saga2/task.cpp b/engines/saga2/task.cpp
index 06aec511f68..b4b8b75e287 100644
--- a/engines/saga2/task.cpp
+++ b/engines/saga2/task.cpp
@@ -3233,13 +3233,13 @@ void HuntToKillTask::evaluateWeapon() {
uint16 cSet = proto->containmentSet();
// Simply use all armor objects
- if (!isPlayerActor(a) && (cSet & ProtoObj::isArmor)) {
+ if (!isPlayerActor(a) && (cSet & ProtoObj::kIsArmor)) {
if (proto->useSlotAvailable(obj, a))
obj->use(actorID);
continue;
}
- if (cSet & ProtoObj::isWeapon) {
+ if (cSet & ProtoObj::kIsWeapon) {
WeaponProto *weaponProto = (WeaponProto *)proto;
int weaponRating;
diff --git a/engines/saga2/tilemode.cpp b/engines/saga2/tilemode.cpp
index 57e0a8252a7..7400c08a363 100644
--- a/engines/saga2/tilemode.cpp
+++ b/engines/saga2/tilemode.cpp
@@ -416,7 +416,7 @@ static void evalMouseState() {
if (g_vm->_mouseInfo->getIntent() == GrabInfo::kIntUse) {
assert(obj != nullptr);
- if (mObj->containmentSet() & (ProtoObj::isSkill | ProtoObj::isSpell)) {
+ if (mObj->containmentSet() & (ProtoObj::kIsSkill | ProtoObj::kIsSpell)) {
GameObject *tob = pickedObject != Nothing ? obj : nullptr;
// If it's a spell we need to do more complex testing
// to see if the current target is valid
@@ -1062,7 +1062,7 @@ static APPFUNC(cmdClickTileMap) {
// If we are using an intangible object (spell) then consider
// the owner of the spell to be the center actor for the rest
// of this action.
- if (mouseObject->proto()->containmentSet() & (ProtoObj::isIntangible | ProtoObj::isSpell | ProtoObj::isSkill)) {
+ if (mouseObject->proto()->containmentSet() & (ProtoObj::kIsIntangible | ProtoObj::kIsSpell | ProtoObj::kIsSkill)) {
ObjectID possessor = mouseObject->possessor();
if (possessor != Nothing) {
@@ -1182,7 +1182,7 @@ static APPFUNC(cmdClickTileMap) {
*centerActorPtr,
GameObject::objectAddress(pickedObject)->getLocation());
- if (pickedObjPtr->proto()->flags & ResourceObjectPrototype::objPropMergeable)
+ if (pickedObjPtr->proto()->flags & ResourceObjectPrototype::kObjPropMergeable)
quantity = pickedObjPtr->getExtra();
if (pickedObjPtr->take(centerActorID, quantity))
Commit: bd03133ec78c1746fc9a80080c8b2430f115065e
https://github.com/scummvm/scummvm/commit/bd03133ec78c1746fc9a80080c8b2430f115065e
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-10-29T13:41:51+02:00
Commit Message:
SAGA2: Rename enums in panel.h
Changed paths:
engines/saga2/automap.cpp
engines/saga2/button.cpp
engines/saga2/contain.cpp
engines/saga2/document.cpp
engines/saga2/floating.cpp
engines/saga2/grequest.cpp
engines/saga2/gtextbox.cpp
engines/saga2/intrface.cpp
engines/saga2/main.cpp
engines/saga2/msgbox.cpp
engines/saga2/objects.cpp
engines/saga2/panel.cpp
engines/saga2/panel.h
engines/saga2/speech.cpp
engines/saga2/tilemode.cpp
engines/saga2/uidialog.cpp
engines/saga2/videobox.cpp
diff --git a/engines/saga2/automap.cpp b/engines/saga2/automap.cpp
index d0fe8b45dc5..f01ecb008d7 100644
--- a/engines/saga2/automap.cpp
+++ b/engines/saga2/automap.cpp
@@ -243,7 +243,7 @@ void AutoMap::deactivate() {
// activation
bool AutoMap::activate(gEventType why) {
- if (why == gEventMouseDown) { // momentarily depress
+ if (why == kEventMouseDown) { // momentarily depress
_selected = 1;
notify(why, 0); // notify App of successful hit
return true;
@@ -307,7 +307,7 @@ void AutoMap::pointerMove(gPanelMessage &msg) {
char *mtext = getMapFeaturesText(viewRegion, currentWorld->_mapNum, _baseCoords, pos) ;
g_vm->_mouseInfo->setText(mtext);
} else {
- notify(gEventMouseMove, 0);
+ notify(kEventMouseMove, 0);
}
}
@@ -356,7 +356,7 @@ bool AutoMap::pointerHit(gPanelMessage &msg) {
}
}
- activate(gEventMouseDown);
+ activate(kEventMouseDown);
return true;
}
@@ -365,7 +365,7 @@ bool AutoMap::pointerHit(gPanelMessage &msg) {
void AutoMap::pointerDrag(gPanelMessage &) {
if (_selected) {
- notify(gEventMouseDrag, 0);
+ notify(kEventMouseDrag, 0);
}
}
@@ -373,7 +373,7 @@ void AutoMap::pointerDrag(gPanelMessage &) {
// mouse click release event handler
void AutoMap::pointerRelease(gPanelMessage &) {
- if (_selected) notify(gEventMouseUp, 0); // notify App of successful hit
+ if (_selected) notify(kEventMouseUp, 0); // notify App of successful hit
deactivate();
}
@@ -598,7 +598,7 @@ APPFUNC(cmdAutoMapQuit) {
gWindow *win;
requestInfo *ri;
- if (ev.panel && ev.eventType == gEventNewValue && ev.value) {
+ if (ev.panel && ev.eventType == kEventNewValue && ev.value) {
win = ev.panel->getWindow(); // get the window pointer
ri = win ? (requestInfo *)win->_userData : nullptr;
@@ -613,7 +613,7 @@ APPFUNC(cmdAutoMapQuit) {
// event handler
APPFUNC(cmdAutoMapScroll) {
- if (ev.panel && ev.eventType == gEventNewValue && ev.value) {
+ if (ev.panel && ev.eventType == kEventNewValue && ev.value) {
static const Rect16 vPosRect(0, 0, scrollBtnWidth / 2, scrollBtnHeight / 2);
static const Rect16 uPosRect(scrollBtnWidth / 2, 0, scrollBtnWidth / 2, scrollBtnHeight / 2);
static const Rect16 uNegRect(0, scrollBtnHeight / 2, scrollBtnWidth / 2, scrollBtnHeight / 2);
@@ -629,7 +629,7 @@ APPFUNC(cmdAutoMapScroll) {
}
APPFUNC(cmdAutoMapAppFunc) {
- if (ev.panel && ev.eventType == gEventMouseMove) {
+ if (ev.panel && ev.eventType == kEventMouseMove) {
// mouse moved
static const Rect16 vPosRect(0, 0, scrollBtnWidth / 2, scrollBtnHeight / 2);
diff --git a/engines/saga2/button.cpp b/engines/saga2/button.cpp
index 346f5a3f81e..72d5e4fb2d0 100644
--- a/engines/saga2/button.cpp
+++ b/engines/saga2/button.cpp
@@ -191,7 +191,7 @@ void GfxCompImage::pointerMove(gPanelMessage &msg) {
// call the superclass's pointerMove
gControl::pointerMove(msg);
- notify(gEventMouseMove, (msg._pointerEnter ? kEnter : 0) | (msg._pointerLeave ? kLeave : 0));
+ notify(kEventMouseMove, (msg._pointerEnter ? kEnter : 0) | (msg._pointerLeave ? kLeave : 0));
}
void GfxCompImage::enable(bool abled) {
@@ -534,9 +534,9 @@ bool GfxCompButton::activate(gEventType why) {
_selected = 1;
_window.update(_extent);
- if (why == gEventKeyDown) { // momentarily depress
+ if (why == kEventKeyDown) { // momentarily depress
deactivate();
- notify(gEventNewValue, 1); // notify App of successful hit
+ notify(kEventNewValue, 1); // notify App of successful hit
}
playMemSound(2);
return false;
@@ -546,7 +546,7 @@ void GfxCompButton::pointerMove(gPanelMessage &msg) {
if (_dimmed)
return;
- //notify( gEventMouseMove, (msg.pointerEnter ? enter : 0)|(msg.pointerLeave ? leave : 0));
+ //notify( kEventMouseMove, (msg.pointerEnter ? enter : 0)|(msg.pointerLeave ? leave : 0));
GfxCompImage::pointerMove(msg);
}
@@ -554,7 +554,7 @@ bool GfxCompButton::pointerHit(gPanelMessage &) {
if (_dimmed)
return false;
- activate(gEventMouseDown);
+ activate(kEventMouseDown);
return true;
}
@@ -563,7 +563,7 @@ void GfxCompButton::pointerRelease(gPanelMessage &) {
if (_selected) {
deactivate(); // give back input focus
- notify(gEventNewValue, 1); // notify App of successful hit
+ notify(kEventNewValue, 1); // notify App of successful hit
} else deactivate();
}
@@ -614,18 +614,18 @@ GfxOwnerSelCompButton::GfxOwnerSelCompButton(gPanelList &list, const Rect16 &box
}
bool GfxOwnerSelCompButton::activate(gEventType why) {
- if (why == gEventKeyDown || why == gEventMouseDown) {
+ if (why == kEventKeyDown || why == kEventMouseDown) {
// selected = !selected;
// window.update( extent );
gPanel::deactivate();
- notify(gEventNewValue, _selected); // notify App of successful hit
+ notify(kEventNewValue, _selected); // notify App of successful hit
playMemSound(2);
}
return false;
}
bool GfxOwnerSelCompButton::pointerHit(gPanelMessage &) {
- return activate(gEventMouseDown);
+ return activate(kEventMouseDown);
}
void GfxOwnerSelCompButton::select(uint16 val) {
@@ -723,7 +723,7 @@ GfxMultCompButton::~GfxMultCompButton() {
}
bool GfxMultCompButton::activate(gEventType why) {
- if (why == gEventKeyDown || why == gEventMouseDown) {
+ if (why == kEventKeyDown || why == kEventMouseDown) {
if (_response) {
if (++_current > _max) {
_current = 0;
@@ -732,7 +732,7 @@ bool GfxMultCompButton::activate(gEventType why) {
}
gPanel::deactivate();
- notify(gEventNewValue, _current); // notify App of successful hit
+ notify(kEventNewValue, _current); // notify App of successful hit
playMemSound(1);
// playSound( MKTAG('C','B','T',5) );
}
@@ -740,7 +740,7 @@ bool GfxMultCompButton::activate(gEventType why) {
}
bool GfxMultCompButton::pointerHit(gPanelMessage &) {
- return activate(gEventMouseDown);
+ return activate(kEventMouseDown);
}
void *GfxMultCompButton::getCurrentCompImage() {
@@ -837,11 +837,11 @@ void GfxSlider::drawClipped(gPort &port,
}
bool GfxSlider::activate(gEventType why) {
- if (why == gEventKeyDown || why == gEventMouseDown) {
+ if (why == kEventKeyDown || why == kEventMouseDown) {
_selected = 1;
_window.update(_extent);
gPanel::deactivate();
- notify(gEventNewValue, _slCurrent); // notify App of successful hit
+ notify(kEventNewValue, _slCurrent); // notify App of successful hit
}
return false;
}
@@ -859,7 +859,7 @@ bool GfxSlider::pointerHit(gPanelMessage &msg) {
// redraw the control should any visual change hath occurred
_window.update(_extent);
- activate(gEventMouseDown);
+ activate(kEventMouseDown);
return true;
}
@@ -871,7 +871,7 @@ void GfxSlider::pointerMove(gPanelMessage &msg) {
// redraw the control should any visual change hath occurred
_window.update(_extent);
- notify(gEventMouseMove, _slCurrent);
+ notify(kEventMouseMove, _slCurrent);
}
}
@@ -879,7 +879,7 @@ void GfxSlider::pointerRelease(gPanelMessage &) {
// We have to test selected first because deactivate clears it.
if (_selected) {
deactivate(); // give back input focus
- notify(gEventNewValue, _slCurrent); // notify App of successful hit
+ notify(kEventNewValue, _slCurrent); // notify App of successful hit
} else deactivate();
}
@@ -887,7 +887,7 @@ void GfxSlider::pointerDrag(gPanelMessage &msg) {
// update the image index
updateSliderIndexes(msg._pickPos);
- notify(gEventNewValue, _slCurrent); // notify App of successful hit
+ notify(kEventNewValue, _slCurrent); // notify App of successful hit
// redraw the control should any visual change hath occurred
_window.update(_extent);
}
diff --git a/engines/saga2/contain.cpp b/engines/saga2/contain.cpp
index 58787247b10..cd8e744c030 100644
--- a/engines/saga2/contain.cpp
+++ b/engines/saga2/contain.cpp
@@ -617,7 +617,7 @@ bool ContainerView::pointerHit(gPanelMessage &msg) {
totalObjects();
_window.update(_extent);
- return activate(gEventMouseDown);
+ return activate(kEventMouseDown);
}
void ContainerView::pointerRelease(gPanelMessage &) {
@@ -1798,7 +1798,7 @@ void setMindContainer(int index, IntangibleContainerWindow &cw) {
}
APPFUNC(cmdMindContainerFunc) {
- if (ev.panel && ev.eventType == gEventNewValue /* && ev.value */) {
+ if (ev.panel && ev.eventType == kEventNewValue /* && ev.value */) {
IntangibleContainerWindow *cw = (IntangibleContainerWindow *)ev.window;
ContainerNode &nd = cw->getView()._node;
int newMindType = nd._mindType;
@@ -1818,7 +1818,7 @@ APPFUNC(cmdMindContainerFunc) {
setMindContainer(nd._mindType, *cw);
cw->update(cw->getView().getExtent());
}
- } else if (ev.eventType == gEventMouseMove) {
+ } else if (ev.eventType == kEventMouseMove) {
//if (ev.value == gCompImage::enter)
{
const Rect16 idea(0, 0, 22, 67), // idea button click area
@@ -1868,7 +1868,7 @@ APPFUNC(cmdMindContainerFunc) {
}
APPFUNC(cmdCloseButtonFunc) {
- if (ev.eventType == gEventNewValue && ev.value == 1) {
+ if (ev.eventType == kEventNewValue && ev.value == 1) {
ContainerWindow *win = (ContainerWindow *)ev.window;
if (win->getView()._node.getType() == ContainerNode::kMentalType) {
@@ -1882,7 +1882,7 @@ APPFUNC(cmdCloseButtonFunc) {
if (g_vm->_mouseInfo->getObject() == nullptr) {
g_vm->_mouseInfo->setText(nullptr);
}
- } else if (ev.eventType == gEventMouseMove) {
+ } else if (ev.eventType == kEventMouseMove) {
if (ev.value == GfxCompImage::kEnter) {
g_vm->_mouseInfo->setText(CLOSE_MOUSE);
} else if (ev.value == GfxCompImage::kLeave) {
@@ -1892,7 +1892,7 @@ APPFUNC(cmdCloseButtonFunc) {
}
APPFUNC(cmdScrollFunc) {
- if (ev.panel && ev.eventType == gEventNewValue && ev.value) {
+ if (ev.panel && ev.eventType == kEventNewValue && ev.value) {
ScrollableContainerWindow *cw;
const Rect16 upArea(0, 0, 44, 22);
@@ -1902,7 +1902,7 @@ APPFUNC(cmdScrollFunc) {
else
cw->scrollDown();
ev.window->update(cw->getView().getExtent());
- } else if (ev.eventType == gEventMouseMove) {
+ } else if (ev.eventType == kEventMouseMove) {
if (ev.value == GfxCompImage::kEnter) {
g_vm->_mouseInfo->setText(SCROLL_MOUSE);
} else if (ev.value == GfxCompImage::kLeave) {
diff --git a/engines/saga2/document.cpp b/engines/saga2/document.cpp
index bbe6e9c2922..45c0d8a9b96 100644
--- a/engines/saga2/document.cpp
+++ b/engines/saga2/document.cpp
@@ -228,7 +228,7 @@ void CDocument::deactivate() {
}
bool CDocument::activate(gEventType why) {
- if (why == gEventMouseDown) { // momentarily depress
+ if (why == kEventMouseDown) { // momentarily depress
_selected = 1;
notify(why, 0); // notify App of successful hit
return true;
@@ -292,12 +292,12 @@ void CDocument::pointerMove(gPanelMessage &msg) {
setMouseImage(kMouseArrowImage, 0, 0);
}
- notify(gEventMouseMove, 0);
+ notify(kEventMouseMove, 0);
}
void CDocument::pointerDrag(gPanelMessage &) {
if (_selected) {
- notify(gEventMouseDrag, 0);
+ notify(kEventMouseDrag, 0);
}
}
@@ -331,7 +331,7 @@ bool CDocument::pointerHit(gPanelMessage &msg) {
}
}
- activate(gEventMouseDown);
+ activate(kEventMouseDown);
return true;
}
@@ -347,7 +347,7 @@ void CDocument::gotoPage(int8 page) {
}
void CDocument::pointerRelease(gPanelMessage &) {
- if (_selected) notify(gEventMouseUp, 0); // notify App of successful hit
+ if (_selected) notify(kEventMouseUp, 0); // notify App of successful hit
deactivate();
}
@@ -865,7 +865,7 @@ APPFUNC(cmdDocumentQuit) {
gWindow *win;
requestInfo *ri;
- if (ev.panel && ev.eventType == gEventNewValue && ev.value) {
+ if (ev.panel && ev.eventType == kEventNewValue && ev.value) {
win = ev.panel->getWindow(); // get the window pointer
ri = win ? (requestInfo *)win->_userData : nullptr;
diff --git a/engines/saga2/floating.cpp b/engines/saga2/floating.cpp
index c546f24d26f..0e4eb9397d6 100644
--- a/engines/saga2/floating.cpp
+++ b/engines/saga2/floating.cpp
@@ -387,15 +387,15 @@ bool gButton::activate(gEventType why) {
_selected = 1;
draw();
- if (why == gEventKeyDown) { // momentarily depress
+ if (why == kEventKeyDown) { // momentarily depress
deactivate();
- notify(gEventNewValue, 1); // notify App of successful hit
+ notify(kEventNewValue, 1); // notify App of successful hit
}
return false;
}
bool gButton::pointerHit(gPanelMessage &) {
- activate(gEventMouseDown);
+ activate(kEventMouseDown);
return true;
}
@@ -404,7 +404,7 @@ void gButton::pointerRelease(gPanelMessage &) {
if (_selected) {
deactivate(); // give back input focus
- notify(gEventNewValue, 1); // notify App of successful hit
+ notify(kEventNewValue, 1); // notify App of successful hit
} else deactivate();
}
@@ -449,17 +449,17 @@ void gImageButton::drawClipped(gPort &port, const Point16 &offset, const Rect16
* ===================================================================== */
bool gToggleButton::activate(gEventType why) {
- if (why == gEventKeyDown || why == gEventMouseDown) {
+ if (why == kEventKeyDown || why == kEventMouseDown) {
_selected = !_selected;
draw();
gPanel::deactivate();
- notify(gEventNewValue, _selected); // notify App of successful hit
+ notify(kEventNewValue, _selected); // notify App of successful hit
}
return false;
}
bool gToggleButton::pointerHit(gPanelMessage &) {
- return activate(gEventMouseDown);
+ return activate(kEventMouseDown);
}
/* ===================================================================== *
diff --git a/engines/saga2/grequest.cpp b/engines/saga2/grequest.cpp
index 2f1cae92807..f66c361d9af 100644
--- a/engines/saga2/grequest.cpp
+++ b/engines/saga2/grequest.cpp
@@ -63,7 +63,7 @@ static void handleRequestEvent(gEvent &ev) {
gWindow *win;
requestInfo *ri;
- if (ev.panel && ev.eventType == gEventNewValue && ev.value) {
+ if (ev.panel && ev.eventType == kEventNewValue && ev.value) {
win = ev.panel->getWindow(); // get the window pointer
ri = win ? (requestInfo *)win->_userData : nullptr;
diff --git a/engines/saga2/gtextbox.cpp b/engines/saga2/gtextbox.cpp
index 0da773a8c2e..3a29c84b713 100644
--- a/engines/saga2/gtextbox.cpp
+++ b/engines/saga2/gtextbox.cpp
@@ -66,12 +66,12 @@ extern gFont *mainFont;
* that it is tab-selectable.
*
* /h2/NOTIFICATIONS
-* This class sends a gEventNewValue whenever the text box becomes
+* This class sends a kEventNewValue whenever the text box becomes
* deactivated. If the deactivation occurred because of the user
* hitting return, then the value of the event will be 1; In all
* other cases it is zero.
*
-* In addition, a gEventAltValue is sent for each character
+* In addition, a kEventAltValue is sent for each character
* typed. (Value is always 0). This is to allow other displays
* to be dynamically updated as the user types.
*
@@ -347,7 +347,7 @@ void gTextBox::setEditExtent(const Rect16 &r) {
//-----------------------------------------------------------------------
bool gTextBox::activate(gEventType why) {
- if (why == gEventAltValue) { // momentarily depress
+ if (why == kEventAltValue) { // momentarily depress
_selected = 1;
notify(why, 0); // notify App of successful hit
return true;
@@ -359,7 +359,7 @@ bool gTextBox::activate(gEventType why) {
_selected = 1;
_fullRedraw = true;
draw();
- if (why == gEventNone)
+ if (why == kEventNone)
return true;
return gPanel::activate(why);
}
@@ -399,7 +399,7 @@ void gTextBox::commitEdit() {
memcpy(_undoBuffer, _fieldStrings[_index], _currentLen[_index] + 1);
_undoLen = _currentLen[_index];
_cursorPos = _anchorPos = _currentLen[_index];
- notify(gEventNewValue, 1); // tell app about new value
+ notify(kEventNewValue, 1); // tell app about new value
}
}
@@ -410,7 +410,7 @@ void gTextBox::revertEdit() {
if (_undoBuffer && changed()) {
_cursorPos = _anchorPos = _currentLen[_index] = _undoLen;
memcpy(_fieldStrings[_index], _undoBuffer, _currentLen[_index] + 1);
- notify(gEventNewValue, 0); // tell app about new value
+ notify(kEventNewValue, 0); // tell app about new value
}
}
@@ -541,7 +541,7 @@ void gTextBox::selectionMove(int howMany) {
draw();
- //activate(gEventAltValue);
+ //activate(kEventAltValue);
}
@@ -593,7 +593,7 @@ bool gTextBox::pointerHit(gPanelMessage &msg) {
makeActive();
}
}
- return true; //gControl::activate( gEventMouseDown );
+ return true; //gControl::activate( kEventMouseDown );
}
@@ -676,7 +676,7 @@ bool gTextBox::keyStroke(gPanelMessage &msg) {
if (_onEnter != nullptr) {
gEvent ev;
- ev.eventType = gEventKeyDown ;
+ ev.eventType = kEventKeyDown ;
ev.value = 1;
ev.panel = _parent;
(*_onEnter)(ev);
@@ -688,7 +688,7 @@ bool gTextBox::keyStroke(gPanelMessage &msg) {
deactivate(); // deactivate the text box
if (_onEscape != nullptr) {
gEvent ev;
- ev.eventType = gEventKeyDown ;
+ ev.eventType = kEventKeyDown ;
ev.value = 1;
ev.value = 1;
ev.panel = this; //_parent;
@@ -729,14 +729,14 @@ bool gTextBox::keyStroke(gPanelMessage &msg) {
if (_undoBuffer) {
_cursorPos = _anchorPos = _currentLen[_index] = _undoLen;
memcpy(_fieldStrings[_index], _undoBuffer, _currentLen[_index] + 1);
- notify(gEventAltValue, 0); // tell app about new value
+ notify(kEventAltValue, 0); // tell app about new value
}
} else {
// Insert text, if it will fit
if (insertText((char *)&key, 1) == false)
return false;
- notify(gEventAltValue, 0); // tell app about new value
+ notify(kEventAltValue, 0); // tell app about new value
}
break;
@@ -753,7 +753,7 @@ bool gTextBox::keyStroke(gPanelMessage &msg) {
_currentLen[_index] - (selStart + selWidth));
_cursorPos = _anchorPos = selStart; // adjust cursor pos
_currentLen[_index] -= selWidth; // adjust str len
- notify(gEventAltValue, 0); // tell app about new value
+ notify(kEventAltValue, 0); // tell app about new value
break;
case Common::KEYCODE_DELETE:
@@ -769,7 +769,7 @@ bool gTextBox::keyStroke(gPanelMessage &msg) {
_currentLen[_index] - (selStart + selWidth));
_cursorPos = _anchorPos = selStart; // adjust cursor pos
_currentLen[_index] -= selWidth; // adjust str len
- notify(gEventAltValue, 0); // tell app about new value
+ notify(kEventAltValue, 0); // tell app about new value
break;
case Common::ASCII_TAB:
@@ -786,7 +786,7 @@ bool gTextBox::keyStroke(gPanelMessage &msg) {
if (insertText((char *)&key, 1) == false)
return false;
- notify(gEventAltValue, 0); // tell app about new value
+ notify(kEventAltValue, 0); // tell app about new value
}
break;
diff --git a/engines/saga2/intrface.cpp b/engines/saga2/intrface.cpp
index 1157add22fa..1e181426368 100644
--- a/engines/saga2/intrface.cpp
+++ b/engines/saga2/intrface.cpp
@@ -2071,7 +2071,7 @@ APPFUNC(cmdPortrait) {
switch (ev.eventType) {
- case gEventNewValue:
+ case kEventNewValue:
if (mouseObject != nullptr) {
PlayerActor *pa = getPlayerActorAddress(translatePanID(panID));
@@ -2122,7 +2122,7 @@ APPFUNC(cmdPortrait) {
}
break;
- case gEventMouseMove:
+ case kEventMouseMove:
if (ev.value == GfxCompImage::kLeave) {
g_vm->_mouseInfo->setText(nullptr);
@@ -2189,7 +2189,7 @@ APPFUNC(cmdAggressive) {
// check for message update stuff
// and aggression update
- if (ev.eventType == gEventNewValue) {
+ if (ev.eventType == kEventNewValue) {
toggleAgression(transBroID, rightButtonState());
// int16 wasAggressive = isAggressive( transBroID );
@@ -2199,7 +2199,7 @@ APPFUNC(cmdAggressive) {
// setAggression( i, !wasAggressive );
// }
// else setAggression( transBroID, !wasAggressive );
- } else if (ev.eventType == gEventMouseMove) {
+ } else if (ev.eventType == kEventMouseMove) {
if (ev.value == GfxCompImage::kEnter) {
// set the text in the cursor
g_vm->_mouseInfo->setText(isAggressive(transBroID)
@@ -2214,7 +2214,7 @@ APPFUNC(cmdAggressive) {
/*
APPFUNC( cmdJump )
{
- if( ev.eventType == gEventNewValue )
+ if( ev.eventType == kEventNewValue )
{
jump = !jump;
@@ -2231,7 +2231,7 @@ APPFUNC( cmdJump )
*/
APPFUNC(cmdArmor) {
- if (ev.eventType == gEventMouseMove) {
+ if (ev.eventType == kEventMouseMove) {
if (ev.value == GfxCompImage::kEnter) {
gArmorIndicator *gai = (gArmorIndicator *)ev.panel;
@@ -2259,12 +2259,12 @@ APPFUNC(cmdArmor) {
APPFUNC(cmdCenter) {
uint16 transBroID = translatePanID(ev.panel->_id);
- if (ev.eventType == gEventNewValue) {
+ if (ev.eventType == kEventNewValue) {
if (rightButtonState())
setCenterBrother((transBroID + 1) % kPlayerActors);
else setCenterBrother(transBroID);
}
- if (ev.eventType == gEventMouseMove) {
+ if (ev.eventType == kEventMouseMove) {
if (ev.value == GfxCompImage::kEnter) {
// set the text in the cursor
g_vm->_mouseInfo->setText(getCenterActorPlayerID() == transBroID
@@ -2288,7 +2288,7 @@ void toggleBanding(PlayerActorID bro, bool all) {
APPFUNC(cmdBand) {
uint16 transBroID = translatePanID(ev.panel->_id);
- if (ev.eventType == gEventNewValue) {
+ if (ev.eventType == kEventNewValue) {
toggleBanding(transBroID, rightButtonState());
// int16 wasBanded = isBanded( transBroID );
//
@@ -2298,7 +2298,7 @@ APPFUNC(cmdBand) {
// setBanded( i, !wasBanded );
// }
// else setBanded( transBroID, !wasBanded );
- } else if (ev.eventType == gEventMouseMove) {
+ } else if (ev.eventType == kEventMouseMove) {
if (ev.value == GfxCompImage::kEnter) {
// set the text in the cursor
g_vm->_mouseInfo->setText(isBanded(transBroID)
@@ -2311,17 +2311,17 @@ APPFUNC(cmdBand) {
}
APPFUNC(cmdOptions) {
- if (ev.eventType == gEventNewValue) {
+ if (ev.eventType == kEventNewValue) {
OptionsDialog();
//openOptionsPanel();
- } else if (ev.eventType == gEventMouseMove) {
+ } else if (ev.eventType == kEventMouseMove) {
if (ev.value == GfxCompImage::kEnter) g_vm->_mouseInfo->setText(OPTIONS_PANEL);
else if (ev.value == GfxCompImage::kLeave) g_vm->_mouseInfo->setText(nullptr);
}
}
APPFUNC(cmdBroChange) {
- if (ev.eventType == gEventNewValue) {
+ if (ev.eventType == kEventNewValue) {
if (!isBrotherDead(ev.panel->_id)) {
setCenterBrother(ev.panel->_id);
// this sets up the _buttons in trio mode to the correct
@@ -2329,7 +2329,7 @@ APPFUNC(cmdBroChange) {
setTrioBtns();
setControlPanelsToIndividualMode(ev.panel->_id);
}
- } else if (ev.eventType == gEventMouseMove) {
+ } else if (ev.eventType == kEventMouseMove) {
const int bufSize = 80;
const int stateBufSize = 60;
@@ -2365,7 +2365,7 @@ APPFUNC(cmdBroChange) {
APPFUNC(cmdHealthStar) {
uint16 transBroID = translatePanID(ev.panel->_id);
- if (ev.eventType == gEventMouseMove) {
+ if (ev.eventType == kEventMouseMove) {
if (ev.value == GfxCompImage::kLeave) {
g_vm->_mouseInfo->setText(nullptr);
return;
@@ -2390,7 +2390,7 @@ APPFUNC(cmdMassInd) {
gWindow *win = nullptr;
GameObject *_containerObject = nullptr;
- if (ev.eventType == gEventMouseMove) {
+ if (ev.eventType == kEventMouseMove) {
if (ev.value == GfxCompImage::kEnter) {
const int bufSize = 40;
int curWeight;
@@ -2428,7 +2428,7 @@ APPFUNC(cmdBulkInd) {
GameObject *_containerObject = nullptr;
- if (ev.eventType == gEventMouseMove) {
+ if (ev.eventType == kEventMouseMove) {
if (ev.value == GfxCompImage::kEnter) {
const int bufSize = 40;
uint16 baseBulk = 100;
@@ -2462,7 +2462,7 @@ APPFUNC(cmdBulkInd) {
}
APPFUNC(cmdManaInd) {
- if (ev.eventType == gEventMouseMove) {
+ if (ev.eventType == kEventMouseMove) {
if (ev.value != GfxCompImage::kLeave) {
const int BUF_SIZE = 64;
char textBuffer[BUF_SIZE];
diff --git a/engines/saga2/main.cpp b/engines/saga2/main.cpp
index a16ee8d6629..7a20417f4d3 100644
--- a/engines/saga2/main.cpp
+++ b/engines/saga2/main.cpp
@@ -851,7 +851,7 @@ APPFUNC(cmdWindowFunc) {
int16 key, qual;
switch (ev.eventType) {
- case gEventKeyDown:
+ case kEventKeyDown:
key = ev.value & 0xffff;
qual = ev.value >> 16;
diff --git a/engines/saga2/msgbox.cpp b/engines/saga2/msgbox.cpp
index 26c72471ee5..c9d70bd2e96 100644
--- a/engines/saga2/msgbox.cpp
+++ b/engines/saga2/msgbox.cpp
@@ -104,7 +104,7 @@ APPFUNC(ErrorWindow::cmdMessageWindow) {
gWindow *win;
requestInfo *ri;
- if (ev.panel && ev.eventType == gEventNewValue && ev.value) {
+ if (ev.panel && ev.eventType == kEventNewValue && ev.value) {
win = ev.panel->getWindow(); // get the window pointer
ri = win ? (requestInfo *)win->_userData : nullptr;
@@ -353,10 +353,10 @@ bool SimpleButton::activate(gEventType why) {
_selected = 1;
draw();
- if (why == gEventKeyDown) { // momentarily depress
+ if (why == kEventKeyDown) { // momentarily depress
//delay( 200 );
deactivate();
- notify(gEventNewValue, 1); // notify App of successful hit
+ notify(kEventNewValue, 1); // notify App of successful hit
}
return false;
}
@@ -364,7 +364,7 @@ bool SimpleButton::activate(gEventType why) {
bool SimpleButton::pointerHit(gPanelMessage &) {
//if (ghosted) return false;
- activate(gEventMouseDown);
+ activate(kEventMouseDown);
return true;
}
@@ -373,7 +373,7 @@ void SimpleButton::pointerRelease(gPanelMessage &) {
if (_selected) {
deactivate(); // give back input focus
- notify(gEventNewValue, 1); // notify App of successful hit
+ notify(kEventNewValue, 1); // notify App of successful hit
} else deactivate();
}
diff --git a/engines/saga2/objects.cpp b/engines/saga2/objects.cpp
index 548ea08769f..4877405a9c0 100644
--- a/engines/saga2/objects.cpp
+++ b/engines/saga2/objects.cpp
@@ -4365,7 +4365,7 @@ APPFUNC(cmdBrain) {
if (!indivControls->getEnabled())
return;
- if (ev.eventType == gEventNewValue) {
+ if (ev.eventType == kEventNewValue) {
//WriteStatusF( 4, "Brain Attempt " );
GameObject *container = indivCviewTop->_containerObject;
@@ -4385,7 +4385,7 @@ APPFUNC(cmdBrain) {
break;
}
}
- } else if (ev.eventType == gEventMouseMove) {
+ } else if (ev.eventType == kEventMouseMove) {
if (ev.value == GfxCompImage::kLeave) {
g_vm->_mouseInfo->setText(nullptr);
} else { //if (ev.value == gCompImage::enter)
@@ -4502,7 +4502,7 @@ void objectTest() {
APPFUNC(cmdControl) {
int newContainer = protoClassIdeaContainer;
- if (ev.eventType == gEventMouseUp) {
+ if (ev.eventType == kEventMouseUp) {
GameObject *object = (GameObject *)getCenterActor();
ContainerIterator iter(object);
diff --git a/engines/saga2/panel.cpp b/engines/saga2/panel.cpp
index 037e54f57f2..b615c0d3b8c 100644
--- a/engines/saga2/panel.cpp
+++ b/engines/saga2/panel.cpp
@@ -535,7 +535,7 @@ void gWindow::deactivate() {
}
bool gWindow::activate(gEventType why) {
- if (why == gEventMouseDown) { // momentarily depress
+ if (why == kEventMouseDown) { // momentarily depress
_selected = 1;
notify(why, 0); // notify App of successful hit
return true;
@@ -544,22 +544,22 @@ bool gWindow::activate(gEventType why) {
}
void gWindow::pointerMove(gPanelMessage &) {
- notify(gEventMouseMove, 0);
+ notify(kEventMouseMove, 0);
}
bool gWindow::pointerHit(gPanelMessage &) {
- activate(gEventMouseDown);
+ activate(kEventMouseDown);
return true;
}
void gWindow::pointerDrag(gPanelMessage &) {
if (_selected) {
- notify(gEventMouseDrag, 0);
+ notify(kEventMouseDrag, 0);
}
}
void gWindow::pointerRelease(gPanelMessage &) {
- if (_selected) notify(gEventMouseUp, 0); // notify App of successful hit
+ if (_selected) notify(kEventMouseUp, 0); // notify App of successful hit
deactivate();
}
@@ -699,29 +699,29 @@ void gGenericControl::deactivate() {
}
void gGenericControl::pointerMove(gPanelMessage &msg) {
- notify(gEventMouseMove, (msg._pointerEnter ? enter : 0) | (msg._pointerLeave ? leave : 0));
+ notify(kEventMouseMove, (msg._pointerEnter ? kCVEnter : 0) | (msg._pointerLeave ? kCVLeave : 0));
}
bool gGenericControl::pointerHit(gPanelMessage &msg) {
if (msg._rightButton)
- notify(gEventRMouseDown, 0);
+ notify(kEventRMouseDown, 0);
else if (msg._doubleClick && !_dblClickFlag) {
_dblClickFlag = true;
- notify(gEventDoubleClick, 0);
+ notify(kEventDoubleClick, 0);
} else {
_dblClickFlag = false;
- notify(gEventMouseDown, 0);
+ notify(kEventMouseDown, 0);
}
return true;
}
void gGenericControl::pointerDrag(gPanelMessage &) {
- notify(gEventMouseDrag, 0);
+ notify(kEventMouseDrag, 0);
}
void gGenericControl::pointerRelease(gPanelMessage &) {
- notify(gEventMouseUp, 0);
+ notify(kEventMouseUp, 0);
deactivate();
}
@@ -736,7 +736,7 @@ void gGenericControl::draw() {
void gToolBase::setActive(gPanel *ctl) {
if (_activePanel && _activePanel == ctl) return;
if (_activePanel) _activePanel->deactivate();
- if (ctl == nullptr || ctl->activate(gEventNone)) _activePanel = ctl;
+ if (ctl == nullptr || ctl->activate(kEventNone)) _activePanel = ctl;
}
void gToolBase::handleMouse(Common::Event &event, uint32 time) {
@@ -1042,7 +1042,7 @@ void gToolBase::handleKeyStroke(Common::Event &event) {
if ((ctl = w->keyTest(k)) != nullptr) {
if (_activePanel == ctl) return;
if (_activePanel) _activePanel->deactivate();
- if (ctl->activate(gEventKeyDown)) {
+ if (ctl->activate(kEventKeyDown)) {
_activePanel = ctl;
return;
}
@@ -1056,7 +1056,7 @@ void gToolBase::handleKeyStroke(Common::Event &event) {
// else send the message to the app.
- w->notify(gEventKeyDown, (qualifier << 16) | key);
+ w->notify(kEventKeyDown, (qualifier << 16) | key);
}
}
diff --git a/engines/saga2/panel.h b/engines/saga2/panel.h
index 5aa623c7cf5..211700d1779 100644
--- a/engines/saga2/panel.h
+++ b/engines/saga2/panel.h
@@ -69,21 +69,21 @@ void EventLoop(bool &running, bool modal = false);
* ===================================================================== */
enum gEventType {
- gEventNone = 0, // no event occurred
- gEventMouseDown, // left button pressed
- gEventMouseUp, // left button released
- gEventRMouseDown, // right button pressed
- gEventRMouseUp, // right button released
- gEventMouseMove, // mouse moved
- gEventMouseDrag, // mouse dragged
- gEventMouseOutside, // mouse click outside of window
- gEventKeyDown, // keystroke
-
- gEventNewValue, // object had new value
- gEventDoubleClick, // double-clicked on object
- gEventAltValue, // for multi-function objects
-
- gEventLast
+ kEventNone = 0, // no event occurred
+ kEventMouseDown, // left button pressed
+ kEventMouseUp, // left button released
+ kEventRMouseDown, // right button pressed
+ kEventRMouseUp, // right button released
+ kEventMouseMove, // mouse moved
+ kEventMouseDrag, // mouse dragged
+ kEventMouseOutside, // mouse click outside of window
+ kEventKeyDown, // keystroke
+
+ kEventNewValue, // object had new value
+ kEventDoubleClick, // double-clicked on object
+ kEventAltValue, // for multi-function objects
+
+ kEventLast
};
/* ===================================================================== *
@@ -348,8 +348,8 @@ private:
// Dragging modes for window -- private and static!
enum drag_modes {
- dragNone = 0,
- dragPosition
+ kDragNone = 0,
+ kDragPosition
};
static int _dragMode; // current dragging mode
@@ -440,8 +440,8 @@ public:
}
enum controlValue {
- enter = (1 << 0),
- leave = (1 << 1)
+ kCVEnter = (1 << 0),
+ kCVLeave = (1 << 1)
};
protected:
diff --git a/engines/saga2/speech.cpp b/engines/saga2/speech.cpp
index 6f38d90fbdf..27f65c134aa 100644
--- a/engines/saga2/speech.cpp
+++ b/engines/saga2/speech.cpp
@@ -1056,13 +1056,13 @@ APPFUNC(cmdClickSpeech) {
Speech *sp;
switch (ev.eventType) {
- case gEventMouseMove:
- case gEventMouseDrag:
+ case kEventMouseMove:
+ case kEventMouseDrag:
g_vm->_mouseInfo->setDoable(Rect16(kTileRectX, kTileRectY, kTileRectWidth, kTileRectHeight).ptInside(ev.mouse));
break;
- case gEventMouseDown:
+ case kEventMouseDown:
if ((sp = speechList.currentActive()) != nullptr) {
sp->_selectedButton = pickSpeechButton(ev.mouse, sp->_speechImage._size.x, sp->_textPort);
diff --git a/engines/saga2/tilemode.cpp b/engines/saga2/tilemode.cpp
index 7400c08a363..7e8f25e472e 100644
--- a/engines/saga2/tilemode.cpp
+++ b/engines/saga2/tilemode.cpp
@@ -1006,7 +1006,7 @@ static APPFUNC(cmdClickTileMap) {
if (!uiKeysEnabled) return;
switch (ev.eventType) {
- case gEventRMouseDown:
+ case kEventRMouseDown:
#if CHEATMOVE
selectedObject = pickedObject;
@@ -1028,9 +1028,9 @@ static APPFUNC(cmdClickTileMap) {
}
break;
- case gEventMouseMove:
- case gEventMouseDrag:
- if (ev.value & gGenericControl::leave) {
+ case kEventMouseMove:
+ case kEventMouseDrag:
+ if (ev.value & gGenericControl::kCVLeave) {
mousePressed = false;
if (g_vm->_mouseInfo->getObject() == nullptr)
@@ -1045,7 +1045,7 @@ static APPFUNC(cmdClickTileMap) {
lastMousePos.set(ev.mouse.x, ev.mouse.y);
break;
- case gEventMouseDown:
+ case kEventMouseDown:
mousePressed = true;
@@ -1214,7 +1214,7 @@ static APPFUNC(cmdClickTileMap) {
}
break;
- case gEventMouseUp:
+ case kEventMouseUp:
mousePressed = false;
@@ -1246,7 +1246,7 @@ static APPFUNC(cmdClickTileMap) {
}
break;
- case gEventDoubleClick:
+ case kEventDoubleClick:
dblClick = true;
@@ -1418,7 +1418,7 @@ void gStickyDragControl::deactivate() {
//void gStickyDragControl::pointerMove( gPanelMessage & )
//{
-// notify( gEventMouseMove, 0 );
+// notify( kEventMouseMove, 0 );
//}
bool gStickyDragControl::pointerHit(gPanelMessage &msg) {
diff --git a/engines/saga2/uidialog.cpp b/engines/saga2/uidialog.cpp
index ba1c4c406ea..fd318483ed8 100644
--- a/engines/saga2/uidialog.cpp
+++ b/engines/saga2/uidialog.cpp
@@ -542,7 +542,7 @@ static bool deferredSaveFlag = false;
static char deferredSaveName[64];
inline bool isUserAction(gEvent ev) {
- return (ev.eventType == gEventNewValue) || (ev.eventType == gEventKeyDown);
+ return (ev.eventType == kEventNewValue) || (ev.eventType == kEventKeyDown);
}
/* ===================================================================== *
@@ -1327,7 +1327,7 @@ bool CPlacardWindow::pointerHit(gPanelMessage &) {
ri->result = _id;
}
- //activate( gEventMouseDown );
+ //activate( kEventMouseDown );
return true;
}
diff --git a/engines/saga2/videobox.cpp b/engines/saga2/videobox.cpp
index fd4857c1326..66e1a5cc6af 100644
--- a/engines/saga2/videobox.cpp
+++ b/engines/saga2/videobox.cpp
@@ -71,7 +71,7 @@ void CVideoBox::deactivate() {
}
bool CVideoBox::activate(gEventType why) {
- if (why == gEventMouseDown) { // momentarily depress
+ if (why == kEventMouseDown) { // momentarily depress
_selected = 1;
notify(why, 0); // notify App of successful hit
return true;
@@ -80,7 +80,7 @@ bool CVideoBox::activate(gEventType why) {
}
void CVideoBox::pointerMove(gPanelMessage &) {
- notify(gEventMouseMove, 0);
+ notify(kEventMouseMove, 0);
}
bool CVideoBox::pointerHit(gPanelMessage &) {
@@ -96,18 +96,18 @@ bool CVideoBox::pointerHit(gPanelMessage &) {
ri->result = _id;
}
- activate(gEventMouseDown);
+ activate(kEventMouseDown);
return true;
}
void CVideoBox::pointerDrag(gPanelMessage &) {
if (_selected) {
- notify(gEventMouseDrag, 0);
+ notify(kEventMouseDrag, 0);
}
}
void CVideoBox::pointerRelease(gPanelMessage &) {
- if (_selected) notify(gEventMouseUp, 0); // notify App of successful hit
+ if (_selected) notify(kEventMouseUp, 0); // notify App of successful hit
deactivate();
}
Commit: e54108a15c0252e6c5dab1d39f0827fc67425850
https://github.com/scummvm/scummvm/commit/e54108a15c0252e6c5dab1d39f0827fc67425850
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-10-29T13:44:19+02:00
Commit Message:
SAGA2: Rename enums in patrol.h
Changed paths:
engines/saga2/assign.cpp
engines/saga2/patrol.cpp
engines/saga2/patrol.h
diff --git a/engines/saga2/assign.cpp b/engines/saga2/assign.cpp
index 9b01ef82d8d..65afc70d36a 100644
--- a/engines/saga2/assign.cpp
+++ b/engines/saga2/assign.cpp
@@ -281,7 +281,7 @@ Task *PatrolRouteAssignment::getTask(TaskStack *ts) {
if (dist < bestDist) {
bestDist = dist;
- startPoint = (_routeFlags & patrolRouteReverse) ? i : (i + 1) % route.vertices();
+ startPoint = (_routeFlags & kPatrolRouteReverse) ? i : (i + 1) % route.vertices();
}
}
}
diff --git a/engines/saga2/patrol.cpp b/engines/saga2/patrol.cpp
index aab4d868a93..072b548121b 100644
--- a/engines/saga2/patrol.cpp
+++ b/engines/saga2/patrol.cpp
@@ -85,10 +85,10 @@ PatrolRouteIterator::PatrolRouteIterator(uint8 map, int16 rte, uint8 type) :
_mapNum(map), _routeNo(rte), _flags(type & 0xF) {
const PatrolRoute &route = patrolRouteList[_mapNum]->getRoute(_routeNo);
- if (_flags & patrolRouteRandom)
+ if (_flags & kPatrolRouteRandom)
_vertexNo = g_vm->_rnd->getRandomNumber(route.vertices() - 1);
else {
- if (_flags & patrolRouteReverse)
+ if (_flags & kPatrolRouteReverse)
_vertexNo = route.vertices() - 1;
else
_vertexNo = 0;
@@ -124,12 +124,12 @@ void PatrolRouteIterator::increment() {
_vertexNo++;
if (_vertexNo >= route.vertices()) {
- if (_flags & patrolRouteAlternate) {
+ if (_flags & kPatrolRouteAlternate) {
// If alternating, initialize for iteration in the alternate
// direction
- _flags |= patrolRouteInAlternate;
+ _flags |= kPatrolRouteInAlternate;
_vertexNo = MAX(route.vertices() - 2, 0);
- } else if (_flags & patrolRouteRepeat)
+ } else if (_flags & kPatrolRouteRepeat)
// If repeating, reset the waypoint index
_vertexNo = 0;
}
@@ -143,12 +143,12 @@ void PatrolRouteIterator::decrement() {
_vertexNo--;
if (_vertexNo < 0) {
- if (_flags & patrolRouteAlternate) {
+ if (_flags & kPatrolRouteAlternate) {
// If alternating, initialize for iteration in the alternate
// direction
- _flags |= patrolRouteInAlternate;
+ _flags |= kPatrolRouteInAlternate;
_vertexNo = MIN(1, route.vertices() - 1);
- } else if (_flags & patrolRouteRepeat)
+ } else if (_flags & kPatrolRouteRepeat)
// If repeating, reset the waypoint index
_vertexNo = route.vertices() - 1;
}
@@ -161,10 +161,10 @@ void PatrolRouteIterator::altIncrement() {
_vertexNo++;
- if (_vertexNo >= route.vertices() && (_flags & patrolRouteRepeat)) {
+ if (_vertexNo >= route.vertices() && (_flags & kPatrolRouteRepeat)) {
// If repeating, initialize for iteration in the standard
// direction, and reset the waypoint index
- _flags &= ~patrolRouteInAlternate;
+ _flags &= ~kPatrolRouteInAlternate;
_vertexNo = MAX(route.vertices() - 2, 0);
}
}
@@ -176,10 +176,10 @@ void PatrolRouteIterator::altDecrement() {
_vertexNo--;
- if (_vertexNo < 0 && (_flags & patrolRouteRepeat)) {
+ if (_vertexNo < 0 && (_flags & kPatrolRouteRepeat)) {
// If repeating, initialize for iteration in the standard
// direction, and reset the waypoint index
- _flags &= ~patrolRouteInAlternate;
+ _flags &= ~kPatrolRouteInAlternate;
_vertexNo = MIN(1, route.vertices() - 1);
}
}
@@ -196,14 +196,14 @@ const PatrolRouteIterator &PatrolRouteIterator::operator++() {
const PatrolRoute &route = patrolRouteList[_mapNum]->getRoute(_routeNo);
if (_vertexNo >= 0 && _vertexNo < route.vertices()) {
- if (!(_flags & patrolRouteRandom)) {
- if (!(_flags & patrolRouteInAlternate)) {
- if (!(_flags & patrolRouteReverse))
+ if (!(_flags & kPatrolRouteRandom)) {
+ if (!(_flags & kPatrolRouteInAlternate)) {
+ if (!(_flags & kPatrolRouteReverse))
increment();
else
decrement();
} else {
- if (!(_flags & patrolRouteReverse))
+ if (!(_flags & kPatrolRouteReverse))
altDecrement();
else
altIncrement();
diff --git a/engines/saga2/patrol.h b/engines/saga2/patrol.h
index 390961c22bf..0258f239735 100644
--- a/engines/saga2/patrol.h
+++ b/engines/saga2/patrol.h
@@ -102,13 +102,13 @@ enum PatrolRouteIteratorFlags {
// These flags define the type of iterator, and are only initialized
// when the iterator is constructed.
- patrolRouteReverse = (1 << 0), // Iterate in reverse
- patrolRouteAlternate = (1 << 1), // Iterate back and forth
- patrolRouteRepeat = (1 << 2), // Iterate repeatedly
- patrolRouteRandom = (1 << 3), // Iterate randomly
+ kPatrolRouteReverse = (1 << 0), // Iterate in reverse
+ kPatrolRouteAlternate = (1 << 1), // Iterate back and forth
+ kPatrolRouteRepeat = (1 << 2), // Iterate repeatedly
+ kPatrolRouteRandom = (1 << 3), // Iterate randomly
// These flags define the current state of the iterator.
- patrolRouteInAlternate = (1 << 4) // Iterator is currently going in
+ kPatrolRouteInAlternate = (1 << 4) // Iterator is currently going in
// the alternate direction
};
@@ -135,7 +135,7 @@ private:
public:
// Determine if the iterator will repeat infinitely
bool isRepeating() const {
- return _flags & (patrolRouteRepeat | patrolRouteRandom);
+ return _flags & (kPatrolRouteRepeat | kPatrolRouteRandom);
}
// Return the current way point number
Commit: b46e1660509f1ef7538137179184c4cb5395ca54
https://github.com/scummvm/scummvm/commit/b46e1660509f1ef7538137179184c4cb5395ca54
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-10-29T13:46:27+02:00
Commit Message:
SAGA2: Rename enums in player.h
Changed paths:
engines/saga2/player.cpp
engines/saga2/player.h
diff --git a/engines/saga2/player.cpp b/engines/saga2/player.cpp
index 7dc2a3551cc..74637ef8273 100644
--- a/engines/saga2/player.cpp
+++ b/engines/saga2/player.cpp
@@ -154,16 +154,16 @@ void PlayerActor::stdAttribUpdate(uint8 &stat, uint8 baseStat, int16 index) {
int16 fractionRecover;
// get the whole number first
- recover = attribPointsPerUpdate / attribPointsPerValue;
+ recover = kAttribPointsPerUpdate / kAttribPointsPerValue;
// get the fraction
- fractionRecover = attribPointsPerUpdate % attribPointsPerValue;
+ fractionRecover = kAttribPointsPerUpdate % kAttribPointsPerValue;
// if there is an overrun
- if (_attribRecPools[index] + fractionRecover > attribPointsPerValue) {
+ if (_attribRecPools[index] + fractionRecover > kAttribPointsPerValue) {
// add the overrun to the whole number
recover++;
- _attribRecPools[index] = (_attribRecPools[index] + fractionRecover) - attribPointsPerValue;
+ _attribRecPools[index] = (_attribRecPools[index] + fractionRecover) - kAttribPointsPerValue;
} else {
_attribRecPools[index] += fractionRecover;
}
@@ -344,8 +344,8 @@ void PlayerActor::skillAdvance(uint8 stat,
void PlayerActor::vitalityAdvance(uint8 points) {
while (points-- > 0) {
if ((int16)g_vm->_rnd->getRandomNumber(ActorAttributes::kVitalityLimit - 1) > _baseStats.vitality) {
- if (++_vitalityMemory >= vitalityLevelBump) {
- _vitalityMemory -= vitalityLevelBump;
+ if (++_vitalityMemory >= kVitalityLevelBump) {
+ _vitalityMemory -= kVitalityLevelBump;
_baseStats.vitality++;
StatusMsg(VITALITY_STATUS, getActor()->objName());
}
diff --git a/engines/saga2/player.h b/engines/saga2/player.h
index 61d9ae570a3..d7780ad54b9 100644
--- a/engines/saga2/player.h
+++ b/engines/saga2/player.h
@@ -55,20 +55,20 @@ public:
ActorAttributes _baseStats; // Base stats for this actor
enum PlayerActorFlags {
- playerAggressive = (1 << 0), // Player is in aggressive mode
- playerBanded = (1 << 1), // Player is banded
- playerHasCartography = (1 << 2) // Player has ability to map
+ kPlayerAggressive = (1 << 0), // Player is in aggressive mode
+ kPlayerBanded = (1 << 1), // Player is banded
+ kPlayerHasCartography = (1 << 2) // Player has ability to map
};
// recovery information
enum Recovery {
- baseManaRec = 1,
- attribPointsPerUpdate = 1,
- attribPointsPerValue = 10
+ kBaseManaRec = 1,
+ kAttribPointsPerUpdate = 1,
+ kAttribPointsPerValue = 10
};
enum {
- vitalityLevelBump = 50
+ kVitalityLevelBump = 50
};
// Container node for ready containers
@@ -144,32 +144,32 @@ public:
// Set player to be aggressive
void setAggression() {
- _flags |= playerAggressive;
+ _flags |= kPlayerAggressive;
}
// Set player to not aggressive
void clearAggression() {
- _flags &= ~playerAggressive;
+ _flags &= ~kPlayerAggressive;
}
// Determine if actor is in aggressive state
bool isAggressive() {
- return (_flags & playerAggressive) != 0;
+ return (_flags & kPlayerAggressive) != 0;
}
// Set the player to be banded
void setBanded() {
- _flags |= playerBanded;
+ _flags |= kPlayerBanded;
}
// Set the player to not be banded
void clearBanded() {
- _flags &= ~playerBanded;
+ _flags &= ~kPlayerBanded;
}
// Determine if this player actor is banded
bool isBanded() {
- return (_flags & playerBanded) != 0;
+ return (_flags & kPlayerBanded) != 0;
}
// Resolve the banding state of this actor
Commit: e00bdadfd2848e79d3092cf18f925f902a5ed050
https://github.com/scummvm/scummvm/commit/e00bdadfd2848e79d3092cf18f925f902a5ed050
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-10-29T13:50:59+02:00
Commit Message:
SAGA2: Rename enums in property.h
Changed paths:
engines/saga2/actor.cpp
engines/saga2/property.h
engines/saga2/task.cpp
diff --git a/engines/saga2/actor.cpp b/engines/saga2/actor.cpp
index 7756a872bc9..92be633eb18 100644
--- a/engines/saga2/actor.cpp
+++ b/engines/saga2/actor.cpp
@@ -2415,11 +2415,11 @@ void Actor::evaluateNeeds() {
if (canSenseActorProperty(
info,
maxSenseRange,
- actorPropIDEnemy)
+ kActorPropIDEnemy)
|| canSenseActorPropertyIndirectly(
info,
maxSenseRange,
- actorPropIDEnemy)) {
+ kActorPropIDEnemy)) {
PlayerActorID playerID = _disposition - kDispositionPlayer;
if (isAggressive(playerID))
@@ -2614,8 +2614,8 @@ void Actor::updateState() {
_curTask,
ActorPropertyTarget(
_disposition == kDispositionEnemy
- ? actorPropIDPlayerActor
- : actorPropIDEnemy),
+ ? kActorPropIDPlayerActor
+ : kActorPropIDEnemy),
true);
if (task != nullptr)
@@ -2640,8 +2640,8 @@ void Actor::updateState() {
_curTask,
ActorPropertyTarget(
disp == kDispositionEnemy
- ? actorPropIDPlayerActor
- : actorPropIDEnemy));
+ ? kActorPropIDPlayerActor
+ : kActorPropIDEnemy));
if (task != nullptr)
_curTask->setTask(task);
@@ -3104,7 +3104,7 @@ uint8 Actor::evaluateFollowerNeeds(Actor *follower) {
&& follower->canSenseActorProperty(
info,
maxSenseRange,
- actorPropIDEnemy)))
+ kActorPropIDEnemy)))
return kActorGoalAttackEnemy;
return kActorGoalFollowLeader;
diff --git a/engines/saga2/property.h b/engines/saga2/property.h
index f332cf0000e..5f2ed8ddf51 100644
--- a/engines/saga2/property.h
+++ b/engines/saga2/property.h
@@ -210,16 +210,16 @@ typedef PropertyOr< GameObject > ObjectPropertyOr;
typedef int16 ObjectPropertyID;
enum {
- objPropIDObject,
- objPropIDActor,
- objPropIDWorld,
- objPropIDLocked,
- objPropIDUnlocked,
- objPropIDKey,
- objPropIDPlayerActor,
- objPropIDEnemy,
-
- objPropIDCount
+ kObjPropIDObject,
+ kObjPropIDActor,
+ kObjPropIDWorld,
+ kObjPropIDLocked,
+ kObjPropIDUnlocked,
+ kObjPropIDKey,
+ kObjPropIDPlayerActor,
+ kObjPropIDEnemy,
+
+ kObjPropIDCount
};
/* ===================================================================== *
@@ -236,12 +236,12 @@ typedef PropertyOr< Actor > ActorPropertyOr;
typedef int16 ActorPropertyID;
enum {
- actorPropIDDead,
- actorPropIDCenterActor,
- actorPropIDPlayerActor,
- actorPropIDEnemy,
+ kActorPropIDDead,
+ kActorPropIDCenterActor,
+ kActorPropIDPlayerActor,
+ kActorPropIDEnemy,
- actorPropIDCount
+ kActorPropIDCount
};
/* ===================================================================== *
@@ -258,9 +258,9 @@ typedef PropertyOr< TileInfo > TilePropertyOr;
typedef int16 TilePropertyID;
enum {
- tilePropIDHasWater,
+ kTilePropIDHasWater,
- tilePropIDCount
+ kTilePropIDCount
};
/* ===================================================================== *
@@ -367,9 +367,9 @@ public:
typedef int16 MetaTilePropertyID;
enum {
- metaTilePropIDHasWater,
+ kMetaTilePropIDHasWater,
- metaTilePropIDCount
+ kMetaTilePropIDCount
};
bool objIsObject(GameObject *obj);
diff --git a/engines/saga2/task.cpp b/engines/saga2/task.cpp
index b4b8b75e287..a4a0472929e 100644
--- a/engines/saga2/task.cpp
+++ b/engines/saga2/task.cpp
@@ -3676,7 +3676,7 @@ bool BandTask::BandAndAvoidEnemiesRepulsorIterator::firstEnemyRepulsor(
int16 actorDistArray[ARRAYSIZE(_actorArray)];
TargetActorArray taa(ARRAYSIZE(_actorArray), _actorArray, actorDistArray);
- ActorPropertyTarget target(actorPropIDEnemy);
+ ActorPropertyTarget target(kActorPropIDEnemy);
_numActors = target.actor(_a->world(), _a->getLocation(), taa);
Commit: 7f4dd6aaaaef1ad6595f32967d1c0e08525e300e
https://github.com/scummvm/scummvm/commit/7f4dd6aaaaef1ad6595f32967d1c0e08525e300e
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-10-29T14:15:21+02:00
Commit Message:
SAGA2: Rename enums in script.h
Changed paths:
engines/saga2/actor.cpp
engines/saga2/interp.cpp
engines/saga2/objproto.cpp
engines/saga2/sagafunc.cpp
engines/saga2/script.h
engines/saga2/tile.cpp
diff --git a/engines/saga2/actor.cpp b/engines/saga2/actor.cpp
index 92be633eb18..14e5a43fee8 100644
--- a/engines/saga2/actor.cpp
+++ b/engines/saga2/actor.cpp
@@ -303,9 +303,9 @@ bool ActorProto::acceptDropAction(
result = runObjectMethod(dObj, Method_Actor_onReceive, scf);
- if (result == scriptResultFinished
- && scf.returnVal != actionResultNotDone)
- return scf.returnVal == actionResultSuccess;
+ if (result == kScriptResultFinished
+ && scf.returnVal != kActionResultNotDone)
+ return scf.returnVal == kActionResultSuccess;
// Place the object in the actor's inventory (if possible)
if (!a->placeObject(enactor, droppedID, true, count))
@@ -3173,14 +3173,14 @@ void Actor::useKnowledge(scriptCallFrame &scf) {
// knowledge package
res = runMethod(_knowledge[i],
- builtinAbstract,
+ kBuiltinAbstract,
0,
Method_KnowledgePackage_evalResponse,
scf);
// If script ran OK, then look at result
- if (res == scriptResultFinished) {
+ if (res == kScriptResultFinished) {
// break up return code into priority and
// response code
@@ -3211,12 +3211,12 @@ void Actor::useKnowledge(scriptCallFrame &scf) {
scf.responseType = bestResponseCode;
runMethod(bestResponseClass,
- builtinAbstract,
+ kBuiltinAbstract,
0,
Method_KnowledgePackage_executeResponse,
scf);
} else {
- scf.returnVal = actionResultNotDone;
+ scf.returnVal = kActionResultNotDone;
}
}
diff --git a/engines/saga2/interp.cpp b/engines/saga2/interp.cpp
index 4a0116a5ea4..c6c9af5d617 100644
--- a/engines/saga2/interp.cpp
+++ b/engines/saga2/interp.cpp
@@ -74,22 +74,22 @@ extern hResource *scriptResFile; // script resources
hResContext *scriptRes; // script resource handle
void script_error(const char *msg) {
- thisThread->_flags |= Thread::aborted;
+ thisThread->_flags |= Thread::kTFAborted;
WriteStatusF(0, msg);
}
static Common::String seg2str(int16 segment) {
switch (segment) {
- case builtinTypeObject:
+ case kBuiltinTypeObject:
return "GameObject";
- case builtinTypeTAG:
+ case kBuiltinTypeTAG:
return "TAG";
- case builtinAbstract:
+ case kBuiltinAbstract:
return Common::String::format("Abstract%d", segment);
- case builtinTypeMission:
+ case kBuiltinTypeMission:
return "Mission";
default:
@@ -104,20 +104,20 @@ uint8 *builtinObjectAddress(int16 segment, uint16 index) {
uint16 segNum, segOff;
switch (segment) {
- case builtinTypeObject:
+ case kBuiltinTypeObject:
return (uint8 *)(&GameObject::objectAddress(index)->_data);
- case builtinTypeTAG:
+ case kBuiltinTypeTAG:
return (uint8 *)(&ActiveItem::activeItemAddress(index)->_data);
- case builtinAbstract:
+ case kBuiltinAbstract:
assert(index > 0);
if (lookupExport(index, segNum, segOff) == false)
error("SAGA: Cannot take address of abtract class");
return segmentAddress(segNum, segOff);
- case builtinTypeMission:
+ case kBuiltinTypeMission:
return (uint8 *)(&ActiveMission::missionAddress(index)->_data);
default:
@@ -140,7 +140,7 @@ uint16 *builtinVTableAddress(int16 btype, uint8 *addr, CallTable **callTab) {
vtOffset;
switch (btype) {
- case builtinTypeObject:
+ case kBuiltinTypeObject:
// Get the address of a game object using the ID
obj = ((ObjectData *)addr)->obj;
@@ -152,7 +152,7 @@ uint16 *builtinVTableAddress(int16 btype, uint8 *addr, CallTable **callTab) {
break;
- case builtinTypeTAG:
+ case kBuiltinTypeTAG:
aItem = ((ActiveItemData *)addr)->aItem;
script = aItem->_data.scriptClassID;
*callTab = &tagCFuncs;
@@ -162,7 +162,7 @@ uint16 *builtinVTableAddress(int16 btype, uint8 *addr, CallTable **callTab) {
break;
- case builtinTypeMission:
+ case kBuiltinTypeMission:
aMission = ((ActiveMissionData *)addr)->aMission;
script = aMission->getScript();
*callTab = &missionCFuncs;
@@ -172,7 +172,7 @@ uint16 *builtinVTableAddress(int16 btype, uint8 *addr, CallTable **callTab) {
break;
- case builtinAbstract:
+ case kBuiltinAbstract:
*callTab = nullptr;
return (uint16 *)addr;
@@ -527,16 +527,16 @@ const char *objectName(int16 segNum, uint16 segOff) {
return "SagaObject";
switch (segNum) {
- case builtinTypeObject:
+ case kBuiltinTypeObject:
return GameObject::objectAddress(segOff)->objName();
- case builtinTypeTAG:
+ case kBuiltinTypeTAG:
return "Tag";
- case builtinAbstract:
+ case kBuiltinAbstract:
return "@";
- case builtinTypeMission:
+ case kBuiltinTypeMission:
return "Mission";
}
return "???";
@@ -700,7 +700,7 @@ bool Thread::interpret() {
// Halt the thread here, wait for death
_programCounter.offset = (pc - (_codeSeg));
_stackPtr = (uint8 *)stack;
- _flags |= finished;
+ _flags |= kTFFinished;
return true;
} else {
_programCounter.segment = *stack++;
@@ -781,11 +781,11 @@ bool Thread::interpret() {
if (op == kOpCcall) { // push the return value
*--stack = _returnVal; // onto the stack
- _flags |= expectResult; // script expecting result
- } else _flags &= ~expectResult; // script not expecting result
+ _flags |= kTFExpectResult; // script expecting result
+ } else _flags &= ~kTFExpectResult; // script not expecting result
// if the thread is asleep, then no more instructions
- if (_flags & asleep)
+ if (_flags & kTFAsleep)
instruction_count = maxTimeSlice; // break out of loop!
break;
@@ -885,11 +885,11 @@ bool Thread::interpret() {
// not a 'void' call.
if (op == kOpCallMember) {
*--stack = _returnVal; // onto the stack
- _flags |= expectResult; // script expecting result
- } else _flags &= ~expectResult; // script not expecting result
+ _flags |= kTFExpectResult; // script expecting result
+ } else _flags &= ~kTFExpectResult; // script not expecting result
// if the thread is asleep, then break interpret loop
- if (_flags & asleep) instruction_count = maxTimeSlice;
+ if (_flags & kTFAsleep) instruction_count = maxTimeSlice;
break;
}
// else it's a NULL function (i.e. pure virtual)
@@ -1556,16 +1556,16 @@ void Thread::dispatch() {
numWaitOther = 0;
for (th = threadList.first(); th; th = threadList.next(th)) {
- if (th->_flags & waiting) {
+ if (th->_flags & kTFWaiting) {
switch (th->_waitType) {
- case waitDelay:
+ case kWaitDelay:
numWaitDelay++;
break;
- case waitFrameDelay:
+ case kWaitFrameDelay:
numWaitFrames++;
break;
- case waitTagSemaphore:
+ case kWaitTagSemaphore:
numWaitSemi++;
break;
default:
@@ -1581,31 +1581,31 @@ void Thread::dispatch() {
for (th = threadList.first(); th; th = nextThread) {
nextThread = threadList.next(th);
- if (th->_flags & (finished | aborted)) {
+ if (th->_flags & (kTFFinished | kTFAborted)) {
delete th;
continue;
}
- if (th->_flags & waiting) {
+ if (th->_flags & kTFWaiting) {
switch (th->_waitType) {
- case waitDelay:
+ case kWaitDelay:
// Wake up the thread!
if (th->_waitAlarm.check())
- th->_flags &= ~waiting;
+ th->_flags &= ~kTFWaiting;
break;
- case waitFrameDelay:
+ case kWaitFrameDelay:
if (th->_waitFrameAlarm.check())
- th->_flags &= ~waiting;
+ th->_flags &= ~kTFWaiting;
break;
- case waitTagSemaphore:
+ case kWaitTagSemaphore:
if (th->_waitParam->isExclusive() == false) {
- th->_flags &= ~waiting;
+ th->_flags &= ~kTFWaiting;
th->_waitParam->setExclusive(true);
}
break;
@@ -1615,12 +1615,12 @@ void Thread::dispatch() {
}
do {
- if (th->_flags & (waiting | finished | aborted))
+ if (th->_flags & (kTFWaiting | kTFFinished | kTFAborted))
break;
if (th->interpret())
goto break_thread_loop;
- } while (th->_flags & synchronous);
+ } while (th->_flags & kTFSynchronous);
}
break_thread_loop:
;
@@ -1641,10 +1641,10 @@ scriptResult Thread::run() {
while (i--) {
// If script stopped, then return
- if (_flags & (waiting | finished | aborted)) {
- if (_flags & finished) return scriptResultFinished;
- if (_flags & waiting) return scriptResultAsync;
- return scriptResultAborted;
+ if (_flags & (kTFWaiting | kTFFinished | kTFAborted)) {
+ if (_flags & kTFFinished) return kScriptResultFinished;
+ if (_flags & kTFWaiting) return kScriptResultAsync;
+ return kScriptResultAborted;
// can't ever fall thru here...
}
@@ -1658,8 +1658,8 @@ scriptResult Thread::run() {
// Convert to extended thread
void Thread::setExtended() {
- if (!(_flags & extended)) {
- _flags |= extended;
+ if (!(_flags & kTFExtended)) {
+ _flags |= kTFExtended;
extendedThreadLevel++;
}
}
@@ -1668,8 +1668,8 @@ void Thread::setExtended() {
// Convert back to regular thread
void Thread::clearExtended() {
- if (_flags & extended) {
- _flags &= ~extended;
+ if (_flags & kTFExtended) {
+ _flags &= ~kTFExtended;
extendedThreadLevel--;
}
}
@@ -1780,10 +1780,10 @@ scriptResult runScript(uint16 exportEntryNum, scriptCallFrame &args) {
// FIXME: We should probably just use an error(), but this will work for mass debugging
if (th == nullptr) {
debugC(4, kDebugScripts, "Couldn't allocate memory for Thread(%d, %d)", segNum, segOff);
- return scriptResultNoScript;
+ return kScriptResultNoScript;
} else if (!th->_valid) {
debugC(4, kDebugScripts, "Scripts: %d is not valid", lastExport);
- return scriptResultNoScript;
+ return kScriptResultNoScript;
}
print_script_name((th->_codeSeg) + th->_programCounter.offset, objectName(segNum, segOff));
@@ -1792,7 +1792,7 @@ scriptResult runScript(uint16 exportEntryNum, scriptCallFrame &args) {
args.returnVal = th->_returnVal;
// If the thread is not still running, then delete it
- if (result != scriptResultAsync) delete th;
+ if (result != kScriptResultAsync) delete th;
// restore "thisThread" ptr.
thisThread = saveThread;
@@ -1812,12 +1812,12 @@ scriptResult runMethod(
segOff;
uint16 *vTable;
Thread *th;
- scriptResult result = scriptResultNoScript;
+ scriptResult result = kScriptResultNoScript;
Thread *saveThread = thisThread;
// For abstract classes, the object index is also the class
// index.
- if (bType == builtinAbstract)
+ if (bType == kBuiltinAbstract)
index = scriptClassID;
lookupExport(scriptClassID, segNum, segOff);
@@ -1831,7 +1831,7 @@ scriptResult runMethod(
if (segNum == 0xffff) { // it's a CFUNC or NULL func
if (segOff == 0xffff) { // it's a NULL function
- return scriptResultNoScript;
+ return kScriptResultNoScript;
} else { // It's a C function
int16 funcNum = segOff; // function number
int16 stack[1]; // dummy stack argument
@@ -1846,9 +1846,9 @@ scriptResult runMethod(
th = new Thread(0, 0, args);
thisThread = th;
if (th == nullptr)
- return scriptResultNoScript;
+ return kScriptResultNoScript;
else if (!th->_valid)
- return scriptResultNoScript;
+ return kScriptResultNoScript;
result = (scriptResult)cfunc(stack); // call the function
delete th;
@@ -1859,10 +1859,10 @@ scriptResult runMethod(
thisThread = th;
if (th == nullptr) {
debugC(3, kDebugScripts, "Couldn't allocate memory for Thread(%d, %d)", segNum, segOff);
- return scriptResultNoScript;
+ return kScriptResultNoScript;
} else if (!th->_valid) {
debugC(3, kDebugScripts, "Scripts: %d is not valid", lastExport);
- return scriptResultNoScript;
+ return kScriptResultNoScript;
}
print_script_name((th->_codeSeg) + th->_programCounter.offset, objectName(bType, index));
@@ -1875,7 +1875,7 @@ scriptResult runMethod(
args.returnVal = th->_returnVal;
debugC(3, kDebugScripts, "return: %d", th->_returnVal);
- if (result != scriptResultAsync) delete th;
+ if (result != kScriptResultAsync) delete th;
}
thisThread = saveThread; // restore "thisThread" ptr.
@@ -1894,7 +1894,7 @@ scriptResult runObjectMethod(
obj = GameObject::objectAddress(id);
return runMethod(obj->scriptClass(),
- builtinTypeObject,
+ kBuiltinTypeObject,
id,
methodNum,
args);
@@ -1911,10 +1911,10 @@ scriptResult runTagMethod(
aItem = ActiveItem::activeItemAddress(index);
if (!aItem->_data.scriptClassID)
- return scriptResultNoScript;
+ return kScriptResultNoScript;
return runMethod(aItem->_data.scriptClassID,
- builtinTypeTAG,
+ kBuiltinTypeTAG,
index,
methodNum,
args);
@@ -1927,7 +1927,7 @@ void wakeUpThread(ThreadID id) {
if (id != NoThread) {
Thread *thread = getThreadAddress(id);
- thread->_flags &= ~Thread::waiting;
+ thread->_flags &= ~Thread::kTFWaiting;
}
}
@@ -1935,13 +1935,13 @@ void wakeUpThread(ThreadID id, int16 _returnVal) {
if (id != NoThread) {
Thread *thread = getThreadAddress(id);
- if (thread->_flags & Thread::expectResult) {
+ if (thread->_flags & Thread::kTFExpectResult) {
WriteStatusF(8, "Result %d", _returnVal);
thread->_returnVal = _returnVal;
*(int16 *)thread->_stackPtr = _returnVal;
} else WriteStatusF(8, "Thread not expecting result!");
- thread->_flags &= ~(Thread::waiting | Thread::expectResult);
+ thread->_flags &= ~(Thread::kTFWaiting | Thread::kTFExpectResult);
}
}
diff --git a/engines/saga2/objproto.cpp b/engines/saga2/objproto.cpp
index 1c2bee0dff7..a05e3a2b237 100644
--- a/engines/saga2/objproto.cpp
+++ b/engines/saga2/objproto.cpp
@@ -108,8 +108,8 @@ bool ProtoObj::use(ObjectID dObj, ObjectID enactor) {
if ((scriptResult = stdActionScript(
Method_GameObject_onUse,
dObj, enactor, Nothing))
- != actionResultNotDone)
- return scriptResult == actionResultSuccess;
+ != kActionResultNotDone)
+ return scriptResult == kActionResultSuccess;
return useAction(dObj, enactor);
}
@@ -135,8 +135,8 @@ bool ProtoObj::useOn(ObjectID dObj, ObjectID enactor, ObjectID item) {
if ((scriptResult = stdActionScript(
Method_GameObject_onUseOn,
dObj, enactor, item))
- != actionResultNotDone)
- return scriptResult == actionResultSuccess;
+ != kActionResultNotDone)
+ return scriptResult == kActionResultSuccess;
// If script has not aborted action call virtual useOnAction
// function
@@ -169,12 +169,12 @@ bool ProtoObj::useOn(ObjectID dObj, ObjectID enactor, ActiveItem *item) {
// If the script actually ran, and it didn't return a code
// telling us to abort the action...
- if (sResult == scriptResultFinished)
+ if (sResult == kScriptResultFinished)
scrResult = scf.returnVal;
else
- scrResult = actionResultNotDone;
- if (scrResult != actionResultNotDone)
- return scrResult == actionResultSuccess;
+ scrResult = kActionResultNotDone;
+ if (scrResult != kActionResultNotDone)
+ return scrResult == kActionResultSuccess;
return useOnAction(dObj, enactor, item);
@@ -193,7 +193,7 @@ bool ProtoObj::useOn(ObjectID dObj, ObjectID enactor, const Location &loc) {
/* int16 scrResult;
scriptCallFrame scf;
- scriptResult sResult=(scriptResult) actionResultNotDone;
+ scriptResult sResult=(scriptResult) kActionResultNotDone;
scf.invokedObject = dObj;
scf.enactor = enactor;
@@ -207,23 +207,23 @@ bool ProtoObj::useOn(ObjectID dObj, ObjectID enactor, const Location &loc) {
// If the script actually ran, and it didn't return a code
// telling us to abort the action...
- if ( sResult == scriptResultFinished )
+ if ( sResult == kScriptResultFinished )
scrResult=scf.returnVal;
else
- scrResult=actionResultNotDone;
+ scrResult=kActionResultNotDone;
*//*
// Handle object script in a standard fashion
if ( ( scriptResult = stdActionScript(
Method_GameObject_useOnTAI,
dObj, enactor, item->thisID() ) )
- != actionResultNotDone )
- return scriptResult == actionResultSuccess;
+ != kActionResultNotDone )
+ return scriptResult == kActionResultSuccess;
// If script has not aborted action call virtual useOnAction
// function
*//*
- if ( scrResult != actionResultNotDone )
- return scrResult == actionResultSuccess;
+ if ( scrResult != kActionResultNotDone )
+ return scrResult == kActionResultSuccess;
*/
return useOnAction(dObj, enactor, loc);
}
@@ -260,8 +260,8 @@ bool ProtoObj::open(ObjectID dObj, ObjectID enactor) {
if ((scriptResult = stdActionScript(
Method_GameObject_onOpen,
dObj, enactor, Nothing))
- != actionResultNotDone)
- return scriptResult == actionResultSuccess;
+ != kActionResultNotDone)
+ return scriptResult == kActionResultSuccess;
return openAction(dObj, enactor);
}
@@ -289,8 +289,8 @@ bool ProtoObj::close(ObjectID dObj, ObjectID enactor) {
if ((scriptResult = stdActionScript(
Method_GameObject_onClose,
dObj, enactor, Nothing))
- != actionResultNotDone)
- return scriptResult == actionResultSuccess;
+ != kActionResultNotDone)
+ return scriptResult == kActionResultSuccess;
return closeAction(dObj, enactor);
}
@@ -314,8 +314,8 @@ bool ProtoObj::take(ObjectID dObj, ObjectID enactor, int16 num) {
if ((scriptResult = stdActionScript(
Method_GameObject_onTake,
dObj, enactor, Nothing))
- != actionResultNotDone)
- return scriptResult == actionResultSuccess;
+ != kActionResultNotDone)
+ return scriptResult == kActionResultSuccess;
return takeAction(dObj, enactor, num);
}
@@ -353,9 +353,9 @@ bool ProtoObj::drop(ObjectID dObj, ObjectID enactor, const Location &loc, int16
// If the script actually ran, and it didn't return a code
// telling us to abort the action...
- if (sResult == scriptResultFinished
- && scf.returnVal != actionResultNotDone)
- return scf.returnVal == actionResultSuccess;
+ if (sResult == kScriptResultFinished
+ && scf.returnVal != kActionResultNotDone)
+ return scf.returnVal == kActionResultSuccess;
return dropAction(dObj, enactor, loc, num);
}
@@ -384,8 +384,8 @@ bool ProtoObj::dropOn(ObjectID dObj, ObjectID enactor, ObjectID target, int16 co
if ((scriptResult = stdActionScript(
Method_GameObject_onDropOn,
dObj, enactor, target, count))
- != actionResultNotDone) {
- return scriptResult == actionResultSuccess;
+ != kActionResultNotDone) {
+ return scriptResult == kActionResultSuccess;
}
// At this point we should probably _split_ the object...
@@ -438,8 +438,8 @@ bool ProtoObj::strike(ObjectID dObj, ObjectID enactor, ObjectID item) {
if ((scriptResult = stdActionScript(
Method_GameObject_onStrike,
dObj, enactor, item))
- != actionResultNotDone)
- return scriptResult == actionResultSuccess;
+ != kActionResultNotDone)
+ return scriptResult == kActionResultSuccess;
return strikeAction(dObj, enactor, item);
}
@@ -459,8 +459,8 @@ bool ProtoObj::damage(ObjectID dObj, ObjectID enactor, ObjectID target) {
if ((scriptResult = stdActionScript(
Method_GameObject_onDamage,
dObj, enactor, target))
- != actionResultNotDone)
- return scriptResult == actionResultSuccess;
+ != kActionResultNotDone)
+ return scriptResult == kActionResultSuccess;
return damageAction(dObj, enactor, target);
}
@@ -481,8 +481,8 @@ bool ProtoObj::eat(ObjectID dObj, ObjectID enactor) {
if ((scriptResult = stdActionScript(
Method_GameObject_onEat,
dObj, enactor, Nothing))
- != actionResultNotDone)
- return scriptResult == actionResultSuccess;
+ != kActionResultNotDone)
+ return scriptResult == kActionResultSuccess;
return eatAction(dObj, enactor);
}
@@ -504,8 +504,8 @@ bool ProtoObj::insert(ObjectID dObj, ObjectID enactor, ObjectID item) {
if ((scriptResult = stdActionScript(
Method_GameObject_onInsert,
dObj, enactor, item))
- != actionResultNotDone)
- return scriptResult == actionResultSuccess;
+ != kActionResultNotDone)
+ return scriptResult == kActionResultSuccess;
return insertAction(dObj, enactor, item);
}
@@ -526,8 +526,8 @@ bool ProtoObj::remove(ObjectID dObj, ObjectID enactor) {
if ((scriptResult = stdActionScript(
Method_GameObject_onRemove,
dObj, enactor, Nothing))
- != actionResultNotDone)
- return scriptResult == actionResultSuccess;
+ != kActionResultNotDone)
+ return scriptResult == kActionResultSuccess;
return removeAction(dObj, enactor);
}
@@ -552,8 +552,8 @@ bool ProtoObj::acceptDrop(
if ((scriptResult = stdActionScript(
Method_GameObject_onAcceptDrop,
dObj, enactor, droppedObj, count))
- != actionResultNotDone)
- return scriptResult == actionResultSuccess;
+ != kActionResultNotDone)
+ return scriptResult == kActionResultSuccess;
return acceptDropAction(dObj, enactor, droppedObj, count);
}
@@ -578,8 +578,8 @@ bool ProtoObj::acceptDamage(
if ((scriptResult = stdActionScript(
Method_GameObject_onAcceptDamage,
dObj, enactor, Nothing))
- != actionResultNotDone)
- return scriptResult == actionResultSuccess;
+ != kActionResultNotDone)
+ return scriptResult == kActionResultSuccess;
return acceptDamageAction(
dObj,
@@ -644,8 +644,8 @@ bool ProtoObj::acceptStrike(
if ((scriptResult = stdActionScript(
Method_GameObject_onAcceptStrike,
dObj, enactor, strikingObj))
- != actionResultNotDone)
- return scriptResult == actionResultSuccess;
+ != kActionResultNotDone)
+ return scriptResult == kActionResultSuccess;
return acceptStrikeAction(
dObj,
@@ -679,8 +679,8 @@ bool ProtoObj::acceptLockToggle(
if ((scriptResult = stdActionScript(
Method_GameObject_onAcceptLockToggle,
dObj, enactor, Nothing))
- != actionResultNotDone)
- return scriptResult == actionResultSuccess;
+ != kActionResultNotDone)
+ return scriptResult == kActionResultSuccess;
return acceptLockToggleAction(dObj, enactor, keyCode);
}
@@ -707,8 +707,8 @@ bool ProtoObj::acceptMix(ObjectID dObj, ObjectID enactor, ObjectID mixObj) {
if ((scriptResult = stdActionScript(
Method_GameObject_onAcceptMix,
dObj, enactor, mixObj))
- != actionResultNotDone)
- return scriptResult == actionResultSuccess;
+ != kActionResultNotDone)
+ return scriptResult == kActionResultSuccess;
return acceptMixAction(dObj, enactor, mixObj);
}
@@ -735,8 +735,8 @@ bool ProtoObj::acceptInsertion(
if ((scriptResult = stdActionScript(
Method_GameObject_onAcceptInsertion,
dObj, enactor, item, count))
- != actionResultNotDone)
- return scriptResult == actionResultSuccess;
+ != kActionResultNotDone)
+ return scriptResult == kActionResultSuccess;
return acceptInsertionAction(dObj, enactor, item, count);
}
@@ -764,8 +764,8 @@ bool ProtoObj::acceptInsertionAt(
if ((scriptResult = stdActionScript(
Method_GameObject_onAcceptInsertion,
dObj, enactor, item))
- != actionResultNotDone)
- return scriptResult == actionResultSuccess;
+ != kActionResultNotDone)
+ return scriptResult == kActionResultSuccess;
return acceptInsertionAtAction(dObj, enactor, item, where, num);
}
@@ -854,10 +854,10 @@ int16 ProtoObj::stdActionScript(
// If the script actually ran, and it didn't return a code
// telling us to abort the action...
- if (sResult == scriptResultFinished)
+ if (sResult == kScriptResultFinished)
return scf.returnVal;
- return actionResultNotDone;
+ return kActionResultNotDone;
}
int16 ProtoObj::stdActionScript(
@@ -880,10 +880,10 @@ int16 ProtoObj::stdActionScript(
// If the script actually ran, and it didn't return a code
// telling us to abort the action...
- if (sResult == scriptResultFinished)
+ if (sResult == kScriptResultFinished)
return scf.returnVal;
- return actionResultNotDone;
+ return kActionResultNotDone;
}
// Initiate an attack using this type of object
diff --git a/engines/saga2/sagafunc.cpp b/engines/saga2/sagafunc.cpp
index bdd2d2d4072..fd518c70055 100644
--- a/engines/saga2/sagafunc.cpp
+++ b/engines/saga2/sagafunc.cpp
@@ -525,7 +525,7 @@ int16 scriptActorSay(int16 *args) {
if (!(flags & speakContinued)) {
// If we're going to wait for it synchronously
if (flags & speakWait) {
- thisThread->waitForEvent(Thread::waitOther, nullptr);
+ thisThread->waitForEvent(Thread::kWaitOther, nullptr);
sp->setWakeUp(getThreadID(thisThread));
}
@@ -1586,7 +1586,7 @@ int16 scriptActorTurn(int16 *args) {
uint16 flags = args[1];
if (flags & kMoveWait) {
- thisThread->waitForEvent(Thread::waitOther, nullptr);
+ thisThread->waitForEvent(Thread::kWaitOther, nullptr);
MotionTask::turn(getThreadID(thisThread), *a, args[0] & 7);
} else {
MotionTask::turn(*a, args[0] & 7);
@@ -1617,7 +1617,7 @@ int16 scriptActorTurnTowards(int16 *args) {
- a->getLocation()).quickDir();
if (flags & kMoveWait) {
- thisThread->waitForEvent(Thread::waitOther, nullptr);
+ thisThread->waitForEvent(Thread::kWaitOther, nullptr);
MotionTask::turn(getThreadID(thisThread), *a, dir);
} else {
MotionTask::turn(*a, dir);
@@ -1642,7 +1642,7 @@ int16 scriptActorWalk(int16 *args) {
uint16 flags = args[3];
if (flags & kMoveWait) {
- thisThread->waitForEvent(Thread::waitOther, nullptr);
+ thisThread->waitForEvent(Thread::kWaitOther, nullptr);
MotionTask::walkToDirect(
getThreadID(thisThread), *a, dest, flags & kMoveRun);
} else {
@@ -2522,7 +2522,7 @@ int16 scriptTagSetAnimation(int16 *args) {
// If we want to wait until finished
if (args[0] & tileAnimateWait) {
// Wait for the animation
- thisThread->waitForEvent(Thread::waitOther, nullptr);
+ thisThread->waitForEvent(Thread::kWaitOther, nullptr);
// And start the tile animation
TileActivityTask::doScript(*ai, args[1], getThreadID(thisThread));
@@ -2545,7 +2545,7 @@ int16 scriptTagSetWait(int16 *args) {
if (TileActivityTask::setWait(ai, getThreadID(thisThread))) {
// Wait for the animation
- thisThread->waitForEvent(Thread::waitOther, nullptr);
+ thisThread->waitForEvent(Thread::kWaitOther, nullptr);
}
return 0;
@@ -2570,7 +2570,7 @@ int16 scriptTagObtainLock(int16 *) {
WriteStatusF(15, "Locked: %d\n", lockCount);
#endif
} else {
- thisThread->waitForEvent(Thread::waitTagSemaphore, ai);
+ thisThread->waitForEvent(Thread::kWaitTagSemaphore, ai);
#if DEBUG*0
lockCount += 1;
WriteStatusF(15, "Locked: %d\n", lockCount);
@@ -2851,7 +2851,7 @@ int16 scriptSetGameMode(int16 *args) {
int16 scriptWait(int16 *args) {
MONOLOG(Wait);
thisThread->_waitAlarm.set(args[0]);
- thisThread->waitForEvent(Thread::waitDelay, nullptr);
+ thisThread->waitForEvent(Thread::kWaitDelay, nullptr);
thisThread->setExtended();
return 0;
}
@@ -2859,7 +2859,7 @@ int16 scriptWait(int16 *args) {
int16 scriptWaitFrames(int16 *args) {
MONOLOG(WaitFrames);
thisThread->_waitFrameAlarm.set(args[0]);
- thisThread->waitForEvent(Thread::waitFrameDelay, nullptr);
+ thisThread->waitForEvent(Thread::kWaitFrameDelay, nullptr);
thisThread->setExtended();
return 0;
}
@@ -3828,12 +3828,12 @@ int16 scriptFadeUp(int16 *) {
int16 scriptSetSynchronous(int16 *args) {
MONOLOG(SetSynchronous);
- int16 oldVal = (thisThread->_flags & Thread::synchronous) != 0;
+ int16 oldVal = (thisThread->_flags & Thread::kTFSynchronous) != 0;
if (args[0])
- thisThread->_flags |= Thread::synchronous;
+ thisThread->_flags |= Thread::kTFSynchronous;
else
- thisThread->_flags &= ~Thread::synchronous;
+ thisThread->_flags &= ~Thread::kTFSynchronous;
return oldVal;
}
diff --git a/engines/saga2/script.h b/engines/saga2/script.h
index cbe3ab40901..09dd4e52092 100644
--- a/engines/saga2/script.h
+++ b/engines/saga2/script.h
@@ -38,16 +38,16 @@ typedef int16 ThreadID;
enum scriptResult {
// Code returned when attempt to run a non-existent script
- scriptResultNoScript = 0,
+ kScriptResultNoScript = 0,
// Code returned when script was aborted before completion
- scriptResultAborted,
+ kScriptResultAborted,
// Code returned when script finished
- scriptResultFinished,
+ kScriptResultFinished,
// Script spun off as async thread; no answer available.
- scriptResultAsync
+ kScriptResultAsync
};
// Variables specific to a thread
@@ -88,15 +88,15 @@ enum {
// Code returned by script when script decides requested
// action is not possible, and the calling C-code should
// take action to inform user
- actionResultFailure = 0,
+ kActionResultFailure = 0,
// Code returned by script when script completes the action
// successfully and C-code should not complete the action
- actionResultSuccess,
+ kActionResultSuccess,
// Code returned by script when requested action should complete
// the action
- actionResultNotDone
+ kActionResultNotDone
};
// Method used to refer to a SAGA object
@@ -110,10 +110,10 @@ struct SegmentRef {
// such as actors and TAGS
enum builtinTypes {
- builtinTypeObject = -1,
- builtinTypeTAG = -2,
- builtinAbstract = -3,
- builtinTypeMission = -4
+ kBuiltinTypeObject = -1,
+ kBuiltinTypeTAG = -2,
+ kBuiltinAbstract = -3,
+ kBuiltinTypeMission = -4
};
/* ===================================================================== *
@@ -188,16 +188,16 @@ public:
uint8 *_stackBase; // base of module stack
enum threadFlags {
- waiting = (1 << 0), // thread waiting for event
- finished = (1 << 1), // thread finished normally
- aborted = (1 << 2), // thread is aborted
- extended = (1 << 3), // this is an extended sequence
- expectResult = (1 << 4), // script is expecting result on stack
- synchronous = (1 << 5), // when this bit is set this thread will
+ kTFWaiting = (1 << 0), // thread waiting for event
+ kTFFinished = (1 << 1), // thread finished normally
+ kTFAborted = (1 << 2), // thread is aborted
+ kTFExtended = (1 << 3), // this is an extended sequence
+ kTFExpectResult = (1 << 4), // script is expecting result on stack
+ kTFSynchronous = (1 << 5), // when this bit is set this thread will
// run until it is finished or this bit
// is cleared
- asleep = (waiting | finished | aborted)
+ kTFAsleep = (kTFWaiting | kTFFinished | kTFAborted)
};
int16 _stackSize, // allocated size of stack
@@ -209,17 +209,17 @@ public:
// Various signals that a script can wait upon
enum WaitTypes {
- waitNone = 0, // waiting for nothing
- waitDelay, // waiting for a timer
- waitFrameDelay, // waiting for frame count
- waitOther, // waiting for to be awoken
- waitTagSemaphore // waiting for a tag semaphore
-
-// waitSpeech, // waiting for speech to finish
-// waitDialogEnd, // waiting for my dialog to finish
-// waitDialogBegin, // waiting for other dialog to finish
-// waitWalk, // waiting to finish walking
-// waitRequest, // a request is up
+ kWaitNone = 0, // waiting for nothing
+ kWaitDelay, // waiting for a timer
+ kWaitFrameDelay, // waiting for frame count
+ kWaitOther, // waiting for to be awoken
+ kWaitTagSemaphore // waiting for a tag semaphore
+
+// kWaitSpeech, // waiting for speech to finish
+// kWaitDialogEnd, // waiting for my dialog to finish
+// kWaitDialogBegin, // waiting for other dialog to finish
+// kWaitWalk, // waiting to finish walking
+// kWaitRequest, // a request is up
};
WaitTypes _waitType; // what we're waiting for
@@ -263,8 +263,8 @@ public:
scriptResult run();
// Tells thread to wait for an event
- void waitForEvent(enum WaitTypes wt, ActiveItem *param) {
- _flags |= waiting;
+ void waitForEvent(WaitTypes wt, ActiveItem *param) {
+ _flags |= kTFWaiting;
_waitType = wt;
_waitParam = param;
}
@@ -312,11 +312,11 @@ extern Thread *thisThread; // task queue
//void killThread( Thread *th );
/*
-void wakeUpActorThread( enum WaitTypes wakeupType, void *obj );
-void wakeUpThreads( enum WaitTypes wakeupType );
-void wakeUpThreadsDelayed( enum WaitTypes wakeupType, int newdelay );
-void abortObjectThreads( Thread *keep, uint16 id );
-bool abortAllThreads( void );
+void wakeUpActorThread(WaitTypes wakeupType, void *obj);
+void wakeUpThreads(WaitTypes wakeupType);
+void wakeUpThreadsDelayed(WaitTypes wakeupType, int newdelay);
+void abortObjectThreads(Thread *keep, uint16 id);
+bool abortAllThreads(void);
*/
// Run a script function
diff --git a/engines/saga2/tile.cpp b/engines/saga2/tile.cpp
index 3ee24780d29..661b5a96325 100644
--- a/engines/saga2/tile.cpp
+++ b/engines/saga2/tile.cpp
@@ -449,9 +449,9 @@ bool ActiveItem::use(ActiveItem *ins, ObjectID enactor) {
scf.invokedTAI,
Method_TileActivityInstance_onUse,
scf)
- == scriptResultFinished) {
- if (scf.returnVal != actionResultNotDone)
- return scf.returnVal == actionResultSuccess;
+ == kScriptResultFinished) {
+ if (scf.returnVal != kActionResultNotDone)
+ return scf.returnVal == kActionResultSuccess;
}
}
@@ -511,7 +511,7 @@ bool ActiveItem::trigger(ActiveItem *ins, ObjectID enactor, ObjectID objID) {
scf.invokedTAI,
Method_TileActivityInstance_onCanTrigger,
scf)
- == scriptResultFinished) {
+ == kScriptResultFinished) {
if (!scf.returnVal) return true;
}
}
@@ -561,9 +561,9 @@ bool ActiveItem::trigger(ActiveItem *ins, ObjectID enactor, ObjectID objID) {
scf.invokedTAI,
Method_TileActivityInstance_onTrigger,
scf)
- == scriptResultFinished) {
- if (scf.returnVal != actionResultNotDone)
- return scf.returnVal == actionResultSuccess;
+ == kScriptResultFinished) {
+ if (scf.returnVal != kActionResultNotDone)
+ return scf.returnVal == kActionResultSuccess;
}
}
@@ -647,9 +647,9 @@ bool ActiveItem::release(ActiveItem *ins, ObjectID enactor, ObjectID objID) {
scf.invokedTAI,
Method_TileActivityInstance_onRelease,
scf)
- == scriptResultFinished) {
- if (scf.returnVal != actionResultNotDone)
- return scf.returnVal == actionResultSuccess;
+ == kScriptResultFinished) {
+ if (scf.returnVal != kActionResultNotDone)
+ return scf.returnVal == kActionResultSuccess;
}
}
@@ -677,9 +677,9 @@ bool ActiveItem::acceptLockToggle(ActiveItem *ins, ObjectID enactor, uint8 keyCo
scf.invokedTAI,
Method_TileActivityInstance_onAcceptLockToggle,
scf)
- == scriptResultFinished) {
- if (scf.returnVal != actionResultNotDone)
- return scf.returnVal == actionResultSuccess;
+ == kScriptResultFinished) {
+ if (scf.returnVal != kActionResultNotDone)
+ return scf.returnVal == kActionResultSuccess;
}
}
Commit: 4d6ca3173be8639a64bb65ef021c00e5a3a40d06
https://github.com/scummvm/scummvm/commit/4d6ca3173be8639a64bb65ef021c00e5a3a40d06
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-10-29T14:26:07+02:00
Commit Message:
SAGA2: Rename enums in sensor.h, setup.h and speech.h
Changed paths:
engines/saga2/sagafunc.cpp
engines/saga2/sensor.cpp
engines/saga2/sensor.h
engines/saga2/setup.h
engines/saga2/speech.cpp
engines/saga2/speech.h
engines/saga2/tilemode.cpp
diff --git a/engines/saga2/sagafunc.cpp b/engines/saga2/sagafunc.cpp
index fd518c70055..5a927de0340 100644
--- a/engines/saga2/sagafunc.cpp
+++ b/engines/saga2/sagafunc.cpp
@@ -479,10 +479,10 @@ int16 scriptActorSay(int16 *args) {
// Actor speech enums -- move these to include file
// MOVED TO SPEECH.H - EO
// enum {
-// speakContinued = (1<<0), // Append next speech
-// speakNoAnimate = (1<<1), // Don't animate speaking
-// speakWait = (1<<2), // wait until speech finished
-// speakLock = (1<<3), // LockUI while speaking
+// kSpeakContinued = (1<<0), // Append next speech
+// kSpeakNoAnimate = (1<<1), // Don't animate speaking
+// kSpeakWait = (1<<2), // wait until speech finished
+// kSpeakLock = (1<<3), // LockUI while speaking
// };
// 'obj' is the actor doing the speaking.
@@ -503,8 +503,8 @@ int16 scriptActorSay(int16 *args) {
if (sp == nullptr) {
uint16 spFlags = 0;
- if (flags & speakNoAnimate) spFlags |= Speech::spNoAnimate;
- if (flags & speakLock) spFlags |= Speech::spLock;
+ if (flags & kSpeakNoAnimate) spFlags |= Speech::kSpNoAnimate;
+ if (flags & kSpeakLock) spFlags |= Speech::kSpLock;
sp = speechList.newTask(obj->thisID(), spFlags);
@@ -522,9 +522,9 @@ int16 scriptActorSay(int16 *args) {
}
// If we're ready to activate the speech
- if (!(flags & speakContinued)) {
+ if (!(flags & kSpeakContinued)) {
// If we're going to wait for it synchronously
- if (flags & speakWait) {
+ if (flags & kSpeakWait) {
thisThread->waitForEvent(Thread::kWaitOther, nullptr);
sp->setWakeUp(getThreadID(thisThread));
}
diff --git a/engines/saga2/sensor.cpp b/engines/saga2/sensor.cpp
index 5361549b0a6..4301680e9a2 100644
--- a/engines/saga2/sensor.cpp
+++ b/engines/saga2/sensor.cpp
@@ -88,27 +88,27 @@ void readSensor(int16 ctr, Common::InSaveFile *in) {
debugC(3, kDebugSaveload, "type = %d", type);
switch (type) {
- case protaganistSensor:
+ case kProtaganistSensor:
sensor = new ProtaganistSensor(in, ctr);
break;
- case specificObjectSensor:
+ case kSpecificObjectSensor:
sensor = new SpecificObjectSensor(in, ctr);
break;
- case objectPropertySensor:
+ case kObjectPropertySensor:
sensor = new ObjectPropertySensor(in, ctr);
break;
- case specificActorSensor:
+ case kSpecificActorSensor:
sensor = new SpecificActorSensor(in, ctr);
break;
- case actorPropertySensor:
+ case kActorPropertySensor:
sensor = new ActorPropertySensor(in, ctr);
break;
- case eventSensor:
+ case kEventSensor:
sensor = new EventSensor(in, ctr);
break;
}
@@ -404,7 +404,7 @@ void Sensor::write(Common::MemoryWriteStreamDynamic *out) {
// Return an integer representing the type of this sensor
int16 ProtaganistSensor::getType() {
- return protaganistSensor;
+ return kProtaganistSensor;
}
//----------------------------------------------------------------------
@@ -558,7 +558,7 @@ void SpecificObjectSensor::write(Common::MemoryWriteStreamDynamic *out) {
// Return an integer representing the type of this sensor
int16 SpecificObjectSensor::getType() {
- return specificObjectSensor;
+ return kSpecificObjectSensor;
}
//----------------------------------------------------------------------
@@ -636,7 +636,7 @@ void ObjectPropertySensor::write(Common::MemoryWriteStreamDynamic *out) {
// Return an integer representing the type of this sensor
int16 ObjectPropertySensor::getType() {
- return objectPropertySensor;
+ return kObjectPropertySensor;
}
//----------------------------------------------------------------------
@@ -690,7 +690,7 @@ void SpecificActorSensor::write(Common::MemoryWriteStreamDynamic *out) {
// Return an integer representing the type of this sensor
int16 SpecificActorSensor::getType() {
- return specificActorSensor;
+ return kSpecificActorSensor;
}
//----------------------------------------------------------------------
@@ -757,7 +757,7 @@ void ActorPropertySensor::write(Common::MemoryWriteStreamDynamic *out) {
// Return an integer representing the type of this sensor
int16 ActorPropertySensor::getType() {
- return actorPropertySensor;
+ return kActorPropertySensor;
}
//----------------------------------------------------------------------
@@ -806,7 +806,7 @@ void EventSensor::write(Common::MemoryWriteStreamDynamic *out) {
// Return an integer representing the type of this sensor
int16 EventSensor::getType() {
- return eventSensor;
+ return kEventSensor;
}
//----------------------------------------------------------------------
diff --git a/engines/saga2/sensor.h b/engines/saga2/sensor.h
index e04d65de628..ad5b6683c6f 100644
--- a/engines/saga2/sensor.h
+++ b/engines/saga2/sensor.h
@@ -39,12 +39,12 @@ const int16 maxSenseRange = 0;
// Integers representing sensor types
enum SensorType {
- protaganistSensor,
- specificObjectSensor,
- objectPropertySensor,
- specificActorSensor,
- actorPropertySensor,
- eventSensor
+ kProtaganistSensor,
+ kSpecificObjectSensor,
+ kObjectPropertySensor,
+ kSpecificActorSensor,
+ kActorPropertySensor,
+ kEventSensor
};
// Sensors will be checked every 5 frames
diff --git a/engines/saga2/setup.h b/engines/saga2/setup.h
index 649a5b34b5b..b2aae35eb16 100644
--- a/engines/saga2/setup.h
+++ b/engines/saga2/setup.h
@@ -45,9 +45,9 @@ struct WindowDecoration;
// enum for the three levels in the trio view
enum trioViews {
- top,
- mid,
- bot
+ kTrioTop,
+ kTrioMid,
+ kTrioBot
};
struct ContainerInfo {
@@ -74,12 +74,12 @@ extern const ContainerInfo indivReadyContInfoBot;
// List of decorations for main window
enum borderIDs {
- MWBottomBorder = 0,
- MWTopBorder,
- MWLeftBorder,
- MWRightBorder1,
- MWRightBorder2,
- MWRightBorder3
+ kMWBottomBorder = 0,
+ kMWTopBorder,
+ kMWLeftBorder,
+ kMWRightBorder1,
+ kMWRightBorder2,
+ kMWRightBorder3
};
const int extraObjects = 512,
diff --git a/engines/saga2/speech.cpp b/engines/saga2/speech.cpp
index 27f65c134aa..e039affc272 100644
--- a/engines/saga2/speech.cpp
+++ b/engines/saga2/speech.cpp
@@ -169,7 +169,7 @@ void Speech::read(Common::InSaveFile *in) {
debugC(4, kDebugSaveload, "...... _speechBuffer = %s", _speechBuffer);
// Requeue the speech if needed
- if (_speechFlags & spQueued) {
+ if (_speechFlags & kSpQueued) {
// Add to the active list
speechList.remove(this);
speechList._list.push_back(this);
@@ -212,7 +212,7 @@ void Speech::write(Common::MemoryWriteStreamDynamic *out) {
// Store the flags. NOTE: Make sure this speech is not stored
// as being active
- out->writeSint16LE(_speechFlags & ~spActive);
+ out->writeSint16LE(_speechFlags & ~kSpActive);
debugC(4, kDebugSaveload, "...... _sampleCount = %d", _sampleCount);
debugC(4, kDebugSaveload, "...... _charCount = %d", _charCount);
@@ -268,7 +268,7 @@ bool Speech::activate() {
// Add to the active list
speechList._list.push_back(this);
- _speechFlags |= spQueued;
+ _speechFlags |= kSpQueued;
// This routine can't fail
return true;
@@ -282,7 +282,7 @@ bool Speech::setupActive() {
int16 buttonNum = 0,
buttonChars;
- _speechFlags |= spActive;
+ _speechFlags |= kSpActive;
speechFinished.set((_charCount * 4 / 2) + ticksPerSecond);
@@ -313,18 +313,18 @@ bool Speech::setupActive() {
/// EO SEARCH ///
if (sayVoiceAt(_sampleID, loc))
- _speechFlags |= spHasVoice;
+ _speechFlags |= kSpHasVoice;
else
- _speechFlags &= ~spHasVoice;
+ _speechFlags &= ~kSpHasVoice;
- } else _speechFlags &= ~spHasVoice;
+ } else _speechFlags &= ~kSpHasVoice;
speechLineCount = buttonWrap(speechLineList,
speechButtonList,
speechButtonCount,
_speechBuffer,
_bounds.width,
- !g_vm->_speechText && (_speechFlags & spHasVoice),
+ !g_vm->_speechText && (_speechFlags & kSpHasVoice),
_textPort);
// Compute height of bitmap based on number of lines of text.
@@ -403,10 +403,10 @@ bool Speech::setupActive() {
speechList.SetLock(false);
} else {
// If there is a lock flag on this speech, then LockUI()
- speechList.SetLock(_speechFlags & spLock);
+ speechList.SetLock(_speechFlags & kSpLock);
}
- if (!(_speechFlags & spNoAnimate) && isActor(_objID)) {
+ if (!(_speechFlags & kSpNoAnimate) && isActor(_objID)) {
Actor *a = (Actor *)GameObject::objectAddress(_objID);
if (!a->isDead() && !a->isMoving()) MotionTask::talk(*a);
@@ -432,7 +432,7 @@ void Speech::setWidth() {
speechButtonCount_,
_speechBuffer,
defaultWidth,
- !g_vm->_speechText && (_speechFlags & spHasVoice),
+ !g_vm->_speechText && (_speechFlags & kSpHasVoice),
_textPort);
// If it's more than 3 lines, then use the max line width.
@@ -443,7 +443,7 @@ void Speech::setWidth() {
speechButtonCount_,
_speechBuffer,
maxWidth,
- !g_vm->_speechText && (_speechFlags & spHasVoice),
+ !g_vm->_speechText && (_speechFlags & kSpHasVoice),
_textPort);
}
@@ -528,7 +528,7 @@ void Speech::dispose() {
speechLineCount = speechButtonCount = 0;
speakButtonControls->enable(false);
- if (!(_speechFlags & spNoAnimate) && isActor(_objID)) {
+ if (!(_speechFlags & kSpNoAnimate) && isActor(_objID)) {
Actor *a = (Actor *)GameObject::objectAddress(_objID);
if (a->_moveTask)
@@ -552,7 +552,7 @@ void updateSpeech() {
// if there is a speech object
if ((sp = speechList.currentActive()) != nullptr) {
// If there is no bitmap, then set one up.
- if (!(sp->_speechFlags & Speech::spActive)) {
+ if (!(sp->_speechFlags & Speech::kSpActive)) {
sp->setupActive();
// If speech failed to set up, then skip it
@@ -575,7 +575,7 @@ void updateSpeech() {
}
bool Speech::longEnough() {
- if (_speechFlags & spHasVoice)
+ if (_speechFlags & kSpHasVoice)
return (!stillDoingVoice(_sampleID));
else
return (_selectedButton != 0 || speechFinished.check());
@@ -586,7 +586,7 @@ bool Speech::longEnough() {
void Speech::abortSpeech() {
// Start by displaying first frame straight off, no delay
speechFinished.set(0);
- if (_speechFlags & spHasVoice) {
+ if (_speechFlags & kSpHasVoice) {
PlayVoice(nullptr);
}
}
@@ -992,7 +992,7 @@ Speech *SpeechTaskList::newTask(ObjectID id, uint16 flags) {
sp->_sampleCount = sp->_charCount = 0;
sp->_objID = id;
- sp->_speechFlags = flags & (Speech::spNoAnimate | Speech::spLock);
+ sp->_speechFlags = flags & (Speech::kSpNoAnimate | Speech::kSpLock);
sp->_outlineColor = 15 + 9;
sp->_thread = NoThread;
sp->_selectedButton = 0;
diff --git a/engines/saga2/speech.h b/engines/saga2/speech.h
index 2420050bfb8..e3b11614c49 100644
--- a/engines/saga2/speech.h
+++ b/engines/saga2/speech.h
@@ -61,10 +61,10 @@ extern int16 speechButtonCount; // count of speech buttons
// Actor speech enums -- move these to include file
enum {
- speakContinued = (1 << 0), // Append next speech
- speakNoAnimate = (1 << 1), // Don't animate speaking
- speakWait = (1 << 2), // wait until speech finished
- speakLock = (1 << 3) // lock UI while speech in progress
+ kSpeakContinued = (1 << 0), // Append next speech
+ kSpeakNoAnimate = (1 << 1), // Don't animate speaking
+ kSpeakWait = (1 << 2), // wait until speech finished
+ kSpeakLock = (1 << 3) // lock UI while speech in progress
};
class Speech {
@@ -122,11 +122,11 @@ private:
public:
enum SpeechFlags {
- spNoAnimate = (1 << 0), // Don't animate actor
- spHasVoice = (1 << 1), // The audio interface is playing this voice
- spQueued = (1 << 2), // In active queue
- spActive = (1 << 3), // Is current active speech
- spLock = (1 << 4) // Lock UI while speaking
+ kSpNoAnimate = (1 << 0), // Don't animate actor
+ kSpHasVoice = (1 << 1), // The audio interface is playing this voice
+ kSpQueued = (1 << 2), // In active queue
+ kSpActive = (1 << 3), // Is current active speech
+ kSpLock = (1 << 4) // Lock UI while speaking
};
// remove speech, dealloc resources
diff --git a/engines/saga2/tilemode.cpp b/engines/saga2/tilemode.cpp
index 7e8f25e472e..9daaf166eca 100644
--- a/engines/saga2/tilemode.cpp
+++ b/engines/saga2/tilemode.cpp
@@ -206,12 +206,12 @@ static bool inCombat,
// inside a header. GT 09/11/95
static StaticWindow mainWindowDecorations[] = {
- {{0, 0, 640, 20}, nullptr, MWTopBorder}, // top border
- {{0, 440, 640, 40}, nullptr, MWBottomBorder}, // bottom border
- {{0, 20, 20, 420}, nullptr, MWLeftBorder}, // left border
- {{460, 20, 180, 142}, nullptr, MWRightBorder1}, // right border #1
- {{460, 162, 180, 151}, nullptr, MWRightBorder2}, // right border #2
- {{460, 313, 180, 127}, nullptr, MWRightBorder3}, // right border #3
+ {{0, 0, 640, 20}, nullptr, kMWTopBorder}, // top border
+ {{0, 440, 640, 40}, nullptr, kMWBottomBorder}, // bottom border
+ {{0, 20, 20, 420}, nullptr, kMWLeftBorder}, // left border
+ {{460, 20, 180, 142}, nullptr, kMWRightBorder1}, // right border #1
+ {{460, 162, 180, 151}, nullptr, kMWRightBorder2}, // right border #2
+ {{460, 313, 180, 127}, nullptr, kMWRightBorder3}, // right border #3
};
/* ===================================================================== *
Commit: d2e7c34fa48efa16245619c624957361277e8996
https://github.com/scummvm/scummvm/commit/d2e7c34fa48efa16245619c624957361277e8996
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-10-29T14:29:23+02:00
Commit Message:
SAGA2: Rename enums in speldefs.h
Changed paths:
engines/saga2/effects.cpp
engines/saga2/effects.h
engines/saga2/spelcast.cpp
engines/saga2/speldefs.h
engines/saga2/spellio.cpp
engines/saga2/spellsta.cpp
engines/saga2/spelshow.h
diff --git a/engines/saga2/effects.cpp b/engines/saga2/effects.cpp
index 577f9789478..c1cb94c7a7d 100644
--- a/engines/saga2/effects.cpp
+++ b/engines/saga2/effects.cpp
@@ -97,7 +97,7 @@ void ProtoDamage::implement(GameObject *cst, SpellTarget *trg, int8 deltaDamage)
totalBase -= deltaDamage;
- assert(trg->getType() == SpellTarget::spellTargetObject);
+ assert(trg->getType() == SpellTarget::kSpellTargetObject);
if (_self)
cst->acceptDamage(cst->thisID(), totalBase, _type, totalDice, _sides);
else
@@ -182,7 +182,7 @@ void ProtoDrainage::implement(GameObject *cst, SpellTarget *trg, int8) {
int8 totalDamage = diceRoll(totalDice, 6, 0, 0);
- if (!(trg->getType() == SpellTarget::spellTargetObject))
+ if (!(trg->getType() == SpellTarget::kSpellTargetObject))
return;
GameObject *target = _self ? cst : trg->getObject();
if (!isActor(target))
@@ -287,30 +287,30 @@ void ProtoSpecialEffect::implement(GameObject *cst, SpellTarget *trg, int8) {
* ===================================================================== */
bool ProtoDamage::applicable(SpellTarget &trg) {
- return trg.getType() == SpellTarget::spellTargetObject ||
- trg.getType() == SpellTarget::spellTargetObjectPoint;
+ return trg.getType() == SpellTarget::kSpellTargetObject ||
+ trg.getType() == SpellTarget::kSpellTargetObjectPoint;
}
bool ProtoDrainage::applicable(SpellTarget &trg) {
- return (trg.getType() == SpellTarget::spellTargetObject ||
- trg.getType() == SpellTarget::spellTargetObjectPoint) &&
+ return (trg.getType() == SpellTarget::kSpellTargetObject ||
+ trg.getType() == SpellTarget::kSpellTargetObjectPoint) &&
isActor(trg.getObject());
}
bool ProtoEnchantment::applicable(SpellTarget &trg) {
- return (trg.getType() == SpellTarget::spellTargetObject ||
- trg.getType() == SpellTarget::spellTargetObjectPoint) &&
+ return (trg.getType() == SpellTarget::kSpellTargetObject ||
+ trg.getType() == SpellTarget::kSpellTargetObjectPoint) &&
(isActor(trg.getObject()) ||
getEnchantmentSubType(_enchID) == kActorInvisible);
}
bool ProtoTAGEffect::applicable(SpellTarget &trg) {
- return (trg.getType() == SpellTarget::spellTargetTAG);
+ return (trg.getType() == SpellTarget::kSpellTargetTAG);
}
bool ProtoObjectEffect::applicable(SpellTarget &trg) {
- return (trg.getType() == SpellTarget::spellTargetObject ||
- trg.getType() == SpellTarget::spellTargetObjectPoint) &&
+ return (trg.getType() == SpellTarget::kSpellTargetObject ||
+ trg.getType() == SpellTarget::kSpellTargetObjectPoint) &&
!isActor(trg.getObject());
}
@@ -331,20 +331,20 @@ void createSpellCallFrame(GameObject *go, SpellTarget *trg, scriptCallFrame &scf
scf.coords = Nowhere;
switch (trg->getType()) {
- case SpellTarget::spellTargetPoint :
- case SpellTarget::spellTargetObjectPoint:
+ case SpellTarget::kSpellTargetPoint :
+ case SpellTarget::kSpellTargetObjectPoint:
scf.value = 1;
scf.coords = trg->getPoint();
break;
- case SpellTarget::spellTargetObject :
+ case SpellTarget::kSpellTargetObject :
scf.value = 2;
scf.directObject = trg->getObject()->thisID();
break;
- case SpellTarget::spellTargetTAG :
+ case SpellTarget::kSpellTargetTAG :
scf.value = 3;
scf.directTAI = trg->getTAG()->thisID();
break;
- case SpellTarget::spellTargetNone :
+ case SpellTarget::kSpellTargetNone :
default :
scf.value = 0;
break;
diff --git a/engines/saga2/effects.h b/engines/saga2/effects.h
index e74c7808a6c..5232085c6d4 100644
--- a/engines/saga2/effects.h
+++ b/engines/saga2/effects.h
@@ -545,8 +545,8 @@ public:
bool applicable(SpellTarget &) {
return true;
- //return (trg.getType()==SpellTarget::spellTargetObject ||
- // trg.getType()==SpellTarget::spellTargetObjectPoint) &&
+ //return (trg.getType()==SpellTarget::kSpellTargetObject ||
+ // trg.getType()==SpellTarget::kSpellTargetObjectPoint) &&
// isActor(trg.getObject());
}
diff --git a/engines/saga2/spelcast.cpp b/engines/saga2/spelcast.cpp
index e8f1774c005..83487777988 100644
--- a/engines/saga2/spelcast.cpp
+++ b/engines/saga2/spelcast.cpp
@@ -150,19 +150,19 @@ void SpellStuff::killEffects() {
void SpellStuff::implement(GameObject *enactor, SpellTarget *target) {
assert(target);
switch (target->getType()) {
- case SpellTarget::spellTargetPoint:
+ case SpellTarget::kSpellTargetPoint:
implement(enactor, Location(target->getPoint(), Nothing));
break;
- case SpellTarget::spellTargetObjectPoint:
+ case SpellTarget::kSpellTargetObjectPoint:
if (_targetTypes == spellApplyObject)
implement(enactor, target->getObject());
else
implement(enactor, Location(target->getPoint(), Nothing));
break;
- case SpellTarget::spellTargetObject:
+ case SpellTarget::kSpellTargetObject:
implement(enactor, target->getObject());
break;
- case SpellTarget::spellTargetTAG:
+ case SpellTarget::kSpellTargetTAG:
implement(enactor, target->getTAG());
break;
default:
@@ -781,7 +781,7 @@ TilePoint collideTo(Effectron *e, TilePoint nloc) {
Effectron::Effectron() {
_age = 0;
_pos = 0;
- _flags = effectronDead;
+ _flags = kEffectronDead;
_parent = nullptr;
_partno = 0;
_totalSteps = _stepNo = 0;
diff --git a/engines/saga2/speldefs.h b/engines/saga2/speldefs.h
index 0d1df48c3b2..0242d1bb9db 100644
--- a/engines/saga2/speldefs.h
+++ b/engines/saga2/speldefs.h
@@ -141,11 +141,11 @@ class SpellTarget {
public :
enum spellTargetType {
- spellTargetNone = 0, // invalid
- spellTargetPoint, // targeted on a particular point
- spellTargetObjectPoint, // targeted on an object's location
- spellTargetObject, // targeted on an object (tracking)
- spellTargetTAG // targeted on an object (tracking)
+ kSpellTargetNone = 0, // invalid
+ kSpellTargetPoint, // targeted on a particular point
+ kSpellTargetObjectPoint, // targeted on an object's location
+ kSpellTargetObject, // targeted on an object (tracking)
+ kSpellTargetTAG // targeted on an object (tracking)
};
private:
@@ -159,7 +159,7 @@ public:
SpellTarget *_next;
SpellTarget() {
- _type = spellTargetNone;
+ _type = kSpellTargetNone;
_obj = nullptr;
_loc.u = 0;
_loc.v = 0;
@@ -170,7 +170,7 @@ public:
// This constructor is for non-tracking targets
SpellTarget(GameObject &object) {
- _type = spellTargetObjectPoint;
+ _type = kSpellTargetObjectPoint;
_loc = object.getWorldLocation();
_loc.z += object.proto()->height / 2;
_next = nullptr;
@@ -180,20 +180,20 @@ public:
// This constructor is for tracking targets
SpellTarget(GameObject *object) {
- _type = spellTargetObject;
+ _type = kSpellTargetObject;
_obj = object;
_next = nullptr;
_tag = nullptr;
}
SpellTarget(TilePoint &tp) {
- _type = spellTargetPoint;
+ _type = kSpellTargetPoint;
_loc = tp;
_next = nullptr;
_tag = nullptr;
_obj = nullptr;
}
SpellTarget(ActiveItem *ai) {
- _type = spellTargetTAG;
+ _type = kSpellTargetTAG;
_tag = ai;
_next = nullptr;
_tag = nullptr;
@@ -225,14 +225,14 @@ public:
TilePoint getPoint() {
switch (_type) {
- case spellTargetPoint :
- case spellTargetObjectPoint :
+ case kSpellTargetPoint :
+ case kSpellTargetObjectPoint :
return _loc;
- case spellTargetObject :
+ case kSpellTargetObject :
return objPos(_obj);
- case spellTargetTAG :
+ case kSpellTargetTAG :
return TAGPos(_tag);
- case spellTargetNone :
+ case kSpellTargetNone :
default :
return Nowhere;
}
@@ -243,12 +243,12 @@ public:
}
GameObject *getObject() {
- assert(_type == spellTargetObject);
+ assert(_type == kSpellTargetObject);
return _obj;
}
ActiveItem *getTAG() {
- assert(_type == spellTargetTAG);
+ assert(_type == kSpellTargetTAG);
return _tag;
}
@@ -258,10 +258,10 @@ public:
// Effectron flags
enum EffectronFlagMasks {
- effectronOK = 0,
- effectronHidden = (1 << 0),
- effectronDead = (1 << 1),
- effectronBumped = (1 << 2)
+ kEffectronOK = 0,
+ kEffectronHidden = (1 << 0),
+ kEffectronDead = (1 << 1),
+ kEffectronBumped = (1 << 2)
};
typedef uint32 EffectronFlags;
@@ -320,23 +320,23 @@ public:
}
inline void hide() {
- _flags |= effectronHidden;
+ _flags |= kEffectronHidden;
}
inline void unhide() {
- _flags &= (~effectronHidden);
+ _flags &= (~kEffectronHidden);
}
inline bool isHidden() const {
- return _flags & effectronHidden;
+ return _flags & kEffectronHidden;
}
inline void kill() {
- _flags |= effectronDead;
+ _flags |= kEffectronDead;
}
inline int isDead() const {
- return _flags & effectronDead;
+ return _flags & kEffectronDead;
}
inline void bump();
inline int isBumped() const {
- return _flags & effectronBumped;
+ return _flags & kEffectronBumped;
}
inline GameWorld *world() const;
diff --git a/engines/saga2/spellio.cpp b/engines/saga2/spellio.cpp
index 48712e5ff14..6cf9f774e72 100644
--- a/engines/saga2/spellio.cpp
+++ b/engines/saga2/spellio.cpp
@@ -231,8 +231,8 @@ StorageSpellTarget::StorageSpellTarget(SpellTarget &st) {
ActiveItem *ai;
type = st.getType();
loc = st.getPoint();
- if (type == SpellTarget::spellTargetObject) {
- if (type == SpellTarget::spellTargetObject)
+ if (type == SpellTarget::kSpellTargetObject) {
+ if (type == SpellTarget::kSpellTargetObject)
go = st.getObject();
else
go = nullptr;
@@ -243,7 +243,7 @@ StorageSpellTarget::StorageSpellTarget(SpellTarget &st) {
else
obj = Nothing;
- if (type == SpellTarget::spellTargetTAG)
+ if (type == SpellTarget::kSpellTargetTAG)
ai = st.getTAG();
else
ai = nullptr;
diff --git a/engines/saga2/spellsta.cpp b/engines/saga2/spellsta.cpp
index 19c9496d8f4..e9a99bcd0d4 100644
--- a/engines/saga2/spellsta.cpp
+++ b/engines/saga2/spellsta.cpp
@@ -34,8 +34,8 @@ namespace Saga2 {
// effectron should still be shown
// Return values
// 0 : show normally
-// effectronHidden: hide but don't remove effectron
-// effectronDead : permanently hide effectron. when all
+// kEffectronHidden: hide but don't remove effectron
+// kEffectronDead : permanently hide effectron. when all
// effectrons have this status the effect ends
//
@@ -46,20 +46,20 @@ namespace Saga2 {
// null spell
SPELLSTATUSFUNCTION(invisibleSpellSta) {
- return effectronDead;
+ return kEffectronDead;
}
// semi permanent aura
SPELLSTATUSFUNCTION(auraSpellSta) {
if (effectron->_stepNo > effectron->_totalSteps)
- return effectronDead;
+ return kEffectronDead;
return 0;
}
SPELLSTATUSFUNCTION(wallSpellSta) {
if (effectron->_stepNo > effectron->_totalSteps)
- return effectronDead;
+ return kEffectronDead;
return 0;
}
@@ -67,68 +67,68 @@ SPELLSTATUSFUNCTION(wallSpellSta) {
SPELLSTATUSFUNCTION(projectileSpellSta) {
if (effectron->_stepNo > effectron->_totalSteps)
- return effectronDead;
+ return kEffectronDead;
return 0;
}
SPELLSTATUSFUNCTION(exchangeSpellSta) {
if (effectron->_stepNo < effectron->_partno / 2)
- return effectronHidden;
+ return kEffectronHidden;
if (effectron->_stepNo >= effectron->_totalSteps)
- return effectronDead;
+ return kEffectronDead;
return 0;
}
SPELLSTATUSFUNCTION(boltSpellSta) {
if (effectron->_stepNo - (effectron->_partno / 9) > effectron->_totalSteps)
- return effectronDead;
+ return kEffectronDead;
if ((effectron->_partno / 9) >= effectron->_stepNo)
- return effectronHidden;
+ return kEffectronHidden;
return 0;
}
SPELLSTATUSFUNCTION(beamSpellSta) {
if ((effectron->_partno > effectron->_totalSteps) ||
(effectron->_stepNo > effectron->_totalSteps))
- return effectronDead;
+ return kEffectronDead;
return 0;
}
SPELLSTATUSFUNCTION(coneSpellSta) {
if (effectron->_stepNo - (effectron->_partno / 9) > effectron->_totalSteps)
- return effectronDead;
+ return kEffectronDead;
if (effectron->_partno / 9 >= effectron->_stepNo)
- return effectronHidden;
+ return kEffectronHidden;
return 0;
}
SPELLSTATUSFUNCTION(waveSpellSta) {
if (effectron->_stepNo - (effectron->_partno / 17) > effectron->_totalSteps)
- return effectronDead;
+ return kEffectronDead;
if (effectron->_partno / 17 < effectron->_stepNo)
- return effectronHidden;
+ return kEffectronHidden;
return 0;
}
SPELLSTATUSFUNCTION(ballSpellSta) {
if (effectron->isBumped() ||
effectron->_stepNo > effectron->_totalSteps)
- return effectronDead;
+ return kEffectronDead;
return 0;
}
SPELLSTATUSFUNCTION(squareSpellSta) {
if (effectron->isBumped() ||
effectron->_stepNo > effectron->_totalSteps)
- return effectronDead;
+ return kEffectronDead;
return 0;
}
SPELLSTATUSFUNCTION(stormSpellSta) {
if (effectron->isBumped() ||
effectron->_stepNo > effectron->_totalSteps)
- return effectronDead;
+ return kEffectronDead;
return 0;
}
diff --git a/engines/saga2/spelshow.h b/engines/saga2/spelshow.h
index 6b89f594d34..52e418a6ec4 100644
--- a/engines/saga2/spelshow.h
+++ b/engines/saga2/spelshow.h
@@ -117,7 +117,7 @@ class EffectDisplayPrototype {
return 0;
}
static SPELLSTATUSFUNCTION(nullStatus) {
- return effectronDead;
+ return kEffectronDead;
}
static SPELLHEIGHTFUNCTION(nullHeight) {
return 0;
Commit: cc93020cb5ea8ebfbcd07262722d11e7eaf8fadc
https://github.com/scummvm/scummvm/commit/cc93020cb5ea8ebfbcd07262722d11e7eaf8fadc
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-10-29T14:33:52+02:00
Commit Message:
SAGA2: Renamed enums in spelbuk.h
Changed paths:
engines/saga2/magic.cpp
engines/saga2/motion.cpp
engines/saga2/objects.cpp
engines/saga2/spelcast.cpp
engines/saga2/speldata.cpp
engines/saga2/spellbuk.h
engines/saga2/spellio.cpp
engines/saga2/spellspr.cpp
engines/saga2/weapons.cpp
diff --git a/engines/saga2/magic.cpp b/engines/saga2/magic.cpp
index a51a107a52a..d67d639bf6a 100644
--- a/engines/saga2/magic.cpp
+++ b/engines/saga2/magic.cpp
@@ -157,8 +157,8 @@ bool validTarget(GameObject *enactor, GameObject *target, ActiveItem *tag, Skill
return false;
}
if (target->thisID() == enactor->thisID())
- return sp.canTarget(spellTargCaster);
- return sp.canTarget(spellTargObject);
+ return sp.canTarget(kSpellTargCaster);
+ return sp.canTarget(kSpellTargObject);
}
if (tag != nullptr) {
if (range > 0 &&
@@ -168,7 +168,7 @@ bool validTarget(GameObject *enactor, GameObject *target, ActiveItem *tag, Skill
.magnitude()) {
return false;
}
- return sp.canTarget(spellTargTAG);
+ return sp.canTarget(kSpellTargTAG);
}
#if RANGE_CHECKING
if (sp.range > 0 &&
@@ -179,7 +179,7 @@ bool validTarget(GameObject *enactor, GameObject *target, ActiveItem *tag, Skill
return false;
}
#endif
- return sp.canTarget(spellTargLocation);
+ return sp.canTarget(kSpellTargLocation);
}
//-----------------------------------------------------------------------
@@ -278,7 +278,7 @@ bool implementSpell(GameObject *enactor, Location &target, SkillProto *spell)
SpellID s = spell->getSpellID();
SpellStuff &sProto = spellBook[s];
- assert(sProto.shouldTarget(spellApplyLocation));
+ assert(sProto.shouldTarget(kSpellApplyLocation));
ActorManaID ami = (ActorManaID)(sProto.getManaType());
@@ -314,10 +314,10 @@ bool implementSpell(GameObject *enactor, ActiveItem *target, SkillProto *spell)
SpellID s = spell->getSpellID();
SpellStuff &sProto = spellBook[s];
Location l = Location(TAGPos(target), enactor->world()->thisID());
- if (sProto.shouldTarget(spellApplyLocation)) {
+ if (sProto.shouldTarget(kSpellApplyLocation)) {
return implementSpell(enactor, l, spell);
}
- assert(sProto.shouldTarget(spellApplyTAG));
+ assert(sProto.shouldTarget(kSpellApplyTAG));
assert(target->_data.itemType == activeTypeInstance);
ActorManaID ami = (ActorManaID)(sProto.getManaType());
@@ -354,9 +354,9 @@ bool implementSpell(GameObject *enactor, GameObject *target, SkillProto *spell)
SpellID s = spell->getSpellID();
SpellStuff &sProto = spellBook[s];
Location l = Location(target->getWorldLocation(), enactor->world()->thisID());
- if (sProto.shouldTarget(spellApplyLocation))
+ if (sProto.shouldTarget(kSpellApplyLocation))
return implementSpell(enactor, l, spell);
- assert(sProto.shouldTarget(spellApplyObject));
+ assert(sProto.shouldTarget(kSpellApplyObject));
ActorManaID ami = (ActorManaID)(sProto.getManaType());
diff --git a/engines/saga2/motion.cpp b/engines/saga2/motion.cpp
index be5f07f0a6a..431d19c2595 100644
--- a/engines/saga2/motion.cpp
+++ b/engines/saga2/motion.cpp
@@ -1689,7 +1689,7 @@ void MotionTask::fireBow(Actor &a, GameObject &target) {
void MotionTask::castSpell(Actor &a, SkillProto &spell, GameObject &target) {
MotionTask *mt;
motionTypes type =
- (spellBook[spell.getSpellID()].getManaType() == sManaIDSkill) ?
+ (spellBook[spell.getSpellID()].getManaType() == ksManaIDSkill) ?
kMotionTypeGive :
kMotionTypeCastSpell;
@@ -1709,7 +1709,7 @@ void MotionTask::castSpell(Actor &a, SkillProto &spell, GameObject &target) {
void MotionTask::castSpell(Actor &a, SkillProto &spell, Location &target) {
MotionTask *mt;
motionTypes type =
- (spellBook[spell.getSpellID()].getManaType() == sManaIDSkill) ?
+ (spellBook[spell.getSpellID()].getManaType() == ksManaIDSkill) ?
kMotionTypeGive :
kMotionTypeCastSpell;
@@ -1728,7 +1728,7 @@ void MotionTask::castSpell(Actor &a, SkillProto &spell, Location &target) {
void MotionTask::castSpell(Actor &a, SkillProto &spell, ActiveItem &target) {
MotionTask *mt;
motionTypes type =
- (spellBook[spell.getSpellID()].getManaType() == sManaIDSkill) ?
+ (spellBook[spell.getSpellID()].getManaType() == ksManaIDSkill) ?
kMotionTypeGive :
kMotionTypeCastSpell;
diff --git a/engines/saga2/objects.cpp b/engines/saga2/objects.cpp
index 4877405a9c0..1bfb6870905 100644
--- a/engines/saga2/objects.cpp
+++ b/engines/saga2/objects.cpp
@@ -658,7 +658,7 @@ void GameObject::objCursorText(char nameBuf[], const int8 size, int16 count) {
manaCost = spellBook[sProto->getSpellID()].getManaAmt();
}
- if (manaColor == sManaIDSkill) { // It's a skill
+ if (manaColor == ksManaIDSkill) { // It's a skill
// get the level of the skill for the brother in question
uint16 brotherID = getCenterActor()->thisID();
uint16 level;
@@ -676,8 +676,8 @@ void GameObject::objCursorText(char nameBuf[], const int8 size, int16 count) {
// normalize and output
Common::sprintf_s(nameBuf, size, "%s-%d", objName(), ++level);
}
- } else if (manaColor >= sManaIDRed
- && manaColor <= sManaIDViolet // A spell
+ } else if (manaColor >= ksManaIDRed
+ && manaColor <= ksManaIDViolet // A spell
&& manaCost > 0) {
ObjectID aID = possessor(); // Who owns the spell
PlayerActorID pID;
@@ -703,7 +703,7 @@ bool GameObject::isTrueSkill() {
SkillProto *sProto = skillProtoFromID(thisID());
// determine if this is a skill icon
- if (spellBook[sProto->getSpellID()].getManaType() == sManaIDSkill) {
+ if (spellBook[sProto->getSpellID()].getManaType() == ksManaIDSkill) {
return true;
}
}
diff --git a/engines/saga2/spelcast.cpp b/engines/saga2/spelcast.cpp
index 83487777988..b6eb467f363 100644
--- a/engines/saga2/spelcast.cpp
+++ b/engines/saga2/spelcast.cpp
@@ -64,13 +64,13 @@ SpellStuff::SpellStuff() {
_master = nullSpell;
_display = nullSpell;
_prototype = nullptr;
- _targetableTypes = spellTargNone;
- _targetTypes = spellApplyNone;
+ _targetableTypes = kSpellTargNone;
+ _targetTypes = kSpellApplyNone;
_effects = nullptr;
_targets = nullptr;
- _manaType = sManaIDSkill;
+ _manaType = ksManaIDSkill;
_manaUse = 0;
- _shape = eAreaInvisible;
+ _shape = keAreaInvisible;
_size = 0;
_range = 0;
_sound = 0;
@@ -82,8 +82,8 @@ SpellStuff::SpellStuff() {
// is this spell harmful
bool SpellStuff::isOffensive() {
- return (canTarget(spellTargActor) || canTarget(spellTargObject)) &&
- (!canTarget(spellTargCaster));
+ return (canTarget(kSpellTargActor) || canTarget(kSpellTargObject)) &&
+ (!canTarget(kSpellTargCaster));
}
//-----------------------------------------------------------------------
@@ -91,21 +91,21 @@ bool SpellStuff::isOffensive() {
bool SpellStuff::safe() {
switch (_shape) {
- case eAreaInvisible:
- case eAreaAura:
- case eAreaGlow:
- case eAreaProjectile:
- case eAreaExchange:
- case eAreaMissle:
- case eAreaSquare:
- case eAreaBall:
- case eAreaWall:
- case eAreaStorm:
+ case keAreaInvisible:
+ case keAreaAura:
+ case keAreaGlow:
+ case keAreaProjectile:
+ case keAreaExchange:
+ case keAreaMissle:
+ case keAreaSquare:
+ case keAreaBall:
+ case keAreaWall:
+ case keAreaStorm:
return false;
- case eAreaBolt:
- case eAreaBeam:
- case eAreaCone:
- case eAreaWave:
+ case keAreaBolt:
+ case keAreaBeam:
+ case keAreaCone:
+ case keAreaWave:
return true;
}
return false;
@@ -154,7 +154,7 @@ void SpellStuff::implement(GameObject *enactor, SpellTarget *target) {
implement(enactor, Location(target->getPoint(), Nothing));
break;
case SpellTarget::kSpellTargetObjectPoint:
- if (_targetTypes == spellApplyObject)
+ if (_targetTypes == kSpellApplyObject)
implement(enactor, target->getObject());
else
implement(enactor, Location(target->getPoint(), Nothing));
@@ -177,7 +177,7 @@ void SpellStuff::implement(GameObject *enactor, GameObject *target) {
SpellTarget st = SpellTarget(target);
if (safe() &&
target->thisID() == enactor->thisID() &&
- !canTarget(spellTargCaster))
+ !canTarget(kSpellTargCaster))
return;
if (_effects) {
for (ProtoEffect *pe = _effects; pe; pe = pe->_next)
@@ -209,7 +209,7 @@ void SpellStuff::implement(GameObject *enactor, Location target) {
if (safe() &&
t->getObject() != nullptr &&
t->getObject()->thisID() == enactor->thisID() &&
- !canTarget(spellTargCaster))
+ !canTarget(kSpellTargCaster))
continue;
for (ProtoEffect *pe = _effects; pe; pe = pe->_next)
if (pe->applicable(*t))
@@ -227,15 +227,15 @@ void SpellStuff::buildTargetList(GameObject *caster, SpellTarget &trg) {
TilePoint tVect, orth, tBase;
show(caster, trg);
switch (_shape) {
- case eAreaInvisible:
- case eAreaAura:
- case eAreaGlow:
- case eAreaProjectile:
- case eAreaExchange:
- case eAreaMissle:
+ case keAreaInvisible:
+ case keAreaAura:
+ case keAreaGlow:
+ case keAreaProjectile:
+ case keAreaExchange:
+ case keAreaMissle:
_targets = &trg;
break;
- case eAreaSquare: {
+ case keAreaSquare: {
tVect = trg.getPoint();
orth = TilePoint(squareSpellSize / 2, squareSpellSize / 2, 0);
@@ -252,7 +252,7 @@ void SpellStuff::buildTargetList(GameObject *caster, SpellTarget &trg) {
break;
}
- case eAreaBolt: {
+ case keAreaBolt: {
tVect = trg.getPoint() - caster->getWorldLocation();
while (tVect.magnitude() == 0) {
tVect = randomVector(TilePoint(-1, -1, 0), TilePoint(1, 1, 0));
@@ -271,7 +271,7 @@ void SpellStuff::buildTargetList(GameObject *caster, SpellTarget &trg) {
break;
}
- case eAreaBeam: {
+ case keAreaBeam: {
tVect = trg.getPoint() - caster->getWorldLocation();
while (tVect.magnitude() == 0) {
tVect = randomVector(TilePoint(-1, -1, 0), TilePoint(1, 1, 0));
@@ -290,7 +290,7 @@ void SpellStuff::buildTargetList(GameObject *caster, SpellTarget &trg) {
break;
}
- case eAreaBall: {
+ case keAreaBall: {
radius = ballSpellRadius;
CircularObjectIterator it(currentWorld, trg.getPoint(), radius);
GameObject *go;
@@ -301,7 +301,7 @@ void SpellStuff::buildTargetList(GameObject *caster, SpellTarget &trg) {
}
break;
}
- case eAreaWall: {
+ case keAreaWall: {
radius = wallSpellRadius;
RingObjectIterator it(currentWorld, trg.getPoint(), radius, wallInnerRadius);
GameObject *go;
@@ -312,7 +312,7 @@ void SpellStuff::buildTargetList(GameObject *caster, SpellTarget &trg) {
}
break;
}
- case eAreaStorm: {
+ case keAreaStorm: {
radius = stormSpellRadius;
CircularObjectIterator it(currentWorld, trg.getPoint(), radius);
GameObject *go;
@@ -323,7 +323,7 @@ void SpellStuff::buildTargetList(GameObject *caster, SpellTarget &trg) {
}
break;
}
- case eAreaCone: {
+ case keAreaCone: {
tVect = trg.getPoint() - caster->getWorldLocation();
while (tVect.magnitude() == 0) {
tVect = randomVector(TilePoint(-1, -1, 0), TilePoint(1, 1, 0));
@@ -341,7 +341,7 @@ void SpellStuff::buildTargetList(GameObject *caster, SpellTarget &trg) {
}
break;
}
- case eAreaWave: {
+ case keAreaWave: {
tVect = trg.getPoint() - caster->getWorldLocation();
while (tVect.magnitude() == 0) {
tVect = randomVector(TilePoint(-1, -1, 0), TilePoint(1, 1, 0));
@@ -381,21 +381,21 @@ void SpellStuff::addTarget(SpellTarget *trg) {
void SpellStuff::removeTargetList() {
switch (_shape) {
- case eAreaInvisible:
- case eAreaAura:
- case eAreaGlow:
- case eAreaProjectile:
- case eAreaExchange:
- case eAreaMissle:
+ case keAreaInvisible:
+ case keAreaAura:
+ case keAreaGlow:
+ case keAreaProjectile:
+ case keAreaExchange:
+ case keAreaMissle:
_targets = nullptr;
break;
- case eAreaWall:
- case eAreaCone:
- case eAreaBeam:
- case eAreaBolt:
- case eAreaBall:
- case eAreaStorm:
- case eAreaSquare:
+ case keAreaWall:
+ case keAreaCone:
+ case keAreaBeam:
+ case keAreaBolt:
+ case keAreaBall:
+ case keAreaStorm:
+ case keAreaSquare:
if (_targets) delete _targets;
_targets = nullptr;
break;
@@ -421,18 +421,18 @@ void SpellStuff::show(GameObject *caster, SpellTarget &trg) {
int16 radius = _size;
TilePoint tVect, orth, tBase;
switch (_shape) {
- case eAreaInvisible:
+ case keAreaInvisible:
showTarg(trg.getPoint());
break;
- case eAreaAura:
- case eAreaGlow:
- case eAreaProjectile:
- case eAreaExchange:
- case eAreaMissle:
+ case keAreaAura:
+ case keAreaGlow:
+ case keAreaProjectile:
+ case keAreaExchange:
+ case keAreaMissle:
TPLine(caster->getWorldLocation(), trg.getPoint(), DSPELL_AREA_COLOR);
showTarg(trg.getPoint());
break;
- case eAreaSquare: {
+ case keAreaSquare: {
tVect = trg.getPoint();
orth = TilePoint(squareSpellSize / 2, squareSpellSize / 2, 0);
@@ -454,7 +454,7 @@ void SpellStuff::show(GameObject *caster, SpellTarget &trg) {
break;
}
- case eAreaBolt: {
+ case keAreaBolt: {
tVect = trg.getPoint() - caster->getWorldLocation();
while (tVect.magnitude() == 0) {
tVect = randomVector(TilePoint(-1, -1, 0), TilePoint(1, 1, 0));
@@ -474,7 +474,7 @@ void SpellStuff::show(GameObject *caster, SpellTarget &trg) {
break;
}
- case eAreaBeam: {
+ case keAreaBeam: {
tVect = trg.getPoint() - caster->getWorldLocation();
while (tVect.magnitude() == 0) {
tVect = randomVector(TilePoint(-1, -1, 0), TilePoint(1, 1, 0));
@@ -494,7 +494,7 @@ void SpellStuff::show(GameObject *caster, SpellTarget &trg) {
break;
}
- case eAreaBall: {
+ case keAreaBall: {
radius = ballSpellRadius;
TPCircle(trg.getPoint(), ballSpellRadius, DSPELL_AREA_COLOR);
CircularObjectIterator it(currentWorld, trg.getPoint(), radius);
@@ -506,7 +506,7 @@ void SpellStuff::show(GameObject *caster, SpellTarget &trg) {
}
break;
}
- case eAreaWall: {
+ case keAreaWall: {
radius = wallSpellRadius;
TPCircle(trg.getPoint(), radius, DSPELL_AREA_COLOR);
TPCircle(trg.getPoint(), radius / 2, DSPELL_AREA_COLOR);
@@ -519,7 +519,7 @@ void SpellStuff::show(GameObject *caster, SpellTarget &trg) {
}
break;
}
- case eAreaStorm: {
+ case keAreaStorm: {
radius = stormSpellRadius;
TPCircle(trg.getPoint(), stormSpellRadius, DSPELL_AREA_COLOR);
CircularObjectIterator it(currentWorld, trg.getPoint(), radius);
@@ -531,7 +531,7 @@ void SpellStuff::show(GameObject *caster, SpellTarget &trg) {
}
break;
}
- case eAreaCone: {
+ case keAreaCone: {
tVect = trg.getPoint() - caster->getWorldLocation();
while (tVect.magnitude() == 0) {
tVect = randomVector(TilePoint(-1, -1, 0), TilePoint(1, 1, 0));
@@ -550,7 +550,7 @@ void SpellStuff::show(GameObject *caster, SpellTarget &trg) {
}
break;
}
- case eAreaWave: {
+ case keAreaWave: {
tVect = trg.getPoint() - caster->getWorldLocation();
while (tVect.magnitude() == 0) {
tVect = randomVector(TilePoint(-1, -1, 0), TilePoint(1, 1, 0));
diff --git a/engines/saga2/speldata.cpp b/engines/saga2/speldata.cpp
index 94c92807108..2d35bc71c65 100644
--- a/engines/saga2/speldata.cpp
+++ b/engines/saga2/speldata.cpp
@@ -215,9 +215,9 @@ static void loadMagicData() {
if (spellRes == nullptr || !spellRes->_valid)
error("Error accessing spell resource group.\n");
i = 1;
- ADD_SHOW(eAreaInvisible, 0, 0, 0, 0, diFlagInc, ecFlagNone, 30, MKTAG('S', 'T', 'A', 0), 23, 24);
+ ADD_SHOW(keAreaInvisible, 0, 0, 0, 0, diFlagInc, ecFlagNone, 30, MKTAG('S', 'T', 'A', 0), 23, 24);
- spellBook[0].setManaType(sManaIDSkill);
+ spellBook[0].setManaType(ksManaIDSkill);
while (spellRes->size(
MKTAG('I', 'N', 'F', i)) > 0) {
diff --git a/engines/saga2/spellbuk.h b/engines/saga2/spellbuk.h
index ffbb8ede744..0ae3cb0ba5e 100644
--- a/engines/saga2/spellbuk.h
+++ b/engines/saga2/spellbuk.h
@@ -37,13 +37,13 @@ class ProtoEffect;
// Mana IDs as spells see them
enum SpellManaID {
- sManaIDRed = 0,
- sManaIDOrange = 1,
- sManaIDYellow = 2,
- sManaIDGreen = 3,
- sManaIDBlue = 4,
- sManaIDViolet = 5,
- sManaIDSkill = 6 // skills are here for convenience
+ ksManaIDRed = 0,
+ ksManaIDOrange = 1,
+ ksManaIDYellow = 2,
+ ksManaIDGreen = 3,
+ ksManaIDBlue = 4,
+ ksManaIDViolet = 5,
+ ksManaIDSkill = 6 // skills are here for convenience
};
//-------------------------------------------------------------------
@@ -56,25 +56,25 @@ enum SpellManaID {
//-------------------------------------------------------------------
// legal target selections
enum SpellTargetingTypes {
- spellTargNone = 0,
- spellTargWorld = 1 << 0, // instant spell
- spellTargLocation = 1 << 1, // cast at any location on map
- spellTargTAG = 1 << 2, // cast at tileactivity inst.
- spellTargObject = 1 << 3, // cast at objects
- spellTargActor = 1 << 4,
- spellTargCaster = 1 << 5
+ kSpellTargNone = 0,
+ kSpellTargWorld = 1 << 0, // instant spell
+ kSpellTargLocation = 1 << 1, // cast at any location on map
+ kSpellTargTAG = 1 << 2, // cast at tileactivity inst.
+ kSpellTargObject = 1 << 3, // cast at objects
+ kSpellTargActor = 1 << 4,
+ kSpellTargCaster = 1 << 5
};
//-------------------------------------------------------------------
// target type the spell uses when implemented
enum SpellApplicationTypes {
- spellApplyNone = spellTargNone,
- spellApplyWorld = spellTargWorld,
- spellApplyLocation = spellTargLocation,
- spellApplyTAG = spellTargTAG,
- spellApplyObject = spellTargObject,
- spellApplyActor = spellTargObject,
- spellApplyTracking = 1 << 6 // track object targets
+ kSpellApplyNone = kSpellTargNone,
+ kSpellApplyWorld = kSpellTargWorld,
+ kSpellApplyLocation = kSpellTargLocation,
+ kSpellApplyTAG = kSpellTargTAG,
+ kSpellApplyObject = kSpellTargObject,
+ kSpellApplyActor = kSpellTargObject,
+ kSpellApplyTracking = 1 << 6 // track object targets
};
@@ -83,20 +83,20 @@ enum SpellApplicationTypes {
// These are the shapes of the visible effects of spells
enum effectAreas {
- eAreaInvisible = 0,
- eAreaAura,
- eAreaProjectile,
- eAreaExchange,
- eAreaBolt,
- eAreaCone,
- eAreaBall,
- eAreaSquare,
- eAreaWave,
- eAreaStorm,
- eAreaMissle,
- eAreaGlow,
- eAreaBeam,
- eAreaWall
+ keAreaInvisible = 0,
+ keAreaAura,
+ keAreaProjectile,
+ keAreaExchange,
+ keAreaBolt,
+ keAreaCone,
+ keAreaBall,
+ keAreaSquare,
+ keAreaWave,
+ keAreaStorm,
+ keAreaMissle,
+ keAreaGlow,
+ keAreaBeam,
+ keAreaWall
};
@@ -150,14 +150,14 @@ public:
}
bool untargetable() {
- return (_targetableTypes == spellTargNone);
+ return (_targetableTypes == kSpellTargNone);
}
bool untargeted() {
- return false; //(targetableTypes == spellTargWorld ) ||
+ return false; //(targetableTypes == kSpellTargWorld ) ||
}
- //(targetableTypes == spellTargCaster ) ||
+ //(targetableTypes == kSpellTargCaster ) ||
//(targetableTypes == targetableTypes &
- // (spellTargWorld | spellTargCaster)); }
+ // (kSpellTargWorld | kSpellTargCaster)); }
void implement(GameObject *enactor, SpellTarget *target);
void implement(GameObject *enactor, GameObject *target);
diff --git a/engines/saga2/spellio.cpp b/engines/saga2/spellio.cpp
index 6cf9f774e72..44c6560e596 100644
--- a/engines/saga2/spellio.cpp
+++ b/engines/saga2/spellio.cpp
@@ -122,7 +122,7 @@ void SpellStuff::addEffect(ResourceSpellEffect *rse) {
0,
(effectDamageTypes) rse->effectType,
0,
- rse->targeting & spellTargCaster);
+ rse->targeting & kSpellTargCaster);
break;
case kEffectDrains :
pe = new ProtoDrainage(
@@ -132,7 +132,7 @@ void SpellStuff::addEffect(ResourceSpellEffect *rse) {
0,
(effectDrainsTypes) rse->effectType,
0,
- rse->targeting & spellTargCaster);
+ rse->targeting & kSpellTargCaster);
break;
case kEffectTAG :
pe = new ProtoTAGEffect(
diff --git a/engines/saga2/spellspr.cpp b/engines/saga2/spellspr.cpp
index ef23bbf6246..250477991b2 100644
--- a/engines/saga2/spellspr.cpp
+++ b/engines/saga2/spellspr.cpp
@@ -67,28 +67,28 @@ namespace Saga2 {
int16 whichColorMap(EffectID eid, const Effectron *const effectron) {
int16 rval = 0;
switch (eid) {
- case eAreaInvisible:
- case eAreaAura:
- case eAreaGlow:
- case eAreaProjectile:
- case eAreaExchange:
- case eAreaMissle:
- case eAreaBeam:
- case eAreaWall:
+ case keAreaInvisible:
+ case keAreaAura:
+ case keAreaGlow:
+ case keAreaProjectile:
+ case keAreaExchange:
+ case keAreaMissle:
+ case keAreaBeam:
+ case keAreaWall:
rval = 0;
break;
- case eAreaSquare:
- case eAreaBall:
- case eAreaStorm:
+ case keAreaSquare:
+ case keAreaBall:
+ case keAreaStorm:
rval = (effectron->_parent->_effSeq == 0) ? 0 : 1;
break;
- case eAreaBolt:
+ case keAreaBolt:
rval = ((effectron->_partno % 3) == 1) ? 0 : 1;
break;
- case eAreaCone:
+ case keAreaCone:
rval = ((effectron->_partno / 9) == 0) ? 0 : 1;
break;
- case eAreaWave:
+ case keAreaWave:
rval = ((effectron->_partno / 17) == 0) ? 0 : 1;
break;
}
diff --git a/engines/saga2/weapons.cpp b/engines/saga2/weapons.cpp
index 2eadf7fbbac..c201c240088 100644
--- a/engines/saga2/weapons.cpp
+++ b/engines/saga2/weapons.cpp
@@ -83,12 +83,12 @@ ProtoEffect *createNewProtoEffect(Common::SeekableReadStream *stream) {
case kEffectDamage:
pe = new ProtoDamage(baseDice, diceSides, skillDice, baseDamage,
- (effectDamageTypes)effectType, 0, targeting & spellTargCaster, skillDamage);
+ (effectDamageTypes)effectType, 0, targeting & kSpellTargCaster, skillDamage);
break;
case kEffectDrains:
pe = new ProtoDrainage(baseDice, diceSides, skillDice, baseDamage,
- (effectDrainsTypes)effectType, 0, targeting & spellTargCaster);
+ (effectDrainsTypes)effectType, 0, targeting & kSpellTargCaster);
break;
case kEffectPoison:
Commit: aec2d5afc6d3516a5b429d16346dd4c954050d00
https://github.com/scummvm/scummvm/commit/aec2d5afc6d3516a5b429d16346dd4c954050d00
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-10-29T14:39:34+02:00
Commit Message:
SAGA2: Rename enums in spells.h
Changed paths:
engines/saga2/magic.cpp
engines/saga2/motion.cpp
engines/saga2/player.cpp
engines/saga2/spelcast.cpp
engines/saga2/speldata.cpp
engines/saga2/speldraw.cpp
engines/saga2/spellio.cpp
engines/saga2/spells.h
diff --git a/engines/saga2/magic.cpp b/engines/saga2/magic.cpp
index d67d639bf6a..9a60f42f3ae 100644
--- a/engines/saga2/magic.cpp
+++ b/engines/saga2/magic.cpp
@@ -96,8 +96,8 @@ SkillProto *skillProtoFromID(int16 spellOrObjectID) {
if (spellOrObjectID > MAX_SPELLS)
return (SkillProto *)GameObject::protoAddress(spellOrObjectID);
- if (spellOrObjectID >= totalSpellBookPages)
- error("Wrong spellID: %d > %d", spellOrObjectID, totalSpellBookPages);
+ if (spellOrObjectID >= kTotalSpellBookPages)
+ error("Wrong spellID: %d > %d", spellOrObjectID, kTotalSpellBookPages);
return spellBook[spellOrObjectID].getProto();
}
@@ -105,7 +105,7 @@ SkillProto *skillProtoFromID(int16 spellOrObjectID) {
//-----------------------------------------------------------------------
// initialization call to connect skill prototypes with their spells
void initializeSkill(SkillProto *oNo, SpellID sNo) {
- if (sNo > 0 && sNo < totalSpellBookPages) {
+ if (sNo > 0 && sNo < kTotalSpellBookPages) {
if (spellBook[sNo].getProto() != nullptr)
error("Duplicate prototype for spell %d", sNo);
spellBook[sNo].setProto(oNo);
diff --git a/engines/saga2/motion.cpp b/engines/saga2/motion.cpp
index 431d19c2595..fd10ae3f509 100644
--- a/engines/saga2/motion.cpp
+++ b/engines/saga2/motion.cpp
@@ -637,7 +637,7 @@ void MotionTask::read(Common::InSaveFile *in) {
// restore the spell prototype
warning("MotionTask::read: Check SpellID size");
sid = (SpellID)in->readUint32LE();
- _spellObj = sid != nullSpell
+ _spellObj = sid != kNullSpell
? skillProtoFromID(sid)
: nullptr;
@@ -995,7 +995,7 @@ void MotionTask::write(Common::MemoryWriteStreamDynamic *out) {
SpellID sid = _spellObj != nullptr
? _spellObj->getSpellID()
- : nullSpell;
+ : kNullSpell;
ObjectID toid = _targetObj != nullptr
? _targetObj->thisID()
diff --git a/engines/saga2/player.cpp b/engines/saga2/player.cpp
index 74637ef8273..fe56bc7d4f7 100644
--- a/engines/saga2/player.cpp
+++ b/engines/saga2/player.cpp
@@ -368,9 +368,9 @@ int8 PlayerActor::getSkillLevel(SkillProto *skill, bool base) { // basestats def
ActorAttributes *effStats = getEffStats();
// check to see if this is a special case
- if (skillID == skillVitality) {
+ if (skillID == kSkillVitality) {
return effStats->vitality / ActorAttributes::kSkillFracPointsPerLevel;
- } else if (skillID == skillCartography) {
+ } else if (skillID == kSkillCartography) {
// cartography has no levels
return 0;
}
@@ -401,55 +401,55 @@ uint8 PlayerActor::getStatIndex(SkillProto *proto) {
// now map the id gotten from spellid to the
// attributeskilll enum for the allSkills array
switch (skillID) {
- case skillPickpocket:
+ case kSkillPickpocket:
stat = kSkillIDPilfer;
break;
- case skillSeeHidden:
+ case kSkillSeeHidden:
stat = kSkillIDSpotHidden;
break;
- case skillLockPick:
+ case kSkillLockPick:
stat = kSkillIDLockpick;
break;
- case skillFirstAid:
+ case kSkillFirstAid:
stat = kSkillIDFirstAid;
break;
- case skillArchery:
+ case kSkillArchery:
stat = kSkillIDArchery;
break;
- case skillSwordcraft:
+ case kSkillSwordcraft:
stat = kSkillIDSwordcraft;
break;
- case skillShieldcraft:
+ case kSkillShieldcraft:
stat = kSkillIDShieldcraft;
break;
- case skillBludgeon:
+ case kSkillBludgeon:
stat = kSkillIDBludgeon;
break;
- case skillThrowing:
+ case kSkillThrowing:
stat = kSkillIDThrowing;
break;
- case skillSpellcraft:
+ case kSkillSpellcraft:
stat = kSkillIDSpellcraft;
break;
- case skillStealth:
+ case kSkillStealth:
stat = kSkillIDStealth;
break;
- case skillAgility:
+ case kSkillAgility:
stat = kSkillIDAgility;
break;
- case skillBrawn:
+ case kSkillBrawn:
stat = kSkillIDBrawn;
break;
diff --git a/engines/saga2/spelcast.cpp b/engines/saga2/spelcast.cpp
index b6eb467f363..b5177b96b58 100644
--- a/engines/saga2/spelcast.cpp
+++ b/engines/saga2/spelcast.cpp
@@ -61,8 +61,8 @@ int32 scatterer(int32 i, int32 m, int32 s);
// ctor
SpellStuff::SpellStuff() {
- _master = nullSpell;
- _display = nullSpell;
+ _master = kNullSpell;
+ _display = kNullSpell;
_prototype = nullptr;
_targetableTypes = kSpellTargNone;
_targetTypes = kSpellApplyNone;
diff --git a/engines/saga2/speldata.cpp b/engines/saga2/speldata.cpp
index 2d35bc71c65..975fba56ab3 100644
--- a/engines/saga2/speldata.cpp
+++ b/engines/saga2/speldata.cpp
@@ -49,8 +49,8 @@ namespace Saga2 {
const uint32 spellSpriteID = MKTAG('S', 'P', 'F', 'X');
-const int32 maxSpells = totalSpellBookPages;
-const int32 maxSpellPrototypes = totalSpellBookPages;
+const int32 maxSpells = kTotalSpellBookPages;
+const int32 maxSpellPrototypes = kTotalSpellBookPages;
const int32 maxEffectPrototypes = 16;
const int32 maxSpellColorMaps = 32;
diff --git a/engines/saga2/speldraw.cpp b/engines/saga2/speldraw.cpp
index 313f378e7ad..2875425301c 100644
--- a/engines/saga2/speldraw.cpp
+++ b/engines/saga2/speldraw.cpp
@@ -65,7 +65,7 @@ EffectDisplayPrototype::EffectDisplayPrototype(
_breadth = newBreadth;
_init = newInit;
_next = nullptr;
- _ID = spellNone;
+ _ID = kSpellNone;
}
/* ===================================================================== *
@@ -142,7 +142,7 @@ SpellDisplayPrototype::SpellDisplayPrototype(
_secondarySpriteNo = sco; // sprites available
//_effCount=eco; // effectrons to allocate
- _ID = spellNone;
+ _ID = kSpellNone;
_implementAge = 0;
}
diff --git a/engines/saga2/spellio.cpp b/engines/saga2/spellio.cpp
index 44c6560e596..e27749569a8 100644
--- a/engines/saga2/spellio.cpp
+++ b/engines/saga2/spellio.cpp
@@ -62,7 +62,7 @@ SpellDisplayPrototype::SpellDisplayPrototype(ResourceSpellItem *rsi) {
_colorMap[1] = rsi->cm1;
_colorMap[2] = 0;
_colorMap[3] = 0;
- _ID = spellNone;
+ _ID = kSpellNone;
}
/* ===================================================================== *
@@ -292,8 +292,8 @@ void StorageSpellTarget::write(Common::MemoryWriteStreamDynamic *out) {
out->writeSint16LE(tag.val);
}
-StorageSpellInstance::StorageSpellInstance() : implementAge(0), effect(0), dProto(spellNone), caster(0),
- world(0), age(0), spell(spellNone), maxAge(0), effSeq(0), eListSize(0) {
+StorageSpellInstance::StorageSpellInstance() : implementAge(0), effect(0), dProto(kSpellNone), caster(0),
+ world(0), age(0), spell(kSpellNone), maxAge(0), effSeq(0), eListSize(0) {
}
void StorageSpellInstance::read(Common::InSaveFile *in) {
diff --git a/engines/saga2/spells.h b/engines/saga2/spells.h
index d6dc60933ef..fcf18097aed 100644
--- a/engines/saga2/spells.h
+++ b/engines/saga2/spells.h
@@ -29,123 +29,123 @@
namespace Saga2 {
enum SpellID {
- spellNone = 0, // none
- spellFire_Storm, // Yellow spells
- spellFlaming_Orb,
- spellSunburst,
- spellBolt_of_Flame,
- spellFlaming_Aura,
- spellSun_Ward,
- spellSoul_Sight,
- spellClairvoyance,
- spellVanquish_Graveborn,
- spellSummon_Flame_Wisp,
- spellSoul_Light,
- spellDisintegration,
- spellSun_Flash,
- spellFirewalk, // Violet spells
- spellAcid_Spray,
- spellCaustic_Rain,
- spellNether_Ward,
- spellSurestrike,
- spellWardbane,
- spellAdrenal_Fervor,
- spellMind_Tap,
- spellSearing_Thought,
- spellSpell_Barrier,
- spellInner_Balance,
- spellShadow_Walk,
- spellWill_Barrier,
- spellFireball, // Red
- spellMeteor_Shower,
- spellWall_of_Fire,
- spellHeat_Ward,
- spellBattle_Fever,
- spellFire_Shield,
- spellPanic,
- spellTerror,
- spellIronskin,
- spellParalysis,
- spellClumsiness,
- spellTimequake,
- spellMagma_Bolt,
- spellIncinerate,
- spellFrost_Bolt, // Blue
- spellCold_Wind,
- spellIce_Storm,
- spellIce_Ward,
- spellInvisibility,
- spellSeawalk,
- spellPaths_of_Mist,
- spellRejoin,
- spellMist_Jump,
- spellHaste,
- spellLevitate_Object,
- spellFlight,
- spellSummon_Wind_Wisp,
- spellFreeze,
- spellLightning_Bolt, // Orange
- spellShocking_Touch,
- spellLightning_Storm,
- spellForce_Ward,
- spellNumbscent,
- spellLethargic_Breeze,
- spellProtect_vs_Evil,
- spellProtect_vs_Undead,
- spellProtect_vs_Ghosts,
- spellAir_of_Constraint,
- spellTime_Stop,
- spellCushion_of_Air,
- spellRing_of_Force,
- spellPoison_Cloud, // Green
- spellWord_of_Harm,
- spellGrasping_Earth,
- spellLife_Ward,
- spellDetect_Poison,
- spellResist_Poison,
- spellMinor_Healing,
- spellMajor_Healing,
- spellCritical_Healing,
- spellBanish_Weakness,
- spellWraith,
- spellResurrection,
- spellBounty_of_the_Earth,
- spellLife_Tap,
- skillPickpocket, // skills
- skillSeeHidden,
- skillLockPick,
- skillFirstAid,
- skillArchery,
- skillSwordcraft,
- skillShieldcraft,
- skillBludgeon,
- skillThrowing,
- skillSpellcraft,
- skillStealth,
- skillAgility,
- skillBrawn,
- skillVitality,
- skillCartography,
- spellCold_Blast = 96, // had to skip because of disapeared skills
- spellThorn,
- spellLife_Shield,
- spellFlame_Shield,
- spellCold_Shield,
- spellArc_Shield,
- spellAcid_Shield,
- spellCaustic_Ward,
- spellElectric_Arc,
- spellForce_Bolt,
- spellChill,
- spellEgo_Flash,
- spellIcicles,
- spellMaelstrom,
- spellDeath_Cloud,
- spellVenom_Blast,
- totalSpellBookPages
+ kSpellNone = 0, // none
+ kSpellFire_Storm, // Yellow spells
+ kSpellFlaming_Orb,
+ kSpellSunburst,
+ kSpellBolt_of_Flame,
+ kSpellFlaming_Aura,
+ kSpellSun_Ward,
+ kSpellSoul_Sight,
+ kSpellClairvoyance,
+ kSpellVanquish_Graveborn,
+ kSpellSummon_Flame_Wisp,
+ kSpellSoul_Light,
+ kSpellDisintegration,
+ kSpellSun_Flash,
+ kSpellFirewalk, // Violet spells
+ kSpellAcid_Spray,
+ kSpellCaustic_Rain,
+ kSpellNether_Ward,
+ kSpellSurestrike,
+ kSpellWardbane,
+ kSpellAdrenal_Fervor,
+ kSpellMind_Tap,
+ kSpellSearing_Thought,
+ kSpellSpell_Barrier,
+ kSpellInner_Balance,
+ kSpellShadow_Walk,
+ kSpellWill_Barrier,
+ kSpellFireball, // Red
+ kSpellMeteor_Shower,
+ kSpellWall_of_Fire,
+ kSpellHeat_Ward,
+ kSpellBattle_Fever,
+ kSpellFire_Shield,
+ kSpellPanic,
+ kSpellTerror,
+ kSpellIronskin,
+ kSpellParalysis,
+ kSpellClumsiness,
+ kSpellTimequake,
+ kSpellMagma_Bolt,
+ kSpellIncinerate,
+ kSpellFrost_Bolt, // Blue
+ kSpellCold_Wind,
+ kSpellIce_Storm,
+ kSpellIce_Ward,
+ kSpellInvisibility,
+ kSpellSeawalk,
+ kSpellPaths_of_Mist,
+ kSpellRejoin,
+ kSpellMist_Jump,
+ kSpellHaste,
+ kSpellLevitate_Object,
+ kSpellFlight,
+ kSpellSummon_Wind_Wisp,
+ kSpellFreeze,
+ kSpellLightning_Bolt, // Orange
+ kSpellShocking_Touch,
+ kSpellLightning_Storm,
+ kSpellForce_Ward,
+ kSpellNumbscent,
+ kSpellLethargic_Breeze,
+ kSpellProtect_vs_Evil,
+ kSpellProtect_vs_Undead,
+ kSpellProtect_vs_Ghosts,
+ kSpellAir_of_Constraint,
+ kSpellTime_Stop,
+ kSpellCushion_of_Air,
+ kSpellRing_of_Force,
+ kSpellPoison_Cloud, // Green
+ kSpellWord_of_Harm,
+ kSpellGrasping_Earth,
+ kSpellLife_Ward,
+ kSpellDetect_Poison,
+ kSpellResist_Poison,
+ kSpellMinor_Healing,
+ kSpellMajor_Healing,
+ kSpellCritical_Healing,
+ kSpellBanish_Weakness,
+ kSpellWraith,
+ kSpellResurrection,
+ kSpellBounty_of_the_Earth,
+ kSpellLife_Tap,
+ kSkillPickpocket, // skills
+ kSkillSeeHidden,
+ kSkillLockPick,
+ kSkillFirstAid,
+ kSkillArchery,
+ kSkillSwordcraft,
+ kSkillShieldcraft,
+ kSkillBludgeon,
+ kSkillThrowing,
+ kSkillSpellcraft,
+ kSkillStealth,
+ kSkillAgility,
+ kSkillBrawn,
+ kSkillVitality,
+ kSkillCartography,
+ kSpellCold_Blast = 96, // had to skip because of disapeared skills
+ kSpellThorn,
+ kSpellLife_Shield,
+ kSpellFlame_Shield,
+ kSpellCold_Shield,
+ kSpellArc_Shield,
+ kSpellAcid_Shield,
+ kSpellCaustic_Ward,
+ kSpellElectric_Arc,
+ kSpellForce_Bolt,
+ kSpellChill,
+ kSpellEgo_Flash,
+ kSpellIcicles,
+ kSpellMaelstrom,
+ kSpellDeath_Cloud,
+ kSpellVenom_Blast,
+ kTotalSpellBookPages
};
-#define nullSpell ((SpellID)0xFF)
+#define kNullSpell ((SpellID)0xFF)
} // end of namespace Saga2
Commit: 9b049d0afb595d0d39f193a2b0a828f33b7ac51f
https://github.com/scummvm/scummvm/commit/9b049d0afb595d0d39f193a2b0a828f33b7ac51f
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-10-29T14:41:52+02:00
Commit Message:
SAGA2: Rename enums in spelshow.h
Changed paths:
engines/saga2/spelcast.cpp
engines/saga2/speldata.cpp
engines/saga2/spellio.cpp
engines/saga2/spelshow.h
diff --git a/engines/saga2/spelcast.cpp b/engines/saga2/spelcast.cpp
index b5177b96b58..967dfbc3cfe 100644
--- a/engines/saga2/spelcast.cpp
+++ b/engines/saga2/spelcast.cpp
@@ -836,16 +836,16 @@ void Effectron::updateEffect(int32 deltaTime) {
//-----------------------------------------------------------------------
void Effectron::bump() {
switch (_parent->_dProto->_elasticity) {
- case ecFlagBounce:
+ case kEcFlagBounce:
_velocity = -_velocity;
break;
- case ecFlagDie:
+ case kEcFlagDie:
kill();
break;
- case ecFlagStop:
+ case kEcFlagStop:
_velocity = TilePoint(0, 0, 0);
break;
- case ecFlagNone:
+ case kEcFlagNone:
break;
}
}
diff --git a/engines/saga2/speldata.cpp b/engines/saga2/speldata.cpp
index 975fba56ab3..044c740959e 100644
--- a/engines/saga2/speldata.cpp
+++ b/engines/saga2/speldata.cpp
@@ -215,7 +215,7 @@ static void loadMagicData() {
if (spellRes == nullptr || !spellRes->_valid)
error("Error accessing spell resource group.\n");
i = 1;
- ADD_SHOW(keAreaInvisible, 0, 0, 0, 0, diFlagInc, ecFlagNone, 30, MKTAG('S', 'T', 'A', 0), 23, 24);
+ ADD_SHOW(keAreaInvisible, 0, 0, 0, 0, kDiFlagInc, kEcFlagNone, 30, MKTAG('S', 'T', 'A', 0), 23, 24);
spellBook[0].setManaType(ksManaIDSkill);
diff --git a/engines/saga2/spellio.cpp b/engines/saga2/spellio.cpp
index e27749569a8..1ccde2a8807 100644
--- a/engines/saga2/spellio.cpp
+++ b/engines/saga2/spellio.cpp
@@ -49,7 +49,7 @@ SpellDisplayPrototype::SpellDisplayPrototype(ResourceSpellItem *rsi) {
_effParm2 = 0; // effect setting 1
_effParm3 = 0; // effect setting 1
_effParm4 = 0; // effect setting 1
- _scatter = diFlagZero; // direction init mode
+ _scatter = kDiFlagZero; // direction init mode
_elasticity = (effectCollisionCont) rsi->effectronElasticity; // collision flags
_maxAge = rsi->maxAge; // auto self-destruct age
_implementAge = rsi->implAge; // auto self-destruct age
diff --git a/engines/saga2/spelshow.h b/engines/saga2/spelshow.h
index 52e418a6ec4..c3ec11504e4 100644
--- a/engines/saga2/spelshow.h
+++ b/engines/saga2/spelshow.h
@@ -205,19 +205,19 @@ public:
//
enum effectCollisionCont {
- ecFlagNone = 0,
- ecFlagBounce,
- ecFlagDie,
- ecFlagStop
+ kEcFlagNone = 0,
+ kEcFlagBounce,
+ kEcFlagDie,
+ kEcFlagStop
};
enum effectDirectionInit {
- diFlagZero = 0,
- diFlagInc = 1,
- diFlagInc2 = 2,
- diFlagInc3 = 3,
- diFlagInc4 = 4,
- diFlagRand = 5
+ kDiFlagZero = 0,
+ kDiFlagInc = 1,
+ kDiFlagInc2 = 2,
+ kDiFlagInc3 = 3,
+ kDiFlagInc4 = 4,
+ kDiFlagRand = 5
};
Commit: a185be3b6451c36577f8d0225d58b7f6f38fc960
https://github.com/scummvm/scummvm/commit/a185be3b6451c36577f8d0225d58b7f6f38fc960
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-10-29T14:44:54+02:00
Commit Message:
SAGA2: Rename constants in spelvals.h
Changed paths:
engines/saga2/spelcast.cpp
engines/saga2/spellini.cpp
engines/saga2/spelvals.h
diff --git a/engines/saga2/spelcast.cpp b/engines/saga2/spelcast.cpp
index 967dfbc3cfe..8e6d8fdd5f4 100644
--- a/engines/saga2/spelcast.cpp
+++ b/engines/saga2/spelcast.cpp
@@ -237,12 +237,12 @@ void SpellStuff::buildTargetList(GameObject *caster, SpellTarget &trg) {
break;
case keAreaSquare: {
tVect = trg.getPoint();
- orth = TilePoint(squareSpellSize / 2, squareSpellSize / 2, 0);
+ orth = TilePoint(kSquareSpellSize / 2, kSquareSpellSize / 2, 0);
RectangularObjectIterator it(currentWorld,
tVect - orth,
- TilePoint(squareSpellSize, 0, 0),
- TilePoint(0, squareSpellSize, 0));
+ TilePoint(kSquareSpellSize, 0, 0),
+ TilePoint(0, kSquareSpellSize, 0));
GameObject *go;
it.first(&go);
while (go) {
@@ -257,9 +257,9 @@ void SpellStuff::buildTargetList(GameObject *caster, SpellTarget &trg) {
while (tVect.magnitude() == 0) {
tVect = randomVector(TilePoint(-1, -1, 0), TilePoint(1, 1, 0));
}
- setMagnitude(tVect, boltSpellLength);
+ setMagnitude(tVect, kBoltSpellLength);
orth = rightVector(tVect, 0);
- setMagnitude(orth, boltSpellWidth / 2);
+ setMagnitude(orth, kBoltSpellWidth / 2);
tBase = caster->getWorldLocation() + (isActor(caster) ? (tVect / 32) : TilePoint(0, 0, 0));
RectangularObjectIterator it(currentWorld, tBase - orth, tVect, orth * 2);
GameObject *go;
@@ -276,9 +276,9 @@ void SpellStuff::buildTargetList(GameObject *caster, SpellTarget &trg) {
while (tVect.magnitude() == 0) {
tVect = randomVector(TilePoint(-1, -1, 0), TilePoint(1, 1, 0));
}
- setMagnitude(tVect, beamSpellLength);
+ setMagnitude(tVect, kBeamSpellLength);
orth = rightVector(tVect, 0);
- setMagnitude(orth, beamSpellWidth / 2);
+ setMagnitude(orth, kBeamSpellWidth / 2);
tBase = caster->getWorldLocation() + (isActor(caster) ? (tVect / 32) : TilePoint(0, 0, 0));
RectangularObjectIterator it(currentWorld, tBase - orth, tVect, orth * 2);
GameObject *go;
@@ -291,7 +291,7 @@ void SpellStuff::buildTargetList(GameObject *caster, SpellTarget &trg) {
}
case keAreaBall: {
- radius = ballSpellRadius;
+ radius = kBallSpellRadius;
CircularObjectIterator it(currentWorld, trg.getPoint(), radius);
GameObject *go;
it.first(&go);
@@ -302,8 +302,8 @@ void SpellStuff::buildTargetList(GameObject *caster, SpellTarget &trg) {
break;
}
case keAreaWall: {
- radius = wallSpellRadius;
- RingObjectIterator it(currentWorld, trg.getPoint(), radius, wallInnerRadius);
+ radius = kWallSpellRadius;
+ RingObjectIterator it(currentWorld, trg.getPoint(), radius, kWallInnerRadius);
GameObject *go;
it.first(&go);
while (go) {
@@ -313,7 +313,7 @@ void SpellStuff::buildTargetList(GameObject *caster, SpellTarget &trg) {
break;
}
case keAreaStorm: {
- radius = stormSpellRadius;
+ radius = kStormSpellRadius;
CircularObjectIterator it(currentWorld, trg.getPoint(), radius);
GameObject *go;
it.first(&go);
@@ -328,9 +328,9 @@ void SpellStuff::buildTargetList(GameObject *caster, SpellTarget &trg) {
while (tVect.magnitude() == 0) {
tVect = randomVector(TilePoint(-1, -1, 0), TilePoint(1, 1, 0));
}
- setMagnitude(tVect, coneSpellLength);
+ setMagnitude(tVect, kConeSpellLength);
orth = rightVector(tVect, 0);
- setMagnitude(orth, coneSpellWidth / 2);
+ setMagnitude(orth, kConeSpellWidth / 2);
tBase = caster->getWorldLocation() + (isActor(caster) ? (tVect / 32) : TilePoint(0, 0, 0));
TriangularObjectIterator it(currentWorld, tBase, tBase + tVect - orth, tBase + tVect + orth);
GameObject *go;
@@ -346,9 +346,9 @@ void SpellStuff::buildTargetList(GameObject *caster, SpellTarget &trg) {
while (tVect.magnitude() == 0) {
tVect = randomVector(TilePoint(-1, -1, 0), TilePoint(1, 1, 0));
}
- setMagnitude(tVect, waveSpellLength);
+ setMagnitude(tVect, kWaveSpellLength);
orth = rightVector(tVect, 0);
- setMagnitude(orth, waveSpellWidth / 2);
+ setMagnitude(orth, kWaveSpellWidth / 2);
tBase = caster->getWorldLocation() + (isActor(caster) ? (tVect / 32) : TilePoint(0, 0, 0));
TriangularObjectIterator it(currentWorld, tBase, tBase + tVect - orth, tBase + tVect + orth);
GameObject *go;
@@ -434,17 +434,17 @@ void SpellStuff::show(GameObject *caster, SpellTarget &trg) {
break;
case keAreaSquare: {
tVect = trg.getPoint();
- orth = TilePoint(squareSpellSize / 2, squareSpellSize / 2, 0);
+ orth = TilePoint(kSquareSpellSize / 2, kSquareSpellSize / 2, 0);
TPRectangle(tVect - orth,
- tBase + TilePoint(squareSpellSize, 0, 0),
- tBase + TilePoint(0, squareSpellSize, 0) + TilePoint(squareSpellSize, 0, 0),
- tBase + TilePoint(0, squareSpellSize, 0),
+ tBase + TilePoint(kSquareSpellSize, 0, 0),
+ tBase + TilePoint(0, kSquareSpellSize, 0) + TilePoint(kSquareSpellSize, 0, 0),
+ tBase + TilePoint(0, kSquareSpellSize, 0),
DSPELL_AREA_COLOR);
RectangularObjectIterator it(currentWorld,
tVect - orth,
- TilePoint(squareSpellSize, 0, 0),
- TilePoint(0, squareSpellSize, 0));
+ TilePoint(kSquareSpellSize, 0, 0),
+ TilePoint(0, kSquareSpellSize, 0));
GameObject *go;
it.first(&go);
while (go) {
@@ -459,9 +459,9 @@ void SpellStuff::show(GameObject *caster, SpellTarget &trg) {
while (tVect.magnitude() == 0) {
tVect = randomVector(TilePoint(-1, -1, 0), TilePoint(1, 1, 0));
}
- setMagnitude(tVect, boltSpellLength);
+ setMagnitude(tVect, kBoltSpellLength);
orth = rightVector(tVect, 0);
- setMagnitude(orth, boltSpellWidth / 2);
+ setMagnitude(orth, kBoltSpellWidth / 2);
tBase = caster->getWorldLocation();
TPRectangle(tBase - orth, tBase + orth, tBase + tVect + orth, tBase + tVect - orth, DSPELL_AREA_COLOR);
RectangularObjectIterator it(currentWorld, tBase - orth, tVect, orth * 2);
@@ -479,9 +479,9 @@ void SpellStuff::show(GameObject *caster, SpellTarget &trg) {
while (tVect.magnitude() == 0) {
tVect = randomVector(TilePoint(-1, -1, 0), TilePoint(1, 1, 0));
}
- setMagnitude(tVect, beamSpellLength);
+ setMagnitude(tVect, kBeamSpellLength);
orth = rightVector(tVect, 0);
- setMagnitude(orth, beamSpellWidth / 2);
+ setMagnitude(orth, kBeamSpellWidth / 2);
tBase = caster->getWorldLocation();
TPRectangle(tBase - orth, tBase + orth, tBase + tVect + orth, tBase + tVect - orth, DSPELL_AREA_COLOR);
RectangularObjectIterator it(currentWorld, tBase - orth, tVect, orth * 2);
@@ -495,8 +495,8 @@ void SpellStuff::show(GameObject *caster, SpellTarget &trg) {
}
case keAreaBall: {
- radius = ballSpellRadius;
- TPCircle(trg.getPoint(), ballSpellRadius, DSPELL_AREA_COLOR);
+ radius = kBallSpellRadius;
+ TPCircle(trg.getPoint(), kBallSpellRadius, DSPELL_AREA_COLOR);
CircularObjectIterator it(currentWorld, trg.getPoint(), radius);
GameObject *go;
it.first(&go);
@@ -507,10 +507,10 @@ void SpellStuff::show(GameObject *caster, SpellTarget &trg) {
break;
}
case keAreaWall: {
- radius = wallSpellRadius;
+ radius = kWallSpellRadius;
TPCircle(trg.getPoint(), radius, DSPELL_AREA_COLOR);
TPCircle(trg.getPoint(), radius / 2, DSPELL_AREA_COLOR);
- RingObjectIterator it(currentWorld, trg.getPoint(), radius, wallInnerRadius);
+ RingObjectIterator it(currentWorld, trg.getPoint(), radius, kWallInnerRadius);
GameObject *go;
it.first(&go);
while (go) {
@@ -520,8 +520,8 @@ void SpellStuff::show(GameObject *caster, SpellTarget &trg) {
break;
}
case keAreaStorm: {
- radius = stormSpellRadius;
- TPCircle(trg.getPoint(), stormSpellRadius, DSPELL_AREA_COLOR);
+ radius = kStormSpellRadius;
+ TPCircle(trg.getPoint(), kStormSpellRadius, DSPELL_AREA_COLOR);
CircularObjectIterator it(currentWorld, trg.getPoint(), radius);
GameObject *go;
it.first(&go);
@@ -536,9 +536,9 @@ void SpellStuff::show(GameObject *caster, SpellTarget &trg) {
while (tVect.magnitude() == 0) {
tVect = randomVector(TilePoint(-1, -1, 0), TilePoint(1, 1, 0));
}
- setMagnitude(tVect, coneSpellLength);
+ setMagnitude(tVect, kConeSpellLength);
orth = rightVector(tVect, 0);
- setMagnitude(orth, coneSpellWidth / 2);
+ setMagnitude(orth, kConeSpellWidth / 2);
tBase = caster->getWorldLocation();
TPTriangle(tBase, tBase + tVect - orth, tBase + tVect + orth, DSPELL_AREA_COLOR);
TriangularObjectIterator it(currentWorld, tBase, tBase + tVect - orth, tBase + tVect + orth);
@@ -555,9 +555,9 @@ void SpellStuff::show(GameObject *caster, SpellTarget &trg) {
while (tVect.magnitude() == 0) {
tVect = randomVector(TilePoint(-1, -1, 0), TilePoint(1, 1, 0));
}
- setMagnitude(tVect, waveSpellLength);
+ setMagnitude(tVect, kWaveSpellLength);
orth = rightVector(tVect, 0);
- setMagnitude(orth, waveSpellWidth / 2);
+ setMagnitude(orth, kWaveSpellWidth / 2);
tBase = caster->getWorldLocation();
TPTriangle(tBase, tBase + tVect - orth, tBase + tVect + orth, DSPELL_AREA_COLOR);
TriangularObjectIterator it(currentWorld, tBase, tBase + tVect - orth, tBase + tVect + orth);
diff --git a/engines/saga2/spellini.cpp b/engines/saga2/spellini.cpp
index 2fcbd79f3e5..150e740dd81 100644
--- a/engines/saga2/spellini.cpp
+++ b/engines/saga2/spellini.cpp
@@ -96,7 +96,7 @@ SPELLINITFUNCTION(wallSpellInit) {
else
effectron->_totalSteps = 20;
effectron->_current = effectron->_parent->_target->getPoint();
- effectron->_velocity = WallVectors[effectron->_partno] * wallSpellRadius / 3;
+ effectron->_velocity = WallVectors[effectron->_partno] * kWallSpellRadius / 3;
effectron->_current = effectron->_parent->_target->getPoint() + effectron->_velocity;
effectron->_acceleration = TilePoint(0, 0, 0);
}
@@ -108,7 +108,7 @@ SPELLINITFUNCTION(projectileSpellInit) {
effectron->_start = effectron->_current;
effectron->_finish = effectron->_parent->_target->getPoint();
TilePoint tp = (effectron->_finish - effectron->_start);
- effectron->_totalSteps = 1 + (tp.magnitude() / (2 * SpellJumpiness));
+ effectron->_totalSteps = 1 + (tp.magnitude() / (2 * kSpellJumpiness));
effectron->_velocity = tp / effectron->_totalSteps;
effectron->_acceleration = TilePoint(0, 0, 0);
}
@@ -125,7 +125,7 @@ SPELLINITFUNCTION(exchangeSpellInit) {
effectron->_finish = effectron->_parent->_target->getPoint();
}
TilePoint tp = (effectron->_finish - effectron->_start);
- effectron->_totalSteps = 1 + (tp.magnitude() / (SpellJumpiness));
+ effectron->_totalSteps = 1 + (tp.magnitude() / (kSpellJumpiness));
effectron->_velocity = tp / effectron->_totalSteps;
effectron->_totalSteps += (effectron->_partno / 2);
effectron->_acceleration = TilePoint(0, 0, 0);
@@ -140,16 +140,16 @@ SPELLINITFUNCTION(boltSpellInit) {
if (effectron->_parent->_maxAge)
effectron->_totalSteps = effectron->_parent->_maxAge;
else
- effectron->_totalSteps = 1 + (boltSpellLength / (SpellJumpiness * 3));
+ effectron->_totalSteps = 1 + (kBoltSpellLength / (kSpellJumpiness * 3));
effectron->_start = effectron->_current;
effectron->_finish = effectron->_parent->_target->getPoint();
TilePoint tVect = effectron->_finish - effectron->_start ;
- setMagnitude(tVect, boltSpellLength);
+ setMagnitude(tVect, kBoltSpellLength);
TilePoint orth = rightVector(tVect, 0);
- setMagnitude(orth, boltSpellWidth * (effectron->_partno % 3 - 1) / 6);
- TilePoint offVect = tVect * ((effectron->_partno / 3) % 3) / (SpellJumpiness * 3);
+ setMagnitude(orth, kBoltSpellWidth * (effectron->_partno % 3 - 1) / 6);
+ TilePoint offVect = tVect * ((effectron->_partno / 3) % 3) / (kSpellJumpiness * 3);
effectron->_start += orth;
effectron->_finish += orth + offVect;
@@ -168,15 +168,15 @@ SPELLINITFUNCTION(beamSpellInit) {
if (effectron->_parent->_maxAge)
effectron->_totalSteps = effectron->_parent->_maxAge;
else
- effectron->_totalSteps = 1 + (beamSpellLength / (SpellJumpiness));
+ effectron->_totalSteps = 1 + (kBeamSpellLength / (kSpellJumpiness));
effectron->_start = effectron->_current;
effectron->_finish = effectron->_parent->_target->getPoint();
TilePoint tVect = effectron->_finish - effectron->_start ;
- setMagnitude(tVect, beamSpellLength);
+ setMagnitude(tVect, kBeamSpellLength);
TilePoint orth = rightVector(tVect, 0);
- setMagnitude(orth, beamSpellWidth / 2);
+ setMagnitude(orth, kBeamSpellWidth / 2);
effectron->_start += (tVect * effectron->_partno) / effectron->_totalSteps;
effectron->_finish = effectron->_start;
@@ -192,15 +192,15 @@ SPELLINITFUNCTION(beamSpellInit) {
SPELLINITFUNCTION(coneSpellInit) {
effectron->_stepNo = 0;
- effectron->_totalSteps = 1 + (coneSpellLength / (SpellJumpiness * 3));
+ effectron->_totalSteps = 1 + (kConeSpellLength / (kSpellJumpiness * 3));
effectron->_start = effectron->_current;
effectron->_finish = effectron->_parent->_target->getPoint();
TilePoint tVect = effectron->_finish - effectron->_start ;
- setMagnitude(tVect, coneSpellLength);
+ setMagnitude(tVect, kConeSpellLength);
TilePoint orth = rightVector(tVect, 0);
- setMagnitude(orth, coneSpellWidth * (effectron->_partno % 9 - 4) / 8);
+ setMagnitude(orth, kConeSpellWidth * (effectron->_partno % 9 - 4) / 8);
effectron->_finish = effectron->_start + tVect + orth;
@@ -213,15 +213,15 @@ SPELLINITFUNCTION(coneSpellInit) {
SPELLINITFUNCTION(waveSpellInit) {
effectron->_stepNo = 0;
- effectron->_totalSteps = 1 + (coneSpellLength / (SpellJumpiness * 2));
+ effectron->_totalSteps = 1 + (kConeSpellLength / (kSpellJumpiness * 2));
effectron->_start = effectron->_current;
effectron->_finish = effectron->_parent->_target->getPoint();
TilePoint tVect = effectron->_finish - effectron->_start ;
- setMagnitude(tVect, waveSpellLength);
+ setMagnitude(tVect, kWaveSpellLength);
TilePoint orth = rightVector(tVect, 0);
- setMagnitude(orth, waveSpellWidth * (effectron->_partno % 17 - 8) / 8);
+ setMagnitude(orth, kWaveSpellWidth * (effectron->_partno % 17 - 8) / 8);
effectron->_finish = effectron->_start + tVect + orth;
@@ -236,13 +236,13 @@ SPELLINITFUNCTION(ballSpellInit) {
effectron->_stepNo = 0;
effectron->_start = effectron->_current;
effectron->_finish = FireballVectors[effectron->_partno];
- setMagnitude(effectron->_finish, ballSpellRadius);
+ setMagnitude(effectron->_finish, kBallSpellRadius);
effectron->_finish = effectron->_finish + effectron->_start;
- effectron->_totalSteps = 1 + (ballSpellRadius / SpellJumpiness);
+ effectron->_totalSteps = 1 + (kBallSpellRadius / kSpellJumpiness);
effectron->_acceleration = TilePoint(0, 0, 0);
TilePoint tp = (effectron->_finish - effectron->_start);
- effectron->_totalSteps = 1 + (tp.magnitude() / SpellJumpiness);
+ effectron->_totalSteps = 1 + (tp.magnitude() / kSpellJumpiness);
effectron->_velocity = tp / effectron->_totalSteps;
effectron->_velocity.z = 0;
effectron->_acceleration = TilePoint(0, 0, 0);
@@ -255,13 +255,13 @@ SPELLINITFUNCTION(squareSpellInit) {
effectron->_stepNo = 0;
effectron->_start = effectron->_current;
effectron->_finish = SquareSpellVectors[effectron->_partno];
- setMagnitude(effectron->_finish, effectron->_finish.magnitude()*squareSpellSize / 4);
+ setMagnitude(effectron->_finish, effectron->_finish.magnitude()*kSquareSpellSize / 4);
effectron->_finish = effectron->_finish + effectron->_start;
- effectron->_totalSteps = 1 + (squareSpellSize / SpellJumpiness);
+ effectron->_totalSteps = 1 + (kSquareSpellSize / kSpellJumpiness);
effectron->_acceleration = TilePoint(0, 0, 0);
TilePoint tp = (effectron->_finish - effectron->_start);
- effectron->_totalSteps = 1 + (tp.magnitude() / SpellJumpiness);
+ effectron->_totalSteps = 1 + (tp.magnitude() / kSpellJumpiness);
effectron->_velocity = tp / effectron->_totalSteps;
effectron->_velocity.z = 0;
effectron->_acceleration = TilePoint(0, 0, 0);
@@ -274,13 +274,13 @@ SPELLINITFUNCTION(stormSpellInit) {
effectron->_stepNo = 0;
effectron->_start = effectron->_current;
effectron->_finish = FireballVectors[effectron->_partno];
- setMagnitude(effectron->_finish, ballSpellRadius);
+ setMagnitude(effectron->_finish, kBallSpellRadius);
effectron->_finish = effectron->_finish + effectron->_start;
- effectron->_totalSteps = 1 + (ballSpellRadius / SpellJumpiness);
+ effectron->_totalSteps = 1 + (kBallSpellRadius / kSpellJumpiness);
effectron->_acceleration = TilePoint(0, 0, 0);
TilePoint tp = (effectron->_finish - effectron->_start);
- effectron->_totalSteps = 1 + (2 * tp.magnitude() / SpellJumpiness);
+ effectron->_totalSteps = 1 + (2 * tp.magnitude() / kSpellJumpiness);
effectron->_velocity = tp / effectron->_totalSteps;
effectron->_velocity.z = 0;
effectron->_acceleration = TilePoint(0, 0, 0);
diff --git a/engines/saga2/spelvals.h b/engines/saga2/spelvals.h
index 2c9fd23ce7c..64c1b5d15cd 100644
--- a/engines/saga2/spelvals.h
+++ b/engines/saga2/spelvals.h
@@ -30,37 +30,37 @@ namespace Saga2 {
// constants affecting all or most of the spells
-const uint32 SpellJumpiness = 10;
-const uint16 spellSpeed = 1;
+const uint32 kSpellJumpiness = 10;
+const uint16 kSpellSpeed = 1;
// Bolt spell dimensions
-const int16 boltSpellLength = 192;
-const int16 boltSpellWidth = boltSpellLength / 6;
+const int16 kBoltSpellLength = 192;
+const int16 kBoltSpellWidth = kBoltSpellLength / 6;
// Bolt spell dimensions
-const int16 beamSpellLength = 192;
-const int16 beamSpellWidth = beamSpellLength / 12;
+const int16 kBeamSpellLength = 192;
+const int16 kBeamSpellWidth = kBeamSpellLength / 12;
// Cone spell dimensions
-const int16 coneSpellLength = 128;
-const int16 coneSpellWidth = coneSpellLength / 2;
+const int16 kConeSpellLength = 128;
+const int16 kConeSpellWidth = kConeSpellLength / 2;
// Wide Cone spell dimensions
-const int16 waveSpellLength = 128;
-const int16 waveSpellWidth = waveSpellLength;
+const int16 kWaveSpellLength = 128;
+const int16 kWaveSpellWidth = kWaveSpellLength;
// small ball spell dimensions
-const int16 ballSpellRadius = 48;
+const int16 kBallSpellRadius = 48;
// small ball spell dimensions
-const int16 squareSpellSize = 48;
+const int16 kSquareSpellSize = 48;
// large ball spell dimensions
-const int16 stormSpellRadius = 64;
+const int16 kStormSpellRadius = 64;
// small ball spell dimensions
-const int16 wallSpellRadius = 32;
-const int16 wallInnerRadius = 16;
+const int16 kWallSpellRadius = 32;
+const int16 kWallInnerRadius = 16;
/* ===================================================================== *
Imports
Commit: 98508c2bfbc50a617ad888d1b525a10a4b72a1b0
https://github.com/scummvm/scummvm/commit/98508c2bfbc50a617ad888d1b525a10a4b72a1b0
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-10-29T14:49:08+02:00
Commit Message:
SAGA2: Rename enums in sprite.h
Changed paths:
engines/saga2/actor.cpp
engines/saga2/dispnode.cpp
engines/saga2/motion.cpp
engines/saga2/sprite.cpp
engines/saga2/sprite.h
diff --git a/engines/saga2/actor.cpp b/engines/saga2/actor.cpp
index 14e5a43fee8..324de6aee0a 100644
--- a/engines/saga2/actor.cpp
+++ b/engines/saga2/actor.cpp
@@ -2086,7 +2086,7 @@ bool Actor::isActionAvailable(int16 newState, bool anyDir) {
return false;
if (anyDir) {
- for (int i = 0; i < numPoseFacings; i++) {
+ for (int i = 0; i < kNumPoseFacings; i++) {
if (anim->count[i] > 0) return true;
}
} else {
diff --git a/engines/saga2/dispnode.cpp b/engines/saga2/dispnode.cpp
index b53e0f5e7d0..2339fdaa87b 100644
--- a/engines/saga2/dispnode.cpp
+++ b/engines/saga2/dispnode.cpp
@@ -257,7 +257,7 @@ void DisplayNodeList::buildObjects(bool fromScratch) {
// actor's appearance.
if (a->_appearance == nullptr) {
a->_appearance =
- LoadActorAppearance(a->_appearanceID, sprStandBank);
+ LoadActorAppearance(a->_appearanceID, kSprStandBank);
}
}
@@ -643,7 +643,7 @@ void DisplayNode::drawObject() {
if (a->_leftHandObject != Nothing) {
partCount++;
- if (poseFlags & ActorPose::leftObjectInFront) {
+ if (poseFlags & ActorPose::kLeftObjectInFront) {
leftIndex = 1;
} else {
leftIndex = 0;
@@ -654,9 +654,9 @@ void DisplayNode::drawObject() {
if (a->_rightHandObject != Nothing) {
partCount++;
- if (poseFlags & ActorPose::rightObjectInFront) {
+ if (poseFlags & ActorPose::kRightObjectInFront) {
if (leftIndex == 1
- && poseFlags & ActorPose::leftOverRight) {
+ && poseFlags & ActorPose::kLeftOverRight) {
leftIndex = 2;
rightIndex = 1;
} else {
@@ -664,7 +664,7 @@ void DisplayNode::drawObject() {
}
} else {
if (leftIndex == 0
- && poseFlags & ActorPose::leftOverRight) {
+ && poseFlags & ActorPose::kLeftOverRight) {
rightIndex = 0;
leftIndex = 1;
bodyIndex = 2;
@@ -693,7 +693,7 @@ void DisplayNode::drawObject() {
// Color remapping info
sc->colorTable = mainColors;
// sc->colorTable = aa->schemeList ? mainColors : identityColors;
- sc->flipped = (poseFlags & ActorPose::actorFlipped);
+ sc->flipped = (poseFlags & ActorPose::kActorFlipped);
assert(sc->sp != nullptr);
assert(sc->sp->size.x > 0);
@@ -720,7 +720,7 @@ void DisplayNode::drawObject() {
assert(sc->offset.y < 1000);
assert(sc->offset.y > -1000);
sc->colorTable = leftColors;
- sc->flipped = (poseFlags & ActorPose::leftObjectFlipped);
+ sc->flipped = (poseFlags & ActorPose::kLeftObjectFlipped);
}
// If we were carrying something in the right hand,
@@ -746,7 +746,7 @@ void DisplayNode::drawObject() {
assert(sc->offset.y < 1000);
assert(sc->offset.y > -1000);
sc->colorTable = rightColors;
- sc->flipped = (poseFlags & ActorPose::rightObjectFlipped);
+ sc->flipped = (poseFlags & ActorPose::kRightObjectFlipped);
}
}
}
@@ -757,12 +757,12 @@ void DisplayNode::drawObject() {
int16 effectFlags = 0;
bool obscured;
- if (ghostIt) effectFlags |= sprFXGhosted;
+ if (ghostIt) effectFlags |= kSprFXGhosted;
if (obj->isSightedByCenter() && objRoofRipped(obj))
- effectFlags |= sprFXGhostIfObscured;
+ effectFlags |= kSprFXGhostIfObscured;
- effectFlags |= sprFXTerrainMask;
+ effectFlags |= kSprFXTerrainMask;
DrawCompositeMaskedSprite(
g_vm->_backPort,
@@ -773,7 +773,7 @@ void DisplayNode::drawObject() {
effectFlags,
&obscured);
- if (effectFlags & sprFXGhostIfObscured)
+ if (effectFlags & kSprFXGhostIfObscured)
obj->setObscured(obscured);
// Record the extent box that the sprite was drawn
@@ -854,7 +854,7 @@ ObjectID pickObject(const StaticPoint32 &mouse, StaticTilePoint &objPos) {
spr = ss->sprite(a->_poseInfo.actorFrameIndex);
flipped =
- (a->_poseInfo.flags & ActorPose::actorFlipped) ? 1 : 0;
+ (a->_poseInfo.flags & ActorPose::kActorFlipped) ? 1 : 0;
}
if (GetSpritePixel(spr, flipped, testPoint)) {
@@ -1000,7 +1000,7 @@ void Effectron::drawEffect() {
objCoords,
((obscured) && //objectFlags & GameObject::kObjectObscured ) &&
0
- ? sprFXGhosted : sprFXTerrainMask));
+ ? kSprFXGhosted : kSprFXTerrainMask));
}
diff --git a/engines/saga2/motion.cpp b/engines/saga2/motion.cpp
index fd10ae3f509..dbb5d08801c 100644
--- a/engines/saga2/motion.cpp
+++ b/engines/saga2/motion.cpp
@@ -2421,9 +2421,9 @@ void MotionTask::walkAction() {
// 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(sprRunBankNum)) {
+ if (aa && !aa->isBankLoaded(kSprRunBankNum)) {
walkType = walkNormal;
- aa->requestBank(sprRunBankNum);
+ aa->requestBank(kSprRunBankNum);
}
}
@@ -2447,8 +2447,8 @@ void MotionTask::walkAction() {
// If we can see this actor, and this actor's walk
// frames have not been loaded, then downgrade this
// action to a stand (i.e. do nothing).
- if (aa && !aa->isBankLoaded(sprWalkBankNum)) {
- aa->requestBank(sprWalkBankNum);
+ if (aa && !aa->isBankLoaded(kSprWalkBankNum)) {
+ aa->requestBank(kSprWalkBankNum);
return;
}
} else {
diff --git a/engines/saga2/sprite.cpp b/engines/saga2/sprite.cpp
index 5813c4ade06..88c289c9d87 100644
--- a/engines/saga2/sprite.cpp
+++ b/engines/saga2/sprite.cpp
@@ -242,8 +242,8 @@ void DrawCompositeMaskedSprite(
}
// do terrain masking
- if (effects & sprFXTerrainMask) {
- if (!(effects & sprFXGhostIfObscured)) {
+ if (effects & kSprFXTerrainMask) {
+ if (!(effects & kSprFXGhostIfObscured)) {
drawTileMask(
Point16(xMin, yMin),
compMap,
@@ -275,7 +275,7 @@ void DrawCompositeMaskedSprite(
isObscured = visiblePixels <= 10;
if (isObscured) {
memcpy(compMap._data, tempMap._data, compMapBytes);
- effects |= sprFXGhosted;
+ effects |= kSprFXGhosted;
}
if (obscured != nullptr) *obscured = isObscured;
@@ -298,7 +298,7 @@ void DrawCompositeMaskedSprite(
}
// Add in "ghost" effects
- if (effects & sprFXGhosted) {
+ if (effects & kSprFXGhosted) {
uint32 *dstRow = (uint32 *)compMap._data;
uint32 mask = (yMin & 1) ? 0xff00ff00 : 0x00ff00ff;
@@ -573,13 +573,13 @@ void ActorAppearance::loadSpriteBanks(int16 banksNeeded) {
}
ActorAnimation::ActorAnimation(Common::SeekableReadStream *stream) {
- for (int i = 0; i < numPoseFacings; i++)
+ for (int i = 0; i < kNumPoseFacings; i++)
start[i] = stream->readUint16LE();
- for (int i = 0; i < numPoseFacings; i++)
+ for (int i = 0; i < kNumPoseFacings; i++)
count[i] = stream->readUint16LE();
- for (int i = 0; i < numPoseFacings; i++)
+ for (int i = 0; i < kNumPoseFacings; i++)
debugC(2, kDebugLoading, "anim%d: start: %d count: %d", i, start[i], count[i]);
}
diff --git a/engines/saga2/sprite.h b/engines/saga2/sprite.h
index dadbe09d0d5..7571c2ff880 100644
--- a/engines/saga2/sprite.h
+++ b/engines/saga2/sprite.h
@@ -84,18 +84,18 @@ extern SpriteSet *objectSprites, // object sprites
* ===================================================================== */
enum spriteFacingDirections {
- sprFaceDown = 0,
- sprFaceDownLeft,
- sprFaceLeft,
- sprFaceUpLeft,
- sprFaceUp
+ kSprFaceDown = 0,
+ kSprFaceDownLeft,
+ kSprFaceLeft,
+ kSprFaceUpLeft,
+ kSprFaceUp
};
/* ===================================================================== *
ActorPose: Describes an element of a choreographed action
* ===================================================================== */
-const int numPoseFacings = 8;
+const int kNumPoseFacings = 8;
// Describes a single entry in an actor sequence
@@ -107,15 +107,15 @@ struct ActorPose {
// Indicates which of the sprites should be drawn flipped
// left-to-right
- actorFlipped = (1 << 0), // actor spr flipped left/right
- leftObjectFlipped = (1 << 1), // left hand object flipped
- rightObjectFlipped = (1 << 2), // right hand object flipped
+ kActorFlipped = (1 << 0), // actor spr flipped left/right
+ kLeftObjectFlipped = (1 << 1), // left hand object flipped
+ kRightObjectFlipped = (1 << 2), // right hand object flipped
// Indicates the front-to-back priority of the objects
- leftObjectInFront = (1 << 3), // left object in front of actor
- rightObjectInFront = (1 << 4), // right object in front of actor
- leftOverRight = (1 << 5) // left in front of right
+ kLeftObjectInFront = (1 << 3), // left object in front of actor
+ kRightObjectInFront = (1 << 4), // right object in front of actor
+ kLeftOverRight = (1 << 5) // left in front of right
};
uint16 flags; // sequence element flags
@@ -145,8 +145,8 @@ struct ActorAnimation {
// table of poses for that sequence, and the number of poses
// in the sequence.
- uint16 start[numPoseFacings];
- uint16 count[numPoseFacings];
+ uint16 start[kNumPoseFacings];
+ uint16 count[kNumPoseFacings];
ActorAnimation(Common::SeekableReadStream *stream);
@@ -200,9 +200,9 @@ struct SpriteComponent {
};
enum spriteEffectFlags {
- sprFXGhosted = (1 << 0), // semi-translucent dither
- sprFXTerrainMask = (1 << 1), // mask sprite to terrain
- sprFXGhostIfObscured = (1 << 2) // apply ghosted effect if
+ kSprFXGhosted = (1 << 0), // semi-translucent dither
+ kSprFXTerrainMask = (1 << 1), // mask sprite to terrain
+ kSprFXGhostIfObscured = (1 << 2) // apply ghosted effect if
// obscured by terrain
};
@@ -226,39 +226,39 @@ struct ObjectSpriteInfo {
// REM: I think we want more banks than this...
enum spriteBankNums {
- sprStandBankNum = 0,
- sprWalkBankNum,
- sprRunBankNum,
- sprKneelBankNum,
- sprLeapBankNum,
- sprClimbBankNum,
- sprTalkBankNum,
- sprFight1HBankNum,
- sprFight2HBankNum,
- sprFireBankNum,
- sprPassiveBankNum,
- sprUpStairsBankNum,
- sprDnStairsBankNum,
- sprSitBankNum,
-
- sprBankCount
+ kSprStandBankNum = 0,
+ kSprWalkBankNum,
+ kSprRunBankNum,
+ kSprKneelBankNum,
+ kSprLeapBankNum,
+ kSprClimbBankNum,
+ kSprTalkBankNum,
+ kSprFight1HBankNum,
+ kSprFight2HBankNum,
+ kSprFireBankNum,
+ kSprPassiveBankNum,
+ kSprUpStairsBankNum,
+ kSprDnStairsBankNum,
+ kSprSitBankNum,
+
+ kSprBankCount
};
enum spriteBankBits {
- sprStandBank = (1 << sprStandBankNum),
- sprWalkBank = (1 << sprWalkBankNum),
- sprRunBank = (1 << sprRunBankNum),
- sprKneelBank = (1 << sprKneelBankNum),
- sprLeapBank = (1 << sprLeapBankNum),
- sprClimbBank = (1 << sprClimbBankNum),
- sprTalkBank = (1 << sprTalkBankNum),
- sprFight1HBank = (1 << sprFight1HBankNum),
- sprFight2HBank = (1 << sprFight2HBankNum),
- sprFireBank = (1 << sprFireBankNum),
- sprPassiveBank = (1 << sprPassiveBankNum),
- sprUpStairsBank = (1 << sprUpStairsBankNum),
- sprDnStairsBank = (1 << sprDnStairsBankNum),
- sprSitBank = (1 << sprSitBankNum)
+ kSprStandBank = (1 << kSprStandBankNum),
+ kSprWalkBank = (1 << kSprWalkBankNum),
+ kSprRunBank = (1 << kSprRunBankNum),
+ kSprKneelBank = (1 << kSprKneelBankNum),
+ kSprLeapBank = (1 << kSprLeapBankNum),
+ kSprClimbBank = (1 << kSprClimbBankNum),
+ kSprTalkBank = (1 << kSprTalkBankNum),
+ kSprFight1HBank = (1 << kSprFight1HBankNum),
+ kSprFight2HBank = (1 << kSprFight2HBankNum),
+ kSprFireBank = (1 << kSprFireBankNum),
+ kSprPassiveBank = (1 << kSprPassiveBankNum),
+ kSprUpStairsBank = (1 << kSprUpStairsBankNum),
+ kSprDnStairsBank = (1 << kSprDnStairsBankNum),
+ kSprSitBank = (1 << kSprSitBankNum)
};
// This structure is used to contain all of the items needed
@@ -276,7 +276,7 @@ public:
ActorAnimSet *_poseList; // list of action sequences
ColorSchemeList *_schemeList; // color remapping info
- SpriteSet *_spriteBanks[sprBankCount];
+ SpriteSet *_spriteBanks[kSprBankCount];
void loadSpriteBanks(int16 banksNeeded);
Commit: 6a9dfb21d5f9b5676b3996c732911018dba3bc6a
https://github.com/scummvm/scummvm/commit/6a9dfb21d5f9b5676b3996c732911018dba3bc6a
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-10-29T14:51:10+02:00
Commit Message:
SAGA2: Rename enums in stimtype.h
Changed paths:
engines/saga2/actor.cpp
engines/saga2/stimtype.h
diff --git a/engines/saga2/actor.cpp b/engines/saga2/actor.cpp
index 324de6aee0a..007cfa1f936 100644
--- a/engines/saga2/actor.cpp
+++ b/engines/saga2/actor.cpp
@@ -286,7 +286,7 @@ bool ActorProto::acceptDropAction(
if (dropType & kIsIntangible) {
// Set up the arguments we want to pass to the script
- scf.value = droppedObj->proto()->lockType + senseIdeaGreeting;
+ scf.value = droppedObj->proto()->lockType + kSenseIdeaGreeting;
// Invoke the script...
@@ -329,7 +329,7 @@ bool ActorProto::greetActor(
scf.enactor = enactor;
scf.directObject = Nothing;
scf.indirectObject = Nothing;
- scf.value = senseIdeaGreeting;
+ scf.value = kSenseIdeaGreeting;
return runObjectMethod(dObj, Method_Actor_onTalkTo, scf);
}
diff --git a/engines/saga2/stimtype.h b/engines/saga2/stimtype.h
index 0f879ea1a1e..5844c53f59b 100644
--- a/engines/saga2/stimtype.h
+++ b/engines/saga2/stimtype.h
@@ -31,64 +31,63 @@ namespace Saga2 {
// A list of stimuli types, used for both SAGA and C code
enum stimuliTypes {
- senseNothing = 0, // no stimuli
+ kSenseNothing = 0, // no stimuli
// Situations
- senseTimePassed, // time passes with no occurance
- senseProximity, // sense proximity of protagonist
+ kSenseTimePassed, // time passes with no occurance
+ kSenseProximity, // sense proximity of protagonist
// Idea icons from protagonist
- senseIdeaGreeting, // greeting from protagonist
- senseIdeaHere, // talk about "here"
- senseIdeaWork, // talk about work
- senseIdeaFood, // talk about food
- senseIdeaDrink,
- senseIdeaGold,
- senseIdeaJewelry,
- senseIdeaWeapons,
- senseIdeaArmor,
- senseIdeaContainer,
- senseIdeaLeader,
- senseIdeaCrime,
- senseIdeaSelf,
- senseIdeaYou,
- senseIdeaKeys,
- senseIdeaDocument,
- senseIdeaPriest,
- senseIdeaMagicSpell,
- senseIdeaMagicItem,
- senseIdeaPotion,
- senseIdeaShip,
- senseIdeaHouse,
- senseIdeaShop,
- senseIdeaCastle,
- senseIdeaSpirit,
+ kSenseIdeaGreeting, // greeting from protagonist
+ kSenseIdeaHere, // talk about "here"
+ kSenseIdeaWork, // talk about work
+ kSenseIdeaFood, // talk about food
+ kSenseIdeaDrink,
+ kSenseIdeaGold,
+ kSenseIdeaJewelry,
+ kSenseIdeaWeapons,
+ kSenseIdeaArmor,
+ kSenseIdeaContainer,
+ kSenseIdeaLeader,
+ kSenseIdeaCrime,
+ kSenseIdeaSelf,
+ kSenseIdeaYou,
+ kSenseIdeaKeys,
+ kSenseIdeaDocument,
+ kSenseIdeaPriest,
+ kSenseIdeaMagicSpell,
+ kSenseIdeaMagicItem,
+ kSenseIdeaPotion,
+ kSenseIdeaShip,
+ kSenseIdeaHouse,
+ kSenseIdeaShop,
+ kSenseIdeaCastle,
+ kSenseIdeaSpirit,
// Protagonist giving physical objects
- senseGiveWealth, // protag gave us gold
- senseGiveFood, // protag gave us food
- senseGiveIntoxicant, // protag gave us booze
- senseGiveWeapon, // protag gave us weapon
- senseGiveDefense, // protag gave us armor
- senseGiveMagic, // protag gave us magic
- senseGiveEnigmatic, // protag gave us strangeness
+ kSenseGiveWealth, // protag gave us gold
+ kSenseGiveFood, // protag gave us food
+ kSenseGiveIntoxicant, // protag gave us booze
+ kSenseGiveWeapon, // protag gave us weapon
+ kSenseGiveDefense, // protag gave us armor
+ kSenseGiveMagic, // protag gave us magic
+ kSenseGiveEnigmatic, // protag gave us strangeness
// Actions witnessed
- senseActionAttack, // protag attacked us
- senseActionAttackFaction, // protag attacked friend
- senseActionTheft, // protag stole from us
- senseActionVandalism, // protag destroyed property
- senseActionSpellcast, // protag cast spell
- senseActionEnemy, // some foe came into sight
+ kSenseActionAttack, // protag attacked us
+ kSenseActionAttackFaction, // protag attacked friend
+ kSenseActionTheft, // protag stole from us
+ kSenseActionVandalism, // protag destroyed property
+ kSenseActionSpellcast, // protag cast spell
+ kSenseActionEnemy, // some foe came into sight
// Actions that we remember doing ourself
- senseDidAttack, // we attacked protag
- senseDidRun, // we raw away from protag
- senseDidGive, // we gave something to protag
+ kSenseDidAttack, // we attacked protag
+ kSenseDidRun, // we raw away from protag
+ kSenseDidGive, // we gave something to protag
// Number of sensory types
- senseCount
-
+ kSenseCount
};
} // end of namespace Saga2
Commit: 1a7c063c9474b56a26e25f2852985d8affbf64b8
https://github.com/scummvm/scummvm/commit/1a7c063c9474b56a26e25f2852985d8affbf64b8
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-10-29T14:54:26+02:00
Commit Message:
SAGA2: Rename enums in target.h
Changed paths:
engines/saga2/target.cpp
engines/saga2/target.h
diff --git a/engines/saga2/target.cpp b/engines/saga2/target.cpp
index 8a6be6ccd09..cfca579964a 100644
--- a/engines/saga2/target.cpp
+++ b/engines/saga2/target.cpp
@@ -46,39 +46,39 @@ void readTarget(void *mem, Common::InSaveFile *in) {
int16 type = in->readSint16LE();
switch (type) {
- case locationTarget:
+ case kLocationTarget:
new (mem) LocationTarget(in);
break;
- case specificTileTarget:
+ case kSpecificTileTarget:
new (mem) SpecificTileTarget(in);
break;
- case tilePropertyTarget:
+ case kTilePropertyTarget:
new (mem) TilePropertyTarget(in);
break;
- case specificMetaTileTarget:
+ case kSpecificMetaTileTarget:
new (mem) SpecificMetaTileTarget(in);
break;
- case metaTilePropertyTarget:
+ case kMetaTilePropertyTarget:
new (mem) MetaTilePropertyTarget(in);
break;
- case specificObjectTarget:
+ case kSpecificObjectTarget:
new (mem) SpecificObjectTarget(in);
break;
- case objectPropertyTarget:
+ case kObjectPropertyTarget:
new (mem) ObjectPropertyTarget(in);
break;
- case specificActorTarget:
+ case kSpecificActorTarget:
new (mem) SpecificActorTarget(in);
break;
- case actorPropertyTarget:
+ case kActorPropertyTarget:
new (mem) ActorPropertyTarget(in);
break;
}
@@ -172,7 +172,7 @@ void LocationTarget::write(Common::MemoryWriteStreamDynamic *out) const {
// Return an integer representing the type of target
int16 LocationTarget::getType() const {
- return locationTarget;
+ return kLocationTarget;
}
//----------------------------------------------------------------------
@@ -193,7 +193,7 @@ void LocationTarget::clone(void *mem) const {
// Determine if the specified target is equivalent to this target
bool LocationTarget::operator == (const Target &t) const {
- if (t.getType() != locationTarget) return false;
+ if (t.getType() != kLocationTarget) return false;
const LocationTarget *targetPtr = (const LocationTarget *)&t;
@@ -229,11 +229,11 @@ TilePoint TileTarget::where(GameWorld *world, const TilePoint &tp) const {
StandingTileInfo sti;
// Compute the tile region to search
- tileReg.min.u = (tp.u - maxTileDist) >> kTileUVShift;
- tileReg.max.u = (tp.u + maxTileDist - 1 + kTileUVMask)
+ tileReg.min.u = (tp.u - kMaxTileDist) >> kTileUVShift;
+ tileReg.max.u = (tp.u + kMaxTileDist - 1 + kTileUVMask)
>> kTileUVShift;
- tileReg.min.v = (tp.v - maxTileDist) >> kTileUVShift;
- tileReg.max.v = (tp.v + maxTileDist - 1 + kTileUVMask)
+ tileReg.min.v = (tp.v - kMaxTileDist) >> kTileUVShift;
+ tileReg.max.v = (tp.v + kMaxTileDist - 1 + kTileUVMask)
>> kTileUVShift;
TileIterator tIter(world->_mapNum, tileReg);
@@ -284,11 +284,11 @@ int16 TileTarget::where(
StandingTileInfo sti;
// Compute the tile region to search
- tileReg.min.u = (tp.u - maxTileDist) >> kTileUVShift;
- tileReg.max.u = (tp.u + maxTileDist - 1 + kTileUVMask)
+ tileReg.min.u = (tp.u - kMaxTileDist) >> kTileUVShift;
+ tileReg.max.u = (tp.u + kMaxTileDist - 1 + kTileUVMask)
>> kTileUVShift;
- tileReg.min.v = (tp.v - maxTileDist) >> kTileUVShift;
- tileReg.max.v = (tp.v + maxTileDist - 1 + kTileUVMask)
+ tileReg.min.v = (tp.v - kMaxTileDist) >> kTileUVShift;
+ tileReg.max.v = (tp.v + kMaxTileDist - 1 + kTileUVMask)
>> kTileUVShift;
TileIterator tIter(world->_mapNum, tileReg);
@@ -356,7 +356,7 @@ void SpecificTileTarget::write(Common::MemoryWriteStreamDynamic *out) const {
// Return an integer representing the type of target
int16 SpecificTileTarget::getType() const {
- return specificTileTarget;
+ return kSpecificTileTarget;
}
//----------------------------------------------------------------------
@@ -377,7 +377,7 @@ void SpecificTileTarget::clone(void *mem) const {
// Determine if the specified target is equivalent to this target
bool SpecificTileTarget::operator == (const Target &t) const {
- if (t.getType() != specificTileTarget) return false;
+ if (t.getType() != kSpecificTileTarget) return false;
const SpecificTileTarget *targetPtr = (const SpecificTileTarget *)&t;
@@ -415,7 +415,7 @@ void TilePropertyTarget::write(Common::MemoryWriteStreamDynamic *out) const {
// Return an integer representing the type of target
int16 TilePropertyTarget::getType() const {
- return tilePropertyTarget;
+ return kTilePropertyTarget;
}
//----------------------------------------------------------------------
@@ -436,7 +436,7 @@ void TilePropertyTarget::clone(void *mem) const {
// Determine if the specified target is equivalent to this target
bool TilePropertyTarget::operator == (const Target &t) const {
- if (t.getType() != tilePropertyTarget) return false;
+ if (t.getType() != kTilePropertyTarget) return false;
const TilePropertyTarget *targetPtr = (const TilePropertyTarget *)&t;
@@ -461,11 +461,11 @@ TilePoint MetaTileTarget::where(
TileRegion tileReg;
// Determine the tile region to search
- tileReg.min.u = (tp.u - maxMetaDist) >> kTileUVShift;
- tileReg.max.u = (tp.u + maxMetaDist + kTileUVMask)
+ tileReg.min.u = (tp.u - kMaxMetaDist) >> kTileUVShift;
+ tileReg.max.u = (tp.u + kMaxMetaDist + kTileUVMask)
>> kTileUVShift;
- tileReg.min.v = (tp.v - maxMetaDist) >> kTileUVShift;
- tileReg.max.v = (tp.v + maxMetaDist + kTileUVMask)
+ tileReg.min.v = (tp.v - kMaxMetaDist) >> kTileUVShift;
+ tileReg.max.v = (tp.v + kMaxMetaDist + kTileUVMask)
>> kTileUVShift;
MetaTileIterator mIter(world->_mapNum, tileReg);
@@ -515,11 +515,11 @@ int16 MetaTileTarget::where(
TileRegion tileReg;
// Compute the tile region to search
- tileReg.min.u = (tp.u - maxMetaDist) >> kTileUVShift;
- tileReg.max.u = (tp.u + maxMetaDist + kTileUVMask)
+ tileReg.min.u = (tp.u - kMaxMetaDist) >> kTileUVShift;
+ tileReg.max.u = (tp.u + kMaxMetaDist + kTileUVMask)
>> kTileUVShift;
- tileReg.min.v = (tp.v - maxMetaDist) >> kTileUVShift;
- tileReg.max.v = (tp.v + maxMetaDist + kTileUVMask)
+ tileReg.min.v = (tp.v - kMaxMetaDist) >> kTileUVShift;
+ tileReg.max.v = (tp.v + kMaxMetaDist + kTileUVMask)
>> kTileUVShift;
MetaTileIterator mIter(world->_mapNum, tileReg);
@@ -586,7 +586,7 @@ void SpecificMetaTileTarget::write(Common::MemoryWriteStreamDynamic *out) const
// Return an integer representing the type of target
int16 SpecificMetaTileTarget::getType() const {
- return specificMetaTileTarget;
+ return kSpecificMetaTileTarget;
}
//----------------------------------------------------------------------
@@ -607,7 +607,7 @@ void SpecificMetaTileTarget::clone(void *mem) const {
// Determine if the specified target is equivalent to this target
bool SpecificMetaTileTarget::operator == (const Target &t) const {
- if (t.getType() != specificMetaTileTarget) return false;
+ if (t.getType() != kSpecificMetaTileTarget) return false;
const SpecificMetaTileTarget *targetPtr = (const SpecificMetaTileTarget *)&t;
@@ -649,7 +649,7 @@ void MetaTilePropertyTarget::write(Common::MemoryWriteStreamDynamic *out) const
// Return an integer representing the type of target
int16 MetaTilePropertyTarget::getType() const {
- return metaTilePropertyTarget;
+ return kMetaTilePropertyTarget;
}
//----------------------------------------------------------------------
@@ -670,7 +670,7 @@ void MetaTilePropertyTarget::clone(void *mem) const {
// Determine if the specified target is equivalent to this target
bool MetaTilePropertyTarget::operator == (const Target &t) const {
- if (t.getType() != metaTilePropertyTarget) return false;
+ if (t.getType() != kMetaTilePropertyTarget) return false;
const MetaTilePropertyTarget *targetPtr = (const MetaTilePropertyTarget *)&t;
@@ -771,7 +771,7 @@ TilePoint ObjectTarget::where(GameWorld *world, const TilePoint &tp) const {
GameObject *objPtr = nullptr;
TilePoint objCoords,
bestOCoords = Nowhere;
- CircularObjectIterator iter(world, tp, maxObjDist);
+ CircularObjectIterator iter(world, tp, kMaxObjDist);
// Iterate through each object in the vicinity
for (iter.first(&objPtr, &dist);
@@ -813,7 +813,7 @@ int16 ObjectTarget::where(
GameWorld *world,
const TilePoint &tp,
TargetLocationArray &tla) const {
- CircularObjectIterator objIter(world, tp, maxObjDist);
+ CircularObjectIterator objIter(world, tp, kMaxObjDist);
GameObject *objPtr;
ObjectID id;
@@ -833,7 +833,7 @@ int16 ObjectTarget::where(
GameObject *ObjectTarget::object(
GameWorld *world,
const TilePoint &tp) const {
- CircularObjectIterator objIter(world, tp, maxObjDist);
+ CircularObjectIterator objIter(world, tp, kMaxObjDist);
GameObject *objPtr,
*bestObj = nullptr;
@@ -879,7 +879,7 @@ int16 ObjectTarget::object(
GameWorld *world,
const TilePoint &tp,
TargetObjectArray &toa) const {
- CircularObjectIterator objIter(world, tp, maxObjDist);
+ CircularObjectIterator objIter(world, tp, kMaxObjDist);
GameObject *objPtr;
ObjectID id;
@@ -924,7 +924,7 @@ void SpecificObjectTarget::write(Common::MemoryWriteStreamDynamic *out) const {
// Return an integer representing the type of target
int16 SpecificObjectTarget::getType() const {
- return specificObjectTarget;
+ return kSpecificObjectTarget;
}
//----------------------------------------------------------------------
@@ -945,7 +945,7 @@ void SpecificObjectTarget::clone(void *mem) const {
// Determine if the specified target is equivalent to this target
bool SpecificObjectTarget::operator == (const Target &t) const {
- if (t.getType() != specificObjectTarget) return false;
+ if (t.getType() != kSpecificObjectTarget) return false;
const SpecificObjectTarget *targetPtr = (const SpecificObjectTarget *)&t;
@@ -972,7 +972,7 @@ TilePoint SpecificObjectTarget::where(
if (o->world() == world) {
TilePoint objLoc = o->getLocation();
- if ((tp - objLoc).quickHDistance() < maxObjDist)
+ if ((tp - objLoc).quickHDistance() < kMaxObjDist)
return objLoc;
}
@@ -993,7 +993,7 @@ int16 SpecificObjectTarget::where(
TilePoint objLoc = o->getLocation();
int16 dist = (tp - objLoc).quickHDistance();
- if (dist < maxObjDist) {
+ if (dist < kMaxObjDist) {
tla.locs = 1;
tla.locArray[0] = objLoc;
tla.distArray[0] = dist;
@@ -1015,7 +1015,7 @@ GameObject *SpecificObjectTarget::object(
GameObject *o = GameObject::objectAddress(_obj);
if (o->world() == world) {
- if ((tp - o->getLocation()).quickHDistance() < maxObjDist)
+ if ((tp - o->getLocation()).quickHDistance() < kMaxObjDist)
return o;
}
@@ -1035,7 +1035,7 @@ int16 SpecificObjectTarget::object(
if (toa.size > 0 && o->world() == world) {
int16 dist = (tp - o->getLocation()).quickHDistance();
- if (dist < maxObjDist) {
+ if (dist < kMaxObjDist) {
toa.objs = 1;
toa.objArray[0] = o;
toa.distArray[0] = dist;
@@ -1075,7 +1075,7 @@ void ObjectPropertyTarget::write(Common::MemoryWriteStreamDynamic *out) const {
// Return an integer representing the type of target
int16 ObjectPropertyTarget::getType() const {
- return objectPropertyTarget;
+ return kObjectPropertyTarget;
}
//----------------------------------------------------------------------
@@ -1096,7 +1096,7 @@ void ObjectPropertyTarget::clone(void *mem) const {
// Determine if the specified target is equivalent to this target
bool ObjectPropertyTarget::operator == (const Target &t) const {
- if (t.getType() != objectPropertyTarget) return false;
+ if (t.getType() != kObjectPropertyTarget) return false;
const ObjectPropertyTarget *targetPtr = (const ObjectPropertyTarget *)&t;
@@ -1177,7 +1177,7 @@ void SpecificActorTarget::write(Common::MemoryWriteStreamDynamic *out) const {
// Return an integer representing the type of target
int16 SpecificActorTarget::getType() const {
- return specificActorTarget;
+ return kSpecificActorTarget;
}
//----------------------------------------------------------------------
@@ -1198,7 +1198,7 @@ void SpecificActorTarget::clone(void *mem) const {
// Determine if the specified target is equivalent to this target
bool SpecificActorTarget::operator == (const Target &t) const {
- if (t.getType() != specificActorTarget) return false;
+ if (t.getType() != kSpecificActorTarget) return false;
const SpecificActorTarget *targetPtr = (const SpecificActorTarget *)&t;
@@ -1221,7 +1221,7 @@ TilePoint SpecificActorTarget::where(GameWorld *world, const TilePoint &tp) cons
if (_a->world() == world) {
TilePoint actorLoc = _a->getLocation();
- if ((tp - actorLoc).quickHDistance() < maxObjDist)
+ if ((tp - actorLoc).quickHDistance() < kMaxObjDist)
return actorLoc;
}
@@ -1237,7 +1237,7 @@ int16 SpecificActorTarget::where(GameWorld *world, const TilePoint &tp, TargetLo
TilePoint actorLoc = _a->getLocation();
int16 dist = (tp - actorLoc).quickHDistance();
- if (dist < maxObjDist) {
+ if (dist < kMaxObjDist) {
tla.locs = 1;
tla.locArray[0] = actorLoc;
tla.distArray[0] = dist;
@@ -1255,7 +1255,7 @@ int16 SpecificActorTarget::where(GameWorld *world, const TilePoint &tp, TargetLo
GameObject *SpecificActorTarget::object(GameWorld *world, const TilePoint &tp) const {
if (_a->world() == world) {
- if ((tp - _a->getLocation()).quickHDistance() < maxObjDist)
+ if ((tp - _a->getLocation()).quickHDistance() < kMaxObjDist)
return _a;
}
@@ -1270,7 +1270,7 @@ int16 SpecificActorTarget::object(GameWorld *world, const TilePoint &tp, TargetO
if (toa.size > 0 && _a->world() == world) {
int16 dist = (tp - _a->getLocation()).quickHDistance();
- if (dist < maxObjDist) {
+ if (dist < kMaxObjDist) {
toa.objs = 1;
toa.objArray[0] = _a;
toa.distArray[0] = dist;
@@ -1288,7 +1288,7 @@ int16 SpecificActorTarget::object(GameWorld *world, const TilePoint &tp, TargetO
Actor *SpecificActorTarget::actor(GameWorld *world, const TilePoint &tp) const {
if (_a->world() == world) {
- if ((tp - _a->getLocation()).quickHDistance() < maxObjDist)
+ if ((tp - _a->getLocation()).quickHDistance() < kMaxObjDist)
return _a;
}
@@ -1303,7 +1303,7 @@ int16 SpecificActorTarget::actor(GameWorld *world, const TilePoint &tp, TargetAc
if (taa.size > 0 && _a->world() == world) {
int16 dist = (tp - _a->getLocation()).quickHDistance();
- if (dist < maxObjDist) {
+ if (dist < kMaxObjDist) {
taa.actors = 1;
taa.actorArray[0] = _a;
taa.distArray[0] = dist;
@@ -1343,7 +1343,7 @@ void ActorPropertyTarget::write(Common::MemoryWriteStreamDynamic *out) const {
// Return an integer representing the type of target
int16 ActorPropertyTarget::getType() const {
- return actorPropertyTarget;
+ return kActorPropertyTarget;
}
//----------------------------------------------------------------------
@@ -1364,7 +1364,7 @@ void ActorPropertyTarget::clone(void *mem) const {
// Determine if the specified target is equivalent to this target
bool ActorPropertyTarget::operator == (const Target &t) const {
- if (t.getType() != actorPropertyTarget) return false;
+ if (t.getType() != kActorPropertyTarget) return false;
const ActorPropertyTarget *targetPtr = (const ActorPropertyTarget *)&t;
diff --git a/engines/saga2/target.h b/engines/saga2/target.h
index 273d464064b..c4b2eb78c5d 100644
--- a/engines/saga2/target.h
+++ b/engines/saga2/target.h
@@ -30,20 +30,20 @@ namespace Saga2 {
struct StandingTileInfo;
-const int maxObjDist = kPlatformWidth * kTileUVSize * 8;
-const int maxTileDist = kPlatformWidth * kTileUVSize * 2;
-const int maxMetaDist = kPlatformWidth * kTileUVSize * 8;
+const int kMaxObjDist = kPlatformWidth * kTileUVSize * 8;
+const int kMaxTileDist = kPlatformWidth * kTileUVSize * 2;
+const int kMaxMetaDist = kPlatformWidth * kTileUVSize * 8;
enum TargetType {
- locationTarget,
- specificTileTarget,
- tilePropertyTarget,
- specificMetaTileTarget,
- metaTilePropertyTarget,
- specificObjectTarget,
- objectPropertyTarget,
- specificActorTarget,
- actorPropertyTarget
+ kLocationTarget,
+ kSpecificTileTarget,
+ kTilePropertyTarget,
+ kSpecificMetaTileTarget,
+ kMetaTilePropertyTarget,
+ kSpecificObjectTarget,
+ kObjectPropertyTarget,
+ kSpecificActorTarget,
+ kActorPropertyTarget
};
/* ===================================================================== *
@@ -641,9 +641,9 @@ public:
// to contain any target. The sizeof( LocationTarget ) is used because
// the LocationTarget takes the most memory.
-const size_t targetBytes = sizeof(LocationTarget);
+const size_t kTargetBytes = sizeof(LocationTarget);
-typedef uint8 TargetPlaceHolder[targetBytes];
+typedef uint8 TargetPlaceHolder[kTargetBytes];
} // end of namespace Saga2
Commit: ca1a6e8f255b3640cc755ad4a75fbfa30eabab88
https://github.com/scummvm/scummvm/commit/ca1a6e8f255b3640cc755ad4a75fbfa30eabab88
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-10-29T15:08:31+02:00
Commit Message:
SAGA2: Rename enums in task.h
Changed paths:
engines/saga2/assign.cpp
engines/saga2/task.cpp
engines/saga2/task.h
diff --git a/engines/saga2/assign.cpp b/engines/saga2/assign.cpp
index 65afc70d36a..144aa007419 100644
--- a/engines/saga2/assign.cpp
+++ b/engines/saga2/assign.cpp
@@ -486,7 +486,7 @@ bool HuntToBeNearActorAssignment::taskNeeded() {
targetLoc = getTarget()->where(a->world(), actorLoc);
return !a->inRange(targetLoc, _range)
- || a->inRange(targetLoc, HuntToBeNearActorTask::tooClose);
+ || a->inRange(targetLoc, HuntToBeNearActorTask::kTooClose);
}
//----------------------------------------------------------------------
diff --git a/engines/saga2/task.cpp b/engines/saga2/task.cpp
index a4a0472929e..d4969df20ed 100644
--- a/engines/saga2/task.cpp
+++ b/engines/saga2/task.cpp
@@ -651,75 +651,75 @@ void readTask(TaskID id, Common::InSaveFile *in) {
// Reconstruct the Task based upon the type
switch (type) {
- case wanderTask:
+ case kWanderTask:
new WanderTask(in, id);
break;
- case tetheredWanderTask:
+ case kTetheredWanderTask:
new TetheredWanderTask(in, id);
break;
- case gotoLocationTask:
+ case kGotoLocationTask:
new GotoLocationTask(in, id);
break;
- case gotoRegionTask:
+ case kGotoRegionTask:
new GotoRegionTask(in, id);
break;
- case gotoObjectTask:
+ case kGotoObjectTask:
new GotoObjectTask(in, id);
break;
- case gotoActorTask:
+ case kGotoActorTask:
new GotoActorTask(in, id);
break;
- case goAwayFromObjectTask:
+ case kGoAwayFromObjectTask:
new GoAwayFromObjectTask(in, id);
break;
- case goAwayFromActorTask:
+ case kGoAwayFromActorTask:
new GoAwayFromActorTask(in, id);
break;
- case huntToBeNearLocationTask:
+ case kHuntToBeNearLocationTask:
new HuntToBeNearLocationTask(in, id);
break;
- case huntToBeNearObjectTask:
+ case kHuntToBeNearObjectTask:
new HuntToBeNearObjectTask(in, id);
break;
- case huntToPossessTask:
+ case kHuntToPossessTask:
new HuntToPossessTask(in, id);
break;
- case huntToBeNearActorTask:
+ case kHuntToBeNearActorTask:
new HuntToBeNearActorTask(in, id);
break;
- case huntToKillTask:
+ case kHuntToKillTask:
new HuntToKillTask(in, id);
break;
- case huntToGiveTask:
+ case kHuntToGiveTask:
new HuntToGiveTask(in, id);
break;
- case bandTask:
+ case kBandTask:
new BandTask(in, id);
break;
- case bandAndAvoidEnemiesTask:
+ case kBandAndAvoidEnemiesTask:
new BandAndAvoidEnemiesTask(in, id);
break;
- case followPatrolRouteTask:
+ case kFollowPatrolRouteTask:
new FollowPatrolRouteTask(in, id);
break;
- case attendTask:
+ case kAttendTask:
new AttendTask(in, id);
break;
}
@@ -810,7 +810,7 @@ void WanderTask::write(Common::MemoryWriteStreamDynamic *out) const {
// Return an integer representing the type of this task
int16 WanderTask::getType() const {
- return wanderTask;
+ return kWanderTask;
}
//----------------------------------------------------------------------
@@ -848,7 +848,7 @@ TaskResult WanderTask::update() {
// Determine if the specified task is equivalent to this task
bool WanderTask::operator == (const Task &t) const {
- return t.getType() == wanderTask;
+ return t.getType() == kWanderTask;
}
//----------------------------------------------------------------------
@@ -951,7 +951,7 @@ void TetheredWanderTask::write(Common::MemoryWriteStreamDynamic *out) const {
// Return an integer representing the type of this task
int16 TetheredWanderTask::getType() const {
- return tetheredWanderTask;
+ return kTetheredWanderTask;
}
//----------------------------------------------------------------------
@@ -974,7 +974,7 @@ void TetheredWanderTask::abortTask() {
// Determine if the specified task is equivalent to this task
bool TetheredWanderTask::operator == (const Task &t) const {
- if (t.getType() != tetheredWanderTask) return false;
+ if (t.getType() != kTetheredWanderTask) return false;
const TetheredWanderTask *taskPtr = (const TetheredWanderTask *)&t;
@@ -1245,14 +1245,14 @@ void GotoLocationTask::write(Common::MemoryWriteStreamDynamic *out) const {
// Return an integer representing the type of this task
int16 GotoLocationTask::getType() const {
- return gotoLocationTask;
+ return kGotoLocationTask;
}
//----------------------------------------------------------------------
// Determine if the specified task is equivalent to this task
bool GotoLocationTask::operator == (const Task &t) const {
- if (t.getType() != gotoLocationTask) return false;
+ if (t.getType() != kGotoLocationTask) return false;
const GotoLocationTask *taskPtr = (const GotoLocationTask *)&t;
@@ -1335,14 +1335,14 @@ void GotoRegionTask::write(Common::MemoryWriteStreamDynamic *out) const {
// Return an integer representing the type of this task
int16 GotoRegionTask::getType() const {
- return gotoRegionTask;
+ return kGotoRegionTask;
}
//----------------------------------------------------------------------
// Determine if the specified task is equivalent to this task
bool GotoRegionTask::operator == (const Task &t) const {
- if (t.getType() != gotoRegionTask) return false;
+ if (t.getType() != kGotoRegionTask) return false;
const GotoRegionTask *taskPtr = (const GotoRegionTask *)&t;
@@ -1443,8 +1443,8 @@ TilePoint GotoObjectTargetTask::intermediateDest() {
//----------------------------------------------------------------------
bool GotoObjectTargetTask::lineOfSight() {
- if (_flags & track) {
- _flags |= inSight;
+ if (_flags & kTrack) {
+ _flags |= kInSight;
_lastKnownLoc = getObject()->getLocation();
} else {
Actor *a = _stack->getActor();
@@ -1454,7 +1454,7 @@ bool GotoObjectTargetTask::lineOfSight() {
SenseInfo info;
// Determine if we need to retest the line of sight
- if (_flags & inSight) {
+ if (_flags & kInSight) {
// If the object was previously in sight, retest the line of
// sight if the target has moved beyond a certain range from
// the last location it was tested at.
@@ -1468,16 +1468,16 @@ bool GotoObjectTargetTask::lineOfSight() {
info,
maxSenseRange,
targetID))
- _flags |= inSight;
+ _flags |= kInSight;
else
- _flags &= ~inSight;
+ _flags &= ~kInSight;
_lastTestedLoc = _targetLoc;
}
} else {
// If the object was not privously in sight, retest the line
// of sight periodically
if (_sightCtr == 0) {
- _sightCtr = sightRate;
+ _sightCtr = kSightRate;
if (a->canSenseSpecificObject(
info,
maxSenseRange,
@@ -1486,15 +1486,15 @@ bool GotoObjectTargetTask::lineOfSight() {
info,
maxSenseRange,
targetID))
- _flags |= inSight;
+ _flags |= kInSight;
else
- _flags &= ~inSight;
+ _flags &= ~kInSight;
_lastTestedLoc = _targetLoc;
}
_sightCtr--;
}
- if (_flags & inSight) {
+ if (_flags & kInSight) {
// If the target is in sight, the last known location is the
// objects current location.
_lastKnownLoc = _targetLoc;
@@ -1508,7 +1508,7 @@ bool GotoObjectTargetTask::lineOfSight() {
}
}
- return _flags & inSight;
+ return _flags & kInSight;
}
/* ===================================================================== *
@@ -1551,14 +1551,14 @@ void GotoObjectTask::write(Common::MemoryWriteStreamDynamic *out) const {
// Return an integer representing the type of this task
int16 GotoObjectTask::getType() const {
- return gotoObjectTask;
+ return kGotoObjectTask;
}
//----------------------------------------------------------------------
// Determine if the specified task is equivalent to this task
bool GotoObjectTask::operator == (const Task &t) const {
- if (t.getType() != gotoObjectTask) return false;
+ if (t.getType() != kGotoObjectTask) return false;
const GotoObjectTask *taskPtr = (const GotoObjectTask *)&t;
@@ -1618,14 +1618,14 @@ void GotoActorTask::write(Common::MemoryWriteStreamDynamic *out) const {
// Return an integer representing the type of this task
int16 GotoActorTask::getType() const {
- return gotoActorTask;
+ return kGotoActorTask;
}
//----------------------------------------------------------------------
// Determine if the specified task is equivalent to this task
bool GotoActorTask::operator == (const Task &t) const {
- if (t.getType() != gotoActorTask) return false;
+ if (t.getType() != kGotoActorTask) return false;
const GotoActorTask *taskPtr = (const GotoActorTask *)&t;
@@ -1749,7 +1749,7 @@ TaskResult GoAwayFromTask::update() {
_goTask->update();
} else {
- if ((_goTask = _flags & run
+ if ((_goTask = _flags & kRun
? new GotoLocationTask(_stack, dest, 0)
: new GotoLocationTask(_stack, dest))
!= nullptr)
@@ -1801,14 +1801,14 @@ void GoAwayFromObjectTask::write(Common::MemoryWriteStreamDynamic *out) const {
// Return an integer representing the type of this task
int16 GoAwayFromObjectTask::getType() const {
- return goAwayFromObjectTask;
+ return kGoAwayFromObjectTask;
}
//----------------------------------------------------------------------
// Determine if the specified task is equivalent to this task
bool GoAwayFromObjectTask::operator == (const Task &t) const {
- if (t.getType() != goAwayFromObjectTask) return false;
+ if (t.getType() != kGoAwayFromObjectTask) return false;
const GoAwayFromObjectTask *taskPtr = (const GoAwayFromObjectTask *)&t;
@@ -1879,14 +1879,14 @@ void GoAwayFromActorTask::write(Common::MemoryWriteStreamDynamic *out) const {
// Return an integer representing the type of this task
int16 GoAwayFromActorTask::getType() const {
- return goAwayFromActorTask;
+ return kGoAwayFromActorTask;
}
//----------------------------------------------------------------------
// Determine if the specified task is equivalent to this task
bool GoAwayFromActorTask::operator == (const Task &t) const {
- if (t.getType() != goAwayFromActorTask) return false;
+ if (t.getType() != kGoAwayFromActorTask) return false;
const GoAwayFromActorTask *taskPtr = (const GoAwayFromActorTask *)&t;
@@ -1933,7 +1933,7 @@ HuntTask::HuntTask(Common::InSaveFile *in, TaskID id) : Task(in, id) {
_subTask = nullptr;
// If the flags say we have a sub task, restore it too
- if (_huntFlags & (huntGoto | huntWander))
+ if (_huntFlags & (kHuntGoto| kHuntWander))
_subTaskID = in->readSint16LE();
else
_subTaskID = NoTask;
@@ -1946,7 +1946,7 @@ void HuntTask::fixup( void ) {
// Let the base class fixup its pointers
Task::fixup();
- if (_huntFlags & (huntGoto | huntWander))
+ if (_huntFlags & (kHuntGoto| kHuntWander))
_subTask = getTaskAddress(_subTaskID);
else
_subTask = nullptr;
@@ -1960,7 +1960,7 @@ inline int32 HuntTask::archiveSize() const {
int32 size = 0;
size += Task::archiveSize() + sizeof(_huntFlags);
- if (_huntFlags & (huntGoto | huntWander)) size += sizeof(TaskID);
+ if (_huntFlags & (kHuntGoto| kHuntWander)) size += sizeof(TaskID);
return size;
}
@@ -1973,14 +1973,14 @@ void HuntTask::write(Common::MemoryWriteStreamDynamic *out) const {
out->writeByte(_huntFlags);
// If the flags say we have a sub task, store it too
- if (_huntFlags & (huntGoto | huntWander))
+ if (_huntFlags & (kHuntGoto| kHuntWander))
out->writeSint16LE(getTaskID(_subTask));
}
//----------------------------------------------------------------------
void HuntTask::abortTask() {
- if (_huntFlags & (huntWander | huntGoto)) {
+ if (_huntFlags & (kHuntWander| kHuntGoto)) {
_subTask->abortTask();
delete _subTask;
}
@@ -1994,9 +1994,9 @@ void HuntTask::abortTask() {
TaskResult HuntTask::evaluate() {
if (atTarget()) {
// If we've reached the target abort any sub tasks
- if (_huntFlags & huntWander)
+ if (_huntFlags & kHuntWander)
removeWanderTask();
- else if (_huntFlags & huntGoto)
+ else if (_huntFlags & kHuntGoto)
removeGotoTask();
return atTargetEvaluate();
@@ -2018,40 +2018,40 @@ TaskResult HuntTask::update() {
// Determine if we have reached the target
if (atTarget()) {
// If we've reached the target abort any sub tasks
- if (_huntFlags & huntWander)
+ if (_huntFlags & kHuntWander)
removeWanderTask();
- else if (_huntFlags & huntGoto)
+ else if (_huntFlags & kHuntGoto)
removeGotoTask();
return atTargetUpdate();
} else {
// If we are going to a target, determine if the goto task
// is still valid. If not, abort it.
- if ((_huntFlags & huntGoto)
+ if ((_huntFlags & kHuntGoto)
&& targetHasChanged((GotoTask *)_subTask))
removeGotoTask();
// Determine if there is a goto subtask
- if (!(_huntFlags & huntGoto)) {
+ if (!(_huntFlags & kHuntGoto)) {
GotoTask *gotoResult;
// Try to set up a goto subtask
if ((gotoResult = setupGoto()) != nullptr) {
- if (_huntFlags & huntWander) removeWanderTask();
+ if (_huntFlags & kHuntWander) removeWanderTask();
_subTask = gotoResult;
- _huntFlags |= huntGoto;
+ _huntFlags |= kHuntGoto;
} else {
// If we couldn't setup a goto task, setup a wander task
- if (!(_huntFlags & huntWander)) {
+ if (!(_huntFlags & kHuntWander)) {
if ((_subTask = new WanderTask(_stack)) != nullptr)
- _huntFlags |= huntWander;
+ _huntFlags |= kHuntWander;
}
}
}
// If there is a subtask, update it
- if ((_huntFlags & (huntGoto | huntWander)) && _subTask)
+ if ((_huntFlags & (kHuntGoto| kHuntWander)) && _subTask)
_subTask->update();
// If we're not at the target, we know the hunt task is not
@@ -2065,7 +2065,7 @@ TaskResult HuntTask::update() {
void HuntTask::removeWanderTask() {
_subTask->abortTask();
delete _subTask;
- _huntFlags &= ~huntWander;
+ _huntFlags &= ~kHuntWander;
}
//----------------------------------------------------------------------
@@ -2074,7 +2074,7 @@ void HuntTask::removeGotoTask() {
_subTask->abortTask();
delete _subTask;
_subTask = nullptr;
- _huntFlags &= ~huntGoto;
+ _huntFlags &= ~kHuntGoto;
}
/* ===================================================================== *
@@ -2188,14 +2188,14 @@ void HuntToBeNearLocationTask::write(Common::MemoryWriteStreamDynamic *out) cons
// Return an integer representing the type of this task
int16 HuntToBeNearLocationTask::getType() const {
- return huntToBeNearLocationTask;
+ return kHuntToBeNearLocationTask;
}
//----------------------------------------------------------------------
// Determine if the specified task is equivalent to this task
bool HuntToBeNearLocationTask::operator == (const Task &t) const {
- if (t.getType() != huntToBeNearLocationTask) return false;
+ if (t.getType() != kHuntToBeNearLocationTask) return false;
const HuntToBeNearLocationTask *taskPtr = (const HuntToBeNearLocationTask *)&t;
@@ -2214,7 +2214,7 @@ void HuntToBeNearLocationTask::evaluateTarget() {
_currentTarget =
getTarget()->where(a->world(), a->getLocation());
- _targetEvaluateCtr = targetEvaluateRate;
+ _targetEvaluateCtr = kTargetEvaluateRate;
}
_targetEvaluateCtr--;
}
@@ -2369,14 +2369,14 @@ void HuntToBeNearObjectTask::write(Common::MemoryWriteStreamDynamic *out) const
// Return an integer representing the type of this task
int16 HuntToBeNearObjectTask::getType() const {
- return huntToBeNearObjectTask;
+ return kHuntToBeNearObjectTask;
}
//----------------------------------------------------------------------
// Determine if the specified task is equivalent to this task
bool HuntToBeNearObjectTask::operator == (const Task &t) const {
- if (t.getType() != huntToBeNearObjectTask) return false;
+ if (t.getType() != kHuntToBeNearObjectTask) return false;
const HuntToBeNearObjectTask *taskPtr = (const HuntToBeNearObjectTask *)&t;
@@ -2420,7 +2420,7 @@ void HuntToBeNearObjectTask::evaluateTarget() {
}
}
- _targetEvaluateCtr = targetEvaluateRate;
+ _targetEvaluateCtr = kTargetEvaluateRate;
}
// Decrement the target reevaluate _counter
@@ -2499,14 +2499,14 @@ void HuntToPossessTask::write(Common::MemoryWriteStreamDynamic *out) const {
// Return an integer representing the type of this task
int16 HuntToPossessTask::getType() const {
- return huntToPossessTask;
+ return kHuntToPossessTask;
}
//----------------------------------------------------------------------
// Determine if the specified task is equivalent to this task
bool HuntToPossessTask::operator == (const Task &t) const {
- if (t.getType() != huntToPossessTask) return false;
+ if (t.getType() != kHuntToPossessTask) return false;
const HuntToPossessTask *taskPtr = (const HuntToPossessTask *)&t;
@@ -2549,7 +2549,7 @@ void HuntToPossessTask::evaluateTarget() {
}
}
- _targetEvaluateCtr = targetEvaluateRate;
+ _targetEvaluateCtr = kTargetEvaluateRate;
}
// Decrement the target reevaluate _counter
@@ -2599,7 +2599,7 @@ HuntActorTask::HuntActorTask(
const ActorTarget &at,
bool trackFlag) :
HuntTask(ts),
- _flags(trackFlag ? track : 0),
+ _flags(trackFlag ? kTrack : 0),
_currentTarget(nullptr) {
assert(at.size() <= sizeof(_targetMem));
debugC(2, kDebugTasks, " - HuntActorTask");
@@ -2666,14 +2666,14 @@ GotoTask *HuntActorTask::setupGoto() {
// If there is an actor to goto, setup a GotoActorTask, else
// return NULL
/* return _currentTarget
- ? new GotoActorTask( stack, _currentTarget, flags & track )
+ ? new GotoActorTask( stack, _currentTarget, flags & kTrack )
: NULL;
*/
if (_currentTarget != nullptr) {
return new GotoActorTask(
_stack,
_currentTarget,
- _flags & track);
+ _flags & kTrack);
}
return nullptr;
@@ -2753,14 +2753,14 @@ void HuntToBeNearActorTask::write(Common::MemoryWriteStreamDynamic *out) const {
// Return an integer representing the type of this task
int16 HuntToBeNearActorTask::getType() const {
- return huntToBeNearActorTask;
+ return kHuntToBeNearActorTask;
}
//----------------------------------------------------------------------
// Determine if the specified task is equivalent to this task
bool HuntToBeNearActorTask::operator == (const Task &t) const {
- if (t.getType() != huntToBeNearActorTask) return false;
+ if (t.getType() != kHuntToBeNearActorTask) return false;
const HuntToBeNearActorTask *taskPtr = (const HuntToBeNearActorTask *)&t;
@@ -2808,7 +2808,7 @@ void HuntToBeNearActorTask::evaluateTarget() {
}
}
- _targetEvaluateCtr = targetEvaluateRate;
+ _targetEvaluateCtr = kTargetEvaluateRate;
}
// Decrement the target reevaluation _counter.
@@ -2852,7 +2852,7 @@ TaskResult HuntToBeNearActorTask::atTargetEvaluate() {
TilePoint _targetLoc = currentTargetLoc();
// If we're not TOO close, we're done
- if (_stack->getActor()->inRange(_targetLoc, tooClose))
+ if (_stack->getActor()->inRange(_targetLoc, kTooClose))
return kTaskNotDone;
if (_goAway != nullptr) {
@@ -2871,7 +2871,7 @@ TaskResult HuntToBeNearActorTask::atTargetUpdate() {
TilePoint _targetLoc = currentTargetLoc();
// Determine if we're TOO close
- if (a->inRange(_targetLoc, tooClose)) {
+ if (a->inRange(_targetLoc, kTooClose)) {
// Setup a go away task if necessary and update it
if (_goAway == nullptr) {
_goAway = new GoAwayFromObjectTask(_stack, _currentTarget);
@@ -2906,7 +2906,7 @@ HuntToKillTask::HuntToKillTask(
HuntActorTask(ts, at, trackFlag),
_targetEvaluateCtr(0),
_specialAttackCtr(10),
- _flags(evalWeapon) {
+ _flags(kEvalWeapon) {
debugC(2, kDebugTasks, " - HuntToKillTask");
Actor *a = _stack->getActor();
@@ -2952,14 +2952,14 @@ void HuntToKillTask::write(Common::MemoryWriteStreamDynamic *out) const {
// Return an integer representing the type of this task
int16 HuntToKillTask::getType() const {
- return huntToKillTask;
+ return kHuntToKillTask;
}
//----------------------------------------------------------------------
// Determine if the specified task is equivalent to this task
bool HuntToKillTask::operator == (const Task &t) const {
- if (t.getType() != huntToKillTask) return false;
+ if (t.getType() != kHuntToKillTask) return false;
const HuntToKillTask *taskPtr = (const HuntToKillTask *)&t;
@@ -2999,9 +2999,9 @@ TaskResult HuntToKillTask::update() {
void HuntToKillTask::evaluateTarget() {
Actor *a = _stack->getActor();
- if (_flags & evalWeapon && a->isInterruptable()) {
+ if (_flags & kEvalWeapon && a->isInterruptable()) {
evaluateWeapon();
- _flags &= ~evalWeapon;
+ _flags &= ~kEvalWeapon;
}
@@ -3142,9 +3142,9 @@ void HuntToKillTask::evaluateTarget() {
a->_currentTarget = _currentTarget;
}
- _flags |= evalWeapon;
+ _flags |= kEvalWeapon;
- _targetEvaluateCtr = targetEvaluateRate;
+ _targetEvaluateCtr = kTargetEvaluateRate;
}
// Decrement the target reevaluation _counter
@@ -3185,7 +3185,7 @@ TaskResult HuntToKillTask::atTargetUpdate() {
// If we're ready to attack, attack
if (a->isInterruptable() && g_vm->_rnd->getRandomNumber(7) == 0) {
a->attack(_currentTarget);
- _flags |= evalWeapon;
+ _flags |= kEvalWeapon;
}
return kTaskNotDone;
@@ -3255,7 +3255,7 @@ void HuntToKillTask::evaluateWeapon() {
if (weaponRating == 0) continue;
if (obj == currentWeapon)
- weaponRating += currentWeaponBonus;
+ weaponRating += kCurrentWeaponBonus;
if (weaponRating > bestWeaponRating) {
bestWeaponRating = weaponRating;
@@ -3318,14 +3318,14 @@ void HuntToGiveTask::write(Common::MemoryWriteStreamDynamic *out) const {
// Return an integer representing the type of this task
int16 HuntToGiveTask::getType() const {
- return huntToGiveTask;
+ return kHuntToGiveTask;
}
//----------------------------------------------------------------------
// Determine if the specified task is equivalent to this task
bool HuntToGiveTask::operator == (const Task &t) const {
- if (t.getType() != huntToGiveTask) return false;
+ if (t.getType() != kHuntToGiveTask) return false;
const HuntToGiveTask *taskPtr = (const HuntToGiveTask *)&t;
@@ -3476,14 +3476,14 @@ void BandTask::write(Common::MemoryWriteStreamDynamic *out) const {
// Return an integer representing the type of this task
int16 BandTask::getType() const {
- return bandTask;
+ return kBandTask;
}
//----------------------------------------------------------------------
// Determine if the specified task is equivalent to this task
bool BandTask::operator == (const Task &t) const {
- return t.getType() == bandTask;
+ return t.getType() == kBandTask;
}
//----------------------------------------------------------------------
@@ -3561,7 +3561,7 @@ void BandTask::evaluateTarget() {
_currentTarget = actorLoc + movementVector;
_currentTarget.z = leader->getLocation().z;
- _targetEvaluateCtr = targetEvaluateRate;
+ _targetEvaluateCtr = kTargetEvaluateRate;
}
_targetEvaluateCtr--;
@@ -3752,14 +3752,14 @@ bool BandTask::BandAndAvoidEnemiesRepulsorIterator::next(
// Return an integer representing the type of this task
int16 BandAndAvoidEnemiesTask::getType() const {
- return bandAndAvoidEnemiesTask;
+ return kBandAndAvoidEnemiesTask;
}
//----------------------------------------------------------------------
// Determine if the specified task is equivalent to this task
bool BandAndAvoidEnemiesTask::operator == (const Task &t) const {
- return t.getType() == bandAndAvoidEnemiesTask;
+ return t.getType() == kBandAndAvoidEnemiesTask;
}
//----------------------------------------------------------------------
@@ -3853,7 +3853,7 @@ void FollowPatrolRouteTask::write(Common::MemoryWriteStreamDynamic *out) const {
// Return an integer representing the type of this task
int16 FollowPatrolRouteTask::getType() const {
- return followPatrolRouteTask;
+ return kFollowPatrolRouteTask;
}
//----------------------------------------------------------------------
@@ -3885,7 +3885,7 @@ TaskResult FollowPatrolRouteTask::update() {
// Determine if the specified task is equivalent to this task
bool FollowPatrolRouteTask::operator == (const Task &t) const {
- if (t.getType() != followPatrolRouteTask) return false;
+ if (t.getType() != kFollowPatrolRouteTask) return false;
const FollowPatrolRouteTask *taskPtr = (const FollowPatrolRouteTask *)&t;
@@ -4012,7 +4012,7 @@ void AttendTask::write(Common::MemoryWriteStreamDynamic *out) const {
// Return an integer representing the type of this task
int16 AttendTask::getType() const {
- return attendTask;
+ return kAttendTask;
}
//----------------------------------------------------------------------
@@ -4052,7 +4052,7 @@ TaskResult AttendTask::update() {
// Determine if the specified task is equivalent to this task
bool AttendTask::operator == (const Task &t) const {
- if (t.getType() != attendTask) return false;
+ if (t.getType() != kAttendTask) return false;
const AttendTask *taskPtr = (const AttendTask *)&t;
diff --git a/engines/saga2/task.h b/engines/saga2/task.h
index 5fce350ee94..79163cee374 100644
--- a/engines/saga2/task.h
+++ b/engines/saga2/task.h
@@ -31,30 +31,30 @@
namespace Saga2 {
-const int defaultEvalRate = 10;
+const int kDefaultEvalRate = 10;
-const size_t maxTaskSize = 48;
+const size_t kMaxTaskSize = 48;
// Integers representing task types
enum TaskType {
- wanderTask,
- tetheredWanderTask,
- gotoLocationTask,
- gotoRegionTask,
- gotoObjectTask,
- gotoActorTask,
- goAwayFromObjectTask,
- goAwayFromActorTask,
- huntToBeNearLocationTask,
- huntToBeNearObjectTask,
- huntToPossessTask,
- huntToBeNearActorTask,
- huntToKillTask,
- huntToGiveTask,
- bandTask,
- bandAndAvoidEnemiesTask,
- followPatrolRouteTask,
- attendTask
+ kWanderTask,
+ kTetheredWanderTask,
+ kGotoLocationTask,
+ kGotoRegionTask,
+ kGotoObjectTask,
+ kGotoActorTask,
+ kGoAwayFromObjectTask,
+ kGoAwayFromActorTask,
+ kHuntToBeNearLocationTask,
+ kHuntToBeNearObjectTask,
+ kHuntToPossessTask,
+ kHuntToBeNearActorTask,
+ kHuntToKillTask,
+ kHuntToGiveTask,
+ kBandTask,
+ kBandAndAvoidEnemiesTask,
+ kFollowPatrolRouteTask,
+ kAttendTask
};
/* ===================================================================== *
@@ -433,13 +433,13 @@ class GotoObjectTargetTask : public GotoTask {
uint8 _flags;
enum {
- track = (1 << 0),
- inSight = (1 << 1)
+ kTrack = (1 << 0),
+ kInSight = (1 << 1)
};
// static const doesn't work in Visual C++
enum {
- sightRate = 16
+ kSightRate = 16
};
// static const int16 sightRate = 16;
@@ -452,7 +452,7 @@ public:
GotoTask(ts),
_lastTestedLoc(Nowhere),
_sightCtr(0),
- _flags(trackFlag ? track : 0),
+ _flags(trackFlag ? kTrack : 0),
_lastKnownLoc(Nowhere) {
debugC(2, kDebugTasks, " - GotoObjectTargetTask");
_type = "GotoObjectTargetTask";
@@ -475,10 +475,10 @@ private:
protected:
bool tracking() const {
- return (_flags & track) != 0;
+ return (_flags & kTrack) != 0;
}
bool isInSight() const {
- return (_flags & inSight) != 0;
+ return (_flags & kInSight) != 0;
}
};
@@ -575,7 +575,7 @@ class GoAwayFromTask : public Task {
uint8 _flags;
enum {
- run = (1 << 0)
+ kRun = (1 << 0)
};
public:
@@ -593,7 +593,7 @@ public:
Task(ts),
_goTask(NULL),
_goTaskID(NoTask),
- _flags(runFlag ? run : 0) {
+ _flags(runFlag ? kRun : 0) {
debugC(2, kDebugTasks, " - GoAwayFromTask2");
_type = "GoAwayFromTask";
}
@@ -696,8 +696,8 @@ class HuntTask : public Task {
uint8 _huntFlags;
enum HuntFlags {
- huntWander = (1 << 0), // Indicates that subtask is a wander task
- huntGoto = (1 << 1) // Indicates that subtask is a goto task
+ kHuntWander = (1 << 0), // Indicates that subtask is a wander task
+ kHuntGoto = (1 << 1) // Indicates that subtask is a goto task
};
public:
@@ -782,9 +782,9 @@ class HuntToBeNearLocationTask : public HuntLocationTask {
// static const doesn't work in Visual C++
enum {
- targetEvaluateRate = 64
+ kTargetEvaluateRate = 64
};
-// static const uint8 targetEvaluateRate;
+// static const uint8 kTargetEvaluateRate;
public:
// Constructor -- initial construction
@@ -824,7 +824,7 @@ protected:
}
};
-//const uint8 HuntToBeNearLocationTask::targetEvaluateRate = 64;
+//const uint8 HuntToBeNearLocationTask::kTargetEvaluateRate = 64;
/* ===================================================================== *
HuntObjectTask Class
@@ -868,9 +868,9 @@ class HuntToBeNearObjectTask : public HuntObjectTask {
uint8 _targetEvaluateCtr;
enum {
- targetEvaluateRate = 64
+ kTargetEvaluateRate = 64
};
-// static const uint8 targetEvaluateRate;
+// static const uint8 kTargetEvaluateRate;
public:
// Constructor -- initial construction
@@ -913,7 +913,7 @@ protected:
}
};
-//const uint8 HuntToBeNearObjectTask::targetEvaluateRate = 64;
+//const uint8 HuntToBeNearObjectTask::kTargetEvaluateRate = 64;
/* ===================================================================== *
HuntToPossessTask Class
@@ -923,9 +923,9 @@ class HuntToPossessTask : public HuntObjectTask {
uint8 _targetEvaluateCtr;
enum {
- targetEvaluateRate = 64
+ kTargetEvaluateRate = 64
};
-// static const uint8 targetEvaluateRate;
+// static const uint8 kTargetEvaluateRate;
bool _grabFlag;
@@ -962,7 +962,7 @@ protected:
TaskResult atTargetUpdate();
};
-//const uint8 HuntToPossessTask::targetEvaluateRate = 16;
+//const uint8 HuntToPossessTask::kTargetEvaluateRate = 16;
/* ===================================================================== *
HuntActorTask Class
@@ -973,7 +973,7 @@ class HuntActorTask : public HuntTask {
uint8 _flags;
enum {
- track = (1 << 0)
+ kTrack = (1 << 0)
};
protected:
@@ -1004,7 +1004,7 @@ protected:
}
bool tracking() const {
- return (_flags & track) != 0;
+ return (_flags & kTrack) != 0;
}
};
@@ -1020,14 +1020,14 @@ class HuntToBeNearActorTask : public HuntActorTask {
uint8 _targetEvaluateCtr;
enum {
- targetEvaluateRate = 16
+ kTargetEvaluateRate = 16
};
-// static const uint8 targetEvaluateRate;
+// static const uint8 kTargetEvaluateRate;
public:
enum {
- tooClose = 12
+ kTooClose = 12
};
// Constructor -- initial construction
@@ -1076,7 +1076,7 @@ protected:
}
};
-//const uint8 HuntToBeNearActorTask::targetEvaluateRate = 64;
+//const uint8 HuntToBeNearActorTask::kTargetEvaluateRate = 64;
/* ===================================================================== *
HuntToKillTask Class
@@ -1087,19 +1087,19 @@ class HuntToKillTask : public HuntActorTask {
uint8 _specialAttackCtr;
enum {
- targetEvaluateRate = 16
+ kTargetEvaluateRate = 16
};
enum {
- currentWeaponBonus = 1
+ kCurrentWeaponBonus = 1
};
uint8 _flags;
enum {
- evalWeapon = (1 << 0)
+ kEvalWeapon = (1 << 0)
};
-// static const uint8 targetEvaluateRate;
+// static const uint8 kTargetEvaluateRate;
public:
// Constructor -- initial construction
@@ -1137,7 +1137,7 @@ private:
void evaluateWeapon();
};
-//const uint8 HuntToKillTask::targetEvaluateRate = 16;
+//const uint8 HuntToKillTask::kTargetEvaluateRate = 16;
// Utility function used for combat target selection
inline int16 closenessScore(int16 dist) {
@@ -1201,7 +1201,7 @@ class BandTask : public HuntTask {
uint8 _targetEvaluateCtr;
enum {
- targetEvaluateRate = 2
+ kTargetEvaluateRate = 2
};
public:
@@ -1524,8 +1524,8 @@ class ParryTask : public Task {
uint8 _flags;
enum {
- motionStarted = (1 << 0),
- blockStarted = (1 << 1)
+ kMotionStarted = (1 << 0),
+ kBlockStarted = (1 << 1)
};
public:
@@ -1579,8 +1579,8 @@ public:
TaskStack(Actor *a) :
_stackBottomID(NoTask),
_actor(a),
- _evalCount(defaultEvalRate),
- _evalRate(defaultEvalRate) {
+ _evalCount(kDefaultEvalRate),
+ _evalRate(kDefaultEvalRate) {
newTaskStack(this);
}
More information about the Scummvm-git-logs
mailing list