Skip to content

Commit

Permalink
Merge remote into local
Browse files Browse the repository at this point in the history
  • Loading branch information
Astral-C committed Sep 3, 2024
2 parents 43d35e4 + e98c3d0 commit 7a77ac4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
2 changes: 2 additions & 0 deletions include/DOM/ObjectDOMNode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ class SObjectDOMNode : public SDOMNodeSerializable {
std::array<std::string, 8> mObjArgNames;
std::array<int, 8> mObjArgs;

std::unordered_map < std::string, int> mSwitches;

glm::mat4 mTransform;
typedef SDOMNodeSerializable Super;

Expand Down
21 changes: 14 additions & 7 deletions src/DOM/ObjectDOMNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,27 @@ void SObjectDOMNode::Deserialize(SBcsvIO* bcsv, int entry){
mPathArgs[i] = bcsv->GetSignedInt(entry, fmt::format("Path_arg{0}", i));
}

std::array<std::string, 7> switchNames = { "SW_APPEAR", "SW_DEAD", "SW_A", "SW_B", "SW_SLEEP", "SW_AWAKE", "SW_PARAM"};

for(auto& obj : objectDB["Classes"]){
if(obj["InternalName"] == mName){
for (size_t i = 0; i < 8; i++){
if(!obj["Parameters"].contains(fmt::format("Obj_arg{0}", i))) continue;
mObjArgNames[i] = obj["Parameters"][fmt::format("Obj_arg{0}", i)]["Name"];
}

for (auto s : switchNames) {
if (obj["Parameters"].contains(s)) {
mSwitches[s] = bcsv->GetSignedInt(entry, s);
}
}
}
}

//Collect arg types from object DB and load data accordingly into array of obj/path args

mLinkID = bcsv->GetSignedInt(entry, "l_id");
mCameraSetID = bcsv->GetSignedInt(entry, "CameraSetId");
mSW_Appear = bcsv->GetSignedInt(entry, "SW_APPEAR");
mSW_Dead = bcsv->GetSignedInt(entry, "SW_DEAD");
mSW_A = bcsv->GetSignedInt(entry, "SW_A");
mSW_B = bcsv->GetSignedInt(entry, "SW_B");
mSW_Sleep = bcsv->GetSignedInt(entry, "SW_SLEEP");
mMessageID = bcsv->GetSignedInt(entry, "MessageId");
mCastID = bcsv->GetSignedInt(entry, "CastId");
mViewGroupID = bcsv->GetSignedInt(entry, "ViewGroupId");
Expand All @@ -78,8 +81,6 @@ void SObjectDOMNode::Deserialize(SBcsvIO* bcsv, int entry){
mDemoGroupID = bcsv->GetShort(entry, "DemoGroupId");
mMapPartID = bcsv->GetShort(entry, "MapParts_ID");

mSwitchAwake = bcsv->GetSignedInt(entry, "SW_AWAKE");
mSwitchParam = bcsv->GetSignedInt(entry, "SW_PARAM");
mParamScale = bcsv->GetFloat(entry, "ParamScale");
mObjID = bcsv->GetShort(entry, "Obj_ID");
mGeneratorID = bcsv->GetShort(entry, "GeneratorID");
Expand Down Expand Up @@ -194,6 +195,12 @@ void SObjectDOMNode::RenderDetailsUI(){
for (size_t i = 0; i < 8; i++){
ImGui::InputInt(mObjArgNames[i].data(), &mObjArgs[i]);
}

ImGui::Separator();

for (auto& pair : mSwitches) {
ImGui::InputInt(pair.first.c_str(), &pair.second);
}
}

void SObjectDOMNode::Render(std::vector<std::shared_ptr<J3DModelInstance>>& renderables, glm::mat4 transform, float dt){
Expand Down
4 changes: 3 additions & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
"dependencies": [
"icu",
"curl"
]
],

"builtin-baseline": "036916f2ca7fbf3effec439119500da00ae478dd"
}

0 comments on commit 7a77ac4

Please sign in to comment.