diff --git a/.gitmodules b/.gitmodules index 3a0a7831e..55be2b519 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,9 @@ [submodule "NODLib"] path = NODLib url = https://github.com/RetroView/NODLib.git +[submodule "hecl"] + path = hecl + url = https://github.com/RetroView/hecl.git +[submodule "MathLib"] + path = MathLib + url = https://github.com/RetroView/MathLib.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c45fbe2f..2ccb07569 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,19 @@ cmake_minimum_required(VERSION 3.0) project(RetroCommon) -if (NOT TARGET NOD) - add_subdirectory(NODLib) + +cmake_minimum_required(VERSION 3.0) +project(hecl) +if(MSVC) + # Shaddup MSVC + add_definitions(-DUNICODE=1 -D_UNICODE=1 -D_CRT_SECURE_NO_WARNINGS=1 /wd4267 /wd4244) +else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-multichar -fno-exceptions") endif() -include_directories(${ATHENA_INCLUDE_DIR} ${LOG_VISOR_INCLUDE_DIR} ${ANGELSCRIPT_INCLUDE_DIR} + +set(HECL_SUBPROJECT TRUE) +add_subdirectory(hecl) +add_subdirectory(NODLib) +include_directories(${ATHENA_INCLUDE_DIR} ${LOG_VISOR_INCLUDE_DIR} ${HECL_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) set(NOD_LIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/NODLib/include) add_subdirectory(DataSpec) diff --git a/DataSpec/DNAMP3/CSKR.hpp b/DataSpec/DNAMP3/CSKR.hpp index fc50d4320..98193ce73 100644 --- a/DataSpec/DNAMP3/CSKR.hpp +++ b/DataSpec/DNAMP3/CSKR.hpp @@ -1,7 +1,7 @@ #ifndef _DNAMP3_CSKR_HPP_ #define _DNAMP3_CSKR_HPP_ -#include "BlenderConnection.hpp" +#include "hecl/blender/BlenderConnection.hpp" #include "../DNACommon/DNACommon.hpp" #include "CINF.hpp" diff --git a/MathLib b/MathLib new file mode 160000 index 000000000..9d657895c --- /dev/null +++ b/MathLib @@ -0,0 +1 @@ +Subproject commit 9d657895cb143fd37ab66658d2af8b5d3198257d diff --git a/Runtime/CAssetFactory.cpp b/Runtime/CAssetFactory.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Runtime/CGameOptions.cpp b/Runtime/CGameOptions.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Runtime/CGameState.cpp b/Runtime/CGameState.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Runtime/CMakeLists.txt b/Runtime/CMakeLists.txt index f4364d4f2..53830930d 100644 --- a/Runtime/CMakeLists.txt +++ b/Runtime/CMakeLists.txt @@ -1,32 +1,5 @@ -add_subdirectory(Graphics) -add_subdirectory(Audio) -add_subdirectory(Character) -add_subdirectory(GuiSys) -add_subdirectory(Script) +add_subdirectory(MP3) +add_subdirectory(MP2) +add_subdirectory(MP1) +add_subdirectory(Common) -add_executable(RuntimeCheck - main.cpp - COsContext.hpp COsContextBoo.cpp - CMemory.hpp CMemory.cpp - CMemoryCardSys.hpp CMemoryCardSysPC.cpp - IAllocator.hpp IAllocator.cpp - CGameAllocator.hpp CGameAllocator.cpp - CBasics.hpp CBasicsPC.cpp - CTweaks.hpp CTweaks.cpp - CTweakParticle.hpp CTweakParticle.cpp - CStateManager.hpp CStateManager.cpp - CGameState.hpp CGameState.cpp - CScriptMailbox.hpp CScriptMailbox.cpp - CMapWorldInfo.hpp CMapWorldInfo.cpp - CPlayerState.hpp CPlayerState.cpp - CWorldTransManager.hpp CWorldTransManager.cpp - CRandom16.hpp CRandom16.cpp - CResFactory.hpp CResFactory.cpp - CSimplePool.hpp CSimplePool.cpp - CAssetFactory.hpp CAssetFactory.cpp - CAi.hpp CAi.cpp - CGameOptions.hpp CGameOptions.cpp - CStaticInterference.hpp CStaticInterference.cpp - CCRC32.hpp CCRC32.cpp - RetroTemplates.hpp - GCNTypes.hpp) diff --git a/Runtime/CMapWorldInfo.cpp b/Runtime/CMapWorldInfo.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Runtime/CMemoryCardSysPC.cpp b/Runtime/CMemoryCardSysPC.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Runtime/CPlayerState.cpp b/Runtime/CPlayerState.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Runtime/CResFactory.cpp b/Runtime/CResFactory.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Runtime/CScriptMailbox.cpp b/Runtime/CScriptMailbox.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Runtime/CSimplePool.cpp b/Runtime/CSimplePool.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Runtime/CStateManager.cpp b/Runtime/CStateManager.cpp deleted file mode 100644 index 62ce402f7..000000000 --- a/Runtime/CStateManager.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "CStateManager.hpp" diff --git a/Runtime/CStaticInterference.cpp b/Runtime/CStaticInterference.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Runtime/CWorldTransManager.cpp b/Runtime/CWorldTransManager.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Runtime/Audio/CMakeLists.txt b/Runtime/Common/Audio/CMakeLists.txt similarity index 100% rename from Runtime/Audio/CMakeLists.txt rename to Runtime/Common/Audio/CMakeLists.txt diff --git a/Runtime/Common/CAi.cpp b/Runtime/Common/CAi.cpp new file mode 100644 index 000000000..f731d4129 --- /dev/null +++ b/Runtime/Common/CAi.cpp @@ -0,0 +1,9 @@ +#include "CAi.hpp" + +namespace Retro +{ +namespace Common +{ + +} +} diff --git a/Runtime/CAi.hpp b/Runtime/Common/CAi.hpp similarity index 65% rename from Runtime/CAi.hpp rename to Runtime/Common/CAi.hpp index aca57f62e..c11290410 100644 --- a/Runtime/CAi.hpp +++ b/Runtime/Common/CAi.hpp @@ -1,4 +1,12 @@ #ifndef __RETRO_CAI_HPP__ #define __RETRO_CAI_HPP__ +namespace Retro +{ +namespace Common +{ + +} +} + #endif // __RETRO_CAI_HPP__ diff --git a/Runtime/Common/CAssetFactory.cpp b/Runtime/Common/CAssetFactory.cpp new file mode 100644 index 000000000..750101281 --- /dev/null +++ b/Runtime/Common/CAssetFactory.cpp @@ -0,0 +1,9 @@ +#include "CAssetFactory.hpp" + +namespace Retro +{ +namespace Common +{ + +} +} diff --git a/Runtime/CAssetFactory.hpp b/Runtime/Common/CAssetFactory.hpp similarity index 72% rename from Runtime/CAssetFactory.hpp rename to Runtime/Common/CAssetFactory.hpp index 79df061c5..d401fea0e 100644 --- a/Runtime/CAssetFactory.hpp +++ b/Runtime/Common/CAssetFactory.hpp @@ -1,4 +1,12 @@ #ifndef __RETRO_CASSETFACTORY_HPP__ #define __RETRO_CASSETFACTORY_HPP__ +namespace Retro +{ +namespace Common +{ + +} +} + #endif // __RETRO_CASSETFACTORY_HPP__ diff --git a/Runtime/CBasics.hpp b/Runtime/Common/CBasics.hpp similarity index 90% rename from Runtime/CBasics.hpp rename to Runtime/Common/CBasics.hpp index 441015e35..1247828d4 100644 --- a/Runtime/CBasics.hpp +++ b/Runtime/Common/CBasics.hpp @@ -8,6 +8,13 @@ #include #include + + +namespace Retro +{ +namespace Common +{ + using CInputStream = Athena::io::IStreamReader; using COutputStream = Athena::io::IStreamWriter; @@ -18,4 +25,7 @@ public: static const char* Stringize(const char* fmt, ...); }; +} +} + #endif // __RETRO_CBASICS_HPP__ diff --git a/Runtime/CBasicsPC.cpp b/Runtime/Common/CBasicsPC.cpp similarity index 87% rename from Runtime/CBasicsPC.cpp rename to Runtime/Common/CBasicsPC.cpp index 0c64f32be..d7da0f36f 100644 --- a/Runtime/CBasicsPC.cpp +++ b/Runtime/Common/CBasicsPC.cpp @@ -3,6 +3,11 @@ #include "CBasics.hpp" +namespace Retro +{ +namespace Common +{ + void CBasics::Init() { } @@ -17,3 +22,6 @@ const char* CBasics::Stringize(const char* fmt, ...) va_end(ap); return STRINGIZE_STR; } + +} +} diff --git a/Runtime/CCRC32.cpp b/Runtime/Common/CCRC32.cpp similarity index 98% rename from Runtime/CCRC32.cpp rename to Runtime/Common/CCRC32.cpp index aa7eea848..ffdce715e 100644 --- a/Runtime/CCRC32.cpp +++ b/Runtime/Common/CCRC32.cpp @@ -1,5 +1,10 @@ #include "CCRC32.hpp" +namespace Retro +{ +namespace Common +{ + const uint32_t CCRC32::crc32Table[256] = { 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, @@ -58,3 +63,6 @@ uint32_t CCRC32::Calculate(const void* data, uint32_t length) return checksum; } + +} +} diff --git a/Runtime/CCRC32.hpp b/Runtime/Common/CCRC32.hpp similarity index 88% rename from Runtime/CCRC32.hpp rename to Runtime/Common/CCRC32.hpp index b7234a1b1..3df4135e2 100644 --- a/Runtime/CCRC32.hpp +++ b/Runtime/Common/CCRC32.hpp @@ -2,6 +2,11 @@ #define RETRO_CRC32_HPP #include +namespace Retro +{ +namespace Common +{ + class CCRC32 { static const uint32_t crc32Table[256]; @@ -12,4 +17,7 @@ public: static uint32_t Calculate(const void* data, uint32_t length); }; +} +} + #endif diff --git a/Runtime/CGameAllocator.cpp b/Runtime/Common/CGameAllocator.cpp similarity index 75% rename from Runtime/CGameAllocator.cpp rename to Runtime/Common/CGameAllocator.cpp index 88be1b2e9..3df099fca 100644 --- a/Runtime/CGameAllocator.cpp +++ b/Runtime/Common/CGameAllocator.cpp @@ -1,5 +1,10 @@ #include "CGameAllocator.hpp" +namespace Retro +{ +namespace Common +{ + bool CGameAllocator::Initialize(COsContext&) { return true; @@ -8,3 +13,6 @@ bool CGameAllocator::Initialize(COsContext&) void CGameAllocator::Shutdown() { } + +} +} diff --git a/Runtime/CGameAllocator.hpp b/Runtime/Common/CGameAllocator.hpp similarity index 85% rename from Runtime/CGameAllocator.hpp rename to Runtime/Common/CGameAllocator.hpp index da14cbd7e..8d9d92362 100644 --- a/Runtime/CGameAllocator.hpp +++ b/Runtime/Common/CGameAllocator.hpp @@ -3,6 +3,11 @@ #include "IAllocator.hpp" +namespace Retro +{ +namespace Common +{ + class CGameAllocator : public IAllocator { public: @@ -10,4 +15,7 @@ public: void Shutdown(); }; +} +} + #endif // __RETRO_CGAMEALLOCATOR_HPP__ diff --git a/Runtime/Common/CGameOptions.cpp b/Runtime/Common/CGameOptions.cpp new file mode 100644 index 000000000..0655f7513 --- /dev/null +++ b/Runtime/Common/CGameOptions.cpp @@ -0,0 +1,9 @@ +#include "CGameOptions.hpp" + +namespace Retro +{ +namespace Common +{ + +} +} diff --git a/Runtime/CGameOptions.hpp b/Runtime/Common/CGameOptions.hpp similarity index 75% rename from Runtime/CGameOptions.hpp rename to Runtime/Common/CGameOptions.hpp index edd27d797..5e109e415 100644 --- a/Runtime/CGameOptions.hpp +++ b/Runtime/Common/CGameOptions.hpp @@ -1,8 +1,16 @@ #ifndef __RETRO_CGAMEOPTIONS_HPP__ #define __RETRO_CGAMEOPTIONS_HPP__ +namespace Retro +{ +namespace Common +{ + class CGameOptions { }; +} +} + #endif // __RETRO_CGAMEOPTIONS_HPP__ diff --git a/Runtime/Common/CGameState.cpp b/Runtime/Common/CGameState.cpp new file mode 100644 index 000000000..d0dca530c --- /dev/null +++ b/Runtime/Common/CGameState.cpp @@ -0,0 +1,9 @@ +#include "CGameState.hpp" + +namespace Retro +{ +namespace Common +{ + +} +} diff --git a/Runtime/CGameState.hpp b/Runtime/Common/CGameState.hpp similarity index 89% rename from Runtime/CGameState.hpp rename to Runtime/Common/CGameState.hpp index 0c88d5451..75b89a245 100644 --- a/Runtime/CGameState.hpp +++ b/Runtime/Common/CGameState.hpp @@ -5,6 +5,11 @@ #include "CPlayerState.hpp" #include "CGameOptions.hpp" +namespace Retro +{ +namespace Common +{ + class CGameState { std::unique_ptr m_playerState; @@ -16,4 +21,7 @@ public: } }; +} +} + #endif // __RETRO_CGAMESTATE_HPP__ diff --git a/Runtime/Common/CMakeLists.txt b/Runtime/Common/CMakeLists.txt new file mode 100644 index 000000000..09cabdde7 --- /dev/null +++ b/Runtime/Common/CMakeLists.txt @@ -0,0 +1,30 @@ +add_subdirectory(Graphics) +add_subdirectory(Audio) +add_subdirectory(Character) +add_subdirectory(GuiSys) + +add_library(RuntimeCommon + COsContext.hpp COsContextBoo.cpp + CMemory.hpp CMemory.cpp + CMemoryCardSys.hpp CMemoryCardSysPC.cpp + IAllocator.hpp IAllocator.cpp + CGameAllocator.hpp CGameAllocator.cpp + CBasics.hpp CBasicsPC.cpp + CTweaks.hpp CTweaks.cpp + CTweakParticle.hpp CTweakParticle.cpp + CStateManager.hpp CStateManager.cpp + CGameState.hpp CGameState.cpp + CScriptMailbox.hpp CScriptMailbox.cpp + CMapWorldInfo.hpp CMapWorldInfo.cpp + CPlayerState.hpp CPlayerState.cpp + CWorldTransManager.hpp CWorldTransManager.cpp + CRandom16.hpp CRandom16.cpp + CResFactory.hpp CResFactory.cpp + CSimplePool.hpp CSimplePool.cpp + CAssetFactory.hpp CAssetFactory.cpp + CAi.hpp CAi.cpp + CGameOptions.hpp CGameOptions.cpp + CStaticInterference.hpp CStaticInterference.cpp + CCRC32.hpp CCRC32.cpp + RetroTemplates.hpp + GCNTypes.hpp) diff --git a/Runtime/Common/CMapWorldInfo.cpp b/Runtime/Common/CMapWorldInfo.cpp new file mode 100644 index 000000000..ee02cf24b --- /dev/null +++ b/Runtime/Common/CMapWorldInfo.cpp @@ -0,0 +1,9 @@ +#include "CMapWorldInfo.hpp" + +namespace Retro +{ +namespace Common +{ + +} +} diff --git a/Runtime/CMapWorldInfo.hpp b/Runtime/Common/CMapWorldInfo.hpp similarity index 76% rename from Runtime/CMapWorldInfo.hpp rename to Runtime/Common/CMapWorldInfo.hpp index 785ad4cfe..6742aa011 100644 --- a/Runtime/CMapWorldInfo.hpp +++ b/Runtime/Common/CMapWorldInfo.hpp @@ -1,8 +1,16 @@ #ifndef __RETRO_CMAPWORLDINFO_HPP__ #define __RETRO_CMAPWORLDINFO_HPP__ +namespace Retro +{ +namespace Common +{ + class CMapWorldInfo { }; +} +} + #endif // __RETRO_CMAPWORLDINFO_HPP__ diff --git a/Runtime/CMemory.cpp b/Runtime/Common/CMemory.cpp similarity index 95% rename from Runtime/CMemory.cpp rename to Runtime/Common/CMemory.cpp index 99fefe3bf..7f8947246 100644 --- a/Runtime/CMemory.cpp +++ b/Runtime/Common/CMemory.cpp @@ -1,6 +1,11 @@ #include "CMemory.hpp" #include "CGameAllocator.hpp" +namespace Retro +{ +namespace Common +{ + static CGameAllocator GAME_ALLOCATOR; static IAllocator* MEMORY_ALLOCATOR = &GAME_ALLOCATOR; static bool MEMORY_ALLOCATOR_READY = false; @@ -38,3 +43,5 @@ CMemorySys::~CMemorySys() IAllocator& CMemorySys::GetGameAllocator() {return GAME_ALLOCATOR;} +} +} diff --git a/Runtime/CMemory.hpp b/Runtime/Common/CMemory.hpp similarity index 90% rename from Runtime/CMemory.hpp rename to Runtime/Common/CMemory.hpp index 28b2f413f..32b4ad516 100644 --- a/Runtime/CMemory.hpp +++ b/Runtime/Common/CMemory.hpp @@ -4,6 +4,11 @@ #include "IAllocator.hpp" #include "COsContext.hpp" +namespace Retro +{ +namespace Common +{ + class CMemory { public: @@ -20,4 +25,7 @@ public: static IAllocator& GetGameAllocator(); }; +} +} + #endif // __RETRO_CMEMORY_HPP__ diff --git a/Runtime/CMemoryCardSys.hpp b/Runtime/Common/CMemoryCardSys.hpp similarity index 76% rename from Runtime/CMemoryCardSys.hpp rename to Runtime/Common/CMemoryCardSys.hpp index 904b481e3..5d8007619 100644 --- a/Runtime/CMemoryCardSys.hpp +++ b/Runtime/Common/CMemoryCardSys.hpp @@ -1,8 +1,16 @@ #ifndef __RETRO_CMEMORYCARDSYS_HPP__ #define __RETRO_CMEMORYCARDSYS_HPP__ +namespace Retro +{ +namespace Common +{ + class CMemoryCardSys { }; +} +} + #endif // __RETRO_CMEMORYCARDSYS_HPP__ diff --git a/Runtime/Common/CMemoryCardSysPC.cpp b/Runtime/Common/CMemoryCardSysPC.cpp new file mode 100644 index 000000000..89f518ebd --- /dev/null +++ b/Runtime/Common/CMemoryCardSysPC.cpp @@ -0,0 +1,9 @@ +#include "CMemoryCardSys.hpp" + +namespace Retro +{ +namespace Common +{ + +} +} diff --git a/Runtime/COsContext.hpp b/Runtime/Common/COsContext.hpp similarity index 83% rename from Runtime/COsContext.hpp rename to Runtime/Common/COsContext.hpp index 57016d171..f8aadac62 100644 --- a/Runtime/COsContext.hpp +++ b/Runtime/Common/COsContext.hpp @@ -1,6 +1,11 @@ #ifndef __RETRO_COSCONTEXT_HPP__ #define __RETRO_COSCONTEXT_HPP__ +namespace Retro +{ +namespace Common +{ + class COsContext { public: @@ -8,4 +13,7 @@ public: int OpenWindow(const char* name, int x, int y, int w, int h); }; +} +} + #endif // __RETRO_COSCONTEXT_HPP__ diff --git a/Runtime/COsContextBoo.cpp b/Runtime/Common/COsContextBoo.cpp similarity index 77% rename from Runtime/COsContextBoo.cpp rename to Runtime/Common/COsContextBoo.cpp index 727f26108..a89e7efb5 100644 --- a/Runtime/COsContextBoo.cpp +++ b/Runtime/Common/COsContextBoo.cpp @@ -1,5 +1,10 @@ #include "COsContext.hpp" +namespace Retro +{ +namespace Common +{ + COsContext::COsContext() { } @@ -8,3 +13,6 @@ int COsContext::OpenWindow(const char* name, int x, int y, int w, int h) { return 0; } + +} +} diff --git a/Runtime/Common/CPlayerState.cpp b/Runtime/Common/CPlayerState.cpp new file mode 100644 index 000000000..1b04daf09 --- /dev/null +++ b/Runtime/Common/CPlayerState.cpp @@ -0,0 +1,9 @@ +#include "CPlayerState.hpp" + +namespace Retro +{ +namespace Common +{ + +} +} diff --git a/Runtime/CPlayerState.hpp b/Runtime/Common/CPlayerState.hpp similarity index 73% rename from Runtime/CPlayerState.hpp rename to Runtime/Common/CPlayerState.hpp index d6291700a..3bc326790 100644 --- a/Runtime/CPlayerState.hpp +++ b/Runtime/Common/CPlayerState.hpp @@ -4,7 +4,12 @@ #include "RetroTemplates.hpp" #include "CStaticInterference.hpp" -class CPlayerState : TOneStatic +namespace Retro +{ +namespace Common +{ + +class CPlayerState : public TOneStatic { CStaticInterference m_staticIntf; class CPowerUp @@ -12,9 +17,13 @@ class CPlayerState : TOneStatic int m_a; int m_b; public: + CPowerUp() : m_a(-1), m_b(-1) {} CPowerUp(int a, int b) : m_a(a), m_b(b) {} }; CPowerUp m_powerups[29]; }; +} +} + #endif // __RETRO_CPLAYERSTATE_HPP__ diff --git a/Runtime/CRandom16.cpp b/Runtime/Common/CRandom16.cpp similarity index 84% rename from Runtime/CRandom16.cpp rename to Runtime/Common/CRandom16.cpp index 48475d4d6..cf2db0ee2 100644 --- a/Runtime/CRandom16.cpp +++ b/Runtime/Common/CRandom16.cpp @@ -2,6 +2,11 @@ namespace Retro { +namespace Common +{ + CRandom16* GLOBAL_RANDOM = nullptr; CGlobalRandom* GLOBAL_RANDOM_TOKEN = nullptr; + +} } diff --git a/Runtime/CRandom16.hpp b/Runtime/Common/CRandom16.hpp similarity index 98% rename from Runtime/CRandom16.hpp rename to Runtime/Common/CRandom16.hpp index dd3cec0ff..682d60596 100644 --- a/Runtime/CRandom16.hpp +++ b/Runtime/Common/CRandom16.hpp @@ -5,6 +5,8 @@ namespace Retro { +namespace Common +{ extern class CRandom16* GLOBAL_RANDOM; extern class CGlobalRandom* GLOBAL_RANDOM_TOKEN; @@ -75,6 +77,7 @@ public: } }; +} } #endif // RETRO_CRANDOM16_HPP diff --git a/Runtime/Common/CResFactory.cpp b/Runtime/Common/CResFactory.cpp new file mode 100644 index 000000000..ed95f5174 --- /dev/null +++ b/Runtime/Common/CResFactory.cpp @@ -0,0 +1,9 @@ +#include "CResFactory.hpp" + +namespace Retro +{ +namespace Common +{ + +} +} diff --git a/Runtime/CResFactory.hpp b/Runtime/Common/CResFactory.hpp similarity index 75% rename from Runtime/CResFactory.hpp rename to Runtime/Common/CResFactory.hpp index 9484bf4bb..8cf56cf15 100644 --- a/Runtime/CResFactory.hpp +++ b/Runtime/Common/CResFactory.hpp @@ -1,8 +1,16 @@ #ifndef __RETRO_CRESFACTORY_HPP__ #define __RETRO_CRESFACTORY_HPP__ +namespace Retro +{ +namespace Common +{ + class CResFactory { }; +} +} + #endif // __RETRO_CRESFACTORY_HPP__ diff --git a/Runtime/Common/CScriptMailbox.cpp b/Runtime/Common/CScriptMailbox.cpp new file mode 100644 index 000000000..087f414bd --- /dev/null +++ b/Runtime/Common/CScriptMailbox.cpp @@ -0,0 +1,9 @@ +#include "CScriptMailbox.hpp" + +namespace Retro +{ +namespace Common +{ + +} +} diff --git a/Runtime/CScriptMailbox.hpp b/Runtime/Common/CScriptMailbox.hpp similarity index 76% rename from Runtime/CScriptMailbox.hpp rename to Runtime/Common/CScriptMailbox.hpp index bccce9c30..2d42db694 100644 --- a/Runtime/CScriptMailbox.hpp +++ b/Runtime/Common/CScriptMailbox.hpp @@ -1,8 +1,16 @@ #ifndef __RETRO_CSCRIPTMAILBOX_HPP__ #define __RETRO_CSCRIPTMAILBOX_HPP__ +namespace Retro +{ +namespace Common +{ + class CScriptMailbox { }; +} +} + #endif // __RETRO_CSCRIPTMAILBOX_HPP__ diff --git a/Runtime/Common/CSimplePool.cpp b/Runtime/Common/CSimplePool.cpp new file mode 100644 index 000000000..bb88d771a --- /dev/null +++ b/Runtime/Common/CSimplePool.cpp @@ -0,0 +1,9 @@ +#include "CSimplePool.hpp" + +namespace Retro +{ +namespace Common +{ + +} +} diff --git a/Runtime/CSimplePool.hpp b/Runtime/Common/CSimplePool.hpp similarity index 75% rename from Runtime/CSimplePool.hpp rename to Runtime/Common/CSimplePool.hpp index 12de9efc4..e5b07580e 100644 --- a/Runtime/CSimplePool.hpp +++ b/Runtime/Common/CSimplePool.hpp @@ -1,8 +1,16 @@ #ifndef __RETRO_CSIMPLEPOOL_HPP__ #define __RETRO_CSIMPLEPOOL_HPP__ +namespace Retro +{ +namespace Common +{ + class CSimplePool { }; +} +} + #endif // __RETRO_CSIMPLEPOOL_HPP__ diff --git a/Runtime/Common/CStateManager.cpp b/Runtime/Common/CStateManager.cpp new file mode 100644 index 000000000..e7c5f54c6 --- /dev/null +++ b/Runtime/Common/CStateManager.cpp @@ -0,0 +1,9 @@ +#include "CStateManager.hpp" + +namespace Retro +{ +namespace Common +{ + +} +} diff --git a/Runtime/CStateManager.hpp b/Runtime/Common/CStateManager.hpp similarity index 92% rename from Runtime/CStateManager.hpp rename to Runtime/Common/CStateManager.hpp index b502bacc4..e4e6d68ee 100644 --- a/Runtime/CStateManager.hpp +++ b/Runtime/Common/CStateManager.hpp @@ -8,6 +8,11 @@ #include "CPlayerState.hpp" #include "CWorldTransManager.hpp" +namespace Retro +{ +namespace Common +{ + class CStateManager : public TOneStatic { public: @@ -17,4 +22,7 @@ public: const std::weak_ptr&); }; +} +} + #endif diff --git a/Runtime/Common/CStaticInterference.cpp b/Runtime/Common/CStaticInterference.cpp new file mode 100644 index 000000000..cc0452229 --- /dev/null +++ b/Runtime/Common/CStaticInterference.cpp @@ -0,0 +1,9 @@ +#include "CStaticInterference.hpp" + +namespace Retro +{ +namespace Common +{ + +} +} diff --git a/Runtime/CStaticInterference.hpp b/Runtime/Common/CStaticInterference.hpp similarity index 78% rename from Runtime/CStaticInterference.hpp rename to Runtime/Common/CStaticInterference.hpp index 890d4b6ac..ab6135b5d 100644 --- a/Runtime/CStaticInterference.hpp +++ b/Runtime/Common/CStaticInterference.hpp @@ -1,8 +1,16 @@ #ifndef __RETRO_CSTATICINTERFERENCE_HPP__ #define __RETRO_CSTATICINTERFERENCE_HPP__ +namespace Retro +{ +namespace Common +{ + class CStaticInterference { }; +} +} + #endif // __RETRO_CSTATICINTERFERENCE_HPP__ diff --git a/Runtime/CTweakParticle.cpp b/Runtime/Common/CTweakParticle.cpp similarity index 65% rename from Runtime/CTweakParticle.cpp rename to Runtime/Common/CTweakParticle.cpp index 99956f65d..56590524a 100644 --- a/Runtime/CTweakParticle.cpp +++ b/Runtime/Common/CTweakParticle.cpp @@ -1,6 +1,14 @@ #include "CTweakParticle.hpp" +namespace Retro +{ +namespace Common +{ + CTweakParticle::CTweakParticle(CInputStream&) { } + +} +} diff --git a/Runtime/CTweakParticle.hpp b/Runtime/Common/CTweakParticle.hpp similarity index 84% rename from Runtime/CTweakParticle.hpp rename to Runtime/Common/CTweakParticle.hpp index a7603a99a..a15bb1bb3 100644 --- a/Runtime/CTweakParticle.hpp +++ b/Runtime/Common/CTweakParticle.hpp @@ -3,10 +3,18 @@ #include "CBasics.hpp" +namespace Retro +{ +namespace Common +{ + class CTweakParticle : TOneStatic { public: CTweakParticle(CInputStream&); }; +} +} + #endif // __RETRO_CTWEAKPARTICLE_HPP__ diff --git a/Runtime/CTweaks.cpp b/Runtime/Common/CTweaks.cpp similarity index 70% rename from Runtime/CTweaks.cpp rename to Runtime/Common/CTweaks.cpp index 561ebeb7e..55b83fc00 100644 --- a/Runtime/CTweaks.cpp +++ b/Runtime/Common/CTweaks.cpp @@ -1,5 +1,10 @@ #include "CTweaks.hpp" +namespace Retro +{ +namespace Common +{ + void CTweaks::RegisterTweaks() { } @@ -7,3 +12,6 @@ void CTweaks::RegisterTweaks() void CTweaks::RegisterResourceTweaks() { } + +} +} diff --git a/Runtime/CTweaks.hpp b/Runtime/Common/CTweaks.hpp similarity index 86% rename from Runtime/CTweaks.hpp rename to Runtime/Common/CTweaks.hpp index 94b53abf9..e4bd0aada 100644 --- a/Runtime/CTweaks.hpp +++ b/Runtime/Common/CTweaks.hpp @@ -4,6 +4,11 @@ #include #include "CTweakParticle.hpp" +namespace Retro +{ +namespace Common +{ + class CTweaks { TOneStatic m_particle; @@ -12,4 +17,7 @@ public: void RegisterResourceTweaks(); }; +} +} + #endif // __RETRO_CTWEAKS_HPP__ diff --git a/Runtime/Common/CWorldTransManager.cpp b/Runtime/Common/CWorldTransManager.cpp new file mode 100644 index 000000000..43087e2b0 --- /dev/null +++ b/Runtime/Common/CWorldTransManager.cpp @@ -0,0 +1,9 @@ +#include "CWorldTransManager.hpp" + +namespace Retro +{ +namespace Common +{ + +} +} diff --git a/Runtime/CWorldTransManager.hpp b/Runtime/Common/CWorldTransManager.hpp similarity index 78% rename from Runtime/CWorldTransManager.hpp rename to Runtime/Common/CWorldTransManager.hpp index 6c3fd40c9..5cd6c8ae1 100644 --- a/Runtime/CWorldTransManager.hpp +++ b/Runtime/Common/CWorldTransManager.hpp @@ -1,8 +1,16 @@ #ifndef __RETRO_CWORLDTRANSMANAGER_HPP__ #define __RETRO_CWORLDTRANSMANAGER_HPP__ +namespace Retro +{ +namespace Common +{ + class CWorldTransManager { }; +} +} + #endif // __RETRO_CWORLDTRANSMANAGER_HPP__ diff --git a/Runtime/Character/CMakeLists.txt b/Runtime/Common/Character/CMakeLists.txt similarity index 100% rename from Runtime/Character/CMakeLists.txt rename to Runtime/Common/Character/CMakeLists.txt diff --git a/Runtime/GCNTypes.hpp b/Runtime/Common/GCNTypes.hpp similarity index 93% rename from Runtime/GCNTypes.hpp rename to Runtime/Common/GCNTypes.hpp index 6993b18c1..d8b7493dd 100644 --- a/Runtime/GCNTypes.hpp +++ b/Runtime/Common/GCNTypes.hpp @@ -2,6 +2,7 @@ #define __RETRO_GCTYPES_HPP__ #include +#include using s8 = int8_t; using u8 = uint8_t; diff --git a/Runtime/Graphics/CMakeLists.txt b/Runtime/Common/Graphics/CMakeLists.txt similarity index 100% rename from Runtime/Graphics/CMakeLists.txt rename to Runtime/Common/Graphics/CMakeLists.txt diff --git a/Runtime/GuiSys/CMakeLists.txt b/Runtime/Common/GuiSys/CMakeLists.txt similarity index 100% rename from Runtime/GuiSys/CMakeLists.txt rename to Runtime/Common/GuiSys/CMakeLists.txt diff --git a/Runtime/Common/IAllocator.cpp b/Runtime/Common/IAllocator.cpp new file mode 100644 index 000000000..dc76de810 --- /dev/null +++ b/Runtime/Common/IAllocator.cpp @@ -0,0 +1,9 @@ +#include "IAllocator.hpp" + +namespace Retro +{ +namespace Common +{ + +} +} diff --git a/Runtime/IAllocator.hpp b/Runtime/Common/IAllocator.hpp similarity index 84% rename from Runtime/IAllocator.hpp rename to Runtime/Common/IAllocator.hpp index 7c1441bbe..6fb62a539 100644 --- a/Runtime/IAllocator.hpp +++ b/Runtime/Common/IAllocator.hpp @@ -3,6 +3,11 @@ #include "COsContext.hpp" +namespace Retro +{ +namespace Common +{ + class IAllocator { public: @@ -10,4 +15,7 @@ public: virtual void Shutdown()=0; }; +} +} + #endif // __RETRO_IALLOCATOR_HPP__ diff --git a/Runtime/RetroTemplates.hpp b/Runtime/Common/RetroTemplates.hpp similarity index 93% rename from Runtime/RetroTemplates.hpp rename to Runtime/Common/RetroTemplates.hpp index 7b684e5da..07acf388c 100644 --- a/Runtime/RetroTemplates.hpp +++ b/Runtime/Common/RetroTemplates.hpp @@ -3,6 +3,11 @@ #include "GCNTypes.hpp" +namespace Retro +{ +namespace Common +{ + /** * @brief Inheritable singleton static-allocator */ @@ -20,4 +25,7 @@ public: template T TOneStatic::m_allocspace; template u32 TOneStatic::m_refCount; +} +} + #endif // __RETRO_TEMPLATES_HPP__ diff --git a/Runtime/IAllocator.cpp b/Runtime/IAllocator.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Runtime/MP1/CMakeLists.txt b/Runtime/MP1/CMakeLists.txt new file mode 100644 index 000000000..81ebabcc6 --- /dev/null +++ b/Runtime/MP1/CMakeLists.txt @@ -0,0 +1,5 @@ +include_directories(. ../Common) +add_executable(mp1 + main.cpp) +target_link_libraries(mp1 + RuntimeCommon) diff --git a/Runtime/main.cpp b/Runtime/MP1/main.cpp similarity index 58% rename from Runtime/main.cpp rename to Runtime/MP1/main.cpp index 033b1f923..5e7a35878 100644 --- a/Runtime/main.cpp +++ b/Runtime/MP1/main.cpp @@ -7,25 +7,30 @@ #include "CResFactory.hpp" #include "CSimplePool.hpp" -class CGameGlobalObjects : public TOneStatic +namespace Retro { - CMemoryCardSys m_memoryCardSys; - CResFactory m_resFactory; - CSimplePool m_simplePool; +namespace MP1 +{ + +class CGameGlobalObjects : public Common::TOneStatic +{ + Common::CMemoryCardSys m_memoryCardSys; + Common::CResFactory m_resFactory; + Common::CSimplePool m_simplePool; public: - void PostInitialize(COsContext& osctx, CMemorySys& memSys) + void PostInitialize(Common::COsContext& osctx, Common::CMemorySys& memSys) { } }; -class CMain : public COsContext +class CMain : public Common::COsContext { - CMemorySys m_memSys; - CTweaks m_tweaks; + Common::CMemorySys m_memSys; + Common::CTweaks m_tweaks; bool m_run = true; public: CMain() - : m_memSys(*this, CMemorySys::GetGameAllocator()) + : m_memSys(*this, Common::CMemorySys::GetGameAllocator()) { OpenWindow("", 0, 0, 640, 480); } @@ -45,8 +50,11 @@ public: } }; +} +} + int main(int argc, const char* argv[]) { - CMain main; + Retro::MP1::CMain main; return main.RsMain(argc, argv); } diff --git a/Runtime/Script/CMakeLists.txt b/Runtime/MP2/CMakeLists.txt similarity index 100% rename from Runtime/Script/CMakeLists.txt rename to Runtime/MP2/CMakeLists.txt diff --git a/Runtime/CAi.cpp b/Runtime/MP3/CMakeLists.txt similarity index 100% rename from Runtime/CAi.cpp rename to Runtime/MP3/CMakeLists.txt diff --git a/hecl b/hecl new file mode 160000 index 000000000..f6b681030 --- /dev/null +++ b/hecl @@ -0,0 +1 @@ +Subproject commit f6b681030a7a5328683c18ea37f56b752551986b