From 1c9377ed93dd378b5b6b905e8ee9384bd91d4966 Mon Sep 17 00:00:00 2001 From: Martin Gerhardy Date: Tue, 10 Aug 2021 11:15:49 +0200 Subject: [PATCH] TWINE: converted enum to enum class --- engines/twine/parser/entity.cpp | 4 ++-- engines/twine/parser/entity.h | 2 +- engines/twine/shared.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/engines/twine/parser/entity.cpp b/engines/twine/parser/entity.cpp index 52abdda188c..3b7204a27d6 100644 --- a/engines/twine/parser/entity.cpp +++ b/engines/twine/parser/entity.cpp @@ -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(); diff --git a/engines/twine/parser/entity.h b/engines/twine/parser/entity.h index f94efec6284..47e673bd905 100644 --- a/engines/twine/parser/entity.h +++ b/engines/twine/parser/entity.h @@ -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; diff --git a/engines/twine/shared.h b/engines/twine/shared.h index e14073212b6..3a30c0cb785 100644 --- a/engines/twine/shared.h +++ b/engines/twine/shared.h @@ -133,7 +133,7 @@ struct ActorBoundingBox { bool hasBoundingBox = false; }; -enum ActionType { +enum class ActionType : uint8 { ACTION_NOP = 0, ACTION_BODY = 1, ACTION_BODP = 2,