2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-05-14 07:51:20 +00:00
metaforce/Runtime/GuiSys/CTargetingManager.cpp
Lioncash 221cc5c6b8 RuntimeCommonB: Normalize cpp file includes
Like the prior changes normalizing the inclusions within headers, this
tackles the cpp files of the RuntimeCommonB target, making these source
files consistent with their headers.
2019-12-22 18:12:04 -05:00

40 lines
1.5 KiB
C++

#include "Runtime/GuiSys/CTargetingManager.hpp"
#include "Runtime/CStateManager.hpp"
#include "Runtime/GameGlobalObjects.hpp"
#include "Runtime/Camera/CGameCamera.hpp"
#include "Runtime/Graphics/CBooRenderer.hpp"
namespace urde {
CTargetingManager::CTargetingManager(const CStateManager& mgr) : x0_targetReticule(mgr) {}
bool CTargetingManager::CheckLoadComplete() {
return (x0_targetReticule.CheckLoadComplete() && x21c_orbitPointMarker.CheckLoadComplete());
}
void CTargetingManager::Update(float dt, const CStateManager& stateMgr) {
x0_targetReticule.Update(dt, stateMgr);
x21c_orbitPointMarker.Update(dt, stateMgr);
}
void CTargetingManager::Draw(const CStateManager& mgr, bool hideLockon) const {
CGraphics::SetAmbientColor(zeus::skWhite);
CGraphics::DisableAllLights();
x21c_orbitPointMarker.Draw(mgr);
const CGameCamera* curCam = mgr.GetCameraManager()->GetCurrentCamera(mgr);
zeus::CTransform camXf = mgr.GetCameraManager()->GetCurrentCameraTransform(mgr);
CGraphics::SetViewPointMatrix(camXf);
zeus::CFrustum frustum;
frustum.updatePlanes(camXf, zeus::SProjPersp(zeus::degToRad(curCam->GetFov()),
g_Viewport.aspect, 1.f, 100.f));
g_Renderer->SetClippingPlanes(frustum);
g_Renderer->SetPerspective(curCam->GetFov(), g_Viewport.x8_width, g_Viewport.xc_height, curCam->GetNearClipDistance(),
curCam->GetFarClipDistance());
x0_targetReticule.Draw(mgr, hideLockon);
}
void CTargetingManager::Touch() { x0_targetReticule.Touch(); }
} // namespace urde