TWINE: converted enum to enum class

This commit is contained in:
Martin Gerhardy 2021-08-10 11:15:49 +02:00
parent faaa0927ce
commit 1c9377ed93
3 changed files with 4 additions and 4 deletions

View File

@ -33,7 +33,7 @@ bool EntityData::loadBody(Common::SeekableReadStream &stream) {
body.bodyIndex = stream.readUint16LE();
body.actorBoundingBox.hasBoundingBox = stream.readByte();
if (body.actorBoundingBox.hasBoundingBox) {
if (stream.readByte() == ActionType::ACTION_ZV) {
if ((ActionType)stream.readByte() == ActionType::ACTION_ZV) {
body.actorBoundingBox.bbox.mins.x = stream.readSint16LE();
body.actorBoundingBox.bbox.mins.y = stream.readSint16LE();
body.actorBoundingBox.bbox.mins.z = stream.readSint16LE();
@ -56,7 +56,7 @@ bool EntityData::loadAnim(Common::SeekableReadStream &stream) {
const uint8 numActions = stream.readByte();
for (uint8 i = 0U; i < numActions; ++i) {
EntityAnim::Action action;
action.type = stream.readByte();
action.type = (ActionType)stream.readByte();
switch (action.type) {
case ActionType::ACTION_HITTING:
action.animFrame = stream.readByte();

View File

@ -42,7 +42,7 @@ struct EntityAnim {
int animIndex;
struct Action {
uint8 type = 0;
ActionType type = ActionType::ACTION_NOP;
uint8 animFrame = 0;
int16 sampleIndex = 0;
int16 frequency = 0;

View File

@ -133,7 +133,7 @@ struct ActorBoundingBox {
bool hasBoundingBox = false;
};
enum ActionType {
enum class ActionType : uint8 {
ACTION_NOP = 0,
ACTION_BODY = 1,
ACTION_BODP = 2,