From d4282fca9d8d4bc355409727c1da54e66318460d Mon Sep 17 00:00:00 2001 From: Martin Gerhardy Date: Thu, 18 Mar 2021 20:31:44 +0100 Subject: [PATCH] TWINE: reduce visibility --- engines/twine/renderer/renderer.h | 10 +++++----- engines/twine/scene/animations.cpp | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/engines/twine/renderer/renderer.h b/engines/twine/renderer/renderer.h index d434f117124..870f5adb142 100644 --- a/engines/twine/renderer/renderer.h +++ b/engines/twine/renderer/renderer.h @@ -117,11 +117,6 @@ private: const int16 numVertices = READ_LE_INT16(verticesBase); return verticesBase + 2 + numVertices * 6; } -public: - static inline bool isAnimated(const uint8 *bodyPtr) { - const int16 bodyHeader = READ_LE_INT16(bodyPtr); - return (bodyHeader & 2) != 0; - } static uint8 *getData(uint8 *bodyPtr) { return bodyPtr + 0x1A; @@ -130,6 +125,11 @@ public: static const uint8 *getData(const uint8 *bodyPtr) { return bodyPtr + 0x1A; } +public: + static inline bool isAnimated(const uint8 *bodyPtr) { + const int16 bodyHeader = READ_LE_INT16(bodyPtr); + return (bodyHeader & 2) != 0; + } static const uint8 *getVerticesBaseData(const uint8 *bodyPtr) { return getData(bodyPtr) + 2; diff --git a/engines/twine/scene/animations.cpp b/engines/twine/scene/animations.cpp index 44ff927b97e..97bfc35a43f 100644 --- a/engines/twine/scene/animations.cpp +++ b/engines/twine/scene/animations.cpp @@ -56,6 +56,7 @@ Animations::Animations(TwinEEngine *engine) : _engine(engine) { int32 Animations::getBodyAnimIndex(AnimationTypes animIdx, int32 actorIdx) { ActorStruct *actor = _engine->_scene->getActor(actorIdx); + // TODO: cache this EntityData entityData; entityData.loadFromBuffer(actor->entityDataPtr, actor->entityDataSize); const int32 bodyAnimIndex = entityData.getAnimIndex(animIdx); @@ -272,6 +273,7 @@ void Animations::processAnimActions(int32 actorIdx) { return; } + // TODO: cache this EntityData entityData; entityData.loadFromBuffer(actor->entityDataPtr, actor->entityDataSize); const Common::Array *actions = entityData.getActions(actor->animExtraPtr);