diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/shared/weapon_ifmbasecamera.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/shared/weapon_ifmbasecamera.h')
| -rw-r--r-- | game/shared/weapon_ifmbasecamera.h | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/game/shared/weapon_ifmbasecamera.h b/game/shared/weapon_ifmbasecamera.h new file mode 100644 index 0000000..bd12c2f --- /dev/null +++ b/game/shared/weapon_ifmbasecamera.h @@ -0,0 +1,86 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//===========================================================================// + +#ifndef WEAPON_IFMBASECAMERA_H +#define WEAPON_IFMBASECAMERA_H +#ifdef _WIN32 +#pragma once +#endif + +#include "weapon_ifmbase.h" + +#ifdef CLIENT_DLL +#include "materialsystem/MaterialSystemUtil.h" +#endif + +#if defined( CLIENT_DLL ) + #define CWeaponIFMBaseCamera C_WeaponIFMBaseCamera +#endif + +class CWeaponIFMBaseCamera : public CWeaponIFMBase +{ +public: + DECLARE_CLASS( CWeaponIFMBaseCamera, CWeaponIFMBase ); + DECLARE_NETWORKCLASS(); + DECLARE_PREDICTABLE(); + +#ifdef GAME_DLL + DECLARE_DATADESC(); +#endif + + // Shared code +public: + CWeaponIFMBaseCamera(); + +#ifdef CLIENT_DLL + // Client code +public: + virtual void ViewModelDrawn( CBaseViewModel *pBaseViewModel ); + virtual void DrawCrosshair( ); + virtual int DrawModel( int flags ); + virtual void OnDataChanged( DataUpdateType_t updateType ); + +protected: + // Gets the abs orientation of the camera + virtual void ComputeAbsCameraTransform( Vector &vecAbsOrigin, QAngle &angAbsRotation ); + + // Gets the bounds of the overlay to draw + void GetOverlayBounds( int &x, int &y, int &w, int &h ); + + // Gets the size of the overlay to draw + void GetViewportSize( int &w, int &h ); + + void TransmitRenderInfo(); + + float m_flFOV; + float m_flArmLength; + Vector m_vecRelativePosition; + QAngle m_angRelativeAngles; + int m_nScreenWidth; + int m_nScreenHeight; + bool m_bFullScreen; + CMaterialReference m_FrustumMaterial; + CMaterialReference m_FrustumWireframeMaterial; +#endif + +#ifdef GAME_DLL + // Server code +public: + void SetRenderInfo( float flAspectRatio, float flFOV, float flArmLength, const Vector &vecPosition, const QAngle &angles ); +#endif + +private: + CNetworkVar( float, m_flRenderAspectRatio ); + CNetworkVar( float, m_flRenderFOV ); + CNetworkVar( float, m_flRenderArmLength ); + CNetworkVector( m_vecRenderPosition ); + CNetworkQAngle( m_angRenderAngles ); + + CWeaponIFMBaseCamera( const CWeaponIFMBaseCamera & ); +}; + + +#endif // WEAPON_IFMBASECAMERA_H |