From 3209748a6689ff28185b661ebaed9b68bf605178 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Tue, 27 Oct 2015 21:45:02 -0700 Subject: [PATCH] Add temporary malloc/free to CGameAllocator Add missing CTimeProvider to CMakeLists.txt --- Runtime/CGameAllocator.cpp | 14 +++++++++----- Runtime/CMakeLists.txt | 1 + Runtime/MP1/CTweaks.cpp | 2 ++ Runtime/MP1/main.cpp | 5 +++-- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Runtime/CGameAllocator.cpp b/Runtime/CGameAllocator.cpp index acc0a25a6..9c1dbe1db 100644 --- a/Runtime/CGameAllocator.cpp +++ b/Runtime/CGameAllocator.cpp @@ -3,6 +3,8 @@ namespace Retro { +LogVisor::LogModule AllocLog("CGameAllocator"); + CGameAllocator::SGameMemInfo* CGameAllocator::FindFreeBlock(u32) { return nullptr; @@ -51,19 +53,21 @@ bool CGameAllocator::Initialize() void CGameAllocator::Shutdown() { } -void* CGameAllocator::Alloc(size_t, EHint, EScope, EType, const CCallStack&) +void* CGameAllocator::Alloc(size_t sz, EHint, EScope, EType, const CCallStack&) { - return nullptr; + AllocLog.report(LogVisor::Warning, _S("Remind Phil to reimplement Alloc!!!!")); + return malloc(sz); } -void CGameAllocator::Free(void*) +void CGameAllocator::Free(void* ptr) { + free(ptr); } void CGameAllocator::ReleaseAll() { } -void* CGameAllocator::AllocSecondary(size_t, EHint, EScope, EType, const CCallStack&) +void* CGameAllocator::AllocSecondary(size_t sz, EHint, EScope, EType, const CCallStack&) { - return nullptr; + return malloc(sz); } void CGameAllocator::FreeSecondary(void*) { diff --git a/Runtime/CMakeLists.txt b/Runtime/CMakeLists.txt index f31636384..bafef7cb0 100644 --- a/Runtime/CMakeLists.txt +++ b/Runtime/CMakeLists.txt @@ -48,6 +48,7 @@ add_library(RuntimeCommon CArchitectureQueue.hpp CArchitectureQueue.cpp IObj.hpp IVParamObj.hpp + CTimeProvider.hpp CTimeProvider.cpp CToken.hpp CAreaOctTree.hpp CAreaOctTree.cpp CActor.hpp CActor.cpp diff --git a/Runtime/MP1/CTweaks.cpp b/Runtime/MP1/CTweaks.cpp index e967deef8..216964356 100644 --- a/Runtime/MP1/CTweaks.cpp +++ b/Runtime/MP1/CTweaks.cpp @@ -26,6 +26,7 @@ static const SObjectTag& IDFromFactory(CResFactory& factory, const char* name) void CTweaks::RegisterTweaks() { +#if 0 CResFactory& factory = *g_ResFactory; CResLoader& loader = factory.GetLoader(); std::unique_ptr strm; @@ -37,6 +38,7 @@ void CTweaks::RegisterTweaks() strm.reset(loader.LoadNewResourceSync(IDFromFactory(factory, "PlayerControls"), nullptr)); TOneStatic playerControl(*strm); g_tweakPlayerControl = playerControl.GetAllocSpace(); +#endif } void CTweaks::RegisterResourceTweaks() diff --git a/Runtime/MP1/main.cpp b/Runtime/MP1/main.cpp index c80f33064..a9f94ea22 100644 --- a/Runtime/MP1/main.cpp +++ b/Runtime/MP1/main.cpp @@ -109,8 +109,8 @@ class CGameArchitectureSupport public: CGameArchitectureSupport() : m_audioSys(0,0,0,0,0), - m_inputGenerator(g_tweakPlayer->GetLeftLogicalThreshold(), - g_tweakPlayer->GetRightLogicalThreshold()) + m_inputGenerator(0.0f /*g_tweakPlayer->GetLeftLogicalThreshold()*/, + 0.0f /*g_tweakPlayer->GetRightLogicalThreshold()*/) { } bool Update() @@ -179,6 +179,7 @@ int main(int argc, const char* argv[]) std::setlocale(LC_ALL, "en-US.UTF-8"); #endif + LogVisor::RegisterConsoleLogger(); Retro::TOneStatic main; std::unique_ptr app = boo::ApplicationBootstrap(boo::IApplication::PLAT_AUTO, *main,