summaryrefslogtreecommitdiff
path: root/src/KingSystem/ActorSystem
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2021-03-19 14:31:19 +0100
committerLéo Lam <leo@leolam.fr>2021-03-20 00:17:33 +0100
commit8c8d9c0e7036d22d3eebe1c8dca54b44b601e8e5 (patch)
treea4370ba6302a8e91b171e352d8540fc9f4f28586 /src/KingSystem/ActorSystem
parentc119c0eefa8513978bfbb48ebd1a3e74e266a86b (diff)
ksys/res: Finish implementing ModelList
Diffstat (limited to 'src/KingSystem/ActorSystem')
-rw-r--r--src/KingSystem/ActorSystem/actInfoData.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/KingSystem/ActorSystem/actInfoData.cpp b/src/KingSystem/ActorSystem/actInfoData.cpp
index 028cb26e..a36aeb30 100644
--- a/src/KingSystem/ActorSystem/actInfoData.cpp
+++ b/src/KingSystem/ActorSystem/actInfoData.cpp
@@ -6,6 +6,7 @@
#include "KingSystem/ActorSystem/actDebug.h"
#include "KingSystem/Event/evtEvent.h"
#include "KingSystem/Event/evtManager.h"
+#include "KingSystem/Resource/resResourceModelList.h"
#include "KingSystem/Utils/Byaml/Byaml.h"
#include "KingSystem/Utils/Byaml/ByamlArrayIter.h"
#include "KingSystem/Utils/Byaml/ByamlData.h"
@@ -215,17 +216,6 @@ const char* InfoData::getStringByKey(const al::ByamlIter& iter, const char* key,
return iter.tryGetStringByKey(&value, key) ? value : default_.cstr();
}
-[[gnu::noinline]] static InfoData::Locator::Type
-getLocatorTypeFromStr(const sead::SafeString& type) {
- static constexpr const char* types[] = {"Trunk", "Branch", "GlowStone",
- "OnTree", "MagnePos", "StopTimerPos"};
- for (s32 i = 0; i < s32(std::size(types)); ++i) {
- if (type == types[i])
- return InfoData::Locator::Type(i);
- }
- return InfoData::Locator::Type::Invalid;
-}
-
void InfoData::getLocators(const char* actor, Locators& info) const {
info.num = 0;
@@ -255,7 +245,8 @@ void InfoData::getLocators(const char* actor, Locators& info) const {
it.tryGetFloatByKey(&locator.rot.z, "rot_z");
it.tryGetStringByKey(&type_str, "type");
- locator.type = type_str ? getLocatorTypeFromStr(type_str) : Locator::Type::Invalid;
+ locator.type =
+ type_str ? res::ModelList::getLocatorTypeFromStr(type_str) : Locator::Type::Invalid;
locator.rot *= 2 * sead::numbers::pi / 360.0;
}