diff --git a/CMakeLists.txt b/CMakeLists.txt index e17aace8b..85c521786 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0) project(PathShagged) if(MSVC) # Shaddup MSVC - add_definitions(-DUNICODE=1 -D_UNICODE=1 -D_CRT_SECURE_NO_WARNINGS=1 /wd4267 /wd4244) + add_definitions(-DUNICODE=1 -D_UNICODE=1 -D_CRT_SECURE_NO_WARNINGS=1 -DD_SCL_SECURE_NO_WARNINGS=1 /wd4267 /wd4244 /wd4305) else() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-multichar -fno-exceptions") endif() diff --git a/DataSpec/CMakeLists.txt b/DataSpec/CMakeLists.txt index 9f0635cb7..b4d93852d 100644 --- a/DataSpec/CMakeLists.txt +++ b/DataSpec/CMakeLists.txt @@ -5,9 +5,10 @@ find_package(atdna REQUIRED) # Assembles a source/header pair list for use in a DNA library macro(make_dnalist outlist) - foreach(type ${ARGN}) + foreach(type ${ARGN}) get_filename_component(dir ${type} DIRECTORY) if(dir) + file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${dir}") set(dir "${dir}/") endif() get_filename_component(name ${type} NAME) diff --git a/DataSpec/DNACommon/ANCS.hpp b/DataSpec/DNACommon/ANCS.hpp index 81c8bba27..40d89b0ae 100644 --- a/DataSpec/DNACommon/ANCS.hpp +++ b/DataSpec/DNACommon/ANCS.hpp @@ -108,7 +108,7 @@ bool ReadANCSToBlender(HECL::BlenderConnection& conn, if (cmdlE) { HECL::ProjectPath cmdlPath = pakRouter.getWorking(cmdlE); - os.linkBlend(cmdlPath.getAbsolutePath(), pakRouter.getBestEntryName(*cmdlE), true); + os.linkBlend(cmdlPath.getAbsolutePathUTF8(), pakRouter.getBestEntryName(*cmdlE), true); /* Attach CMDL to CINF */ os << "if obj.name not in bpy.context.scene.objects:\n" diff --git a/DataSpec/DNACommon/ANIM.cpp b/DataSpec/DNACommon/ANIM.cpp index 412a5e2c5..1aa01a33b 100644 --- a/DataSpec/DNACommon/ANIM.cpp +++ b/DataSpec/DNACommon/ANIM.cpp @@ -1,3 +1,5 @@ +#define _USE_MATH_DEFINES +#include #include "ANIM.hpp" namespace Retro diff --git a/DataSpec/DNACommon/ANIM.hpp b/DataSpec/DNACommon/ANIM.hpp index 28b62a25a..189c0f8fd 100644 --- a/DataSpec/DNACommon/ANIM.hpp +++ b/DataSpec/DNACommon/ANIM.hpp @@ -1,7 +1,6 @@ #ifndef _DNACOMMON_ANIMBITSTREAM_HPP_ #define _DNACOMMON_ANIMBITSTREAM_HPP_ -#include #include "DNACommon.hpp" namespace Retro diff --git a/DataSpec/DNACommon/CMDL.hpp b/DataSpec/DNACommon/CMDL.hpp index e32a25915..247f5230e 100644 --- a/DataSpec/DNACommon/CMDL.hpp +++ b/DataSpec/DNACommon/CMDL.hpp @@ -204,7 +204,7 @@ public: } operator bool() { - return *m_cur && ((m_cur - m_dl.get()) < m_dlSize); + return *m_cur && ((m_cur - m_dl.get()) < intptr_t(m_dlSize)); } GX::Primitive readPrimitive() { @@ -618,7 +618,7 @@ bool ReadCMDLToBlender(HECL::BlenderConnection& conn, os.format("materials[%u].pass_index = %u\n", sHead.matIdx, surfIdx++); if (matUVCount > createdUVLayers) { - for (int l=createdUVLayers ; l m_words; size_t m_bitCount = 0; +public: void read(Athena::io::IStreamReader& reader, size_t bitCount) { m_bitCount = bitCount; diff --git a/DataSpec/DNACommon/PAK.hpp b/DataSpec/DNACommon/PAK.hpp index 6214bab66..cad367002 100644 --- a/DataSpec/DNACommon/PAK.hpp +++ b/DataSpec/DNACommon/PAK.hpp @@ -93,7 +93,7 @@ struct ResExtractor std::function func_a; std::function&, const typename PAKBRIDGE::PAKType::Entry&, bool)> func_b; - const char* fileExts[4]; + const HECL::SystemChar* fileExts[4]; unsigned weight; }; @@ -200,7 +200,11 @@ public: const HECL::ProjectPath& pakPath = m_bridgePaths[uniqueSearch->second.first].first; pakPath.makeDir(); HECL::ProjectPath uniquePath = entry->unique.uniquePath(pakPath); +#if HECL_UCS2 + HECL::SystemString entName = HECL::UTF8ToWide(m_pak->bestEntryName(*entry)); +#else HECL::SystemString entName = m_pak->bestEntryName(*entry); +#endif if (extractor.fileExts[0] && !extractor.fileExts[1]) entName += extractor.fileExts[0]; return HECL::ProjectPath(uniquePath, entName); @@ -210,7 +214,11 @@ public: { const HECL::ProjectPath& pakPath = m_bridgePaths[m_curBridgeIdx].first; HECL::ProjectPath uniquePathPre = entry->unique.uniquePath(pakPath); +#if HECL_UCS2 + HECL::SystemString entBase = HECL::UTF8ToWide(m_pak->bestEntryName(*entry)); +#else HECL::SystemString entBase = m_pak->bestEntryName(*entry); +#endif HECL::SystemString entName = entBase; if (extractor.fileExts[0] && !extractor.fileExts[1]) entName += extractor.fileExts[0]; @@ -290,7 +298,7 @@ public: HECL::ProjectPath aPath = getWorking(&a, BRIDGETYPE::LookupExtractor(a)); HECL::SystemString ret; for (int i=0 ; i& pakRouter, - const typename PAKRouter::EntryType& entry, + const PAKRouter::EntryType& entry, unsigned setIdx, const SpecBase& dataspec) { diff --git a/DataSpec/DNAMP1/DNAMP1.cpp b/DataSpec/DNAMP1/DNAMP1.cpp index dd8de08fe..72cdd0f4e 100644 --- a/DataSpec/DNAMP1/DNAMP1.cpp +++ b/DataSpec/DNAMP1/DNAMP1.cpp @@ -104,7 +104,7 @@ UniqueResult PAKBridge::uniqueCheck(const PAK::Entry& entry) static HECL::SystemString LayerName(const std::string& name) { #if HECL_UCS2 - HECL::SystemString ret = HECL::UTF8ToWide(mlvl.layerNames[layerIdx++]); + HECL::SystemString ret = HECL::UTF8ToWide(name); #else HECL::SystemString ret = name; #endif @@ -177,15 +177,15 @@ ResExtractor PAKBridge::LookupExtractor(const PAK::Entry& entry) switch (entry.type) { case SBIG('STRG'): - return {STRG::Extract, nullptr, {".yaml"}}; + return {STRG::Extract, nullptr, {_S(".yaml")}}; case SBIG('TXTR'): - return {TXTR::Extract, nullptr, {".png"}}; + return {TXTR::Extract, nullptr, {_S(".png")}}; case SBIG('CMDL'): - return {nullptr, CMDL::Extract, {".blend"}, 2}; + return {nullptr, CMDL::Extract, {_S(".blend")}, 2}; case SBIG('ANCS'): - return {nullptr, ANCS::Extract, {".yaml", ".blend"}, 1}; + return {nullptr, ANCS::Extract, {_S(".yaml"), _S(".blend")}, 1}; case SBIG('MLVL'): - return {MLVL::Extract, nullptr, {".yaml"}}; + return {MLVL::Extract, nullptr, {_S(".yaml")}}; } return {}; } diff --git a/DataSpec/DNAMP2/ANIM.cpp b/DataSpec/DNAMP2/ANIM.cpp index 43a093c1b..f46f56fc5 100644 --- a/DataSpec/DNAMP2/ANIM.cpp +++ b/DataSpec/DNAMP2/ANIM.cpp @@ -379,7 +379,7 @@ void ANIM::ANIM2::read(Athena::io::IStreamReader& reader) { ChannelDesc desc; desc.read(reader); - bones.emplace_back(desc.id, std::make_tuple(desc.keyCount1, desc.keyCount2, desc.keyCount3)); + bones.emplace_back(desc.id, std::make_tuple(desc.keyCount1 != 0, desc.keyCount2 != 0, desc.keyCount3 != 0)); if (desc.keyCount1) { diff --git a/DataSpec/DNAMP2/CMDLMaterials.hpp b/DataSpec/DNAMP2/CMDLMaterials.hpp index d5991f418..31227674e 100644 --- a/DataSpec/DNAMP2/CMDLMaterials.hpp +++ b/DataSpec/DNAMP2/CMDLMaterials.hpp @@ -65,7 +65,7 @@ struct MaterialSet : BigDNA inline void readToBlender(HECL::BlenderConnection::PyOutStream& os, const PAKRouter& pakRouter, - const typename PAKRouter::EntryType& entry, + const PAKRouter::EntryType& entry, unsigned setIdx, const SpecBase& dataspec) { diff --git a/DataSpec/DNAMP2/DNAMP2.cpp b/DataSpec/DNAMP2/DNAMP2.cpp index fe56bdfc1..c281a3d33 100644 --- a/DataSpec/DNAMP2/DNAMP2.cpp +++ b/DataSpec/DNAMP2/DNAMP2.cpp @@ -103,7 +103,7 @@ UniqueResult PAKBridge::uniqueCheck(const DNAMP1::PAK::Entry& entry) static HECL::SystemString LayerName(const std::string& name) { #if HECL_UCS2 - HECL::SystemString ret = HECL::UTF8ToWide(mlvl.layerNames[layerIdx++]); + HECL::SystemString ret = HECL::UTF8ToWide(name); #else HECL::SystemString ret = name; #endif @@ -138,7 +138,6 @@ void PAKBridge::build() } if (areaDeps.name.empty()) { - areaDeps.name = area.internalAreaName; #if HECL_UCS2 areaDeps.name = HECL::UTF8ToWide(area.internalAreaName); #else @@ -185,13 +184,13 @@ ResExtractor PAKBridge::LookupExtractor(const DNAMP1::PAK::Entry& ent switch (entry.type) { case SBIG('STRG'): - return {STRG::Extract, nullptr, {".yaml"}}; + return {STRG::Extract, nullptr, {_S(".yaml")}}; case SBIG('TXTR'): - return {TXTR::Extract, nullptr, {".png"}}; + return {TXTR::Extract, nullptr, {_S(".png")}}; case SBIG('CMDL'): - return {nullptr, CMDL::Extract, {".blend"}, 2}; + return {nullptr, CMDL::Extract, {_S(".blend")}, 2}; case SBIG('ANCS'): - return {nullptr, ANCS::Extract, {".yaml", ".blend"}, 1}; + return {nullptr, ANCS::Extract, {_S(".yaml"), _S(".blend")}, 1}; } return {}; } diff --git a/DataSpec/DNAMP3/CMDLMaterials.hpp b/DataSpec/DNAMP3/CMDLMaterials.hpp index d05335557..398f454c5 100644 --- a/DataSpec/DNAMP3/CMDLMaterials.hpp +++ b/DataSpec/DNAMP3/CMDLMaterials.hpp @@ -190,7 +190,7 @@ struct MaterialSet : BigDNA inline void readToBlender(HECL::BlenderConnection::PyOutStream& os, const PAKRouter& pakRouter, - const typename PAKRouter::EntryType& entry, + const PAKRouter::EntryType& entry, unsigned setIdx, const SpecBase& dataspec) { diff --git a/DataSpec/DNAMP3/DNAMP3.cpp b/DataSpec/DNAMP3/DNAMP3.cpp index 82df96de3..64603ae55 100644 --- a/DataSpec/DNAMP3/DNAMP3.cpp +++ b/DataSpec/DNAMP3/DNAMP3.cpp @@ -58,11 +58,11 @@ ResExtractor PAKBridge::LookupExtractor(const PAK::Entry& entry) switch (entry.type) { case SBIG('STRG'): - return {STRG::Extract, nullptr, {".yaml"}}; + return {STRG::Extract, nullptr, {_S(".yaml")}}; case SBIG('TXTR'): - return {TXTR::Extract, nullptr, {".png"}}; + return {TXTR::Extract, nullptr, {_S(".png")}}; case SBIG('CMDL'): - return {nullptr, CMDL::Extract, {".blend"}, 1}; + return {nullptr, CMDL::Extract, {_S(".blend")}, 1}; } return {}; } diff --git a/MathLib b/MathLib index 151b0e633..60be8cd29 160000 --- a/MathLib +++ b/MathLib @@ -1 +1 @@ -Subproject commit 151b0e63338a8f8645f908e48fb7423795224690 +Subproject commit 60be8cd2999b139c4fe29071b6e2b842b62850ff diff --git a/Runtime/Audio/CAudioStateWin.hpp b/Runtime/Audio/CAudioStateWin.hpp index abeb65fac..839270845 100644 --- a/Runtime/Audio/CAudioStateWin.hpp +++ b/Runtime/Audio/CAudioStateWin.hpp @@ -10,8 +10,9 @@ class CAudioStateWin : public CIOWin { public: CAudioStateWin() : CIOWin("CAudioStateWin") {} - virtual CIOWin::EMessageReturn OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue) + CIOWin::EMessageReturn OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue) { + return MsgRetNormal; } }; diff --git a/Runtime/CDvdFile.hpp b/Runtime/CDvdFile.hpp index 77da5f6a4..71b7072ef 100644 --- a/Runtime/CDvdFile.hpp +++ b/Runtime/CDvdFile.hpp @@ -27,11 +27,11 @@ public: void UpdateFilePos(int) {} void CalcFileOffset(int, ESeekOrigin) {} static void internalCallback(s32, DVDFileInfo*) {} - static bool FileExists(const char*) {} + static bool FileExists(const char*) {return false;} void CloseFile() {} - CDvdRequest* AsyncSeekRead(void*, u32, ESeekOrigin, int) {} + CDvdRequest* AsyncSeekRead(void*, u32, ESeekOrigin, int) {return nullptr;} void SyncSeekRead(void*, u32, ESeekOrigin, int) {} - CDvdRequest* AsyncRead(void*, u32) {} + CDvdRequest* AsyncRead(void*, u32) {return nullptr;} void SyncRead(void*, u32) {} void StallForARAMFile() {} void StartARAMFileLoad() {} diff --git a/Runtime/CGameAllocator.cpp b/Runtime/CGameAllocator.cpp index fa90ef664..acc0a25a6 100644 --- a/Runtime/CGameAllocator.cpp +++ b/Runtime/CGameAllocator.cpp @@ -5,21 +5,26 @@ namespace Retro 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*) { @@ -32,6 +37,7 @@ void CGameAllocator::DumpAllocations() const } u32 CGameAllocator::GetLargestFreeChunk() const { + return 0; } CGameAllocator::SGameMemInfo* CGameAllocator::GetMemInfoFromBlockPtr(void* ptr) { @@ -40,12 +46,14 @@ CGameAllocator::SGameMemInfo* CGameAllocator::GetMemInfoFromBlockPtr(void* ptr) bool CGameAllocator::Initialize() { + return false; } void CGameAllocator::Shutdown() { } void* CGameAllocator::Alloc(size_t, EHint, EScope, EType, const CCallStack&) { + return nullptr; } void CGameAllocator::Free(void*) { @@ -55,6 +63,7 @@ void CGameAllocator::ReleaseAll() } void* CGameAllocator::AllocSecondary(size_t, EHint, EScope, EType, const CCallStack&) { + return nullptr; } void CGameAllocator::FreeSecondary(void*) { @@ -69,15 +78,18 @@ void CGameAllocator::SetOutOfMemoryCallback(const TOutOfMemoryCallback cb, void* } 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/CGameOptions.hpp b/Runtime/CGameOptions.hpp index e27d929ce..4b45af75c 100644 --- a/Runtime/CGameOptions.hpp +++ b/Runtime/CGameOptions.hpp @@ -1,17 +1,19 @@ #ifndef __RETRO_CGAMEOPTIONS_HPP__ #define __RETRO_CGAMEOPTIONS_HPP__ +#include "RetroTypes.hpp" + namespace Retro { class CGameOptions { - char a = 0; - char b = 0; - char c = 128; - char d = 128; - char e = 255; - char f = 255; + u8 a = 0; + u8 b = 0; + u8 c = 128; + u8 d = 128; + u8 e = 255; + u8 f = 255; bool g = true; }; diff --git a/Runtime/CMakeLists.txt b/Runtime/CMakeLists.txt index d69afa9d5..7ada7b683 100644 --- a/Runtime/CMakeLists.txt +++ b/Runtime/CMakeLists.txt @@ -1,4 +1,4 @@ -include_directories(${BOO_INCLUDE_DIR}) +include_directories(${BOO_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR}) add_subdirectory(Audio) add_subdirectory(Character) diff --git a/Runtime/CMoviePlayer.cpp b/Runtime/CMoviePlayer.cpp index 24178117c..ce1ce135c 100644 --- a/Runtime/CMoviePlayer.cpp +++ b/Runtime/CMoviePlayer.cpp @@ -35,15 +35,19 @@ void CMoviePlayer::Rewind() bool CMoviePlayer::GetIsMovieFinishedPlaying() const { + return false; } bool CMoviePlayer::GetIsFullyCached() const { + return false; } float CMoviePlayer::GetPlayedSeconds() const { + return 0.0; } float CMoviePlayer::GetTotalSeconds() const { + return 0.0; } void CMoviePlayer::SetPlayMode(EPlayMode mode) { diff --git a/Runtime/CNODDvdRequest.cpp b/Runtime/CNODDvdRequest.cpp index 4221fe89f..2c5f67a08 100644 --- a/Runtime/CNODDvdRequest.cpp +++ b/Runtime/CNODDvdRequest.cpp @@ -8,6 +8,7 @@ void CNODDvdRequest::WaitUntilComplete() } bool CNODDvdRequest::IsComplete() { + return false; } void CNODDvdRequest::PostCancelRequest() { diff --git a/Runtime/CPakFile.hpp b/Runtime/CPakFile.hpp index 2caf6bebd..a51bd0e7e 100644 --- a/Runtime/CPakFile.hpp +++ b/Runtime/CPakFile.hpp @@ -44,9 +44,9 @@ public: return &p.second; return nullptr; } - const SResInfo* GetResInfoForLoad(u32 id) {} - const SResInfo* GetResInfo(u32 id) const {} - u32 GetFakeStaticSize() const {} + const SResInfo* GetResInfoForLoad(u32 id) {return nullptr;} + const SResInfo* GetResInfo(u32 id) const {return nullptr;} + u32 GetFakeStaticSize() const {return 0;} void DataLoad() {} void InitialHeaderLoad() {} void Warmup() {} diff --git a/Runtime/CPlayMovieBase.hpp b/Runtime/CPlayMovieBase.hpp index 0aac31d9b..542a4e5d7 100644 --- a/Runtime/CPlayMovieBase.hpp +++ b/Runtime/CPlayMovieBase.hpp @@ -13,7 +13,7 @@ class CPlayMovieBase : public CIOWin public: CPlayMovieBase(const char* iowName, const char* path) : CIOWin(iowName), x18_moviePlayer(path, 0.0, false) {} - EMessageReturn OnMessage(const CArchitectureMessage&, CArchitectureQueue&) {} + EMessageReturn OnMessage(const CArchitectureMessage&, CArchitectureQueue&) {return MsgRetNormal;} void Draw() const {} }; diff --git a/Runtime/CResFactory.cpp b/Runtime/CResFactory.cpp index 580481492..9d74e5408 100644 --- a/Runtime/CResFactory.cpp +++ b/Runtime/CResFactory.cpp @@ -1,10 +1,12 @@ #include "CResFactory.hpp" +#include "IObj.hpp" namespace Retro { std::unique_ptr CResFactory::Build(const SObjectTag&, const CVParamTransfer&) { + return std::unique_ptr(); } void CResFactory::BuildAsync(const SObjectTag&, const CVParamTransfer&, IObj**) { diff --git a/Runtime/CResLoader.cpp b/Runtime/CResLoader.cpp index 2063d3858..6773e340b 100644 --- a/Runtime/CResLoader.cpp +++ b/Runtime/CResLoader.cpp @@ -135,7 +135,7 @@ FourCC CResLoader::GetResourceTypeById(u32 id) { if (FindResource(id)) return x50_cachedResInfo->x0_type; - return false; + return FourCC(); } const SObjectTag* CResLoader::GetResourceIdByName(const char* name) const diff --git a/Runtime/CResLoader.hpp b/Runtime/CResLoader.hpp index b3b111d9d..fad79efe5 100644 --- a/Runtime/CResLoader.hpp +++ b/Runtime/CResLoader.hpp @@ -9,7 +9,7 @@ namespace Retro { -class SObjectTag; +struct SObjectTag; class CDvdRequest; class CResLoader diff --git a/Runtime/CSimplePool.hpp b/Runtime/CSimplePool.hpp index d00dad738..5e3d69d61 100644 --- a/Runtime/CSimplePool.hpp +++ b/Runtime/CSimplePool.hpp @@ -9,17 +9,19 @@ class IFactory; class CSimplePool : public IObjectStore { + IFactory& m_factory; public: - CSimplePool(IFactory&) + CSimplePool(IFactory& factory) + : m_factory(factory) { } - IObj& GetObj(const SObjectTag&, const CVParamTransfer&) {} - IObj& GetObj(const SObjectTag&) {} - IObj& GetObj(char const*) {} - IObj& GetObj(char const*, const CVParamTransfer&) {} + IObj* GetObj(const SObjectTag&, const CVParamTransfer&) {return nullptr;} + IObj* GetObj(const SObjectTag&) {return nullptr;} + IObj* GetObj(char const*) {return nullptr;} + IObj* GetObj(char const*, const CVParamTransfer&) {return nullptr;} void HasObject(const SObjectTag&) const {} void ObjectIsLive(const SObjectTag&) const {} - IFactory& GetFactory() const {} + IFactory& GetFactory() const {return m_factory;} void Flush() {} void ObjectUnreferenced(const SObjectTag&) {} }; diff --git a/Runtime/Character/CAssetFactory.hpp b/Runtime/Character/CAssetFactory.hpp index 35159714d..45abe89d3 100644 --- a/Runtime/Character/CAssetFactory.hpp +++ b/Runtime/Character/CAssetFactory.hpp @@ -2,17 +2,18 @@ #define __RETRO_CASSETFACTORY_HPP__ #include "../IFactory.hpp" +#include "../IObj.hpp" namespace Retro { class CCharacterFactoryBuilder : public IFactory { public: - std::unique_ptr Build(const SObjectTag&, const CVParamTransfer&) {} + std::unique_ptr Build(const SObjectTag&, const CVParamTransfer&) {return std::unique_ptr();} void BuildAsync(const SObjectTag&, const CVParamTransfer&, IObj**) {} void CancelBuild(const SObjectTag&) {} - bool CanBuild(const SObjectTag&) {} - const SObjectTag* GetResourceIdByName(const char*) const {} + bool CanBuild(const SObjectTag&) {return false;} + const SObjectTag* GetResourceIdByName(const char*) const {return nullptr;} }; } diff --git a/Runtime/GameGlobalObjects.hpp b/Runtime/GameGlobalObjects.hpp index 36a37ca8d..97cef8a8d 100644 --- a/Runtime/GameGlobalObjects.hpp +++ b/Runtime/GameGlobalObjects.hpp @@ -13,8 +13,8 @@ extern class CGameState* g_GameState; extern class CInGameTweakManagerBase* g_TweakManager; extern class CBooRenderer* g_Renderer; -extern class ITweakPlayer* g_tweakPlayer; -extern class ITweakPlayerControl* g_tweakPlayerControl; +extern struct ITweakPlayer* g_tweakPlayer; +extern struct ITweakPlayerControl* g_tweakPlayerControl; } diff --git a/Runtime/IObjectStore.hpp b/Runtime/IObjectStore.hpp index b5fc6d651..b2d860e97 100644 --- a/Runtime/IObjectStore.hpp +++ b/Runtime/IObjectStore.hpp @@ -3,7 +3,7 @@ namespace Retro { -class SObjectTag; +struct SObjectTag; class CVParamTransfer; class IFactory; class IObj; @@ -11,10 +11,10 @@ class IObj; class IObjectStore { public: - virtual IObj& GetObj(const SObjectTag&, const CVParamTransfer&)=0; - virtual IObj& GetObj(const SObjectTag&)=0; - virtual IObj& GetObj(char const*)=0; - virtual IObj& GetObj(char const*, const CVParamTransfer&)=0; + virtual IObj* GetObj(const SObjectTag&, const CVParamTransfer&)=0; + virtual IObj* GetObj(const SObjectTag&)=0; + virtual IObj* GetObj(char const*)=0; + virtual IObj* GetObj(char const*, const CVParamTransfer&)=0; virtual void HasObject(const SObjectTag&) const=0; virtual void ObjectIsLive(const SObjectTag&) const=0; virtual IFactory& GetFactory() const=0; diff --git a/Runtime/MP1/CFrontEndUI.cpp b/Runtime/MP1/CFrontEndUI.cpp index 7da532a60..a73c29b71 100644 --- a/Runtime/MP1/CFrontEndUI.cpp +++ b/Runtime/MP1/CFrontEndUI.cpp @@ -31,9 +31,9 @@ void CFrontEndUI::OnFileMenuAdvance(CGuiTableGroup* grp) void CFrontEndUI::OnMainMenuAdvance(CGuiTableGroup* grp) {} const char* CFrontEndUI::GetAttractMovieFileName(int idx) -{} +{return nullptr;} const char* CFrontEndUI::GetNextAttractMovieFileName(int idx) -{} +{return nullptr;} void CFrontEndUI::SetCurrentMovie(EMenuMovie movie) {} void CFrontEndUI::StopAttractMovie() @@ -45,7 +45,7 @@ void CFrontEndUI::UpdateMenuHighlights(CGuiTableGroup* grp) void CFrontEndUI::CompleteStateTransition() {} bool CFrontEndUI::CanBuild(const SObjectTag& tag) -{} +{return false;} void CFrontEndUI::StartStateTransition(EScreen screen) {} void CFrontEndUI::HandleDebugMenuReturnValue(CGameDebug::EReturnValue val, CArchitectureQueue& queue) @@ -57,7 +57,7 @@ void CFrontEndUI::UpdateMovies(float dt) void CFrontEndUI::Update(float dt, CArchitectureQueue& queue) {} CIOWin::EMessageReturn CFrontEndUI::OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue) -{} +{return MsgRetNormal;} void CFrontEndUI::StartGame() {} void CFrontEndUI::InitializeFrame() diff --git a/Runtime/MP1/CFrontEndUI.hpp b/Runtime/MP1/CFrontEndUI.hpp index 0210babb4..b39ca9f78 100644 --- a/Runtime/MP1/CFrontEndUI.hpp +++ b/Runtime/MP1/CFrontEndUI.hpp @@ -8,7 +8,7 @@ namespace Retro { class CGuiSliderGroup; class CGuiTableGroup; -class SObjectTag; +struct SObjectTag; namespace MP1 { diff --git a/Runtime/MP1/CMain.hpp b/Runtime/MP1/CMain.hpp index a8e958c53..ac6585259 100644 --- a/Runtime/MP1/CMain.hpp +++ b/Runtime/MP1/CMain.hpp @@ -57,7 +57,7 @@ public: void StreamNewGameState(CInputStream&); void CheckTweakManagerDebugOptions() {} void AddWorldPaks(); - int RsMain(int argc, const char* argv[]); + int RsMain(int argc, const boo::SystemChar* argv[]); bool CheckReset(); bool CheckTerminate() {return false;} void DrawDebugMetrics(double, CStopwatch&) {} diff --git a/Runtime/MP1/CMakeLists.txt b/Runtime/MP1/CMakeLists.txt index e32e666b8..4c3995f65 100644 --- a/Runtime/MP1/CMakeLists.txt +++ b/Runtime/MP1/CMakeLists.txt @@ -16,5 +16,5 @@ target_link_libraries(mp1 DNAMP1 DNACommon HECLDatabase HECLBlender HECLCommon AthenaCore NOD - LogVisor AthenaLibYaml Boo png squish blowfish z lzo2 pthread + LogVisor AthenaLibYaml Boo png squish blowfish z lzo2 ${BOO_SYS_LIBS}) diff --git a/Runtime/MP1/main.cpp b/Runtime/MP1/main.cpp index 7f4cd5086..4faa698d9 100644 --- a/Runtime/MP1/main.cpp +++ b/Runtime/MP1/main.cpp @@ -1,3 +1,8 @@ +#if _WIN32 +#include +#endif + +#include #include #include #include "CBasics.hpp" @@ -139,7 +144,7 @@ void CMain::FillInAssetIDs() void CMain::LoadAudio() { } -int CMain::RsMain(int argc, const char* argv[]) +int CMain::RsMain(int argc, const boo::SystemChar* argv[]) { TOneStatic globalObjs; InitializeSubsystems(); @@ -159,11 +164,21 @@ int CMain::RsMain(int argc, const char* argv[]) } } +#ifdef _WIN32 +int wmain(int argc, const wchar_t* argv[]) +#else int main(int argc, const char* argv[]) +#endif { +#if _WIN32 + CoInitializeEx(nullptr, COINIT_MULTITHREADED); +#else + std::setlocale(LC_ALL, "en-US.UTF-8"); +#endif + Retro::TOneStatic main; std::unique_ptr app = boo::ApplicationBootstrap(boo::IApplication::PLAT_AUTO, *main, - "mp1", "MP1", argc, argv); + _S("mp1"), _S("MP1"), argc, argv); return main->RsMain(argc, argv); } diff --git a/hecl b/hecl index b80f351d6..9666a8ec9 160000 --- a/hecl +++ b/hecl @@ -1 +1 @@ -Subproject commit b80f351d65b15d9a0ffe28625d69f718be074257 +Subproject commit 9666a8ec9ce14a5b248757d7c393d379f825f656 diff --git a/libBoo b/libBoo index f9c4ed076..49771b0e1 160000 --- a/libBoo +++ b/libBoo @@ -1 +1 @@ -Subproject commit f9c4ed076157c78fd131f83c5d0f3bc4c95ae13a +Subproject commit 49771b0e15fc9a7a7974dfc9b8c74fe4b25d66a5