diff --git a/Editor/CMakeLists.txt b/Editor/CMakeLists.txt index 3479f07c1..ee4b327d5 100644 --- a/Editor/CMakeLists.txt +++ b/Editor/CMakeLists.txt @@ -39,6 +39,9 @@ target_link_libraries(urde UrdeLocales UrdeIcons RuntimeMP1 + RuntimeCommonWorld + RuntimeCommonAutoMapper + RuntimeCommonCamera RuntimeCommonCharacter RuntimeCommonInput RuntimeCommonParticle diff --git a/Runtime/AutoMapper/CMakeLists.txt b/Runtime/AutoMapper/CMakeLists.txt new file mode 100644 index 000000000..7304bed86 --- /dev/null +++ b/Runtime/AutoMapper/CMakeLists.txt @@ -0,0 +1,2 @@ +add_library(RuntimeCommonAutoMapper + CMapWorldInfo.hpp CMapWorldInfo.cpp) diff --git a/Runtime/CMapWorldInfo.cpp b/Runtime/AutoMapper/CMapWorldInfo.cpp similarity index 100% rename from Runtime/CMapWorldInfo.cpp rename to Runtime/AutoMapper/CMapWorldInfo.cpp diff --git a/Runtime/CMapWorldInfo.hpp b/Runtime/AutoMapper/CMapWorldInfo.hpp similarity index 100% rename from Runtime/CMapWorldInfo.hpp rename to Runtime/AutoMapper/CMapWorldInfo.hpp diff --git a/Runtime/CGameState.hpp b/Runtime/CGameState.hpp index b742debc8..689d68657 100644 --- a/Runtime/CGameState.hpp +++ b/Runtime/CGameState.hpp @@ -5,7 +5,7 @@ #include "CBasics.hpp" #include "CPlayerState.hpp" #include "CGameOptions.hpp" -#include "CWorldTransManager.hpp" +#include "World/CWorldTransManager.hpp" namespace urde { diff --git a/Runtime/CMakeLists.txt b/Runtime/CMakeLists.txt index dc8fc78b6..fa3c72536 100644 --- a/Runtime/CMakeLists.txt +++ b/Runtime/CMakeLists.txt @@ -5,6 +5,8 @@ add_subdirectory(Audio) add_subdirectory(Character) add_subdirectory(Graphics) add_subdirectory(Camera) +add_subdirectory(World) +add_subdirectory(AutoMapper) add_subdirectory(GuiSys) add_subdirectory(Input) add_subdirectory(Particle) @@ -22,7 +24,6 @@ add_library(RuntimeCommon CMemoryCardSys.hpp IAllocator.hpp IAllocator.cpp CGameAllocator.hpp CGameAllocator.cpp - CPathFindArea.hpp CPathFindArea.cpp CDependencyGroup.hpp CDependencyGroup.cpp CBasics.hpp CBasicsPC.cpp CIOWin.hpp @@ -30,9 +31,7 @@ add_library(RuntimeCommon 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 CResLoader.hpp CResLoader.cpp @@ -41,11 +40,9 @@ add_library(RuntimeCommon CVirtualDvdFile.hpp CVirtualDvdFile.cpp IObjectStore.hpp CSimplePool.hpp CSimplePool.cpp - CAi.hpp CAi.cpp CGameOptions.hpp CGameOptions.cpp CStaticInterference.hpp CCRC32.hpp CCRC32.cpp - CEntity.hpp CEntity.cpp IFactory.hpp IObjFactory.hpp ScriptObjectSupport.hpp ScriptObjectSupport.cpp @@ -58,9 +55,6 @@ add_library(RuntimeCommon IVParamObj.hpp CTimeProvider.hpp CTimeProvider.cpp CToken.hpp - CAreaOctTree.hpp CAreaOctTree.cpp - CActor.hpp CActor.cpp - CPhysicsActor.hpp CPhysicsActor.cpp CFactoryMgr.hpp CFactoryMgr.cpp CPakFile.hpp CPakFile.cpp CStringExtras.hpp diff --git a/Runtime/CObjectList.hpp b/Runtime/CObjectList.hpp index e2282be2b..9ee5783d5 100644 --- a/Runtime/CObjectList.hpp +++ b/Runtime/CObjectList.hpp @@ -1,7 +1,7 @@ #ifndef __URDE_COBJECTLIST_HPP__ #define __URDE_COBJECTLIST_HPP__ -#include "CEntity.hpp" +#include "World/CEntity.hpp" #include "RetroTypes.hpp" namespace urde diff --git a/Runtime/Camera/CCameraManager.cpp b/Runtime/Camera/CCameraManager.cpp index 125ad4f1a..a3988e55b 100644 --- a/Runtime/Camera/CCameraManager.cpp +++ b/Runtime/Camera/CCameraManager.cpp @@ -1,9 +1,11 @@ #include "CCameraManager.hpp" +#include "CCameraShakeData.hpp" namespace urde { -CCameraManager::CCameraManager(TUniqueId id) +CCameraManager::CCameraManager(TUniqueId curCameraId) +: x0_curCameraId(curCameraId) { } diff --git a/Runtime/Camera/CCameraManager.hpp b/Runtime/Camera/CCameraManager.hpp index 8810123bf..e3546a9bd 100644 --- a/Runtime/Camera/CCameraManager.hpp +++ b/Runtime/Camera/CCameraManager.hpp @@ -3,21 +3,26 @@ #include "RetroTypes.hpp" #include "zeus/CVector3f.hpp" +#include "World/CGameArea.hpp" namespace urde { class CFirstPersonCamera; class CBallCamera; class CStateManager; +class CGameCamera; +class CCameraShakeData; class CCameraManager { - TUniqueId x0_id; + TUniqueId x0_curCameraId; std::vector x4_cineCameras; + std::list x18_shakers; + zeus::CVector3f x30_; CFirstPersonCamera* x7c_fpCamera; CBallCamera* x80_ballCamera; public: - CCameraManager(TUniqueId id); + CCameraManager(TUniqueId curCameraId); void SetSpecialCameras(CFirstPersonCamera& fp, CBallCamera& ball) { @@ -31,7 +36,15 @@ public: void AddCinemaCamera(TUniqueId, CStateManager& stateMgr); void SetInsideFluid(bool, TUniqueId); void Update(float dt, CStateManager& stateMgr); - + CGameCamera* GetCurrentCamera(CStateManager& stateMgr) const; + const CGameCamera* GetCurrentCamera(const CStateManager& stateMgr) const; + void SetCurrentCameraId(TUniqueId id, CStateManager& stateMgr); + TUniqueId GetCurrentCameraId() const + { + if (x4_cineCameras.size()) + return x4_cineCameras.back(); + return x0_curCameraId; + } }; } diff --git a/Runtime/CAreaOctTree.cpp b/Runtime/Camera/CCameraShakeData.cpp similarity index 100% rename from Runtime/CAreaOctTree.cpp rename to Runtime/Camera/CCameraShakeData.cpp diff --git a/Runtime/Camera/CCameraShakeData.hpp b/Runtime/Camera/CCameraShakeData.hpp new file mode 100644 index 000000000..e2073a0e5 --- /dev/null +++ b/Runtime/Camera/CCameraShakeData.hpp @@ -0,0 +1,15 @@ +#ifndef __URDE_CCAMERASHAKEDATA_HPP__ +#define __URDE_CCAMERASHAKEDATA_HPP__ + +namespace urde +{ + +class CCameraShakeData +{ +public: + CCameraShakeData(float, float, float, float, float, float, float, bool); +}; + +} + +#endif // __URDE_CCAMERASHAKEDATA_HPP__ diff --git a/Runtime/Camera/CMakeLists.txt b/Runtime/Camera/CMakeLists.txt index c6f7c020d..4450cf0c8 100644 --- a/Runtime/Camera/CMakeLists.txt +++ b/Runtime/Camera/CMakeLists.txt @@ -4,4 +4,5 @@ add_library(RuntimeCommonCamera CFirstPersonCamera.hpp CFirstPersonCamera.cpp CBallCamera.hpp CBallCamera.cpp CPathCamera.hpp CPathCamera.cpp - CCinematicCamera.hpp CCinematicCamera.cpp) + CCinematicCamera.hpp CCinematicCamera.cpp + CCameraShakeData.hpp CCameraShakeData.cpp) diff --git a/Runtime/MP1/MP1.hpp b/Runtime/MP1/MP1.hpp index eb0c829e4..8e34884bb 100644 --- a/Runtime/MP1/MP1.hpp +++ b/Runtime/MP1/MP1.hpp @@ -15,7 +15,7 @@ #include "CResFactory.hpp" #include "CSimplePool.hpp" #include "Character/CAssetFactory.hpp" -#include "CAi.hpp" +#include "World/CAi.hpp" #include "CGameState.hpp" #include "CInGameTweakManager.hpp" #include "Particle/CElementGen.hpp" diff --git a/Runtime/CActor.cpp b/Runtime/World/CActor.cpp similarity index 100% rename from Runtime/CActor.cpp rename to Runtime/World/CActor.cpp diff --git a/Runtime/CActor.hpp b/Runtime/World/CActor.hpp similarity index 100% rename from Runtime/CActor.hpp rename to Runtime/World/CActor.hpp diff --git a/Runtime/CAi.cpp b/Runtime/World/CAi.cpp similarity index 100% rename from Runtime/CAi.cpp rename to Runtime/World/CAi.cpp diff --git a/Runtime/CAi.hpp b/Runtime/World/CAi.hpp similarity index 100% rename from Runtime/CAi.hpp rename to Runtime/World/CAi.hpp diff --git a/Runtime/CPhysicsActor.cpp b/Runtime/World/CAreaOctTree.cpp similarity index 100% rename from Runtime/CPhysicsActor.cpp rename to Runtime/World/CAreaOctTree.cpp diff --git a/Runtime/CAreaOctTree.hpp b/Runtime/World/CAreaOctTree.hpp similarity index 100% rename from Runtime/CAreaOctTree.hpp rename to Runtime/World/CAreaOctTree.hpp diff --git a/Runtime/CEntity.cpp b/Runtime/World/CEntity.cpp similarity index 100% rename from Runtime/CEntity.cpp rename to Runtime/World/CEntity.cpp diff --git a/Runtime/CEntity.hpp b/Runtime/World/CEntity.hpp similarity index 100% rename from Runtime/CEntity.hpp rename to Runtime/World/CEntity.hpp diff --git a/Runtime/World/CGameArea.cpp b/Runtime/World/CGameArea.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/World/CGameArea.hpp b/Runtime/World/CGameArea.hpp new file mode 100644 index 000000000..62af34047 --- /dev/null +++ b/Runtime/World/CGameArea.hpp @@ -0,0 +1,13 @@ +#ifndef __URDE_CGAMEAREA_HPP__ +#define __URDE_CGAMEAREA_HPP__ + +namespace urde +{ + +class CGameArea +{ +}; + +} + +#endif // __URDE_CGAMEAREA_HPP__ diff --git a/Runtime/World/CMakeLists.txt b/Runtime/World/CMakeLists.txt new file mode 100644 index 000000000..04255ccb6 --- /dev/null +++ b/Runtime/World/CMakeLists.txt @@ -0,0 +1,9 @@ +add_library(RuntimeCommonWorld + CGameArea.hpp CGameArea.cpp + CPathFindArea.hpp CPathFindArea.cpp + CAreaOctTree.hpp CAreaOctTree.cpp + CActor.hpp CActor.cpp + CAi.hpp CAi.cpp + CEntity.hpp CEntity.cpp + CPhysicsActor.hpp CPhysicsActor.cpp + CWorldTransManager.hpp CWorldTransManager.cpp) diff --git a/Runtime/CPathFindArea.cpp b/Runtime/World/CPathFindArea.cpp similarity index 100% rename from Runtime/CPathFindArea.cpp rename to Runtime/World/CPathFindArea.cpp diff --git a/Runtime/CPathFindArea.hpp b/Runtime/World/CPathFindArea.hpp similarity index 100% rename from Runtime/CPathFindArea.hpp rename to Runtime/World/CPathFindArea.hpp diff --git a/Runtime/World/CPhysicsActor.cpp b/Runtime/World/CPhysicsActor.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/CPhysicsActor.hpp b/Runtime/World/CPhysicsActor.hpp similarity index 100% rename from Runtime/CPhysicsActor.hpp rename to Runtime/World/CPhysicsActor.hpp diff --git a/Runtime/CWorldTransManager.cpp b/Runtime/World/CWorldTransManager.cpp similarity index 100% rename from Runtime/CWorldTransManager.cpp rename to Runtime/World/CWorldTransManager.cpp diff --git a/Runtime/CWorldTransManager.hpp b/Runtime/World/CWorldTransManager.hpp similarity index 100% rename from Runtime/CWorldTransManager.hpp rename to Runtime/World/CWorldTransManager.hpp