Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
307 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/***************************************************************************** | ||
* | ||
* PROJECT: Multi Theft Auto v1.x | ||
* (Shared logic for modifications) | ||
* LICENSE: See LICENSE in the top level directory | ||
* FILE: mods/shared_logic/CClientSearchLight.cpp | ||
* PURPOSE: HeliLight entity class source | ||
* | ||
*****************************************************************************/ | ||
#include <StdInc.h> | ||
|
||
CClientSearchLight::CClientSearchLight ( CClientManager* pManager, ElementID ID ) : ClassInit ( this ), CClientStreamElement ( pManager->GetLightStreamer (), ID ) | ||
{ | ||
m_pManager = pManager; | ||
pManager->GetPointLightsManager ()->AddToSearchLightList ( this ); | ||
|
||
SetTypeName ( "searchlight" ); | ||
} | ||
|
||
CClientSearchLight::~CClientSearchLight () | ||
{ | ||
Unlink (); | ||
} | ||
|
||
void CClientSearchLight::Unlink () | ||
{ | ||
g_pClientGame->GetManager ()->GetPointLightsManager ()->RemoveSearchLightFromList ( this ); | ||
} | ||
|
||
void CClientSearchLight::Render () | ||
{ | ||
DoAttaching (); | ||
|
||
if ( IsStreamedIn () ) | ||
g_pGame->GetPointLights ()->RenderHeliLight ( m_StartPosition, m_EndPosition, m_StartRadius, m_EndRadius, m_bRenderSpot ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/***************************************************************************** | ||
* | ||
* PROJECT: Multi Theft Auto v1.x | ||
* (Shared logic for modifications) | ||
* LICENSE: See LICENSE in the top level directory | ||
* FILE: mods/shared_logic/CClientSearchLight.h | ||
* PURPOSE: HeliLight entity class header | ||
* | ||
*****************************************************************************/ | ||
#pragma once | ||
#include "CClientEntity.h" | ||
|
||
class CClientPointLightsManager; | ||
|
||
class CClientSearchLight : public CClientStreamElement | ||
{ | ||
DECLARE_CLASS ( CClientSearchLight, CClientEntity ); | ||
friend class CClientPointLightsManager; | ||
|
||
public: | ||
CClientSearchLight ( CClientManager* pManager, ElementID ID ); | ||
~CClientSearchLight (); | ||
|
||
void Unlink (); | ||
eClientEntityType GetType () const { return CCLIENTSEARCHLIGHT; } | ||
|
||
// CClientEntity methods | ||
virtual void GetPosition ( CVector& vecPosition ) const override { vecPosition = m_StartPosition; } // required for streaming | ||
virtual void SetPosition ( const CVector& vecPosition ) override { } | ||
|
||
// CClientStreamElement methods | ||
virtual void StreamIn ( bool bInstantly ) override { if ( !IsStreamedIn () ) NotifyCreate (); } | ||
virtual void StreamOut () override { } | ||
|
||
inline const CVector& GetStartPosition () const { return m_StartPosition; } | ||
inline void SetStartPosition ( const CVector& startPos ) { m_StartPosition = startPos; UpdateStreamPosition ( startPos );} | ||
inline const CVector& GetEndPosition () const { return m_EndPosition; } | ||
inline void SetEndPosition ( const CVector& endPos ) { m_EndPosition = endPos; } | ||
|
||
inline float GetStartRadius () const { return m_StartRadius; } | ||
inline void SetStartRadius ( float radius ) { m_StartRadius = radius; } | ||
inline float GetEndRadius () const { return m_EndRadius; } | ||
inline void SetEndRadius ( float radius ) { m_EndRadius = radius; } | ||
|
||
inline bool GetRenderSpot () const { return m_bRenderSpot; } | ||
inline void SetRenderSpot ( bool renderSpot ) { m_bRenderSpot = renderSpot; } | ||
|
||
protected: | ||
void Render (); | ||
|
||
private: | ||
bool m_bStreamedIn; | ||
CVector m_StartPosition; | ||
CVector m_EndPosition; | ||
float m_StartRadius; | ||
float m_EndRadius; | ||
bool m_bRenderSpot; | ||
}; |
Oops, something went wrong.
9330995
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice