[Scummvm-git-logs] scummvm master -> 17f6f2dc24fa7faa3514230ac55753680337320f
mgerhardy
noreply at scummvm.org
Tue Oct 8 08:32:00 UTC 2024
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
ad990653cc TWINE: extended imgui debugger windows
54d2e51c48 TWINE: added getter for bodydata
9bb2257e0a TWINE: added hqrindex member to the Parser class to improve the error messages
17f6f2dc24 TWINE: renamed getter
Commit: ad990653cc36ebcc453fe452b9bcc9997f84b3fd
https://github.com/scummvm/scummvm/commit/ad990653cc36ebcc453fe452b9bcc9997f84b3fd
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-10-08T10:25:04+02:00
Commit Message:
TWINE: extended imgui debugger windows
Changed paths:
engines/twine/debugger/debug_state.h
engines/twine/debugger/debugtools.cpp
engines/twine/parser/entity.h
engines/twine/shared.h
diff --git a/engines/twine/debugger/debug_state.h b/engines/twine/debugger/debug_state.h
index cb17f7b25e0..9c87e9f5d2e 100644
--- a/engines/twine/debugger/debug_state.h
+++ b/engines/twine/debugger/debug_state.h
@@ -83,6 +83,9 @@ public:
unsigned int _typeZones = 127; // all zones on as default
int16 _onlyLoadActor = -1;
const char *_openPopup = nullptr;
+ bool _holomapFlagsWindow = false;
+ bool _gameFlagsWindow = false;
+ bool _menuTextWindow = false;
bool _useFreeCamera = false;
bool _disableGridRendering = false;
diff --git a/engines/twine/debugger/debugtools.cpp b/engines/twine/debugger/debugtools.cpp
index fb1466828d0..074fd062588 100644
--- a/engines/twine/debugger/debugtools.cpp
+++ b/engines/twine/debugger/debugtools.cpp
@@ -19,13 +19,17 @@
*
*/
+#include "twine/debugger/debugtools.h"
+#include "backends/imgui/imgui.h"
#include "backends/imgui/imgui_utils.h"
+#include "common/str.h"
#include "common/util.h"
#include "twine/debugger/debug_state.h"
-#include "twine/debugger/debugtools.h"
#include "twine/debugger/dt-internal.h"
#include "twine/holomap.h"
+#include "twine/parser/entity.h"
#include "twine/renderer/redraw.h"
+#include "twine/resources/resources.h"
#include "twine/scene/actor.h"
#include "twine/scene/gamestate.h"
#include "twine/scene/grid.h"
@@ -57,11 +61,29 @@ bool InputAngle(const char *label, int32 *v, int step = 1, int step_fast = 100,
return false;
}
+bool InputBoundingBox(ImGuiID id, const char *prefixLabel, TwinE::BoundingBox &bbox) {
+ TwinE::BoundingBox copy = bbox;
+ Common::String idStr = Common::String::format("%s mins##mins%u", prefixLabel, id);
+ if (ImGuiEx::InputIVec3(idStr.c_str(), copy.mins, ImGuiInputTextFlags_EnterReturnsTrue)) {
+ if (copy.isValid()) {
+ bbox.mins = copy.mins;
+ }
+ return true;
+ }
+ idStr = Common::String::format("%s maxs##maxs%u", prefixLabel, id);
+ if (ImGuiEx::InputIVec3(idStr.c_str(), copy.maxs, ImGuiInputTextFlags_EnterReturnsTrue)) {
+ if (copy.isValid()) {
+ bbox.maxs = copy.maxs;
+ }
+ return true;
+ }
+ return false;
+}
+
} // namespace ImGuiEx
namespace TwinE {
-#define MAIN_WINDOW_TITLE "Debug window"
#define HOLOMAP_FLAGS_TITLE "Holomap flags"
#define GAME_FLAGS_TITLE "Game flags"
#define ACTOR_DETAILS_TITLE "Actor"
@@ -123,22 +145,29 @@ void onImGuiInit() {
_tinyFont = ImGui::addTTFFontFromArchive("FreeSans.ttf", 10.0f, nullptr, nullptr);
}
-static void holomapFlagsPopup(TwinEEngine *engine) {
- if (ImGui::BeginPopup(HOLOMAP_FLAGS_TITLE)) {
+static void holomapFlagsWindow(TwinEEngine *engine) {
+ if (!engine->_debugState->_holomapFlagsWindow) {
+ return;
+ }
+ if (ImGui::Begin(HOLOMAP_FLAGS_TITLE, &engine->_debugState->_holomapFlagsWindow)) {
if (ImGui::BeginTable("###holomapflags", 8)) {
for (int i = 0; i < engine->numHoloPos(); ++i) {
ImGui::TableNextColumn();
Common::String id = Common::String::format("[%03d]", i);
ImGuiEx::InputInt(id.c_str(), &engine->_gameState->_holomapFlags[i]);
+ ImGui::SetItemTooltip("%s", engine->_holomap->getLocationName(i));
}
ImGui::EndTable();
}
- ImGui::EndPopup();
}
+ ImGui::End();
}
-static void gameFlagsPopup(TwinEEngine *engine) {
- if (ImGui::BeginPopup(GAME_FLAGS_TITLE)) {
+static void gameFlagsWindow(TwinEEngine *engine) {
+ if (!engine->_debugState->_gameFlagsWindow) {
+ return;
+ }
+ if (ImGui::Begin(GAME_FLAGS_TITLE, &engine->_debugState->_gameFlagsWindow)) {
ImGui::Text("Chapter %i", engine->_gameState->getChapter());
if (ImGui::BeginTable("###gameflags", 8)) {
for (int i = 0; i < NUM_GAME_FLAGS; ++i) {
@@ -151,12 +180,15 @@ static void gameFlagsPopup(TwinEEngine *engine) {
}
ImGui::EndTable();
}
- ImGui::EndPopup();
}
+ ImGui::End();
}
-static void menuTextsPopup(TwinEEngine *engine) {
- if (ImGui::BeginPopup(MENU_TEXT_TITLE)) {
+static void menuTextsWindow(TwinEEngine *engine) {
+ if (!engine->_debugState->_menuTextWindow) {
+ return;
+ }
+ if (ImGui::Begin(MENU_TEXT_TITLE, &engine->_debugState->_menuTextWindow)) {
int id = (int)engine->_debugState->_textBankId;
if (ImGui::InputInt("Text bank", &id)) {
engine->_debugState->_textBankId = (TextBankId)id;
@@ -170,8 +202,8 @@ static void menuTextsPopup(TwinEEngine *engine) {
}
}
engine->_text->initDial(oldTextBankId);
- ImGui::EndPopup();
}
+ ImGui::End();
}
static void actorDetailsWindow(int &actorIdx, TwinEEngine *engine) {
@@ -179,6 +211,7 @@ static void actorDetailsWindow(int &actorIdx, TwinEEngine *engine) {
if (actor == nullptr) {
return;
}
+
if (ImGui::Begin(ACTOR_DETAILS_TITLE)) {
if (actorIdx < 0 || actorIdx > engine->_scene->_nbObjets) {
actorIdx = 0;
@@ -202,8 +235,7 @@ static void actorDetailsWindow(int &actorIdx, TwinEEngine *engine) {
ImGuiEx::InputInt("Speed", &actor->_speed);
ImGuiEx::InputInt("Life", &actor->_lifePoint);
ImGuiEx::InputInt("Armor", &actor->_armor);
- ImGuiEx::InputIVec3("Bounding box mins", actor->_boundingBox.mins);
- ImGuiEx::InputIVec3("Bounding box maxs", actor->_boundingBox.maxs);
+ ImGuiEx::InputBoundingBox(actorIdx, "Bounding box", actor->_boundingBox);
if (ImGui::BeginTable("Properties", 2)) {
ImGui::TableSetupColumn("Name", ImGuiTableColumnFlags_WidthFixed);
@@ -247,6 +279,10 @@ static void actorDetailsWindow(int &actorIdx, TwinEEngine *engine) {
ImGui::TableNextColumn();
ImGui::Text("%i", actor->_objCol);
ImGui::TableNextColumn();
+ ImGui::Text("Talk color");
+ ImGui::TableNextColumn();
+ ImGui::Text("%i", actor->_talkColor);
+ ImGui::TableNextColumn();
ImGui::Text("Body");
ImGui::TableNextColumn();
ImGui::Text("%i", actor->_body); // TODO: link to resources
@@ -281,6 +317,38 @@ static void actorDetailsWindow(int &actorIdx, TwinEEngine *engine) {
ImGui::EndTable();
}
+
+ if (actor->_body != -1) {
+ ImGui::SeparatorText("Body");
+ BodyData &bodyData = engine->_resources->_bodyData[actor->_body];
+ ImGuiEx::InputBoundingBox(actor->_body, "Bounding box", bodyData.bbox);
+ }
+
+ ImGui::SeparatorText("Entity");
+ EntityData &entityData = actor->_entityData;
+ Common::Array<EntityBody> &bodies = entityData.getBodies();
+ ImGui::Text("Bodies: %i", (int)bodies.size());
+ for (EntityBody &body : bodies) {
+ ImGui::Text("%s index: %i", Resources::HQR_FILE3D_FILE, body.index);
+ ImGui::Indent();
+ ImGui::Text("%s index: %i", Resources::HQR_BODY_FILE, body.hqrBodyIndex);
+ Common::String id = Common::String::format("Has bounding box##%i", body.index);
+ ImGui::Checkbox(id.c_str(), &body.actorBoundingBox.hasBoundingBox);
+ ImGuiEx::InputBoundingBox(body.index, "Bounding box", body.actorBoundingBox.bbox);
+ ImGui::Unindent();
+ }
+ Common::Array<EntityAnim> &animations = entityData.getAnimations();
+ ImGui::Text("Animations: %i", (int)animations.size());
+ for (EntityAnim &animation : animations) {
+ ImGui::Text("Animation type: %i", (int)animation.animation);
+ ImGui::Indent();
+ ImGui::Text("Body animation index: %i", (int)animation.animIndex);
+ ImGui::Text("actions: %i", (int)animation._actions.size());
+ for (EntityAnim::Action &action : animation._actions) {
+ ImGui::BulletText("%i", (int)action.type);
+ }
+ ImGui::Unindent();
+ }
}
ImGui::End();
}
@@ -365,13 +433,13 @@ static void gridMenu(TwinEEngine *engine) {
static void debuggerMenu(TwinEEngine *engine) {
if (ImGui::BeginMenu("Debugger")) {
if (ImGui::MenuItem("Texts")) {
- engine->_debugState->_openPopup = MENU_TEXT_TITLE;
+ engine->_debugState->_menuTextWindow = true;
}
if (ImGui::MenuItem("Holomap flags")) {
- engine->_debugState->_openPopup = HOLOMAP_FLAGS_TITLE;
+ engine->_debugState->_holomapFlagsWindow = true;
}
if (ImGui::MenuItem("Game flags")) {
- engine->_debugState->_openPopup = GAME_FLAGS_TITLE;
+ engine->_debugState->_gameFlagsWindow = true;
}
ImGui::SeparatorText("Actions");
@@ -469,9 +537,9 @@ void onImGuiRender() {
actorDetailsWindow(currentActor, engine);
- menuTextsPopup(engine);
- holomapFlagsPopup(engine);
- gameFlagsPopup(engine);
+ menuTextsWindow(engine);
+ holomapFlagsWindow(engine);
+ gameFlagsWindow(engine);
if (engine->_debugState->_openPopup) {
ImGui::OpenPopup(engine->_debugState->_openPopup);
diff --git a/engines/twine/parser/entity.h b/engines/twine/parser/entity.h
index 7fe923328ee..0fdc7691986 100644
--- a/engines/twine/parser/entity.h
+++ b/engines/twine/parser/entity.h
@@ -95,6 +95,20 @@ public:
const Common::Array<EntityAnim::Action> *getActions(AnimationTypes animation) const;
const EntityBody *getBody(const int index) const;
int32 getAnimIndex(AnimationTypes animation) const;
+
+ const Common::Array<EntityBody> &getBodies() const {
+ return _bodies;
+ }
+ const Common::Array<EntityAnim> &getAnimations() const {
+ return _animations;
+ }
+
+ Common::Array<EntityBody> &getBodies() {
+ return _bodies;
+ }
+ Common::Array<EntityAnim> &getAnimations() {
+ return _animations;
+ }
};
} // End of namespace TwinE
diff --git a/engines/twine/shared.h b/engines/twine/shared.h
index 94f49beead4..4aa3de90575 100644
--- a/engines/twine/shared.h
+++ b/engines/twine/shared.h
@@ -188,6 +188,10 @@ int32 getDistance3D(const IVec3 &v1, const IVec3 &v2);
struct BoundingBox {
IVec3 mins;
IVec3 maxs;
+
+ bool isValid() const {
+ return mins.x <= maxs.x && mins.y <= maxs.y && mins.z <= maxs.z;
+ }
};
struct ActorBoundingBox {
Commit: 54d2e51c48b2cafc3a67b8ff1038a77b1397eb78
https://github.com/scummvm/scummvm/commit/54d2e51c48b2cafc3a67b8ff1038a77b1397eb78
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-10-08T10:25:04+02:00
Commit Message:
TWINE: added getter for bodydata
Changed paths:
engines/twine/debugger/debugtools.cpp
engines/twine/menu/menu.cpp
engines/twine/renderer/redraw.cpp
engines/twine/resources/resources.cpp
engines/twine/resources/resources.h
engines/twine/scene/actor.cpp
engines/twine/scene/animations.cpp
engines/twine/scene/gamestate.cpp
diff --git a/engines/twine/debugger/debugtools.cpp b/engines/twine/debugger/debugtools.cpp
index 074fd062588..bf6216e5cec 100644
--- a/engines/twine/debugger/debugtools.cpp
+++ b/engines/twine/debugger/debugtools.cpp
@@ -320,7 +320,7 @@ static void actorDetailsWindow(int &actorIdx, TwinEEngine *engine) {
if (actor->_body != -1) {
ImGui::SeparatorText("Body");
- BodyData &bodyData = engine->_resources->_bodyData[actor->_body];
+ BodyData &bodyData = engine->_resources->getBodyData(actor->_body);
ImGuiEx::InputBoundingBox(actor->_body, "Bounding box", bodyData.bbox);
}
diff --git a/engines/twine/menu/menu.cpp b/engines/twine/menu/menu.cpp
index 32dd1ea42a7..e4f14a92a6f 100644
--- a/engines/twine/menu/menu.cpp
+++ b/engines/twine/menu/menu.cpp
@@ -1210,7 +1210,7 @@ void Menu::processBehaviourMenu(bool behaviourMenu) {
_engine->_actor->setBehaviour(HeroBehaviourType::kNormal);
}
- _behaviourEntity = &_engine->_resources->_bodyData[_engine->_scene->_sceneHero->_body];
+ _behaviourEntity = &_engine->_resources->getBodyData(_engine->_scene->_sceneHero->_body);
_engine->_actor->_heroAnimIdx[(byte)HeroBehaviourType::kNormal] = _engine->_actor->_heroAnimIdxNORMAL;
_engine->_actor->_heroAnimIdx[(byte)HeroBehaviourType::kAthletic] = _engine->_actor->_heroAnimIdxATHLETIC;
diff --git a/engines/twine/renderer/redraw.cpp b/engines/twine/renderer/redraw.cpp
index 043561c1c17..0dddb862c4d 100644
--- a/engines/twine/renderer/redraw.cpp
+++ b/engines/twine/renderer/redraw.cpp
@@ -404,7 +404,7 @@ void Redraw::processDrawListActors(const DrawListStruct &drawCmd, bool bgRedraw)
ActorStruct *actor = _engine->_scene->getActor(actorIdx);
if (actor->_anim >= 0) {
const AnimData &animData = _engine->_resources->_animData[actor->_anim];
- _engine->_animations->doSetInterAnimObjet(actor->_frame, animData, _engine->_resources->_bodyData[actor->_body], &actor->_animTimerData);
+ _engine->_animations->doSetInterAnimObjet(actor->_frame, animData, _engine->_resources->getBodyData(actor->_body), &actor->_animTimerData);
}
const IVec3 &delta = actor->posObj() - _engine->_grid->_worldCube;
@@ -416,7 +416,7 @@ void Redraw::processDrawListActors(const DrawListStruct &drawCmd, bool bgRedraw)
}
}
- if (!_engine->_renderer->affObjetIso(delta.x, delta.y, delta.z, LBAAngles::ANGLE_0, actor->_beta, LBAAngles::ANGLE_0, _engine->_resources->_bodyData[actor->_body], renderRect)) {
+ if (!_engine->_renderer->affObjetIso(delta.x, delta.y, delta.z, LBAAngles::ANGLE_0, actor->_beta, LBAAngles::ANGLE_0, _engine->_resources->getBodyData(actor->_body), renderRect)) {
return;
}
diff --git a/engines/twine/resources/resources.cpp b/engines/twine/resources/resources.cpp
index f6b57c37a3c..b5155077cbc 100644
--- a/engines/twine/resources/resources.cpp
+++ b/engines/twine/resources/resources.cpp
@@ -252,6 +252,10 @@ void Resources::initResources() {
debug("Loaded %i text banks", textEntryCount / 2);
}
+BodyData &Resources::getBodyData(int index) {
+ return _bodyData[index];
+}
+
const TextEntry *Resources::getText(TextBankId textBankId, TextId index) const {
return _textData.getText(textBankId, index);
}
diff --git a/engines/twine/resources/resources.h b/engines/twine/resources/resources.h
index b4667a90246..f9d83abb4fe 100644
--- a/engines/twine/resources/resources.h
+++ b/engines/twine/resources/resources.h
@@ -151,6 +151,8 @@ private:
TextData _textData;
Anim3DSData _anim3DSData;
+ /** Actors 3D body table - size of NUM_BODIES */
+ BodyData _bodyData[NUM_BODIES];
public:
Resources(TwinEEngine *engine) : _engine(engine) {}
~Resources();
@@ -172,8 +174,7 @@ public:
AnimData _animData[NUM_ANIMS];
- /** Actors 3D body table - size of NUM_BODIES */
- BodyData _bodyData[NUM_BODIES];
+ BodyData &getBodyData(int index);
/** Table with all loaded samples */
uint8 *_samplesTable[NUM_SAMPLES]{nullptr};
diff --git a/engines/twine/scene/actor.cpp b/engines/twine/scene/actor.cpp
index 40070ff5404..f86dd125853 100644
--- a/engines/twine/scene/actor.cpp
+++ b/engines/twine/scene/actor.cpp
@@ -275,7 +275,7 @@ void Actor::initBody(BodyType bodyIdx, int16 actorIdx) {
if (actorBoundingBox.hasBoundingBox) {
localActor->_boundingBox = actorBoundingBox.bbox;
} else {
- const BodyData &bd = _engine->_resources->_bodyData[localActor->_body];
+ const BodyData &bd = _engine->_resources->getBodyData(localActor->_body);
localActor->_boundingBox = bd.bbox;
int32 size = 0;
@@ -298,7 +298,7 @@ void Actor::initBody(BodyType bodyIdx, int16 actorIdx) {
localActor->_boundingBox.maxs.z = size;
}
if (oldBody != -1 && localActor->_anim != -1) {
- copyInterAnim(_engine->_resources->_bodyData[oldBody], _engine->_resources->_bodyData[localActor->_body]);
+ copyInterAnim(_engine->_resources->getBodyData(oldBody), _engine->_resources->getBodyData(localActor->_body));
}
}
diff --git a/engines/twine/scene/animations.cpp b/engines/twine/scene/animations.cpp
index 2bc1592de65..328a62cb8e5 100644
--- a/engines/twine/scene/animations.cpp
+++ b/engines/twine/scene/animations.cpp
@@ -434,10 +434,10 @@ bool Animations::initAnim(AnimationTypes newAnim, AnimType flag, AnimationTypes
if (actor->_anim == -1) {
// if no previous animation
- setAnimObjet(0, _engine->_resources->_animData[newanim], _engine->_resources->_bodyData[actor->_body], &actor->_animTimerData);
+ setAnimObjet(0, _engine->_resources->_animData[newanim], _engine->_resources->getBodyData(actor->_body), &actor->_animTimerData);
} else {
// interpolation between animations
- stockInterAnim(_engine->_resources->_bodyData[actor->_body], &actor->_animTimerData);
+ stockInterAnim(_engine->_resources->getBodyData(actor->_body), &actor->_animTimerData);
}
actor->_anim = newanim;
@@ -562,7 +562,7 @@ void Animations::doAnim(int32 actorIdx) {
const AnimData &animData = _engine->_resources->_animData[actor->_anim];
bool keyFramePassed = false;
- if (_engine->_resources->_bodyData[actor->_body].isAnimated()) {
+ if (_engine->_resources->getBodyData(actor->_body).isAnimated()) {
keyFramePassed = setInterDepObjet(actor->_frame, animData, &actor->_animTimerData);
}
diff --git a/engines/twine/scene/gamestate.cpp b/engines/twine/scene/gamestate.cpp
index dee74152914..6d5a614b082 100644
--- a/engines/twine/scene/gamestate.cpp
+++ b/engines/twine/scene/gamestate.cpp
@@ -346,7 +346,7 @@ void GameState::doFoundObj(InventoryItems item) {
itemCamera.y = _engine->_grid->_newCamera.y * SIZE_BRICK_Y;
itemCamera.z = _engine->_grid->_newCamera.z * SIZE_BRICK_XZ;
- BodyData &bodyData = _engine->_resources->_bodyData[_engine->_scene->_sceneHero->_body];
+ BodyData &bodyData = _engine->_resources->getBodyData(_engine->_scene->_sceneHero->_body);
const IVec3 bodyPos = _engine->_scene->_sceneHero->_posObj - itemCamera;
Common::Rect modelRect;
_engine->_renderer->renderIsoModel(bodyPos, LBAAngles::ANGLE_0, LBAAngles::ANGLE_45, LBAAngles::ANGLE_0, bodyData, modelRect);
Commit: 9bb2257e0a342dbb2faea4c290b30549a07be34e
https://github.com/scummvm/scummvm/commit/9bb2257e0a342dbb2faea4c290b30549a07be34e
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-10-08T10:25:04+02:00
Commit Message:
TWINE: added hqrindex member to the Parser class to improve the error messages
Changed paths:
engines/twine/parser/parser.cpp
engines/twine/parser/parser.h
engines/twine/renderer/renderer.cpp
diff --git a/engines/twine/parser/parser.cpp b/engines/twine/parser/parser.cpp
index e4bb41dffcd..faaa7a099df 100644
--- a/engines/twine/parser/parser.cpp
+++ b/engines/twine/parser/parser.cpp
@@ -44,6 +44,7 @@ bool Parser::loadFromHQR(const char *name, int index, bool lba1) {
delete stream;
return false;
}
+ _hqrIndex = index;
delete stream;
return true;
}
diff --git a/engines/twine/parser/parser.h b/engines/twine/parser/parser.h
index ef4cd47bed8..505837b41b3 100644
--- a/engines/twine/parser/parser.h
+++ b/engines/twine/parser/parser.h
@@ -31,6 +31,7 @@ namespace TwinE {
class Parser {
protected:
+ int _hqrIndex = -1;
virtual void reset() {}
public:
virtual ~Parser() {
@@ -41,6 +42,10 @@ public:
bool loadFromBuffer(const uint8 *buf, uint32 size, bool lba1);
bool loadFromHQR(const char *name, int index, bool lba1);
+ int hqrIndex() const {
+ return _hqrIndex;
+ }
+
inline bool loadFromHQR(const TwineResource &resource, bool lba1) {
return loadFromHQR(resource.hqr, resource.index, lba1);
}
diff --git a/engines/twine/renderer/renderer.cpp b/engines/twine/renderer/renderer.cpp
index d1c986545ee..a8d94773da3 100644
--- a/engines/twine/renderer/renderer.cpp
+++ b/engines/twine/renderer/renderer.cpp
@@ -1730,7 +1730,7 @@ bool Renderer::affObjetIso(int32 x, int32 y, int32 z, int32 alpha, int32 beta, i
RenderCommand* renderCmds = _renderCmds;
return renderModelElements(numOfPrimitives, bodyData, &renderCmds, &_modelData, modelRect);
#else
- error("Unsupported unanimated model render!");
+ error("Unsupported unanimated model render for model index %i!", bodyData.hqrIndex());
#endif
}
// restart at the beginning of the renderTable
Commit: 17f6f2dc24fa7faa3514230ac55753680337320f
https://github.com/scummvm/scummvm/commit/17f6f2dc24fa7faa3514230ac55753680337320f
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-10-08T10:25:04+02:00
Commit Message:
TWINE: renamed getter
Changed paths:
engines/twine/parser/entity.cpp
engines/twine/parser/entity.h
engines/twine/scene/actor.cpp
diff --git a/engines/twine/parser/entity.cpp b/engines/twine/parser/entity.cpp
index 79f41f2002e..6632313a27c 100644
--- a/engines/twine/parser/entity.cpp
+++ b/engines/twine/parser/entity.cpp
@@ -307,7 +307,7 @@ const Common::Array<EntityAnim::Action> *EntityData::getActions(AnimationTypes a
return nullptr;
}
-const EntityBody *EntityData::getBody(const int index) const {
+const EntityBody *EntityData::getEntityBody(const int index) const {
for (const EntityBody &body : _bodies) {
if (body.index == index) {
return &body;
diff --git a/engines/twine/parser/entity.h b/engines/twine/parser/entity.h
index 0fdc7691986..a7e8a04ea44 100644
--- a/engines/twine/parser/entity.h
+++ b/engines/twine/parser/entity.h
@@ -93,7 +93,7 @@ public:
bool loadFromStream(Common::SeekableReadStream &stream, bool lba1) override;
const Common::Array<EntityAnim::Action> *getActions(AnimationTypes animation) const;
- const EntityBody *getBody(const int index) const;
+ const EntityBody *getEntityBody(const int index) const;
int32 getAnimIndex(AnimationTypes animation) const;
const Common::Array<EntityBody> &getBodies() const {
diff --git a/engines/twine/scene/actor.cpp b/engines/twine/scene/actor.cpp
index f86dd125853..b71934a5229 100644
--- a/engines/twine/scene/actor.cpp
+++ b/engines/twine/scene/actor.cpp
@@ -233,7 +233,7 @@ int32 Actor::searchBody(BodyType bodyIdx, int32 actorIdx, ActorBoundingBox &acto
return -1;
}
ActorStruct *actor = _engine->_scene->getActor(actorIdx);
- const EntityBody *body = actor->_entityDataPtr->getBody((int)bodyIdx);
+ const EntityBody *body = actor->_entityDataPtr->getEntityBody((int)bodyIdx);
if (body == nullptr) {
warning("Failed to get entity body for body idx %i", (int)bodyIdx);
return -1;
More information about the Scummvm-git-logs
mailing list