2017-02-12 03:17:18 +00:00
|
|
|
#ifndef __URDE_CPLAYERVISOR_HPP__
|
|
|
|
#define __URDE_CPLAYERVISOR_HPP__
|
|
|
|
|
2017-05-29 19:55:44 +00:00
|
|
|
#include "RetroTypes.hpp"
|
|
|
|
#include "Camera/CCameraFilter.hpp"
|
|
|
|
#include "zeus/CVector2f.hpp"
|
|
|
|
#include "Audio/CSfxManager.hpp"
|
|
|
|
#include "CPlayerState.hpp"
|
2017-05-31 02:51:38 +00:00
|
|
|
#include "Graphics/CModel.hpp"
|
2017-06-01 05:34:24 +00:00
|
|
|
#include "Graphics/Shaders/CColoredQuadFilter.hpp"
|
2018-01-06 06:50:42 +00:00
|
|
|
#include "Graphics/Shaders/CTexturedQuadFilter.hpp"
|
2017-05-29 19:55:44 +00:00
|
|
|
|
2017-02-12 03:17:18 +00:00
|
|
|
namespace urde
|
|
|
|
{
|
|
|
|
class CStateManager;
|
2017-05-21 16:01:04 +00:00
|
|
|
class CTargetingManager;
|
2017-02-12 03:17:18 +00:00
|
|
|
|
|
|
|
namespace MP1
|
|
|
|
{
|
|
|
|
|
|
|
|
class CPlayerVisor
|
|
|
|
{
|
2017-05-29 19:55:44 +00:00
|
|
|
struct SScanTarget
|
|
|
|
{
|
|
|
|
TUniqueId x0_objId = kInvalidUniqueId;
|
2017-05-30 03:45:31 +00:00
|
|
|
float x4_timer = 0.f;
|
|
|
|
float x8_inRangeTimer = 0.f;
|
|
|
|
bool xc_inBox = false;
|
2017-05-29 19:55:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum class EScanWindowState
|
|
|
|
{
|
|
|
|
NotInScanVisor,
|
|
|
|
Idle,
|
|
|
|
Scan
|
|
|
|
};
|
|
|
|
|
|
|
|
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;
|
|
|
|
bool x25_25_ : 1;
|
|
|
|
float x28_ = 0.f;
|
|
|
|
float x2c_scanDimInterp = 1.f;
|
2017-05-30 03:45:31 +00:00
|
|
|
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;
|
2017-05-29 19:55:44 +00:00
|
|
|
float x58_scanMagInterp = 1.f;
|
|
|
|
CSfxHandle x5c_visorLoopSfx;
|
2017-05-30 03:45:31 +00:00
|
|
|
CSfxHandle x60_scanningLoopSfx;
|
2017-06-01 05:34:24 +00:00
|
|
|
CCameraFilterPass<CColoredQuadFilter> x64_scanDim;
|
2017-05-29 19:55:44 +00:00
|
|
|
CCameraBlurPass x90_xrayBlur;
|
|
|
|
float xc4_vpScaleX = 1.f;
|
|
|
|
float xc8_vpScaleY = 1.f;
|
2018-01-07 19:55:09 +00:00
|
|
|
TLockedToken<CModel> xcc_scanFrameCorner;
|
|
|
|
TLockedToken<CModel> xd8_scanFrameCenterSide;
|
|
|
|
TLockedToken<CModel> xe4_scanFrameCenterTop;
|
|
|
|
TLockedToken<CModel> xf0_scanFrameStretchSide;
|
|
|
|
TLockedToken<CModel> xfc_scanFrameStretchTop;
|
2018-01-06 06:50:42 +00:00
|
|
|
//TCachedToken<CModel> x108_newScanPane;
|
|
|
|
CTexturedQuadFilter x108_newScanPane;
|
2018-01-07 19:55:09 +00:00
|
|
|
TLockedToken<CModel> x114_scanShield;
|
2017-05-30 03:45:31 +00:00
|
|
|
int x120_assetLockCountdown = 0;
|
2018-01-07 19:55:09 +00:00
|
|
|
TLockedToken<CModel> x124_scanIconNoncritical;
|
|
|
|
TLockedToken<CModel> x130_scanIconCritical;
|
2017-05-29 19:55:44 +00:00
|
|
|
rstl::reserved_vector<SScanTarget, 64> x13c_scanTargets;
|
|
|
|
TLockedToken<CTexture> x540_xrayPalette;
|
2018-02-05 06:56:09 +00:00
|
|
|
float x54c_scanFrameColorInterp = 0.f;
|
|
|
|
float x550_scanFrameColorImpulseInterp = 0.f;
|
2017-05-29 19:55:44 +00:00
|
|
|
|
|
|
|
int FindEmptyInactiveScanTarget() const;
|
|
|
|
int FindCachedInactiveScanTarget(TUniqueId uid) const;
|
2017-05-30 03:45:31 +00:00
|
|
|
bool DrawScanObjectIndicators(const CStateManager& mgr) const;
|
|
|
|
void UpdateScanObjectIndicators(const CStateManager& mgr, float dt);
|
2017-05-29 19:55:44 +00:00
|
|
|
void UpdateScanWindow(float dt, const CStateManager& mgr);
|
|
|
|
EScanWindowState GetDesiredScanWindowState(const CStateManager& mgr) const;
|
|
|
|
void LockUnlockAssets();
|
|
|
|
void DrawScanEffect(const CStateManager& mgr, const CTargetingManager* tgtMgr) const;
|
|
|
|
void DrawXRayEffect(const CStateManager& mgr) const;
|
|
|
|
void DrawThermalEffect(const CStateManager& mgr) const;
|
|
|
|
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:
|
|
|
|
CPlayerVisor(CStateManager& stateMgr);
|
2017-05-29 19:55:44 +00:00
|
|
|
~CPlayerVisor();
|
2017-05-18 19:27:21 +00:00
|
|
|
void Update(float dt, const CStateManager& stateMgr);
|
2017-05-21 16:01:04 +00:00
|
|
|
void Draw(const CStateManager& stateMgr, const CTargetingManager* tgtManager) const;
|
2017-05-18 19:27:21 +00:00
|
|
|
void Touch();
|
|
|
|
float GetDesiredViewportScaleX(const CStateManager& stateMgr) const;
|
|
|
|
float GetDesiredViewportScaleY(const CStateManager& stateMgr) const;
|
2017-02-12 03:17:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // __URDE_CPLAYERVISOR_HPP__
|