gcblue-commits Mailing List for Global Conflict Blue (Page 41)
Status: Alpha
Brought to you by:
ddcforge
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(112) |
Feb
(106) |
Mar
(88) |
Apr
(111) |
May
(53) |
Jun
(60) |
Jul
(58) |
Aug
(61) |
Sep
(45) |
Oct
(31) |
Nov
(71) |
Dec
(70) |
| 2005 |
Jan
(33) |
Feb
(57) |
Mar
(98) |
Apr
(47) |
May
(53) |
Jun
(79) |
Jul
(79) |
Aug
|
Sep
(33) |
Oct
(1) |
Nov
(20) |
Dec
(64) |
| 2006 |
Jan
(20) |
Feb
(1) |
Mar
(43) |
Apr
(11) |
May
(8) |
Jun
(23) |
Jul
|
Aug
(28) |
Sep
(58) |
Oct
(25) |
Nov
(47) |
Dec
(70) |
|
From: Dewitt C. <ddc...@us...> - 2004-11-07 03:42:03
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4233/src/common Modified Files: tcSound.cpp Log Message: Added optical sensor model, fixed generic model display for sensor tracks Index: tcSound.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/tcSound.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** tcSound.cpp 14 Sep 2004 02:01:46 -0000 1.17 --- tcSound.cpp 7 Nov 2004 03:40:43 -0000 1.18 *************** *** 109,112 **** --- 109,115 ---- LoadWavDataFromFile("fslide.wav",SEFFECT_FSLIDE); LoadWavDataFromFile("NavalGun1.wav", SEFFECT_NAVALGUN); + LoadWavDataFromFile("helolaunch.wav", SEFFECT_HELOLAUNCH); + LoadWavDataFromFile("radar_on.wav", SEFFECT_RADARON); + LoadWavDataFromFile("radar_off.wav", SEFFECT_RADAROFF); if((alGetError())!=AL_NO_ERROR) |
|
From: Dewitt C. <ddc...@us...> - 2004-11-07 03:41:59
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4233/src/database Modified Files: tcMissileDBObject.cpp Log Message: Added optical sensor model, fixed generic model display for sensor tracks Index: tcMissileDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcMissileDBObject.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcMissileDBObject.cpp 6 Nov 2004 15:13:41 -0000 1.12 --- tcMissileDBObject.cpp 7 Nov 2004 03:40:44 -0000 1.13 *************** *** 53,64 **** tsMissileFlightSegment *pFirstSegment = &maFlightProfile[0]; ! if ((pFirstSegment->meGuidanceMode == GM_COMMAND)|| ! (pFirstSegment->meGuidanceMode == GM_NAV)) { ! return DATUM_ONLY; ! } else { ! return SEEKER_TRACK; // SA not implemented yet } } --- 53,65 ---- tsMissileFlightSegment *pFirstSegment = &maFlightProfile[0]; ! /* removed (pFirstSegment->meGuidanceMode == GM_COMMAND) since ! ** command guidance for AAMs works through seeker */ ! if (pFirstSegment->meGuidanceMode == GM_NAV) { ! return DATUM_ONLY; ! } else { ! return SEEKER_TRACK; // SA not implemented yet } } |
|
From: Dewitt C. <ddc...@us...> - 2004-11-07 03:41:58
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4233/src/graphics Modified Files: tc3DWindow.cpp tcCreditView.cpp tcHookInfo.cpp tcParticleEffect.cpp Log Message: Added optical sensor model, fixed generic model display for sensor tracks Index: tcCreditView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcCreditView.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcCreditView.cpp 2 Nov 2004 04:23:56 -0000 1.8 --- tcCreditView.cpp 7 Nov 2004 03:40:44 -0000 1.9 *************** *** 107,110 **** --- 107,113 ---- AddCredit(s, 60.0f, 0); + s = "Some sound effects courtesy of A1 Sound Effects, www.a1freesoundeffects.com\n"; + AddCredit(s, 60.0f, 0); + s = "3D sky code\n"; AddCredit(s, 25.0f, 0); Index: tcHookInfo.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcHookInfo.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcHookInfo.cpp 6 Nov 2004 15:13:41 -0000 1.5 --- tcHookInfo.cpp 7 Nov 2004 03:40:44 -0000 1.6 *************** *** 38,41 **** --- 38,42 ---- #include "tcDatabase.h" #include "tcTime.h" + #include "tcMissileObject.h" #ifdef _DEBUG *************** *** 396,400 **** // AI action text for platform objects tcPlatformObject* pPlatformObj = dynamic_cast<tcPlatformObject*>(pHookedObj); ! if(pPlatformObj != NULL) { std::string text; --- 397,401 ---- // AI action text for platform objects tcPlatformObject* pPlatformObj = dynamic_cast<tcPlatformObject*>(pHookedObj); ! if (pPlatformObj != NULL) { std::string text; *************** *** 407,410 **** --- 408,419 ---- ftexty += 15; } + if (tcMissileObject* missile = dynamic_cast<tcMissileObject*>(pHookedObj)) + { + sprintf(zBuff, "Runtime: %.1f", missile->RuntimeRemaining()); + + DrawTextR(zBuff, ftextx, ftexty, defaultFont.get(), color, fontSize, LEFT_BASE_LINE); + ftexty += 15; + + } } Index: tcParticleEffect.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcParticleEffect.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcParticleEffect.cpp 2 Nov 2004 04:23:56 -0000 1.4 --- tcParticleEffect.cpp 7 Nov 2004 03:40:44 -0000 1.5 *************** *** 192,207 **** case AFTERBURNER: { ! counter->setRateRange(300, 350); ! ptemplate.setLifeTime(3); // 3 seconds of life ! ptemplate.setSizeRange(osgParticle::rangef(0.75f, 3.0f)); ! ptemplate.setAlphaRange(osgParticle::rangef(0.0f, 1.5f)); ptemplate.setColorRange(osgParticle::rangev4( ! osg::Vec4(0.8f, 0.6f, 0.6f, 1.5f), osg::Vec4(0, 0.7f, 1.0f, 0.0f))); ! ptemplate.setRadius(0.5f); // 5 cm wide particles ! ptemplate.setMass(0.05f); // 50 g heavy ! shooter->setInitialSpeedRange(0, 0); accelOp->setAcceleration(osg::Vec3(0, 0, 0)); } break; --- 192,209 ---- case AFTERBURNER: { ! //counter->setRateRange(300, 350); ! ptemplate.setLifeTime(2); ! ptemplate.setSizeRange(osgParticle::rangef(0.5f, 10.0f)); ! ptemplate.setAlphaRange(osgParticle::rangef(0.1f, 0.3f)); ptemplate.setColorRange(osgParticle::rangev4( ! osg::Vec4(0.5f, 0.2f, 0.2f, 1.5f), osg::Vec4(0, 0.7f, 1.0f, 0.0f))); ! ptemplate.setRadius(1.0f); ! ptemplate.setMass(0.05f); ! //shooter->setInitialSpeedRange(0, 0); accelOp->setAcceleration(osg::Vec3(0, 0, 0)); + + particlePlacer->setApplyJitter(true); } break; *************** *** 230,233 **** --- 232,259 ---- } break; + case GUN: + { + counter->setRateRange(20, 40); + ptemplate.setLifeTime(8); // 3 seconds of life + ptemplate.setSizeRange(osgParticle::rangef(2.5f, 5.0f)); + ptemplate.setAlphaRange(osgParticle::rangef(0.0f, 1.5f)); + ptemplate.setColorRange(osgParticle::rangev4( + osg::Vec4(0.0f, 0.0f, 0.0f, 1.5f), + osg::Vec4(0.7, 0.6f, 0.6f, 0.0f))); + ptemplate.setRadius(25.0f); + ptemplate.setMass(0.05f); // for friction op I guess + + + shooter->setInitialSpeedRange(3, 15); + shooter->setThetaRange(-0.1, 0.1); + shooter->setPhiRange(0, 0); + + accelOp->setAcceleration(osg::Vec3(0, 0, -0.5)); + + osgParticle::FluidFrictionOperator *op = new osgParticle::FluidFrictionOperator; + op->setFluidToAir(); + program->addOperator(op); + } + break; default: break; *************** *** 267,270 **** --- 293,324 ---- } + void tcParticleEffect::InitializeGunEffect() + { + osgParticle::ModularEmitter* modularEmitter = new osgParticle::ModularEmitter; + emitter = modularEmitter; + + modularEmitter->setParticleSystem(this); + + counter = new osgParticle::RandomRateCounter; + + modularEmitter->setCounter(counter.get()); + + particlePlacer = new osgParticle::tcParticlePlacer; + particlePlacer->setCenter(0, 0, 0); + + modularEmitter->setPlacer(particlePlacer); + modularEmitter->setReferenceFrame(osgParticle::Emitter::RELATIVE_TO_ABSOLUTE); + + shooter = new osgParticle::RadialShooter; + + modularEmitter->setShooter(shooter.get()); + + program = new osgParticle::ModularProgram; + program->setParticleSystem(this); + + // create an operator that simulates the gravity acceleration. + accelOp = new osgParticle::AccelOperator; + program->addOperator(accelOp.get()); + } *************** *** 272,276 **** : root(0), smokeMode(smokeModeCode) { ! if (smokeModeCode == MISSILE) { osgParticle::SmokeTrailEmitter* smokeTrailEmitter = --- 326,330 ---- : root(0), smokeMode(smokeModeCode) { ! if ((smokeModeCode == MISSILE) || (smokeModeCode == AFTERBURNER)) { osgParticle::SmokeTrailEmitter* smokeTrailEmitter = Index: tc3DWindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DWindow.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tc3DWindow.cpp 2 Nov 2004 04:23:56 -0000 1.9 --- tc3DWindow.cpp 7 Nov 2004 03:40:44 -0000 1.10 *************** *** 1392,1395 **** --- 1392,1396 ---- + #ifdef _DEBUG if (osg::StateSet* stateSet = textRoot->getStateSet()) { *************** *** 1415,1418 **** --- 1416,1420 ---- fprintf(stderr, "Error - TextObject null stateset\n"); } + #endif text->dirtyBound(); text->dirtyDisplayList(); *************** *** 1515,1519 **** { ! if (osg::StateSet* stateSet = backgroundRoot->getStateSet()) { --- 1517,1521 ---- { ! #ifdef _DEBUG if (osg::StateSet* stateSet = backgroundRoot->getStateSet()) { *************** *** 1533,1536 **** --- 1535,1539 ---- fprintf(stderr, "Error - backgroundRoot null stateset\n"); } + #endif |
|
From: Dewitt C. <ddc...@us...> - 2004-11-07 03:41:51
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4233/include/sim Modified Files: tcAeroAirObject.h tcAirObject.h tcMissileObject.h tcRadar.h Log Message: Added optical sensor model, fixed generic model display for sensor tracks Index: tcAirObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcAirObject.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcAirObject.h 9 Aug 2004 02:35:14 -0000 1.11 --- tcAirObject.h 7 Nov 2004 03:40:43 -0000 1.12 *************** *** 80,85 **** tcCommandObject commandObj; ! virtual void UpdateHeading(float dt_s); float maxPitch_rad; ///< user imposed restriction to pitch angle }; --- 80,86 ---- tcCommandObject commandObj; ! virtual void UpdateEffects(); virtual void UpdateHeading(float dt_s); + virtual void UpdateSpeed(float dt_s); float maxPitch_rad; ///< user imposed restriction to pitch angle }; Index: tcAeroAirObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcAeroAirObject.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcAeroAirObject.h 17 Aug 2004 02:22:56 -0000 1.6 --- tcAeroAirObject.h 7 Nov 2004 03:40:43 -0000 1.7 *************** *** 59,62 **** --- 59,63 ---- protected: virtual void UpdateClimb(float dt_s); + virtual void UpdateEffects(); virtual void UpdateHeading(float dt_s); virtual void Update(double afStatusTime); Index: tcMissileObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcMissileObject.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcMissileObject.h 17 Aug 2004 02:22:56 -0000 1.12 --- tcMissileObject.h 7 Nov 2004 03:40:43 -0000 1.13 *************** *** 59,63 **** tcMissileDBObject *mpDBObject; // pointer to valid database obj ! void Clear(void); void LaunchFrom(tcGameObject* obj, unsigned nLauncher); void RandInitNear(float afLon_deg, float afLat_deg); --- 59,63 ---- tcMissileDBObject *mpDBObject; // pointer to valid database obj ! void Clear(); void LaunchFrom(tcGameObject* obj, unsigned nLauncher); void RandInitNear(float afLon_deg, float afLat_deg); *************** *** 66,73 **** --- 66,76 ---- virtual void UpdateGuidance(double afStatusTime); virtual void SetHeading(float afNewHeading) {mfGoalHeading_rad=afNewHeading;} + teAltitudeMode GetCurrentAltitudeMode(); + teGuidanceMode GetCurrentGuidanceMode(); virtual void SetSpeed(float afNewSpeed) {mfGoalSpeed_kts=afNewSpeed;} virtual tcRadar* GetSensorState() {return &mcSensorState;} virtual void DesignateTarget(long anID); virtual int GetGuidanceParameters(tsGuidanceParameters& gp); + float RuntimeRemaining(); void PrintToFile(tcFile&); void SaveToFile(tcFile& file); *************** *** 81,89 **** tcMissileObject(tcMissileDBObject *obj); ~tcMissileObject(); - - private: - teAltitudeMode GetCurrentAltitudeMode(); - teGuidanceMode GetCurrentGuidanceMode(); - }; #endif \ No newline at end of file --- 84,87 ---- Index: tcRadar.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcRadar.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcRadar.h 6 Nov 2004 15:13:40 -0000 1.9 --- tcRadar.h 7 Nov 2004 03:40:43 -0000 1.10 *************** *** 79,82 **** --- 79,83 ---- virtual bool IsCommandReceiver() {return isCommandReceiver;} virtual bool IsSemiactive() const {return isSemiactive;} + virtual void SetCommandState(bool state); virtual void SetIlluminator(long illum_id, unsigned sensor_idx); |
|
From: Dewitt C. <ddc...@us...> - 2004-11-06 15:15:51
|
Update of /cvsroot/gcblue/gcb_wx/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31933/docs Modified Files: CHANGES.txt Log Message: Added optical sensor model, fixed generic model display for sensor tracks Index: CHANGES.txt =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/docs/CHANGES.txt,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** CHANGES.txt 29 Oct 2004 02:50:40 -0000 1.39 --- CHANGES.txt 6 Nov 2004 15:15:12 -0000 1.40 *************** *** 4,7 **** --- 4,14 ---- 0.6.1 --------------------------------------------------------------------- + - Added optical sensor model. Basic "eyeball" sensor now can identify + tracks when close enough + - Fixed generic model display for sensor tracks + - Fixed ESM sensor + - Added platform ambiguity list to ESM. Track is identified when ambiguity + list has exactly one entry + *** 2004-10-28 Dewitt Colclough *** - Ported hook info and briefing windows to 3D win system |
|
From: Dewitt C. <ddc...@us...> - 2004-11-06 15:14:46
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31472/include/database Modified Files: tcBallisticDBObject.h tcDatabase.h tcDatabaseObject.h tcESMDBObject.h tcGenericDBObject.h tcMissileDBObject.h tcRadarDBObject.h tcSensorDBObject.h Added Files: tcDatabaseIterator.h tcOpticalDBObject.h Log Message: Added optical sensor model, fixed generic model display for sensor tracks --- NEW FILE: tcDatabaseIterator.h --- /** ** @file tcDatabaseIterator.h */ /* Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _DATABASEITERATOR_H_ #define _DATABASEITERATOR_H_ #if _MSC_VER > 1000 #pragma once #endif #include "simmath.h" namespace Database { class tcDatabase; class tcDatabaseObject; class tcDatabaseIterator { public: void First(); tcDatabaseObject* Get(); void Next(); bool IsDone(); tcDatabaseIterator(unsigned int classificationMask); virtual ~tcDatabaseIterator(); private: static tcDatabase* database; long firstPos; ///< index of first game object, last advances to first long currentPos; ///< current position index tcDatabaseObject* currentObj; const unsigned int mask; unsigned nIterated; ///< count of elements iterated unsigned nSize; ///< size of list bool PassesMask(const tcDatabaseObject* obj); }; } #endif Index: tcGenericDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcGenericDBObject.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcGenericDBObject.h 8 Aug 2004 00:31:32 -0000 1.10 --- tcGenericDBObject.h 6 Nov 2004 15:13:39 -0000 1.11 *************** *** 74,77 **** --- 74,78 ---- tcDBString maLauncherClass[MAXLAUNCHERS]; tcDBString maSensorClass[MAXSENSORS]; + std::vector<long> sensorId; ///< database id's of sensors float launcherAz[MAXLAUNCHERS]; ///< pointing angles of launchers in degrees tc3DPoint launcherPosition[MAXLAUNCHERS]; ///< relative position of launchers in meters *************** *** 86,89 **** --- 87,91 ---- tcFlightportDBObject* GetFlightport(); tc3DPoint GetLauncherPosition(unsigned n); + bool HasAllEmitters(std::vector<long>& emitters); void RandInit(); virtual void PrintToFile(tcFile& file); *************** *** 100,103 **** --- 102,108 ---- tcGenericDBObject(tcGenericDBObject& obj); ///< copy constructor virtual ~tcGenericDBObject(); + + private: + void UpdateSensorList(); }; Index: tcRadarDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcRadarDBObject.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcRadarDBObject.h 8 Aug 2004 00:31:32 -0000 1.9 --- tcRadarDBObject.h 6 Nov 2004 15:13:39 -0000 1.10 *************** *** 1,6 **** ! /* ! ** tcRadarDBObject.h ! ** ! ** Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** ! ** @file tcRadarDBObject.h ! */ ! /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 48,51 **** --- 48,52 ---- bool mbDetectsGround; ///< set true if detects ground targets + virtual tcSensorState* CreateSensor(tcGameObject* parent); ///< factory method virtual const char* GetClassName() {return "Radar";} ///< returns class name of database object virtual void PrintToFile(tcFile& file); Index: tcSensorDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcSensorDBObject.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcSensorDBObject.h 8 Aug 2004 00:31:32 -0000 1.6 --- tcSensorDBObject.h 6 Nov 2004 15:13:39 -0000 1.7 *************** *** 1,6 **** ! /* ! ** tcSensorDBObject.h ! ** ! ** Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** ! ** @file tcSensorDBObject.h ! */ ! /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 30,33 **** --- 30,35 ---- class TiXmlElement; + class tcSensorState; + class tcGameObject; namespace Database *************** *** 43,46 **** --- 45,49 ---- float mfScanPeriod_s; ///< [s] + virtual tcSensorState* CreateSensor(tcGameObject* parent); ///< factory method virtual const char* GetClassName() {return "Sensor";} ///< returns class name of database object virtual void PrintToFile(tcFile& file); Index: tcDatabaseObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcDatabaseObject.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcDatabaseObject.h 8 Aug 2004 00:31:32 -0000 1.15 --- tcDatabaseObject.h 6 Nov 2004 15:13:39 -0000 1.16 *************** *** 105,108 **** --- 105,109 ---- #define DTYPE_WEAPON 10 #define DTYPE_BALLISTIC 11 + #define DTYPE_OPTICAL 12 #define DTYPE_NULL 0xFFFFFFFF Index: tcBallisticDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcBallisticDBObject.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcBallisticDBObject.h 8 Aug 2004 00:31:32 -0000 1.3 --- tcBallisticDBObject.h 6 Nov 2004 15:13:39 -0000 1.4 *************** *** 41,45 **** float GetMaxLevelGunRangeKm(); ! virtual const char* GetClassName() {return "Sensor";} ///< returns class name of database object virtual void PrintToFile(tcFile& file); int Serialize(tcFile& file, bool mbLoad, UINT32 anVersion); --- 41,45 ---- float GetMaxLevelGunRangeKm(); ! virtual const char* GetClassName() {return "Ballistic";} ///< returns class name of database object virtual void PrintToFile(tcFile& file); int Serialize(tcFile& file, bool mbLoad, UINT32 anVersion); --- NEW FILE: tcOpticalDBObject.h --- /** ** @file tcOpticalDBObject.h */ /* Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _OPTICALDBOBJECT_H_ #define _OPTICALDBOBJECT_H_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "tcSensorDBObject.h" class TiXmlElement; namespace Database { class tcSqlReader; class tcOpticalDBObject : public tcSensorDBObject { public: bool mbDetectsSurface; ///< set true if detects surface targets bool mbDetectsAir; ///< set true if detects airborne targets bool mbDetectsGround; ///< set true if detects ground targets bool isIR; ///< set true if detects infrared targets float nightFactor; ///< peak darkness range reduction factor virtual tcSensorState* CreateSensor(tcGameObject* parent); ///< factory method virtual const char* GetClassName() {return "Optical";} ///< returns class name of database object virtual void PrintToFile(tcFile& file); int Serialize(tcFile& file, bool mbLoad, UINT32 anVersion); virtual void SerializeXml(TiXmlElement* node, bool load); ///< XML serialization static void AddSqlColumns(std::string& columnString); void ReadSql(tcSqlReader& entry); void WriteSql(std::string& valueString); tcOpticalDBObject(); tcOpticalDBObject(tcOpticalDBObject& obj); ///< copy constructor virtual ~tcOpticalDBObject(); }; } // namespace Database #endif Index: tcDatabase.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcDatabase.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcDatabase.h 1 Sep 2004 02:55:35 -0000 1.8 --- tcDatabase.h 6 Nov 2004 15:13:39 -0000 1.9 *************** *** 32,35 **** --- 32,36 ---- #include "tcDBString.h" #include "tcDatabaseObject.h" + #include <map> #include <wx/wx.h> *************** *** 68,82 **** tcPool<tcDatabaseObject,N_DATABASE_OBJECTS> mcObjectData; ///< need to add accessor and iterator for this tcString mstrCurrentFile; UINT32 mnVersion; ! ! void Clear(void); ! void CreateDefaultDB(void); int CreateObjectCopy(tnPoolIndex anKey); int CreateObjectByType(UINT anClassID); int DeleteObject(tnPoolIndex anKey); ! tnPoolIndex GetRandomKey(void); tcDatabaseObject* GetRandomOfType(UINT model_type); ! tnPoolIndex GetSize(void) {return mcObjectData.GetCount();} int GetObject(tnPoolIndex anKey, tcDatabaseObject*& rpobj); tcDatabaseObject* GetObject(tnPoolIndex anKey); --- 69,85 ---- tcPool<tcDatabaseObject,N_DATABASE_OBJECTS> mcObjectData; ///< need to add accessor and iterator for this + tcString mstrCurrentFile; UINT32 mnVersion; ! ! void BuildDictionaries(); ! void Clear(); ! void CreateDefaultDB(); int CreateObjectCopy(tnPoolIndex anKey); int CreateObjectByType(UINT anClassID); int DeleteObject(tnPoolIndex anKey); ! tnPoolIndex GetRandomKey(); tcDatabaseObject* GetRandomOfType(UINT model_type); ! tnPoolIndex GetSize() {return mcObjectData.GetCount();} int GetObject(tnPoolIndex anKey, tcDatabaseObject*& rpobj); tcDatabaseObject* GetObject(tnPoolIndex anKey); *************** *** 88,92 **** tnPoolIndex GetKey(tcDBString& s); void GetVersion(int& v1, int& v2, int& v3); ! void LoadDB(void); void LoadDB(tcString astrDBFileName); void SaveDB(tcString astrDBFileName); --- 91,95 ---- tnPoolIndex GetKey(tcDBString& s); void GetVersion(int& v1, int& v2, int& v3); ! void LoadDB(); void LoadDB(tcString astrDBFileName); void SaveDB(tcString astrDBFileName); *************** *** 95,99 **** void LoadDBXml(std::string suffix = ""); void SaveDBXml(std::string suffix = ""); ! void RandomizePlatforms(void); void PrintToFile(tcString); int Serialize(tcFile& file, bool mbLoad); --- 98,102 ---- void LoadDBXml(std::string suffix = ""); void SaveDBXml(std::string suffix = ""); ! void RandomizePlatforms(); void PrintToFile(tcString); int Serialize(tcFile& file, bool mbLoad); *************** *** 103,110 **** private: tcDatabase(); ~tcDatabase(); - - bool IsVersionSupported(void); }; --- 106,114 ---- private: + std::map<std::string, long> nameToKey; ///< dictionary of (className, key) pairs + + bool IsVersionSupported(); tcDatabase(); ~tcDatabase(); }; Index: tcESMDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcESMDBObject.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcESMDBObject.h 8 Aug 2004 00:31:32 -0000 1.5 --- tcESMDBObject.h 6 Nov 2004 15:13:39 -0000 1.6 *************** *** 1,6 **** ! /* ! ** tcESMDBObject.h ! ** ! ** Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** ! ** @file tcESMDBObject.h ! */ ! /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 37,40 **** --- 37,41 ---- { public: + virtual tcSensorState* CreateSensor(tcGameObject* parent); ///< factory method virtual const char* GetClassName() {return "ESM";} ///< returns class name of database object virtual void PrintToFile(tcFile& file); Index: tcMissileDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcMissileDBObject.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcMissileDBObject.h 8 Aug 2004 00:31:32 -0000 1.11 --- tcMissileDBObject.h 6 Nov 2004 15:13:39 -0000 1.12 *************** *** 28,31 **** --- 28,32 ---- #include "tcWeaponDBObject.h" + #include <vector> class TiXmlElement; *************** *** 137,140 **** --- 138,142 ---- teWeaponLaunchMode GetLaunchMode(void); tnPoolIndex GetPrimarySeekerKey(); + bool HasAllEmitters(std::vector<long>& emitters); virtual void PrintToFile(tcFile& file); int Serialize(tcFile& file, bool mbLoad, UINT32 anVersion); |
|
From: Dewitt C. <ddc...@us...> - 2004-11-06 15:14:46
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31472/include/sim Modified Files: tcESMSensor.h tcGameObject.h tcRadar.h tcSensorMap.h tcSensorState.h tcSimState.h Added Files: tcOpticalSensor.h Log Message: Added optical sensor model, fixed generic model display for sensor tracks Index: tcGameObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcGameObject.h,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** tcGameObject.h 6 Sep 2004 01:08:03 -0000 1.25 --- tcGameObject.h 6 Nov 2004 15:13:40 -0000 1.26 *************** *** 96,100 **** tc3DModel *model; ///< 3D model UINT mnModelType; // class MTYPE_ identifier ! int mnID; tcDBString mzClass; // name of database class tnPoolIndex mnDBKey; // key of database entry --- 96,100 ---- tc3DModel *model; ///< 3D model UINT mnModelType; // class MTYPE_ identifier ! long mnID; tcDBString mzClass; // name of database class tnPoolIndex mnDBKey; // key of database entry *************** *** 147,151 **** virtual void GetLauncherState(tcLauncherState*& pLauncherState) {pLauncherState = NULL;} virtual tcLauncher* GetLauncher(unsigned idx) {return 0;} ! float GetSpan(); float GetTerrainElevation() {return mcTerrain.mfHeight_m;} virtual void Launch(tnPoolIndex& rnKey, unsigned& rnLauncher) {} --- 147,151 ---- virtual void GetLauncherState(tcLauncherState*& pLauncherState) {pLauncherState = NULL;} virtual tcLauncher* GetLauncher(unsigned idx) {return 0;} ! float GetSpan() const; float GetTerrainElevation() {return mcTerrain.mfHeight_m;} virtual void Launch(tnPoolIndex& rnKey, unsigned& rnLauncher) {} Index: tcSensorMap.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSensorMap.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcSensorMap.h 1 Nov 2004 03:17:17 -0000 1.9 --- tcSensorMap.h 6 Nov 2004 15:13:40 -0000 1.10 *************** *** 34,37 **** --- 34,43 ---- class tcUpdateStream; + namespace Database + { + class tcDatabase; + } + using Database::tcDatabase; + /** * Sensor track management code. This is older code *************** *** 54,62 **** double mfTimestamp; double mfStartTime; ///< birth time of track from report ! tnPoolIndex mnTrackID; ! tnPoolIndex mnSensorPlatformID; UINT8 mnFlags; std::vector<UINT32> maEmitter; unsigned mbClassified : 1; void Clear() { --- 60,71 ---- double mfTimestamp; double mfStartTime; ///< birth time of track from report ! long mnTrackID; ! long trackDatabaseID; ///< database id of track (usually from visual ident), -1 is unknown ! long mnSensorPlatformID; ///< id of contributing sensor UINT8 mnFlags; std::vector<UINT32> maEmitter; unsigned mbClassified : 1; + unsigned isIdentified : 1; + void Clear() { *************** *** 69,73 **** --- 78,84 ---- mnFlags=0; mbClassified = 0; + isIdentified = 0; } + bool IsIdentified() const {return isIdentified != 0;} bool IsNew() {return (mfTimestamp == 0);} }; *************** *** 95,99 **** tsEmitterInfo maEmitterInfo[MAX_EMITTERS]; int mnEmitters; ! tnPoolIndex mnDatabaseID; ///< database ID of track float matchupRating; ///< matchup rating for platforms that have targeted this track float expectedDamage; ///< rating of expected fractional damage of weapons launched at target, 0 - none, 1.0 - totally destroyed --- 106,110 ---- tsEmitterInfo maEmitterInfo[MAX_EMITTERS]; int mnEmitters; ! long mnDatabaseID; ///< database ID of track, -1 for unknown float matchupRating; ///< matchup rating for platforms that have targeted this track float expectedDamage; ///< rating of expected fractional damage of weapons launched at target, 0 - none, 1.0 - totally destroyed *************** *** 101,104 **** --- 112,117 ---- std::vector<long> intercepts; ///< vector of platform ids that are intercepting this track std::vector<long> engaged; ///< vector of weapon ids that are tracking / engaging + std::vector<long> ambiguityList; ///< vector of platform ids consistent with detected emitters + static unsigned int ambiguityListUpdates; /// called to indicate weapon launched at target *************** *** 111,114 **** --- 124,128 ---- ///< static method to set pointer to tcSimState object + static void AttachDatabase(tcDatabase* db) {database = db;} static void AttachSimState(tcSimState* ss) {simState = ss;} *************** *** 133,138 **** bool UpdateActiveReport(tcSensorReport*& rpReport, tnPoolIndex anSensorID); void UpdateClassification(UINT16 mnClassification, teAffiliation meAffiliation, ! tnPoolIndex mnDatabaseID); bool UpdateEmitter(tsEmitterInfo*& rpEmitterInfo, tnPoolIndex anEmitterID); --- 147,153 ---- bool UpdateActiveReport(tcSensorReport*& rpReport, tnPoolIndex anSensorID); + void UpdateAmbiguityList(); void UpdateClassification(UINT16 mnClassification, teAffiliation meAffiliation, ! tnPoolIndex databaseID); bool UpdateEmitter(tsEmitterInfo*& rpEmitterInfo, tnPoolIndex anEmitterID); *************** *** 158,162 **** private: ! static tcSimState *simState; }; --- 173,178 ---- private: ! static tcSimState* simState; ! static tcDatabase* database; }; Index: tcRadar.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcRadar.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcRadar.h 17 Aug 2004 02:22:56 -0000 1.8 --- tcRadar.h 6 Nov 2004 15:13:40 -0000 1.9 *************** *** 29,32 **** --- 29,37 ---- #include <vector> + namespace Database + { + class tcRadarDBObject; + } + using Database::tcRadarDBObject; /** * *************** *** 65,69 **** virtual bool CanDetectTarget(const tcGameObject* target, float& range_km); ! virtual bool InitFromDB(tcDatabase *apDatabase, tnPoolIndex anKey, float mountAzimuth_rad); // fire control methods --- 70,74 ---- virtual bool CanDetectTarget(const tcGameObject* target, float& range_km); ! virtual bool InitFromDatabase(long key); ///< initializes sensor using database data at key // fire control methods *************** *** 87,91 **** tcRadar* Clone(); tcRadar(); ! tcRadar(tcGameObject *obj); virtual ~tcRadar(); --- 92,96 ---- tcRadar* Clone(); tcRadar(); ! tcRadar(tcRadarDBObject* dbObj); virtual ~tcRadar(); Index: tcSensorState.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSensorState.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcSensorState.h 17 Aug 2004 02:22:56 -0000 1.11 --- tcSensorState.h 6 Nov 2004 15:13:40 -0000 1.12 *************** *** 1,17 **** ! /** @file tcSensorState.h ! ** ! ** Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ! ** ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ! ** ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ! ** ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software --- 1,18 ---- ! /** ! ** @file tcSensorState.h ! */ ! /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ! ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ! ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ! ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software *************** *** 27,35 **** #include "tcPool.h" - #include "tcDatabase.h" - #include "tcSensorDBObject.h" #include "simmath.h" ! using namespace Database; #define SSMODE_SURVEILLANCE 1 --- 28,41 ---- #include "tcPool.h" #include "simmath.h" ! namespace Database ! { ! class tcDatabase; ! class tcSensorDBObject; ! } ! ! using Database::tcDatabase; ! using Database::tcSensorDBObject; #define SSMODE_SURVEILLANCE 1 *************** *** 53,57 **** tcGameObject *parent; tnPoolIndex mnDBKey; ! tcSensorDBObject *mpDBObj; double mfLastScan; float mfCurrentScanPeriod_s; --- 59,63 ---- tcGameObject *parent; tnPoolIndex mnDBKey; ! tcSensorDBObject* mpDBObj; double mfLastScan; float mfCurrentScanPeriod_s; *************** *** 63,70 **** float mfSensorHeight_m; ///< height of sensor relative to platform altitude ! static void AttachSimState(tcSimState *ss) {simState = ss;} bool GetActive() const {return mbActive != 0;} void GetTestArea(tcRect& region); ! virtual bool InitFromDB(tcDatabase *apDatabase, tnPoolIndex anKey, float mountAzimuth_rad); void Serialize(tcFile& file, bool mbLoad); --- 69,78 ---- float mfSensorHeight_m; ///< height of sensor relative to platform altitude ! 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 IsHidden() const; void Serialize(tcFile& file, bool mbLoad); *************** *** 73,77 **** virtual void SetActive(bool active); ! void SetMountAz(float az) {mountAz_rad = az;} void SetParent(tcGameObject *obj) {parent = obj;} virtual void Update(double t); --- 81,85 ---- virtual void SetActive(bool active); ! void SetMountAz(float az); void SetParent(tcGameObject *obj) {parent = obj;} virtual void Update(double t); *************** *** 81,89 **** tcSensorState* Clone(); tcSensorState(); ! tcSensorState(tcGameObject *obj); virtual ~tcSensorState(); protected: ! static tcSimState *simState; }; #endif \ No newline at end of file --- 89,100 ---- tcSensorState* Clone(); tcSensorState(); ! tcSensorState(tcSensorDBObject* dbObj); virtual ~tcSensorState(); protected: ! static tcSimState* simState; ! static tcDatabase* database; ! ! bool isHidden; ///< hidden sensors are not displayed in object control view }; #endif \ No newline at end of file --- NEW FILE: tcOpticalSensor.h --- /** ** @file tcOpticalSensor.h */ /* Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA **/ #if _MSC_VER > 1000 #pragma once #endif #ifndef _TCOPTICALSENSOR_H_ #define _TCOPTICALSENSOR_H_ #include "tcSensorState.h" #include "tcOpticalDBObject.h" #include <vector> using Database::tcOpticalDBObject; class tcGameObject; class tcStream; class tcUpdateStream; /** * Class to model optical and IR sensors. Handles visual detections. */ class tcOpticalSensor : public tcSensorState { public: tcOpticalDBObject* mpDBObj; virtual bool CanDetectTarget(const tcGameObject* target, float& range_km); virtual bool InitFromDatabase(long key); ///< initializes sensor using database data at key void Serialize(tcFile& file, bool mbLoad); virtual void Update(double t); tcOpticalSensor& operator=(tcOpticalSensor& ss); virtual tcUpdateStream& operator<<(tcUpdateStream& stream); virtual tcUpdateStream& operator>>(tcUpdateStream& stream); tcOpticalSensor* Clone(); tcOpticalSensor(); tcOpticalSensor(tcOpticalDBObject* dbObj); virtual ~tcOpticalSensor(); protected: // bool isSemiactive; //tcRadar* GetSemiactiveIlluminator(); // add semi-active later for laser designated guidance void UpdateSeeker(double t); void UpdateSensorMap(double t, const tcGameObject* target, float range_km); void UpdateSurveillance(double t); void UpdateTrack(const tcGameObject* target, double t); /* parameters saved by CanDetectTarget so that this info is available in UpdateSensorMap ** (didn't want to modify virtual method CanDetectTarget to pass this info directly) */ long detectionCandidate; float detectionScore; }; #endif Index: tcSimState.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSimState.h,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** tcSimState.h 6 Sep 2004 01:08:03 -0000 1.28 --- tcSimState.h 6 Nov 2004 15:13:40 -0000 1.29 *************** *** 155,158 **** --- 155,159 ---- bool IsLauncherReady(tcGameObject *apGameObj, unsigned anLauncher); bool IsLauncherReady(tnPoolIndex anKey, unsigned anLauncher); + bool IsScenarioLoaded() const; void LoadTimeFromStream(tcStream& stream); void PrintToFile(tcString); Index: tcESMSensor.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcESMSensor.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcESMSensor.h 17 Aug 2004 02:22:56 -0000 1.5 --- tcESMSensor.h 6 Nov 2004 15:13:40 -0000 1.6 *************** *** 41,47 **** { public: ! tcESMDBObject *mpDBObj; ! bool InitFromDB(tcDatabase *apDatabase, tnPoolIndex anKey, float mountAzimuth_rad); bool IsDetected(const tcRadar* emitter, float& rfAz_rad); void Serialize(tcFile& file, bool mbLoad); --- 41,47 ---- { public: ! tcESMDBObject* mpDBObj; ! virtual bool InitFromDatabase(long key); ///< initializes sensor using database data at key bool IsDetected(const tcRadar* emitter, float& rfAz_rad); void Serialize(tcFile& file, bool mbLoad); *************** *** 53,58 **** tcESMSensor* Clone(void); tcESMSensor(); ! tcESMSensor(tcGameObject *obj); virtual ~tcESMSensor(); }; #endif \ No newline at end of file --- 53,63 ---- tcESMSensor* Clone(void); tcESMSensor(); ! 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 |
|
From: Dewitt C. <ddc...@us...> - 2004-11-06 15:14:45
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31472/src/database Modified Files: tcBallisticDBObject.cpp tcDatabase.cpp tcESMDBObject.cpp tcGenericDBObject.cpp tcMissileDBObject.cpp tcRadarDBObject.cpp tcSensorDBObject.cpp Added Files: tcDatabaseIterator.cpp tcOpticalDBObject.cpp Log Message: Added optical sensor model, fixed generic model display for sensor tracks --- NEW FILE: tcDatabaseIterator.cpp --- /** ** @file tcDatabaseIterator.cpp */ /* Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA **/ #include "stdwx.h" // precompiled header file #ifndef WX_PRECOMP #include "wx/wx.h" #endif #include "tcDatabaseIterator.h" #include "tcDatabase.h" #include "tcDatabaseObject.h" #ifdef _DEBUG #define new DEBUG_NEW #endif namespace Database { tcDatabase* tcDatabaseIterator::database = 0; void tcDatabaseIterator::First() { nSize = database->mcObjectData.GetCount(); nIterated = 0; if (nSize == 0) { currentPos = -1; currentObj = 0; nIterated = 1; return; } currentPos = database->mcObjectData.GetStartPosition(); Next(); } tcDatabaseObject* tcDatabaseIterator::Get() { return currentObj; } /** * Advance to next object in pool that meets filter criteria. If * no objects are found, set currentObj to NULL */ void tcDatabaseIterator::Next() { bool searching = true; while ((nIterated <= nSize) && searching) { long id; if (nIterated < nSize) // kind of a hack, nIterated > nSize is used for end condition { database->mcObjectData.GetNextAssoc(currentPos, id, currentObj); } nIterated++; if (PassesMask(currentObj)) { searching = false; // found eligible object } else { currentObj = 0; } } } bool tcDatabaseIterator::IsDone() { return (nIterated > nSize); } /** * Checks currentObj against mask (filtering) criteria. This is used * to iterate through a filtered set of objects. * @return true if current obj meets mask criteria, false otherwise */ bool tcDatabaseIterator::PassesMask(const tcDatabaseObject* obj) { if (obj == 0) return false; if (mask == 0) return true; bool coarsePasses = (obj->mnType & mask & 0xFFF0) != 0; bool finePasses = (obj->mnType & mask & 0x000F) != 0; // if mask has fine classification set then use it, otherwise ignore if (mask & 0x000F) { return coarsePasses && finePasses; } else { return coarsePasses; } } /** * @param classificationMask use 0 to pass all */ tcDatabaseIterator::tcDatabaseIterator(unsigned int classificationMask) : mask(classificationMask) { if (database == 0) { database = tcDatabase::Get(); } First(); } tcDatabaseIterator::~tcDatabaseIterator() { } } Index: tcESMDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcESMDBObject.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcESMDBObject.cpp 2 Nov 2004 04:23:55 -0000 1.7 --- tcESMDBObject.cpp 6 Nov 2004 15:13:41 -0000 1.8 *************** *** 1,6 **** ! /* ! ** tcESMDBObject.cpp ! ** ! ** Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** ! ** @file tcESMDBObject.cpp ! */ ! /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 28,33 **** #include "tcESMDBObject.h" ! #include "math_constants.h" ! #include "randfn.h" //#include "AError.h" #include "CsvTranslator.h" --- 28,34 ---- #include "tcESMDBObject.h" ! #include "tcESMSensor.h" ! //#include "math_constants.h" ! //#include "randfn.h" //#include "AError.h" #include "CsvTranslator.h" *************** *** 42,45 **** --- 43,54 ---- { + tcSensorState* tcESMDBObject::CreateSensor(tcGameObject* parent) + { + tcESMSensor* esm = new tcESMSensor(this); + esm->SetParent(parent); + + return esm; + } + void tcESMDBObject::PrintToFile(tcFile& file) { Index: tcSensorDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcSensorDBObject.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcSensorDBObject.cpp 2 Nov 2004 04:23:55 -0000 1.8 --- tcSensorDBObject.cpp 6 Nov 2004 15:13:41 -0000 1.9 *************** *** 1,6 **** ! /* ! ** tcSensorDBObject.cpp ! ** ! ** Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** ! ** @file tcSensorDBObject.cpp ! */ ! /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 27,37 **** #include "tcSensorDBObject.h" ! #include "math_constants.h" ! #include "randfn.h" #include "CsvTranslator.h" #include "common/tinyxml.h" #include "database/tcSqlReader.h" #include <sstream> #ifdef _DEBUG #define new DEBUG_NEW --- 27,40 ---- #include "tcSensorDBObject.h" ! //#include "math_constants.h" ! //#include "randfn.h" #include "CsvTranslator.h" #include "common/tinyxml.h" #include "database/tcSqlReader.h" + #include "tcSensorState.h" // for factory method + #include "tcGameObject.h" // for factory method #include <sstream> + #ifdef _DEBUG #define new DEBUG_NEW *************** *** 43,46 **** --- 46,55 ---- { + tcSensorState* tcSensorDBObject::CreateSensor(tcGameObject* parent) + { + return 0; + } + + void tcSensorDBObject::PrintToFile(tcFile& file) { Index: tcRadarDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcRadarDBObject.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcRadarDBObject.cpp 2 Nov 2004 04:23:55 -0000 1.13 --- tcRadarDBObject.cpp 6 Nov 2004 15:13:41 -0000 1.14 *************** *** 1,6 **** ! /** @file tcRadarDBObject.cpp */ ! /* ! ** Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** ! ** @file tcRadarDBObject.cpp */ ! /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 27,36 **** #include "tcRadarDBObject.h" ! #include "math_constants.h" ! #include "randfn.h" #include "CsvTranslator.h" #include "common/tinyxml.h" #include "database/tcSqlReader.h" #include <sstream> #ifdef _DEBUG --- 27,37 ---- #include "tcRadarDBObject.h" ! //#include "math_constants.h" ! //#include "randfn.h" #include "CsvTranslator.h" #include "common/tinyxml.h" #include "database/tcSqlReader.h" #include <sstream> + #include "tcRadar.h" #ifdef _DEBUG *************** *** 41,44 **** --- 42,53 ---- { + tcSensorState* tcRadarDBObject::CreateSensor(tcGameObject* parent) + { + tcRadar* radar = new tcRadar(this); + radar->SetParent(parent); + + return radar; + } + /******************************** tcRadarDBObject ***********************************/ *************** *** 57,61 **** if (anVersion <= VERSION_1_0_3) { ! tcDatabaseObject::Serialize(file,mbLoad,anVersion); if (mbLoad) { --- 66,70 ---- if (anVersion <= VERSION_1_0_3) { ! tcSensorDBObject::Serialize(file,mbLoad,anVersion); if (mbLoad) { Index: tcBallisticDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcBallisticDBObject.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcBallisticDBObject.cpp 2 Nov 2004 04:23:55 -0000 1.6 --- tcBallisticDBObject.cpp 6 Nov 2004 15:13:41 -0000 1.7 *************** *** 152,156 **** //TiXmlElement* localNode = ! node->InsertEndChild(TiXmlElement("sensor"))->ToElement(); //localNode->SetAttribute("maxRange_km" ,mfMaxRange_km); --- 152,156 ---- //TiXmlElement* localNode = ! node->InsertEndChild(TiXmlElement("ballistic"))->ToElement(); //localNode->SetAttribute("maxRange_km" ,mfMaxRange_km); --- NEW FILE: tcOpticalDBObject.cpp --- /** ** @file tcOpticalDBObject.cpp */ /* ** Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "stdwx.h" #if _MSC_VER > 1000 #pragma warning(disable:4786) // suppress warning for STL bug in VC6, see Q167355 in the MSDN Library. #endif // _MSC_VER > 1000 #include "tcOpticalDBObject.h" #include "tcOpticalSensor.h" #include "common/tinyxml.h" #include "database/tcSqlReader.h" #include <sstream> #ifdef _DEBUG #define new DEBUG_NEW #endif namespace Database { tcSensorState* tcOpticalDBObject::CreateSensor(tcGameObject* parent) { tcOpticalSensor* optical = new tcOpticalSensor(this); optical->SetParent(parent); return optical; } /******************************** tcOpticalDBObject ***********************************/ void tcOpticalDBObject::PrintToFile(tcFile& file) { tcString s; tcDatabaseObject::PrintToFile(file); s.Format(" ref range: %3.1f km, night: %.2f, IR: %d\n", mfRefRange_km, nightFactor, isIR); file.WriteString(s.GetBuffer()); } int tcOpticalDBObject::Serialize(tcFile& file, bool mbLoad, UINT32 anVersion) { tcSensorDBObject::Serialize(file,mbLoad,anVersion); if (mbLoad) { file.Read(&mbDetectsSurface,sizeof(mbDetectsSurface)); file.Read(&mbDetectsAir,sizeof(mbDetectsAir)); file.Read(&mbDetectsGround,sizeof(mbDetectsGround)); file.Read(&isIR,sizeof(isIR)); file.Read(&nightFactor,sizeof(nightFactor)); } else { file.Write(&mbDetectsSurface,sizeof(mbDetectsSurface)); file.Write(&mbDetectsAir,sizeof(mbDetectsAir)); file.Write(&mbDetectsGround,sizeof(mbDetectsGround)); file.Write(&isIR,sizeof(isIR)); file.Write(&nightFactor,sizeof(nightFactor)); } return true; } /** * Loads/saves XML data for database object * @param load true to load, false to save */ void tcOpticalDBObject::SerializeXml(TiXmlElement* node, bool load) { if (load) return; // write only for now wxASSERT(node); TiXmlElement* localNode = node->InsertEndChild(TiXmlElement("radar"))->ToElement(); localNode->SetAttribute("detectsSurface", (int)mbDetectsSurface); localNode->SetAttribute("detectsAir", (int)mbDetectsAir); localNode->SetAttribute("detectsGround", (int)mbDetectsGround); localNode->SetAttribute("IsIR", (int)isIR); localNode->SetAttribute("NightFactor", nightFactor); tcSensorDBObject::SerializeXml(node, load); } /** * Adds sql column definitions to columnString. This is used for * SQL create table command */ void tcOpticalDBObject::AddSqlColumns(std::string& columnString) { tcSensorDBObject::AddSqlColumns(columnString); columnString += ","; columnString += "DetectsSurface number(1),"; columnString += "DetectsAir number(1),"; columnString += "DetectsGround number(1),"; columnString += "IsIR number(1),"; columnString += "NightFactor number(5)"; } void tcOpticalDBObject::ReadSql(tcSqlReader& entry) { tcSensorDBObject::ReadSql(entry); mbDetectsSurface = entry.GetInt("DetectsSurface") != 0; mbDetectsAir = entry.GetInt("DetectsAir") != 0; mbDetectsGround = entry.GetInt("DetectsGround") != 0; isIR = entry.GetInt("IsIR") != 0; nightFactor = entry.GetDouble("NightFactor"); } void tcOpticalDBObject::WriteSql(std::string& valueString) { tcSensorDBObject::WriteSql(valueString); std::stringstream s; s << ","; s << (long)mbDetectsSurface << ","; s << (long)mbDetectsAir << ","; s << (long)mbDetectsGround << ","; s << (long)isIR << ","; s << nightFactor; valueString += s.str(); } tcOpticalDBObject::tcOpticalDBObject() : tcSensorDBObject() { mzClass = "Default Optical"; mnClassID = DTYPE_OPTICAL; mfMaxRange_km = 20.0f; mfRefRange_km = 0.5f; mfFieldOfView_deg = 360.0f; mfScanPeriod_s = 5.0f; mbDetectsSurface = true; mbDetectsAir = true; mbDetectsGround = true; isIR = false; nightFactor = 1.0f; } tcOpticalDBObject::tcOpticalDBObject(tcOpticalDBObject& obj) : tcSensorDBObject(obj) { mnClassID = DTYPE_OPTICAL; mbDetectsSurface = obj.mbDetectsSurface; mbDetectsAir = obj.mbDetectsAir; mbDetectsGround = obj.mbDetectsGround; isIR = obj.isIR; nightFactor = obj.nightFactor; } tcOpticalDBObject::~tcOpticalDBObject() { } } Index: tcDatabase.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcDatabase.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcDatabase.cpp 2 Nov 2004 04:23:55 -0000 1.18 --- tcDatabase.cpp 6 Nov 2004 15:13:41 -0000 1.19 *************** *** 29,34 **** #include "tcDatabase.h" ! #include "math_constants.h" ! #include "randfn.h" #include "AError.h" #include <iostream> --- 29,33 ---- #include "tcDatabase.h" ! #include "AError.h" #include <iostream> *************** *** 42,45 **** --- 41,45 ---- #include "tcSensorDBObject.h" #include "tcRadarDBObject.h" + #include "tcOpticalDBObject.h" #include "tcESMDBObject.h" #include "tcFixedDBObject.h" *************** *** 47,50 **** --- 47,51 ---- #include "tcFlightportDBObject.h" #include "tcBallisticDBObject.h" + #include "tcDatabaseIterator.h" #include "common/tinyxml.h" #include "sqlite/sqlite_plus.h" *************** *** 69,72 **** --- 70,108 ---- } + + /** + * Should be called once after the database is loaded or modified + */ + void tcDatabase::BuildDictionaries() + { + nameToKey.clear(); + + std::map<std::string, long>::iterator mapIter; + + tcDatabaseIterator iter(0); + for (iter.First(); !iter.IsDone(); iter.Next()) + { + tcDatabaseObject* obj = iter.Get(); + wxASSERT(obj); + wxASSERT(obj->mnKey != -1); + + std::string className = obj->mzClass.mz; + + mapIter = nameToKey.find(className); + if (mapIter == nameToKey.end()) + { + nameToKey[className] = obj->mnKey; + } + else + { + fprintf(stderr, "Error - tcDatabase::BuildDictionaries - " + "duplicate class name in database (ignoring)\n"); + } + + } + + } + + /** * Serialization is replicated for each leaf class type. This *************** *** 229,232 **** --- 265,275 ---- else serializer.Save(); } + // tcOpticalDBObject + { + tcDBObjSerializerSql<tcOpticalDBObject> + serializer(this, sqlConnection, "optical"); + if (load) serializer.Load(); + else serializer.Save(); + } // tcAirDBObject { *************** *** 251,256 **** } ! ! } --- 294,298 ---- } ! BuildDictionaries(); } *************** *** 349,352 **** --- 391,401 ---- } break; + case DTYPE_OPTICAL: + { + tcOpticalDBObject* optical = new tcOpticalDBObject; + if (optical) {nResult = optical->Serialize(file,true,mnVersion);} + pdbobj = static_cast<tcDatabaseObject*>(pradar); + } + break; default: // error, unrecognized ClassID break; *************** *** 407,410 **** --- 456,465 ---- } break; + case DTYPE_OPTICAL: + { + tcOpticalDBObject* optical = dynamic_cast<tcOpticalDBObject*>(pdbobj); + if (optical) {nResult = optical->Serialize(file,false,mnVersion);} + } + break; default: // error, unrecognized ClassID break; *************** *** 996,999 **** --- 1051,1075 ---- tcDatabaseObject* tcDatabase::GetObject(std::string className) { + std::map<std::string, long>::iterator mapIter = nameToKey.find(className); + if (mapIter == nameToKey.end()) + { + fprintf(stderr, "Error - tcDatabase::GetObject - not found in nameToKey\n"); + return 0; + } + + return GetObject(mapIter->second); + #if 0 + tcDatabaseIterator iter(0xFFF0); + for (iter.First(); !iter.IsDone(); iter.Next()) + { + tcDatabaseObject* obj = iter.Get(); + wxASSERT(obj); + wxASSERT(obj->mnKey != -1); + + std::string className = obj->mzClass.mz; + + + + tnPoolIndex nPoolSize = mcObjectData.GetCount(); tnPoolIndex key = mcObjectData.GetStartPosition(); *************** *** 1010,1013 **** --- 1086,1090 ---- } return NULL; // not found + #endif } Index: tcMissileDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcMissileDBObject.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcMissileDBObject.cpp 2 Nov 2004 04:23:55 -0000 1.11 --- tcMissileDBObject.cpp 6 Nov 2004 15:13:41 -0000 1.12 *************** *** 77,80 **** --- 77,101 ---- } + /** + * This checks that the database object has all of the emitters in the + * emitters vector. Somewhat expensive, nEmitters * nSensors + * comparisons for positive result, fewer for negative result. + * Modified tcGenericDBObject method + * @see tcGenericDBObject::HasAllEmitters + * @return true if this database object has all of the emitters + */ + bool tcMissileDBObject::HasAllEmitters(std::vector<long>& emitters) + { + unsigned int nEmitters = emitters.size(); + + for (unsigned int k=0; k<nEmitters; k++) + { + long emitterId = emitters[k]; + + if (primarySeekerKey != emitterId) return false; + } + return true; + } + void tcMissileDBObject::PrintToFile(tcFile& file) { Index: tcGenericDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcGenericDBObject.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcGenericDBObject.cpp 2 Nov 2004 04:23:55 -0000 1.13 --- tcGenericDBObject.cpp 6 Nov 2004 15:13:41 -0000 1.14 *************** *** 82,85 **** --- 82,113 ---- } + /** + * This checks that the database object has all of the emitters in the + * emitters vector. Somewhat expensive, nEmitters * nSensors + * comparisons for positive result, fewer for negative result. + * @return true if this database object has all of the emitters + */ + bool tcGenericDBObject::HasAllEmitters(std::vector<long>& emitters) + { + unsigned int nEmitters = emitters.size(); + if ((int)nEmitters > mnNumSensors) return false; + + /* watch out for problems with this lazy init done inside this method + ** sensorId will not be available until this is called first */ + if (sensorId.size() == 0) UpdateSensorList(); + + for (unsigned int k=0; k<nEmitters; k++) + { + bool bFound = false; + long emitterId = emitters[k]; + for (int n=0; (n<mnNumSensors) && !bFound; n++) + { + if (sensorId[n] == emitterId) bFound = true; + } + if (!bFound) return false; + } + return true; + } + void tcGenericDBObject::RandInit() { *************** *** 465,468 **** --- 493,519 ---- /** + * Updates sensorId vector with database ids for each sensor + */ + void tcGenericDBObject::UpdateSensorList() + { + sensorId.clear(); + for(int n=0; n<mnNumSensors; n++) + { + std::string sensorClass = maSensorClass[n].mz; + tcDatabaseObject* obj = database->GetObject(sensorClass); + if (obj) + { + sensorId.push_back(obj->mnKey); + } + else + { + fprintf(stderr, "Error - tcGenericDBObject::UpdateSensorList - sensor %s not found\n", + sensorClass.c_str()); + sensorId.push_back(-1); + } + } + } + + /** * Adds sql column definitions to columnString. This is used for * SQL create table command |
|
From: Dewitt C. <ddc...@us...> - 2004-11-06 15:14:36
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31472/include/common Modified Files: math_constants.h simmath.h tcOptions.h Log Message: Added optical sensor model, fixed generic model display for sensor tracks Index: tcOptions.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/tcOptions.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcOptions.h 2 Oct 2004 22:41:32 -0000 1.8 --- tcOptions.h 6 Nov 2004 15:13:39 -0000 1.9 *************** *** 73,76 **** --- 73,79 ---- int debugLevel; + /// 0 - own-alliance only, 1 - raw track data, 2 - add true pitch roll if available, 3 - use true data if avail + int mn3DCheatMode; + tsOptionInfo maOptionInfo[N_OPTIONS]; int mnNumOptions; Index: simmath.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/simmath.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** simmath.h 1 Nov 2004 03:17:15 -0000 1.23 --- simmath.h 6 Nov 2004 15:13:39 -0000 1.24 *************** *** 134,138 **** --- 134,140 ---- bool IsSurface() {return ((mnClassification & PTYPE_SURFACE) != 0);} bool IsValid() {return mnID != -1;} + bool IsBearingOnly() const; void SetAllValid() {mnFlags |= 0x0F;} + float GetOrGuessAltitude() const; void GetPrediction(tcTrack& td, double mfTime); tcTrack PredictAhead(float timeDelta_s); Index: math_constants.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/math_constants.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** math_constants.h 12 Aug 2004 01:14:27 -0000 1.8 --- math_constants.h 6 Nov 2004 15:13:39 -0000 1.9 *************** *** 53,57 **** #define C_MTORAD 1.5678552e-7f #define C_RADARHOR 3.92482f ///< radar horizon in km = constant*sqrt(h in meters) ! namespace UnitConversions { --- 53,57 ---- #define C_MTORAD 1.5678552e-7f #define C_RADARHOR 3.92482f ///< radar horizon in km = constant*sqrt(h in meters) ! #define C_VISUALHOR 2.78f ///< visible horizon in km = constant*sqrt(h in meters) namespace UnitConversions { |
|
From: Dewitt C. <ddc...@us...> - 2004-11-06 15:14:36
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31472/include/graphics Modified Files: ObjectUpdater.h tc3DModel.h tc3DViewer.h tcHookInfo.h tcScenarioSelectView.h Log Message: Added optical sensor model, fixed generic model display for sensor tracks Index: tcHookInfo.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcHookInfo.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcHookInfo.h 29 Oct 2004 02:50:43 -0000 1.3 --- tcHookInfo.h 6 Nov 2004 15:13:40 -0000 1.4 *************** *** 77,82 **** tcOptions *mpOptions; tcUserInfo *mpUserInfo; tnPoolIndex mnHookID; ! //Gdiplus::Pen *mpPen; // GDI+ objects --- 77,84 ---- tcOptions *mpOptions; tcUserInfo *mpUserInfo; + tcDatabase* database; tnPoolIndex mnHookID; ! unsigned int ambiguityIdx; ///< index to cycle display of large numbers of ambiguous platforms ! unsigned int lastCycleCount; ///< time of last update of cycle display //Gdiplus::Pen *mpPen; // GDI+ objects Index: tc3DModel.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DModel.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tc3DModel.h 6 Sep 2004 01:08:03 -0000 1.8 --- tc3DModel.h 6 Nov 2004 15:13:40 -0000 1.9 *************** *** 1,5 **** ! /** @file tc3DModel.h */ ! /* ! ** Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** ! ** @file tc3DModel.h ! */ ! /* Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 70,73 **** --- 71,83 ---- { public: + enum + { + USE_TRUE_MODEL = 0, + USE_UNKNOWN_GENERIC = 1, + USE_AIR_GENERIC = 2, + USE_LAND_GENERIC = 3, + USE_SURFACE_GENERIC = 4, + DISABLE_MODEL = 5 + }; std::vector<tcAnimationInfo> animationInfo; ///< animation transforms to update at model level void AddChild(tc3DModel *child); *************** *** 79,82 **** --- 89,93 ---- unsigned int GetNumParents(); float GetRadius(); + float GetRadiusGeneric(); bool IsSmokeEnabled() const {return smokeTrail.valid();} void Load(std::string model_name); *************** *** 84,87 **** --- 95,99 ---- void SetupAnimation(tcGameObject *obj); void SetDistanceFromCamera(float distance) {distanceFromCamera = distance;} + void SetGenericMode(int mode); void SetSmokeMode(int mode) {smokeMode = mode;} void SetupUpdate(tcGameObject *obj); *************** *** 93,96 **** --- 105,109 ---- ~tc3DModel(); + static void LoadUnknowns(); static void SetWorldFrame(osg::Group* worldFrame) {world = worldFrame;} *************** *** 101,112 **** int smokeMode; ! osg::ref_ptr<osg::LOD> modelGroup; ///< top level group for model, not shared osg::ref_ptr<osg::MatrixTransform> modelTransform; ///< positions object in world, not shared osg::ref_ptr<osg::Node> modelNode; ///< shared between instances of model static osg::ref_ptr<osg::Group> world; tcGameObject *gameObj; ///< game object to use to update model state ! bool useSmoothing; float distanceFromCamera; void DisableSmoke(); --- 114,135 ---- int smokeMode; ! osg::ref_ptr<osg::Switch> root; ///< top level group for model ! osg::ref_ptr<osg::LOD> modelGroup; ///< top level group for (identified) model, not shared osg::ref_ptr<osg::MatrixTransform> modelTransform; ///< positions object in world, not shared osg::ref_ptr<osg::Node> modelNode; ///< shared between instances of model static osg::ref_ptr<osg::Group> world; + /// models for unidentified platforms + static osg::ref_ptr<osg::Node> unknownAll; + static osg::ref_ptr<osg::Node> unknownAir; + static osg::ref_ptr<osg::Node> unknownLand; + static osg::ref_ptr<osg::Node> unknownSurface; + static bool useSmoothing; + + tcGameObject *gameObj; ///< game object to use to update model state ! float distanceFromCamera; + int genericMode; void DisableSmoke(); Index: tcScenarioSelectView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcScenarioSelectView.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcScenarioSelectView.h 2 Oct 2004 22:41:32 -0000 1.2 --- tcScenarioSelectView.h 6 Nov 2004 15:13:40 -0000 1.3 *************** *** 90,94 **** bool Init(); void Draw(); ! void OnLButtonDown(wxMouseEvent& event); void OnMouseMove(wxMouseEvent& event); --- 90,94 ---- bool Init(); void Draw(); ! void LoadScenario(std::string filePath, std::string caption); void OnLButtonDown(wxMouseEvent& event); void OnMouseMove(wxMouseEvent& event); *************** *** 127,131 **** void DrawScenarioDirectory(std::vector<scenarioInfo>& info); wxArrayString GetListOfScenarioFiles(); - void LoadScenario(std::string filePath, std::string caption); void LogScenarioInfo(std::vector<scenarioInfo>& info, int level); bool ProcessMouseClick(std::vector<scenarioInfo>& info, wxPoint pos); --- 127,130 ---- Index: tc3DViewer.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DViewer.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tc3DViewer.h 21 Oct 2004 04:10:58 -0000 1.3 --- tc3DViewer.h 6 Nov 2004 15:13:40 -0000 1.4 *************** *** 92,96 **** virtual void OnSize(wxSizeEvent& event); void AttachMapData(tcMapData *pMapData); ! void AttachSimState(tcSimState *ss) {simState = ss;} void SkipMouseEvent(wxMouseEvent& event); ///< adjusts position to parent frame --- 92,96 ---- virtual void OnSize(wxSizeEvent& event); void AttachMapData(tcMapData *pMapData); ! void AttachSimState(tcSimState *ss); void SkipMouseEvent(wxMouseEvent& event); ///< adjusts position to parent frame Index: ObjectUpdater.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/ObjectUpdater.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ObjectUpdater.h 11 Apr 2004 21:09:52 -0000 1.6 --- ObjectUpdater.h 6 Nov 2004 15:13:40 -0000 1.7 *************** *** 1,2 **** --- 1,22 ---- + /** + ** @file ObjectUpdater.h + */ + /* Copyright (C) 2003 Dewitt Colclough (de...@tw...) + ** All rights reserved. + + ** This file is part of the Global Conflict Blue (GCB) program. + ** GCB is free software; you can redistribute it and/or modify + ** it under the terms of version 2 of the GNU General Public License as + ** published by the Free Software Foundation. + + ** GCB is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + + ** You should have received a copy of the GNU General Public License + ** along with GCB; if not, write to the Free Software + ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #ifndef __ObjectUpdater_h__ *************** *** 7,12 **** class tc3DModel; class tc3DViewer; ! ! using namespace osg; /** --- 27,39 ---- class tc3DModel; class tc3DViewer; ! class tcSimState; ! namespace Sensor ! { ! class tcSensorMap; ! } ! using Sensor::tcSensorMap; ! using osg::Node; ! using osg::NodeCallback; ! using osg::NodeVisitor; /** *************** *** 19,25 **** { public: ! bool useRelativeChildPos; /** implements the callback*/ virtual void operator()(Node* node, NodeVisitor* nv); static void AttachViewer(tc3DViewer *v) {viewer = v;} --- 46,53 ---- { public: ! /** implements the callback*/ virtual void operator()(Node* node, NodeVisitor* nv); + static void AttachSimState(tcSimState* ss) {simState = ss;} static void AttachViewer(tc3DViewer *v) {viewer = v;} *************** *** 29,37 **** private: ! static tc3DViewer *viewer; tc3DModel *model; ///< tc3DModel has method to access sim tcGameObject float distanceFromCamera; ///< model distance from camera, calculated by update ! void UpdateAnimations(); }; --- 57,71 ---- private: ! static tc3DViewer* viewer; ! static tcSimState* simState; ! static tcSensorMap* sensorMap; ! tc3DModel *model; ///< tc3DModel has method to access sim tcGameObject float distanceFromCamera; ///< model distance from camera, calculated by update ! void UpdateAnimations(); ! void UpdateTrack(Node* node); ! void UpdateTrue(Node* node); ! }; |
|
From: Dewitt C. <ddc...@us...> - 2004-11-06 15:14:35
|
Update of /cvsroot/gcblue/gcb_wx/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31472/scripts Modified Files: AI.py Menu.py Log Message: Added optical sensor model, fixed generic model display for sensor tracks Index: AI.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/AI.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** AI.py 3 Nov 2004 16:36:43 -0000 1.13 --- AI.py 6 Nov 2004 15:13:40 -0000 1.14 *************** *** 308,314 **** best_target = track_id ! info_string = '%s %d (%.1f %d)' % (info_string, track_id, score, engaged_count) ! UI.DisplayMessage('%d: %s\n' % (class_mask, info_string)) return (best_score, best_target) --- 308,314 ---- best_target = track_id ! #info_string = '%s %d (%.1f %d)' % (info_string, track_id, score, engaged_count) ! #UI.DisplayMessage('%d: %s\n' % (class_mask, info_string)) return (best_score, best_target) Index: Menu.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/Menu.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Menu.py 14 Sep 2004 02:01:45 -0000 1.6 --- Menu.py 6 Nov 2004 15:13:40 -0000 1.7 *************** *** 14,17 **** --- 14,18 ---- TrackMenu.EndSubMenu() TrackMenu.AddItem('Drop track','DropTrack') + TrackMenu.AddItem('Update ambiguity list','UpdateAmbiguityList') def DeclareFriendly(TrackInfo): *************** *** 27,30 **** --- 28,34 ---- TrackInfo.DropTrack() + def UpdateAmbiguityList(TrackInfo): + TrackInfo.UpdateAmbiguityList() + def BuildGroupMenu(GroupMenu, GroupInfo): GroupMenu.Clear() |
|
From: Dewitt C. <ddc...@us...> - 2004-11-06 15:14:34
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31472/src/common Modified Files: simmath.cpp tcOptions.cpp Log Message: Added optical sensor model, fixed generic model display for sensor tracks Index: simmath.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/simmath.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** simmath.cpp 29 Oct 2004 02:50:43 -0000 1.17 --- simmath.cpp 6 Nov 2004 15:13:41 -0000 1.18 *************** *** 312,315 **** --- 312,335 ---- } + /** + * @returns track altitude or default based on classification if not avail + */ + float tcTrack::GetOrGuessAltitude() const + { + if (mnFlags & TRACK_ALT_VALID) + { + return mfAlt_m; + } + else if (mnClassification & (PTYPE_AIR | PTYPE_MISSILE)) + { + return 1000.0f; + } + else + { + return 0; + } + } + + void tcTrack::GetPrediction(tcTrack& td, double afTime) { *************** *** 368,371 **** --- 388,396 ---- } + bool tcTrack::IsBearingOnly() const + { + return (mnFlags & TRACK_BEARING_ONLY) != 0; + } + /******************************* tcTerrainInfo *******************************/ void tcTerrainInfo::Clear() { Index: tcOptions.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/tcOptions.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcOptions.cpp 1 Nov 2004 03:17:17 -0000 1.12 --- tcOptions.cpp 6 Nov 2004 15:13:41 -0000 1.13 *************** *** 131,134 **** --- 131,144 ---- AddOption(oi); + oi.meType = tsOptionInfo::OT_RADIOBUTTON; + oi.mnStateCount = 4; + oi.mnValue = 1; + oi.mpAssociated = &mn3DCheatMode; + oi.mzCaption[0] = "Own-alliance 3D only"; + oi.mzCaption[1] = "Track 3D"; + oi.mzCaption[2] = "Track 3D+"; + oi.mzCaption[3] = "Cheat"; + AddOption(oi); + Serialize(true); // read option state from file (options.dat) |
|
From: Dewitt C. <ddc...@us...> - 2004-11-06 15:14:34
|
Update of /cvsroot/gcblue/gcb_wx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31472 Modified Files: GCblue.vcproj Log Message: Added optical sensor model, fixed generic model display for sensor tracks Index: GCblue.vcproj =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/GCblue.vcproj,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** GCblue.vcproj 21 Oct 2004 04:10:58 -0000 1.70 --- GCblue.vcproj 6 Nov 2004 15:13:39 -0000 1.71 *************** *** 479,482 **** --- 479,485 ---- </File> <File + RelativePath=".\src\sim\tcOpticalSensor.cpp"> + </File> + <File RelativePath="src\sim\tcPlatformObject.cpp"> </File> *************** *** 522,525 **** --- 525,531 ---- </File> <File + RelativePath=".\src\database\tcDatabaseIterator.cpp"> + </File> + <File RelativePath="src\database\tcDatabaseObject.cpp"> </File> *************** *** 546,549 **** --- 552,558 ---- </File> <File + RelativePath=".\src\database\tcOpticalDBObject.cpp"> + </File> + <File RelativePath="src\database\tcRadarDBObject.cpp"> </File> *************** *** 1322,1325 **** --- 1331,1337 ---- </File> <File + RelativePath=".\include\sim\tcOpticalSensor.h"> + </File> + <File RelativePath="include\sim\tcPlatformObject.h"> </File> *************** *** 1371,1374 **** --- 1383,1389 ---- </File> <File + RelativePath=".\include\database\tcDatabaseIterator.h"> + </File> + <File RelativePath="include\database\tcDatabaseObject.h"> </File> *************** *** 1401,1404 **** --- 1416,1422 ---- </File> <File + RelativePath=".\include\database\tcOpticalDBObject.h"> + </File> + <File RelativePath="include\database\tcRadarDBObject.h"> </File> |
|
From: Dewitt C. <ddc...@us...> - 2004-11-06 15:14:34
|
Update of /cvsroot/gcblue/gcb_wx/include/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31472/include/scriptinterface Modified Files: tcTrackInterface.h Log Message: Added optical sensor model, fixed generic model display for sensor tracks Index: tcTrackInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcTrackInterface.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcTrackInterface.h 1 Nov 2004 03:17:16 -0000 1.5 --- tcTrackInterface.h 6 Nov 2004 15:13:40 -0000 1.6 *************** *** 28,33 **** #include "gctypes.h" ! namespace Sensor { class tcAllianceSensorMap; } --- 28,35 ---- #include "gctypes.h" ! namespace Sensor ! { class tcAllianceSensorMap; + class tcSensorMapTrack; } *************** *** 46,57 **** void DeclareHostile(); void DropTrack(); ! static void SetTrack(unsigned int anID) {mnTrackID = anID;} static void AttachSensorMap(tcAllianceSensorMap *apSM); tcTrackInterface(); virtual ~tcTrackInterface(); private: ! static unsigned int mnTrackID; static tcAllianceSensorMap *mpSensorMap; }; --- 48,62 ---- void DeclareHostile(); void DropTrack(); + void UpdateAmbiguityList(); ! static void SetTrack(long anID) {mnTrackID = anID;} static void AttachSensorMap(tcAllianceSensorMap *apSM); tcTrackInterface(); virtual ~tcTrackInterface(); private: ! static long mnTrackID; static tcAllianceSensorMap *mpSensorMap; + + tcSensorMapTrack* GetTrack(); }; |
|
From: Dewitt C. <ddc...@us...> - 2004-11-06 15:14:06
|
Update of /cvsroot/gcblue/gcb_wx/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31472/xml Modified Files: info_console.xml options.xml Log Message: Added optical sensor model, fixed generic model display for sensor tracks Index: options.xml =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/xml/options.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** options.xml 29 Oct 2004 02:50:54 -0000 1.5 --- options.xml 6 Nov 2004 15:13:43 -0000 1.6 *************** *** 2,4 **** --- 2,6 ---- <HostAddress>192.168.0.102</HostAddress> <DisplaySettings>default</DisplaySettings> + <LastScenarioPath>Random.py</LastScenarioPath> + <LastScenarioName>Random</LastScenarioName> </Options> Index: info_console.xml =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/xml/info_console.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** info_console.xml 1 Nov 2004 03:17:19 -0000 1.2 --- info_console.xml 6 Nov 2004 15:13:43 -0000 1.3 *************** *** 1,5 **** <Window> ! <TextBox TopMargin="2" BottomMargin="2" Wrap="70" DrawBorder="0" FontSize="12"/> </Window> \ No newline at end of file --- 1,5 ---- <Window> ! <TextBox TopMargin="2" BottomMargin="2" Wrap="60" DrawBorder="0" FontSize="12"/> </Window> \ No newline at end of file |
|
From: Dewitt C. <ddc...@us...> - 2004-11-06 15:14:04
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31472/src/graphics Modified Files: ObjectUpdater.cpp tc3DModel.cpp tc3DViewer.cpp tcHookInfo.cpp tcMapView.cpp tcScenarioSelectView.cpp Log Message: Added optical sensor model, fixed generic model display for sensor tracks Index: tc3DModel.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DModel.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tc3DModel.cpp 14 Sep 2004 02:01:46 -0000 1.14 --- tc3DModel.cpp 6 Nov 2004 15:13:41 -0000 1.15 *************** *** 2,7 **** ** @file tc3DModel.cpp */ ! /* ! ** Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 2,6 ---- ** @file tc3DModel.cpp */ ! /* Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 25,31 **** #ifndef WX_PRECOMP #include "wx/wx.h" ! #ifdef WIN32 ! #include "wx/msw/private.h" // for MS Windows specific definitions ! #endif // WIN32 #endif // WX_PRECOMP --- 24,30 ---- #ifndef WX_PRECOMP #include "wx/wx.h" ! //#ifdef WIN32 ! //#include "wx/msw/private.h" // for MS Windows specific definitions ! //#endif // WIN32 #endif // WX_PRECOMP *************** *** 38,41 **** --- 37,41 ---- #include "tcGenericDBObject.h" #include <osg/MatrixTransform> + #include <osg/Switch> #include <osgDB/ReadFile> #include <osgUtil/SmoothingVisitor> *************** *** 207,211 **** { // shallow copy node if larger than detail threshold ! const BoundingSphere& bs = node->getBound(); if (bs.radius() >= _detailThreshold) { --- 207,211 ---- { // shallow copy node if larger than detail threshold ! const osg::BoundingSphere& bs = node->getBound(); if (bs.radius() >= _detailThreshold) { *************** *** 252,255 **** --- 252,294 ---- osg::ref_ptr<osg::Group> tc3DModel::world; + osg::ref_ptr<osg::Node> tc3DModel::unknownAll; + osg::ref_ptr<osg::Node> tc3DModel::unknownAir; + osg::ref_ptr<osg::Node> tc3DModel::unknownLand; + osg::ref_ptr<osg::Node> tc3DModel::unknownSurface; + + bool tc3DModel::useSmoothing = true; + + /** + * Static method to load unknowns models. Should be called + * once at startup + */ + void tc3DModel::LoadUnknowns() + { + if (unknownAll.valid()) return; // models already loaded + fprintf(stdout, "Loading unknowns: "); + + unknownAll = osgDB::readNodeFile("unk_all.3ds"); + unknownAir = osgDB::readNodeFile("air_small.3ds"); + unknownLand = osgDB::readNodeFile("surf_small.3ds"); + unknownSurface = osgDB::readNodeFile("surf_small.3ds"); + + if (!unknownAll.valid()) fprintf(stdout, "FAILED unk_all.3ds "); + if (!unknownAir.valid()) fprintf(stdout, "FAILED air_small.3ds "); + if (!unknownLand.valid()) fprintf(stdout, "FAILED surf_small.3ds "); + if (!unknownSurface.valid()) fprintf(stdout, "FAILED surf_small.3ds "); + fprintf(stdout, "done\n"); + + if (useSmoothing) + { + osgUtil::SmoothingVisitor smoothingVisitor; + + unknownAll->accept(smoothingVisitor); + unknownAir->accept(smoothingVisitor); + unknownLand->accept(smoothingVisitor); + unknownSurface->accept(smoothingVisitor); + } + } + + /** * Adds child to modelTransform of this model. *************** *** 315,318 **** --- 354,360 ---- /** + * Always returns radius of true model without considering generic + * models. + * @see tc3DModel::GetRadiusGeneric * @return radius of bounding sphere in meters */ *************** *** 322,325 **** --- 364,387 ---- } + /** + * @return radius of rendered model, considering generics + */ + float tc3DModel::GetRadiusGeneric() + { + switch (genericMode) + { + case USE_TRUE_MODEL: return GetRadius(); + case USE_UNKNOWN_GENERIC: return unknownAll.get()->getBound().radius(); + case USE_AIR_GENERIC: return unknownAir.get()->getBound().radius(); + case USE_LAND_GENERIC: return unknownLand.get()->getBound().radius(); + case USE_SURFACE_GENERIC: return unknownSurface.get()->getBound().radius(); + case DISABLE_MODEL: return unknownAll.get()->getBound().radius(); + default: + fprintf(stderr, "Error - tc3DModel::GetRadiusGeneric - invalid genericMode\n"); + return 1.0f; + } + + } + void tc3DModel::Load(std::string model_name) { *************** *** 392,395 **** --- 454,486 ---- /** + * Sets generic display mode for model. + * Mode controls switch selection at root + * Options for mode are + * USE_TRUE_MODEL = 0, + * USE_UNKNOWN_GENERIC = 1, + * USE_AIR_GENERIC = 2, + * USE_LAND_GENERIC = 3, + * USE_SURFACE_GENERIC = 4, + * DISABLE_MODEL = 5 + */ + void tc3DModel::SetGenericMode(int mode) + { + if (mode == DISABLE_MODEL) + { + genericMode = DISABLE_MODEL; + root->setAllChildrenOff(); + return; + } + + if ((mode < 0) || (mode > 5)) + { + fprintf(stderr, "Error - tc3DModel::SetGenericMode - Mode out of range\n"); + return; + } + root->setSingleChildOn(mode); + genericMode = mode; + } + + /** * Called once per instance to set and configure update callback. * Bind switchVariable for animations *************** *** 440,444 **** tc3DModel::tc3DModel() { - useSmoothing = true; } --- 531,534 ---- *************** *** 452,462 **** { wxASSERT(source->modelNode.valid()); // error if modelNode not loaded yet ! modelTransform = new osg::MatrixTransform; modelTransform->setDataVariance(osg::Object::DYNAMIC); modelGroup = new osg::LOD; ! modelTransform->addChild(modelGroup.get()); animationInfo.clear(); --- 542,562 ---- { wxASSERT(source->modelNode.valid()); // error if modelNode not loaded yet ! wxASSERT(unknownAll.valid()); modelTransform = new osg::MatrixTransform; modelTransform->setDataVariance(osg::Object::DYNAMIC); + + root = new osg::Switch; + modelTransform->addChild(root.get()); + modelGroup = new osg::LOD; ! root->addChild(modelGroup.get(), true); ! root->addChild(unknownAll.get(), false); ! root->addChild(unknownAir.get(), false); ! root->addChild(unknownLand.get(), false); ! root->addChild(unknownSurface.get(), false); ! genericMode = USE_TRUE_MODEL; ! animationInfo.clear(); Index: tcScenarioSelectView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcScenarioSelectView.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcScenarioSelectView.cpp 2 Nov 2004 04:23:56 -0000 1.6 --- tcScenarioSelectView.cpp 6 Nov 2004 15:13:41 -0000 1.7 *************** *** 219,222 **** --- 219,224 ---- { loadedScenarioCaption = caption; + tcOptions::Get()->SetOptionString("LastScenarioPath", filePath.c_str()); + tcOptions::Get()->SetOptionString("LastScenarioName", caption.c_str()); } else Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapView.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcMapView.cpp 3 Nov 2004 16:36:43 -0000 1.6 --- tcMapView.cpp 6 Nov 2004 15:13:41 -0000 1.7 *************** *** 1600,1603 **** --- 1600,1604 ---- if (bBearingOnly) { + symbolColor._v[3] = 0.5f; DrawLineR(xv, yv, xv_passive, yv_passive, symbolColor); } Index: tcHookInfo.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcHookInfo.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcHookInfo.cpp 2 Nov 2004 04:23:56 -0000 1.4 --- tcHookInfo.cpp 6 Nov 2004 15:13:41 -0000 1.5 *************** *** 36,39 **** --- 36,41 ---- #include "commandlist.h" #include "simmath.h" + #include "tcDatabase.h" + #include "tcTime.h" #ifdef _DEBUG *************** *** 67,74 **** // classification ClassificationToString(pTrack->mnClassification, zBuff); color.set(0.4f, 1.0f, 0.4f, 1.0f); ! DrawTextR(zBuff, ftextx-2.0f, ftexty, defaultFont.get(), color, fontSizeLarge, LEFT_BASE_LINE); ! ftexty += 20.0f; // speed, heading, altitude, terrain info --- 69,101 ---- // classification ClassificationToString(pTrack->mnClassification, zBuff); + strcat(zBuff, " track"); color.set(0.4f, 1.0f, 0.4f, 1.0f); ! if (pSMTrack->mnDatabaseID == -1) ! { ! DrawTextR(zBuff, ftextx-2.0f, ftexty, defaultFont.get(), ! color, fontSizeLarge, LEFT_BASE_LINE); ! ftexty += 20.0f; ! } ! else // track is identified, look up class name ! { ! if (tcDatabaseObject* databaseObj = database->GetObject(pSMTrack->mnDatabaseID)) ! { ! s = databaseObj->mzClass.mz; ! } ! else // error, not found in database ! { ! s = "Error"; ! } ! ! DrawTextR(s.c_str(), ftextx-2.0f, ftexty, ! defaultFont.get(), color, fontSizeLarge, LEFT_BASE_LINE); ! ftexty += 15.0f; ! ! DrawTextR(zBuff, ftextx, ftexty, ! defaultFont.get(), color, fontSize, LEFT_BASE_LINE); ! ftexty += 20.0f; ! } ! // speed, heading, altitude, terrain info *************** *** 136,144 **** strcpy(zBuff,"Error"); } ! DrawTextR(zBuff, ftextx, ftexty, defaultFont.get(), color, fontSize, LEFT_BASE_LINE); ftexty += 15; } //*********** draw engagement info ************** DrawTrackEngaged(pSMTrack, ftextx, ftexty); --- 163,229 ---- strcpy(zBuff,"Error"); } ! DrawTextR(zBuff, ftextx + 3.0f, ftexty, defaultFont.get(), color, fontSize, LEFT_BASE_LINE); ftexty += 15; } + ftexty += 5; + + /* Platform ambiguity list, update if at least one emitter + ** is detected, and detailed identification is not + ** available */ + if ((nEmitters > 0) && (pSMTrack->mnDatabaseID == -1)) + { + unsigned nCandidates = pSMTrack->ambiguityList.size(); + if (nCandidates) + { + sprintf(zBuff, "Ambiguity list (%d):", nCandidates); + DrawTextR(zBuff, ftextx, ftexty, defaultFont.get(), color, fontSize, LEFT_BASE_LINE); + ftexty+=15; + } + else + { + DrawTextR("Ambiguity list not available", ftextx, ftexty, defaultFont.get(), + color, fontSize, LEFT_BASE_LINE); + ftexty += 15; + } + + unsigned int currentCount = tcTime::Get()->Get30HzCount(); + if (currentCount - lastCycleCount > 75) // 2.5 seconds + { + lastCycleCount = currentCount; + if (nCandidates > 4) + { + ambiguityIdx += 4; + } + } + if (ambiguityIdx >= nCandidates) ambiguityIdx = 0; + + for (unsigned int n=ambiguityIdx; (n < ambiguityIdx+4) && (n < nCandidates); n++) + { + long candidateID = pSMTrack->ambiguityList[n]; + tcDatabaseObject* dbObj = mpSS->mpDatabase->GetObject(candidateID); + if (dbObj) + { + strcpy(zBuff, dbObj->mzClass.mz); + } + else + { + strcpy(zBuff, "Error"); + } + DrawTextR(zBuff, ftextx + 3.0f, ftexty, defaultFont.get(), color, fontSize, LEFT_BASE_LINE); + + ftexty += 10; + } + + } + + + + + + + + //*********** draw engagement info ************** DrawTrackEngaged(pSMTrack, ftextx, ftexty); *************** *** 250,254 **** s = pHookedObj->mzUnit.mz; color.set(0.4f, 1.0f, 0.4f, 1.0f); ! DrawTextR(s.c_str(), ftextx-2.0f, ftexty, defaultFont.get(), color, fontSize, LEFT_BASE_LINE); ftexty += 20.0f; --- 335,339 ---- s = pHookedObj->mzUnit.mz; color.set(0.4f, 1.0f, 0.4f, 1.0f); ! DrawTextR(s.c_str(), ftextx-2.0f, ftexty, defaultFont.get(), color, fontSizeLarge, LEFT_BASE_LINE); ftexty += 20.0f; *************** *** 500,514 **** mpSS = NULL; mpOptions = NULL; mpUserInfo = NULL; drawEngagedMode = 1; } /***********************************************************************************/ tcHookInfo::~tcHookInfo() { ! /* ! if (mpPen != NULL) {delete mpPen;} ! if (mpFont != NULL) {delete mpFont;} ! if (mpFontLarge != NULL) {delete mpFontLarge;} ! if (mpBrush != NULL) {delete mpBrush;} ! */ } --- 585,597 ---- mpSS = NULL; mpOptions = NULL; + database = tcDatabase::Get(); mpUserInfo = NULL; drawEngagedMode = 1; + ambiguityIdx = 0; + lastCycleCount = 0; } /***********************************************************************************/ tcHookInfo::~tcHookInfo() { ! } Index: ObjectUpdater.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/ObjectUpdater.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ObjectUpdater.cpp 2 Nov 2004 04:23:56 -0000 1.10 --- ObjectUpdater.cpp 6 Nov 2004 15:13:41 -0000 1.11 *************** *** 1,6 **** --- 1,33 ---- + /** + ** @file ObjectUpdater.cpp + */ + /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) + ** All rights reserved. + + ** This file is part of the Global Conflict Blue (GCB) program. + ** GCB is free software; you can redistribute it and/or modify + ** it under the terms of version 2 of the GNU General Public License as + ** published by the Free Software Foundation. + + ** GCB is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + + ** You should have received a copy of the GNU General Public License + ** along with GCB; if not, write to the Free Software + ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + #include "stdwx.h" + #include "ObjectUpdater.h" #include "tcGameObject.h" #include "tc3DModel.h" #include "tc3DViewer.h" + #include "tcSimState.h" + #include "tcOptions.h" + #include "tcSensorMap.h" + #include <osg/MatrixTransform> #include "tcParticleEffect.h" *************** *** 12,16 **** using namespace osg; ! tc3DViewer* ObjectUpdater::viewer = NULL; --- 39,45 ---- using namespace osg; ! tc3DViewer* ObjectUpdater::viewer = 0; ! tcSimState* ObjectUpdater::simState = 0; ! Sensor::tcSensorMap* ObjectUpdater::sensorMap = 0; *************** *** 33,36 **** --- 62,66 ---- }; + void ObjectUpdater::UpdateAnimations() { *************** *** 55,59 **** } ! void ObjectUpdater::operator()(Node* node, NodeVisitor* nv) { float yaw, pitch, roll; --- 85,171 ---- } ! /** ! * Omits child (captive object) updates ! */ ! void ObjectUpdater::UpdateTrack(Node* node) ! { ! tcGameObject* gameObject = model->GetGameObj(); ! wxASSERT(gameObject); ! ! unsigned int ownAlliance = simState->mpUserInfo->GetOwnAlliance(); ! tcSensorMapTrack* track = sensorMap->GetSensorMapTrack(gameObject->mnID, ownAlliance); ! ! int n3DCheatMode = tcOptions::Get()->mn3DCheatMode; ! ! if ((n3DCheatMode == 0) || (track == 0) || (track->IsBearingOnly())) ! { ! model->SetGenericMode(tc3DModel::DISABLE_MODEL); ! return; ! } ! ! int genericMode = 0; ! ! // first case assumes track identification is never wrong (currently true) ! if (track->mnDatabaseID != -1) genericMode = tc3DModel::USE_TRUE_MODEL; ! else if (track->IsSurface()) genericMode = tc3DModel::USE_SURFACE_GENERIC; ! else if (track->IsAir()) genericMode = tc3DModel::USE_AIR_GENERIC; ! else if (track->IsMissile()) genericMode = tc3DModel::USE_AIR_GENERIC; ! else genericMode = tc3DModel::USE_UNKNOWN_GENERIC; ! ! model->SetGenericMode(genericMode); ! ! ! ! float yaw, pitch, roll; ! float x, y, z; ! yaw = track->mfHeading_rad; ! pitch = 0; ! roll = 0; ! ! // if object is close to camera, use predicted track for position ! if (distanceFromCamera < 10e3) ! { ! tcTrack predicted; ! track->GetPrediction(predicted, simState->GetTime()); ! x = viewer->LonToX(predicted.mfLon_rad); ! y = viewer->LatToY(predicted.mfLat_rad); ! z = predicted.GetOrGuessAltitude(); ! } ! else ! { ! x = viewer->LonToX(track->mfLon_rad); ! y = viewer->LatToY(track->mfLat_rad); ! z = track->GetOrGuessAltitude(); ! } ! ! ! float yawCorrection = C_PI; // 180 degrees added to yaw for different 3D model convention ! ! ! // not correct for child objects ! osg::Vec3 cameraDelta = osg::Vec3(x,y,z) - viewer->GetCameraPosition(); ! distanceFromCamera = cameraDelta.length(); ! model->SetDistanceFromCamera(distanceFromCamera); ! ! ! if ((model->IsSmokeEnabled())&&(track->IsMissile())) ! { ! model->UpdateSmokePosition(x, y, z); ! } ! ! osg::Matrix m = ! osg::Matrix::rotate(osg::inRadians(roll),0.0f,1.0f,0.0f)* ! osg::Matrix::rotate(-osg::inRadians(pitch),1.0f,0.0f,0.0f)* ! osg::Matrix::rotate(-osg::inRadians(yaw + yawCorrection),0.0f,0.0f,1.0f)*osg::Matrix::translate(x,y,z) ! ; ! ! UpdaterCallbackVisitor cv(m); ! node->accept(cv); ! ! } ! ! ! ! void ObjectUpdater::UpdateTrue(Node* node) { float yaw, pitch, roll; *************** *** 62,147 **** float yawCorrection = 0; ! tcGameObject *gameObject = model->GetGameObj(); if (gameObject) { ! if (!gameObject->parent) ! { ! tcKinematics *kin = &gameObject->mcKin; ! yaw = kin->mfHeading_rad; ! pitch = kin->mfPitch_rad; ! roll = kin->mfRoll_rad; ! x = viewer->LonToX(kin->mfLon_rad); ! y = viewer->LatToY(kin->mfLat_rad); ! z = kin->mfAlt_m; ! yawCorrection = C_PI; // 180 degrees added to yaw for different 3D model convention ! } ! else ! { ! if (useRelativeChildPos) ! { ! tsRelativePosition *pos = &gameObject->rel_pos; ! yaw = pos->yaw; ! pitch = pos->pitch; ! roll = pos->roll; ! x = -pos->dx; // backwards because of 180 deg model issue ! y = pos->dz; // backwards because of 180 deg model issue ! z = pos->dy; ! isVisible = pos->isVisible; ! } ! else ! { ! // not implemented correctly, just a test mode ! tcKinematics *kin = &gameObject->parent->mcKin; ! yaw = kin->mfHeading_rad; ! pitch = kin->mfPitch_rad; ! roll = kin->mfRoll_rad; ! x = viewer->LonToX(kin->mfLon_rad); ! y = viewer->LatToY(kin->mfLat_rad); ! z = kin->mfAlt_m + 60.0f; ! yawCorrection = C_PI; ! } ! } ! ! // not correct for child objects ! osg::Vec3 cameraDelta = osg::Vec3(x,y,z) - viewer->GetCameraPosition(); ! distanceFromCamera = cameraDelta.length(); ! model->SetDistanceFromCamera(distanceFromCamera); ! ! /* ! if ((distanceFromCamera <= 20)&&(gameObject->parent == 0)) ! { ! int xx = 8; ! } ! */ ! /* ! if ((abs(x) < 4000)&&(gameObject->parent == 0)) ! { ! int xx = 8; ! osg::Vec3 camPos = viewer->GetCameraPosition(); ! } ! */ ! ! ! if (model->IsSmokeEnabled()) ! { ! model->UpdateSmokePosition(x, y, z); ! } ! osg::Matrix m = ! osg::Matrix::rotate(osg::inRadians(roll),0.0f,1.0f,0.0f)* ! osg::Matrix::rotate(-osg::inRadians(pitch),1.0f,0.0f,0.0f)* ! osg::Matrix::rotate(-osg::inRadians(yaw + yawCorrection),0.0f,0.0f,1.0f)*osg::Matrix::translate(x,y,z) ! ; ! if (isVisible) ! { ! UpdaterCallbackVisitor cv(m); ! node->accept(cv); ! } ! } ! UpdateAnimations(); - // must call any nested node callbacks and continue subgraph traversal. - NodeCallback::traverse(node,nv); } --- 174,261 ---- float yawCorrection = 0; ! tcGameObject* gameObject = model->GetGameObj(); ! ! model->SetGenericMode(tc3DModel::USE_TRUE_MODEL); ! ! if (!gameObject->parent) ! { ! tcKinematics* kin = &gameObject->mcKin; ! yaw = kin->mfHeading_rad; ! pitch = kin->mfPitch_rad; ! roll = kin->mfRoll_rad; ! x = viewer->LonToX(kin->mfLon_rad); ! y = viewer->LatToY(kin->mfLat_rad); ! z = kin->mfAlt_m; ! ! yawCorrection = C_PI; // 180 degrees added to yaw for different 3D model convention ! } ! else ! { ! tsRelativePosition *pos = &gameObject->rel_pos; ! yaw = pos->yaw; ! pitch = pos->pitch; ! roll = pos->roll; ! x = -pos->dx; // backwards because of 180 deg model issue ! y = pos->dz; // backwards because of 180 deg model issue ! z = pos->dy; ! isVisible = pos->isVisible; ! } ! ! // not correct for child objects ! osg::Vec3 cameraDelta = osg::Vec3(x,y,z) - viewer->GetCameraPosition(); ! distanceFromCamera = cameraDelta.length(); ! model->SetDistanceFromCamera(distanceFromCamera); ! ! ! if (model->IsSmokeEnabled()) ! { ! model->UpdateSmokePosition(x, y, z); ! } ! ! osg::Matrix m = ! osg::Matrix::rotate(osg::inRadians(roll),0.0f,1.0f,0.0f)* ! osg::Matrix::rotate(-osg::inRadians(pitch),1.0f,0.0f,0.0f)* ! osg::Matrix::rotate(-osg::inRadians(yaw + yawCorrection),0.0f,0.0f,1.0f)*osg::Matrix::translate(x,y,z) ! ; ! if (isVisible) ! { ! UpdaterCallbackVisitor cv(m); ! node->accept(cv); ! } ! } ! ! ! /** ! * Main update method. ! * Updates position and attitude of object ! * Fix this so that the track-only mode does not require a game object to be ! * present. ! */ ! void ObjectUpdater::operator()(Node* node, NodeVisitor* nv) ! { ! tcGameObject* gameObject = model->GetGameObj(); ! int displayMode = tcOptions::Get()->mn3DCheatMode; ! if (gameObject) { ! if ((displayMode == 3) || simState->mpUserInfo->IsOwnAlliance(gameObject->mnAlliance)) ! { ! UpdateTrue(node); ! } ! else ! { ! UpdateTrack(node); ! } ! UpdateAnimations(); ! // must call any nested node callbacks and continue subgraph traversal. ! NodeCallback::traverse(node,nv); ! } ! else // no game object available ! { ! fprintf(stderr, "Error - ObjectUpdater::operator() - called with null game obj\n"); ! } } *************** *** 150,154 **** { model = NULL; ! useRelativeChildPos = true; } --- 264,272 ---- { model = NULL; ! if (!simState) ! { ! simState = tcSimState::Get(); ! sensorMap = simState->GetSensorMap(); ! } } *************** *** 156,160 **** model(mod) { ! useRelativeChildPos = true; } --- 274,282 ---- model(mod) { ! if (!simState) ! { ! simState = tcSimState::Get(); ! sensorMap = simState->GetSensorMap(); ! } } Index: tc3DViewer.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DViewer.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tc3DViewer.cpp 29 Oct 2004 02:50:43 -0000 1.4 --- tc3DViewer.cpp 6 Nov 2004 15:13:41 -0000 1.5 *************** *** 88,91 **** --- 88,94 ---- { + /** + * This code was taken from one of the osg sources + */ class PrintCullVistor : public osgUtil::CullVisitor { *************** *** 112,121 **** } ! void apply(Geode& node) { if (isCulled(node)) return; // push the node's state. ! StateSet* node_state = node.getStateSet(); if (node_state) pushStateSet(node_state); --- 115,124 ---- } ! void apply(osg::Geode& node) { if (isCulled(node)) return; // push the node's state. ! osg::StateSet* node_state = node.getStateSet(); if (node_state) pushStateSet(node_state); *************** *** 123,131 **** handle_cull_callbacks_and_traverse(node); ! RefMatrix& matrix = getModelViewMatrix(); for(unsigned int i=0;i<node.getNumDrawables();++i) { ! Drawable* drawable = node.getDrawable(i); ! const BoundingBox &bb =drawable->getBound(); if( drawable->getCullCallback() ) --- 126,134 ---- handle_cull_callbacks_and_traverse(node); ! osg::RefMatrix& matrix = getModelViewMatrix(); for(unsigned int i=0;i<node.getNumDrawables();++i) { ! osg::Drawable* drawable = node.getDrawable(i); ! const osg::BoundingBox &bb = drawable->getBound(); if( drawable->getCullCallback() ) *************** *** 134,139 **** continue; } ! ! //else { if (node.isCullingActive() && isCulled(bb)) continue; --- 137,141 ---- continue; } ! else { if (node.isCullingActive() && isCulled(bb)) continue; *************** *** 147,151 **** // push the geoset's state on the geostate stack. ! StateSet* stateset = drawable->getStateSet(); if (stateset) pushStateSet(stateset); --- 149,153 ---- // push the geoset's state on the geostate stack. ! osg::StateSet* stateset = drawable->getStateSet(); if (stateset) pushStateSet(stateset); *************** *** 559,562 **** --- 561,570 ---- + void tc3DViewer::AttachSimState(tcSimState *ss) + { + simState = ss; + } + + /** * Adds text drawable to textGeode. Take care with reference count *************** *** 734,738 **** depth->setRange(0, 1); depth->setWriteMask(true); ! terrainState->setAttributeAndModes(depth,StateAttribute::ON); terrainState->setRenderBinDetails(-2, "RenderBin"); --- 742,746 ---- depth->setRange(0, 1); depth->setWriteMask(true); ! terrainState->setAttributeAndModes(depth, osg::StateAttribute::ON); terrainState->setRenderBinDetails(-2, "RenderBin"); *************** *** 1045,1053 **** * @return object position in world coordinates. */ ! osg::Vec3 tc3DViewer::GetObjectPosition(tcGameObject *obj) { ! float x = LonToX(obj->mcKin.mfLon_rad); ! float y = LatToY(obj->mcKin.mfLat_rad); ! float z = obj->mcKin.mfAlt_m; return osg::Vec3(x,y,z); } --- 1053,1094 ---- * @return object position in world coordinates. */ ! osg::Vec3 tc3DViewer::GetObjectPosition(tcGameObject* obj) { ! int n3DCheatMode = tcOptions::Get()->mn3DCheatMode; ! ! float x, y, z; ! if (n3DCheatMode == 3) ! { ! x = LonToX(obj->mcKin.mfLon_rad); ! y = LatToY(obj->mcKin.mfLat_rad); ! z = obj->mcKin.mfAlt_m; ! } ! else ! { ! tcSensorMap* sensorMap = simState->GetSensorMap(); ! unsigned int ownAlliance = simState->mpUserInfo->GetOwnAlliance(); ! if (ownAlliance == obj->mnAlliance) ! { ! x = LonToX(obj->mcKin.mfLon_rad); ! y = LatToY(obj->mcKin.mfLat_rad); ! z = obj->mcKin.mfAlt_m; ! } ! else if (tcSensorMapTrack* track = ! sensorMap->GetSensorMapTrack(obj->mnID, ownAlliance)) ! { ! tcTrack predicted; ! track->GetPrediction(predicted, simState->GetTime()); ! x = LonToX(predicted.mfLon_rad); ! y = LatToY(predicted.mfLat_rad); ! z = predicted.GetOrGuessAltitude(); ! } ! else ! { ! x = LonToX(obj->mcKin.mfLon_rad); ! y = LatToY(obj->mcKin.mfLat_rad); ! z = obj->mcKin.mfAlt_m; ! } ! } ! return osg::Vec3(x,y,z); } *************** *** 1339,1343 **** osg::Vec3 upperLeft(20.0f, (float)mnHeight - 40.0f, 0.0f); osg::Vec3 upperRight((float)mnWidth - 150.0f, (float)mnHeight - 40.0f, 0.0f); ! osg::Vec3 bottomCenter(0.5 * (float)mnWidth, 40.0f, 0.0f); osg::Vec4 color(0.4f, 0.4f, 0.8f, 0.8f); --- 1380,1385 ---- osg::Vec3 upperLeft(20.0f, (float)mnHeight - 40.0f, 0.0f); osg::Vec3 upperRight((float)mnWidth - 150.0f, (float)mnHeight - 40.0f, 0.0f); ! osg::Vec3 bottomCenter(0.5 * (float)mnWidth, 0.2f*(float)mnHeight, 0.0f); ! osg::Vec3 topCenter(0.5 * (float)mnWidth, 0.8f*(float)mnHeight, 0.0f); osg::Vec4 color(0.4f, 0.4f, 0.8f, 0.8f); *************** *** 1350,1353 **** --- 1392,1398 ---- AddTextObject(2, bottomCenter, 16.0, osg::Vec4(0.9f, 0.9f, 0.7f, 0.9f), osgText::Text::AlignmentType::CENTER_CENTER); + + AddTextObject(3, topCenter, 16.0, osg::Vec4(0.9f, 0.9f, 0.7f, 0.9f), + osgText::Text::AlignmentType::CENTER_CENTER); } *************** *** 1357,1360 **** --- 1402,1406 ---- ClearTextObject(1); ClearTextObject(2); + ClearTextObject(3); } *************** *** 1466,1470 **** osg::StateSet *stateSet = rootnode->getOrCreateStateSet(); wxASSERT(stateSet); ! osg::StateAttribute *sa = stateSet->getAttribute(StateAttribute::POLYGONMODE); osg::PolygonMode *pm = dynamic_cast<osg::PolygonMode*>(sa); if (pm == NULL) --- 1512,1516 ---- osg::StateSet *stateSet = rootnode->getOrCreateStateSet(); wxASSERT(stateSet); ! osg::StateAttribute *sa = stateSet->getAttribute(osg::StateAttribute::POLYGONMODE); osg::PolygonMode *pm = dynamic_cast<osg::PolygonMode*>(sa); if (pm == NULL) *************** *** 1500,1505 **** { // set camera position to ! const osg::BoundingSphere& bs = obj->model->GetNode()->getBound(); ! cameraRange = 4*bs.radius(); if (cameraRange < 12.0f) cameraRange = 12.0f; } --- 1546,1552 ---- { // set camera position to ! //const osg::BoundingSphere& bs = obj->model->GetNode()->getBound(); ! //cameraRange = 4*bs.radius(); ! cameraRange = 2 * obj->model->GetRadiusGeneric(); if (cameraRange < 12.0f) cameraRange = 12.0f; } *************** *** 1620,1623 **** --- 1667,1672 ---- CreateScene(); + + tc3DModel::LoadUnknowns(); } |
|
From: Dewitt C. <ddc...@us...> - 2004-11-06 15:14:03
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31472/src/scriptinterface Modified Files: tcSimPythonInterface.cpp tcTrackInterface.cpp Log Message: Added optical sensor model, fixed generic model display for sensor tracks Index: tcSimPythonInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcSimPythonInterface.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcSimPythonInterface.cpp 5 Sep 2004 01:02:02 -0000 1.18 --- tcSimPythonInterface.cpp 6 Nov 2004 15:13:42 -0000 1.19 *************** *** 608,611 **** --- 608,612 ---- .def("DeclareFriendly", &tcTrackInterface::DeclareFriendly) .def("DropTrack", &tcTrackInterface::DropTrack) + .def("UpdateAmbiguityList", &tcTrackInterface::UpdateAmbiguityList) ; TrackInterface = TrackInterfaceType(); Index: tcTrackInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcTrackInterface.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcTrackInterface.cpp 1 Nov 2004 03:17:18 -0000 1.7 --- tcTrackInterface.cpp 6 Nov 2004 15:13:42 -0000 1.8 *************** *** 41,45 **** tcAllianceSensorMap* tcTrackInterface::mpSensorMap = NULL; ! unsigned int tcTrackInterface::mnTrackID = 0xFFFFFFFF; void tcTrackInterface::AttachSensorMap(tcAllianceSensorMap *apSM) --- 41,46 ---- tcAllianceSensorMap* tcTrackInterface::mpSensorMap = NULL; ! long tcTrackInterface::mnTrackID = -1; ! void tcTrackInterface::AttachSensorMap(tcAllianceSensorMap *apSM) *************** *** 52,57 **** void tcTrackInterface::DropTrack() { ! if (mpSensorMap == NULL) {return;} ! mpSensorMap->DropTrack(mnTrackID); } --- 53,73 ---- void tcTrackInterface::DropTrack() { ! if (mpSensorMap == NULL) {return;} ! mpSensorMap->DropTrack(mnTrackID); ! } ! ! tcSensorMapTrack* tcTrackInterface::GetTrack() ! { ! wxASSERT(mpSensorMap); ! if (mpSensorMap == 0) return 0; ! if (mnTrackID == -1) return 0; ! tcSensorMapTrack* track = mpSensorMap->GetSensorMapTrack(mnTrackID); ! if (track == NULL) ! { ! fprintf(stderr, "Warning - tcTrackInterface::GetTrack - " ! "couldn't find track id: %d, alliance: %d\n", ! mnTrackID, mpSensorMap->GetAlliance()); ! } ! return track; } *************** *** 85,88 **** --- 101,112 ---- } + void tcTrackInterface::UpdateAmbiguityList() + { + tcSensorMapTrack* track = GetTrack(); + if (track) + { + track->UpdateAmbiguityList(); + } + } tcTrackInterface::tcTrackInterface() |
|
From: Dewitt C. <ddc...@us...> - 2004-11-03 16:37:22
|
Update of /cvsroot/gcblue/gcb_wx/include/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15682/include/scriptinterface Modified Files: tcPlatformInterface.h Log Message: AI experimentation Index: tcPlatformInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcPlatformInterface.h,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** tcPlatformInterface.h 16 Aug 2004 01:43:29 -0000 1.24 --- tcPlatformInterface.h 3 Nov 2004 16:36:42 -0000 1.25 *************** *** 90,94 **** public: double mfCurrentTime; ! static void InitPythonClassesA(void); static object InitPythonPlatformInterface(); static object GetPlatformInterface(); --- 90,94 ---- public: double mfCurrentTime; ! static void InitPythonClassesA(); static object InitPythonPlatformInterface(); static object GetPlatformInterface(); *************** *** 126,130 **** void SetSpeed(float speed_kts) {mpPlatformObj->SetSpeed(speed_kts);} /// set speed of platform to maximum speed (use SetThrottle for aero air objects) ! void SetSpeedToMax(void); /// set throttle for air objects /** --- 126,130 ---- void SetSpeed(float speed_kts) {mpPlatformObj->SetSpeed(speed_kts);} /// set speed of platform to maximum speed (use SetThrottle for aero air objects) ! void SetSpeedToMax(); /// set throttle for air objects /** *************** *** 144,150 **** // platform info /// get unit name of platform ! std::string GetPlatformName(void); /// get database class name of platform ! std::string GetPlatformClass(void); /// returns true if platform is a surface platform bool IsSurface() {return (mpPlatformObj->mnModelType == MTYPE_SURFACE);} --- 144,150 ---- // platform info /// get unit name of platform ! std::string GetPlatformName(); /// get database class name of platform ! std::string GetPlatformClass(); /// returns true if platform is a surface platform bool IsSurface() {return (mpPlatformObj->mnModelType == MTYPE_SURFACE);} *************** *** 173,177 **** long GetTarget() {return mpPlatformObj->mcAI.GetTarget();} /// get range to target in km ! float GetRangeToTarget(void); /// get track info object for target tcSensorMapTrack GetTargetTrackInfo(); --- 173,177 ---- long GetTarget() {return mpPlatformObj->mcAI.GetTarget();} /// get range to target in km ! float GetRangeToTarget(); /// get track info object for target tcSensorMapTrack GetTargetTrackInfo(); *************** *** 188,194 **** // weapon related commands /// gets launcher info object for best launcher for target ! tcLauncherInfo GetBestLauncher(void); /// gets number of launchers available on platform ! int GetLauncherCount(void); /// sets datum for launcher void SendDatumToLauncher(float afLon_rad, float afLat_rad, float alt_m, int anLauncher); --- 188,194 ---- // weapon related commands /// gets launcher info object for best launcher for target ! tcLauncherInfo GetBestLauncher(); /// gets number of launchers available on platform ! int GetLauncherCount(); /// sets datum for launcher void SendDatumToLauncher(float afLon_rad, float afLat_rad, float alt_m, int anLauncher); *************** *** 207,215 **** // order related commands /// true if platform has any orders ! bool HasOrders(void); /// gets order info object for current platform order ! tcOrder GetCurrentOrder(void); /// called to indicate current order is complete and to move to next order ! void CompletedOrder(void); /// adds generic order void AddOrder(std::string order_text, long data = -1); --- 207,215 ---- // order related commands /// true if platform has any orders ! bool HasOrders(); /// gets order info object for current platform order ! tcOrder GetCurrentOrder(); /// called to indicate current order is complete and to move to next order ! void CompletedOrder(); /// adds generic order void AddOrder(std::string order_text, long data = -1); *************** *** 217,221 **** void AddNavOrder(float afLon_rad, float afLat_rad); /// clear all orders ! void ClearOrders(void); /// delete order void DeleteOrder(int n); --- 217,221 ---- void AddNavOrder(float afLon_rad, float afLat_rad); /// clear all orders ! void ClearOrders(); /// delete order void DeleteOrder(int n); *************** *** 227,233 **** // sensor map and sensor commands /// get first track in alliance sensor map, track iterator object is returned ! tcTrackIterator GetFirstTrack(void); /// gets total number of tracks in alliance sensor map ! int GetTrackCount(void); /// gets next track in sensor map, nPos is obtained from track iterator from last call tcTrackIterator GetNextTrack(long nPos); --- 227,233 ---- // sensor map and sensor commands /// get first track in alliance sensor map, track iterator object is returned ! tcTrackIterator GetFirstTrack(); /// gets total number of tracks in alliance sensor map ! int GetTrackCount(); /// gets next track in sensor map, nPos is obtained from track iterator from last call tcTrackIterator GetNextTrack(long nPos); *************** *** 285,289 **** float GetRand() {return randf();} static void SetObj(tcPlatformObject *apObj) {mpStaticPlatformObj = apObj;} ! void GetLocalObj(void); void SetPlatform(tcPlatformObject *obj); static void AttachCommandQueue(tcCommandQueue *cq) {mpCommandQueue = cq;} --- 285,289 ---- float GetRand() {return randf();} static void SetObj(tcPlatformObject *apObj) {mpStaticPlatformObj = apObj;} ! void GetLocalObj(); void SetPlatform(tcPlatformObject *obj); static void AttachCommandQueue(tcCommandQueue *cq) {mpCommandQueue = cq;} |
|
From: Dewitt C. <ddc...@us...> - 2004-11-03 16:36:55
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15682/src/sim Modified Files: tcObjectControl.cpp Log Message: AI experimentation Index: tcObjectControl.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcObjectControl.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** tcObjectControl.cpp 2 Nov 2004 04:23:57 -0000 1.19 --- tcObjectControl.cpp 3 Nov 2004 16:36:44 -0000 1.20 *************** *** 1068,1074 **** } DrawRectangleR(rcurrent, color, FILL_ON); - color.set(0.4f, 1.0f, 0.4f, 1.0f); } s.Format("%.0f",afValue); //mpBrush->SetColor(0xFEFF8080); --- 1068,1075 ---- } DrawRectangleR(rcurrent, color, FILL_ON); } + color.set(0.4f, 1.0f, 0.4f, 1.0f); + s.Format("%.0f",afValue); //mpBrush->SetColor(0xFEFF8080); |
|
From: Dewitt C. <ddc...@us...> - 2004-11-03 16:36:55
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15682/src/graphics Modified Files: tcMapView.cpp Log Message: AI experimentation Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapView.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcMapView.cpp 2 Nov 2004 04:23:56 -0000 1.5 --- tcMapView.cpp 3 Nov 2004 16:36:43 -0000 1.6 *************** *** 1082,1085 **** --- 1082,1086 ---- symbol->addPrimitiveSet(new osg::DrawArrays(GL_LINE_STRIP,0,4)); + break; } case HOSTILE: *************** *** 1090,1093 **** --- 1091,1095 ---- symbol->addPrimitiveSet(new osg::DrawArrays(GL_LINE_STRIP,0,3)); + break; } default: *************** *** 1137,1140 **** --- 1139,1143 ---- vertices->push_back(osg::Vec3(-wu, 0, 0)); symbol->addPrimitiveSet(new osg::DrawArrays(GL_LINE_STRIP,0,4)); + break; } case HOSTILE: *************** *** 1144,1151 **** vertices->push_back(osg::Vec3(-w, 0, 0)); symbol->addPrimitiveSet(new osg::DrawArrays(GL_LINE_STRIP,0,3)); } default: { ! fprintf(stderr, "Error - tcTacticalMapView::DrawNTDSAirFW\n"); } } --- 1147,1155 ---- vertices->push_back(osg::Vec3(-w, 0, 0)); symbol->addPrimitiveSet(new osg::DrawArrays(GL_LINE_STRIP,0,3)); + break; } default: { ! fprintf(stderr, "Error - tcTacticalMapView::DrawNTDSAirRW\n"); } } *************** *** 1209,1212 **** --- 1213,1217 ---- vertices->push_back(osg::Vec3(2, w, 0)); symbol->addPrimitiveSet(new osg::DrawArrays(GL_LINES, v_idx, 4)); + break; } case HOSTILE: *************** *** 1223,1230 **** vertices->push_back(osg::Vec3(2, w-1, 0)); symbol->addPrimitiveSet(new osg::DrawArrays(GL_LINES, v_idx, 4)); } default: { ! fprintf(stderr, "Error - tcTacticalMapView::DrawNTDSAirFW\n"); } } --- 1228,1236 ---- vertices->push_back(osg::Vec3(2, w-1, 0)); symbol->addPrimitiveSet(new osg::DrawArrays(GL_LINES, v_idx, 4)); + break; } default: { ! fprintf(stderr, "Error - tcTacticalMapView::DrawNTDSMissile\n"); } } |
|
From: Dewitt C. <ddc...@us...> - 2004-11-03 16:36:54
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15682/src/scriptinterface Modified Files: tcPlatformInterface.cpp Log Message: AI experimentation Index: tcPlatformInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterface.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** tcPlatformInterface.cpp 16 Aug 2004 01:43:31 -0000 1.27 --- tcPlatformInterface.cpp 3 Nov 2004 16:36:44 -0000 1.28 *************** *** 373,378 **** } ! // return best launcher for target, best.mnLauncher set to -1 if ! // no compatible launchers or no target is selected tcLauncherInfo tcPlatformInterface::GetBestLauncher() { --- 373,380 ---- } ! /** ! * return best launcher for target, best.mnLauncher set to -1 if ! * no compatible launchers or no target is selected ! */ tcLauncherInfo tcPlatformInterface::GetBestLauncher() { *************** *** 884,889 **** wxASSERT(mpConsole); ! if (isPlatformOwnAlliance) mpConsole->Print(text.c_str()); ! } --- 886,900 ---- wxASSERT(mpConsole); ! if (isPlatformOwnAlliance) ! { ! mpConsole->Print(text.c_str()); ! fprintf(stdout, "* msg from platform:%d %s\n", mpPlatformObj->mnID, text.c_str()); ! } ! #ifdef _DEBUG ! else ! { ! fprintf(stdout, "* msg from OPFOR:%d %s\n", mpPlatformObj->mnID, text.c_str()); ! } ! #endif } |
|
From: Dewitt C. <ddc...@us...> - 2004-11-03 16:36:53
|
Update of /cvsroot/gcblue/gcb_wx/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15682/scripts Modified Files: AI.py Log Message: AI experimentation Index: AI.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/AI.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** AI.py 9 Aug 2004 02:35:14 -0000 1.12 --- AI.py 3 Nov 2004 16:36:43 -0000 1.13 *************** *** 65,71 **** UI.SetUpdate(30.0) # engage hostiles in range ! track_id = GetSuitableTarget(UI) ! if (track_id != -1): ! UI.SetTarget(track_id) UI.SetHeadingToInterceptTarget() UI.SetUpdate(4.0) --- 65,84 ---- UI.SetUpdate(30.0) # engage hostiles in range ! ! missile_score, missile_id = GetSuitableTargetAll(UI, 64) ! if (missile_score >= 3.0): ! best_id = missile_id ! else: ! surf_score, surf_id = GetSuitableTargetAll(UI, 16) ! air_score, air_id = GetSuitableTargetAll(UI, 32) ! ! if (air_score > surf_score): ! best_id = air_id ! else: ! best_id = surf_id ! ! #track_id = GetSuitableTarget(UI) ! if (best_id != -1): ! UI.SetTarget(best_id) UI.SetHeadingToInterceptTarget() UI.SetUpdate(4.0) *************** *** 269,274 **** UI.SetUpdate(10) ! ! def GetSuitableTarget(UI): --- 282,315 ---- UI.SetUpdate(10) ! # this version iterates through all tracks ! def GetSuitableTargetAll(UI, class_mask): ! # anAffiliation: UNKNOWN = 0, FRIENDLY = 1, NEUTRAL = 2, HOSTILE = 3 ! # ! # anClassMask: ! # PTYPE_SURFACE 0x0010 ! # PTYPE_AIR 0x0020 ! # PTYPE_MISSILE 0x0040 ! # PTYPE_SUBSURFACE 0x0080 ! # PTYPE_FIXED 0x0100 ! # int anClassMask, float afMaxRange_km, UINT8 anAffiliation ! track_list = UI.GetTrackList(class_mask, 150, 3) ! nTracks = track_list.Size() ! best_score = 0 ! best_target = -1 ! info_string = '' ! for n in range(0, nTracks): ! track_info = track_list.GetTrack(n) ! track_id = track_info.ID ! engaged_count = track_info.GetEngagedCount() ! UI.SetTarget(track_id) ! score = ScoreTarget(UI, track_info) ! if (score > best_score): ! best_score = score ! best_target = track_id ! ! info_string = '%s %d (%.1f %d)' % (info_string, track_id, score, engaged_count) ! ! UI.DisplayMessage('%d: %s\n' % (class_mask, info_string)) ! return (best_score, best_target) def GetSuitableTarget(UI): *************** *** 308,312 **** if target_id == -1: return ! # check if effective weapon is available target_info = UI.GetTargetTrackInfo() --- 349,353 ---- if target_id == -1: return ! # check if effective weapon is available target_info = UI.GetTargetTrackInfo() *************** *** 315,318 **** --- 356,361 ---- if (launcher == -1): # if (no effective launcher is available) return 0 + engaged_count = target_info.GetEngagedCount() + UI.DisplayMessage('target id: %d, engaged count: %d\n' % (target_id, engaged_count)) launch_range = launcher_info.Range_km # reference max range, use for launch decision target_range = UI.GetRangeToTarget() *************** *** 322,325 **** --- 365,393 ---- return 2 + def ScoreTarget(UI, target_info): + target_id = target_info.ID + if target_id == -1: + return + + # check if effective weapon is available + launcher_info = UI.GetBestLauncher() + launcher = launcher_info.Launcher + if (launcher == -1): # if (no effective launcher is available) + return 0 + engaged_count = target_info.GetEngagedCount() + if (engaged_count > 4): + return 0 + + launch_range = launcher_info.Range_km # reference max range, use for launch decision + target_range = UI.GetRangeToTarget() + if (target_range > launch_range): + score = 1 + 0.001 * (target_range - launch_range) + else: + score = 3 + 0.001 * target_range + + score = score * 0.2 * (5-engaged_count) + return score + + def InterceptTarget(UI): targetid = UI.GetTarget() *************** *** 341,345 **** # debug_file.close() ! if (target_info.GetEngagedCount() > 4): UI.SetTarget(-1) # clear target return --- 409,413 ---- # debug_file.close() ! if (target_info.GetEngagedCount() > 2): UI.SetTarget(-1) # clear target return *************** *** 378,382 **** launch_qty = 1 elif target_info.IsMissile(): ! launch_qty = 2 elif target_info.IsSurface(): launch_qty = 4 --- 446,450 ---- launch_qty = 1 elif target_info.IsMissile(): ! launch_qty = 1 elif target_info.IsSurface(): launch_qty = 4 |
|
From: Dewitt C. <ddc...@us...> - 2004-11-02 04:24:46
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8917/include/common Modified Files: tcSoundConsole.h Log Message: A few more changes related to GDI+ replacement Index: tcSoundConsole.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/tcSoundConsole.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcSoundConsole.h 29 Oct 2004 02:50:42 -0000 1.10 --- tcSoundConsole.h 2 Nov 2004 04:23:54 -0000 1.11 *************** *** 36,39 **** --- 36,40 ---- { public: + void Clear(); virtual void Draw(); tcConsoleBox* GetConsoleBox(); |
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8917/src/sim Modified Files: Game.cpp tcAIData.cpp tcAero.cpp tcAeroAirObject.cpp tcAirObject.cpp tcAirfieldObject.cpp tcBallisticWeapon.cpp tcCarrierObject.cpp tcCommandObject.cpp tcDemTileReader.cpp tcDirector.cpp tcDirectorEvent.cpp tcESMSensor.cpp tcEngagementData.cpp tcFlightOpsObject.cpp tcFlightPort.cpp tcGameObjIterator.cpp tcGameObject.cpp tcGoal.cpp tcGuidanceState.cpp tcHeloObject.cpp tcLaunchRequest.cpp tcLauncher.cpp tcLauncherState.cpp tcMapData.cpp tcMenu.cpp tcMissileObject.cpp tcObjectControl.cpp tcPlatformObject.cpp tcRadar.cpp tcSensorMap.cpp tcSensorState.cpp tcSimState.cpp tcSurfaceObject.cpp tcTime.cpp tcUserInfo.cpp tcWeaponObject.cpp Log Message: A few more changes related to GDI+ replacement Index: tcUserInfo.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcUserInfo.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcUserInfo.cpp 8 Aug 2004 00:31:35 -0000 1.4 --- tcUserInfo.cpp 2 Nov 2004 04:23:57 -0000 1.5 *************** *** 27,30 **** --- 27,34 ---- #include "tcUserInfo.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + UINT8 tcUserInfo::GetOwnAlliance(void) { Index: tcMissileObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMissileObject.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** tcMissileObject.cpp 14 Sep 2004 02:01:47 -0000 1.17 --- tcMissileObject.cpp 2 Nov 2004 04:23:57 -0000 1.18 *************** *** 21,24 **** --- 21,25 ---- */ + #include "stdwx.h" #include "tcMissileObject.h" #include "common/tcStream.h" *************** *** 31,34 **** --- 32,39 ---- #include "tc3DPoint.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + /** * Load state from update stream Index: tcSensorMap.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSensorMap.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcSensorMap.cpp 1 Nov 2004 03:17:18 -0000 1.11 --- tcSensorMap.cpp 2 Nov 2004 04:23:57 -0000 1.12 *************** *** 18,24 **** */ - #ifdef WX_PRECOMP #include "stdwx.h" - #endif #include "tcSensorMap.h" --- 18,22 ---- *************** *** 29,32 **** --- 27,34 ---- #include "common/tcObjStream.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + using namespace Sensor; Index: tcMenu.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMenu.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcMenu.cpp 1 Nov 2004 03:17:18 -0000 1.8 --- tcMenu.cpp 2 Nov 2004 04:23:57 -0000 1.9 *************** *** 30,33 **** --- 30,36 ---- #include <osg/Geometry> + #ifdef _DEBUG + #define new DEBUG_NEW + #endif using namespace std; Index: tcCommandObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcCommandObject.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcCommandObject.cpp 24 May 2004 00:14:47 -0000 1.1 --- tcCommandObject.cpp 2 Nov 2004 04:23:56 -0000 1.2 *************** *** 30,33 **** --- 30,37 ---- #include "common/tcObjStream.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + bool tcCommandObject::clientMode = false; Index: tcLaunchRequest.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcLaunchRequest.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcLaunchRequest.cpp 8 Aug 2004 00:31:35 -0000 1.2 --- tcLaunchRequest.cpp 2 Nov 2004 04:23:56 -0000 1.3 *************** *** 18,23 **** --- 18,28 ---- */ + #include "stdwx.h" #include "tcLaunchRequest.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + tcLaunchRequest& tcLaunchRequest::operator= (tcLaunchRequest& lr) { Index: tcESMSensor.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcESMSensor.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcESMSensor.cpp 14 Sep 2004 02:01:47 -0000 1.7 --- tcESMSensor.cpp 2 Nov 2004 04:23:56 -0000 1.8 *************** *** 18,21 **** --- 18,23 ---- */ + #include "stdwx.h" + #include "tcESMSensor.h" #include "aerror.h" *************** *** 25,28 **** --- 27,34 ---- #include "common/tcStream.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + /** * Index: tcObjectControl.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcObjectControl.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcObjectControl.cpp 14 Sep 2004 02:01:47 -0000 1.18 --- tcObjectControl.cpp 2 Nov 2004 04:23:57 -0000 1.19 *************** *** 1,6 **** ! /* ! ** tcObjectControl.cpp ! ** ! ** Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** ! ** @file tcObjectControl.cpp ! */ [...1818 lines suppressed...] { ! if (mpPen != NULL) {delete mpPen;} ! if (mpFont != NULL) {delete mpFont;} ! if (mpFontLarge != NULL) {delete mpFontLarge;} ! if (mpBrush != NULL) {delete mpBrush;} } --- 1619,1631 ---- mpUserInfo = NULL; msOCSymbolList.mnSymbols = 0; + + mpOptions = tcOptions::Get(); + InitControls(); } tcObjectControl::~tcObjectControl() { ! } Index: tcDemTileReader.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcDemTileReader.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcDemTileReader.cpp 24 Jun 2004 01:43:44 -0000 1.1 --- tcDemTileReader.cpp 2 Nov 2004 04:23:56 -0000 1.2 *************** *** 26,29 **** --- 26,33 ---- #include "tcDemTileReader.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + /** * Sets namestring to path + filename of 10 x 10 dem tile for northwest Index: tcTime.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcTime.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcTime.cpp 8 Aug 2004 00:31:35 -0000 1.7 --- tcTime.cpp 2 Nov 2004 04:23:57 -0000 1.8 *************** *** 27,30 **** --- 27,33 ---- #include "tcTime.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif /** Index: tcWeaponObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcWeaponObject.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcWeaponObject.cpp 14 Sep 2004 02:01:47 -0000 1.8 --- tcWeaponObject.cpp 2 Nov 2004 04:23:57 -0000 1.9 *************** *** 19,22 **** --- 19,23 ---- */ + #include "stdwx.h" // precompiled header file #include "tcWeaponObject.h" #include "tcGameObject.h" *************** *** 27,30 **** --- 28,34 ---- #include "common/tcObjStream.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif /** Index: tcAirfieldObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcAirfieldObject.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcAirfieldObject.cpp 9 Aug 2004 02:35:16 -0000 1.2 --- tcAirfieldObject.cpp 2 Nov 2004 04:23:56 -0000 1.3 *************** *** 20,23 **** --- 20,29 ---- */ + #include "stdwx.h" // precompiled header file + + #ifndef WX_PRECOMP + #include "wx/wx.h" + #endif + #include "tcAirfieldObject.h" #include "tcFlightOpsObject.h" *************** *** 25,28 **** --- 31,38 ---- #include "tcGenericDBObject.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + void tcAirfieldObject::Clear() { Index: tcAero.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcAero.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcAero.cpp 8 Aug 2004 00:31:35 -0000 1.5 --- tcAero.cpp 2 Nov 2004 04:23:56 -0000 1.6 *************** *** 18,21 **** --- 18,26 ---- */ + #include "stdwx.h" // precompiled header file + + #ifndef WX_PRECOMP + #include "wx/wx.h" + #endif #include "tcAero.h" *************** *** 24,27 **** --- 29,36 ---- #include "common/tcStream.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + namespace Aero { Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.102 retrieving revision 1.103 diff -C2 -d -r1.102 -r1.103 *** Game.cpp 1 Nov 2004 03:17:18 -0000 1.102 --- Game.cpp 2 Nov 2004 04:23:56 -0000 1.103 *************** *** 950,954 **** objectControl->AttachCommandInterface(&mcCommandQueue); objectControl->AttachSimState(simState); - objectControl->AttachOptions(tcOptions::Get()); objectControl->AttachUserInfo(&mcUserInfo); --- 950,953 ---- *************** *** 1050,1053 **** --- 1049,1057 ---- popupControl = 0; + tacticalMap->ClearMapObjects(); + worldMap->ClearMapObjects(); + + briefingConsoleLeft->Clear(); + tcCustomControl::ReleaseGdi(); } Index: tcDirector.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcDirector.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcDirector.cpp 7 Oct 2004 22:01:47 -0000 1.9 --- tcDirector.cpp 2 Nov 2004 04:23:56 -0000 1.10 *************** *** 34,37 **** --- 34,40 ---- #include "wxcommands.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif /** Index: tcDirectorEvent.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcDirectorEvent.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcDirectorEvent.cpp 21 Oct 2004 04:11:00 -0000 1.11 --- tcDirectorEvent.cpp 2 Nov 2004 04:23:56 -0000 1.12 *************** *** 38,41 **** --- 38,45 ---- #include <osg/Vec3> // tc3DTextEvent + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + using MapView::tcMapView; *************** *** 90,93 **** --- 94,98 ---- tcMapEvent::~tcMapEvent() { + if (mapObject) delete mapObject; } Index: tcMapData.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMapData.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcMapData.cpp 14 Sep 2004 02:01:47 -0000 1.13 --- tcMapData.cpp 2 Nov 2004 04:23:57 -0000 1.14 *************** *** 20,26 **** */ - #ifdef WX_PRECOMP #include "stdwx.h" - #endif #include "tcMapData.h" --- 20,24 ---- *************** *** 31,34 **** --- 29,36 ---- #include "tcDemTileReader.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + /********************************************************************/ /** Index: tcAIData.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcAIData.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcAIData.cpp 8 Aug 2004 00:31:35 -0000 1.6 --- tcAIData.cpp 2 Nov 2004 04:23:56 -0000 1.7 *************** *** 18,26 **** */ - #include "wx/wx.h" - #include "wx/msw/private.h" // for MS Windows specific definitions #include "tcAIData.h" using namespace std; using namespace AI; --- 18,33 ---- */ + #include "stdwx.h" // precompiled header file + + #ifndef WX_PRECOMP + #include "wx/wx.h" + #endif #include "tcAIData.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + using namespace std; using namespace AI; Index: tcAeroAirObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcAeroAirObject.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcAeroAirObject.cpp 8 Aug 2004 00:31:35 -0000 1.6 --- tcAeroAirObject.cpp 2 Nov 2004 04:23:56 -0000 1.7 *************** *** 31,34 **** --- 31,38 ---- #include "math_constants.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + using namespace Database; Index: tcCarrierObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcCarrierObject.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcCarrierObject.cpp 18 Jul 2004 03:18:01 -0000 1.8 --- tcCarrierObject.cpp 2 Nov 2004 04:23:56 -0000 1.9 *************** *** 17,20 **** --- 17,25 ---- ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include "stdwx.h" + + #ifndef WX_PRECOMP + #include "wx/wx.h" + #endif #include "tcCarrierObject.h" *************** *** 24,27 **** --- 29,35 ---- #include "tcFlightOpsObject.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif Index: tcFlightPort.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcFlightPort.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcFlightPort.cpp 14 Sep 2004 02:01:47 -0000 1.11 --- tcFlightPort.cpp 2 Nov 2004 04:23:56 -0000 1.12 *************** *** 24,30 **** #ifndef WX_PRECOMP #include "wx/wx.h" - #ifdef WIN32 - #include "wx/msw/private.h" // for MS Windows specific definitions - #endif #endif --- 24,27 ---- *************** *** 36,39 **** --- 33,39 ---- #include "tcGenericDBObject.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif //---------------------------------------------------------------------------- *************** *** 580,582 **** --- 580,583 ---- tcFlightPort::~tcFlightPort() { + Clear(); } \ No newline at end of file Index: tcHeloObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcHeloObject.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcHeloObject.cpp 9 Aug 2004 02:35:17 -0000 1.1 --- tcHeloObject.cpp 2 Nov 2004 04:23:56 -0000 1.2 *************** *** 29,33 **** #include "tcGenericDBObject.h" ! void tcHeloObject::Clear() --- 29,35 ---- #include "tcGenericDBObject.h" ! #ifdef _DEBUG ! #define new DEBUG_NEW ! #endif void tcHeloObject::Clear() Index: tcGuidanceState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcGuidanceState.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcGuidanceState.cpp 8 Aug 2004 00:31:35 -0000 1.3 --- tcGuidanceState.cpp 2 Nov 2004 04:23:56 -0000 1.4 *************** *** 18,24 **** --- 18,30 ---- */ + #include "stdwx.h" // precompiled header file + #include "tcGuidanceState.h" #include "common/tcStream.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + /** * Index: tcAirObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcAirObject.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcAirObject.cpp 9 Aug 2004 02:35:16 -0000 1.11 --- tcAirObject.cpp 2 Nov 2004 04:23:56 -0000 1.12 *************** *** 30,33 **** --- 30,37 ---- #include "common/tcObjStream.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + /******************************************************************************/ /****************************** tcAirObject *******************************/ Index: tcEngagementData.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcEngagementData.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcEngagementData.cpp 8 Aug 2004 00:31:35 -0000 1.2 --- tcEngagementData.cpp 2 Nov 2004 04:23:56 -0000 1.3 *************** *** 21,24 **** --- 21,28 ---- #include "tcEngagementData.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + tcEngagementData::tcEngagementData() { Index: tcLauncher.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcLauncher.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcLauncher.cpp 5 Aug 2004 02:22:35 -0000 1.4 --- tcLauncher.cpp 2 Nov 2004 04:23:56 -0000 1.5 *************** *** 19,22 **** --- 19,23 ---- */ + #include "stdwx.h" // precompiled header file #include "tcLauncher.h" #include "tcDatabase.h" *************** *** 29,32 **** --- 30,37 ---- #include "common/tcObjStream.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + /** * Index: tcGoal.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcGoal.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcGoal.cpp 5 Sep 2004 02:38:45 -0000 1.5 --- tcGoal.cpp 2 Nov 2004 04:23:56 -0000 1.6 *************** *** 36,39 **** --- 36,42 ---- using namespace boost::python; + #ifdef _DEBUG + #define new DEBUG_NEW + #endif /** * Not sure how to best package this. Index: tcPlatformObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcPlatformObject.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** tcPlatformObject.cpp 6 Sep 2004 01:08:04 -0000 1.29 --- tcPlatformObject.cpp 2 Nov 2004 04:23:57 -0000 1.30 *************** *** 37,40 **** --- 37,44 ---- #include "common/tcObjStream.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + using namespace AI; Index: tcGameObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcGameObject.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** tcGameObject.cpp 14 Sep 2004 02:01:47 -0000 1.22 --- tcGameObject.cpp 2 Nov 2004 04:23:56 -0000 1.23 *************** *** 32,35 **** --- 32,38 ---- #include "common/tcObjStream.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif /** Index: tcBallisticWeapon.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcBallisticWeapon.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcBallisticWeapon.cpp 12 Aug 2004 01:14:28 -0000 1.5 --- tcBallisticWeapon.cpp 2 Nov 2004 04:23:56 -0000 1.6 *************** *** 21,24 **** --- 21,30 ---- */ + #include "stdwx.h" + + #ifndef WX_PRECOMP + #include "wx/wx.h" + #endif + #include "tcBallisticWeapon.h" #include "tcBallisticDBObject.h" *************** *** 32,35 **** --- 38,45 ---- #include "tc3DPoint.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + /** * Load state from update stream Index: tcSimState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSimState.cpp,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** tcSimState.cpp 14 Sep 2004 02:01:47 -0000 1.54 --- tcSimState.cpp 2 Nov 2004 04:23:57 -0000 1.55 *************** *** 50,53 **** --- 50,57 ---- #include "common/tcStream.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + using namespace Database; using namespace Aero; Index: tcFlightOpsObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcFlightOpsObject.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcFlightOpsObject.cpp 14 Sep 2004 02:01:47 -0000 1.4 --- tcFlightOpsObject.cpp 2 Nov 2004 04:23:56 -0000 1.5 *************** *** 21,24 **** --- 21,25 ---- */ + #include "stdwx.h" #include "tcFlightOpsObject.h" *************** *** 30,33 **** --- 31,39 ---- #include "tcFlightportDBObject.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + + Database::tcDatabase* tcFlightOpsObject::database = 0; Index: tcSensorState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSensorState.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcSensorState.cpp 8 Aug 2004 00:31:35 -0000 1.10 --- tcSensorState.cpp 2 Nov 2004 04:23:57 -0000 1.11 *************** *** 18,21 **** --- 18,22 ---- */ + #include "stdwx.h" #include "tcSensorState.h" #include "aerror.h" *************** *** 24,27 **** --- 25,32 ---- #include "common/tcObjStream.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + tcSimState* tcSensorState::simState = NULL; Index: tcSurfaceObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSurfaceObject.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcSurfaceObject.cpp 8 Aug 2004 00:31:35 -0000 1.12 --- tcSurfaceObject.cpp 2 Nov 2004 04:23:57 -0000 1.13 *************** *** 31,34 **** --- 31,37 ---- #include "tc3DModel.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif /******************************************************************************/ Index: tcLauncherState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcLauncherState.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** tcLauncherState.cpp 1 Nov 2004 03:17:18 -0000 1.19 --- tcLauncherState.cpp 2 Nov 2004 04:23:56 -0000 1.20 *************** *** 20,23 **** --- 20,24 ---- */ + #include "stdwx.h" #include "tcLauncherState.h" #include "tcLauncher.h" *************** *** 33,36 **** --- 34,41 ---- #include "Game.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + tcDatabase* tcLauncherState::mpDatabase = NULL; tcSimState* tcLauncherState::simState = NULL; Index: tcRadar.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcRadar.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcRadar.cpp 1 Nov 2004 03:17:18 -0000 1.13 --- tcRadar.cpp 2 Nov 2004 04:23:57 -0000 1.14 *************** *** 18,21 **** --- 18,22 ---- */ + #include "stdwx.h" #include "aerror.h" #include "nsNav.h" *************** *** 34,37 **** --- 35,42 ---- #include "common/tcObjStream.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + // break up this file later Index: tcGameObjIterator.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcGameObjIterator.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcGameObjIterator.cpp 8 Aug 2004 00:31:35 -0000 1.4 --- tcGameObjIterator.cpp 2 Nov 2004 04:23:56 -0000 1.5 *************** *** 32,35 **** --- 32,39 ---- #include "tcSimState.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + tcSimState* tcGameObjIterator::simState = NULL; |
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8917/src/graphics Modified Files: ObjectUpdater.cpp SmokeTrailEmitter.cpp cspColorspace.cpp cspSky.cpp tc2DGraphicsSurface.cpp tc3DWindow.cpp tcButton.cpp tcConsoleBox.cpp tcCreditView.cpp tcDisplayModes.cpp tcDisplaySettingsView.cpp tcEditBox.cpp tcFIFO.cpp tcGameView.cpp tcHookInfo.cpp tcMapObject.cpp tcMapView.cpp tcOOBView.cpp tcPanel.cpp tcParticleEffect.cpp tcPopupControl.cpp tcRadioButton.cpp tcScenarioSelectView.cpp tcStartView.cpp tcTerrainView.cpp tcXmlWindow.cpp Log Message: A few more changes related to GDI+ replacement Index: tcStartView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcStartView.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcStartView.cpp 1 Nov 2004 03:17:18 -0000 1.4 --- tcStartView.cpp 2 Nov 2004 04:23:56 -0000 1.5 *************** *** 37,40 **** --- 37,43 ---- #include "wxcommands.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif bool tcStartView::Init() Index: tcPanel.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcPanel.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcPanel.cpp 1 Nov 2004 03:17:18 -0000 1.4 --- tcPanel.cpp 2 Nov 2004 04:23:56 -0000 1.5 *************** *** 28,32 **** #include "tcPanel.h" ! tc3DWindow* tcPanel::parentWindow = 0; --- 28,34 ---- #include "tcPanel.h" ! #ifdef _DEBUG ! #define new DEBUG_NEW ! #endif tc3DWindow* tcPanel::parentWindow = 0; Index: cspColorspace.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/cspColorspace.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** cspColorspace.cpp 4 Dec 2003 22:31:52 -0000 1.1 --- cspColorspace.cpp 2 Nov 2004 04:23:56 -0000 1.2 *************** *** 38,41 **** --- 38,45 ---- #include <cstdio> + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + float const PI = 3.14159265358979323846264338327950288419716939937510f; Index: tcRadioButton.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcRadioButton.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcRadioButton.cpp 7 Oct 2004 22:01:46 -0000 1.7 --- tcRadioButton.cpp 2 Nov 2004 04:23:56 -0000 1.8 *************** *** 35,38 **** --- 35,41 ---- #include <iostream> + #ifdef _DEBUG + #define new DEBUG_NEW + #endif BEGIN_EVENT_TABLE(tcRadioButton, tc3DWindow) Index: tcHookInfo.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcHookInfo.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcHookInfo.cpp 29 Oct 2004 02:50:53 -0000 1.3 --- tcHookInfo.cpp 2 Nov 2004 04:23:56 -0000 1.4 *************** *** 37,40 **** --- 37,43 ---- #include "simmath.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif Index: tcScenarioSelectView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcScenarioSelectView.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcScenarioSelectView.cpp 21 Oct 2004 04:10:59 -0000 1.5 --- tcScenarioSelectView.cpp 2 Nov 2004 04:23:56 -0000 1.6 *************** *** 38,42 **** #include "common/tinyxml.h" ! --- 38,44 ---- #include "common/tinyxml.h" ! #ifdef _DEBUG ! #define new DEBUG_NEW ! #endif Index: tcXmlWindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcXmlWindow.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcXmlWindow.cpp 21 Oct 2004 04:10:59 -0000 1.4 --- tcXmlWindow.cpp 2 Nov 2004 04:23:56 -0000 1.5 *************** *** 32,35 **** --- 32,38 ---- #include <iostream> + #ifdef _DEBUG + #define new DEBUG_NEW + #endif unsigned tcXmlWindow::ref_count = 0; Index: tcOOBView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcOOBView.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcOOBView.cpp 1 Nov 2004 03:17:18 -0000 1.3 --- tcOOBView.cpp 2 Nov 2004 04:23:56 -0000 1.4 *************** *** 32,35 **** --- 32,39 ---- #include "tcSound.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + using namespace MapView; *************** *** 324,328 **** if (info.mbRadiating) { ! color.set(0.4f, 1, 0.4f, 0.5f); //graphics->FillEllipse(mpBrush, info.remcon); DrawRectangleR(info.remcon, color, FILL_ON); --- 328,332 ---- if (info.mbRadiating) { ! color.set(0.4f, 1.0f, 0.4f, 0.5f); //graphics->FillEllipse(mpBrush, info.remcon); DrawRectangleR(info.remcon, color, FILL_ON); Index: tcGameView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcGameView.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcGameView.cpp 1 Nov 2004 03:17:18 -0000 1.2 --- tcGameView.cpp 2 Nov 2004 04:23:56 -0000 1.3 *************** *** 38,41 **** --- 38,44 ---- #include "tcMissileObject.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif //* #include "tc3DScene.h" Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapView.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcMapView.cpp 1 Nov 2004 03:17:18 -0000 1.4 --- tcMapView.cpp 2 Nov 2004 04:23:56 -0000 1.5 *************** *** 50,53 **** --- 50,56 ---- using namespace MapView; + #ifdef _DEBUG + #define new DEBUG_NEW + #endif *************** *** 1524,1553 **** else if (type == SYMBOL_PIE) { float width,height; width = GeoExtentToScreen(pMO->mfLonExtent); height = GeoExtentToScreen(pMO->mfLatExtent); ! ! if (mpOptions->mbFillRangeCircles) { ! // graphics->FillPie(mpBrush,pscreen.x-0.5f*width,pscreen.y-0.5f*height, ! // width,height,h-0.5f*pMO->mfArc_deg-90.0f,pMO->mfArc_deg); // h is in degrees (fix this) ! //DrawRectangleR(pscreen.x-0.5f*width, pscreen.y-0.5f*height, width, height, symbolColor); ! } ! else { ! if (pMO->mfArc_deg >= 360.0f) ! { ! //graphics->DrawEllipse(mpPen,pscreen.x-0.5f*width,pscreen.y-0.5f*height, ! // width,height); ! //DrawRectangleR(pscreen.x-0.5f*width, pscreen.y-0.5f*height, width, height, symbolColor); ! } ! else ! { ! //graphics->DrawPie(mpPen,pscreen.x-0.5f*width,pscreen.y-0.5f*height, ! // width,height,h-0.5f*pMO->mfArc_deg-90.0f,pMO->mfArc_deg); // h is in degrees (fix this) ! //DrawRectangleR(pscreen.x-0.5f*width, pscreen.y-0.5f*height, width, height, symbolColor); ! } ! } } else --- 1527,1552 ---- else if (type == SYMBOL_PIE) { + symbolColor._v[3] = 0.35f; + float width,height; width = GeoExtentToScreen(pMO->mfLonExtent); height = GeoExtentToScreen(pMO->mfLatExtent); ! int fillMode = (mpOptions->mbFillRangeCircles) ? FILL_ON : FILL_OFF; ! ! osg::Geometry* rangeCircle; ! if (pMO->mfArc_deg >= 360.0f) { ! rangeCircle = CreatePieGeometry(width, height, -180, 180, ! symbolColor, fillMode); ! } ! else { ! float halfArc = 0.5f*pMO->mfArc_deg; ! rangeCircle = CreatePieGeometry(width, height, h-halfArc, h+halfArc, ! symbolColor, fillMode); ! } ! DrawGeometryR(rangeCircle, pscreen.x, pscreen.y); ! } else Index: tcPopupControl.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcPopupControl.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcPopupControl.cpp 1 Nov 2004 03:17:18 -0000 1.4 --- tcPopupControl.cpp 2 Nov 2004 04:23:56 -0000 1.5 *************** *** 30,33 **** --- 30,37 ---- #include "tcSimPythonInterface.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + using namespace ScriptInterface; Index: tcParticleEffect.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcParticleEffect.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcParticleEffect.cpp 7 Oct 2004 22:01:46 -0000 1.3 --- tcParticleEffect.cpp 2 Nov 2004 04:23:56 -0000 1.4 *************** *** 49,52 **** --- 49,56 ---- #include "tcParticlePlacer.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + ////////////////////////////////////////////////////////////////////////////// // CUSTOM OPERATOR CLASS Index: ObjectUpdater.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/ObjectUpdater.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ObjectUpdater.cpp 14 Sep 2004 02:01:46 -0000 1.9 --- ObjectUpdater.cpp 2 Nov 2004 04:23:56 -0000 1.10 *************** *** 6,9 **** --- 6,13 ---- #include "tcParticleEffect.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + using namespace osg; Index: tc3DWindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DWindow.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tc3DWindow.cpp 1 Nov 2004 03:17:18 -0000 1.8 --- tc3DWindow.cpp 2 Nov 2004 04:23:56 -0000 1.9 *************** *** 49,52 **** --- 49,56 ---- #include "tc3DViewer.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + BEGIN_EVENT_TABLE(tc3DWindow, wxWindow) *************** *** 72,75 **** --- 76,80 ---- tc3DViewer* tc3DWindow::viewer = 0; + /** * This override along with use of Freeze() Thaw() prevents *************** *** 419,423 **** --- 424,515 ---- + /** + * Creates default osg::Geometry object + */ + osg::Geometry* tc3DWindow::CreateDefaultGeometry() + { + osg::Geometry* symbol = new osg::Geometry; + + symbol->setUseDisplayList(true); + + // set state + osg::StateSet* stateSet = symbol->getOrCreateStateSet(); + stateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF); + stateSet->setMode(GL_DEPTH_WRITEMASK, osg::StateAttribute::OFF); + stateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF); + stateSet->setMode(GL_BLEND, osg::StateAttribute::ON); + stateSet->setRenderBinDetails(baseRenderBin + rectRenderBin, "RenderBin"); + + return symbol; + } + + /** + * Angle of zero is up, angle increases in clockwise direction + * startAngle must be less than stopAngle (can use negative angles) + * @param startAngle in degrees + * @param stopAngle in degrees + */ + osg::Geometry* tc3DWindow::CreatePieGeometry(float width, float height, float startAngle, float stopAngle, + osg::Vec4& color, int fillMode) + { + unsigned int nArcPoints = 48; + + wxASSERT(startAngle < stopAngle); + wxASSERT(nArcPoints > 1); + + osg::Geometry* symbol = CreateDefaultGeometry(); + + // set color + osg::Vec4Array* colors = new osg::Vec4Array; + colors->push_back(color); + symbol->setColorArray(colors); + symbol->setColorBinding(osg::Geometry::BIND_OVERALL); + + // create vertex array + osg::Vec3Array* vertices = new osg::Vec3Array; + symbol->setVertexArray(vertices); + + bool fullCircle = ((stopAngle - startAngle) >= 359.9f); + + startAngle *= C_PIOVER180; + stopAngle *= C_PIOVER180; + + float deltaAngle = (stopAngle - startAngle) / float(nArcPoints-1); + float half_width = 0.5f * width; + float half_height = 0.5f * height; + float xc = 0; + float yc = 0; + + float angle = stopAngle; + + // add center point if not full circle + if (!fullCircle) + { + vertices->push_back(osg::Vec3(xc, yc, 0)); + } + for (unsigned int n = 0; n < nArcPoints; n++) + { + float x = xc + half_width * sinf(angle); + float y = yc + half_height * cosf(angle); + + vertices->push_back(osg::Vec3(x, y, 0)); + angle -= deltaAngle; + } + + unsigned int nPoints = vertices->size(); + + + if (fillMode == FILL_OFF) + { + symbol->addPrimitiveSet(new osg::DrawArrays(GL_LINE_LOOP, 0, nPoints)); + } + else + { + symbol->addPrimitiveSet(new osg::DrawArrays(GL_TRIANGLE_FAN, 0, nPoints)); + } + + return symbol; + } /** * *************** *** 863,866 **** --- 955,960 ---- } + + /** * There wasn't a direct replacement for the GDI+ version of this. Index: tcConsoleBox.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcConsoleBox.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcConsoleBox.cpp 1 Nov 2004 03:17:18 -0000 1.10 --- tcConsoleBox.cpp 2 Nov 2004 04:23:56 -0000 1.11 *************** *** 29,32 **** --- 29,35 ---- #include <iostream> + #ifdef _DEBUG + #define new DEBUG_NEW + #endif void tcConsoleBox::OnSize(wxSizeEvent& event) Index: tcTerrainView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcTerrainView.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcTerrainView.cpp 2 Oct 2004 22:41:33 -0000 1.1 --- tcTerrainView.cpp 2 Nov 2004 04:23:56 -0000 1.2 *************** *** 34,37 **** --- 34,41 ---- #include "tcOptions.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + using namespace Gdiplus; Index: tcFIFO.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcFIFO.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcFIFO.cpp 8 Aug 2004 00:31:34 -0000 1.4 --- tcFIFO.cpp 2 Nov 2004 04:23:56 -0000 1.5 *************** *** 18,24 **** --- 18,32 ---- */ + #include "stdwx.h" // precompiled header file + + #ifndef WX_PRECOMP + #include "wx/wx.h" + #endif #include "tcFIFO.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif bool tcFIFO::GetIndex(UINT16& rnNewIndex) { Index: tcMapObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapObject.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcMapObject.cpp 21 Oct 2004 04:10:59 -0000 1.5 --- tcMapObject.cpp 2 Nov 2004 04:23:56 -0000 1.6 *************** *** 33,36 **** --- 33,40 ---- #include "simmath.h" + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + using MapView::tcMapView; Index: tcCreditView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcCreditView.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcCreditView.cpp 1 Nov 2004 03:17:18 -0000 1.7 --- tcCreditView.cpp 2 Nov 2004 04:23:56 -0000 1.8 *************** *** 36,40 **** #include "tcTime.h" ! void tcCreditView::AddCredit(tcString& s, float afTrailSpace, int effect) --- 36,42 ---- #include "tcTime.h" ! #ifdef _DEBUG ! #define new DEBUG_NEW ! #endif void tcCreditView::AddCredit(tcString& s, float afTrailSpace, int effect) Index: tcEditBox.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcEditBox.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcEditBox.cpp 7 Oct 2004 22:01:46 -0000 1.8 --- tcEditBox.cpp 2 Nov 2004 04:23:56 -0000 1.9 *************** *** 33,36 **** --- 33,39 ---- #include <iostream> + #ifdef _DEBUG + #define new DEBUG_NEW + #endif /* BEGIN_EVENT_TABLE(tcEditBox, tcWindow) Index: cspSky.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/cspSky.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** cspSky.cpp 26 Jul 2004 01:44:40 -0000 1.11 --- cspSky.cpp 2 Nov 2004 04:23:56 -0000 1.12 *************** *** 72,75 **** --- 72,79 ---- + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + using namespace osg; using UnitConversions::toRadians; *************** *** 1112,1117 **** } ! Sky::~Sky() { delete[] m_lev; } --- 1116,1125 ---- } ! Sky::~Sky() ! { delete[] m_lev; + + m_HorizonColors->clear(); // can't delete, still leaks + } Index: tcDisplaySettingsView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcDisplaySettingsView.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcDisplaySettingsView.cpp 1 Nov 2004 03:17:18 -0000 1.6 --- tcDisplaySettingsView.cpp 2 Nov 2004 04:23:56 -0000 1.7 *************** *** 28,32 **** #include "wxcommands.h" ! /*******************************************************************************/ --- 28,34 ---- #include "wxcommands.h" ! #ifdef _DEBUG ! #define new DEBUG_NEW ! #endif /*******************************************************************************/ Index: tcButton.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcButton.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcButton.cpp 21 Oct 2004 04:10:59 -0000 1.13 --- tcButton.cpp 2 Nov 2004 04:23:56 -0000 1.14 *************** *** 37,45 **** #include <iostream> ! /* ! Gdiplus::Pen* tcButton::pen = NULL; ! Gdiplus::SolidBrush* tcButton::brush = NULL; ! Gdiplus::Font* tcButton::font = NULL; ! */ unsigned tcButton::ref_count = 0; --- 37,45 ---- #include <iostream> ! #ifdef _DEBUG ! #define new DEBUG_NEW ! #endif ! ! unsigned tcButton::ref_count = 0; Index: tc2DGraphicsSurface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc2DGraphicsSurface.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tc2DGraphicsSurface.cpp 8 Aug 2004 00:31:34 -0000 1.10 --- tc2DGraphicsSurface.cpp 2 Nov 2004 04:23:56 -0000 1.11 *************** *** 32,35 **** --- 32,36 ---- #include "tcString.h" + using namespace Gdiplus; Index: tcDisplayModes.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcDisplayModes.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcDisplayModes.cpp 10 Jul 2004 01:51:16 -0000 1.2 --- tcDisplayModes.cpp 2 Nov 2004 04:23:56 -0000 1.3 *************** *** 28,32 **** #include "tcOptions.h" ! /** --- 28,34 ---- #include "tcOptions.h" ! #ifdef _DEBUG ! #define new DEBUG_NEW ! #endif /** Index: SmokeTrailEmitter.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/SmokeTrailEmitter.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SmokeTrailEmitter.cpp 1 Sep 2004 02:55:36 -0000 1.1 --- SmokeTrailEmitter.cpp 2 Nov 2004 04:23:56 -0000 1.2 *************** *** 1,5 **** --- 1,36 ---- + /** + ** @file SmokeTrailEmitter.cpp + */ + /* Copyright (C) 2004 Dewitt Colclough (de...@tw...) + ** All rights reserved. + + ** This file is part of the Global Conflict Blue (GCB) program. + ** GCB is free software; you can redistribute it and/or modify + ** it under the terms of version 2 of the GNU General Public License as + ** published by the Free Software Foundation. + + ** GCB is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + + ** You should have received a copy of the GNU General Public License + ** along with GCB; if not, write to the Free Software + ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + #include "stdwx.h" // precompiled header file + + #ifndef WX_PRECOMP + #include "wx/wx.h" + #endif + #include <graphics/SmokeTrailEmitter.h> #include <osgParticle/Emitter> + #ifdef _DEBUG + #define new DEBUG_NEW + #endif + //#pragma warning (disable: 4273) // inconsistent dll linkage |