[Gcblue-commits] gcb_wx/src/sim Game.cpp, 1.163, 1.164 tcObjectControl.cpp, 1.53, 1.54 tcOpticalSen
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2006-11-23 00:07:35
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv22565/src/sim Modified Files: Game.cpp tcObjectControl.cpp tcOpticalSensor.cpp tcPlatformObject.cpp tcStores.cpp Log Message: Index: tcOpticalSensor.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcOpticalSensor.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcOpticalSensor.cpp 20 Nov 2006 00:17:44 -0000 1.14 --- tcOpticalSensor.cpp 23 Nov 2006 00:07:33 -0000 1.15 *************** *** 27,30 **** --- 27,31 ---- #include "tcGameObject.h" #include "tcSurfaceObject.h" + #include "tcAeroAirObject.h" #include "tcAirObject.h" #include "tcMissileObject.h" *************** *** 64,74 **** } ! float tcOpticalSensor::CalculateNightPenalty(float lon_rad) const { static DateZulu dz; simState->GetDateZulu(dz); ! ! float localHours = float(dz.getHour()) + C_RADTOHRS * lon_rad; if (localHours >= 24.0) localHours -= 24.0; else if (localHours < 0) localHours += 24.0; --- 65,76 ---- } ! float tcOpticalSensor::CalculateNightPenalty(const tcGameObject* target) const { static DateZulu dz; simState->GetDateZulu(dz); ! ! ! float localHours = float(dz.getHour()) + C_RADTOHRS * target->mcKin.mfLon_rad; if (localHours >= 24.0) localHours -= 24.0; else if (localHours < 0) localHours += 24.0; *************** *** 76,79 **** --- 78,87 ---- if ((localHours < 6) || (localHours > 18)) { + // for jet target check if afterburners are active + if (const tcAeroAirObject* air = dynamic_cast<const tcAeroAirObject*>(target)) + { + if (air->GetThrottleFraction() > 1.0f) return 2.0f; + } + return mpDBObj->nightFactor; } *************** *** 163,167 **** // calculate night penalty ! float nightPenalty = CalculateNightPenalty(tgt_kin->mfLon_rad); float margin_dB = --- 171,175 ---- // calculate night penalty ! float nightPenalty = CalculateNightPenalty(target); float margin_dB = Index: tcPlatformObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcPlatformObject.cpp,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** tcPlatformObject.cpp 20 Nov 2006 00:17:44 -0000 1.67 --- tcPlatformObject.cpp 23 Nov 2006 00:07:33 -0000 1.68 *************** *** 37,40 **** --- 37,41 ---- #include "tcLauncher.h" #include "tc3DModel.h" + #include "tcSimState.h" #include "tcStores.h" #include "common/tcStream.h" *************** *** 82,85 **** --- 83,93 ---- void tcPlatformObject::DesignateTarget(long anID) { + tcSensorMapTrack track; + bool trackFound = tcSimState::Get()->GetTrack(anID, GetAlliance(), track); + if (!trackFound) + { + return; + } + brain->SetTarget(anID); unsigned nLaunchers = mcLauncherState.GetLauncherCount(); *************** *** 87,90 **** --- 95,99 ---- { mcLauncherState.SetLauncherTarget(n, anID); + mcLauncherState.SetLauncherDatum(n, track.mfLon_rad, track.mfLat_rad, 0); } } Index: tcObjectControl.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcObjectControl.cpp,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** tcObjectControl.cpp 20 Nov 2006 00:17:44 -0000 1.53 --- tcObjectControl.cpp 23 Nov 2006 00:07:33 -0000 1.54 *************** *** 1711,1714 **** --- 1711,1715 ---- mcWeaponPanel.SetPage(0); mcSensorPanel.SetPage(0); + UpdateControlObjects(); } *************** *** 1896,1900 **** SetControlGameObject(mpHookedGameObj); ! if (!bFound) {return;} { --- 1897,1906 ---- SetControlGameObject(mpHookedGameObj); ! if (!bFound) ! { ! mcAIPanel.SetAIData(0); ! wxASSERT(false); ! return; ! } { Index: tcStores.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcStores.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tcStores.cpp 20 Nov 2006 00:17:45 -0000 1.16 --- tcStores.cpp 23 Nov 2006 00:07:33 -0000 1.17 *************** *** 542,546 **** wxASSERT(obj); ! if (obj == 0) return; tcLauncher* launcher = obj->GetLauncher(op.launcherIdx); --- 542,549 ---- wxASSERT(obj); ! if (obj == 0) ! { ! return; ! } tcLauncher* launcher = obj->GetLauncher(op.launcherIdx); *************** *** 1106,1109 **** --- 1109,1122 ---- void tcStores::UpdateAutomation() { + const int finishOp = 86; + + // first verify valid op target, otherwise set stage to finishOp + for (size_t n=0; n<automationOps.size(); n++) + { + AutomationOperation& op = automationOps[n]; + tcGameObject* obj = GetChildOrParent(op.obj); + if (obj == 0) op.stage = finishOp; + } + for (size_t n=0; n<automationOps.size(); n++) { *************** *** 1118,1122 **** else { ! op.stage = 86; } } --- 1131,1135 ---- else { ! op.stage = finishOp; } } *************** *** 1127,1131 **** if (op.type == "Empty") { ! op.stage = 86; } else --- 1140,1144 ---- if (op.type == "Empty") { ! op.stage = finishOp; } else *************** *** 1137,1141 **** else { ! op.stage = 86; } } --- 1150,1154 ---- else { ! op.stage = finishOp; } } *************** *** 1146,1164 **** if (AllLaunchersReady(op.obj)) { ! op.stage = 86; } } else { ! op.stage = 86; } } ! // remove all automation ops at delete stage (op.stage == 86) std::vector<AutomationOperation> temp; for (size_t n=0; n<automationOps.size(); n++) { ! if (automationOps[n].stage != 86) { temp.push_back(automationOps[n]); --- 1159,1177 ---- if (AllLaunchersReady(op.obj)) { ! op.stage = finishOp; } } else { ! op.stage = finishOp; } } ! // remove all automation ops at delete stage (op.stage == finishOp) std::vector<AutomationOperation> temp; for (size_t n=0; n<automationOps.size(); n++) { ! if (automationOps[n].stage != finishOp) { temp.push_back(automationOps[n]); *************** *** 1448,1452 **** { tcPlatformObject* obj = dynamic_cast<tcPlatformObject*>(GetChildOrParent(child)); ! size_t nLaunchers = obj->GetLauncherCount(); for (size_t n=0; n<nLaunchers; n++) --- 1461,1469 ---- { tcPlatformObject* obj = dynamic_cast<tcPlatformObject*>(GetChildOrParent(child)); ! if (obj == 0) ! { ! return false; ! } ! size_t nLaunchers = obj->GetLauncherCount(); for (size_t n=0; n<nLaunchers; n++) *************** *** 1470,1474 **** { tcPlatformObject* obj = dynamic_cast<tcPlatformObject*>(GetChildOrParent(child)); ! size_t nLaunchers = obj->GetLauncherCount(); for (size_t n=0; n<nLaunchers; n++) --- 1487,1495 ---- { tcPlatformObject* obj = dynamic_cast<tcPlatformObject*>(GetChildOrParent(child)); ! if (obj == 0) ! { ! return false; ! } ! size_t nLaunchers = obj->GetLauncherCount(); for (size_t n=0; n<nLaunchers; n++) Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.163 retrieving revision 1.164 diff -C2 -d -r1.163 -r1.164 *** Game.cpp 20 Nov 2006 00:17:43 -0000 1.163 --- Game.cpp 23 Nov 2006 00:07:33 -0000 1.164 *************** *** 3008,3013 **** commandQueue = tcCommandQueue::Get(); ! database->LogSqlColumns("column_log.csv"); int attribList[15]; --- 3008,3014 ---- commandQueue = tcCommandQueue::Get(); ! #ifdef _DEBUG database->LogSqlColumns("column_log.csv"); + #endif int attribList[15]; |