SAGA2: Rename enums in sprite.h
This commit is contained in:
parent
a185be3b64
commit
98508c2bfb
5 changed files with 73 additions and 73 deletions
|
@ -2086,7 +2086,7 @@ bool Actor::isActionAvailable(int16 newState, bool anyDir) {
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (anyDir) {
|
if (anyDir) {
|
||||||
for (int i = 0; i < numPoseFacings; i++) {
|
for (int i = 0; i < kNumPoseFacings; i++) {
|
||||||
if (anim->count[i] > 0) return true;
|
if (anim->count[i] > 0) return true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -257,7 +257,7 @@ void DisplayNodeList::buildObjects(bool fromScratch) {
|
||||||
// actor's appearance.
|
// actor's appearance.
|
||||||
if (a->_appearance == nullptr) {
|
if (a->_appearance == nullptr) {
|
||||||
a->_appearance =
|
a->_appearance =
|
||||||
LoadActorAppearance(a->_appearanceID, sprStandBank);
|
LoadActorAppearance(a->_appearanceID, kSprStandBank);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -643,7 +643,7 @@ void DisplayNode::drawObject() {
|
||||||
if (a->_leftHandObject != Nothing) {
|
if (a->_leftHandObject != Nothing) {
|
||||||
partCount++;
|
partCount++;
|
||||||
|
|
||||||
if (poseFlags & ActorPose::leftObjectInFront) {
|
if (poseFlags & ActorPose::kLeftObjectInFront) {
|
||||||
leftIndex = 1;
|
leftIndex = 1;
|
||||||
} else {
|
} else {
|
||||||
leftIndex = 0;
|
leftIndex = 0;
|
||||||
|
@ -654,9 +654,9 @@ void DisplayNode::drawObject() {
|
||||||
if (a->_rightHandObject != Nothing) {
|
if (a->_rightHandObject != Nothing) {
|
||||||
partCount++;
|
partCount++;
|
||||||
|
|
||||||
if (poseFlags & ActorPose::rightObjectInFront) {
|
if (poseFlags & ActorPose::kRightObjectInFront) {
|
||||||
if (leftIndex == 1
|
if (leftIndex == 1
|
||||||
&& poseFlags & ActorPose::leftOverRight) {
|
&& poseFlags & ActorPose::kLeftOverRight) {
|
||||||
leftIndex = 2;
|
leftIndex = 2;
|
||||||
rightIndex = 1;
|
rightIndex = 1;
|
||||||
} else {
|
} else {
|
||||||
|
@ -664,7 +664,7 @@ void DisplayNode::drawObject() {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (leftIndex == 0
|
if (leftIndex == 0
|
||||||
&& poseFlags & ActorPose::leftOverRight) {
|
&& poseFlags & ActorPose::kLeftOverRight) {
|
||||||
rightIndex = 0;
|
rightIndex = 0;
|
||||||
leftIndex = 1;
|
leftIndex = 1;
|
||||||
bodyIndex = 2;
|
bodyIndex = 2;
|
||||||
|
@ -693,7 +693,7 @@ void DisplayNode::drawObject() {
|
||||||
// Color remapping info
|
// Color remapping info
|
||||||
sc->colorTable = mainColors;
|
sc->colorTable = mainColors;
|
||||||
// sc->colorTable = aa->schemeList ? mainColors : identityColors;
|
// sc->colorTable = aa->schemeList ? mainColors : identityColors;
|
||||||
sc->flipped = (poseFlags & ActorPose::actorFlipped);
|
sc->flipped = (poseFlags & ActorPose::kActorFlipped);
|
||||||
|
|
||||||
assert(sc->sp != nullptr);
|
assert(sc->sp != nullptr);
|
||||||
assert(sc->sp->size.x > 0);
|
assert(sc->sp->size.x > 0);
|
||||||
|
@ -720,7 +720,7 @@ void DisplayNode::drawObject() {
|
||||||
assert(sc->offset.y < 1000);
|
assert(sc->offset.y < 1000);
|
||||||
assert(sc->offset.y > -1000);
|
assert(sc->offset.y > -1000);
|
||||||
sc->colorTable = leftColors;
|
sc->colorTable = leftColors;
|
||||||
sc->flipped = (poseFlags & ActorPose::leftObjectFlipped);
|
sc->flipped = (poseFlags & ActorPose::kLeftObjectFlipped);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we were carrying something in the right hand,
|
// 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);
|
||||||
assert(sc->offset.y > -1000);
|
assert(sc->offset.y > -1000);
|
||||||
sc->colorTable = rightColors;
|
sc->colorTable = rightColors;
|
||||||
sc->flipped = (poseFlags & ActorPose::rightObjectFlipped);
|
sc->flipped = (poseFlags & ActorPose::kRightObjectFlipped);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -757,12 +757,12 @@ void DisplayNode::drawObject() {
|
||||||
int16 effectFlags = 0;
|
int16 effectFlags = 0;
|
||||||
bool obscured;
|
bool obscured;
|
||||||
|
|
||||||
if (ghostIt) effectFlags |= sprFXGhosted;
|
if (ghostIt) effectFlags |= kSprFXGhosted;
|
||||||
|
|
||||||
if (obj->isSightedByCenter() && objRoofRipped(obj))
|
if (obj->isSightedByCenter() && objRoofRipped(obj))
|
||||||
effectFlags |= sprFXGhostIfObscured;
|
effectFlags |= kSprFXGhostIfObscured;
|
||||||
|
|
||||||
effectFlags |= sprFXTerrainMask;
|
effectFlags |= kSprFXTerrainMask;
|
||||||
|
|
||||||
DrawCompositeMaskedSprite(
|
DrawCompositeMaskedSprite(
|
||||||
g_vm->_backPort,
|
g_vm->_backPort,
|
||||||
|
@ -773,7 +773,7 @@ void DisplayNode::drawObject() {
|
||||||
effectFlags,
|
effectFlags,
|
||||||
&obscured);
|
&obscured);
|
||||||
|
|
||||||
if (effectFlags & sprFXGhostIfObscured)
|
if (effectFlags & kSprFXGhostIfObscured)
|
||||||
obj->setObscured(obscured);
|
obj->setObscured(obscured);
|
||||||
|
|
||||||
// Record the extent box that the sprite was drawn
|
// 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);
|
spr = ss->sprite(a->_poseInfo.actorFrameIndex);
|
||||||
flipped =
|
flipped =
|
||||||
(a->_poseInfo.flags & ActorPose::actorFlipped) ? 1 : 0;
|
(a->_poseInfo.flags & ActorPose::kActorFlipped) ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetSpritePixel(spr, flipped, testPoint)) {
|
if (GetSpritePixel(spr, flipped, testPoint)) {
|
||||||
|
@ -1000,7 +1000,7 @@ void Effectron::drawEffect() {
|
||||||
objCoords,
|
objCoords,
|
||||||
((obscured) && //objectFlags & GameObject::kObjectObscured ) &&
|
((obscured) && //objectFlags & GameObject::kObjectObscured ) &&
|
||||||
0
|
0
|
||||||
? sprFXGhosted : sprFXTerrainMask));
|
? kSprFXGhosted : kSprFXTerrainMask));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2421,9 +2421,9 @@ void MotionTask::walkAction() {
|
||||||
// If we can see this actor, and the actor's run frames
|
// If we can see this actor, and the actor's run frames
|
||||||
// have not been loaded, then downgrade this action to
|
// have not been loaded, then downgrade this action to
|
||||||
// a walk (but request the run frames).
|
// a walk (but request the run frames).
|
||||||
if (aa && !aa->isBankLoaded(sprRunBankNum)) {
|
if (aa && !aa->isBankLoaded(kSprRunBankNum)) {
|
||||||
walkType = walkNormal;
|
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
|
// If we can see this actor, and this actor's walk
|
||||||
// frames have not been loaded, then downgrade this
|
// frames have not been loaded, then downgrade this
|
||||||
// action to a stand (i.e. do nothing).
|
// action to a stand (i.e. do nothing).
|
||||||
if (aa && !aa->isBankLoaded(sprWalkBankNum)) {
|
if (aa && !aa->isBankLoaded(kSprWalkBankNum)) {
|
||||||
aa->requestBank(sprWalkBankNum);
|
aa->requestBank(kSprWalkBankNum);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -242,8 +242,8 @@ void DrawCompositeMaskedSprite(
|
||||||
}
|
}
|
||||||
|
|
||||||
// do terrain masking
|
// do terrain masking
|
||||||
if (effects & sprFXTerrainMask) {
|
if (effects & kSprFXTerrainMask) {
|
||||||
if (!(effects & sprFXGhostIfObscured)) {
|
if (!(effects & kSprFXGhostIfObscured)) {
|
||||||
drawTileMask(
|
drawTileMask(
|
||||||
Point16(xMin, yMin),
|
Point16(xMin, yMin),
|
||||||
compMap,
|
compMap,
|
||||||
|
@ -275,7 +275,7 @@ void DrawCompositeMaskedSprite(
|
||||||
isObscured = visiblePixels <= 10;
|
isObscured = visiblePixels <= 10;
|
||||||
if (isObscured) {
|
if (isObscured) {
|
||||||
memcpy(compMap._data, tempMap._data, compMapBytes);
|
memcpy(compMap._data, tempMap._data, compMapBytes);
|
||||||
effects |= sprFXGhosted;
|
effects |= kSprFXGhosted;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obscured != nullptr) *obscured = isObscured;
|
if (obscured != nullptr) *obscured = isObscured;
|
||||||
|
@ -298,7 +298,7 @@ void DrawCompositeMaskedSprite(
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add in "ghost" effects
|
// Add in "ghost" effects
|
||||||
if (effects & sprFXGhosted) {
|
if (effects & kSprFXGhosted) {
|
||||||
uint32 *dstRow = (uint32 *)compMap._data;
|
uint32 *dstRow = (uint32 *)compMap._data;
|
||||||
|
|
||||||
uint32 mask = (yMin & 1) ? 0xff00ff00 : 0x00ff00ff;
|
uint32 mask = (yMin & 1) ? 0xff00ff00 : 0x00ff00ff;
|
||||||
|
@ -573,13 +573,13 @@ void ActorAppearance::loadSpriteBanks(int16 banksNeeded) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ActorAnimation::ActorAnimation(Common::SeekableReadStream *stream) {
|
ActorAnimation::ActorAnimation(Common::SeekableReadStream *stream) {
|
||||||
for (int i = 0; i < numPoseFacings; i++)
|
for (int i = 0; i < kNumPoseFacings; i++)
|
||||||
start[i] = stream->readUint16LE();
|
start[i] = stream->readUint16LE();
|
||||||
|
|
||||||
for (int i = 0; i < numPoseFacings; i++)
|
for (int i = 0; i < kNumPoseFacings; i++)
|
||||||
count[i] = stream->readUint16LE();
|
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]);
|
debugC(2, kDebugLoading, "anim%d: start: %d count: %d", i, start[i], count[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,18 +84,18 @@ extern SpriteSet *objectSprites, // object sprites
|
||||||
* ===================================================================== */
|
* ===================================================================== */
|
||||||
|
|
||||||
enum spriteFacingDirections {
|
enum spriteFacingDirections {
|
||||||
sprFaceDown = 0,
|
kSprFaceDown = 0,
|
||||||
sprFaceDownLeft,
|
kSprFaceDownLeft,
|
||||||
sprFaceLeft,
|
kSprFaceLeft,
|
||||||
sprFaceUpLeft,
|
kSprFaceUpLeft,
|
||||||
sprFaceUp
|
kSprFaceUp
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ===================================================================== *
|
/* ===================================================================== *
|
||||||
ActorPose: Describes an element of a choreographed action
|
ActorPose: Describes an element of a choreographed action
|
||||||
* ===================================================================== */
|
* ===================================================================== */
|
||||||
|
|
||||||
const int numPoseFacings = 8;
|
const int kNumPoseFacings = 8;
|
||||||
|
|
||||||
// Describes a single entry in an actor sequence
|
// Describes a single entry in an actor sequence
|
||||||
|
|
||||||
|
@ -107,15 +107,15 @@ struct ActorPose {
|
||||||
// Indicates which of the sprites should be drawn flipped
|
// Indicates which of the sprites should be drawn flipped
|
||||||
// left-to-right
|
// left-to-right
|
||||||
|
|
||||||
actorFlipped = (1 << 0), // actor spr flipped left/right
|
kActorFlipped = (1 << 0), // actor spr flipped left/right
|
||||||
leftObjectFlipped = (1 << 1), // left hand object flipped
|
kLeftObjectFlipped = (1 << 1), // left hand object flipped
|
||||||
rightObjectFlipped = (1 << 2), // right hand object flipped
|
kRightObjectFlipped = (1 << 2), // right hand object flipped
|
||||||
|
|
||||||
// Indicates the front-to-back priority of the objects
|
// Indicates the front-to-back priority of the objects
|
||||||
|
|
||||||
leftObjectInFront = (1 << 3), // left object in front of actor
|
kLeftObjectInFront = (1 << 3), // left object in front of actor
|
||||||
rightObjectInFront = (1 << 4), // right object in front of actor
|
kRightObjectInFront = (1 << 4), // right object in front of actor
|
||||||
leftOverRight = (1 << 5) // left in front of right
|
kLeftOverRight = (1 << 5) // left in front of right
|
||||||
};
|
};
|
||||||
|
|
||||||
uint16 flags; // sequence element flags
|
uint16 flags; // sequence element flags
|
||||||
|
@ -145,8 +145,8 @@ struct ActorAnimation {
|
||||||
// table of poses for that sequence, and the number of poses
|
// table of poses for that sequence, and the number of poses
|
||||||
// in the sequence.
|
// in the sequence.
|
||||||
|
|
||||||
uint16 start[numPoseFacings];
|
uint16 start[kNumPoseFacings];
|
||||||
uint16 count[numPoseFacings];
|
uint16 count[kNumPoseFacings];
|
||||||
|
|
||||||
ActorAnimation(Common::SeekableReadStream *stream);
|
ActorAnimation(Common::SeekableReadStream *stream);
|
||||||
|
|
||||||
|
@ -200,9 +200,9 @@ struct SpriteComponent {
|
||||||
};
|
};
|
||||||
|
|
||||||
enum spriteEffectFlags {
|
enum spriteEffectFlags {
|
||||||
sprFXGhosted = (1 << 0), // semi-translucent dither
|
kSprFXGhosted = (1 << 0), // semi-translucent dither
|
||||||
sprFXTerrainMask = (1 << 1), // mask sprite to terrain
|
kSprFXTerrainMask = (1 << 1), // mask sprite to terrain
|
||||||
sprFXGhostIfObscured = (1 << 2) // apply ghosted effect if
|
kSprFXGhostIfObscured = (1 << 2) // apply ghosted effect if
|
||||||
// obscured by terrain
|
// obscured by terrain
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -226,39 +226,39 @@ struct ObjectSpriteInfo {
|
||||||
// REM: I think we want more banks than this...
|
// REM: I think we want more banks than this...
|
||||||
|
|
||||||
enum spriteBankNums {
|
enum spriteBankNums {
|
||||||
sprStandBankNum = 0,
|
kSprStandBankNum = 0,
|
||||||
sprWalkBankNum,
|
kSprWalkBankNum,
|
||||||
sprRunBankNum,
|
kSprRunBankNum,
|
||||||
sprKneelBankNum,
|
kSprKneelBankNum,
|
||||||
sprLeapBankNum,
|
kSprLeapBankNum,
|
||||||
sprClimbBankNum,
|
kSprClimbBankNum,
|
||||||
sprTalkBankNum,
|
kSprTalkBankNum,
|
||||||
sprFight1HBankNum,
|
kSprFight1HBankNum,
|
||||||
sprFight2HBankNum,
|
kSprFight2HBankNum,
|
||||||
sprFireBankNum,
|
kSprFireBankNum,
|
||||||
sprPassiveBankNum,
|
kSprPassiveBankNum,
|
||||||
sprUpStairsBankNum,
|
kSprUpStairsBankNum,
|
||||||
sprDnStairsBankNum,
|
kSprDnStairsBankNum,
|
||||||
sprSitBankNum,
|
kSprSitBankNum,
|
||||||
|
|
||||||
sprBankCount
|
kSprBankCount
|
||||||
};
|
};
|
||||||
|
|
||||||
enum spriteBankBits {
|
enum spriteBankBits {
|
||||||
sprStandBank = (1 << sprStandBankNum),
|
kSprStandBank = (1 << kSprStandBankNum),
|
||||||
sprWalkBank = (1 << sprWalkBankNum),
|
kSprWalkBank = (1 << kSprWalkBankNum),
|
||||||
sprRunBank = (1 << sprRunBankNum),
|
kSprRunBank = (1 << kSprRunBankNum),
|
||||||
sprKneelBank = (1 << sprKneelBankNum),
|
kSprKneelBank = (1 << kSprKneelBankNum),
|
||||||
sprLeapBank = (1 << sprLeapBankNum),
|
kSprLeapBank = (1 << kSprLeapBankNum),
|
||||||
sprClimbBank = (1 << sprClimbBankNum),
|
kSprClimbBank = (1 << kSprClimbBankNum),
|
||||||
sprTalkBank = (1 << sprTalkBankNum),
|
kSprTalkBank = (1 << kSprTalkBankNum),
|
||||||
sprFight1HBank = (1 << sprFight1HBankNum),
|
kSprFight1HBank = (1 << kSprFight1HBankNum),
|
||||||
sprFight2HBank = (1 << sprFight2HBankNum),
|
kSprFight2HBank = (1 << kSprFight2HBankNum),
|
||||||
sprFireBank = (1 << sprFireBankNum),
|
kSprFireBank = (1 << kSprFireBankNum),
|
||||||
sprPassiveBank = (1 << sprPassiveBankNum),
|
kSprPassiveBank = (1 << kSprPassiveBankNum),
|
||||||
sprUpStairsBank = (1 << sprUpStairsBankNum),
|
kSprUpStairsBank = (1 << kSprUpStairsBankNum),
|
||||||
sprDnStairsBank = (1 << sprDnStairsBankNum),
|
kSprDnStairsBank = (1 << kSprDnStairsBankNum),
|
||||||
sprSitBank = (1 << sprSitBankNum)
|
kSprSitBank = (1 << kSprSitBankNum)
|
||||||
};
|
};
|
||||||
|
|
||||||
// This structure is used to contain all of the items needed
|
// This structure is used to contain all of the items needed
|
||||||
|
@ -276,7 +276,7 @@ public:
|
||||||
ActorAnimSet *_poseList; // list of action sequences
|
ActorAnimSet *_poseList; // list of action sequences
|
||||||
ColorSchemeList *_schemeList; // color remapping info
|
ColorSchemeList *_schemeList; // color remapping info
|
||||||
|
|
||||||
SpriteSet *_spriteBanks[sprBankCount];
|
SpriteSet *_spriteBanks[kSprBankCount];
|
||||||
|
|
||||||
void loadSpriteBanks(int16 banksNeeded);
|
void loadSpriteBanks(int16 banksNeeded);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue