diff --git a/DataSpec/DNACommon/Tweaks/ITweakGame.hpp b/DataSpec/DNACommon/Tweaks/ITweakGame.hpp index 3297b05ea..b07636b6c 100644 --- a/DataSpec/DNACommon/Tweaks/ITweakGame.hpp +++ b/DataSpec/DNACommon/Tweaks/ITweakGame.hpp @@ -8,10 +8,13 @@ namespace DataSpec struct ITweakGame : BigYAML { - virtual const std::string& GetWorldPrefix() const=0; - virtual float GetFirstPersonFOV() const =0; + virtual const std::string& GetWorldPrefix() const = 0; + virtual bool GetSplashScreensDisabled() const = 0; + virtual float GetFirstPersonFOV() const = 0; + virtual float GetPressStartDelay() const = 0; + virtual float GetHardModeDamageMultiplier() const = 0; + virtual float GetHardModeWeaponMultiplier() const = 0; }; - } #endif diff --git a/DataSpec/DNAMP1/DNAMP1.cpp b/DataSpec/DNAMP1/DNAMP1.cpp index 47936d64b..900e4dbed 100644 --- a/DataSpec/DNAMP1/DNAMP1.cpp +++ b/DataSpec/DNAMP1/DNAMP1.cpp @@ -32,6 +32,7 @@ #include "Tweaks/CTweakPlayer.hpp" #include "Tweaks/CTweakCameraBob.hpp" #include "Tweaks/CTweakSlideShow.hpp" +#include "Tweaks/CTweakGame.hpp" namespace DataSpec { @@ -382,6 +383,8 @@ ResExtractor PAKBridge::LookupExtractor(const PAK& pak, const PAK::En return {ExtractTweak, {_S(".yaml")}}; if (!name.compare("SlideShow")) return {ExtractTweak, {_S(".yaml")}}; + if (!name.compare("Game")) + return {ExtractTweak, {_S(".yaml")}}; } break; } diff --git a/DataSpec/DNAMP1/Tweaks/CTweakGame.hpp b/DataSpec/DNAMP1/Tweaks/CTweakGame.hpp index ecf799d1e..31268c17f 100644 --- a/DataSpec/DNAMP1/Tweaks/CTweakGame.hpp +++ b/DataSpec/DNAMP1/Tweaks/CTweakGame.hpp @@ -17,9 +17,9 @@ struct CTweakGame : ITweakGame Value x28_unknown1; Value x29_unknown2; Value x2a_unknown3; - Value x2b_unknown4; - Value x2c_cunknown5; - Value x30_unknown6; + Value x2b_splashScreensDisabled; + Value x2c_unknown5; + Value x30_presStartDelay; Value x34_unknown7; Value x38_unknown8; Value x3c_unknown9; @@ -31,13 +31,21 @@ struct CTweakGame : ITweakGame Value x54_unknown15; Value x58_unknown16; Value x5c_unknown17; - Value x60_unknown18; - Value x64_hardmodeDamageMult; - Value x68_hardmodeWeaponMult; + Value x60_hardmodeDamageMult; + Value x64_hardmodeWeaponMult; virtual const std::string& GetWorldPrefix() const { return x4_worldPrefix; } + virtual bool GetSplashScreensDisabled() const { return x2b_splashScreensDisabled; } virtual float GetFirstPersonFOV() const { return x24_fov; } - CTweakGame(athena::io::IStreamReader& in) { this->read(in); x2b_unknown4 = false; } + virtual float GetPressStartDelay() const { return x30_presStartDelay; } + virtual float GetHardModeDamageMultiplier() const { return x60_hardmodeDamageMult; } + virtual float GetHardModeWeaponMultiplier() const { return x64_hardmodeWeaponMult; } + CTweakGame() = default; + CTweakGame(athena::io::IStreamReader& in) + { + this->read(in); + x2b_splashScreensDisabled = false; + } }; } } diff --git a/DataSpec/DNAMP1/Tweaks/CTweakPlayer.cpp b/DataSpec/DNAMP1/Tweaks/CTweakPlayer.cpp index 12bdeaa66..5f04b81e3 100644 --- a/DataSpec/DNAMP1/Tweaks/CTweakPlayer.cpp +++ b/DataSpec/DNAMP1/Tweaks/CTweakPlayer.cpp @@ -407,8 +407,8 @@ void CTweakPlayer::read(athena::io::IStreamReader& __dna_reader) x274_ = __dna_reader.readFloatBig(); /* x278_ */ x278_ = __dna_reader.readFloatBig(); - /* x27c_ */ - x27c_ = __dna_reader.readFloatBig(); + /* x27c_playerBallHalfExtent */ + x27c_playerBallHalfExtent = __dna_reader.readFloatBig(); /* x280_ */ x280_ = __dna_reader.readFloatBig(); /* x284_ */ @@ -847,8 +847,8 @@ void CTweakPlayer::write(athena::io::IStreamWriter& __dna_writer) const __dna_writer.writeFloatBig(x274_); /* x278_ */ __dna_writer.writeFloatBig(x278_); - /* x27c_ */ - __dna_writer.writeFloatBig(x27c_); + /* x27c_playerBallHalfExtent */ + __dna_writer.writeFloatBig(x27c_playerBallHalfExtent); /* x280_ */ __dna_writer.writeFloatBig(x280_); /* x284_ */ @@ -1362,8 +1362,8 @@ void CTweakPlayer::read(athena::io::YAMLDocReader& __dna_docin) x274_ = __dna_docin.readFloat("x274_"); /* x278_ */ x278_ = __dna_docin.readFloat("x278_"); - /* x27c_ */ - x27c_ = __dna_docin.readFloat("x27c_"); + /* x27c_playerBallHalfExtent */ + x27c_playerBallHalfExtent = __dna_docin.readFloat("x27c_playerBallHalfExtent"); /* x280_ */ x280_ = __dna_docin.readFloat("x280_"); /* x284_ */ @@ -1862,8 +1862,8 @@ void CTweakPlayer::CTweakPlayer::write(athena::io::YAMLDocWriter& __dna_docout) __dna_docout.writeFloat("x274_", x274_); /* x278_ */ __dna_docout.writeFloat("x278_", x278_); - /* x27c_ */ - __dna_docout.writeFloat("x27c_", x27c_); + /* x27c_playerBallHalfExtent */ + __dna_docout.writeFloat("x27c_playerBallHalfExtent", x27c_playerBallHalfExtent); /* x280_ */ __dna_docout.writeFloat("x280_", x280_); /* x284_ */ diff --git a/DataSpec/DNAMP1/Tweaks/CTweakPlayer.hpp b/DataSpec/DNAMP1/Tweaks/CTweakPlayer.hpp index e1fc0bd3b..cab110af4 100644 --- a/DataSpec/DNAMP1/Tweaks/CTweakPlayer.hpp +++ b/DataSpec/DNAMP1/Tweaks/CTweakPlayer.hpp @@ -138,7 +138,7 @@ struct CTweakPlayer : ITweakPlayer Value x270_playerXYHalfExtent; Value x274_; Value x278_; - Value x27c_; + Value x27c_playerBallHalfExtent; Value x280_; Value x284_; Value x288_; @@ -183,7 +183,7 @@ struct CTweakPlayer : ITweakPlayer float GetPlayerXYHalfExtent() const { return x270_playerXYHalfExtent; } float GetX274() const { return x274_; } float GetX278() const { return x278_; } - float GetX27C() const { return x27c_; } + float GetX27C() const { return x27c_playerBallHalfExtent; } float GetX124() const { return x134_; } bool GetX228_24() const { return x228_24_; } float GetX288() const { return x288_; } diff --git a/Editor/ViewManager.cpp b/Editor/ViewManager.cpp index 704c79341..9b5717670 100644 --- a/Editor/ViewManager.cpp +++ b/Editor/ViewManager.cpp @@ -56,7 +56,7 @@ void ViewManager::BuildTestPART(urde::IObjectStore& objStore) TLockedToken xrayPalette = objStore.GetObj("TXTR_XRayPalette"); m_particleView.reset(new ParticleView(*this, m_viewResources, *m_rootView, xrayPalette)); -#if 1 +#if 0 m_moviePlayer.reset(new CMoviePlayer("Video/SpecialEnding.thp", 1.f, false, true)); m_moviePlayer->SetFrame({-1.0f, 1.0f, 0.f}, {-1.0f, -1.0f, 0.f}, {1.0f, -1.0f, 0.f}, {1.0f, 1.0f, 0.f}); CDvdFile testRSF("Audio/frontend_1.rsf"); diff --git a/Editor/main.cpp b/Editor/main.cpp index 51688ab98..181de48ee 100644 --- a/Editor/main.cpp +++ b/Editor/main.cpp @@ -2,7 +2,7 @@ #include "boo/boo.hpp" #include "specter/specter.hpp" #include "hecl/CVarManager.hpp" -#include "Runtime/CGameAllocator.hpp" +#include "Runtime/CBasics.hpp" #include #include "ViewManager.hpp" diff --git a/Runtime/CBasicsPC.cpp b/Runtime/CBasicsPC.cpp index 6e099827e..184d2f25a 100644 --- a/Runtime/CBasicsPC.cpp +++ b/Runtime/CBasicsPC.cpp @@ -27,7 +27,7 @@ const u64 CBasics::TICKS_PER_SECOND = 60750000LL; #ifndef _WIN32 static struct tm* localtime_r(const time_t& time, struct tm& timeSt, long& gmtOff) { - auto ret = localtime_r(&time, &timeSt); + auto ret = ::localtime_r(&time, &timeSt); if (!ret) return nullptr; gmtOff = ret->tm_gmtoff; diff --git a/Runtime/CCallStack.hpp b/Runtime/CCallStack.hpp deleted file mode 100644 index 2ef5168c6..000000000 --- a/Runtime/CCallStack.hpp +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef __URDE_CCALLSTACK_HPP__ -#define __URDE_CCALLSTACK_HPP__ - -namespace urde -{ - -class CCallStack -{ - const char* x0_fileAndLineStr; - const char* x4_typeStr; -public: - CCallStack(const char* fileAndLineStr, const char* typeStr) - : x0_fileAndLineStr(fileAndLineStr), x4_typeStr(typeStr) {} - const char* GetFileAndLineText() const {return x0_fileAndLineStr;} - const char* GetTypeText() const {return x4_typeStr;} -}; - -} - -#endif // __URDE_CCALLSTACK_HPP__ diff --git a/Runtime/CGameAllocator.cpp b/Runtime/CGameAllocator.cpp deleted file mode 100644 index b8b9b921e..000000000 --- a/Runtime/CGameAllocator.cpp +++ /dev/null @@ -1,99 +0,0 @@ -#include "CGameAllocator.hpp" - -namespace urde -{ - -logvisor::Module AllocLog("CGameAllocator"); - -CGameAllocator::SGameMemInfo* CGameAllocator::FindFreeBlock(u32) -{ - return nullptr; -} -CGameAllocator::SGameMemInfo* CGameAllocator::FindFreeBlockFromTopOfHeap(u32) -{ - return nullptr; -} -u32 CGameAllocator::FixupAllocPtrs(SGameMemInfo*, u32, u32, EHint, const CCallStack&) -{ - return 0; -} -void CGameAllocator::UpdateAllocDebugStats(u32, u32, u32) -{ -} -bool CGameAllocator::FreeNormalAllocation(void*) -{ - return false; -} -u32 CGameAllocator::GetFreeBinEntryForSize(u32) -{ - return 0; -} -void CGameAllocator::AddFreeEntryToFreeList(SGameMemInfo*) -{ -} -void CGameAllocator::RemoveFreeEntryFromFreeList(SGameMemInfo*) -{ -} -void CGameAllocator::DumpAllocations() const -{ -} -u32 CGameAllocator::GetLargestFreeChunk() const -{ - return 0; -} -CGameAllocator::SGameMemInfo* CGameAllocator::GetMemInfoFromBlockPtr(void* ptr) -{ - return reinterpret_cast(reinterpret_cast(ptr) - 32); -} - -bool CGameAllocator::Initialize() -{ - return false; -} -void CGameAllocator::Shutdown() -{ -} -void* CGameAllocator::Alloc(size_t sz, EHint, EScope, EType, const CCallStack&) -{ - //AllocLog.report(logvisor::Warning, _S("Remind Phil to reimplement Alloc!!!!")); - return malloc(sz); -} -void CGameAllocator::Free(void* ptr) -{ - free(ptr); -} -void CGameAllocator::ReleaseAll() -{ -} -void* CGameAllocator::AllocSecondary(size_t sz, EHint, EScope, EType, const CCallStack&) -{ - return malloc(sz); -} -void CGameAllocator::FreeSecondary(void*) -{ -} -void CGameAllocator::ReleaseAllSecondary() -{ -} -void CGameAllocator::SetOutOfMemoryCallback(const TOutOfMemoryCallback cb, void* ctx) -{ - x58_oomCb = cb; - x5c_oomCtx = ctx; -} -int CGameAllocator::EnumAllocations(const TAllocationVisitCallback, void*, bool) const -{ - return 0; -} -CGameAllocator::SAllocInfo CGameAllocator::GetAllocInfo(void*) const -{ - return CGameAllocator::SAllocInfo(); -} -void CGameAllocator::OffsetFakeStatics(int) -{ -} -CGameAllocator::SMetrics CGameAllocator::GetMetrics() const -{ - return CGameAllocator::SMetrics(); -} - -} diff --git a/Runtime/CGameAllocator.hpp b/Runtime/CGameAllocator.hpp deleted file mode 100644 index 9fe2a9659..000000000 --- a/Runtime/CGameAllocator.hpp +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef __URDE_CGAMEALLOCATOR_HPP__ -#define __URDE_CGAMEALLOCATOR_HPP__ - -#include "IAllocator.hpp" - -namespace urde -{ -class CCallStack; - -class CGameAllocator : public IAllocator -{ -public: - struct SGameMemInfo - { - }; -private: - SGameMemInfo* x10_rootInfo = nullptr; - TOutOfMemoryCallback x58_oomCb = nullptr; - void* x5c_oomCtx = nullptr; - u32 xbc_fakeStaticOff = 0; -public: - SGameMemInfo* FindFreeBlock(u32); - SGameMemInfo* FindFreeBlockFromTopOfHeap(u32); - u32 FixupAllocPtrs(SGameMemInfo*, u32, u32, EHint, const CCallStack&); - void UpdateAllocDebugStats(u32, u32, u32); - bool FreeNormalAllocation(void*); - u32 GetFreeBinEntryForSize(u32); - void AddFreeEntryToFreeList(SGameMemInfo*); - void RemoveFreeEntryFromFreeList(SGameMemInfo*); - void DumpAllocations() const; - u32 GetLargestFreeChunk() const; - SGameMemInfo* GetMemInfoFromBlockPtr(void* ptr); - - bool Initialize(); - void Shutdown(); - void* Alloc(size_t, EHint, EScope, EType, const CCallStack&); - void Free(void*); - void ReleaseAll(); - void* AllocSecondary(size_t, EHint, EScope, EType, const CCallStack&); - void FreeSecondary(void*); - void ReleaseAllSecondary(); - void SetOutOfMemoryCallback(const TOutOfMemoryCallback, void*); - int EnumAllocations(const TAllocationVisitCallback, void*, bool) const; - SAllocInfo GetAllocInfo(void*) const; - void OffsetFakeStatics(int); - SMetrics GetMetrics() const; -}; - -} - -#endif // __URDE_CGAMEALLOCATOR_HPP__ diff --git a/Runtime/CGameState.cpp b/Runtime/CGameState.cpp index 16d456635..82acf3643 100644 --- a/Runtime/CGameState.cpp +++ b/Runtime/CGameState.cpp @@ -286,4 +286,14 @@ CWorldState& CGameState::StateForWorld(ResId mlvlId) return *it; } +float CGameState::GetHardModeDamageMultiplier() const +{ + return g_tweakGame->GetHardModeDamageMultiplier(); +} + +float CGameState::GetHardModeWeaponMultiplier() const +{ + return g_tweakGame->GetHardModeWeaponMultiplier(); +} + } diff --git a/Runtime/CGameState.hpp b/Runtime/CGameState.hpp index eeb83ddac..2f98c8055 100644 --- a/Runtime/CGameState.hpp +++ b/Runtime/CGameState.hpp @@ -113,6 +113,8 @@ public: void WriteBackupBuf(); void SetCardSerial(u64 serial) { x210_cardSerial = serial; } void PutTo(CBitStreamWriter& writer) const; + float GetHardModeDamageMultiplier() const; + float GetHardModeWeaponMultiplier() const; struct GameFileStateInfo { diff --git a/Runtime/CMakeLists.txt b/Runtime/CMakeLists.txt index feef0f7ad..6e442ce38 100644 --- a/Runtime/CMakeLists.txt +++ b/Runtime/CMakeLists.txt @@ -26,7 +26,7 @@ if(WIN32) elseif(APPLE) list(APPEND PLAT_SRCS CMemoryCardSysOSX.cpp) else() - list(APPEND PLAT_SRCS CMemoryCardSysNix.cpp CCallStackNix.cpp) + list(APPEND PLAT_SRCS CMemoryCardSysNix.cpp) endif() add_subdirectory(MP1) @@ -48,14 +48,11 @@ add_library(RuntimeCommon ${PARTICLE_SOURCES} ${WORLD_SOURCES} ${WEAPON_SOURCES} - #CMemory.hpp CMemory.cpp ITweak.hpp IMain.hpp CMemoryCardSys.hpp CMemoryCardSys.cpp CScannableObjectInfo.hpp CScannableObjectInfo.cpp CSaveWorld.hpp CSaveWorld.cpp - IAllocator.hpp IAllocator.cpp - CGameAllocator.hpp CGameAllocator.cpp CDependencyGroup.hpp CDependencyGroup.cpp CBasics.hpp CBasicsPC.cpp CIOWin.hpp @@ -91,7 +88,6 @@ add_library(RuntimeCommon CFactoryMgr.hpp CFactoryMgr.cpp CPakFile.hpp CPakFile.cpp CStringExtras.hpp - CCallStack.hpp IOStreams.hpp IOStreams.cpp CMainFlowBase.hpp CMainFlowBase.cpp CMFGameBase.hpp diff --git a/Runtime/CMemory.cpp b/Runtime/CMemory.cpp deleted file mode 100644 index 88a8eec16..000000000 --- a/Runtime/CMemory.cpp +++ /dev/null @@ -1,146 +0,0 @@ -#if 0 - -#include "CMemory.hpp" -#include "CGameAllocator.hpp" -#include "CCallStack.hpp" -#include "logvisor/logvisor.hpp" - -namespace urde -{ - -static logvisor::Module Log("CMemory"); - -static CGameAllocator g_gameAllocator; -static IAllocator* g_memoryAllocator = &g_gameAllocator; -static bool g_memoryAllocatorReady = false; - -void CMemory::Startup() -{ - g_memoryAllocatorReady = g_memoryAllocator->Initialize(); -} - -void CMemory::Shutdown() -{ - g_memoryAllocator->Shutdown(); - g_memoryAllocatorReady = false; -} - -void CMemory::SetAllocator(IAllocator& alloc) -{ - if (&alloc != g_memoryAllocator) - { - g_memoryAllocator = &alloc; - g_memoryAllocator->Initialize(); - } -} - -void CMemory::OffsetFakeStatics(int val) -{ - g_memoryAllocator->OffsetFakeStatics(val); -} - -void CMemory::SetOutOfMemoryCallback(const IAllocator::TOutOfMemoryCallback cb, void* ctx) -{ - g_memoryAllocator->SetOutOfMemoryCallback(cb, ctx); -} - -void CMemory::Free(void* ptr) -{ - g_memoryAllocator->Free(ptr); -} - -void* CMemory::Alloc(size_t sz, IAllocator::EHint hint, IAllocator::EScope scope, - IAllocator::EType type, const CCallStack& cs) -{ - void* newPtr = g_memoryAllocator->Alloc(sz, hint, scope, type, cs); - if (!newPtr) - Log.report(logvisor::Error, "Alloc Failed! - Size %d", sz); - return newPtr; -} - -CMemorySys::CMemorySys(IAllocator& alloc) -{ - CMemory::Startup(); - CMemory::SetAllocator(alloc); -} - -CMemorySys::~CMemorySys() -{ - CMemory::Shutdown(); -} - -IAllocator& CMemorySys::GetGameAllocator() {return g_gameAllocator;} - -} - -void* operator new(std::size_t sz) -{ - if (!urde::g_memoryAllocatorReady) - return malloc(sz); - urde::CCallStack cs("?\?(?\?)", "UnknownType"); - return urde::CMemory::Alloc(sz, - urde::IAllocator::EHint::None, - urde::IAllocator::EScope::Default, - urde::IAllocator::EType::Primitive, - cs); -} - -void* operator new(std::size_t sz, - const char* funcName, const char* typeName) -{ - if (!urde::g_memoryAllocatorReady) - return malloc(sz); - urde::CCallStack cs(funcName, typeName); - return urde::CMemory::Alloc(sz, - urde::IAllocator::EHint::None, - urde::IAllocator::EScope::Default, - urde::IAllocator::EType::Primitive, - cs); -} - -void operator delete(void* ptr) noexcept -{ - if (!urde::g_memoryAllocatorReady) - { - free(ptr); - return; - } - urde::CMemory::Free(ptr); -} - -void* operator new[](std::size_t sz) -{ - if (!urde::g_memoryAllocatorReady) - return malloc(sz); - urde::CCallStack cs("?\?(?\?)", "UnknownType"); - return urde::CMemory::Alloc(sz, - urde::IAllocator::EHint::None, - urde::IAllocator::EScope::Default, - urde::IAllocator::EType::Array, - cs); -} - -void* operator new[](std::size_t sz, - const char* funcName, const char* typeName) -{ - if (!urde::g_memoryAllocatorReady) - return malloc(sz); - urde::CCallStack cs(funcName, typeName); - return urde::CMemory::Alloc(sz, - urde::IAllocator::EHint::None, - urde::IAllocator::EScope::Default, - urde::IAllocator::EType::Array, - cs); -} - -void operator delete[](void* ptr) noexcept -{ - if (!urde::g_memoryAllocatorReady) - { - free(ptr); - return; - } - urde::CMemory::Free(ptr); -} - -#endif diff --git a/Runtime/CMemory.hpp b/Runtime/CMemory.hpp deleted file mode 100644 index 638deb3bb..000000000 --- a/Runtime/CMemory.hpp +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef __URDE_CMEMORY_HPP__ -#define __URDE_CMEMORY_HPP__ - -#if 0 - -#include "IAllocator.hpp" - -namespace urde -{ -class COsContext; - -class CMemory -{ -public: - static void Startup(); - static void Shutdown(); - static void SetAllocator(IAllocator&); - static void OffsetFakeStatics(int); - static void SetOutOfMemoryCallback(const IAllocator::TOutOfMemoryCallback, void*); - static void Free(void*); - static void* Alloc(size_t, IAllocator::EHint, IAllocator::EScope, IAllocator::EType, const CCallStack&); -}; - -class CMemorySys -{ -public: - CMemorySys(IAllocator&); - ~CMemorySys(); - static IAllocator& GetGameAllocator(); -}; - -} - -/* Custom new funcs */ -void* operator new(std::size_t sz, const char* funcName, const char* typeName); -void* operator new[](std::size_t sz, const char* funcName, const char* typeName); - -#endif - -#endif // __URDE_CMEMORY_HPP__ diff --git a/Runtime/CResLoader.cpp b/Runtime/CResLoader.cpp index cd8ec2eb7..d9c905c57 100644 --- a/Runtime/CResLoader.cpp +++ b/Runtime/CResLoader.cpp @@ -1,7 +1,5 @@ #include "CResLoader.hpp" #include "CPakFile.hpp" -#include "CMemory.hpp" -#include "CCallStack.hpp" namespace urde { diff --git a/Runtime/IAllocator.cpp b/Runtime/IAllocator.cpp deleted file mode 100644 index fdc53541d..000000000 --- a/Runtime/IAllocator.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include "IAllocator.hpp" - -namespace urde -{ - -} diff --git a/Runtime/IAllocator.hpp b/Runtime/IAllocator.hpp deleted file mode 100644 index 15b778fda..000000000 --- a/Runtime/IAllocator.hpp +++ /dev/null @@ -1,79 +0,0 @@ -#ifndef __URDE_IALLOCATOR_HPP__ -#define __URDE_IALLOCATOR_HPP__ - -#include "RetroTypes.hpp" - -namespace urde -{ -class COsContext; -class CCallStack; - -class IAllocator -{ -public: - virtual ~IAllocator() {} - enum class EHint - { - None = 0x0, - TopOfHeap = 0x1, - Large = 0x2 - }; - enum class EScope - { - None = 0, - Default = 1 - }; - enum class EType - { - Primitive = 0, - Array = 1 - }; - struct SAllocInfo - { - }; - struct SMetrics - { - u32 a; - u32 b; - u32 c; - u32 d; - u32 e; - u32 f; - u32 g; - u32 h; - u32 i; - u32 j; - u32 k; - u32 l; - u32 m; - u32 n; - u32 o; - u32 p; - u32 q; - u32 r; - u32 s; - u32 t; - u32 u; - u32 v; - }; - typedef bool(*TOutOfMemoryCallback)(void*, u32); - typedef bool(*TAllocationVisitCallback)(const SAllocInfo&, void*); - - virtual bool Initialize()=0; - virtual void Shutdown()=0; - virtual void* Alloc(size_t, EHint, EScope, EType, const CCallStack&)=0; - virtual void Free(void*)=0; - virtual void ReleaseAll()=0; - virtual void* AllocSecondary(size_t, EHint, EScope, EType, const CCallStack&)=0; - virtual void FreeSecondary(void*)=0; - virtual void ReleaseAllSecondary()=0; - virtual void SetOutOfMemoryCallback(const TOutOfMemoryCallback, void*)=0; - virtual int EnumAllocations(const TAllocationVisitCallback, void*, bool) const=0; - virtual SAllocInfo GetAllocInfo(void*) const=0; - virtual void OffsetFakeStatics(int)=0; - virtual SMetrics GetMetrics() const=0; -}; - -} - -#endif // __URDE_IALLOCATOR_HPP__ diff --git a/Runtime/IOStreams.cpp b/Runtime/IOStreams.cpp index 942129ecf..4bd961cba 100644 --- a/Runtime/IOStreams.cpp +++ b/Runtime/IOStreams.cpp @@ -1,5 +1,4 @@ #include "IOStreams.hpp" -#include "CMemory.hpp" namespace urde { diff --git a/Runtime/CCallStackNix.cpp b/Runtime/MP1/CBabygoth.cpp similarity index 100% rename from Runtime/CCallStackNix.cpp rename to Runtime/MP1/CBabygoth.cpp diff --git a/Runtime/MP1/CBabygoth.hpp b/Runtime/MP1/CBabygoth.hpp new file mode 100644 index 000000000..e23a27ca0 --- /dev/null +++ b/Runtime/MP1/CBabygoth.hpp @@ -0,0 +1,51 @@ +#ifndef __URDE_MP1_CBABYGOTH_HPP__ +#define __URDE_MP1_CBABYGOTH_HPP__ + +#include "World/CPatterned.hpp" + +namespace urde +{ +class CBabygothData +{ + float x0_; + float x4_; + u32 x8_; + CDamageInfo xc_; + CDamageInfo x28_; + u32 x44_; + u32 x48_; + CDamageInfo x4c_; + CDamageVulnerability x68_; + CDamageVulnerability xd0_; + u32 x138_; + u32 x13c_; + float x140_; + s16 x144_; + u32 x148_; + u32 x14c_; + u32 x150_; + u32 x154_; + s16 x158_; + s16 x15a_; + s16 x15c_; + float x160_; + float x164_; + float x168_; + u32 x16c_; + s16 x170_; + u32 x174_; +public: + CBabygothData(CInputStream&); + ResId GetShellModelResId() const; + void GetFireballDamage() const; + ResId GetFireballResID() const; + const CDamageVulnerability& GetShellDamageVulnerability() const; + void GetSHellHitPoints() const; + void GetFireballAttackVariance() const; + void GetFireballAttackTime() const; + void GetFireBreathDamage() const; + ResId GetFireBreathResId() const; +}; + +} +#endif // __URDE_MP1_CBABYGOTH_HPP__ diff --git a/Runtime/MP1/CMakeLists.txt b/Runtime/MP1/CMakeLists.txt index ab46ee27a..6acb42859 100644 --- a/Runtime/MP1/CMakeLists.txt +++ b/Runtime/MP1/CMakeLists.txt @@ -16,6 +16,7 @@ set(MP1_SOURCES CBeetle.hpp CBeetle.cpp CWarWasp.hpp CWarWasp.cpp CSpacePirate.hpp CSpacePirate.cpp + CBabygoth.hpp CBabygoth.cpp CSaveUI.hpp CSaveUI.cpp CMemoryCardDriver.hpp CMemoryCardDriver.cpp MP1.hpp MP1.cpp) diff --git a/Runtime/MP1/MP1.hpp b/Runtime/MP1/MP1.hpp index c0109af85..be06d6167 100644 --- a/Runtime/MP1/MP1.hpp +++ b/Runtime/MP1/MP1.hpp @@ -4,7 +4,6 @@ #define MP1_USE_BOO 0 #include "IMain.hpp" -#include "CMemory.hpp" #include "CTweaks.hpp" #include "CPlayMovie.hpp" #include "IOStreams.hpp"