[Gcblue-commits] gcb_wx/src/sim Game.cpp,1.94,1.95 tc3DViewer.cpp,1.35,1.36 tcDirector.cpp,1.7,1.8 t
Status: Alpha
Brought to you by:
ddcforge
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14891/src/sim Modified Files: Game.cpp tc3DViewer.cpp tcDirector.cpp tcDirectorEvent.cpp tcESMSensor.cpp tcFlightOpsObject.cpp tcFlightPort.cpp tcGameObject.cpp tcGameView.cpp tcLauncherState.cpp tcMapData.cpp tcMapView.cpp tcMissileObject.cpp tcOOBView.cpp tcObjectControl.cpp tcRadar.cpp tcSensorMap.cpp tcSimState.cpp tcWeaponObject.cpp Log Message: Index: tcMissileObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMissileObject.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tcMissileObject.cpp 6 Aug 2004 02:47:52 -0000 1.16 --- tcMissileObject.cpp 14 Sep 2004 02:01:47 -0000 1.17 *************** *** 233,237 **** float dp_rad,dp_min,dp_max; dp_rad = mfGoalPitch_rad - mcKin.mfPitch_rad; ! dp_max = 0.524f*dt_s; // 30 deg/s pitch rate, hard coded for now dp_min = -dp_max; if (dp_rad < dp_min) {dp_rad = dp_min;} --- 233,237 ---- float dp_rad,dp_min,dp_max; dp_rad = mfGoalPitch_rad - mcKin.mfPitch_rad; ! dp_max = 1.05f*dt_s; // 60 deg/s pitch rate, hard coded for now dp_min = -dp_max; if (dp_rad < dp_min) {dp_rad = dp_min;} *************** *** 293,297 **** } if (guidanceStatusTime == 0) {guidanceStatusTime = afStatusTime;} ! float dt_s = (float)(afStatusTime - guidanceStatusTime); guidanceStatusTime = afStatusTime; mfLastGuidanceUpdate = msKState.mfFlightTime; --- 293,297 ---- } if (guidanceStatusTime == 0) {guidanceStatusTime = afStatusTime;} ! // float dt_s = (float)(afStatusTime - guidanceStatusTime); guidanceStatusTime = afStatusTime; mfLastGuidanceUpdate = msKState.mfFlightTime; *************** *** 421,433 **** if (msKState.mfAltitude_m < fGoalAltitude_m - MISSILE_ACZ) { ! mfGoalPitch_rad = 1.0f; } else if (msKState.mfAltitude_m > fGoalAltitude_m + MISSILE_ACZ) { ! mfGoalPitch_rad = -1.0f; } else { ! mfGoalPitch_rad = 0.1f*(fGoalAltitude_m-msKState.mfAltitude_m)/MISSILE_ACZ; } } --- 421,433 ---- if (msKState.mfAltitude_m < fGoalAltitude_m - MISSILE_ACZ) { ! mfGoalPitch_rad = 0.7f; } else if (msKState.mfAltitude_m > fGoalAltitude_m + MISSILE_ACZ) { ! mfGoalPitch_rad = -0.7f; } else { ! mfGoalPitch_rad = 0.7f*(fGoalAltitude_m-msKState.mfAltitude_m)/MISSILE_ACZ; } } *************** *** 444,448 **** // force level flight for first few seconds for air-launched missiles ! if ((msKState.mfFlightTime < 3.0)&&(msKState.mfAltitude_m > 50.0f)) { mfGoalHeading_rad = mcKin.mfHeading_rad; --- 444,448 ---- // force level flight for first few seconds for air-launched missiles ! if ((msKState.mfFlightTime < 1.5)&&(msKState.mfAltitude_m > 50.0f)) { mfGoalHeading_rad = mcKin.mfHeading_rad; *************** *** 612,615 **** --- 612,616 ---- mfGuidanceUpdateInterval = 0.5f; mnCurrentSegment = 0; + mfRangeToObjective_km = 9999.0f; mfGoalPitch_rad = 0.01f; } *************** *** 648,651 **** --- 649,653 ---- guidanceStatusTime = 0; mfInterceptTime = 9999.0f; + mfRangeToObjective_km = 9999.0f; // if these inits are missing, causes a crash with time accel after missile launch Index: tcSensorMap.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSensorMap.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcSensorMap.cpp 8 Aug 2004 00:31:35 -0000 1.9 --- tcSensorMap.cpp 14 Sep 2004 02:01:47 -0000 1.10 *************** *** 207,216 **** // search for existing match ! for(int n=0;n<mnContributors;n++) { tcSensorReport *pSensorReport = &maSensorReport[n]; ! if (pSensorReport->mnFlags & (TRACK_BEARING_ONLY|TRACK_TRIANGULATED)) { ! int nPassiveIdx = n; } ! else if (pSensorReport->mnSensorPlatformID == anSensorID) { rpReport = pSensorReport; return true; --- 207,219 ---- // search for existing match ! for(int n=0; n<mnContributors; n++) ! { tcSensorReport *pSensorReport = &maSensorReport[n]; ! if (pSensorReport->mnFlags & (TRACK_BEARING_ONLY|TRACK_TRIANGULATED)) ! { ! nPassiveIdx = n; // used to have "int nPassiveIdx = n;" here !? } ! else if (pSensorReport->mnSensorPlatformID == anSensorID) ! { rpReport = pSensorReport; return true; *************** *** 241,245 **** bool tcSensorMapTrack::UpdatePassiveReport(Sensor::tcSensorReport*& rpReport, tnPoolIndex anSensorID) { ! int nPassiveIdx = -1; // if track already has active data then do not update with passive data --- 244,248 ---- bool tcSensorMapTrack::UpdatePassiveReport(Sensor::tcSensorReport*& rpReport, tnPoolIndex anSensorID) { ! //int nPassiveIdx = -1; // if track already has active data then do not update with passive data *************** *** 247,251 **** // search for existing match ! for(int n=0;n<mnContributors;n++) { tcSensorReport *pSensorReport = &maSensorReport[n]; if ((pSensorReport->mnFlags & (TRACK_BEARING_ONLY|TRACK_TRIANGULATED))&& --- 250,255 ---- // search for existing match ! for(int n=0;n<mnContributors;n++) ! { tcSensorReport *pSensorReport = &maSensorReport[n]; if ((pSensorReport->mnFlags & (TRACK_BEARING_ONLY|TRACK_TRIANGULATED))&& *************** *** 258,262 **** // add new report if there is room ! if (mnContributors < MAX_SENSOR_REPORTS) { tcSensorReport *pSensorReport = &maSensorReport[mnContributors++]; pSensorReport->Clear(); --- 262,267 ---- // add new report if there is room ! if (mnContributors < MAX_SENSOR_REPORTS) ! { tcSensorReport *pSensorReport = &maSensorReport[mnContributors++]; pSensorReport->Clear(); *************** *** 313,319 **** * check for update reports and update track */ ! void tcSensorMapTrack::UpdateTrack(void) { ! bool bUpdated = false; // find first new active report since last update and update track --- 318,324 ---- * check for update reports and update track */ ! void tcSensorMapTrack::UpdateTrack() { ! //bool bUpdated = false; // find first new active report since last update and update track *************** *** 911,918 **** } ! bool tcSensorMap::Test() { double fTime = 1.0f; tnPoolIndex nSensorPlatformIdx = 1; ! tnPoolIndex nTargetID = 3; tcSensorReport report; --- 916,924 ---- } ! bool tcSensorMap::Test() ! { double fTime = 1.0f; tnPoolIndex nSensorPlatformIdx = 1; ! // tnPoolIndex nTargetID = 3; tcSensorReport report; Index: tcFlightPort.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcFlightPort.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcFlightPort.cpp 9 Aug 2004 02:35:16 -0000 1.10 --- tcFlightPort.cpp 14 Sep 2004 02:01:47 -0000 1.11 *************** *** 436,439 **** --- 436,448 ---- pGameObj->SetRelativeOrientation(spotinfo->orientation, 0, 0); } + + /** + * @return true if all launch spots are heloOnly + */ + bool tcFlightPort::IsHeloOnly() const + { + return mpDBObject->heloOnly != 0; + } + //---------------------------------------------------------------------------- void tcFlightPort::SetObjectDestination(unsigned n, teLocation loc) *************** *** 446,450 **** void tcFlightPort::UpdateRelPos(tcAirState *airstate, double time) { ! tcGameObject *pGameObj = airstate->obj; if (airstate->current_location == TRANSIT) { --- 455,459 ---- void tcFlightPort::UpdateRelPos(tcAirState *airstate, double time) { ! // tcGameObject *pGameObj = airstate->obj; if (airstate->current_location == TRANSIT) { Index: tcESMSensor.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcESMSensor.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcESMSensor.cpp 8 Aug 2004 00:31:35 -0000 1.6 --- tcESMSensor.cpp 14 Sep 2004 02:01:47 -0000 1.7 *************** *** 61,65 **** // look az is az relative to north, might have to change later ! float lookAz_rad = parent->mcKin.mfHeading_rad + mountAz_rad; float emitterAz_rad = emitter_kin.mfHeading_rad + emitter->mountAz_rad; --- 61,65 ---- // look az is az relative to north, might have to change later ! // float lookAz_rad = parent->mcKin.mfHeading_rad + mountAz_rad; float emitterAz_rad = emitter_kin.mfHeading_rad + emitter->mountAz_rad; Index: tc3DViewer.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tc3DViewer.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** tc3DViewer.cpp 6 Sep 2004 01:08:04 -0000 1.35 --- tc3DViewer.cpp 14 Sep 2004 02:01:47 -0000 1.36 *************** *** 535,539 **** --- 535,555 ---- } + /** + * Creates new drawing projection and adds it to the scene graph. + * New owner should remove the projection from the scenegraph if + * it is destroyed before the 3DViewer. + * The default projection is the same size as the 3D viewer + * + * @return projection that was just created + */ + osg::Projection* tc3DViewer::CreateDrawProjection() + { + osg::Projection* projection = new osg::Projection(); + projection->setMatrix(osg::Matrix::ortho2D(0, mnWidth, 0, mnHeight)); + + rootnode->addChild(projection); + return projection; + } void tc3DViewer::CreateScene() *************** *** 667,671 **** positioned->addChild(glider); osg::PositionAttitudeTransform* xform = new osg::PositionAttitudeTransform; ! osg::AnimationPath* animationPath = createAnimationPath(10.0f); //xform->setUpdateCallback(new osg::AnimationPathCallback(animationPath,0.0,1.0)); xform->setUpdateCallback(new ObjectUpdater()); --- 683,687 ---- positioned->addChild(glider); osg::PositionAttitudeTransform* xform = new osg::PositionAttitudeTransform; ! // osg::AnimationPath* animationPath = createAnimationPath(10.0f); //xform->setUpdateCallback(new osg::AnimationPathCallback(animationPath,0.0,1.0)); xform->setUpdateCallback(new ObjectUpdater()); *************** *** 887,890 **** --- 903,914 ---- /** + * @return pointer to MatrixTransform used to display 2D objects like HUD text + */ + osg::MatrixTransform* tc3DViewer::GetDrawMatrixTransform() + { + return hudObjects.get(); + } + + /** * @return object position in world coordinates. */ Index: tcObjectControl.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcObjectControl.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** tcObjectControl.cpp 9 Aug 2004 02:35:16 -0000 1.17 --- tcObjectControl.cpp 14 Sep 2004 02:01:47 -0000 1.18 *************** *** 543,547 **** bool mbDrawSpeed = mbSurface || mbAir; bool mbDrawAltitude = mbAir; ! bool mbDrawEngagement = mbSurface; if (mbDrawSpeed) {DrawBarObject(pGraphics, &msSOI, pkin->mfSpeed_kts, mfGoalSpeed_kts);} --- 543,547 ---- bool mbDrawSpeed = mbSurface || mbAir; bool mbDrawAltitude = mbAir; ! // bool mbDrawEngagement = mbSurface; if (mbDrawSpeed) {DrawBarObject(pGraphics, &msSOI, pkin->mfSpeed_kts, mfGoalSpeed_kts);} *************** *** 1195,1200 **** else if (msHOI.mrectArc.Contains((float)point.x,(float)point.y)) { ! mpHookedGameObj->SetHeading(msHOI.mfMouseHeading_rad); ! msHOI.mbMouseOver = false; } else if (msSOI.mrectcontrol.Contains((float)point.x,(float)point.y)) --- 1195,1203 ---- else if (msHOI.mrectArc.Contains((float)point.x,(float)point.y)) { ! if (tcPlatformObject* plat = dynamic_cast<tcPlatformObject*>(mpHookedGameObj)) ! { ! plat->SetHeading(msHOI.mfMouseHeading_rad); ! msHOI.mbMouseOver = false; ! } } else if (msSOI.mrectcontrol.Contains((float)point.x,(float)point.y)) *************** *** 1205,1211 **** aeroAirObj->SetThrottleFraction(msSOI.mfmousevalue / aeroAirObj->mpDBObject->mfMaxSpeed_kts); } ! else if (tcPlatformObject *platformObj = dynamic_cast<tcPlatformObject*>(mpHookedGameObj)) { ! platformObj->SetSpeed(msSOI.mfmousevalue); } msSOI.mbMouseOver = false; --- 1208,1214 ---- aeroAirObj->SetThrottleFraction(msSOI.mfmousevalue / aeroAirObj->mpDBObject->mfMaxSpeed_kts); } ! else if (tcPlatformObject* plat = dynamic_cast<tcPlatformObject*>(mpHookedGameObj)) { ! plat->SetSpeed(msSOI.mfmousevalue); } msSOI.mbMouseOver = false; Index: tcGameObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcGameObject.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** tcGameObject.cpp 6 Sep 2004 01:08:04 -0000 1.21 --- tcGameObject.cpp 14 Sep 2004 02:01:47 -0000 1.22 *************** *** 235,239 **** void tcGameObject::RemoveChild(tcGameObject *child) { ! int nChildren = (int)children.size(); tcGameObject*& child_n = children.at(child->mnID); if (child_n == child) --- 235,239 ---- void tcGameObject::RemoveChild(tcGameObject *child) { ! // int nChildren = (int)children.size(); tcGameObject*& child_n = children.at(child->mnID); if (child_n == child) Index: tcDirector.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcDirector.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcDirector.cpp 24 Jun 2004 21:35:41 -0000 1.7 --- tcDirector.cpp 14 Sep 2004 02:01:47 -0000 1.8 *************** *** 79,83 **** AddEvent(new tcGameCommandEvent(ID_SET3D, 0, 0)); // deactivate 3D window ! AddEvent(new tcSoundEffectEvent(1.0f,SEFFECT_WELCOME)); //AddEvent(new tcMusicEvent("","pause",0,0,0)); AddEvent(new tcMusicEvent("tension1","play",0,2.0,30.0)); --- 79,83 ---- AddEvent(new tcGameCommandEvent(ID_SET3D, 0, 0)); // deactivate 3D window ! //AddEvent(new tcSoundEffectEvent(1.0f,SEFFECT_WELCOME)); //AddEvent(new tcMusicEvent("","pause",0,0,0)); AddEvent(new tcMusicEvent("tension1","play",0,2.0,30.0)); Index: tcSimState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSimState.cpp,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** tcSimState.cpp 6 Sep 2004 01:08:04 -0000 1.53 --- tcSimState.cpp 14 Sep 2004 02:01:47 -0000 1.54 *************** *** 359,370 **** if (trueRange2 < 64.0f) // 8.0 m range { - tcString s; - s.Format("weapon %d hit target %d, range^2: %3.1f m, time %.1f s", - missile->mnID, target->mnID, trueRange2, mfSimTime); - WTL(s.GetBuffer()); - std::cout << s.GetBuffer(); - fprintf(stdout," collision relative time: %f, dx:%f dy:%f dz:%f\n", - tclosest, dx, dy, dz); - float fDamage = missile->mpDBObject->mfDamage; float fDamageFract = GetFractionalDamage(fDamage, target); --- 359,362 ---- *************** *** 383,386 **** --- 375,386 ---- } } + + tcString s; + s.Format("weapon %d hit target %d, range^2: %3.1f m, dmg: %3.1f %%, time %.1f s", + missile->mnID, target->mnID, trueRange2, fDamageFract, mfSimTime); + WTL(s.GetBuffer()); + std::cout << s.GetBuffer(); + fprintf(stdout," collision relative time: %f, dx:%f dy:%f dz:%f\n", + tclosest, dx, dy, dz); } *************** *** 502,506 **** { bool bTerminal = (missileObj->GetGuidanceParameters(gp) != 0); ! if (gp.mnTargetID != -1) { if ((gp.mfInterceptTime < 10.0)) --- 502,506 ---- { bool bTerminal = (missileObj->GetGuidanceParameters(gp) != 0); ! if (bTerminal && (gp.mnTargetID != -1)) { if ((gp.mfInterceptTime < 10.0)) *************** *** 792,796 **** tnPoolIndex nSize = maPlatformState.GetCount(); tnPoolIndex nKey; - int nListIndex=0; for (tnPoolIndex i=0; i<nSize; i++) --- 792,795 ---- *************** *** 881,885 **** { enum {MAX_EMITTERS=4}; ! float fAz_rad; if (!mpUserInfo->IsOwnAlliance(apESMPlat->mnAlliance)) {return;} --- 880,884 ---- { enum {MAX_EMITTERS=4}; ! float fAz_rad = 0; if (!mpUserInfo->IsOwnAlliance(apESMPlat->mnAlliance)) {return;} *************** *** 1015,1019 **** apSensorState->GetTestArea(region); nCount = GetPlatformsWithinRegion(aTargetKeys, 100, ®ion); ! bool bOwnAllianceUpdate = mpUserInfo->IsOwnAlliance(applat->mnAlliance); for(int k=0;k<nCount;k++) { --- 1014,1018 ---- apSensorState->GetTestArea(region); nCount = GetPlatformsWithinRegion(aTargetKeys, 100, ®ion); ! // bool bOwnAllianceUpdate = mpUserInfo->IsOwnAlliance(applat->mnAlliance); for(int k=0;k<nCount;k++) { *************** *** 1063,1067 **** int bTargetExists = maPlatformState.Lookup(nTargetID,pTargetObj); bool bOwnAlliance = (pTargetObj->mnAlliance == apGameObj->mnAlliance); ! float fRange_km; if ((bTargetExists)&&(!bOwnAlliance)) // no own-alliance detections { --- 1062,1066 ---- int bTargetExists = maPlatformState.Lookup(nTargetID,pTargetObj); bool bOwnAlliance = (pTargetObj->mnAlliance == apGameObj->mnAlliance); ! float fRange_km = 0; if ((bTargetExists)&&(!bOwnAlliance)) // no own-alliance detections { *************** *** 1521,1525 **** bool bFound = false; int nTries = 0; ! tcDatabaseObject *pdata; while ((bSearching)&&(nTries++ < 128)) --- 1520,1524 ---- bool bFound = false; int nTries = 0; ! tcDatabaseObject *pdata = 0; while ((bSearching)&&(nTries++ < 128)) *************** *** 1538,1542 **** { tcGameObject *pplat; ! int nPlatDB = mpDatabase->mcObjectData.GetCount(); static int nSeedCount = 0; UINT platform_type; --- 1537,1541 ---- { tcGameObject *pplat; ! // int nPlatDB = mpDatabase->mcObjectData.GetCount(); static int nSeedCount = 0; UINT platform_type; Index: tcWeaponObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcWeaponObject.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcWeaponObject.cpp 8 Aug 2004 00:31:35 -0000 1.7 --- tcWeaponObject.cpp 14 Sep 2004 02:01:47 -0000 1.8 *************** *** 106,113 **** fprintf(stderr, "tcWeaponObject::SetIntendedTarget - targetId %d not found in sensor map", targetId); - - return; } ! smtrack->AddEngagement(tcGameObject::mnID); } --- 106,114 ---- fprintf(stderr, "tcWeaponObject::SetIntendedTarget - targetId %d not found in sensor map", targetId); } ! else ! { ! smtrack->AddEngagement(tcGameObject::mnID); ! } } Index: tcFlightOpsObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcFlightOpsObject.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcFlightOpsObject.cpp 9 Aug 2004 02:35:16 -0000 1.3 --- tcFlightOpsObject.cpp 14 Sep 2004 02:01:47 -0000 1.4 *************** *** 129,140 **** if (gameObj->mpDBObject == NULL) {return;} int nAircraft = flight_deck.GetHangarCapacity(); ! for(int i=0;i<nAircraft;i++) { // add FW air child for test ! tcDatabaseObject *dbObj = database->GetRandomOfType(MTYPE_FIXEDWINGX); ! tcAirDBObject *airDBObj = dynamic_cast<tcAirDBObject*>(dbObj); ! tcAeroAirObject *child = NULL; ! if (airDBObj) child = new tcAeroAirObject(airDBObj); /* This ASSERT can happen if bad model ids are in a database table (e.g. --- 129,152 ---- if (gameObj->mpDBObject == NULL) {return;} + bool heloOnly = flight_deck.IsHeloOnly(); + unsigned int modelType = (heloOnly) ? MTYPE_HELO : MTYPE_FIXEDWINGX; + int nAircraft = flight_deck.GetHangarCapacity(); ! for(int i=0; i<nAircraft; i++) { // add FW air child for test ! tcDatabaseObject* dbObj = database->GetRandomOfType(modelType); ! // tcAirDBObject* airDBObj = dynamic_cast<tcAirDBObject*>(dbObj); ! ! tcAirObject* child = 0; ! ! if (heloOnly) ! { ! child = new tcHeloObject(dynamic_cast<tcGenericDBObject*>(dbObj)); ! } ! else ! { ! child = new tcAeroAirObject(dynamic_cast<tcAirDBObject*>(dbObj)); ! } /* This ASSERT can happen if bad model ids are in a database table (e.g. *************** *** 144,148 **** if (child != NULL) { ! child->mzUnit = "AIRX_"; child->mzUnit.AssignRandomSuffix(); float z = -20.0f + (float)i * 18.0f; --- 156,160 ---- if (child != NULL) { ! child->mzUnit = (heloOnly) ? "HELO_" : "AIRX_"; child->mzUnit.AssignRandomSuffix(); float z = -20.0f + (float)i * 18.0f; Index: tcLauncherState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcLauncherState.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** tcLauncherState.cpp 16 Aug 2004 01:43:31 -0000 1.17 --- tcLauncherState.cpp 14 Sep 2004 02:01:47 -0000 1.18 *************** *** 551,555 **** for(int n = 0; n < mnCount; n++) { ! const tcLauncher* launcher = &launchers[n]; int launcherFlag = GetLauncherFlag(n); --- 551,555 ---- for(int n = 0; n < mnCount; n++) { ! // const tcLauncher* launcher = &launchers[n]; int launcherFlag = GetLauncherFlag(n); Index: tcOOBView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcOOBView.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcOOBView.cpp 17 Aug 2004 02:22:56 -0000 1.8 --- tcOOBView.cpp 14 Sep 2004 02:01:47 -0000 1.9 *************** *** 289,293 **** if (yheader > 0) { ! mpBrush->SetColor(Color(254,200,200,250)); DrawText(graphics, mpFont, mpBrush, "* Surface", mfXOffset, yheader - 15.0f); --- 289,293 ---- if (yheader > 0) { ! mpBrush->SetColor(Color(254,220,220,150)); DrawText(graphics, mpFont, mpBrush, "* Surface", mfXOffset, yheader - 15.0f); *************** *** 299,303 **** if (yheader > 0) { ! mpBrush->SetColor(Color(254,200,200,250)); DrawText(graphics, mpFont, mpBrush, "* Air", mfXOffset, yheader - 15.0f); } --- 299,303 ---- if (yheader > 0) { ! mpBrush->SetColor(Color(254,220,220,150)); DrawText(graphics, mpFont, mpBrush, "* Air", mfXOffset, yheader - 15.0f); } *************** *** 307,311 **** if (yheader > 0) { ! mpBrush->SetColor(Color(254,200,200,250)); DrawText(graphics, mpFont, mpBrush, "* CVs and Airfields", mfXOffset, yheader - 15.0f); --- 307,311 ---- if (yheader > 0) { ! mpBrush->SetColor(Color(254,220,220,150)); DrawText(graphics, mpFont, mpBrush, "* CVs and Airfields", mfXOffset, yheader - 15.0f); Index: tcDirectorEvent.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcDirectorEvent.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcDirectorEvent.cpp 8 Aug 2004 00:31:35 -0000 1.8 --- tcDirectorEvent.cpp 14 Sep 2004 02:01:47 -0000 1.9 *************** *** 114,118 **** return; } ! if (effectCode == 1) // alpha blend { double tspan = eventStop - eventStart; --- 114,118 ---- return; } ! if (effectCode & FADE_MASK) // alpha blend { double tspan = eventStop - eventStart; *************** *** 139,148 **** tcMapTextEvent::tcMapTextEvent(std::string text, double startTime, double endTime, double lon_deg, double lat_deg, int effect) ! : tcMapEvent(new tcMapTextObject(text, lon_deg, lat_deg)) , tcDirectorEvent(startTime, endTime) { effectCode = effect; } --- 139,155 ---- + /** + * effect - bit pos 0, fade in & out enabled + * effect - bit pos 1, enabled - use relative screen coords, disabled - use geo lat/lon + * effect - bit pos 2, disable marker + */ tcMapTextEvent::tcMapTextEvent(std::string text, double startTime, double endTime, double lon_deg, double lat_deg, int effect) ! : tcMapEvent(new tcMapTextObject(text, lon_deg, lat_deg, ! (effect & RELATIVE_COORD_MASK) != 0)) , tcDirectorEvent(startTime, endTime) { effectCode = effect; + mapObject->SetMarkerActive((effect & MARKER_DISABLE_MASK) == 0); } Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMapView.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** tcMapView.cpp 6 Sep 2004 01:08:04 -0000 1.32 --- tcMapView.cpp 14 Sep 2004 02:01:47 -0000 1.33 *************** *** 146,149 **** --- 146,150 ---- return afExtent_rad*mfScaleX_pelprad; } + /***********************************************************************************/ tcPoint tcMapView::ScreenToGeo(wxPoint pscreen) Index: tcGameView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcGameView.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcGameView.cpp 8 Aug 2004 00:31:35 -0000 1.12 --- tcGameView.cpp 14 Sep 2004 02:01:47 -0000 1.13 *************** *** 446,451 **** void tcGameView::Update(double afStatusTime) { ! tnPoolIndex cmappos = mpSS->maPlatformState.GetStartPosition(); ! int nSize = mpSS->maPlatformState.GetCount(); int nMapObj = 0; int nWorldMapObj = 0; --- 446,451 ---- void tcGameView::Update(double afStatusTime) { ! // tnPoolIndex cmappos = mpSS->maPlatformState.GetStartPosition(); ! // int nSize = mpSS->maPlatformState.GetCount(); int nMapObj = 0; int nWorldMapObj = 0; Index: tcMapData.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMapData.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcMapData.cpp 24 Jun 2004 21:35:41 -0000 1.12 --- tcMapData.cpp 14 Sep 2004 02:01:47 -0000 1.13 *************** *** 61,65 **** int trial = 0; ! float randomLon,randomLat,alt; while (trial++ < MAX_TRIALS) { --- 61,67 ---- int trial = 0; ! float randomLon = 0; ! float randomLat = 0; ! float alt = 0; while (trial++ < MAX_TRIALS) { Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.94 retrieving revision 1.95 diff -C2 -d -r1.94 -r1.95 *** Game.cpp 6 Sep 2004 01:08:03 -0000 1.94 --- Game.cpp 14 Sep 2004 02:01:47 -0000 1.95 *************** *** 52,55 **** --- 52,56 ---- #include "network/tcMultiplayerInterface.h" #include "tcChatBox.h" + #include "tc3DWindow.h" #if defined(_MSC_VER) *************** *** 338,341 **** --- 339,344 ---- // deactivate delayed text so that briefing text is quickly available briefingConsoleLeft->SetDelayedTextEffect(false); + + SetBriefingMode(0); } *************** *** 344,347 **** --- 347,356 ---- if (InitGame()) { + // set hookID for windows that were just created + long hookID = tacticalMap->GetHookID(); + hookInfo->SetHookID(hookID); + oobView->SetHookID(hookID); + objectControl->SetHookID(hookID); + optionsView->SetActive(false); startView->SetActive(false); *************** *** 372,375 **** --- 381,385 ---- meScreenMode = CREDIT; tcSound::Get()->PlayMusic("tension1"); + tcSound::Get()->SeekMusic(3.0); } *************** *** 479,482 **** --- 489,497 ---- /* ** Init graphics engine * **/ mpGraphicsEngine = tcGraphicsEngine::Get(); + tc3DWindow::Set3DViewer(viewer); + + test3DWindow = + new tc3DWindow(viewer, wxPoint(0, 0), wxSize(150, 80), "Test3DWindow"); + test3DWindow->SetActive(true); /* start view has to be initialized first so that we can *************** *** 717,721 **** briefingConsoleLeft->Print(" "); // need this to get it to display // add buttons ! briefingConsoleLeft->AddButton(wxRect(10,leftConsoleHeight-20,50,14), ID_SKIPBRIEFING, "SKIP"); briefingConsoleBottom = new tcSoundConsole(glCanvas, wxPoint(0,mnHeight-mnBottomMargin), --- 732,736 ---- briefingConsoleLeft->Print(" "); // need this to get it to display // add buttons ! briefingConsoleLeft->AddButton(wxRect(10,leftConsoleHeight-20,50,14), ID_SKIPBRIEFING, "EXIT"); briefingConsoleBottom = new tcSoundConsole(glCanvas, wxPoint(0,mnHeight-mnBottomMargin), *************** *** 1105,1108 **** --- 1120,1131 ---- { long state = event.m_extraLong; + SetBriefingMode(state); + } + + /** + * @param state 0 - deactivate briefing mode, 1 - activate briefing + */ + void tcGame::SetBriefingMode(long state) + { if (state == 1) { *************** *** 1115,1118 **** --- 1138,1142 ---- } + /** * Set multiplayer mode *************** *** 1329,1332 **** --- 1353,1358 ---- viewer->SetActive(true); + test3DWindow->Draw(); + viewer->SetCameraAz(viewer->GetCameraAz() + 0.02f); static float cameraTime = 0; *************** *** 1768,1772 **** bool tcGame::Finish() { ! mpGraphicsEngine->DeleteAllSurfaces(); /* if (mpGraphicsEngine != NULL) --- 1794,1798 ---- bool tcGame::Finish() { ! // mpGraphicsEngine->DeleteAllSurfaces(); /* if (mpGraphicsEngine != NULL) *************** *** 1796,1801 **** unsigned count = simState->GetAlliancePlatforms(&id[0], maxPlats, ownAlliance); ! unsigned idx = rand() % count; ! NewHook(id[idx]); } --- 1822,1835 ---- unsigned count = simState->GetAlliancePlatforms(&id[0], maxPlats, ownAlliance); ! if (count) ! { ! unsigned idx = rand() % count; ! NewHook(id[idx]); ! } ! { ! #ifdef _DEBUG ! fprintf(stderr, "tcGame::HookRandomFriendly - No friendlies found.\n"); ! #endif ! } } Index: tcRadar.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcRadar.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcRadar.cpp 8 Aug 2004 00:31:35 -0000 1.11 --- tcRadar.cpp 14 Sep 2004 02:01:47 -0000 1.12 *************** *** 308,312 **** { long nTargetID; ! tcGameObject *ptarget; int bFound; --- 308,312 ---- { long nTargetID; ! tcGameObject *ptarget = 0; int bFound; *************** *** 458,462 **** if (target != parent) // no self detection { ! float range_km; bool bDetected = (parent->mnAlliance != target->mnAlliance) && CanDetectTarget(target,range_km); --- 458,462 ---- if (target != parent) // no self detection { ! float range_km = 0; bool bDetected = (parent->mnAlliance != target->mnAlliance) && CanDetectTarget(target,range_km); |