From 06a1c6e8ac2972c27b68e8d02d2abb42c2cb6578 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Sat, 5 Feb 2022 07:22:30 -0800 Subject: [PATCH] Minor fixes, get PRESS START rendering --- Runtime/CToken.cpp | 2 +- Runtime/Graphics/CCubeModel.cpp | 10 +++++++--- Runtime/Graphics/CCubeModel.hpp | 8 ++++---- Runtime/GuiSys/CGuiModel.cpp | 6 ++++-- Runtime/MP1/CFrontEndUI.cpp | 10 +++++++++- Runtime/World/CWorldTransManager.hpp | 2 +- 6 files changed, 26 insertions(+), 12 deletions(-) diff --git a/Runtime/CToken.cpp b/Runtime/CToken.cpp index 94f756b71..9c22125ca 100644 --- a/Runtime/CToken.cpp +++ b/Runtime/CToken.cpp @@ -39,7 +39,7 @@ void CObjectReference::Lock() { } void CObjectReference::CancelLoad() { - if (xC_objectStore && IsLoading()) { + if ((xC_objectStore != nullptr) && IsLoading()) { xC_objectStore->GetFactory().CancelBuild(x4_objTag); x3_loading = false; } diff --git a/Runtime/Graphics/CCubeModel.cpp b/Runtime/Graphics/CCubeModel.cpp index 8c9f3d047..302bd93cc 100644 --- a/Runtime/Graphics/CCubeModel.cpp +++ b/Runtime/Graphics/CCubeModel.cpp @@ -189,8 +189,8 @@ void CModel::DisableTextureTimeout() { sIsTextureTimeoutEnabled = false; } #pragma region CCubeModel -CCubeModel::CCubeModel(const std::vector>* surfaces, - const std::vector>* textures, const u8* materialData, +CCubeModel::CCubeModel(std::vector>* surfaces, + std::vector>* textures, const u8* materialData, const std::vector* positions, const std::vector* colors, const std::vector* normals, const std::vector* texCoords, const std::vector>* packedTexCoords, const zeus::CAABox& aabox, u8 flags, @@ -229,7 +229,11 @@ CCubeMaterial CCubeModel::GetMaterialByIndex(u32 idx) { return CCubeMaterial(matData + materialOffset + (materialCount * 4) + 4); } -void CCubeModel::UnlockTextures() {} +void CCubeModel::UnlockTextures() { + for (TCachedToken& tex : *x1c_textures) { + tex.Unlock(); + } +} void CCubeModel::MakeTexturesFromMats(const u8* ptr, std::vector>& textures, IObjectStore* store, bool b1) { diff --git a/Runtime/Graphics/CCubeModel.hpp b/Runtime/Graphics/CCubeModel.hpp index a88d6de7f..58967304b 100644 --- a/Runtime/Graphics/CCubeModel.hpp +++ b/Runtime/Graphics/CCubeModel.hpp @@ -77,7 +77,7 @@ private: const std::vector>* x18_packedTexCoords; // was a pointer to void public: - ModelInstance(const std::vector>* surfaces, const u8* material, + ModelInstance(std::vector>* surfaces, const u8* material, const std::vector* positions, const std::vector* colors, const std::vector* normals, const std::vector* texCoords, const std::vector>* packedTexCoords) @@ -103,7 +103,7 @@ private: }; ModelInstance x0_modelInstance; - const std::vector>* x1c_textures; + std::vector>* x1c_textures; zeus::CAABox x20_worldAABB; CCubeSurface* x38_firstUnsortedSurf = nullptr; CCubeSurface* x3c_firstSortedSurf = nullptr; @@ -112,8 +112,8 @@ private: u32 x44_idx; public: - CCubeModel(const std::vector>* surfaces, - const std::vector>* textures, const u8* materialData, + CCubeModel(std::vector>* surfaces, + std::vector>* textures, const u8* materialData, const std::vector* positions, const std::vector* colors, const std::vector* normals, const std::vector* texCoords, const std::vector>* packedTexCoords, const zeus::CAABox& aabox, u8 flags, bool b1, diff --git a/Runtime/GuiSys/CGuiModel.cpp b/Runtime/GuiSys/CGuiModel.cpp index 8ea304413..a397356bf 100644 --- a/Runtime/GuiSys/CGuiModel.cpp +++ b/Runtime/GuiSys/CGuiModel.cpp @@ -23,11 +23,12 @@ bool CGuiModel::GetIsFinishedLoadingWidgetSpecific() { if (!xb8_model.IsLoaded()) { return false; } - xb8_model->GetInstance().Touch(0); - return xb8_model->IsLoaded(0); + //xb8_model->GetInstance().Touch(0); + return true; //xb8_model->IsLoaded(0); } void CGuiModel::Touch() { + return; CModel* const model = xb8_model.GetObj(); if (model == nullptr) { @@ -38,6 +39,7 @@ void CGuiModel::Touch() { } void CGuiModel::Draw(const CGuiWidgetDrawParms& parms) { + return; CGraphics::SetModelMatrix(x34_worldXF); if (!xb8_model) { return; diff --git a/Runtime/MP1/CFrontEndUI.cpp b/Runtime/MP1/CFrontEndUI.cpp index 24cea6b06..a6d5915a7 100644 --- a/Runtime/MP1/CFrontEndUI.cpp +++ b/Runtime/MP1/CFrontEndUI.cpp @@ -2046,7 +2046,15 @@ void CFrontEndUI::Draw() { x38_pressStart->GetHeight() / 480.f * vPad); zeus::CColor color = zeus::skWhite; color.a() = x64_pressStartAlpha; - m_pressStartQuad->draw(color, 1.f, rect); + aurora::shaders::queue_textured_quad( + aurora::shaders::CameraFilterType::Blend, + x38_pressStart->GetTexture()->ref, + aurora::shaders::ZTest::None, + color, + 1.f, + rect, + 0.f + ); } if (xc0_attractCount > 0) { diff --git a/Runtime/World/CWorldTransManager.hpp b/Runtime/World/CWorldTransManager.hpp index 9a0816af5..4748c7929 100644 --- a/Runtime/World/CWorldTransManager.hpp +++ b/Runtime/World/CWorldTransManager.hpp @@ -69,7 +69,7 @@ private: float x34_stopTime = 0.0f; float x38_textStartTime = 0.f; float x3c_sfxInterval = 0.0f; - bool x40_strIdx = false; + u32 x40_strIdx = 0; bool x44_24_transFinished : 1 = true; bool x44_25_stopSoon : 1 = false; bool x44_26_goingUp : 1 = false;