[Gcblue-commits] gcb_wx/include/sim tcAirObject.h,1.6,1.7 tcGameObject.h,1.17,1.18 tcMissileObject.h
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-05-01 21:49:32
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7022/include/sim Modified Files: tcAirObject.h tcGameObject.h tcMissileObject.h tcPlatformObject.h tcWeaponObject.h Log Message: Index: tcWeaponObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcWeaponObject.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcWeaponObject.h 23 Apr 2004 00:14:56 -0000 1.2 --- tcWeaponObject.h 1 May 2004 21:49:24 -0000 1.3 *************** *** 27,30 **** --- 27,31 ---- class tcStream; + class tcUpdateStream; namespace Database *************** *** 49,54 **** long intendedTarget; ! virtual tcStream& operator<<(tcStream& stream); ! virtual tcStream& operator>>(tcStream& stream); tcWeaponObject(); --- 50,55 ---- long intendedTarget; ! virtual tcUpdateStream& operator<<(tcUpdateStream& stream); ! virtual tcUpdateStream& operator>>(tcUpdateStream& stream); tcWeaponObject(); Index: tcGameObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcGameObject.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** tcGameObject.h 27 Apr 2004 01:24:17 -0000 1.17 --- tcGameObject.h 1 May 2004 21:49:24 -0000 1.18 *************** *** 43,46 **** --- 43,49 ---- class tcSimState; class tcStream; + class tcCommandStream; + class tcCreateStream; + class tcUpdateStream; /** *************** *** 93,100 **** // mpDBObject should always point to relevant data for current model class tcDatabaseObject *mpDBObject; ! double mfStatusTime; // timestamp for parameters ! tcKinematics mcKin; // position, motion, etc parameters ! tcTerrainInfo mcTerrain; // ground height ASL, water depth ! float mfDamageLevel; // 0 is no damage, up to toughness amount float RangeTo(tcGameObject& p); --- 96,103 ---- // mpDBObject should always point to relevant data for current model class tcDatabaseObject *mpDBObject; ! double mfStatusTime; ///< timestamp for parameters ! tcKinematics mcKin; ///< position, motion, etc parameters ! tcTerrainInfo mcTerrain; ///< ground height ASL, water depth ! float mfDamageLevel; ///< 0 is no damage, up to toughness amount float RangeTo(tcGameObject& p); *************** *** 109,115 **** virtual void PrintToFile(tcFile&); virtual void SaveToFile(tcFile& file); - virtual tcStream& operator<<(tcStream& stream); - virtual tcStream& operator>>(tcStream& stream); virtual void LoadFromFile(tcFile& file); --- 112,127 ---- virtual void PrintToFile(tcFile&); virtual void SaveToFile(tcFile& file); + virtual tcCommandStream& operator<<(tcCommandStream& stream); + virtual tcCreateStream& operator<<(tcCreateStream& stream); + virtual tcUpdateStream& operator<<(tcUpdateStream& stream); + + virtual tcCommandStream& operator>>(tcCommandStream& stream); + virtual tcCreateStream& operator>>(tcCreateStream& stream); + virtual tcUpdateStream& operator>>(tcUpdateStream& stream); + + virtual void ClearNewCommand(); + virtual bool HasNewCommand() const; + virtual bool HasUnacknowledgedCommand() const; virtual void LoadFromFile(tcFile& file); Index: tcMissileObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcMissileObject.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcMissileObject.h 23 Apr 2004 00:14:56 -0000 1.7 --- tcMissileObject.h 1 May 2004 21:49:24 -0000 1.8 *************** *** 30,34 **** using namespace Aero; ! class tcStream; /** --- 30,34 ---- using namespace Aero; ! class tcUpdateStream; /** *************** *** 66,71 **** void LoadFromFile(tcFile& file); virtual void Serialize(tcFile& file, bool mbLoad); ! virtual tcStream& operator<<(tcStream& stream); ! virtual tcStream& operator>>(tcStream& stream); tcMissileObject(); --- 66,71 ---- void LoadFromFile(tcFile& file); virtual void Serialize(tcFile& file, bool mbLoad); ! virtual tcUpdateStream& operator<<(tcUpdateStream& stream); ! virtual tcUpdateStream& operator>>(tcUpdateStream& stream); tcMissileObject(); Index: tcAirObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcAirObject.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcAirObject.h 13 Feb 2004 01:31:32 -0000 1.6 --- tcAirObject.h 1 May 2004 21:49:24 -0000 1.7 *************** *** 25,28 **** --- 25,31 ---- #include "tcplatformobject.h" + class tcUpdateStream; + class tcCommandStream; + #define MAX_PITCH_RAD 0.875f *************** *** 30,40 **** { public: tcGenericDBObject *mpDBObject; int readyForLanding; ///< 1 if gear down/ready for landing, 0 otherwise virtual void ApplyRestrictions(); virtual void Clear(void); virtual void RandInitNear(float afLon_deg, float afLat_deg); ! virtual void SetLandingState(int state) {readyForLanding = state;} void SetPitchLimit(float limit_rad); virtual void UpdateClimb(float dt_s); --- 33,56 ---- { public: + enum + { + LANDING_CMD = 0x0001 + }; + tcGenericDBObject *mpDBObject; int readyForLanding; ///< 1 if gear down/ready for landing, 0 otherwise + bool newCommand; ///< flag to indicate new obj command since last update + /** + * bitfield to manage acknowledgement for command updates. + * appropriate bit is set when new command update is generated, + * bit is cleared when ack update is received. + */ + int commandStatus; + virtual void ApplyRestrictions(); virtual void Clear(void); virtual void RandInitNear(float afLon_deg, float afLat_deg); ! virtual void SetLandingState(int state); void SetPitchLimit(float limit_rad); virtual void UpdateClimb(float dt_s); *************** *** 46,49 **** --- 62,75 ---- virtual void Serialize(tcFile& file, bool mbLoad); + virtual tcCommandStream& operator<<(tcCommandStream& stream); + virtual tcUpdateStream& operator<<(tcUpdateStream& stream); + + virtual tcCommandStream& operator>>(tcCommandStream& stream); + virtual tcUpdateStream& operator>>(tcUpdateStream& stream); + + virtual void ClearNewCommand(); + virtual bool HasNewCommand() const; + virtual bool HasUnacknowledgedCommand() const; + tcAirObject(); tcAirObject(tcAirObject&); Index: tcPlatformObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcPlatformObject.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcPlatformObject.h 29 Apr 2004 00:05:13 -0000 1.15 --- tcPlatformObject.h 1 May 2004 21:49:24 -0000 1.16 *************** *** 30,33 **** --- 30,36 ---- class tcStream; + class tcCommandStream; + class tcCreateStream; + class tcUpdateStream; namespace Database *************** *** 50,55 **** ALT_CMD = 0x0004, LAUNCH_CMD = 0x0008, ! AI_CMD = 0x0010, ! NEW_CMD = 0x8000 }; enum --- 53,57 ---- ALT_CMD = 0x0004, LAUNCH_CMD = 0x0008, ! AI_CMD = 0x0010 }; enum *************** *** 69,77 **** tsFormationParameters msFormationParameters; tcGenericDBObject *mpDBObject; /** ! * bits set when new command is received from UI (client) or from client via ! * mp interface (server). ! * bits cleared when matching state update received (client) or state update is ! * transmitted (server) */ int commandStatus; --- 71,80 ---- tsFormationParameters msFormationParameters; tcGenericDBObject *mpDBObject; + + bool newCommand; ///< flag to indicate new obj command since last update /** ! * bitfield to manage acknowledgement for command updates. ! * appropriate bit is set when new command update is generated, ! * bit is cleared when ack update is received. */ int commandStatus; *************** *** 106,111 **** void LoadFromFile(tcFile& file); virtual void Serialize(tcFile& file, bool mbLoad); ! virtual tcStream& operator<<(tcStream& stream); ! virtual tcStream& operator>>(tcStream& stream); --- 109,124 ---- void LoadFromFile(tcFile& file); virtual void Serialize(tcFile& file, bool mbLoad); ! ! virtual tcCommandStream& operator<<(tcCommandStream& stream); ! virtual tcCreateStream& operator<<(tcCreateStream& stream); ! virtual tcUpdateStream& operator<<(tcUpdateStream& stream); ! ! virtual tcCommandStream& operator>>(tcCommandStream& stream); ! virtual tcCreateStream& operator>>(tcCreateStream& stream); ! virtual tcUpdateStream& operator>>(tcUpdateStream& stream); ! ! virtual void ClearNewCommand(); ! virtual bool HasNewCommand() const; ! virtual bool HasUnacknowledgedCommand() const; *************** *** 120,124 **** virtual void ApplyRestrictions(void); virtual void SetFireControlSensors(); ! void LoadCommandParam(tcStream& stream, float& param, int flag); ///< used for multiplayer serialization virtual void Move(float dt_s); virtual void UpdateClimb(float dt_s) {}; --- 133,141 ---- virtual void ApplyRestrictions(void); virtual void SetFireControlSensors(); ! ! /// implements rules for updating command params over multiplayer connection ! void LoadCommandParam(tcCommandStream& stream, float& param, int& cmdStatus, int flag); ! void LoadCommandParam(tcCommandStream& stream, int& param, int& cmdStatus, int flag); ! virtual void Move(float dt_s); virtual void UpdateClimb(float dt_s) {}; |