[Gcblue-commits] gcb_wx/include/sim Game.h,1.59,1.60 tcESMSensor.h,1.8,1.9 tcGameObject.h,1.39,1.40
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2005-06-22 01:21:39
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2118/include/sim Modified Files: Game.h tcESMSensor.h tcGameObject.h tcGoal.h tcLauncher.h tcLauncherState.h tcMapData.h tcMissileObject.h tcPlatformObject.h tcRadar.h tcSensorPlatform.h tcSensorState.h tcSimState.h tcStores.h Log Message: Misc housekeeping, updates for infrared and anti-radiation seekers, more info for multiplayer airfield units, icon gui enhancements Index: tcGameObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcGameObject.h,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** tcGameObject.h 1 Jun 2005 00:13:28 -0000 1.39 --- tcGameObject.h 22 Jun 2005 01:21:27 -0000 1.40 *************** *** 121,124 **** --- 121,125 ---- float BearingToRad(tcGameObject& p) const; void AddChild(tcGameObject *child); + tcGameObject* GetChildById(long id) const; bool IsChild(const tcGameObject* child) const; void RemoveChild(tcGameObject *child); Index: tcMapData.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcMapData.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcMapData.h 24 Feb 2005 22:19:14 -0000 1.10 --- tcMapData.h 22 Jun 2005 01:21:27 -0000 1.11 *************** *** 103,106 **** --- 103,108 ---- * generations of code are jumbled together here. This sorely * needs refactoring. + * + * Converted into singleton class. */ class tcMapData *************** *** 134,144 **** void LoadHighResB(float startLon_deg, float startLat_deg); int LoadHighResDefault(float afStartLon_deg, float afStartLat_deg); ! void SaveHighRes(void); ! int LoadLowRes(void); void CreateDefaultMap(float afStartLat_deg, float afStartLon_deg, unsigned anWidth, unsigned anHeight); tcMapData(); ~tcMapData(); ! private: tcOptions *mpOptions; tsDemInfo maDemInfo[N_DEMFILES]; --- 136,149 ---- void LoadHighResB(float startLon_deg, float startLat_deg); int LoadHighResDefault(float afStartLon_deg, float afStartLat_deg); ! void SaveHighRes(); ! int LoadLowRes(); void CreateDefaultMap(float afStartLat_deg, float afStartLon_deg, unsigned anWidth, unsigned anHeight); + + static tcMapData* Get(); ///< singleton accessor + private: tcMapData(); ~tcMapData(); ! tcOptions *mpOptions; tsDemInfo maDemInfo[N_DEMFILES]; Index: tcStores.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcStores.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcStores.h 12 Jun 2005 20:46:33 -0000 1.5 --- tcStores.h 22 Jun 2005 01:21:27 -0000 1.6 *************** *** 61,65 **** tcDatabaseObject* GetDatabaseObject() const; ! StoreItem(); StoreItem(const StoreItem& src); --- 61,66 ---- tcDatabaseObject* GetDatabaseObject() const; ! void SetDatabaseObject(tcDatabaseObject* obj); ! StoreItem(); StoreItem(const StoreItem& src); *************** *** 113,118 **** tcUpdateStream& operator>>(tcUpdateStream& stream); ! bool CommandInfoMatches(const tcStores& launcher); ! void CopyCommandInfoFrom(const tcStores& launcher); tcStores(tcStoresDBObject* dbObj); --- 114,119 ---- tcUpdateStream& operator>>(tcUpdateStream& stream); ! void ClearNewCommand(); ! bool HasNewCommand() const; tcStores(tcStoresDBObject* dbObj); *************** *** 126,132 **** --- 127,148 ---- int errorCode; ///< used in multiplayer to pass error code to client double lastUpdate; + + // data for multiplayer commands + struct CommandInfo + { + short int id; ///< id of unit that command applies to, -1 for local unit + unsigned char op; ///< UNLOAD = 0, LOAD = 1, REFUEL = 2 + long itemId; ///< database id of item (if applicable) + unsigned long quantity; + unsigned char launcherIdx; + }; + std::vector<CommandInfo> commandList; + + bool AddOperation(const std::string& itemName, unsigned int launcherIdx, unsigned long quantity, + int opType, tcGameObject* obj); void CompleteOperation(StoreOperation& op); tcGameObject* GetChildOrParent(tcGameObject* child); + bool ValidateOpObject(tcGameObject* obj); }; #endif \ No newline at end of file Index: tcSimState.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSimState.h,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** tcSimState.h 1 Jun 2005 00:13:28 -0000 1.41 --- tcSimState.h 22 Jun 2005 01:21:27 -0000 1.42 *************** *** 152,156 **** const char* GetScenarioDescription() const; const char* GetScenarioName() const; - int GetSeekerTrack(long anKey, tcTrack& track); tcSensorMap* GetSensorMap(); double GetTime() {return mfSimTime;} --- 152,155 ---- *************** *** 165,170 **** void PrintToFile(tcString); void ProcessLanding(tcGameObject *receiver, tcGameObject *landing_unit); ! bool RadarCanDetect(tnPoolIndex anSensorKey, const tcGameObject* target, tcGameObject* reference, float afSensorAz, long fcID = -1, unsigned fcIdx = 0); void RandInit(); void RemoveDestroyedObjects(void); --- 164,173 ---- void PrintToFile(tcString); void ProcessLanding(tcGameObject *receiver, tcGameObject *landing_unit); ! ! bool RadarCanDetect(long anSensorKey, const tcGameObject* target, tcGameObject* reference, float afSensorAz, long fcID = -1, unsigned fcIdx = 0); + bool SensorCanDetect(long sensorKey, const tcGameObject* target, + tcGameObject* reference, float sensorAz, long fcID = -1, unsigned fcIdx = 0); + void RandInit(); void RemoveDestroyedObjects(void); Index: Game.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/Game.h,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** Game.h 11 Jun 2005 21:01:43 -0000 1.59 --- Game.h 22 Jun 2005 01:21:26 -0000 1.60 *************** *** 39,43 **** #include "tcGameView.h" #include "tcUserInfo.h" - #include "tcMapData.h" #include "tcOptions.h" #include "tcOptionsView.h" --- 39,42 ---- *************** *** 72,75 **** --- 71,75 ---- class tc3DWindow; class tcDraggedIconDisplay; + class tcMapData; using namespace scriptinterface; *************** *** 165,169 **** tcDatabase* database; tcSimState* simState; ! tcMapData mcMapData; tcCommandQueue* commandQueue; tcSimPythonInterface* pythonInterface; --- 165,169 ---- tcDatabase* database; tcSimState* simState; ! tcMapData* mapData; tcCommandQueue* commandQueue; tcSimPythonInterface* pythonInterface; Index: tcESMSensor.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcESMSensor.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcESMSensor.h 1 Jun 2005 00:13:28 -0000 1.8 --- tcESMSensor.h 22 Jun 2005 01:21:27 -0000 1.9 *************** *** 43,46 **** --- 43,47 ---- tcESMDBObject* mpDBObj; + virtual bool CanDetectTarget(const tcGameObject* target, float& range_km); virtual bool InitFromDatabase(long key); ///< initializes sensor using database data at key bool IsDetected(const tcRadar* emitter, float& rfAz_rad); *************** *** 56,64 **** tcESMSensor(tcESMDBObject* dbObj); virtual ~tcESMSensor(); ! protected: void ProcessESMDetection(tcGameObject* target, double t); void UpdateSensorMap(const tcGameObject* target, long* emitters, unsigned int nEmitters, float az_rad, double t); }; ! #endif \ No newline at end of file --- 57,70 ---- tcESMSensor(tcESMDBObject* dbObj); virtual ~tcESMSensor(); ! ! private: ! float targetRange_km; ///< target range from last call to IsDetected void ProcessESMDetection(tcGameObject* target, double t); void UpdateSensorMap(const tcGameObject* target, long* emitters, unsigned int nEmitters, float az_rad, double t); + void UpdateSeeker(double t); + void UpdateSurveillance(double t); + void UpdateTrack(const tcGameObject* target, double t); }; ! #endif Index: tcGoal.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcGoal.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcGoal.h 5 Sep 2004 02:38:44 -0000 1.4 --- tcGoal.h 22 Jun 2005 01:21:27 -0000 1.5 *************** *** 67,71 **** tcGoal(); tcGoal(const tcGoal& goal); ! ~tcGoal(); }; --- 67,71 ---- tcGoal(); tcGoal(const tcGoal& goal); ! virtual ~tcGoal(); }; Index: tcLauncher.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcLauncher.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcLauncher.h 12 Jun 2005 20:46:28 -0000 1.18 --- tcLauncher.h 22 Jun 2005 01:21:27 -0000 1.19 *************** *** 159,162 **** --- 159,164 ---- static tcSimState* simState; + void InitForNewChild(); + }; #endif \ No newline at end of file Index: tcMissileObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcMissileObject.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcMissileObject.h 1 Jun 2005 00:13:28 -0000 1.18 --- tcMissileObject.h 22 Jun 2005 01:21:27 -0000 1.19 *************** *** 55,59 **** float mfRangeToObjective_km; // for segment determination UINT mnCurrentSegment; ! tcRadar mcSensorState; Aero::tsMissileKState msKState; tcMissileDBObject *mpDBObject; // pointer to valid database obj --- 55,59 ---- float mfRangeToObjective_km; // for segment determination UINT mnCurrentSegment; ! tcSensorState* sensor; ///< missile seeker Aero::tsMissileKState msKState; tcMissileDBObject *mpDBObject; // pointer to valid database obj *************** *** 70,74 **** float GetDistanceFromLaunch() const; virtual void SetSpeed(float afNewSpeed) {mfGoalSpeed_kts=afNewSpeed;} ! virtual tcRadar* GetSensorState(); virtual void DesignateTarget(long anID); virtual int GetGuidanceParameters(tsGuidanceParameters& gp); --- 70,75 ---- float GetDistanceFromLaunch() const; virtual void SetSpeed(float afNewSpeed) {mfGoalSpeed_kts=afNewSpeed;} ! virtual tcRadar* GetSeekerRadar() const; ! virtual tcSensorState* GetSeekerSensor() const; virtual void DesignateTarget(long anID); virtual int GetGuidanceParameters(tsGuidanceParameters& gp); Index: tcLauncherState.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcLauncherState.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tcLauncherState.h 1 Jun 2005 00:13:28 -0000 1.16 --- tcLauncherState.h 22 Jun 2005 01:21:27 -0000 1.17 *************** *** 44,48 **** class tcGameObject; class tcSimState; ! class tcRadar; class tcStream; class tcCommandStream; --- 44,48 ---- class tcGameObject; class tcSimState; ! class tcSensorState; class tcStream; class tcCommandStream; *************** *** 90,94 **** void Serialize(tcFile& file, bool abLoad); ! void SetFireControlSensor(unsigned nLauncher, tcRadar* radar, unsigned sensorIdx); int SetLaunch(int nLauncher, int quantity); bool SetLauncherDatum(unsigned nLauncher, --- 90,94 ---- void Serialize(tcFile& file, bool abLoad); ! void SetFireControlSensor(unsigned nLauncher, tcSensorState* sensor, unsigned sensorIdx); int SetLaunch(int nLauncher, int quantity); bool SetLauncherDatum(unsigned nLauncher, Index: tcRadar.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcRadar.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcRadar.h 1 Jun 2005 00:13:28 -0000 1.15 --- tcRadar.h 22 Jun 2005 01:21:27 -0000 1.16 *************** *** 69,74 **** // semi-active and command mode vars - long illuminatorID; ///< id of SA illuminating platform - unsigned char illuminatorSensorIdx; ///< sensor index of illum platform virtual bool CanDetectTarget(const tcGameObject* target, float& range_km); --- 69,72 ---- *************** *** 83,87 **** virtual bool IsSemiactive() const {return isSemiactive;} virtual void SetCommandState(bool state); ! virtual void SetIlluminator(long illum_id, unsigned char sensor_idx); void Serialize(tcFile& file, bool mbLoad); --- 81,85 ---- virtual bool IsSemiactive() const {return isSemiactive;} virtual void SetCommandState(bool state); ! virtual void SetFireControlSensor(long id, unsigned char idx); void Serialize(tcFile& file, bool mbLoad); *************** *** 104,108 **** bool isCommandReceiver; - tcRadar* GetSemiactiveIlluminator(); void UpdateSeeker(double t); void UpdateSensorMap(double t, const tcGameObject* target, float range_km); --- 102,105 ---- Index: tcPlatformObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcPlatformObject.h,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** tcPlatformObject.h 12 Jun 2005 20:46:33 -0000 1.30 --- tcPlatformObject.h 22 Jun 2005 01:21:27 -0000 1.31 *************** *** 77,81 **** UPDATE_LAUNCHERS = 0x02, UPDATE_SENSORS = 0x04, ! UPDATE_AI = 0x08 }; --- 77,82 ---- UPDATE_LAUNCHERS = 0x02, UPDATE_SENSORS = 0x04, ! UPDATE_AI = 0x08, ! UPDATE_STORES = 0x10 }; Index: tcSensorState.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSensorState.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcSensorState.h 1 Jun 2005 00:13:28 -0000 1.18 --- tcSensorState.h 22 Jun 2005 01:21:27 -0000 1.19 *************** *** 45,48 **** --- 45,49 ---- #define SSMODE_FC 5 // fire control only + class tcRadar; class tcSimState; class tcGameObject; *************** *** 70,76 **** static void AttachDatabase(tcDatabase* db) {database = db;} static void AttachSimState(tcSimState* ss) {simState = ss;} ! bool GetActive() const {return mbActive != 0;} void GetTestArea(tcRect& region); virtual bool InitFromDatabase(long key); ///< initializes sensor using database data at key bool IsDamaged() const; bool IsHidden() const; --- 71,83 ---- static void AttachDatabase(tcDatabase* db) {database = db;} static void AttachSimState(tcSimState* ss) {simState = ss;} ! virtual bool CanDetectTarget(const tcGameObject* target, float& range_km); ! ! tcRadar* GetFireControlRadar(); ! tcSensorState* GetFireControlSensor(); void GetTestArea(tcRect& region); + bool GetTrack(tcTrack& track_); + bool HasFireControlSensor() const; virtual bool InitFromDatabase(long key); ///< initializes sensor using database data at key + bool IsActive() const; bool IsDamaged() const; bool IsHidden() const; *************** *** 87,90 **** --- 94,98 ---- virtual void SetActive(bool active); void SetDamaged(bool state); + virtual void SetFireControlSensor(long id, unsigned char idx); void SetMountAz(float az); void SetParent(tcGameObject *obj) {parent = obj;} *************** *** 104,107 **** --- 112,118 ---- bool isHidden; ///< hidden sensors are not displayed in object control view bool isDamaged; + long fireControlId; ///< id of platform with fire control sensor (semi-active illuminator, or command guidance sensor) + unsigned char fireControlIdx; ///< sensor index of fire control sensor platform + }; #endif \ No newline at end of file Index: tcSensorPlatform.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSensorPlatform.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcSensorPlatform.h 1 Jun 2005 00:13:28 -0000 1.3 --- tcSensorPlatform.h 22 Jun 2005 01:21:27 -0000 1.4 *************** *** 62,67 **** unsigned int GetSensorCount() const; bool HasActivatedSensor(); ! bool IsRadiating(); ! const tcSensorState* GetSensor(unsigned idx); wxString GetSensorDescription(); tcSensorState* GetSensorMutable(unsigned idx); --- 62,67 ---- unsigned int GetSensorCount() const; bool HasActivatedSensor(); ! bool IsRadiating() const; ! const tcSensorState* GetSensor(unsigned idx) const; wxString GetSensorDescription(); tcSensorState* GetSensorMutable(unsigned idx); |