Merge pr-127

This commit is contained in:
Phillip Stephens 2020-01-20 20:06:04 -08:00
commit 7b89a165bf
Signed by: Antidote
GPG Key ID: F8BEE4C83DACA60D
2 changed files with 10 additions and 7 deletions

View File

@ -1,5 +1,7 @@
#include "Runtime/Camera/CCameraManager.hpp" #include "Runtime/Camera/CCameraManager.hpp"
#include <algorithm>
#include "Runtime/CStateManager.hpp" #include "Runtime/CStateManager.hpp"
#include "Runtime/GameGlobalObjects.hpp" #include "Runtime/GameGlobalObjects.hpp"
#include "Runtime/Camera/CBallCamera.hpp" #include "Runtime/Camera/CBallCamera.hpp"
@ -37,12 +39,13 @@ zeus::CTransform CCameraManager::GetCurrentCameraTransform(const CStateManager&
return camera->GetTransform() * zeus::CTransform::Translate(x30_shakeOffset); return camera->GetTransform() * zeus::CTransform::Translate(x30_shakeOffset);
} }
void CCameraManager::RemoveCameraShaker(int id) { void CCameraManager::RemoveCameraShaker(u32 id) {
for (auto it = x14_shakers.begin(); it != x14_shakers.end(); ++it) const auto iter = std::find_if(x14_shakers.cbegin(), x14_shakers.cend(),
if (it->xbc_shakerId == id) { [id](const auto& shaker) { return shaker.xbc_shakerId == id; });
x14_shakers.erase(it); if (iter == x14_shakers.cend()) {
break; return;
} }
x14_shakers.erase(iter);
} }
int CCameraManager::AddCameraShaker(const CCameraShakeData& data, bool sfx) { int CCameraManager::AddCameraShaker(const CCameraShakeData& data, bool sfx) {

View File

@ -94,7 +94,7 @@ public:
bool IsInFirstPersonCamera() const; bool IsInFirstPersonCamera() const;
zeus::CVector3f GetGlobalCameraTranslation(const CStateManager& stateMgr) const; zeus::CVector3f GetGlobalCameraTranslation(const CStateManager& stateMgr) const;
zeus::CTransform GetCurrentCameraTransform(const CStateManager& stateMgr) const; zeus::CTransform GetCurrentCameraTransform(const CStateManager& stateMgr) const;
void RemoveCameraShaker(int id); void RemoveCameraShaker(u32 id);
int AddCameraShaker(const CCameraShakeData& data, bool sfx); int AddCameraShaker(const CCameraShakeData& data, bool sfx);
void AddCinemaCamera(TUniqueId, CStateManager& stateMgr); void AddCinemaCamera(TUniqueId, CStateManager& stateMgr);
void RemoveCinemaCamera(TUniqueId, CStateManager&); void RemoveCinemaCamera(TUniqueId, CStateManager&);