ivaria/engseq.h Source File (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

ivaria/engseq.h
Go to the documentation of this file.

    00001 /*
    00002     Copyright (C) 2002 by Jorrit Tyberghein
    00003
    00004     This library is free software; you can redistribute it and/or
    00005     modify it under the terms of the GNU Library General Public
    00006     License as published by the Free Software Foundation; either
    00007     version 2 of the License, or (at your option) any later version.
    00008
    00009     This library is distributed in the hope that it will be useful,
    00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00012     Library General Public License for more details.
    00013
    00014     You should have received a copy of the GNU Library General Public
    00015     License along with this library; if not, write to the Free
    00016     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    00017 */
    00018
    00019 #ifndef __CS_IVARIA_ENGSEQ_H__
    00020 #define __CS_IVARIA_ENGSEQ_H__
    00021
    00022 #include "csutil/scf.h"
    00023
    00029 struct iLight;
    00030 struct iMeshWrapper;
    00031 struct iObject;
    00032 struct iSector;
    00033 struct iSharedVariable;
    00034
    00035 class csBox3;
    00036 class csColor;
    00037 class csSphere;
    00038 class csVector3;
    00039
    00040 struct iSequence;
    00041 struct iSequenceManager;
    00042 struct iSequenceTrigger;
    00043 struct iSequenceWrapper;
    00044
    00046
    00049 enum
    00050 {
    00052   CS_SEQUENCE_LIGHTCHANGE_NONE = 0,
    00054   CS_SEQUENCE_LIGHTCHANGE_LESS = 1,
    00056   CS_SEQUENCE_LIGHTCHANGE_GREATER = 2
    00057 };
    00059
    00083 struct iParameterESM : public virtual iBase
    00084 {
    00085   SCF_INTERFACE (iParameterESM, 1, 0, 0);
    00086
    00093   virtual iBase* GetValue (iBase* params = 0) const = 0;
    00094
    00102   virtual bool IsConstant () const = 0;
    00103 };
    00104
    00129 struct iEngineSequenceParameters : public virtual iBase
    00130 {
    00131   SCF_INTERFACE (iEngineSequenceParameters, 1, 0, 0);
    00132
    00136   virtual size_t GetParameterCount () const = 0;
    00137
    00141   virtual iBase* GetParameter (size_t idx) const = 0;
    00142
    00146   virtual iBase* GetParameter (const char* name) const = 0;
    00147
    00151   virtual size_t GetParameterIdx (const char* name) const = 0;
    00152
    00156   virtual const char* GetParameterName (size_t idx) const = 0;
    00157
    00163   virtual void AddParameter (const char* name, iBase* def_value = 0) = 0;
    00164
    00168   virtual void SetParameter (size_t idx, iBase* value) = 0;
    00169
    00173   virtual void SetParameter (const char* name, iBase* value) = 0;
    00174
    00181   virtual csPtr<iParameterESM> CreateParameterESM (const char* name) = 0;
    00182 };
    00183
    00206 struct iSequenceWrapper : public virtual iBase
    00207 {
    00208   SCF_INTERFACE (iSequenceWrapper, 2, 0, 0);
    00212   virtual iObject* QueryObject () = 0;
    00213
    00222   virtual iSequence* GetSequence () = 0;
    00223
    00231   virtual iEngineSequenceParameters* CreateBaseParameterBlock () = 0;
    00232
    00237   virtual iEngineSequenceParameters* GetBaseParameterBlock () = 0;
    00238
    00250   virtual csPtr<iEngineSequenceParameters> CreateParameterBlock () = 0;
    00251
    00263   virtual void AddOperationSetVariable (csTicks time,
    00264                 iSharedVariable* var, float value, float dvalue = 0) = 0;
    00265
    00278   virtual void AddOperationSetVariable (csTicks time,
    00279                 iSharedVariable* var, iSharedVariable* value,
    00280                 iSharedVariable* dvalue = 0) = 0;
    00281
    00288   virtual void AddOperationSetVariable (csTicks time,
    00289                 iSharedVariable* var, const csVector3& v) = 0;
    00290
    00297   virtual void AddOperationSetVariable (csTicks time,
    00298                 iSharedVariable* var, const csColor& c) = 0;
    00299
    00307   virtual void AddOperationSetMaterial (csTicks time, iParameterESM* mesh,
    00308                   iParameterESM* mat) = 0;
    00309
    00317   virtual void AddOperationSetLight (csTicks time, iParameterESM* light,
    00318                   const csColor& color) = 0;
    00319
    00330   virtual void AddOperationFadeLight (csTicks time, iParameterESM* light,
    00331                   const csColor& color, csTicks duration) = 0;
    00332
    00342   virtual void AddOperationSetAmbient (csTicks time, iParameterESM* sector,
    00343                   const csColor& color, iSharedVariable *colorvar) = 0;
    00344
    00355   virtual void AddOperationFadeAmbient (csTicks time, iParameterESM* sector,
    00356                   const csColor& color, csTicks duration) = 0;
    00357
    00365   virtual void AddOperationRandomDelay (csTicks time, int min, int max) = 0;
    00366
    00374   virtual void AddOperationSetMeshColor (csTicks time, iParameterESM* mesh,
    00375                   const csColor& color) = 0;
    00376
    00387   virtual void AddOperationFadeMeshColor (csTicks time, iParameterESM* mesh,
    00388                   const csColor& color, csTicks duration) = 0;
    00389
    00398   virtual void AddOperationSetFog (csTicks time, iParameterESM* sector,
    00399                   const csColor& color, float density) = 0;
    00400
    00412   virtual void AddOperationFadeFog (csTicks time, iParameterESM* sector,
    00413                   const csColor& color, float density, csTicks duration) = 0;
    00414
    00437   virtual void AddOperationRotateDuration (csTicks time, iParameterESM* mesh,
    00438                 int axis1, float tot_angle1,
    00439                 int axis2, float tot_angle2,
    00440                 int axis3, float tot_angle3,
    00441                 const csVector3& offset,
    00442                 csTicks duration, bool relative = false) = 0;
    00443
    00454   virtual void AddOperationMoveDuration (csTicks time, iParameterESM* mesh,
    00455                 const csVector3& offset, csTicks duration) = 0;
    00456
    00464   virtual void AddOperationTriggerState (csTicks time,
    00465                   iParameterESM* trigger, bool en) = 0;
    00466
    00476   virtual void AddOperationCheckTrigger (csTicks time,
    00477                   iParameterESM* trigger, csTicks delay) = 0;
    00478
    00492   virtual void AddOperationTestTrigger (csTicks time,
    00493                   iParameterESM* trigger,
    00494                   iSequence* trueSequence,
    00495                   iSequence* falseSequence) = 0;
    00496 };
    00497
    00514 struct iSequenceTrigger : public virtual iBase
    00515 {
    00516   SCF_INTERFACE (iSequenceTrigger, 0, 0, 3);
    00517
    00521   virtual iObject* QueryObject () = 0;
    00522
    00526   virtual void AddConditionInSector (iSector* sector) = 0;
    00527
    00531   virtual void AddConditionInSector (iSector* sector,
    00532         const csBox3& box) = 0;
    00533
    00537   virtual void AddConditionInSector (iSector* sector,
    00538         const csSphere& sphere) = 0;
    00539
    00543   virtual void AddConditionSectorVisible (iSector* sector) = 0;
    00544
    00548   virtual void AddConditionMeshClick (iMeshWrapper* mesh) = 0;
    00549
    00561   virtual void AddConditionLightChange (iLight *whichlight,
    00562                                         int oper, const csColor& color) = 0;
    00563
    00569   virtual void AddConditionManual () = 0;
    00570
    00575   virtual void SetEnabled (bool en) = 0;
    00576
    00580   virtual bool IsEnabled () const = 0;
    00581
    00585   virtual void ClearConditions () = 0;
    00586
    00590   virtual void Trigger () = 0;
    00591
    00595   virtual void SetParameters (iEngineSequenceParameters* params) = 0;
    00596
    00600   virtual iEngineSequenceParameters* GetParameters () const = 0;
    00601
    00608   virtual void FireSequence (csTicks delay, iSequenceWrapper* seq) = 0;
    00609
    00613   virtual iSequenceWrapper* GetFiredSequence () = 0;
    00614
    00620   virtual void TestConditions (csTicks delay) = 0;
    00621
    00629   virtual bool CheckState () = 0;
    00630
    00646   virtual void ForceFire (bool now = false) = 0;
    00647 };
    00648
    00666 struct iSequenceTimedOperation : public virtual iBase
    00667 {
    00668   SCF_INTERFACE (iSequenceTimedOperation, 1, 0, 0);
    00669
    00673   virtual void Do (float time, iBase* params) = 0;
    00674 };
    00675
    00687 struct iEngineSequenceManager : public virtual iBase
    00688 {
    00689   SCF_INTERFACE (iEngineSequenceManager, 1, 0, 0);
    00690
    00695   virtual iSequenceManager* GetSequenceManager () = 0;
    00696
    00700   virtual csPtr<iParameterESM> CreateParameterESM (iBase* value) = 0;
    00701
    00702   //-----------------------------------------------------------------------
    00703
    00707   virtual csPtr<iSequenceTrigger> CreateTrigger (const char* name) = 0;
    00708
    00712   virtual void RemoveTrigger (iSequenceTrigger* trigger) = 0;
    00713
    00717   virtual void RemoveTriggers () = 0;
    00718
    00722   virtual size_t GetTriggerCount () const = 0;
    00723
    00727   virtual iSequenceTrigger* GetTrigger (size_t idx) const = 0;
    00728
    00732   virtual iSequenceTrigger* FindTriggerByName (const char* name) const = 0;
    00733
    00740   virtual bool FireTriggerByName (const char *name, bool now = false) const = 0;
    00741
    00742   //-----------------------------------------------------------------------
    00743
    00747   virtual csPtr<iSequenceWrapper> CreateSequence (const char* name) = 0;
    00748
    00752   virtual void RemoveSequence (iSequenceWrapper* seq) = 0;
    00753
    00757   virtual void RemoveSequences () = 0;
    00758
    00762   virtual size_t GetSequenceCount () const = 0;
    00763
    00767   virtual iSequenceWrapper* GetSequence (size_t idx) const = 0;
    00768
    00772   virtual iSequenceWrapper* FindSequenceByName (const char* name) const = 0;
    00773
    00777   virtual bool RunSequenceByName (const char *name,int delay) const = 0;
    00778
    00779   //-----------------------------------------------------------------------
    00780
    00795   virtual void FireTimedOperation (csTicks delta, csTicks duration,
    00796         iSequenceTimedOperation* op, iBase* params = 0,
    00797         uint sequence_id = 0) = 0;
    00798
    00802   virtual void DestroyTimedOperations (uint sequence_id) = 0;
    00803
    00804   //-----------------------------------------------------------------------
    00805 };
    00806
    00807 #endif // __CS_IVARIA_ENGSEQ_H__
    00808