From 550f7dbdd0a31d9f82cdab98ae9da4315c30cbeb Mon Sep 17 00:00:00 2001 From: fallenoak Date: Wed, 15 Oct 2025 00:37:44 -0500 Subject: [PATCH] feat(glue): call CGlueLoading::StartLoad from CCharacterSelection::ShowCharacter --- src/glue/CCharacterSelection.cpp | 4 +++- src/glue/CGlueLoading.cpp | 21 +++++++++++++++++++++ src/glue/CGlueLoading.hpp | 17 +++++++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 src/glue/CGlueLoading.cpp create mode 100644 src/glue/CGlueLoading.hpp diff --git a/src/glue/CCharacterSelection.cpp b/src/glue/CCharacterSelection.cpp index b25acb3..2d082e9 100644 --- a/src/glue/CCharacterSelection.cpp +++ b/src/glue/CCharacterSelection.cpp @@ -2,6 +2,7 @@ #include "client/ClientServices.hpp" #include "component/CCharacterComponent.hpp" #include "db/Db.hpp" +#include "glue/CGlueLoading.hpp" #include "glue/CGlueMgr.hpp" #include "glue/CRealmList.hpp" #include "glue/Types.hpp" @@ -169,7 +170,8 @@ void CCharacterSelection::ShowCharacter() { petModel->AttachToParent(parent, 1, nullptr, 0); } - // TODO CGlueLoading::StartLoad(&character->component, 0); + // TODO a2 may be 1 in some circumstances + CGlueLoading::StartLoad(character->component, 0); return; } diff --git a/src/glue/CGlueLoading.cpp b/src/glue/CGlueLoading.cpp new file mode 100644 index 0000000..d4b5f79 --- /dev/null +++ b/src/glue/CGlueLoading.cpp @@ -0,0 +1,21 @@ +#include "glue/CGlueLoading.hpp" +#include "component/CCharacterComponent.hpp" +#include "model/Model2.hpp" +#include "util/SFile.hpp" + +int32_t CGlueLoading::s_loadState; + +void CGlueLoading::StartLoad(CCharacterComponent* component, int32_t a2) { + if (SFile::IsStreamingTrial()) { + // TODO + + return; + } + + if (component) { + component->RenderPrep(1); + component->m_data.model->IsDrawable(1, 1); + } + + CGlueLoading::s_loadState = 3; +} diff --git a/src/glue/CGlueLoading.hpp b/src/glue/CGlueLoading.hpp new file mode 100644 index 0000000..a735a87 --- /dev/null +++ b/src/glue/CGlueLoading.hpp @@ -0,0 +1,17 @@ +#ifndef GLUE_C_GLUE_LOADING_HPP +#define GLUE_C_GLUE_LOADING_HPP + +#include + +class CCharacterComponent; + +class CGlueLoading { + public: + // Static variables + static int32_t s_loadState; + + // Static functions + static void StartLoad(CCharacterComponent* component, int32_t a2); +}; + +#endif