metaforce/Runtime/MP1/CPlayerVisor.hpp

96 lines
3.5 KiB
C++
Raw Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
2017-02-12 03:17:18 +00:00
#include "Runtime/CPlayerState.hpp"
#include "Runtime/RetroTypes.hpp"
#include "Runtime/rstl.hpp"
#include "Runtime/Audio/CSfxManager.hpp"
#include "Runtime/Camera/CCameraFilter.hpp"
#include "Runtime/Graphics/CModel.hpp"
#include "Runtime/Graphics/Shaders/CColoredQuadFilter.hpp"
#include "Runtime/Graphics/Shaders/CTexturedQuadFilter.hpp"
#include <zeus/CVector2f.hpp>
2021-04-10 08:42:06 +00:00
namespace metaforce {
2017-02-12 03:17:18 +00:00
class CStateManager;
2017-05-21 16:01:04 +00:00
class CTargetingManager;
2017-02-12 03:17:18 +00:00
2018-12-08 05:30:43 +00:00
namespace MP1 {
2017-02-12 03:17:18 +00:00
2018-12-08 05:30:43 +00:00
class CPlayerVisor {
struct SScanTarget {
TUniqueId x0_objId = kInvalidUniqueId;
float x4_timer = 0.f;
float x8_inRangeTimer = 0.f;
bool xc_inBox = false;
};
2018-12-08 05:30:43 +00:00
enum class EScanWindowState { NotInScanVisor, Idle, Scan };
2018-12-08 05:30:43 +00:00
rstl::reserved_vector<zeus::CVector2f, 3> x0_scanWindowSizes;
CPlayerState::EPlayerVisor x1c_curVisor = CPlayerState::EPlayerVisor::Combat;
CPlayerState::EPlayerVisor x20_nextVisor = CPlayerState::EPlayerVisor::Combat;
float x24_visorSfxVol = 1.f; // used to be u8
bool x25_24_visorTransitioning : 1 = false;
bool x25_25_ : 1 = false;
2018-12-08 05:30:43 +00:00
float x28_ = 0.f;
float x2c_scanDimInterp = 1.f;
EScanWindowState x30_prevState = EScanWindowState::NotInScanVisor;
EScanWindowState x34_nextState = EScanWindowState::NotInScanVisor;
float x38_windowInterpDuration = 0.f;
float x3c_windowInterpTimer = 0.f;
zeus::CVector2f x40_prevWindowDims;
zeus::CVector2f x48_interpWindowDims;
zeus::CVector2f x50_nextWindowDims;
float x58_scanMagInterp = 1.f;
CSfxHandle x5c_visorLoopSfx;
CSfxHandle x60_scanningLoopSfx;
CCameraFilterPass<CColoredQuadFilter> x64_scanDim;
CCameraBlurPass x90_xrayBlur;
float xc4_vpScaleX = 1.f;
float xc8_vpScaleY = 1.f;
TLockedToken<CModel> xcc_scanFrameCorner;
TLockedToken<CModel> xd8_scanFrameCenterSide;
TLockedToken<CModel> xe4_scanFrameCenterTop;
TLockedToken<CModel> xf0_scanFrameStretchSide;
TLockedToken<CModel> xfc_scanFrameStretchTop;
2022-02-01 00:06:54 +00:00
TCachedToken<CModel> x108_newScanPane;
// CTexturedQuadFilter x108_newScanPane;
2018-12-08 05:30:43 +00:00
TLockedToken<CModel> x114_scanShield;
int x120_assetLockCountdown = 0;
TLockedToken<CModel> x124_scanIconNoncritical;
TLockedToken<CModel> x130_scanIconCritical;
rstl::reserved_vector<SScanTarget, 64> x13c_scanTargets;
TLockedToken<CTexture> x540_xrayPalette;
float x54c_scanFrameColorInterp = 0.f;
float x550_scanFrameColorImpulseInterp = 0.f;
2018-12-08 05:30:43 +00:00
int FindEmptyInactiveScanTarget() const;
int FindCachedInactiveScanTarget(TUniqueId uid) const;
bool DrawScanObjectIndicators(const CStateManager& mgr);
2018-12-08 05:30:43 +00:00
void UpdateScanObjectIndicators(const CStateManager& mgr, float dt);
void UpdateScanWindow(float dt, const CStateManager& mgr);
EScanWindowState GetDesiredScanWindowState(const CStateManager& mgr) const;
void LockUnlockAssets();
void DrawScanEffect(const CStateManager& mgr, CTargetingManager* tgtMgr);
void DrawXRayEffect(const CStateManager& mgr);
void DrawThermalEffect(const CStateManager& mgr);
2018-12-08 05:30:43 +00:00
void UpdateCurrentVisor(float transFactor);
void FinishTransitionIn();
void BeginTransitionIn(const CStateManager& mgr);
void FinishTransitionOut(const CStateManager& mgr);
void BeginTransitionOut();
2017-02-12 03:17:18 +00:00
public:
explicit CPlayerVisor(CStateManager& stateMgr);
2018-12-08 05:30:43 +00:00
~CPlayerVisor();
void Update(float dt, const CStateManager& stateMgr);
void Draw(const CStateManager& stateMgr, CTargetingManager* tgtManager);
2018-12-08 05:30:43 +00:00
void Touch();
float GetDesiredViewportScaleX(const CStateManager& stateMgr) const;
float GetDesiredViewportScaleY(const CStateManager& stateMgr) const;
2017-02-12 03:17:18 +00:00
};
2018-12-08 05:30:43 +00:00
} // namespace MP1
2021-04-10 08:42:06 +00:00
} // namespace metaforce