123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- #ifndef __GAME_LIGHT_H__
- #define __GAME_LIGHT_H__
- extern const idEventDef EV_Light_GetLightParm;
- extern const idEventDef EV_Light_SetLightParm;
- extern const idEventDef EV_Light_SetLightParms;
- class idLight : public idEntity {
- public:
- CLASS_PROTOTYPE( idLight );
- idLight();
- ~idLight();
- void Spawn();
- void Save( idSaveGame *savefile ) const;
- void Restore( idRestoreGame *savefile );
- virtual void UpdateChangeableSpawnArgs( const idDict *source );
- virtual void Think();
- virtual void ClientThink( const int curTime, const float fraction, const bool predict );
- virtual void FreeLightDef();
- virtual bool GetPhysicsToSoundTransform( idVec3 &origin, idMat3 &axis );
- void Present();
- void SaveState( idDict *args );
- virtual void SetColor( float red, float green, float blue );
- virtual void SetColor( const idVec4 &color );
- void SetColor( const idVec3 &color );
- virtual void GetColor( idVec3 &out ) const;
- virtual void GetColor( idVec4 &out ) const;
- const idVec3 & GetBaseColor() const { return baseColor; }
- void SetShader( const char *shadername );
- void SetLightParm( int parmnum, float value );
- void SetLightParms( float parm0, float parm1, float parm2, float parm3 );
- void SetRadiusXYZ( float x, float y, float z );
- void SetRadius( float radius );
- void On();
- void Off();
- void Fade( const idVec4 &to, float fadeTime );
- void FadeOut( float time );
- void FadeIn( float time );
- void Killed( idEntity *inflictor, idEntity *attacker, int damage, const idVec3 &dir, int location );
- void BecomeBroken( idEntity *activator );
- qhandle_t GetLightDefHandle() const { return lightDefHandle; }
- void SetLightParent( idEntity *lparent ) { lightParent = lparent; }
- void SetLightLevel();
- virtual void ShowEditingDialog();
- enum {
- EVENT_BECOMEBROKEN = idEntity::EVENT_MAXEVENTS,
- EVENT_MAXEVENTS
- };
- virtual void ClientPredictionThink();
- virtual void WriteToSnapshot( idBitMsg &msg ) const;
- virtual void ReadFromSnapshot( const idBitMsg &msg );
- virtual bool ClientReceiveEvent( int event, int time, const idBitMsg &msg );
- private:
- renderLight_t renderLight;
- idVec3 localLightOrigin;
- idMat3 localLightAxis;
- qhandle_t lightDefHandle;
- idStr brokenModel;
- int levels;
- int currentLevel;
- idVec3 baseColor;
-
- idVec3 previousBaseColor;
- idVec3 nextBaseColor;
- bool breakOnTrigger;
- int count;
- int triggercount;
- idEntity * lightParent;
- idVec4 fadeFrom;
- idVec4 fadeTo;
- int fadeStart;
- int fadeEnd;
- bool soundWasPlaying;
- private:
- void PresentLightDefChange();
- void PresentModelDefChange();
- void Event_SetShader( const char *shadername );
- void Event_GetLightParm( int parmnum );
- void Event_SetLightParm( int parmnum, float value );
- void Event_SetLightParms( float parm0, float parm1, float parm2, float parm3 );
- void Event_SetRadiusXYZ( float x, float y, float z );
- void Event_SetRadius( float radius );
- void Event_Hide();
- void Event_Show();
- void Event_On();
- void Event_Off();
- void Event_ToggleOnOff( idEntity *activator );
- void Event_SetSoundHandles();
- void Event_FadeOut( float time );
- void Event_FadeIn( float time );
- };
- #endif
|