gcblue-commits Mailing List for Global Conflict Blue (Page 6)
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...> - 2006-10-24 01:34:30
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv8449/include/common Modified Files: simmath.h Log Message: Index: simmath.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/simmath.h,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** simmath.h 18 Jun 2006 00:49:19 -0000 1.36 --- simmath.h 24 Oct 2006 01:33:57 -0000 1.37 *************** *** 198,201 **** --- 198,202 ---- float HeadingToTrack(const tcTrack& track); float HeadingToGeoRad(const GeoPoint *apGeoPoint); + float HeadingToGeoRad(float lon_rad, float lat_rad); float RangeToKm(const GeoPoint *apGeoPoint) const; float RangeToKm(tcKinematics& k) const; |
From: Dewitt C. <ddc...@us...> - 2006-10-24 01:34:30
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv8449/include/database Modified Files: tcGenericDBObject.h tcRadarDBObject.h Log Message: Index: tcGenericDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcGenericDBObject.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** tcGenericDBObject.h 18 Jun 2006 00:47:51 -0000 1.22 --- tcGenericDBObject.h 24 Oct 2006 01:33:57 -0000 1.23 *************** *** 90,94 **** bool IsLeaf() const; ///< returns true if db obj is a leaf obj tcFlightportDBObject* GetFlightport(); ! float GetFuelConsumptionConstant() const; osg::Vec2 GetLauncherAttitude(unsigned n); tc3DPoint GetLauncherPosition(unsigned n); --- 90,94 ---- bool IsLeaf() const; ///< returns true if db obj is a leaf obj tcFlightportDBObject* GetFlightport(); ! float GetFuelConsumptionConstant(float speed_kts = 0) const; osg::Vec2 GetLauncherAttitude(unsigned n); tc3DPoint GetLauncherPosition(unsigned n); *************** *** 111,114 **** --- 111,115 ---- private: float fuelConsumptionConstant; ///< = (fuel rate / max speed) + float invMaxSpeed; ///< 1/max_speed void CalculateParams(); Index: tcRadarDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcRadarDBObject.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcRadarDBObject.h 22 Mar 2006 01:23:28 -0000 1.15 --- tcRadarDBObject.h 24 Oct 2006 01:33:57 -0000 1.16 *************** *** 38,48 **** { public: ! float mfERP_dBW; ///< [dBW] effective radiated power ! unsigned int maxFireControlTracks; ///< max number of simultaneous fire control tracks ! bool isSemiactive; ///< set true if this is a semiactive radar ! bool isCommandReceiver; ///< set true if this is a command guidance receiver (a workaround) ! bool mbDetectsSurface; ///< set true if detects surface targets ! bool mbDetectsAir; ///< set true if detects airborne targets ! bool mbDetectsGround; ///< set true if detects ground targets virtual tcSensorState* CreateSensor(tcGameObject* parent); ///< factory method --- 38,49 ---- { public: ! float mfERP_dBW; ///< [dBW] effective radiated power ! unsigned int maxFireControlTracks; ///< max number of simultaneous fire control tracks ! bool isSemiactive; ///< set true if this is a semiactive radar ! bool isCommandReceiver; ///< set true if this is a command guidance receiver (a workaround) ! bool mbDetectsSurface; ///< set true if detects surface targets ! bool mbDetectsAir; ///< set true if detects airborne targets ! bool mbDetectsMissile; ///< set true if detects missiles ! bool mbDetectsGround; ///< set true if detects ground targets virtual tcSensorState* CreateSensor(tcGameObject* parent); ///< factory method |
From: Dewitt C. <ddc...@us...> - 2006-10-24 01:34:11
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv8446/src/sim Modified Files: Game.cpp tcESMSensor.cpp tcGameObject.cpp tcLauncher.cpp tcOpticalSensor.cpp tcPlatformObject.cpp tcRadar.cpp tcSensorMapTrack.cpp tcSensorState.cpp tcSimState.cpp tcStores.cpp tcTorpedoObject.cpp Log Message: Index: tcLauncher.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcLauncher.cpp,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** tcLauncher.cpp 5 Sep 2006 01:04:25 -0000 1.38 --- tcLauncher.cpp 24 Oct 2006 01:34:05 -0000 1.39 *************** *** 483,486 **** --- 483,488 ---- bool tcLauncher::IsEffective(unsigned int targetClassification) const { + if (mnCurrent == 0) return false; + if ((targetClassification & PTYPE_SURFACE)&&(mnTargetFlags & SURFACE_TARGET)) { Index: tcPlatformObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcPlatformObject.cpp,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** tcPlatformObject.cpp 1 Oct 2006 21:07:41 -0000 1.65 --- tcPlatformObject.cpp 24 Oct 2006 01:34:06 -0000 1.66 *************** *** 230,234 **** if (mpDBObject->mfFuelCapacity_kg > 0) { ! fuel_kg -= dt_s * mpDBObject->GetFuelConsumptionConstant() * mcKin.mfSpeed_kts; if (fuel_kg < 0) fuel_kg = 0; --- 230,234 ---- if (mpDBObject->mfFuelCapacity_kg > 0) { ! fuel_kg -= dt_s * mpDBObject->GetFuelConsumptionConstant(mcKin.mfSpeed_kts) * mcKin.mfSpeed_kts; if (fuel_kg < 0) fuel_kg = 0; *************** *** 1019,1023 **** if (stream.GetDetailLevel() == tcStream::WRITE_ALL) updateMask = 0xFF; ! if (IsClientMode()) updateMask &= (~UPDATE_AI); // don't do ai updates at client stream << updateMask; --- 1019,1023 ---- if (stream.GetDetailLevel() == tcStream::WRITE_ALL) updateMask = 0xFF; ! //if (IsClientMode()) updateMask &= (~UPDATE_AI); // don't do ai updates at client stream << updateMask; *************** *** 1156,1160 **** bool tcPlatformObject::HasNewCommand() const { ! bool newBrainCommand = !IsClientMode() && brain->HasNewCommand(); if (newBrainCommand) return true; --- 1156,1160 ---- bool tcPlatformObject::HasNewCommand() const { ! bool newBrainCommand = brain->HasNewCommand(); if (newBrainCommand) return true; *************** *** 1169,1173 **** --- 1169,1183 ---- } + void tcPlatformObject::SetController(const std::string& username) + { + // set controller for all children + size_t nChildren = children.size(); + for (size_t n=0; n<nChildren; n++) + { + children[n]->SetController(username); + } + tcControllableObject::SetController(username); + } /** Index: tcTorpedoObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcTorpedoObject.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** tcTorpedoObject.cpp 24 Sep 2006 19:50:20 -0000 1.20 --- tcTorpedoObject.cpp 24 Oct 2006 01:34:06 -0000 1.21 *************** *** 365,372 **** --- 365,374 ---- { ApplyDamage(1.0f, 0); // self-destruct + #ifdef _DEBUG tcString s; s.Format("Torpedo %s shut down at time %.1f lon %.3f, lat %.3f", mzUnit.c_str(), afStatusTime, mcKin.mfLon_rad*C_180OVERPI, mcKin.mfLat_rad*C_180OVERPI); WTL(s.GetBuffer()); + #endif } Index: tcESMSensor.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcESMSensor.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcESMSensor.cpp 26 Mar 2006 00:32:15 -0000 1.18 --- tcESMSensor.cpp 24 Oct 2006 01:34:05 -0000 1.19 *************** *** 294,303 **** mcTrack.mnID = NULL_INDEX; if(simState->mpUserInfo->IsOwnAlliance(parent->GetAlliance())) { char zBuff[128]; ! sprintf(zBuff,"Missile %d shut down\n", parent->mnID); tcMessageInterface::Get()->ConsoleMessage(zBuff); } return; } --- 294,305 ---- mcTrack.mnID = NULL_INDEX; + #ifdef _DEBUG if(simState->mpUserInfo->IsOwnAlliance(parent->GetAlliance())) { char zBuff[128]; ! _snprintf(zBuff, 128, "Mis %d shut down (%s)\n", parent->mnID, parent->mzClass.c_str()); tcMessageInterface::Get()->ConsoleMessage(zBuff); } + #endif return; } Index: tcGameObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcGameObject.cpp,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** tcGameObject.cpp 17 Aug 2006 01:28:05 -0000 1.46 --- tcGameObject.cpp 24 Oct 2006 01:34:05 -0000 1.47 *************** *** 765,768 **** --- 765,770 ---- mcKin << stream; + stream >> mcTerrain.mfHeight_m; + stream >> mfDamageLevel; *************** *** 791,794 **** --- 793,798 ---- mcKin >> stream; + stream << mcTerrain.mfHeight_m; + stream << mfDamageLevel; Index: tcSimState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSimState.cpp,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** tcSimState.cpp 18 Jun 2006 00:45:04 -0000 1.99 --- tcSimState.cpp 24 Oct 2006 01:34:06 -0000 1.100 *************** *** 353,357 **** unsigned nLauncher; ! UpdateObjTerrainInfo(); bool usePositionRegistry = (positionRegistry != 0); --- 353,360 ---- unsigned nLauncher; ! if (multiplayerMode != MM_CLIENT) ! { ! UpdateObjTerrainInfo(); ! } bool usePositionRegistry = (positionRegistry != 0); *************** *** 1166,1170 **** void tcSimState::ReportDamage(tcGameObject* obj) { ! tcSound::Get()->PlayEffect("Implosion"); std::string damageString = "reports light damage"; --- 1169,1173 ---- void tcSimState::ReportDamage(tcGameObject* obj) { ! PlayEntitySoundEffect(obj, "Implosion"); std::string damageString = "reports light damage"; *************** *** 1438,1456 **** AddPlatform(child); ! // sound effects ! if (mpUserInfo->IsOwnAlliance(gameObj->GetAlliance())) ! { ! if (dynamic_cast<tcHeloObject*>(child)) ! { ! tcSound::Get()->PlayEffect("helolaunch"); ! } ! else if (dynamic_cast<tcAirObject*>(child)) ! { ! tcSound::Get()->PlayEffect("jetlaunch"); ! } ! } ! } if (launch_count) { --- 1441,1455 ---- AddPlatform(child); ! if (dynamic_cast<tcHeloObject*>(child)) ! { ! PlayEntitySoundEffect(gameObj, "helolaunch"); ! } ! else if (dynamic_cast<tcAirObject*>(child)) ! { ! PlayEntitySoundEffect(gameObj, "jetlaunch"); ! } ! } if (launch_count) { *************** *** 2456,2459 **** --- 2455,2459 ---- mcSensorMap.GetSensorMapTrack(obj->mnID, alliance); if (pTrack) track = *pTrack; + else return false; // track not found } Index: tcOpticalSensor.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcOpticalSensor.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcOpticalSensor.cpp 17 Aug 2006 01:28:05 -0000 1.12 --- tcOpticalSensor.cpp 24 Oct 2006 01:34:06 -0000 1.13 *************** *** 238,241 **** --- 238,243 ---- } // shut down missile if track lost for > 7 seconds + + parent->SetHeading(parent->mcKin.mfHeading_rad); // stop turning if track lost if ((mnMode == SSMODE_SEEKERTRACK)&& (t - mcTrack.mfTimestamp) > 7.0) *************** *** 243,252 **** parent->SelfDestruct(); mcTrack.mnID = NULL_INDEX; if(simState->mpUserInfo->IsOwnAlliance(parent->GetAlliance())) { char zBuff[128]; ! sprintf(zBuff,"Missile %d shut down\n", parent->mnID); simState->mpCommandInterface->DisplayInfoMessage(zBuff); } return; } --- 245,256 ---- parent->SelfDestruct(); mcTrack.mnID = NULL_INDEX; + #ifdef _DEBUG if(simState->mpUserInfo->IsOwnAlliance(parent->GetAlliance())) { char zBuff[128]; ! _snprintf(zBuff, 128, "Mis %d shut down (%s)\n", parent->mnID, parent->mzClass.c_str()); simState->mpCommandInterface->DisplayInfoMessage(zBuff); } + #endif return; } Index: tcSensorState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSensorState.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcSensorState.cpp 23 Mar 2006 01:11:02 -0000 1.18 --- tcSensorState.cpp 24 Oct 2006 01:34:06 -0000 1.19 *************** *** 444,448 **** { // release fire control track ! if (fireControlId != -1) { if (tcRadar *illuminator = GetFireControlRadar()) --- 444,448 ---- { // release fire control track ! if ((!simState->IsMultiplayerClient()) && (fireControlId != -1)) { if (tcRadar *illuminator = GetFireControlRadar()) Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.161 retrieving revision 1.162 diff -C2 -d -r1.161 -r1.162 *** Game.cpp 1 Oct 2006 21:07:41 -0000 1.161 --- Game.cpp 24 Oct 2006 01:34:05 -0000 1.162 *************** *** 1079,1083 **** "xml/info_console.xml", "InfoConsole", gameWindow); infoConsole->SetBaseRenderBin(30); ! infoConsole->LoadBackgroundImage("start_background.jpg"); messageConsole = infoConsole; --- 1079,1084 ---- "xml/info_console.xml", "InfoConsole", gameWindow); infoConsole->SetBaseRenderBin(30); ! infoConsole->LoadBackgroundImage("start_background_plain.jpg"); ! infoConsole->MoveToTop(); messageConsole = infoConsole; *************** *** 2140,2143 **** --- 2141,2146 ---- int ownAlliance = userInfo->GetOwnAlliance(); + if (ownAlliance == 0) return; // no alliance selected yet (multiplayer) + unsigned count = simState->GetAlliancePlatforms(&id[0], maxPlats, ownAlliance); Index: tcSensorMapTrack.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSensorMapTrack.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcSensorMapTrack.cpp 18 Jun 2006 00:45:03 -0000 1.7 --- tcSensorMapTrack.cpp 24 Oct 2006 01:34:06 -0000 1.8 *************** *** 489,493 **** { ! if (autoKillAssess) { if (!IsNew() && !IsDestroyed()) --- 489,493 ---- { ! if (autoKillAssess && (!simState->IsMultiplayerClient())) { if (!IsNew() && !IsDestroyed()) Index: tcStores.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcStores.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcStores.cpp 1 Oct 2006 21:07:41 -0000 1.14 --- tcStores.cpp 24 Oct 2006 01:34:06 -0000 1.15 *************** *** 187,196 **** unsigned long quantity; unsigned char launcherIdx; ! stream >> id; stream >> op; ! stream >> itemId; ! stream >> quantity; ! stream >> launcherIdx; bool ok = true; --- 187,205 ---- unsigned long quantity; unsigned char launcherIdx; ! std::string type; ! stream >> id; stream >> op; ! ! if (op != StoreOperation::AUTOMATION) ! { ! stream >> itemId; ! stream >> quantity; ! stream >> launcherIdx; ! } ! else ! { ! stream >> type; ! } bool ok = true; *************** *** 209,213 **** std::string item; ! if (op != StoreOperation::UNLOAD) { tcDatabaseObject* databaseObj = tcDatabase::Get()->GetObject(itemId); --- 218,222 ---- std::string item; ! if ((op != StoreOperation::UNLOAD) && (op != StoreOperation::AUTOMATION)) { tcDatabaseObject* databaseObj = tcDatabase::Get()->GetObject(itemId); *************** *** 221,227 **** } } if (ok) { ! if (op == StoreOperation::LOAD) { LoadLauncher(launcherIdx, item, obj); --- 230,241 ---- } } + if (ok) { ! if (op == StoreOperation::AUTOMATION) ! { ! AddAutomationOp(type, obj); ! } ! else if (op == StoreOperation::LOAD) { LoadLauncher(launcherIdx, item, obj); *************** *** 261,267 **** stream << cmd.id; stream << cmd.op; ! stream << cmd.itemId; ! stream << cmd.quantity; ! stream << cmd.launcherIdx; } --- 275,288 ---- stream << cmd.id; stream << cmd.op; ! if (cmd.op != StoreOperation::AUTOMATION) ! { ! stream << cmd.itemId; ! stream << cmd.quantity; ! stream << cmd.launcherIdx; ! } ! else ! { ! stream << cmd.type; ! } } *************** *** 294,297 **** --- 315,342 ---- } + if (parent->IsClientMode()) + { + CommandInfo cmd; + + if (child->parent != 0) + { + cmd.id = child->mnID; + } + else + { + cmd.id = -1; + } + + cmd.op = StoreOperation::AUTOMATION; + cmd.itemId = -1; + cmd.quantity = 0; + cmd.launcherIdx = 0; + cmd.type = type; + + commandList.push_back(cmd); + + return; + } + // first search for any existing ops with this child and remove std::vector<AutomationOperation> temp; Index: tcRadar.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcRadar.cpp,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** tcRadar.cpp 5 Sep 2006 01:04:25 -0000 1.40 --- tcRadar.cpp 24 Oct 2006 01:34:06 -0000 1.41 *************** *** 224,227 **** --- 224,228 ---- bool isSurface = false; bool isAir = false; + bool isMissile = false; bool isGround = false; float rcs_dBsm; *************** *** 243,247 **** { rcs_dBsm = missileObj->mpDBObject->mfRcs_dbsm; ! isAir = true; } else if (const tcGroundObject* groundObj = dynamic_cast<const tcGroundObject*>(target)) --- 244,248 ---- { rcs_dBsm = missileObj->mpDBObject->mfRcs_dbsm; ! isMissile = true; } else if (const tcGroundObject* groundObj = dynamic_cast<const tcGroundObject*>(target)) *************** *** 264,268 **** rcs_dBsm = sub->mpDBObject->mfRcs_dbsm; isSurface = true; ! targetHeight_m += 2.0f + 0.4f * surfaceObj->GetZmaxConst(); } else --- 265,269 ---- rcs_dBsm = sub->mpDBObject->mfRcs_dbsm; isSurface = true; ! targetHeight_m += 2.0f + 0.4f * sub->GetZmaxConst(); } else *************** *** 310,313 **** --- 311,315 ---- bool bTargetTypeMatch = (mpDBObj->mbDetectsAir && isAir) || + (mpDBObj->mbDetectsMissile && isMissile) || (mpDBObj->mbDetectsSurface && isSurface) || (mpDBObj->mbDetectsGround && isGround); *************** *** 545,554 **** parent->SelfDestruct(); mcTrack.mnID = -1; if(simState->mpUserInfo->IsOwnAlliance(parent->GetAlliance())) { char zBuff[128]; ! sprintf(zBuff,"Missile %d shut down\n", parent->mnID); simState->mpCommandInterface->DisplayInfoMessage(zBuff); } return; } --- 547,558 ---- parent->SelfDestruct(); mcTrack.mnID = -1; + #ifdef _DEBUG if(simState->mpUserInfo->IsOwnAlliance(parent->GetAlliance())) { char zBuff[128]; ! _snprintf(zBuff, 128, "Mis %d shut down (%s)\n", parent->mnID, parent->mzClass.c_str()); simState->mpCommandInterface->DisplayInfoMessage(zBuff); } + #endif return; } |
From: Dewitt C. <ddc...@us...> - 2006-10-24 01:34:09
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv8446/src/graphics Modified Files: cspSky.cpp tc3DViewer.cpp tcConsoleBox.cpp tcCreditView.cpp tcEditBox.cpp tcGameView.cpp tcMapView.cpp tcNetworkView.cpp tcScrollBar.cpp Log Message: Index: tcScrollBar.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcScrollBar.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcScrollBar.cpp 20 Aug 2006 22:24:02 -0000 1.2 --- tcScrollBar.cpp 24 Oct 2006 01:34:04 -0000 1.3 *************** *** 174,177 **** --- 174,179 ---- autoScrollIncrement = clickScrollAmount; } + + SendRedrawMessage(); } *************** *** 190,193 **** --- 192,197 ---- autoScrollIncrement = 0; autoScroll = false; + + SendRedrawMessage(); } *************** *** 203,206 **** --- 207,212 ---- overArrowUp = false; overArrowDown = false; + + SendRedrawMessage(); } *************** *** 229,237 **** } ! if (!scrollDrag) return; ! float dy = float(pos.y - scrollDragStart.y); ! UpdateYbar(ybarStart + dy); } --- 235,246 ---- } ! if (scrollDrag) ! { ! float dy = float(pos.y - scrollDragStart.y); ! UpdateYbar(ybarStart + dy); ! } ! SendRedrawMessage(); } *************** *** 243,247 **** wxCommandEvent cmd(wxEVT_COMMAND_SCROLLBAR_UPDATED, 1); cmd.SetEventObject(this); ! cmd.m_extraLong = long(ybar * 4.0f / barFraction); --- 252,269 ---- wxCommandEvent cmd(wxEVT_COMMAND_SCROLLBAR_UPDATED, 1); cmd.SetEventObject(this); ! ! if (scrollFromBottom) ! { ! float rectHeight = float(mnHeight) - 2*float(mnWidth); ! float barHeight = barFraction*rectHeight; ! ! cmd.m_extraLong = long((rectHeight - barHeight - ybar)* 4.0f / barFraction * (float(mnHeight)/rectHeight)); ! if (cmd.m_extraLong < 0) cmd.m_extraLong = 0; ! } ! else ! { ! float rectHeight = float(mnHeight) - 2*float(mnWidth); ! cmd.m_extraLong = long(ybar * 4.0f / barFraction * (float(mnHeight)/rectHeight)); ! } *************** *** 250,253 **** --- 272,287 ---- + void tcScrollBar::SetActive(bool abActive) + { + if (barFraction >= 1.0) + { + tc3DWindow::SetActive(false); + } + else + { + tc3DWindow::SetActive(abActive); + } + } + /** * *************** *** 263,272 **** if (barFraction == val) return; barFraction = val; if (barFraction < 0.005) barFraction = 0.005; SetActive(barFraction < 1.0); ! ybar = 0; } /** --- 297,346 ---- if (barFraction == val) return; + float barFractionPrev = barFraction; + barFraction = val; if (barFraction < 0.005) barFraction = 0.005; + else if (barFraction > 1.0) barFraction = 1.0; + SetActive(barFraction < 1.0); ! ! float ybar_adjust = 0; ! if (scrollFromBottom) ! { ! float rectHeight = float(mnHeight) - 2*float(mnWidth); ! ybar_adjust = (barFractionPrev - barFraction) * rectHeight; ! } ! ! UpdateYbar(ybar + ybar_adjust); ! } ! ! void tcScrollBar::SendRedrawMessage() ! { ! if (!sendRedraw) return; ! ! wxCommandEvent cmd(wxEVT_COMMAND_BUTTON_CLICKED, ID_BUTTONREDRAW); ! cmd.SetEventObject(this); ! ! AddPendingEvent(cmd); ! } ! ! void tcScrollBar::SetScrollFromBottom(bool state) ! { ! scrollFromBottom = state; ! ! if (scrollFromBottom) ! { ! ybar = 99999.9f; ! } ! else ! { ! ybar = 0; ! } } + void tcScrollBar::SetSendRedraw(bool state) + { + sendRedraw = state; + } /** *************** *** 301,305 **** ybar = ynew; ! float ybarMax = float(mnHeight) - float(2*mnWidth) - barRect.Height(); if (ybar < 0) ybar = 0; --- 375,379 ---- ybar = ynew; ! float ybarMax = (float(mnHeight) - float(2*mnWidth))*(1.0-barFraction); if (ybar < 0) ybar = 0; *************** *** 323,327 **** scrollDrag(false), backgroundAlpha(0.8f), ! barFraction(1.1f), ybar(0), lastybar(9999.9f), --- 397,401 ---- scrollDrag(false), backgroundAlpha(0.8f), ! barFraction(1.234f), ybar(0), lastybar(9999.9f), *************** *** 329,333 **** autoScroll(false), autoScrollIncrement(0), ! buttonDownTime(0) { LoadImages(); --- 403,410 ---- autoScroll(false), autoScrollIncrement(0), ! buttonDownTime(0), ! sendRedraw(false), ! scrollFromBottom(false), ! barRect(0, 0, 0, 0) { LoadImages(); Index: tcNetworkView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcNetworkView.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcNetworkView.cpp 21 Apr 2006 23:29:09 -0000 1.13 --- tcNetworkView.cpp 24 Oct 2006 01:34:04 -0000 1.14 *************** *** 36,39 **** --- 36,40 ---- #include "common/tcOptions.h" #include "tcUserInfo.h" + #include "ai/Blackboard.h" *************** *** 82,97 **** x = (float)statusBoxBounds.x + 10.0f; ! const std::list<int>& connectionList = tcMultiplayerInterface::Get()->GetConnectionList(); ! std::list<int>::const_iterator iter = connectionList.begin(); ! for ( ; iter != connectionList.end(); ++iter) { ! y += 14.0f; ! std::string connectionStatus = tcMultiplayerInterface::Get()->GetConnectionStatus(*iter); DrawTextR(connectionStatus.c_str(), x, y, defaultFont.get(), color, 14.0f, LEFT_CENTER); ! } ! wxString s = wxString::Format("Max update: %d", tcMultiplayerInterface::Get()->updateCount); DrawTextR(s.c_str(), x, (float)statusBoxBounds.y - 15.0f, defaultFont.get(), color, 12.0f, LEFT_CENTER); --- 83,110 ---- x = (float)statusBoxBounds.x + 10.0f; ! tcMultiplayerInterface* mp = tcMultiplayerInterface::Get(); ! if (!mp->IsConnecting()) { ! const std::list<int>& connectionList = tcMultiplayerInterface::Get()->GetConnectionList(); ! std::list<int>::const_iterator iter = connectionList.begin(); ! for ( ; iter != connectionList.end(); ++iter) ! { ! y += 14.0f; ! std::string connectionStatus = mp->GetConnectionStatus(*iter); ! ! DrawTextR(connectionStatus.c_str(), x, y, defaultFont.get(), color, 14.0f, ! LEFT_CENTER); ! } ! } ! else ! { ! y += 14.0f; ! std::string connectionStatus = mp->GetConnectionStatus(0); DrawTextR(connectionStatus.c_str(), x, y, defaultFont.get(), color, 14.0f, LEFT_CENTER); ! } ! wxString s = wxString::Format("Max update: %d", mp->updateCount); DrawTextR(s.c_str(), x, (float)statusBoxBounds.y - 15.0f, defaultFont.get(), color, 12.0f, LEFT_CENTER); *************** *** 241,244 **** --- 254,258 ---- tcMultiplayerInterface::Get()->Reset(); tcSimState::Get()->SetMultiplayerOff(); + ai::Blackboard::SetMultiplayerClientMode(false); } else if (tcMultiplayerInterface::Get()->GetNumConnections() > 0) *************** *** 251,254 **** --- 265,269 ---- tcMultiplayerInterface::Get()->MakeClient(); tcSimState::Get()->SetMultiplayerClient(); + ai::Blackboard::SetMultiplayerClientMode(true); } else if (mode == MULTIPLAYER_SERVER) *************** *** 257,260 **** --- 272,276 ---- tcSimState::Get()->SetMultiplayerServer(); tcUserInfo::Get()->SetScore(10.0e6); // set high score for high server "rank" + ai::Blackboard::SetMultiplayerClientMode(false); } else Index: tcCreditView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcCreditView.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** tcCreditView.cpp 17 Aug 2006 01:28:04 -0000 1.21 --- tcCreditView.cpp 24 Oct 2006 01:34:04 -0000 1.22 *************** *** 81,86 **** s = "Urwumpe"; ! AddCredit(s, 60.0f, 1); --- 81,88 ---- s = "Urwumpe"; ! AddCredit(s, 25.0f, 1); + s = "Ryan Crierie"; + AddCredit(s, 60.0f, 1); Index: cspSky.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/cspSky.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** cspSky.cpp 23 Mar 2006 01:11:02 -0000 1.17 --- cspSky.cpp 24 Oct 2006 01:34:03 -0000 1.18 *************** *** 333,338 **** float specular_scale = 1.0; float diffuse_scale = 1.0; ! float ambient = background; ! if (ambient > 0.1) ambient = 0.1; // the sky shading at the sun's position is too blue when the sun --- 333,338 ---- float specular_scale = 1.0; float diffuse_scale = 1.0; ! float ambient = 2*background; ! if (ambient > 0.25) ambient = 0.25; // the sky shading at the sun's position is too blue when the sun Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapView.cpp,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** tcMapView.cpp 1 Oct 2006 21:07:40 -0000 1.50 --- tcMapView.cpp 24 Oct 2006 01:34:04 -0000 1.51 *************** *** 725,740 **** // update symbology selection ! // 0 - 2525, 1 - NTDS computer, 2 - NTDS image if (mpOptions->symbologyType == 0) { meSymbology = M2525; } - else if (mpOptions->symbologyType == 1) - { - meSymbology = NTDS; - } else { ! meSymbology = NTDS_IMAGE; } --- 725,736 ---- // update symbology selection ! // 0 - 2525, 1 - NTDS if (mpOptions->symbologyType == 0) { meSymbology = M2525; } else { ! meSymbology = NTDS; } *************** *** 1809,1819 **** break; } ! if (symbolArray == 0) { maSymbolB[nAffiliation][nSymbol] = pSymbol; } ! else { ! maSymbolC[nAffiliation][nSymbol] = pSymbol; } } --- 1805,1815 ---- break; } ! if (symbolArray == 0) // m2525 { maSymbolB[nAffiliation][nSymbol] = pSymbol; } ! else // ntds { ! maSymbolA[nAffiliation][nSymbol] = pSymbol; } } *************** *** 1852,1864 **** maSymbolB_fade[nAffiliation][nSymbol] = fadedB; } - { - osg::Geometry* fadedC = new osg::Geometry(*maSymbolC[nAffiliation][nSymbol]); - osg::Vec4Array* colors = new osg::Vec4Array; - colors->push_back(osg::Vec4(0.4, 0.4, 0.4, 1.0)); - fadedC->setColorArray(colors); - fadedC->setColorBinding(osg::Geometry::BIND_OVERALL); - maSymbolC_fade[nAffiliation][nSymbol] = fadedC; - } { --- 1848,1852 ---- *************** *** 1882,1894 **** maSymbolB_alt[nAffiliation][nSymbol] = altB; } - { - osg::Geometry* altC = new osg::Geometry(*maSymbolC[nAffiliation][nSymbol]); - osg::Vec4Array* colors = new osg::Vec4Array; - colors->push_back(osg::Vec4(0.6, 0.6, 0.8, 1.0)); - altC->setColorArray(colors); - altC->setColorBinding(osg::Geometry::BIND_OVERALL); - - maSymbolC_alt[nAffiliation][nSymbol] = altC; - } } --- 1870,1873 ---- *************** *** 1914,1925 **** return maSymbolA[nAffilIdx][nSymbolIdx].get(); } ! else if (meSymbology == M2525) { return maSymbolB[nAffilIdx][nSymbolIdx].get(); } - else - { - return maSymbolC[nAffilIdx][nSymbolIdx].get(); - } } --- 1893,1900 ---- return maSymbolA[nAffilIdx][nSymbolIdx].get(); } ! else // (meSymbology == M2525) { return maSymbolB[nAffilIdx][nSymbolIdx].get(); } } *************** *** 1938,1949 **** return maSymbolA_alt[nAffilIdx][nSymbolIdx].get(); } ! else if (meSymbology == M2525) { return maSymbolB_alt[nAffilIdx][nSymbolIdx].get(); } - else - { - return maSymbolC_alt[nAffilIdx][nSymbolIdx].get(); - } } --- 1913,1920 ---- return maSymbolA_alt[nAffilIdx][nSymbolIdx].get(); } ! else // (meSymbology == M2525) { return maSymbolB_alt[nAffilIdx][nSymbolIdx].get(); } } *************** *** 1962,1973 **** return maSymbolA_fade[nAffilIdx][nSymbolIdx].get(); } ! else if (meSymbology == M2525) { return maSymbolB_fade[nAffilIdx][nSymbolIdx].get(); } - else - { - return maSymbolC_fade[nAffilIdx][nSymbolIdx].get(); - } } --- 1933,1940 ---- return maSymbolA_fade[nAffilIdx][nSymbolIdx].get(); } ! else // (meSymbology == M2525) { return maSymbolB_fade[nAffilIdx][nSymbolIdx].get(); } } *************** *** 3031,3043 **** if (hookedId.size() == 0) return; ! tcGameObject* obj = tcSimState::Get()->GetObject(hookedId[0]); ! if (obj == 0) return; ! ! tcPoint pos(obj->mcKin.mfLon_rad, obj->mcKin.mfLat_rad); ! if (!PointInView(pos)) { ! tcPoint screen = GeoToScreen(pos); ! SetViewCenterZoom(wxPoint(screen.x, screen.y), 1.0); } } --- 2998,3017 ---- if (hookedId.size() == 0) return; ! tcSensorMapTrack track; ! if (tcSimState::Get()->GetTrack(hookedId[0], tcUserInfo::Get()->GetOwnAlliance(), track)) { ! tcPoint pos(track.mfLon_rad, track.mfLat_rad); ! if (!PointInView(pos)) ! { ! tcPoint screen = GeoToScreen(pos); ! SetViewCenterZoom(wxPoint(screen.x, screen.y), 1.0); ! } ! } ! else ! { ! return; // hookedId doesn't exist (friendly) or not found in sensor map (other) } + + } Index: tcGameView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcGameView.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** tcGameView.cpp 17 Aug 2006 01:28:04 -0000 1.20 --- tcGameView.cpp 24 Oct 2006 01:34:04 -0000 1.21 *************** *** 485,489 **** AddTruthTracks(nOwnAlliance, nMapObj, nWorldMapObj, FRIENDLY); ! if ((nViewMode < 2) || (tcGameObject::IsEditMode())) { AddTruthTracks(nOtherAlliance, nMapObj, nWorldMapObj, HOSTILE); --- 485,489 ---- AddTruthTracks(nOwnAlliance, nMapObj, nWorldMapObj, FRIENDLY); ! if ((nViewMode < 2) || (tcGameObject::IsEditMode()) || mpSS->IsMultiplayerServer()) { AddTruthTracks(nOtherAlliance, nMapObj, nWorldMapObj, HOSTILE); Index: tcConsoleBox.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcConsoleBox.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** tcConsoleBox.cpp 23 Mar 2006 01:11:02 -0000 1.17 --- tcConsoleBox.cpp 24 Oct 2006 01:34:04 -0000 1.18 *************** *** 26,29 **** --- 26,31 ---- #include "AError.h" #include "common/tinyxml.h" + #include "tcScrollBar.h" + #include "wxcommands.h" #include <stdio.h> #include <iostream> *************** *** 33,36 **** --- 35,44 ---- #endif + + BEGIN_EVENT_TABLE(tcConsoleBox, tc3DWindow) + EVT_COMMAND(-1, wxEVT_COMMAND_SCROLLBAR_UPDATED, tcConsoleBox::OnScrollbarUpdated) + EVT_COMMAND(ID_BUTTONREDRAW, wxEVT_COMMAND_BUTTON_CLICKED, tcConsoleBox::OnChildRedraw) + END_EVENT_TABLE() + using std::min; using std::max; *************** *** 38,41 **** --- 46,54 ---- + void tcConsoleBox::OnChildRedraw(wxCommandEvent& event) + { + forceRedraw = true; + } + /** * Catch key events to scroll buffer *************** *** 141,144 **** --- 154,169 ---- redraw = true; + + // update scroll bar parameters + size_t nLines = textArray.GetCount(); + float barFraction = 123.4f; + + if (nLines > 0) + { + barFraction = float(mnHeight - 35) / float(nlinespace*nLines); + } + + scrollBar->SetBarFraction(barFraction); + return 0; } *************** *** 211,214 **** --- 236,241 ---- redraw = false; + DrawChildren(); + HideUnusedObjects(); } *************** *** 285,288 **** --- 312,325 ---- } + + void tcConsoleBox::OnScrollbarUpdated(wxCommandEvent& event) + { + yOffset = 0.25 * float(event.m_extraLong); + + float maxLines = float(mnHeight) / float(nlinespace); + unsigned int offset = floorf(yOffset / maxLines); + SetLineOffset(offset); + } + /** * Scroll displayed lines of buffer history *************** *** 302,305 **** --- 339,343 ---- } + void tcConsoleBox::SetLineOffset(unsigned int offset) { *************** *** 393,396 **** --- 431,441 ---- InitFromXml(config); + int scrollBarWidth = 12; + scrollBar = new tcScrollBar(this, wxPoint(mnWidth-scrollBarWidth, 0), wxSize(scrollBarWidth, mnHeight)); + scrollBar->SetBackgroundAlpha(0.3f); + scrollBar->SetSendRedraw(true); + scrollBar->SetScrollFromBottom(true); + scrollBar->SetBarFraction(1.0); + } Index: tcEditBox.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcEditBox.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcEditBox.cpp 23 Mar 2006 01:11:02 -0000 1.15 --- tcEditBox.cpp 24 Oct 2006 01:34:04 -0000 1.16 *************** *** 144,147 **** --- 144,149 ---- } } + + ReleaseMouse(); } else if (keycode == WXK_BACK) *************** *** 173,176 **** --- 175,180 ---- else if (keycode == WXK_ESCAPE) { + ReleaseMouse(); + wxASSERT(GetParent()); GetParent()->SetFocus(); *************** *** 219,222 **** --- 223,239 ---- void tcEditBox::OnLButtonDown(wxMouseEvent& event) { + wxPoint pos = event.GetPosition(); + + wxRect bounds(0, 0, mnWidth, mnHeight); + bool clickedInWindow = bounds.Inside(pos); + + if (clickedInWindow) + { + CaptureMouse(); + } + else + { + ReleaseMouse(); + } } Index: tc3DViewer.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DViewer.cpp,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** tc3DViewer.cpp 1 Oct 2006 21:07:40 -0000 1.39 --- tc3DViewer.cpp 24 Oct 2006 01:34:04 -0000 1.40 *************** *** 534,537 **** --- 534,539 ---- wxASSERT(foggedObjects.valid()); + fogMode = mode; + osg::StateSet* fogState = foggedObjects->getOrCreateStateSet(); osg::Fog* fog = dynamic_cast<osg::Fog*>(fogState->getAttribute(osg::StateAttribute::FOG)); *************** *** 552,558 **** } - osg::Vec4 airFog(0.6f, 0.7f, 0.8f, 1.0f); - osg::Vec4 waterFog(0.1f, 0.2f, 0.3f, 1.0f); - fogState->setMode(GL_FOG, osg::StateAttribute::ON); --- 554,557 ---- *************** *** 912,915 **** --- 911,915 ---- osg::StateSet *terrainState = terrainNode->getOrCreateStateSet(); terrainState->setMode(GL_LIGHTING, osg::StateAttribute::ON); + terrainState->setMode(GL_FOG, osg::StateAttribute::ON); terrainState->setMode(GL_CULL_FACE, osg::StateAttribute::OFF); *************** *** 927,931 **** skyTransform = new osg::PositionAttitudeTransform; - skyTransform->setCullingActive(false); CreateSky(); --- 927,930 ---- *************** *** 935,938 **** --- 934,939 ---- skyTransform->addChild(sky.get()); + skyTransform->setCullingActive(false); + foggedObjects->addChild(worldObjects.get()); foggedObjects->addChild(terrainNode.get()); *************** *** 942,946 **** rootnode->addChild(foggedObjects.get()); ! //rootnodeFar->addChild(skyTransform.get()); --- 943,949 ---- rootnode->addChild(foggedObjects.get()); ! ! //rootnode->addChild(sky2.get()); ! //rootnodeFar->addChild(skyTransform.get()); *************** *** 991,994 **** --- 994,1014 ---- skyLights->addChild(pSunLightSource); skyLights->addChild(pMoonLightSource); + + waterLights = new osg::Group; + osg::Light* waterLight = new osg::Light; + osg::LightSource* waterLightSource = new osg::LightSource; + waterLightSource->setLight(waterLight); + waterLightSource->setLocalStateSetModes(osg::StateAttribute::ON); + waterLightSource->setStateSetModes(*globalStateSet, osg::StateAttribute::ON); // why? + waterLights->addChild(waterLightSource); + + //sky2 = new osgEphemeris::EphemerisModel; + //sky2->setSkyDomeRadius(10000.0); + //sky2->setSkyDomeCenter(osg::Vec3(0, 0, 0)); + //sky2->setCullingActive(false); + //sky2->setSunLightNum(2); + //sky2->setMoonLightNum(3); + + } *************** *** 1237,1250 **** } ! //osg::Group* terrainRoot = (useFarSceneView) ? rootnodeFar.get() : rootnode.get(); ! osg::Group* terrainRoot = rootnode.get(); // workaround for sky issue, deactivate sky when camera underwater ! if (cameraPosition._v[2] < -1.0+10e3) { if (skyTransform->getNumParents()) { terrainRoot->removeChild(skyTransform.get()); ! // SetFogMode(FOG_WATER); } } --- 1257,1271 ---- } ! osg::Group* terrainRoot = (useFarSceneView) ? rootnodeFar.get() : rootnode.get(); ! //osg::Group* terrainRoot = rootnode.get(); // workaround for sky issue, deactivate sky when camera underwater ! if (cameraPosition._v[2] <= -1.0) { if (skyTransform->getNumParents()) { terrainRoot->removeChild(skyTransform.get()); ! SetFogMode(FOG_WATER); ! //terrainRoot->addChild(waterLights.get()); } } *************** *** 1255,1258 **** --- 1276,1280 ---- terrainRoot->addChild(skyTransform.get()); SetFogMode(FOG_AIR); + //terrainRoot->removeChild(waterLights.get()); } } *************** *** 1420,1424 **** void tc3DViewer::UpdateSky(DateZulu& dateZulu) { ! sky->update(latOrigin_rad, lonOrigin_rad, dateZulu); } --- 1442,1450 ---- void tc3DViewer::UpdateSky(DateZulu& dateZulu) { ! sky->update(latOrigin_rad, lonOrigin_rad, dateZulu); ! ! airFog = sky->getHorizonColor(0); ! ! SetFogMode(fogMode); // to update fog color } *************** *** 1895,1900 **** osg::ref_ptr<osg::Node> terrainNode = terrainManager->GetTerrainNode().get(); ! //osg::Group* terrainRoot = (useFarSceneView) ? rootnodeFar.get() : rootnode.get(); ! osg::Group* terrainRoot = rootnode.get(); wxASSERT(terrainRoot); --- 1921,1926 ---- osg::ref_ptr<osg::Node> terrainNode = terrainManager->GetTerrainNode().get(); ! osg::Group* terrainRoot = (useFarSceneView) ? rootnodeFar.get() : rootnode.get(); ! //osg::Group* terrainRoot = rootnode.get(); wxASSERT(terrainRoot); *************** *** 2227,2231 **** cameraSpinRate(0), lastSpinCount(0), ! isBorderActive(false) { glCanvas = parent; --- 2253,2260 ---- cameraSpinRate(0), lastSpinCount(0), ! isBorderActive(false), ! airFog(0.6f, 0.7f, 0.8f, 1.0f), ! waterFog(0.1f, 0.2f, 0.3f, 1.0f), ! fogMode(FOG_AIR) { glCanvas = parent; *************** *** 2325,2331 **** if (useFarSceneView) { ! //rootnodeFar = new osg::Group; ! //rootnodeFar->addChild(rootnode.get()); ! sceneViewFar->setSceneData(rootnode.get()); } --- 2354,2360 ---- if (useFarSceneView) { ! rootnodeFar = new osg::Group; ! rootnodeFar->addChild(rootnode.get()); ! sceneViewFar->setSceneData(rootnodeFar.get()); } |
From: Dewitt C. <ddc...@us...> - 2006-10-24 01:34:08
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv8446/src/scriptinterface Modified Files: tcFlightPortInterface.cpp tcPlatformInterface.cpp tcPlatformInterfaceExtensionB.cpp Log Message: Index: tcPlatformInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterface.cpp,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** tcPlatformInterface.cpp 16 Sep 2006 14:01:24 -0000 1.65 --- tcPlatformInterface.cpp 24 Oct 2006 01:34:05 -0000 1.66 *************** *** 361,366 **** --- 361,402 ---- } + /** + * @param class_mask see below: + * PTYPE_UNKNOWN 0x0000 + * PTYPE_SURFACE 0x0010 + * PTYPE_SMALLSURFACE 0x0011 + * PTYPE_LARGESURFACE 0x0012 + * PTYPE_CARRIER 0x0014 + * PTYPE_AIR 0x0020 + * PTYPE_FIXEDWING 0x0021 + * PTYPE_HELO 0x0022 + * PTYPE_MISSILE 0x0040 + * PTYPE_SUBSURFACE 0x0080 + * PTYPE_SUBMARINE 0x0081 + * PTYPE_TORPEDO 0x0082 + * PTYPE_SONOBUOY 0x0084 + * PTYPE_FIXED 0x0100 + * PTYPE_AIRFIELD 0x0101 + * PTYPE_BALLISTIC 0x0200 + */ + bool tcPlatformInterface::IsEquippedForTargetType(unsigned int class_mask) + { + if (mpPlatformObj == 0) + { + wxASSERT(false); + return false; + } + size_t nLaunchers = mpPlatformObj->GetLauncherCount(); + for (size_t n=0; n<nLaunchers; n++) + { + tcLauncher* launcher = mpPlatformObj->GetLauncher(n); + wxASSERT(launcher != 0); + if (launcher->IsEffective(class_mask)) return true; + } + + return false; + } bool tcPlatformInterface::IsLauncherEffective(int anLauncher) *************** *** 854,859 **** void tcPlatformInterface::AddTask(const std::string& taskName, double priority, int attributes) { - if (mpPlatformObj->IsClientMode()) return; - ai::Brain* brain = mpPlatformObj->GetBrain(); wxASSERT(brain); --- 890,893 ---- Index: tcPlatformInterfaceExtensionB.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterfaceExtensionB.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** tcPlatformInterfaceExtensionB.cpp 16 Sep 2006 14:01:24 -0000 1.33 --- tcPlatformInterfaceExtensionB.cpp 24 Oct 2006 01:34:05 -0000 1.34 *************** *** 97,100 **** --- 97,101 ---- .def("HandoffTargetToLauncher", &tcPlatformInterface::HandoffTargetToLauncher) .def("IsLauncherEffective", &tcPlatformInterface::IsLauncherEffective) + .def("IsEquippedForTargetType", &tcPlatformInterface::IsEquippedForTargetType) .def("Launch", &tcPlatformInterface::Launch) .def("GetLauncherQuantity", &tcPlatformInterface::GetLauncherQuantity) Index: tcFlightPortInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcFlightPortInterface.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcFlightPortInterface.cpp 28 Sep 2006 02:01:53 -0000 1.12 --- tcFlightPortInterface.cpp 24 Oct 2006 01:34:05 -0000 1.13 *************** *** 83,87 **** ! void tcFlightPortInterface::AddCAPMission() { if (flightport == 0) return; --- 83,87 ---- ! void tcFlightPortInterface::AddCAPMission(float lon_rad, float lat_rad) { if (flightport == 0) return; *************** *** 90,94 **** tcCAPMission* cap = new tcCAPMission(); ! cap->SetStation(0, 0); missionManager->AddMission(cap); --- 90,94 ---- tcCAPMission* cap = new tcCAPMission(); ! cap->SetStation(lon_rad, lat_rad); missionManager->AddMission(cap); |
From: Dewitt C. <ddc...@us...> - 2006-10-24 01:34:08
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv8449/include/sim Modified Files: tcControllableObject.h tcFlightPort.h tcGameObject.h tcPlatformObject.h tcStores.h Log Message: Index: tcGameObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcGameObject.h,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** tcGameObject.h 17 Aug 2006 01:27:11 -0000 1.48 --- tcGameObject.h 24 Oct 2006 01:34:01 -0000 1.49 *************** *** 101,105 **** tsRelativePosition rel_pos; ///< if parent is not NULL, this contains relative position std::vector<tcGameObject*> children; ! std::vector<tcGameObject*> toLaunch; ///< list of ex-childrent to launch tc3DModel* model; ///< 3D model UINT mnModelType; ///< class MTYPE_ identifier --- 101,105 ---- tsRelativePosition rel_pos; ///< if parent is not NULL, this contains relative position std::vector<tcGameObject*> children; ! std::vector<tcGameObject*> toLaunch; ///< list of ex-children to launch tc3DModel* model; ///< 3D model UINT mnModelType; ///< class MTYPE_ identifier Index: tcStores.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcStores.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcStores.h 6 Sep 2006 01:28:20 -0000 1.10 --- tcStores.h 24 Oct 2006 01:34:01 -0000 1.11 *************** *** 78,82 **** struct StoreOperation { ! enum {UNLOAD = 0, LOAD = 1, REFUEL = 2}; std::string item; ///< item type to transfer unsigned long quantity; ///< quantity of item --- 78,82 ---- struct StoreOperation { ! enum {UNLOAD = 0, LOAD = 1, REFUEL = 2, AUTOMATION = 3}; std::string item; ///< item type to transfer unsigned long quantity; ///< quantity of item *************** *** 154,161 **** { short int id; ///< id of unit that command applies to, -1 for local unit ! unsigned char op; ///< UNLOAD = 0, LOAD = 1, REFUEL = 2 long itemId; ///< database id of item (if applicable) unsigned long quantity; unsigned char launcherIdx; }; std::vector<CommandInfo> commandList; --- 154,162 ---- { short int id; ///< id of unit that command applies to, -1 for local unit ! unsigned char op; ///< UNLOAD = 0, LOAD = 1, REFUEL = 2, AUTOMATION = 3 long itemId; ///< database id of item (if applicable) unsigned long quantity; unsigned char launcherIdx; + std::string type; ///< for automation only }; std::vector<CommandInfo> commandList; Index: tcControllableObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcControllableObject.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcControllableObject.h 22 Mar 2006 01:23:29 -0000 1.3 --- tcControllableObject.h 24 Oct 2006 01:34:00 -0000 1.4 *************** *** 53,57 **** const std::string& GetController() const; ! void SetController(const std::string& username); bool IsAvailable() const; --- 53,57 ---- const std::string& GetController() const; ! virtual void SetController(const std::string& username); bool IsAvailable() const; Index: tcFlightPort.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcFlightPort.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tcFlightPort.h 1 Oct 2006 21:07:40 -0000 1.16 --- tcFlightPort.h 24 Oct 2006 01:34:01 -0000 1.17 *************** *** 36,40 **** class tcUpdateStream; ! class tcMissionManager; namespace database --- 36,43 ---- class tcUpdateStream; ! namespace ai ! { ! class tcMissionManager; ! } namespace database *************** *** 150,154 **** void UpdateUnitKin(tcAirState *airstate); // update unit kinematics based on parent info and rel_pos ! tcMissionManager* GetMissionManager(); tcCommandStream& operator<<(tcCommandStream& stream); --- 153,157 ---- void UpdateUnitKin(tcAirState *airstate); // update unit kinematics based on parent info and rel_pos ! ai::tcMissionManager* GetMissionManager(); tcCommandStream& operator<<(tcCommandStream& stream); *************** *** 184,188 **** }; std::vector<CommandInfo> commandList; ! tcMissionManager* missionManager; teLocation GetNextStop(teLocation current, teLocation destination); --- 187,191 ---- }; std::vector<CommandInfo> commandList; ! ai::tcMissionManager* missionManager; teLocation GetNextStop(teLocation current, teLocation destination); Index: tcPlatformObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcPlatformObject.h,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** tcPlatformObject.h 1 Oct 2006 21:07:40 -0000 1.38 --- tcPlatformObject.h 24 Oct 2006 01:34:01 -0000 1.39 *************** *** 145,148 **** --- 145,150 ---- virtual void Update(double afStatusTime); + virtual void SetController(const std::string& username); + void PrintToFile(tcFile&); void SaveToFile(tcFile& file); |
From: Dewitt C. <ddc...@us...> - 2006-10-24 01:34:07
|
Update of /cvsroot/gcblue/gcb_wx/src/network In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv8446/src/network Modified Files: tcMultiplayerInterface.cpp tcNetworkInterface.cpp Log Message: Index: tcMultiplayerInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/network/tcMultiplayerInterface.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** tcMultiplayerInterface.cpp 21 Apr 2006 23:29:09 -0000 1.35 --- tcMultiplayerInterface.cpp 24 Oct 2006 01:34:05 -0000 1.36 *************** *** 455,459 **** } ! chatText.push(message); } --- 455,459 ---- } ! //chatText.push(message); // uncomment to echo to local console } *************** *** 544,553 **** static std::string s; ! const tcPlayerStatus& status = GetPlayerStatus(connectionId); ! wxString s2 = wxString::Format("%s (%d) ", status.GetName().c_str(), ! status.GetAlliance()); ! s = s2.c_str(); s += networkInterface->GetConnectionStatus(connectionId).c_str(); --- 544,560 ---- static std::string s; ! if (!IsConnecting()) ! { ! const tcPlayerStatus& status = GetPlayerStatus(connectionId); ! wxString s2 = wxString::Format("%s (%d) ", status.GetName().c_str(), ! status.GetAlliance()); ! s = s2.c_str(); ! } ! else ! { ! s = ""; ! } s += networkInterface->GetConnectionStatus(connectionId).c_str(); *************** *** 684,687 **** --- 691,702 ---- } + bool tcMultiplayerInterface::IsConnecting() const + { + if (IsServer()) return false; + + return (networkInterface->IsConnecting()); + } + + bool tcMultiplayerInterface::IsNewPlayer(int id) { *************** *** 702,706 **** * @return true if acting as a server */ ! bool tcMultiplayerInterface::IsServer() { return networkInterface->IsServer(); --- 717,721 ---- * @return true if acting as a server */ ! bool tcMultiplayerInterface::IsServer() const { return networkInterface->IsServer(); *************** *** 1934,1939 **** UpdateNewAndExistingEntities(id); ! fprintf(stdout, "Performed entity state update, conn %d, t: %d\n", ! id, t); } --- 1949,1954 ---- UpdateNewAndExistingEntities(id); ! //fprintf(stdout, "Performed entity state update, conn %d, t: %d\n", ! // id, t); } *************** *** 2129,2133 **** static unsigned lastUpdate = 0; unsigned currentTime = tcTime::Get()->Get30HzCount(); ! if (currentTime - lastUpdate < 240) return; lastUpdate = currentTime; --- 2144,2148 ---- static unsigned lastUpdate = 0; unsigned currentTime = tcTime::Get()->Get30HzCount(); ! if (currentTime - lastUpdate < 150) return; lastUpdate = currentTime; *************** *** 2141,2146 **** myName("Server"), evtHandler(0), ! entityUpdateInterval(50), ! sensorUpdateInterval(50), goalUpdateInterval(600), acceptAllClients(true) --- 2156,2161 ---- myName("Server"), evtHandler(0), ! entityUpdateInterval(0), ! sensorUpdateInterval(30), goalUpdateInterval(600), acceptAllClients(true) *************** *** 2168,2174 **** */ tcMultiplayerInterface::tcMultiplayerInterface(const tcMultiplayerInterface& source) ! : entityUpdateInterval(10), ! sensorUpdateInterval(50), ! goalUpdateInterval(600) { wxASSERT(false); --- 2183,2189 ---- */ tcMultiplayerInterface::tcMultiplayerInterface(const tcMultiplayerInterface& source) ! : entityUpdateInterval(source.entityUpdateInterval), ! sensorUpdateInterval(source.sensorUpdateInterval), ! goalUpdateInterval(source.goalUpdateInterval) { wxASSERT(false); *************** *** 2178,2182 **** { ClearMessageMap(); ! if (networkInterface) delete networkInterface; } --- 2193,2201 ---- { ClearMessageMap(); ! ! if (networkInterface) ! { ! delete networkInterface; ! } } Index: tcNetworkInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/network/tcNetworkInterface.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** tcNetworkInterface.cpp 23 Mar 2006 01:11:02 -0000 1.22 --- tcNetworkInterface.cpp 24 Oct 2006 01:34:05 -0000 1.23 *************** *** 406,409 **** --- 406,415 ---- } + + bool tcNetworkInterface::IsConnecting() const + { + return (connectState == IS_CONNECTING); + } + /** * @return true if this interface is acting as a server *************** *** 879,885 **** tcNetworkInterface::~tcNetworkInterface() { ! if (clientSock) {clientSock->Destroy();} ! if (serverSock) {serverSock->Destroy();} ! if (datagramSock) {datagramSock->Destroy();} } --- 885,892 ---- tcNetworkInterface::~tcNetworkInterface() { ! // if (clientSock) {clientSock->Destroy();} ! // if (serverSock) {serverSock->Destroy();} // crashes in debug ! // if (datagramSock) {datagramSock->Destroy();} ! } |
From: Dewitt C. <ddc...@us...> - 2006-10-24 01:34:07
|
Update of /cvsroot/gcblue/gcb_wx/include/network In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv8449/include/network Modified Files: tcMultiplayerInterface.h tcNetworkInterface.h Log Message: Index: tcMultiplayerInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/network/tcMultiplayerInterface.h,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** tcMultiplayerInterface.h 21 Apr 2006 23:28:32 -0000 1.29 --- tcMultiplayerInterface.h 24 Oct 2006 01:33:58 -0000 1.30 *************** *** 133,137 **** bool IsChatTextAvail(); bool IsCommand(const std::string& text); ! bool IsServer(); int LogInPlayer(const std::string& username, int connectionId, tcPlayerStatus& playerStatus, wxString& msg); --- 133,138 ---- bool IsChatTextAvail(); bool IsCommand(const std::string& text); ! bool IsConnecting() const; ! bool IsServer() const; int LogInPlayer(const std::string& username, int connectionId, tcPlayerStatus& playerStatus, wxString& msg); Index: tcNetworkInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/network/tcNetworkInterface.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcNetworkInterface.h 22 Mar 2006 01:23:29 -0000 1.14 --- tcNetworkInterface.h 24 Oct 2006 01:33:58 -0000 1.15 *************** *** 68,72 **** --- 68,74 ---- unsigned int GetNumConnections(); tcConnectionData* GetConnection(int id); + bool IsConnecting() const; + void Clear(); bool IsServer() const; void MakeClient(); *************** *** 117,121 **** void AddConnection(wxSocketBase *socket); // adds new connection using socket ! void Clear(); void ClearConnectionMessages(int id); int CheckoutMessage(); --- 119,123 ---- void AddConnection(wxSocketBase *socket); // adds new connection using socket ! void ClearConnectionMessages(int id); int CheckoutMessage(); |
From: Dewitt C. <ddc...@us...> - 2006-10-24 01:34:06
|
Update of /cvsroot/gcblue/gcb_wx/include/scriptinterface In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv8449/include/scriptinterface Modified Files: tcFlightPortInterface.h tcPlatformInterface.h Log Message: Index: tcPlatformInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcPlatformInterface.h,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** tcPlatformInterface.h 16 Sep 2006 14:01:24 -0000 1.55 --- tcPlatformInterface.h 24 Oct 2006 01:34:00 -0000 1.56 *************** *** 195,198 **** --- 195,200 ---- /// returns true if launcher is effective vs. current target bool IsLauncherEffective(int anLauncher); + /// returns true if any launchers effective vs. target type + bool IsEquippedForTargetType(unsigned int class_mask); /// if target is valid, sets heading to intercept target (collision course intercept) float SetHeadingToInterceptTarget(); Index: tcFlightPortInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcFlightPortInterface.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcFlightPortInterface.h 28 Sep 2006 02:01:52 -0000 1.11 --- tcFlightPortInterface.h 24 Oct 2006 01:34:00 -0000 1.12 *************** *** 105,109 **** void SetDestination(int n, int dest_code); ! void AddCAPMission(); tcFlightPortInterface(); --- 105,109 ---- void SetDestination(int n, int dest_code); ! void AddCAPMission(float lon_rad, float lat_rad); tcFlightPortInterface(); |
From: Dewitt C. <ddc...@us...> - 2006-10-01 21:07:45
|
Update of /cvsroot/gcblue/gcb_wx/include/ai In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv6071/include/ai Modified Files: tcMission.h tcMissionManager.h Log Message: Airbase automation updates Index: tcMissionManager.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/ai/tcMissionManager.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcMissionManager.h 28 Sep 2006 02:01:53 -0000 1.1 --- tcMissionManager.h 1 Oct 2006 21:07:39 -0000 1.2 *************** *** 49,54 **** --- 49,56 ---- void AddMission(tcMission* mission_); + void DeleteMission(unsigned int missionId); std::vector<long>& GetAvailableAircraft(int targetMask); tcAirObject* GetAircraft(long id); + bool IsAircraftReserved(long id) const; void LaunchAircraft(long id); void Update(double t); *************** *** 62,67 **** std::map<long, unsigned int> reserved; ///< map of reserved aircraft (aircraft id, mission id) double lastUpdate; ! bool IsAircraftReserved(long id) const; void UpdateReserved(); }; --- 64,71 ---- std::map<long, unsigned int> reserved; ///< map of reserved aircraft (aircraft id, mission id) double lastUpdate; + std::vector<unsigned int> missionsToDelete; ! ! void PerformDeletions(); void UpdateReserved(); }; Index: tcMission.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/ai/tcMission.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcMission.h 28 Sep 2006 02:01:53 -0000 1.1 --- tcMission.h 1 Oct 2006 21:07:39 -0000 1.2 *************** *** 41,46 **** --- 41,48 ---- { public: + void EndMission(); unsigned int GetId() const; const std::vector<long>& GetMissionAircraft() const; + bool AllMissionAircraftDeparted() const; void SetMissionManager(tcMissionManager* mm); |
From: Dewitt C. <ddc...@us...> - 2006-10-01 21:07:45
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv6071/src/sim Modified Files: Game.cpp tcFlightPort.cpp tcPlatformObject.cpp tcStores.cpp Log Message: Airbase automation updates Index: tcPlatformObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcPlatformObject.cpp,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** tcPlatformObject.cpp 28 Sep 2006 02:01:53 -0000 1.64 --- tcPlatformObject.cpp 1 Oct 2006 21:07:41 -0000 1.65 *************** *** 585,588 **** --- 585,603 ---- /** + * @return true if all launchers full and not loading + */ + bool tcPlatformObject::AllLaunchersFull() + { + size_t nLaunchers = GetLauncherCount(); + for (size_t n=0; n<nLaunchers; n++) + { + tcLauncher* launcher = GetLauncher(n); + if ((launcher->IsLoading()) || (launcher->mnCurrent < launcher->capacity)) return false; + } + + return true; + } + + /** * @return true if fully equipped, done loading, and at least one * launcher is effective vs. target type *************** *** 723,726 **** --- 738,749 ---- + bool tcPlatformObject::IsReadyForLaunch() + { + bool fullyFueled = (fuel_kg >= mpDBObject->mfFuelCapacity_kg) && (!isRefueling); + bool launchersLoaded = AllLaunchersFull(); + + return fullyFueled && launchersLoaded; + } + bool tcPlatformObject::IsRefueling() const { Index: tcStores.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcStores.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcStores.cpp 6 Sep 2006 01:28:20 -0000 1.13 --- tcStores.cpp 1 Oct 2006 21:07:41 -0000 1.14 *************** *** 302,305 **** --- 302,309 ---- temp.push_back(automationOps[n]); } + else if (automationOps[n].type == type) + { + return; // op already exists, don't add again + } } automationOps = temp; Index: tcFlightPort.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcFlightPort.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** tcFlightPort.cpp 28 Sep 2006 02:01:53 -0000 1.28 --- tcFlightPort.cpp 1 Oct 2006 21:07:41 -0000 1.29 *************** *** 625,629 **** } ! int tcFlightPort::GetAirStateIdx(long id) { size_t nUnits = units.size(); --- 625,629 ---- } ! int tcFlightPort::GetAirStateIdx(long id) const { size_t nUnits = units.size(); *************** *** 927,930 **** --- 927,951 ---- /** + * @return true if unit matching id is queued for takeoff + * (goal loc == TAKEOFF) + */ + bool tcFlightPort::IsQueuedForTakeoff(long id) const + { + int idx = GetAirStateIdx(id); + if (idx < 0) return false; + + const tcAirState* airState = GetAirState((unsigned)idx); + if (airState != 0) + { + return (airState->goal_location == TAKEOFF); + } + else + { + wxASSERT(false); + return false; + } + } + + /** * Use to check status of specific spot, e.g. runway 1 * @return true if spot is empty, hangar spot is empty if hangar is not full Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.160 retrieving revision 1.161 diff -C2 -d -r1.160 -r1.161 *** Game.cpp 24 Sep 2006 19:50:20 -0000 1.160 --- Game.cpp 1 Oct 2006 21:07:41 -0000 1.161 *************** *** 795,799 **** startView->AttachOptions(tcOptions::Get()); ! startView->LoadBackgroundImage("start_background.jpg"); // start_background_dev.jpg if (startView->Init() == false) --- 795,799 ---- startView->AttachOptions(tcOptions::Get()); ! startView->LoadBackgroundImage("start_background_dev.jpg"); // start_background.jpg if (startView->Init() == false) |
From: Dewitt C. <ddc...@us...> - 2006-10-01 21:07:45
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv6071/src/common Modified Files: tcOptions.cpp Log Message: Airbase automation updates Index: tcOptions.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/tcOptions.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** tcOptions.cpp 23 Mar 2006 01:11:01 -0000 1.19 --- tcOptions.cpp 1 Oct 2006 21:07:40 -0000 1.20 *************** *** 94,102 **** oi.meType = tsOptionInfo::OT_RADIOBUTTON; ! oi.mnStateCount = 2; oi.mnValue = 0; ! oi.mpAssociated = &mbUseNTDS; oi.mzCaption[0] = "Icon (2525B) symbols"; oi.mzCaption[1] = "NTDS symbols"; AddOption(oi); --- 94,103 ---- oi.meType = tsOptionInfo::OT_RADIOBUTTON; ! oi.mnStateCount = 3; oi.mnValue = 0; ! oi.mpAssociated = &symbologyType; oi.mzCaption[0] = "Icon (2525B) symbols"; oi.mzCaption[1] = "NTDS symbols"; + oi.mzCaption[2] = "NTDS symbols (image)"; AddOption(oi); |
From: Dewitt C. <ddc...@us...> - 2006-10-01 21:07:45
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv6071/include/graphics Modified Files: tcMapView.h Log Message: Airbase automation updates Index: tcMapView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMapView.h,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** tcMapView.h 24 Sep 2006 19:50:19 -0000 1.32 --- tcMapView.h 1 Oct 2006 21:07:40 -0000 1.33 *************** *** 83,87 **** { NTDS = 0, ! M2525 = 1 }; --- 83,88 ---- { NTDS = 0, ! M2525 = 1, ! NTDS_IMAGE = 2 }; *************** *** 356,367 **** --- 357,371 ---- osg::ref_ptr<osg::Geometry> maSymbolA[4][MAX_SYMBOL]; osg::ref_ptr<osg::Geometry> maSymbolB[4][MAX_SYMBOL]; + osg::ref_ptr<osg::Geometry> maSymbolC[4][MAX_SYMBOL]; /// faded versions for stale tracks osg::ref_ptr<osg::Geometry> maSymbolA_fade[4][MAX_SYMBOL]; osg::ref_ptr<osg::Geometry> maSymbolB_fade[4][MAX_SYMBOL]; + osg::ref_ptr<osg::Geometry> maSymbolC_fade[4][MAX_SYMBOL]; /// altered versions of symbols (e.g. objects not under control of player) osg::ref_ptr<osg::Geometry> maSymbolA_alt[4][MAX_SYMBOL]; osg::ref_ptr<osg::Geometry> maSymbolB_alt[4][MAX_SYMBOL]; + osg::ref_ptr<osg::Geometry> maSymbolC_alt[4][MAX_SYMBOL]; teSymbology meSymbology; *************** *** 373,378 **** --- 377,384 ---- + void BuildImageSymbology(int symbolArray, const std::string& subdirectory); void Build2525(); void BuildNTDS(); + void BuildNTDSImage(); osg::Geometry* GetSymbol(teAffiliation aeAffiliation, teSymbol aeSymbol); |
From: Dewitt C. <ddc...@us...> - 2006-10-01 21:07:45
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv6071/src/graphics Modified Files: tc3DViewer.cpp tcContainerItem.cpp tcFlightPortGui.cpp tcMapView.cpp tcStartView.cpp Log Message: Airbase automation updates Index: tcStartView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcStartView.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcStartView.cpp 27 Mar 2006 01:08:17 -0000 1.13 --- tcStartView.cpp 1 Oct 2006 21:07:40 -0000 1.14 *************** *** 96,103 **** ! /*wxString s = wxString::Format("%s Test Build", __DATE__); ! DrawTextR(s.c_str(), 85.0, 180.0, ! GetDefaultFont(), color, 24.0, LEFT_BASE_LINE);*/ --- 96,103 ---- ! wxString s = wxString::Format("%s Test Build", __DATE__); ! DrawTextR(s.c_str(), 85.0, 225.0, ! GetDefaultFont(), color, 24.0, LEFT_BASE_LINE); Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapView.cpp,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** tcMapView.cpp 24 Sep 2006 19:50:20 -0000 1.49 --- tcMapView.cpp 1 Oct 2006 21:07:40 -0000 1.50 *************** *** 725,729 **** // update symbology selection ! meSymbology = (mpOptions->mbUseNTDS) ? NTDS : M2525; /*** Draw nav points ***/ --- 725,741 ---- // update symbology selection ! // 0 - 2525, 1 - NTDS computer, 2 - NTDS image ! if (mpOptions->symbologyType == 0) ! { ! meSymbology = M2525; ! } ! else if (mpOptions->symbologyType == 1) ! { ! meSymbology = NTDS; ! } ! else ! { ! meSymbology = NTDS_IMAGE; ! } /*** Draw nav points ***/ *************** *** 1676,1685 **** } /** ! * Creates textured osg::Geometry objects for M2525 icon symbol set */ ! void tcTacticalMapView::Build2525() { ! char zBuff[128]; osg::Geometry* pSymbol = 0; --- 1688,1712 ---- } + + void tcTacticalMapView::Build2525() + { + BuildImageSymbology(0, "m2525"); + } + + void tcTacticalMapView::BuildNTDSImage() + { + BuildImageSymbology(1, "ntds"); + } + + /** ! * Creates textured osg::Geometry objects for symbology described in image files ! * @param subdirectory directory within images\symbology to read files from ! * */ ! void tcTacticalMapView::BuildImageSymbology(int symbolArray, const std::string& subdirectory) { ! const size_t nBuff = 128; ! char zBuff[nBuff]; osg::Geometry* pSymbol = 0; *************** *** 1704,1738 **** } ! sprintf(zBuff,"seasurface%s",zAffil); osg::Geometry* pSurface = CreateTexturedSymbol(zBuff); ! sprintf(zBuff,"carrier%s",zAffil); osg::Geometry* pCarrier = CreateTexturedSymbol(zBuff); ! sprintf(zBuff,"air_fw%s",zAffil); osg::Geometry* pAir = CreateTexturedSymbol(zBuff); ! sprintf(zBuff,"air_rw%s",zAffil); osg::Geometry* pHelo = CreateTexturedSymbol(zBuff); ! sprintf(zBuff,"missile%s",zAffil); osg::Geometry* pMissile = CreateTexturedSymbol(zBuff); ! sprintf(zBuff,"fixed%s",zAffil); osg::Geometry* pFixed = CreateTexturedSymbol(zBuff); ! sprintf(zBuff,"airfield%s",zAffil); osg::Geometry* pAirfield = CreateTexturedSymbol(zBuff); ! sprintf(zBuff,"sub%s",zAffil); osg::Geometry* pSub = CreateTexturedSymbol(zBuff); ! sprintf(zBuff,"torp%s",zAffil); osg::Geometry* pTorpedo = CreateTexturedSymbol(zBuff); osg::Geometry* pMark = DrawDefaultMark((teAffiliation)nAffiliation); ! ! osg::Geometry* pUnknown = CreateTexturedSymbol("unknown.png"); --- 1731,1765 ---- } ! _snprintf(zBuff, nBuff, "%s\\seasurface%s", subdirectory.c_str(), zAffil); osg::Geometry* pSurface = CreateTexturedSymbol(zBuff); ! _snprintf(zBuff, nBuff, "%s\\carrier%s", subdirectory.c_str(), zAffil); osg::Geometry* pCarrier = CreateTexturedSymbol(zBuff); ! _snprintf(zBuff, nBuff, "%s\\air_fw%s", subdirectory.c_str(), zAffil); osg::Geometry* pAir = CreateTexturedSymbol(zBuff); ! _snprintf(zBuff, nBuff, "%s\\air_rw%s", subdirectory.c_str(), zAffil); osg::Geometry* pHelo = CreateTexturedSymbol(zBuff); ! _snprintf(zBuff, nBuff, "%s\\missile%s", subdirectory.c_str(), zAffil); osg::Geometry* pMissile = CreateTexturedSymbol(zBuff); ! _snprintf(zBuff, nBuff, "%s\\fixed%s", subdirectory.c_str(), zAffil); osg::Geometry* pFixed = CreateTexturedSymbol(zBuff); ! _snprintf(zBuff, nBuff, "%s\\airfield%s", subdirectory.c_str(), zAffil); osg::Geometry* pAirfield = CreateTexturedSymbol(zBuff); ! _snprintf(zBuff, nBuff, "%s\\sub%s", subdirectory.c_str(), zAffil); osg::Geometry* pSub = CreateTexturedSymbol(zBuff); ! _snprintf(zBuff, nBuff, "%s\\torp%s", subdirectory.c_str(), zAffil); osg::Geometry* pTorpedo = CreateTexturedSymbol(zBuff); osg::Geometry* pMark = DrawDefaultMark((teAffiliation)nAffiliation); ! _snprintf(zBuff, nBuff, "%s\\unknown.png", subdirectory.c_str()); ! osg::Geometry* pUnknown = CreateTexturedSymbol(zBuff); *************** *** 1782,1786 **** break; } ! maSymbolB[nAffiliation][nSymbol] = pSymbol; } } --- 1809,1820 ---- break; } ! if (symbolArray == 0) ! { ! maSymbolB[nAffiliation][nSymbol] = pSymbol; ! } ! else ! { ! maSymbolC[nAffiliation][nSymbol] = pSymbol; ! } } } *************** *** 1819,1822 **** --- 1853,1866 ---- } { + osg::Geometry* fadedC = new osg::Geometry(*maSymbolC[nAffiliation][nSymbol]); + osg::Vec4Array* colors = new osg::Vec4Array; + colors->push_back(osg::Vec4(0.4, 0.4, 0.4, 1.0)); + fadedC->setColorArray(colors); + fadedC->setColorBinding(osg::Geometry::BIND_OVERALL); + + maSymbolC_fade[nAffiliation][nSymbol] = fadedC; + } + + { osg::Geometry* altA = new osg::Geometry(*maSymbolA[nAffiliation][nSymbol]); *************** *** 1838,1841 **** --- 1882,1894 ---- maSymbolB_alt[nAffiliation][nSymbol] = altB; } + { + osg::Geometry* altC = new osg::Geometry(*maSymbolC[nAffiliation][nSymbol]); + osg::Vec4Array* colors = new osg::Vec4Array; + colors->push_back(osg::Vec4(0.6, 0.6, 0.8, 1.0)); + altC->setColorArray(colors); + altC->setColorBinding(osg::Geometry::BIND_OVERALL); + + maSymbolC_alt[nAffiliation][nSymbol] = altC; + } } *************** *** 1861,1868 **** return maSymbolA[nAffilIdx][nSymbolIdx].get(); } ! else { return maSymbolB[nAffilIdx][nSymbolIdx].get(); } } --- 1914,1925 ---- return maSymbolA[nAffilIdx][nSymbolIdx].get(); } ! else if (meSymbology == M2525) { return maSymbolB[nAffilIdx][nSymbolIdx].get(); } + else + { + return maSymbolC[nAffilIdx][nSymbolIdx].get(); + } } *************** *** 1881,1888 **** return maSymbolA_alt[nAffilIdx][nSymbolIdx].get(); } ! else { return maSymbolB_alt[nAffilIdx][nSymbolIdx].get(); } } --- 1938,1949 ---- return maSymbolA_alt[nAffilIdx][nSymbolIdx].get(); } ! else if (meSymbology == M2525) { return maSymbolB_alt[nAffilIdx][nSymbolIdx].get(); } + else + { + return maSymbolC_alt[nAffilIdx][nSymbolIdx].get(); + } } *************** *** 1901,1908 **** return maSymbolA_fade[nAffilIdx][nSymbolIdx].get(); } ! else { return maSymbolB_fade[nAffilIdx][nSymbolIdx].get(); } } --- 1962,1973 ---- return maSymbolA_fade[nAffilIdx][nSymbolIdx].get(); } ! else if (meSymbology == M2525) { return maSymbolB_fade[nAffilIdx][nSymbolIdx].get(); } + else + { + return maSymbolC_fade[nAffilIdx][nSymbolIdx].get(); + } } *************** *** 2433,2436 **** --- 2498,2502 ---- BuildNTDS(); Build2525(); + BuildNTDSImage(); CreateAlternateSymbols(); Index: tcFlightPortGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcFlightPortGui.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcFlightPortGui.cpp 28 Sep 2006 02:01:53 -0000 1.10 --- tcFlightPortGui.cpp 1 Oct 2006 21:07:40 -0000 1.11 *************** *** 37,40 **** --- 37,42 ---- #include "tcPlatformObject.h" #include "tcSimState.h" + #include <osg/Geometry> + #include "ai/tcMissionManager.h" #ifdef _DEBUG *************** *** 167,170 **** --- 169,173 ---- captionColor, 18.0f, LEFT_BASE_LINE); + // draw slots and items size_t nSlots = slots.size(); *************** *** 175,189 **** bool isMouseOver = slot.IsMouseOver(); if (item) { int drawState = item->GetDrawState(); ! bool doDraw = (drawState == tcContainerItem::NORMAL) || ! ((drawState == tcContainerItem::BLINK) && blinkOn); ! if (doDraw) { ! osg::Geometry* icon = slot.GetIcon(); ! DrawGeometryR(icon, slot.loc.XCenter(), slot.loc.YCenter()); ! } // draw description caption if mouse is over slot --- 178,224 ---- bool isMouseOver = slot.IsMouseOver(); + bool unitQueuedForTakeoff = false; if (item) { int drawState = item->GetDrawState(); ! osg::Vec4 itemColor(1, 1, 1, 1); ! /* Determine item color (color mixed with image color) ! ** Damaged - red ! ** Not fully equipped and refueled - yellow ! ** Repositioning - blink blue ! ** Reserved for mission - darken 50% ! */ ! tcPlatformObject* platform = dynamic_cast<tcPlatformObject*>(item->GetEntity()); ! if (platform != 0) { ! if (platform->GetDamageLevel() > 0) ! { ! itemColor.set(1, 0, 0, 1); ! } ! else if (!platform->IsReadyForLaunch()) ! { ! itemColor.set(1, 1, 0.5, 1); ! } ! else if ((drawState == tcContainerItem::BLINK) && !blinkOn) ! { ! itemColor.set(0.5, 0.5, 1, 1); ! } ! ! if (flightPort->GetMissionManager()->IsAircraftReserved(platform->mnID)) ! { ! itemColor = itemColor * 0.7; ! } ! ! unitQueuedForTakeoff = flightPort->IsQueuedForTakeoff(platform->mnID); ! } ! ! osg::Geometry* icon = slot.GetIcon(); ! ! osg::Vec4Array* colorArray = dynamic_cast<osg::Vec4Array*>(icon->getColorArray()); // assumes color array already created ! colorArray->back() = itemColor; ! ! DrawGeometryR(icon, slot.loc.XCenter(), slot.loc.YCenter()); ! // draw description caption if mouse is over slot *************** *** 205,212 **** borderColor.set(1, 1, 1, 1); } else { ! borderColor.set(0.5, 0.5, 0.5, 1); } DrawRectangleR(r, borderColor, tc3DWindow::FILL_OFF); --- 240,252 ---- borderColor.set(1, 1, 1, 1); } + else if (unitQueuedForTakeoff) + { + borderColor.set(0.8, 1.0, 0.8, 1.0); + } else { ! borderColor.set(0.5, 0.5, 0.5, 1.0); } + DrawRectangleR(r, borderColor, tc3DWindow::FILL_OFF); Index: tcContainerItem.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcContainerItem.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcContainerItem.cpp 23 Mar 2006 01:11:02 -0000 1.3 --- tcContainerItem.cpp 1 Oct 2006 21:07:40 -0000 1.4 *************** *** 29,32 **** --- 29,33 ---- #include "tcContainerItem.h" #include "tcContainerGui.h" + #include <osg/CopyOp> #include <osg/Geometry> *************** *** 93,97 **** void tcContainerItem::SetIcon(osg::Geometry* icon_) { ! icon = icon_; } --- 94,98 ---- void tcContainerItem::SetIcon(osg::Geometry* icon_) { ! icon = new osg::Geometry(*icon_, osg::CopyOp(osg::CopyOp::DEEP_COPY_DRAWABLES)); } Index: tc3DViewer.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DViewer.cpp,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** tc3DViewer.cpp 24 Sep 2006 19:50:20 -0000 1.38 --- tc3DViewer.cpp 1 Oct 2006 21:07:40 -0000 1.39 *************** *** 1949,1953 **** { viewerText->setPosition(osg::Vec3(20.0f,(float)mnHeight - 40.0f,0.0f)); ! viewerText->setAlignment(osgText::Text::AlignmentType::LEFT_BASE_LINE); } else if (positionCode == 1) --- 1949,1953 ---- { viewerText->setPosition(osg::Vec3(20.0f,(float)mnHeight - 40.0f,0.0f)); ! viewerText->setAlignment(osgText::Text::LEFT_BASE_LINE); } else if (positionCode == 1) *************** *** 1955,1959 **** viewerText->setPosition(osg::Vec3(0.5f * (float)mnWidth, (float)mnHeight - 40.0f, 0.0f)); ! viewerText->setAlignment(osgText::Text::AlignmentType::CENTER_CENTER); } else --- 1955,1959 ---- viewerText->setPosition(osg::Vec3(0.5f * (float)mnWidth, (float)mnHeight - 40.0f, 0.0f)); ! viewerText->setAlignment(osgText::Text::CENTER_CENTER); } else *************** *** 1961,1965 **** viewerText->setPosition(osg::Vec3(0.5f * (float)mnWidth, (float)40.0f, 0.0f)); ! viewerText->setAlignment(osgText::Text::AlignmentType::CENTER_CENTER); } } --- 1961,1965 ---- viewerText->setPosition(osg::Vec3(0.5f * (float)mnWidth, (float)40.0f, 0.0f)); ! viewerText->setAlignment(osgText::Text::CENTER_CENTER); } } *************** *** 1974,1987 **** AddTextObject(0, upperLeft, 12.0, color, ! osgText::Text::AlignmentType::LEFT_BASE_LINE); AddTextObject(1, upperRight, 12.0, color, ! osgText::Text::AlignmentType::LEFT_BASE_LINE); 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); } --- 1974,1987 ---- AddTextObject(0, upperLeft, 12.0, color, ! osgText::Text::LEFT_BASE_LINE); AddTextObject(1, upperRight, 12.0, color, ! osgText::Text::LEFT_BASE_LINE); AddTextObject(2, bottomCenter, 16.0, osg::Vec4(0.9f, 0.9f, 0.7f, 0.9f), ! osgText::Text::CENTER_CENTER); AddTextObject(3, topCenter, 16.0, osg::Vec4(0.9f, 0.9f, 0.7f, 0.9f), ! osgText::Text::CENTER_CENTER); } *************** *** 2106,2110 **** { pm = new osg::PolygonMode(); ! pm->setMode(osg::PolygonMode::Face::FRONT_AND_BACK, osg::PolygonMode::FILL); stateSet->setAttribute(pm, osg::StateAttribute::ON); } --- 2106,2110 ---- { pm = new osg::PolygonMode(); ! pm->setMode(osg::PolygonMode::FRONT_AND_BACK, osg::PolygonMode::FILL); stateSet->setAttribute(pm, osg::StateAttribute::ON); } *************** *** 2112,2120 **** if (viewWireframe) { ! pm->setMode(osg::PolygonMode::Face::FRONT_AND_BACK, osg::PolygonMode::LINE); } else { ! pm->setMode(osg::PolygonMode::Face::FRONT_AND_BACK, osg::PolygonMode::FILL); } --- 2112,2120 ---- if (viewWireframe) { ! pm->setMode(osg::PolygonMode::FRONT_AND_BACK, osg::PolygonMode::LINE); } else { ! pm->setMode(osg::PolygonMode::FRONT_AND_BACK, osg::PolygonMode::FILL); } |
From: Dewitt C. <ddc...@us...> - 2006-10-01 21:07:45
|
Update of /cvsroot/gcblue/gcb_wx/src/ai In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv6071/src/ai Modified Files: tcCAPMission.cpp tcMission.cpp tcMissionManager.cpp Log Message: Airbase automation updates Index: tcMission.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/ai/tcMission.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcMission.cpp 28 Sep 2006 02:01:54 -0000 1.1 --- tcMission.cpp 1 Oct 2006 21:07:40 -0000 1.2 *************** *** 35,38 **** --- 35,63 ---- unsigned long tcMission::nextId = 1; + /** + * @return true if all mission aircraft do not exist within flightport + * Normally this occurs when all have launched (could also be due to damage) + */ + bool tcMission::AllMissionAircraftDeparted() const + { + for (size_t n=0; n<missionAircraft.size(); n++) + { + if (missionManager->GetAircraft(missionAircraft[n]) != 0) + { + return false; + } + } + + return true; + } + + /** + * End mission (safely deletes from mission manager) + */ + void tcMission::EndMission() + { + missionManager->DeleteMission(id); + } + unsigned int tcMission::GetId() const { Index: tcCAPMission.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/ai/tcCAPMission.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcCAPMission.cpp 28 Sep 2006 02:01:53 -0000 1.1 --- tcCAPMission.cpp 1 Oct 2006 21:07:40 -0000 1.2 *************** *** 101,104 **** --- 101,108 ---- { // verify all aircraft have launched and end mission + if (AllMissionAircraftDeparted()) + { + EndMission(); + } } Index: tcMissionManager.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/ai/tcMissionManager.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcMissionManager.cpp 28 Sep 2006 02:01:54 -0000 1.1 --- tcMissionManager.cpp 1 Oct 2006 21:07:40 -0000 1.2 *************** *** 45,48 **** --- 45,53 ---- } + void tcMissionManager::DeleteMission(unsigned int missionId) + { + missionsToDelete.push_back(missionId); + } + tcAirObject* tcMissionManager::GetAircraft(long id) { *************** *** 95,98 **** --- 100,134 ---- + /** + * Called internally to perform queued deletions + */ + void tcMissionManager::PerformDeletions() + { + if (missionsToDelete.size() == 0) return; + + std::vector<tcMission*> temp; + + for (size_t n=0; n<missions.size(); n++) + { + unsigned int missionId = missions[n]->GetId(); + bool deleteMatch = false; + for (size_t k=0; (k<missionsToDelete.size()) && (!deleteMatch); k++) + { + if (missionsToDelete[k] == missionId) deleteMatch = true; + } + + if (!deleteMatch) + { + temp.push_back(missions[n]); + } + else + { + delete missions[n]; + } + } + + missions = temp; + } + void tcMissionManager::Update(double t) { *************** *** 104,107 **** --- 140,147 ---- missions[n]->Update(t); } + + PerformDeletions(); + + UpdateReserved(); } |
From: Dewitt C. <ddc...@us...> - 2006-10-01 21:07:45
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv6071/include/sim Modified Files: tcFlightPort.h tcPlatformObject.h Log Message: Airbase automation updates Index: tcFlightPort.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcFlightPort.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcFlightPort.h 28 Sep 2006 02:01:52 -0000 1.15 --- tcFlightPort.h 1 Oct 2006 21:07:40 -0000 1.16 *************** *** 123,127 **** tcAirState* GetAirState(unsigned n); const tcAirState* GetAirState(unsigned n) const; ! int GetAirStateIdx(long id); size_t GetCount() const {return units.size();} tsSpotInfo* GetCurrentSpotInfo(tcAirState *airstate); --- 123,127 ---- tcAirState* GetAirState(unsigned n); const tcAirState* GetAirState(unsigned n) const; ! int GetAirStateIdx(long id) const; size_t GetCount() const {return units.size();} tsSpotInfo* GetCurrentSpotInfo(tcAirState *airstate); *************** *** 138,141 **** --- 138,142 ---- int Launch(int runway); // order unit on runway to take off int LaunchID(long id); // order unit with id to take off (if on runway) + bool IsQueuedForTakeoff(long id) const; bool MoveToLaunchQueue(tcAirState *airstate); Index: tcPlatformObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcPlatformObject.h,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** tcPlatformObject.h 28 Sep 2006 02:01:52 -0000 1.37 --- tcPlatformObject.h 1 Oct 2006 21:07:40 -0000 1.38 *************** *** 128,132 **** --- 128,134 ---- bool IsCapableVsTargetType(int targetFlag); bool IsEquippedForTargetType(int targetFlag); + bool IsReadyForLaunch(); bool AllLaunchersEmpty(); + bool AllLaunchersFull(); void UnloadAllLaunchers(); void EquipForTargetType(int targetFlag); |
From: Dewitt C. <ddc...@us...> - 2006-10-01 21:07:45
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv6071/include/common Modified Files: tcOptions.h Log Message: Airbase automation updates Index: tcOptions.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/tcOptions.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcOptions.h 22 Mar 2006 01:23:28 -0000 1.13 --- tcOptions.h 1 Oct 2006 21:07:40 -0000 1.14 *************** *** 68,72 **** int mnMapMode; int mbFillRangeCircles; ! int mbUseNTDS; int max3Drange; ///< 0 - 50 km, 1 - 75 km, 2 - 100 km --- 68,72 ---- int mnMapMode; int mbFillRangeCircles; ! int symbologyType; // 0 - 2525, 1 - NTDS computer, 2 - NTDS image int max3Drange; ///< 0 - 50 km, 1 - 75 km, 2 - 100 km |
From: Dewitt C. <ddc...@us...> - 2006-09-28 02:02:25
|
Update of /cvsroot/gcblue/gcb_wx/database/csv In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32752/database/csv Modified Files: air.csv Log Message: Initial airbase automation work Index: air.csv =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/database/csv/air.csv,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** air.csv 20 Aug 2006 22:39:48 -0000 1.1 --- air.csv 28 Sep 2006 02:01:51 -0000 1.2 *************** *** 1,19 **** "DatabaseClass","ModelClassId","ClassificationId","Cost","ImageList","IconFileName","ModelFileName","Description","Rcs_dbsm","MaxSpeed_kts","Accel_ktsps","TurnRate_degps","FuelCapacity_kg","FuelRate_kgps","MaxAltitude_m","MaxDepth_m","AltitudeRate_mps","Toughness","Damage","Weight_kg","MaxThrust_N","Range_km","IsCarrierCompatible","FlightportClass","L1_class","L1_name","L2_class","L2_name","L3_class","L3_name","L4_class","L4_name","L5_class","L5_name","L6_class","L6_name","L7_class","L7_name","L8_class","L8_name","L9_class","L9_name","L10_class","L10_name","L11_class","L11_name","L12_class","L12_name","L13_class","L13_name","L14_class","L14_name","L15_class","L15_name","L16_class","L16_name","M1_class","M2_class","M3_class","S1_class","S1_az","S2_class","S2_az","S3_class","S3_az","S4_class","S4_az","S5_class","S5_az","S6_class","S6_az","S7_class","S7_az","S8_class","S8_az","ABFuelRate_kgps","ABThrust_N","Cdpsub","Cdptran","Cdpsup","Mcm","Msupm","Kdi","StallSpeed_mps","Gmax","T2","T4","T6","T8","T10","T12","T16","T20","T25","T30","FE2","FE4","FE6","FE8","FE10","FE12","FE16","FE20","FE25","FE30" ! "Tu-22ME","12","33","50000000","","air/tu22ico.jpg","tu-22.xml","Long-range supersonic bomber","20","1100","20","10","25000","1","13000","0","0","3","0","80000","100000","0","0","","Tu-22M Kh-22 Launcher","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Down Beat SS","0","Eyeball-2","0","","0","","0","","0","","0","","0","","0","8","325000","2.5","4","3","0.9","1.1","2","50","0","1","0.9","0.9","0.85","0.8","0.6","0","0","0","0","1","0.95","0.9","0.85","0.8","1","1.4","2","2","2" ! "Su-33","12","33","25000005","su27-34p04.jpg;su27-2.jpg;su27-34p03.jpg;su27-06.jpg","air/su27ico.jpg","su-27.xml","Carrier-based version of the Su-27","10","1350","20","20","6350","3","19800","0","0","1","0","18000","90000","0","1","","Su-27 W1","Wing tips","Su-27 W2","Wings","Su-27 F","Fuselage","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","N001E Myech AS","0","N001E Myech R AS","180","Eyeball-2","0","","0","","0","","0","","0","","0","12","245600","1.2","1.4","1.3","0.9","1.1","2","50","0","1","0.9","0.8","0.75","0.73","0.72","0.35","0.1","0.05","0","1","0.95","0.9","0.85","0.8","1","1.4","2","2","2" ! "Su-30MKK","12","33","25000006","su30-01.jpg;su33-s.jpg","air/su30ico.jpg","su-30.xml","Chinese export version of Su-30 with air to ground missiles. Carries the latest Russian AAMs including the medium range R-77 'AMRAAM-ski'. (ref www.fas.org)","10","1200","20","20","4000","1.7","17300","0","0","1","0","24900","100000","0","0","","Su-30 W1","Wing tips","Su-30 W2","Wings","Su-30 F","Fuselage","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","N001E Myech AS","0","N001E Myech R AS","180","Eyeball-2","0","","0","","0","","0","","0","","0","8","262000","1.3","1.6","1.5","0.9","1.1","3","50","0","1","0.9","0.8","0.75","0.7","0.65","0.3","0","0","0","1","0.95","0.9","0.85","0.8","1","1.4","1.6","1.8","2" ! "Su-27","12","33","25000005","su27-34p04.jpg;su27-2.jpg;su27-34p03.jpg;su27-06.jpg","air/su27ico.jpg","su-27.xml","The Su-27 Flanker is a high performance fighter capable of carrying up to 10 AAMs. In service in Russia, China, and Vietnam.","10","1350","20","20","6350","3","19800","0","0","1","0","18000","90000","0","0","","Su-27 W1","Wing tips","Su-27 W2","Wings","Su-27 F","Fuselage","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","N001E Myech AS","0","N001E Myech R AS","180","Eyeball-2","0","","0","","0","","0","","0","","0","12","245600","1.2","1.4","1.3","0.9","1.1","2","50","0","1","0.9","0.8","0.75","0.73","0.72","0.35","0.1","0.05","0","1","0.95","0.9","0.85","0.8","1","1.4","2","2","2" ! "Mirage-IIIE","12","33","12000000","","air/mirIIIico.jpg","mirage-f1.xml","Mirage-IIIE","10","1268","20","18","3600","1","17000","0","84","1","0","13500","40000","0","1","","MirIII IW","Inner wing","MirIII OW","Outer wing","MirIII CP","Center pylon","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Cyrano-IV","0","Eyeball-2","0","","0","","0","","0","","0","","0","","0","9.5","77000","1.1","1.3","1.2","0.9","1.1","2","50","0","1","1","0.9","0.85","0.8","0.6","0.3","0.1","0.05","0","1","0.95","0.9","0.85","0.8","1","1.4","2","2","2" ! "Mirage-F1","12","33","18000000","","air/mirf1ico.jpg","mirage-f1.xml","Mirage-F1","10","1370","20","20","3400","1","19100","0","215","1","0","15000","50000","0","1","","Mirage-F1 center pylon","Center","Mirage-F1 AAM rail","Wing rail","Mirage-F1 AAM rail","Wing rail","Mirage-F1 AAM rail","Wing rail","Mirage-F1 AAM rail","Wing rail","Mirage-F1 AAM rail","Wing rail","Mirage-F1 AAM rail","Wing rail","","","","","","","","","","","","","","","","","","","","","","Cyrano-IV","0","Eyeball-2","0","","0","","0","","0","","0","","0","","0","10","230000","1","1.2","1.1","0.9","1.1","2","50","0","1","1","0.9","0.85","0.8","0.6","0.3","0.1","0.05","0","1","0.95","0.9","0.85","0.8","1","1.4","2","2","2" ! "Mirage-2000","12","33","23000000","","air/mir2000ico.jpg","mirage-f1.xml","Mirage 2000 multirole fighter","10","1270","20","18","4300","1.2","18000","0","285","1","0","15000","62000","0","1","","Mir2000 W1","Outer wing","Mir2000 W2","Inner wing","Mir2000 Fuselage","Fuselage","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Thales RDY","0","Eyeball-2","0","","0","","0","","0","","0","","0","","0","10.5","180000","1.2","1.4","1.3","0.9","1.1","2","50","0","1","1","0.9","0.8","0.75","0.72","0.35","0.1","0.05","0","1","0.95","0.9","0.85","0.8","1","1.4","2","2","2" ! "MiG-29","12","33","30000000","","air/mig29ico.jpg","mig-29.xml","Advanced multi-role fighter similar to F-15C. ","10","1350","20","20","4000","1.3","18400","0","0","1","0","14000","50000","0","1","","AA-12 Launcher","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Fighter radar","0","Eyeball-2","0","","0","","0","","0","","0","","0","","0","8","172800","0.7","1.1","0.75","0.9","1.1","2","50","0","1","0.9","0.8","0.75","0.73","0.72","0.35","0.1","0.05","0","1","0.95","0.9","0.85","0.8","1","1.4","2","2","2" ! "MiG-27","12","33","13000000","","air/mig27ico.jpg","harrier-gr3.xml","MiG-27 Flogger D","10","1018","20","16","5000","1.6","14000","0","200","1","0","18100","81000","0","0","","MiG-27 W1","Wing gloves","MiG-27 Fuselage","Fuselage","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Cyrano-IV","0","Eyeball-2","0","","0","","0","","0","","0","","0","","0","9.5","123000","1.2","1.4","1.5","0.9","1.1","2","50","0","1","0.9","0.8","0.75","0.7","0.5","0.35","0.1","0.05","0","1","0.95","0.9","0.85","0.8","1","1.4","2","2","2" ! "MiG-25","12","33","25000000","","air/mig25ico.jpg","mig-29.xml","MiG-25 Foxbat","10","1600","20","12","8000","4","24400","0","270","1","0","27000","112000","0","0","","MiG-25 W1","Outer wing","MiG-25 W2","Inner wing","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","RP-25 Smerch radar","0","Eyeball-2","0","","0","","0","","0","","0","","0","","0","12","220000","0.7","1.5","0.8","0.9","1.1","2","50","0","1","0.9","0.8","0.75","0.73","0.72","0.35","0.12","0.1","0","1","0.95","0.9","0.85","0.8","1","1.4","2","2","2" ! "MiG-23","12","33","10000000","","air/mig23ico.jpg","harrier-gr3.xml","MiG-23 Flogger","10","1350","20","16","4000","1.65","18500","0","240","1","0","15700","83600","0","1","","MiG-23 W1","Wing glove","MiG-23 W2","Inner wing","MiG-23 Fuselage","Fuselage","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Cyrano-IV","0","Eyeball-2","0","","0","","0","","0","","0","","0","","0","10","127000","1.2","1.4","1.5","0.9","1.1","2","50","0","1","0.9","0.8","0.75","0.7","0.5","0.35","0.1","0.05","0","1","0.95","0.9","0.85","0.8","1","1.4","2","2","2" ! "Harrier GR3a-STK","12","33","15000000","","air/gr3ico.jpg","harrier-gr3.xml","Single-engine; ""jump-jet"" fighter-bomber designed to fly from combat areas and aircraft carriers and to support ground forces. It was made by Hawker Siddeley Aviation and first flew on Aug. 31; 1966; after a long period of development.Powered by a vectored-thrust turbofan engine; the plane diverted its engine thrust downward for vertical takeoff using rotatable engine exhaust ports. It could carry a combination of armaments; including air-to-air missiles; air-to-surface antiship missiles; rockets; bombs.??????","10","570","20","20","3000","1.3","15600","0","0","1","0","15000","60000","0","1","","AAM-SR Launcher","","AGM Launcher","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Fighter radar","0","Eyeball-2","0","","0","","0","","0","","0","","0","","0","8","90000","1","5","20","0.9","1.1","2","50","0","1","0.9","0.8","0.75","0.7","0.5","0.05","0","0","0","1","0.95","0.9","0.85","0.8","1","1.4","2","2","2" ! "Harrier GR3a","12","33","15000000","","air/gr3ico.jpg","harrier-gr3.xml","Single-engine; ""jump-jet"" fighter-bomber designed to fly from combat areas and aircraft carriers and to support ground forces. It was made by Hawker Siddeley Aviation and first flew on Aug. 31; 1966; after a long period of development.Powered by a vectored-thrust turbofan engine; the plane diverted its engine thrust downward for vertical takeoff using rotatable engine exhaust ports. It could carry a combination of armaments; including air-to-air missiles; air-to-surface antiship missiles; rockets; bombs.??????","10","570","20","20","3000","1.3","15600","0","0","1","0","15000","60000","0","1","","AAM-SR Launcher","","AAM-SR Launcher","","Harrier Bomb Mount","","Harrier Bomb Mount","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Fighter radar","0","Eyeball-2","0","","0","","0","","0","","0","","0","","0","8","90000","1","5","20","0.9","1.1","2","50","0","1","0.9","0.8","0.75","0.7","0.5","0.05","0","0","0","1","0.95","0.9","0.85","0.8","1","1.4","2","2","2" ! "F-5E","12","33","21000000","","air/f5ico.jpg","mirage-f1.xml","F-5E Tiger II / Freedom Fighter","10","1700","20","18","3500","1.2","15800","0","175","1","0","11500","52000","0","0","","F-16 W1","Wing tips","F-16 W2","Mid-wing","F-16 W3","Inner wing","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","AN/APG-66","0","Eyeball-2","0","","0","","0","","0","","0","","0","","0","6","110000","1.2","1.4","1.28","0.9","1.1","2","50","0","1","0.9","0.8","0.75","0.73","0.72","0.35","0.1","0.05","0","1","0.95","0.9","0.85","0.8","1","1.4","2","2","2" ! "F-4E","12","33","15000000","","air/f4ico.jpg","su-27.xml","F-4E Phantom II","11","1279","20","14","4500","2.2","18300","0","210","1","0","18825","79600","0","1","","F-4 W1","Wing tips","F-4 W2","Mid-wing","F-4 Fuselage","Fuselage","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","AN/APG-66","0","Eyeball-2","0","","0","","0","","0","","0","","0","","0","13","230000","1.5","1.7","1.5","0.9","1.1","2","50","0","1","0.9","0.8","0.75","0.73","0.72","0.35","0","0","0","1","0.95","0.9","0.85","0.8","1","1.4","1.7","2","2" ! "F-16C","12","33","25000000","f16-15.jpg;f16-20-pakistan.jpg","air/f16ico.jpg","mig-29.xml","F-16 Fighting Falcon","10","1150","20","20","4000","1.2","17000","0","255","1","0","14000","60000","0","0","","F-16 W1","Wing tips","F-16 W2","Mid-wing","F-16 W3","Inner wing","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","AN/APG-66","0","Eyeball-2","0","","0","","0","","0","","0","","0","","0","6","185000","1.2","1.4","1.28","0.9","1.1","2","50","0","1","0.9","0.8","0.75","0.73","0.72","0.35","0.1","0.05","0","1","0.95","0.9","0.85","0.8","1","1.4","2","2","2" ! "F-15C","12","33","29900000","","air/f15ico.jpg","su-27.xml","F-15C Eagle","10","1434","20","18","6103","1.7","19800","0","255","1","0","20200","104000","0","0","","F-15 W1","Wing tips","F-15 W2","Mid-wing","F-15 Fuselage","Fuselage","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","AN/APG-70/71","0","Eyeball-2","0","","0","","0","","0","","0","","0","","0","12","258000","1.2","1.4","1.3","0.9","1.1","2","50","0","1","0.9","0.83","0.77","0.75","0.73","0.37","0.13","0.07","0","1","0.95","0.9","0.85","0.8","1","1.4","1.7","2","2" ! "F-14B","12","33","38000000","","air/f14ico.jpg","su-27.xml","F-14B Super Tomcat","12","1341","20","16","9072","1.8","17000","0","230","1","0","28000","95000","0","1","","F-14 W1","Wing tips","F-14 W2","Mid-wing","F-14 Fuselage","Fuselage","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","AN/APG-70/71","0","Eyeball-2","0","","0","","0","","0","","0","","0","","0","12","252000","1.4","1.6","1.4","0.9","1.1","2","50","0","1","0.9","0.8","0.75","0.73","0.72","0.35","0.1","0.05","0","1","0.95","0.9","0.85","0.8","1","1.4","1.7","2","2" --- 1,19 ---- "DatabaseClass","ModelClassId","ClassificationId","Cost","ImageList","IconFileName","ModelFileName","Description","Rcs_dbsm","MaxSpeed_kts","Accel_ktsps","TurnRate_degps","FuelCapacity_kg","FuelRate_kgps","MaxAltitude_m","MaxDepth_m","AltitudeRate_mps","Toughness","Damage","Weight_kg","MaxThrust_N","Range_km","IsCarrierCompatible","FlightportClass","L1_class","L1_name","L2_class","L2_name","L3_class","L3_name","L4_class","L4_name","L5_class","L5_name","L6_class","L6_name","L7_class","L7_name","L8_class","L8_name","L9_class","L9_name","L10_class","L10_name","L11_class","L11_name","L12_class","L12_name","L13_class","L13_name","L14_class","L14_name","L15_class","L15_name","L16_class","L16_name","M1_class","M2_class","M3_class","S1_class","S1_az","S2_class","S2_az","S3_class","S3_az","S4_class","S4_az","S5_class","S5_az","S6_class","S6_az","S7_class","S7_az","S8_class","S8_az","ABFuelRate_kgps","ABThrust_N","Cdpsub","Cdptran","Cdpsup","Mcm","Msupm","Kdi","StallSpeed_mps","Gmax","T2","T4","T6","T8","T10","T12","T16","T20","T25","T30","FE2","FE4","FE6","FE8","FE10","FE12","FE16","FE20","FE25","FE30" ! "Tu-22ME",12,33,50000000,,"air/tu22ico.jpg","tu-22.xml","Long-range supersonic bomber",20,1100,20,10,25000,1,13000,0,0,3,0,80000,100000,0,0,,"Tu-22M Kh-22 Launcher",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"Down Beat SS",0,"Eyeball-2",0,,0,,0,,0,,0,,0,,0,8,325000,2.5,4,3,0.9,1.1,2,50,0,1,0.9,0.9,0.85,0.8,0.6,0,0,0,0,1,0.95,0.9,0.85,0.8,1,1.4,2,2,2 ! "Su-33",12,33,25000005,"su27-34p04.jpg;su27-2.jpg;su27-34p03.jpg;su27-06.jpg","air/su27ico.jpg","su-27.xml","Carrier-based version of the Su-27",10,1350,20,20,6350,3,19800,0,0,1,0,18000,90000,0,1,,"Su-27 W1","Wing tips","Su-27 W2","Wings","Su-27 F","Fuselage",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"N001E Myech AS",0,"N001E Myech R AS",180,"Eyeball-2",0,,0,,0,,0,,0,,0,12,245600,1.2,1.4,1.3,0.9,1.1,2,50,0,1,0.9,0.8,0.75,0.73,0.72,0.35,0.1,0.05,0,1,0.95,0.9,0.85,0.8,1,1.4,2,2,2 ! "Su-30MKK",12,33,25000006,"su30-01.jpg;su33-s.jpg","air/su30ico.jpg","su-30.xml","Chinese export version of Su-30 with air to ground missiles. Carries the latest Russian AAMs including the medium range R-77 'AMRAAM-ski'. (ref www.fas.org)",10,1200,20,20,4000,1.7,17300,0,0,1,0,24900,100000,0,0,,"Su-30 W1","Wing tips","Su-30 W2","Wings","Su-30 F","Fuselage",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"N001E Myech AS",0,"N001E Myech R AS",180,"Eyeball-2",0,,0,,0,,0,,0,,0,8,262000,1.3,1.6,1.5,0.9,1.1,3,50,0,1,0.9,0.8,0.75,0.7,0.65,0.3,0,0,0,1,0.95,0.9,0.85,0.8,1,1.4,1.6,1.8,2 ! "Su-27",12,33,25000005,"su27-34p04.jpg;su27-2.jpg;su27-34p03.jpg;su27-06.jpg","air/su27ico.jpg","su-27.xml","The Su-27 Flanker is a high performance fighter capable of carrying up to 10 AAMs. In service in Russia, China, and Vietnam.",10,1350,20,20,6350,3,19800,0,0,1,0,18000,90000,0,0,,"Su-27 W1","Wing tips","Su-27 W2","Wings","Su-27 F","Fuselage",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"N001E Myech AS",0,"N001E Myech R AS",180,"Eyeball-2",0,,0,,0,,0,,0,,0,12,245600,1.2,1.4,1.3,0.9,1.1,2,50,0,1,0.9,0.8,0.75,0.73,0.72,0.35,0.1,0.05,0,1,0.95,0.9,0.85,0.8,1,1.4,2,2,2 ! "Mirage-IIIE",12,33,12000000,,"air/mirIIIico.jpg","mirage-f1.xml","Mirage-IIIE",10,1268,20,18,3600,1,17000,0,84,1,0,13500,40000,0,1,,"MirIII IW","Inner wing","MirIII OW","Outer wing","MirIII CP","Center pylon",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"Cyrano-IV",0,"Eyeball-2",0,,0,,0,,0,,0,,0,,0,9.5,77000,1.1,1.3,1.2,0.9,1.1,2,50,0,1,1,0.9,0.85,0.8,0.6,0.3,0.1,0.05,0,1,0.95,0.9,0.85,0.8,1,1.4,2,2,2 ! "Mirage-F1",12,33,18000000,,"air/mirf1ico.jpg","mirage-f1.xml","Mirage-F1",10,1370,20,20,3400,1,19100,0,215,1,0,15000,50000,0,1,,"Mirage-F1 center pylon","Center","Mirage-F1 AAM rail","Wing rail","Mirage-F1 AAM rail","Wing rail","Mirage-F1 AAM rail","Wing rail","Mirage-F1 AAM rail","Wing rail","Mirage-F1 AAM rail","Wing rail","Mirage-F1 AAM rail","Wing rail",,,,,,,,,,,,,,,,,,,,,,"Cyrano-IV",0,"Eyeball-2",0,,0,,0,,0,,0,,0,,0,10,230000,1,1.2,1.1,0.9,1.1,2,50,0,1,1,0.9,0.85,0.8,0.6,0.3,0.1,0.05,0,1,0.95,0.9,0.85,0.8,1,1.4,2,2,2 ! "Mirage-2000",12,33,23000000,,"air/mir2000ico.jpg","mirage-f1.xml","Mirage 2000 multirole fighter",10,1270,20,18,4300,1.2,18000,0,285,1,0,15000,62000,0,1,,"Mir2000 W1","Outer wing","Mir2000 W2","Inner wing","Mir2000 Fuselage","Fuselage",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"Thales RDY",0,"Eyeball-2",0,,0,,0,,0,,0,,0,,0,10.5,180000,1.2,1.4,1.3,0.9,1.1,2,50,0,1,1,0.9,0.8,0.75,0.72,0.35,0.1,0.05,0,1,0.95,0.9,0.85,0.8,1,1.4,2,2,2 ! "MiG-29",12,33,30000000,,"air/mig29ico.jpg","mig-29.xml","Advanced multi-role fighter similar to F-15C. ",10,1350,20,20,4000,1.3,18400,0,0,1,0,14000,50000,0,1,,"AA-12 Launcher",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"Fighter radar",0,"Eyeball-2",0,,0,,0,,0,,0,,0,,0,8,172800,0.7,1.1,0.75,0.9,1.1,2,50,0,1,0.9,0.8,0.75,0.73,0.72,0.35,0.1,0.05,0,1,0.95,0.9,0.85,0.8,1,1.4,2,2,2 ! "MiG-27",12,33,13000000,,"air/mig27ico.jpg","harrier-gr3.xml","MiG-27 Flogger D",10,1018,20,16,5000,1.6,14000,0,200,1,0,18100,81000,0,0,,"MiG-27 W1","Wing gloves","MiG-27 Fuselage","Fuselage",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"Cyrano-IV",0,"Eyeball-2",0,,0,,0,,0,,0,,0,,0,9.5,123000,1.2,1.4,1.5,0.9,1.1,2,50,0,1,0.9,0.8,0.75,0.7,0.5,0.35,0.1,0.05,0,1,0.95,0.9,0.85,0.8,1,1.4,2,2,2 ! "MiG-25",12,33,25000000,,"air/mig25ico.jpg","mig-29.xml","MiG-25 Foxbat",10,1600,20,12,8000,4,24400,0,270,1,0,27000,112000,0,0,,"MiG-25 W1","Outer wing","MiG-25 W2","Inner wing",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"RP-25 Smerch radar",0,"Eyeball-2",0,,0,,0,,0,,0,,0,,0,12,220000,0.7,1.5,0.8,0.9,1.1,2,50,0,1,0.9,0.8,0.75,0.73,0.72,0.35,0.12,0.1,0,1,0.95,0.9,0.85,0.8,1,1.4,2,2,2 ! "MiG-23",12,33,10000000,,"air/mig23ico.jpg","harrier-gr3.xml","MiG-23 Flogger",10,1350,20,16,4000,1.65,18500,0,240,1,0,15700,83600,0,1,,"MiG-23 W1","Wing glove","MiG-23 W2","Inner wing","MiG-23 Fuselage","Fuselage",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"Cyrano-IV",0,"Eyeball-2",0,,0,,0,,0,,0,,0,,0,10,127000,1.2,1.4,1.5,0.9,1.1,2,50,0,1,0.9,0.8,0.75,0.7,0.5,0.35,0.1,0.05,0,1,0.95,0.9,0.85,0.8,1,1.4,2,2,2 ! "Harrier GR3a-STK",12,33,15000000,,"air/gr3ico.jpg","harrier-gr3.xml","Single-engine; ""jump-jet"" fighter-bomber designed to fly from combat areas and aircraft carriers and to support ground forces. It was made by Hawker Siddeley Aviation and first flew on Aug. 31; 1966; after a long period of development.Powered by a vectored-thrust turbofan engine; the plane diverted its engine thrust downward for vertical takeoff using rotatable engine exhaust ports. It could carry a combination of armaments; including air-to-air missiles; air-to-surface antiship missiles; rockets; bombs.??????",10,570,20,20,3000,1.3,15600,0,0,1,0,15000,60000,0,1,,"AAM-SR Launcher",,"AGM Launcher",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"Fighter radar",0,"Eyeball-2",0,,0,,0,,0,,0,,0,,0,8,90000,1,5,20,0.9,1.1,2,50,0,1,0.9,0.8,0.75,0.7,0.5,0.05,0,0,0,1,0.95,0.9,0.85,0.8,1,1.4,2,2,2 ! "Harrier GR3a",12,33,15000000,,"air/gr3ico.jpg","harrier-gr3.xml","Single-engine; ""jump-jet"" fighter-bomber designed to fly from combat areas and aircraft carriers and to support ground forces. It was made by Hawker Siddeley Aviation and first flew on Aug. 31; 1966; after a long period of development.Powered by a vectored-thrust turbofan engine; the plane diverted its engine thrust downward for vertical takeoff using rotatable engine exhaust ports. It could carry a combination of armaments; including air-to-air missiles; air-to-surface antiship missiles; rockets; bombs.??????",10,570,20,20,3000,1.3,15600,0,0,1,0,15000,60000,0,1,,"AAM-SR Launcher",,"AAM-SR Launcher",,"Harrier Bomb Mount",,"Harrier Bomb Mount",,,,,,,,,,,,,,,,,,,,,,,,,,,,,"Fighter radar",0,"Eyeball-2",0,,0,,0,,0,,0,,0,,0,8,90000,1,5,20,0.9,1.1,2,50,0,1,0.9,0.8,0.75,0.7,0.5,0.05,0,0,0,1,0.95,0.9,0.85,0.8,1,1.4,2,2,2 ! "F-5E",12,33,21000000,,"air/f5ico.jpg","mirage-f1.xml","F-5E Tiger II / Freedom Fighter",10,1700,20,18,3500,1.2,15800,0,175,1,0,11500,52000,0,0,,"F-16 W1","Wing tips","F-16 W2","Mid-wing","F-16 W3","Inner wing",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"AN/APG-66",0,"Eyeball-2",0,,0,,0,,0,,0,,0,,0,6,110000,1.2,1.4,1.28,0.9,1.1,2,50,0,1,0.9,0.8,0.75,0.73,0.72,0.35,0.1,0.05,0,1,0.95,0.9,0.85,0.8,1,1.4,2,2,2 ! "F-4E",12,33,15000000,,"air/f4ico.jpg","su-27.xml","F-4E Phantom II",11,1279,20,14,4500,2.2,18300,0,210,1,0,18825,79600,0,1,,"F-4 W1","Wing tips","F-4 W2","Mid-wing","F-4 Fuselage","Fuselage",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"AN/APG-66",0,"Eyeball-2",0,,0,,0,,0,,0,,0,,0,13,230000,1.5,1.7,1.5,0.9,1.1,2,50,0,1,0.9,0.8,0.75,0.73,0.72,0.35,0,0,0,1,0.95,0.9,0.85,0.8,1,1.4,1.7,2,2 ! "F-16C",12,33,25000000,"f16-15.jpg;f16-20-pakistan.jpg","air/f16ico.jpg","f-16.xml","F-16 Fighting Falcon",10,1150,20,20,4000,1.2,17000,0,255,1,0,14000,60000,0,0,,"F-16 W1","Wing tips","F-16 W2","Mid-wing","F-16 W3","Inner wing",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"AN/APG-66",0,"Eyeball-2",0,,0,,0,,0,,0,,0,,0,6,185000,1.2,1.4,1.28,0.9,1.1,2,50,0,1,0.9,0.8,0.75,0.73,0.72,0.35,0.1,0.05,0,1,0.95,0.9,0.85,0.8,1,1.4,2,2,2 ! "F-15C",12,33,29900000,,"air/f15ico.jpg","su-27.xml","F-15C Eagle",10,1434,20,18,6103,1.7,19800,0,255,1,0,20200,104000,0,0,,"F-15 W1","Wing tips","F-15 W2","Mid-wing","F-15 Fuselage","Fuselage",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"AN/APG-70/71",0,"Eyeball-2",0,,0,,0,,0,,0,,0,,0,12,258000,1.2,1.4,1.3,0.9,1.1,2,50,0,1,0.9,0.83,0.77,0.75,0.73,0.37,0.13,0.07,0,1,0.95,0.9,0.85,0.8,1,1.4,1.7,2,2 ! "F-14B",12,33,38000000,,"air/f14ico.jpg","su-27.xml","F-14B Super Tomcat",12,1341,20,16,9072,1.8,17000,0,230,1,0,28000,95000,0,1,,"F-14 W1","Wing tips","F-14 W2","Mid-wing","F-14 Fuselage","Fuselage",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"AN/APG-70/71",0,"Eyeball-2",0,,0,,0,,0,,0,,0,,0,12,252000,1.4,1.6,1.4,0.9,1.1,2,50,0,1,0.9,0.8,0.75,0.73,0.72,0.35,0.1,0.05,0,1,0.95,0.9,0.85,0.8,1,1.4,1.7,2,2 |
From: Dewitt C. <ddc...@us...> - 2006-09-28 02:02:24
|
Update of /cvsroot/gcblue/gcb_wx/database In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32752/database Modified Files: database.db Log Message: Initial airbase automation work Index: database.db =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/database/database.db,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 Binary files /tmp/cvs5YvtNl and /tmp/cvsq51kPM differ |
From: Dewitt C. <ddc...@us...> - 2006-09-28 02:02:23
|
Update of /cvsroot/gcblue/gcb_wx In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32752 Modified Files: GCblue.vcproj Log Message: Initial airbase automation work Index: GCblue.vcproj =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/GCblue.vcproj,v retrieving revision 1.106 retrieving revision 1.107 diff -C2 -d -r1.106 -r1.107 *** GCblue.vcproj 17 Aug 2006 01:31:32 -0000 1.106 --- GCblue.vcproj 28 Sep 2006 02:01:50 -0000 1.107 *************** *** 431,435 **** </File> <File ! RelativePath="src\graphics\tcGraphicsEngine.cpp" > </File> --- 431,435 ---- </File> <File ! RelativePath=".\src\graphics\tcGraphicsInfo.cpp" > </File> *************** *** 1082,1085 **** --- 1082,1097 ---- > </File> + <File + RelativePath=".\src\ai\tcCAPMission.cpp" + > + </File> + <File + RelativePath=".\src\ai\tcMission.cpp" + > + </File> + <File + RelativePath=".\src\ai\tcMissionManager.cpp" + > + </File> </Filter> </Filter> *************** *** 1741,1745 **** </File> <File ! RelativePath="include\graphics\tcGraphicsEngine.h" > </File> --- 1753,1757 ---- </File> <File ! RelativePath=".\include\graphics\tcGraphicsInfo.h" > </File> *************** *** 2384,2387 **** --- 2396,2411 ---- > </File> + <File + RelativePath=".\include\ai\tcCAPMission.h" + > + </File> + <File + RelativePath=".\include\ai\tcMission.h" + > + </File> + <File + RelativePath=".\include\ai\tcMissionManager.h" + > + </File> </Filter> </Filter> |
From: Dewitt C. <ddc...@us...> - 2006-09-28 02:01:57
|
Update of /cvsroot/gcblue/gcb_wx/src/ai In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32752/src/ai Added Files: tcCAPMission.cpp tcMission.cpp tcMissionManager.cpp Log Message: Initial airbase automation work --- NEW FILE: tcMission.cpp --- /** ** @file tcMission.cpp */ /* Copyright (C) 2006 Dewitt Colclough (de...@gc...) ** 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" #ifndef WX_PRECOMP #include "wx/wx.h" #endif #include "ai/tcMission.h" #include "ai/tcMissionManager.h" #ifdef _DEBUG #define new DEBUG_NEW #endif unsigned long tcMission::nextId = 1; unsigned int tcMission::GetId() const { return id; } const std::vector<long>& tcMission::GetMissionAircraft() const { return missionAircraft; } void tcMission::SetMissionManager(tcMissionManager* mm) { missionManager = mm; } void tcMission::Update(double t) { } const tcMission& tcMission::operator=(const tcMission& src) { missionManager = src.missionManager; id = src.id; stage = src.stage; missionAircraft = src.missionAircraft; return *this; } tcMission::tcMission(const tcMission& src) : missionManager(src.missionManager), id(src.id), stage(src.stage), missionAircraft(src.missionAircraft) { } tcMission::tcMission() : missionManager(0), id(nextId++), stage("init") { } tcMission::~tcMission() { } --- NEW FILE: tcCAPMission.cpp --- /** ** @file tcCAPMission.cpp */ /* Copyright (C) 2006 Dewitt Colclough (de...@gc...) ** 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" #ifndef WX_PRECOMP #include "wx/wx.h" #endif #include "ai/tcCAPMission.h" #include "ai/tcMissionManager.h" #include "tcWeaponDBObject.h" #include "tcAirObject.h" #ifdef _DEBUG #define new DEBUG_NEW #endif void tcCAPMission::SetStation(float lon_rad, float lat_rad) { station.x = lon_rad; station.y = lat_rad; } void tcCAPMission::Update(double t) { wxASSERT(missionManager != 0); if (missionManager == 0) return; // step 1, get aircraft for mission // step 2, outfit aircraft // step 3, create tasks for mission on each aircraft // step 4, order launch of aircraft // step 5, when all aircraft launched, delete mission if (stage == "init") { // query available aircraft and take first from list std::vector<long> candidates = missionManager->GetAvailableAircraft(AIR_TARGET); missionAircraft.clear(); for (size_t n=0; (n<quantity)&&(n<candidates.size()); n++) { missionAircraft.push_back(candidates[n]); } if (missionAircraft.size() == 0) return; // none available stage = "outfit"; } else if (stage == "outfit") { bool allOutfitted = true; for (size_t n=0; n<missionAircraft.size(); n++) { tcAirObject* aircraft = missionManager->GetAircraft(missionAircraft[n]); if (aircraft != 0) { if (!aircraft->IsEquippedForTargetType(AIR_TARGET)) { aircraft->EquipForTargetType(AIR_TARGET); allOutfitted = false; } } } if (allOutfitted) stage = "task"; } else if (stage == "task") { stage = "launch"; } else if (stage == "launch") { for (size_t n=0; n<missionAircraft.size(); n++) { missionManager->LaunchAircraft(missionAircraft[n]); } stage = "finish"; } else if (stage == "finish") { // verify all aircraft have launched and end mission } } const tcCAPMission& tcCAPMission::operator=(const tcCAPMission& src) { tcMission::operator=(src); quantity = src.quantity; station = src.station; return *this; } tcCAPMission::tcCAPMission(const tcCAPMission& src) : tcMission(src) { } tcCAPMission::tcCAPMission() : tcMission(), quantity(2) { } tcCAPMission::~tcCAPMission() { } --- NEW FILE: tcMissionManager.cpp --- /** ** @file tcMissionManager.cpp */ /* Copyright (C) 2006 Dewitt Colclough (de...@gc...) ** 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" #ifndef WX_PRECOMP #include "wx/wx.h" #endif #include "ai/tcMissionManager.h" #include "ai/tcMission.h" #include "tcFlightPort.h" #include "tcPlatformObject.h" #include "tcAirObject.h" #ifdef _DEBUG #define new DEBUG_NEW #endif void tcMissionManager::AddMission(tcMission* mission_) { mission_->SetMissionManager(this); missions.push_back(mission_); } tcAirObject* tcMissionManager::GetAircraft(long id) { return dynamic_cast<tcAirObject*>(flightPort->GetObjectById(id)); } std::vector<long>& tcMissionManager::GetAvailableAircraft(int targetMask) { static std::vector<long> availableAircraft; availableAircraft.clear(); UpdateReserved(); size_t nAircraft = flightPort->GetCount(); for (size_t n=0; n<nAircraft; n++) { tcAirState* airState = flightPort->GetAirState(n); long id = airState->obj->mnID; if (!IsAircraftReserved(id)) { tcPlatformObject* platform = dynamic_cast<tcPlatformObject*>(airState->obj); wxASSERT(platform != 0); if ((platform != 0) && (platform->IsCapableVsTargetType(targetMask))) { availableAircraft.push_back(id); } } } return availableAircraft; } bool tcMissionManager::IsAircraftReserved(long id) const { std::map<long, unsigned int>::const_iterator iter = reserved.find(id); return (iter != reserved.end()); } void tcMissionManager::LaunchAircraft(long id) { flightPort->LaunchID(id); } void tcMissionManager::Update(double t) { if ((t - lastUpdate) < 1.0f) return; lastUpdate = t; for (size_t n=0; n<missions.size(); n++) { missions[n]->Update(t); } } void tcMissionManager::UpdateReserved() { reserved.clear(); for (size_t n=0; n<missions.size(); n++) { const std::vector<long>& missionAircraft = missions[n]->GetMissionAircraft(); unsigned int missionId = missions[n]->GetId(); for (size_t k=0; k<missionAircraft.size(); k++) { reserved[missionAircraft[k]] = missionId; } } } tcMissionManager::tcMissionManager(tcFlightPort* fp) : flightPort(fp), lastUpdate(randf()) { wxASSERT(fp != 0); } tcMissionManager::~tcMissionManager() { for (size_t n=0; n<missions.size(); n++) { delete missions[n]; } } |
From: Dewitt C. <ddc...@us...> - 2006-09-28 02:01:57
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32752/src/sim Modified Files: tcFlightPort.cpp tcPlatformObject.cpp Log Message: Initial airbase automation work Index: tcPlatformObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcPlatformObject.cpp,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** tcPlatformObject.cpp 5 Sep 2006 01:04:25 -0000 1.63 --- tcPlatformObject.cpp 28 Sep 2006 02:01:53 -0000 1.64 *************** *** 30,33 **** --- 30,34 ---- #include "tcLauncherDBObject.h" #include "tcStoresDBObject.h" + #include "tcWeaponDBObject.h" #include "tcString.h" #include "tcRadar.h" *************** *** 545,548 **** --- 546,726 ---- } + /** + * @return true if either currently equipped for target type or + * parent magazines have compatible weapons in stock for target type + */ + bool tcPlatformObject::IsCapableVsTargetType(int targetFlag) + { + if (IsEquippedForTargetType(targetFlag)) return true; + + tcPlatformObject* parentPlatform = dynamic_cast<tcPlatformObject*>(parent); + if (parentPlatform == 0) return false; // not landed or docked, or parent is not tcPlatformObject + + size_t nMagazines = parentPlatform->GetMagazineCount(); + for (size_t n=0; n<nMagazines; n++) + { + tcStores* mag = parentPlatform->GetMagazine(n); + int magFlags = mag->GetAvailableTargetFlags(this); + if ((magFlags & targetFlag) != 0) return true; + } + + return false; + } + + + /** + * @return true if all launchers empty and not loading + */ + bool tcPlatformObject::AllLaunchersEmpty() + { + size_t nLaunchers = GetLauncherCount(); + for (size_t n=0; n<nLaunchers; n++) + { + tcLauncher* launcher = GetLauncher(n); + if ((launcher->IsLoading()) || (launcher->mnCurrent > 0)) return false; + } + + return true; + } + + /** + * @return true if fully equipped, done loading, and at least one + * launcher is effective vs. target type + */ + bool tcPlatformObject::IsEquippedForTargetType(int targetFlag) + { + if (targetFlag == 0) return false; // don't call this to check empty + + bool anyEffective = false; + + size_t nLaunchers = GetLauncherCount(); + for (size_t n=0; n<nLaunchers; n++) + { + tcLauncher* launcher = GetLauncher(n); + if (launcher->IsLoading()) return false; + if ((launcher->mnCurrent == 0) || (launcher->capacity > launcher->mnCurrent)) return false; + anyEffective = anyEffective || ((launcher->mnTargetFlags & targetFlag) != 0); + } + + return anyEffective; + } + + void tcPlatformObject::UnloadAllLaunchers() + { + tcPlatformObject* parentPlatform = dynamic_cast<tcPlatformObject*>(parent); + if (parentPlatform == 0) + { + fprintf(stderr, "tcPlatformObject::UnloadAllLaunchers - no host platform (%s)\n", + GetName()); + wxASSERT(false); + return; // not landed or docked, or parent is not tcPlatformObject + } + + size_t nMagazines = parentPlatform->GetMagazineCount(); + for (size_t n=0; n<nMagazines; n++) + { + tcStores* mag = parentPlatform->GetMagazine(n); + if (mag->HasStoresForThisObject(this)) // stores empty can cause problem with this + { + mag->AddAutomationOp("Empty", this); + return; + } + } + + fprintf(stderr, "tcPlatformObject::EquipForTargetType('empty') - no mags available (%s)\n", + GetName()); + wxASSERT(false); + } + + /** + * @param targetType "Empty" "AAW" "ASuW" "ASW" "Strike" + */ + void tcPlatformObject::EquipForTargetType(const std::string& targetType) + { + if (targetType == "Empty") + { + UnloadAllLaunchers(); + return; + } + + tcPlatformObject* parentPlatform = dynamic_cast<tcPlatformObject*>(parent); + if (parentPlatform == 0) + { + fprintf(stderr, "tcPlatformObject::EquipForTargetType - no host platform (%s)\n", + GetName()); + wxASSERT(false); + return; // not landed or docked, or parent is not tcPlatformObject + } + + int targetFlag = 0; + if (targetType == "AAW") targetFlag = AIR_TARGET; + else if (targetType == "ASuW") targetFlag = SURFACE_TARGET; + else if (targetType == "ASW") targetFlag = SUBSURFACE_TARGET; + else if (targetType == "Strike") targetFlag = LAND_TARGET; + else + { + fprintf(stderr, "tcPlatformObject::EquipForTargetType - targetType not found (%s)\n", + GetName()); + wxASSERT(false); + return; + } + + size_t nMagazines = parentPlatform->GetMagazineCount(); + for (size_t n=0; n<nMagazines; n++) + { + tcStores* mag = parentPlatform->GetMagazine(n); + int magFlags = mag->GetAvailableTargetFlags(this); + if ((magFlags & targetFlag) != 0) + { + mag->AddAutomationOp(targetType, this); + return; + } + } + + fprintf(stdout, "tcPlatformObject::EquipForTargetType - no compatible equipment found (%s)\n", + GetName()); + } + + /** + * Schedule automatic loadout op for target type. Platform must be + * landed and have access to appropriate stores + */ + void tcPlatformObject::EquipForTargetType(int targetFlag) + { + if ((targetFlag != 0) && (IsEquippedForTargetType(targetFlag))) return; // already equipped + + std::string loadoutType; + if (targetFlag == 0) + { + loadoutType = "Empty"; + } + else if ((targetFlag & AIR_TARGET) != 0) + { + loadoutType = "AAW"; + } + else if ((targetFlag & SURFACE_TARGET) != 0) + { + loadoutType = "ASuW"; + } + else if ((targetFlag & SUBSURFACE_TARGET) != 0) + { + loadoutType = "ASW"; + } + else if ((targetFlag & LAND_TARGET) != 0) + { + loadoutType = "Strike"; + } + else + { + fprintf(stderr, "tcPlatformObject::EquipForTargetType - bad target flag (%s)\n", + GetName()); + wxASSERT(false); // bad targetFlag + return; + } + + EquipForTargetType(loadoutType); + } + + bool tcPlatformObject::IsRefueling() const { Index: tcFlightPort.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcFlightPort.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** tcFlightPort.cpp 18 Jun 2006 00:45:02 -0000 1.27 --- tcFlightPort.cpp 28 Sep 2006 02:01:53 -0000 1.28 *************** *** 38,41 **** --- 38,42 ---- #include "tcPlatformObject.h" #include "tcLauncher.h" + #include "ai/tcMissionManager.h" #ifdef _DEBUG *************** *** 57,61 **** case READY: return "Deck"; case LAUNCH: return "Runwy"; ! case TRANSIT: return "Trans"; default: return "Error"; } --- 58,62 ---- case READY: return "Deck"; case LAUNCH: return "Runwy"; ! case TAKEOFF: return "Tkoff"; default: return "Error"; } *************** *** 438,441 **** --- 439,443 ---- airstate->goal_location = loc; airstate->goal_spot = airstate->current_spot; + airstate->inTransit = false; units.push_back(airstate); // add to fport units vector *************** *** 546,549 **** --- 548,557 ---- last_update_time = 0; + + if (missionManager == 0) + { + delete missionManager; + missionManager = 0; + } } *************** *** 585,589 **** loc_vector = GetLocVector(loc); if (loc == HANGAR) return (inHangarCount >= hangarCapacity) ? -1 : 0; ! if ((loc == TRANSIT)||(loc == NOWHERE)) return -1; // error return FindEmptySpot(loc_vector); --- 593,597 ---- loc_vector = GetLocVector(loc); if (loc == HANGAR) return (inHangarCount >= hangarCapacity) ? -1 : 0; ! if ((loc == TAKEOFF)||(loc == NOWHERE)) return -1; // error return FindEmptySpot(loc_vector); *************** *** 612,615 **** --- 620,628 ---- } + const tcAirState* tcFlightPort::GetAirState(unsigned n) const + { + return units[n]; + } + int tcFlightPort::GetAirStateIdx(long id) { *************** *** 638,641 **** --- 651,674 ---- } + /** + * @return game object for unit with matching id + */ + tcGameObject* tcFlightPort::GetObjectById(long id) + { + int idx = GetAirStateIdx(id); + if (idx < 0) return 0; + return GetObject(unsigned(idx)); + } + + tcMissionManager* tcFlightPort::GetMissionManager() + { + if (missionManager == 0) + { + missionManager = new tcMissionManager(this); + } + + return missionManager; + } + int tcFlightPort::Launch(int runway) { *************** *** 688,692 **** (spot->obj_info->obj->mnID == id)) { ! bool isReady = (spot->obj_info->ready_time >= last_update_time); if (isReady) { --- 721,725 ---- (spot->obj_info->obj->mnID == id)) { ! bool isReady = (spot->obj_info->ready_time <= last_update_time); if (isReady) { *************** *** 700,704 **** } } ! return 0; // not found on runway } --- 733,755 ---- } } ! ! // if not on runway, then queue for takeoff by moving to TAKEOFF destination ! ! int idx = GetAirStateIdx(id); ! if (idx >= 0) ! { ! tcAirState* airState = GetAirState(idx); ! if (airState != 0) ! { ! SetObjectDestination(airState, TAKEOFF, 0); ! return 1; ! } ! } ! ! ! fprintf(stderr, "tcFlightPort::LaunchID - Bad air state\n"); ! wxASSERT(false); ! return 0; ! } *************** *** 706,719 **** * Move object to new location if valid. Remove object from old location. */ ! void tcFlightPort::MoveObjectToGoal(tcAirState *airstate) { ! if (airstate->goal_spot == -1) return; // no valid goal spot yet ! if (airstate->current_location == airstate->goal_location) return; // no need to move (may need spot move in future) ! if (airstate->current_location == TRANSIT) return; // already moving, error ! if (airstate->goal_location == HANGAR) inHangarCount++; std::vector<tsSpotInfo>* current_loc_vect = GetLocVector(airstate->current_location); ! std::vector<tsSpotInfo>* goal_loc_vect = GetLocVector(airstate->goal_location); if (current_loc_vect) --- 757,771 ---- * Move object to new location if valid. Remove object from old location. */ ! void tcFlightPort::MoveObjectToDestination(tcAirState *airstate, teLocation destination, int spot) { ! if (spot == -1) return; // no valid goal spot yet ! if (airstate->current_location == destination) return; // no need to move (may need spot move in future) ! if (airstate->inTransit) return; // already moving, error ! wxASSERT(destination != TAKEOFF); ! if (destination == HANGAR) inHangarCount++; std::vector<tsSpotInfo>* current_loc_vect = GetLocVector(airstate->current_location); ! std::vector<tsSpotInfo>* dest_loc_vect = GetLocVector(destination); if (current_loc_vect) *************** *** 722,733 **** current_spot.obj_info = NULL; // remove from current spot } ! if (goal_loc_vect) { ! tsSpotInfo& goal_spot = goal_loc_vect->at(airstate->goal_spot); ! goal_spot.obj_info = airstate; // add to goal spot } ! airstate->current_location = TRANSIT; ! airstate->current_spot = -1; airstate->op = OP_TRANSIT; } --- 774,788 ---- current_spot.obj_info = NULL; // remove from current spot } ! if (dest_loc_vect) { ! tsSpotInfo& dest_spot = dest_loc_vect->at(spot); ! dest_spot.obj_info = airstate; // add to dest spot } ! airstate->current_location = destination; ! airstate->current_spot = spot; ! ! airstate->inTransit = true; ! airstate->op = OP_TRANSIT; } *************** *** 881,885 **** std::vector<tsSpotInfo>* loc_vector = GetLocVector(loc); ! if ((loc == TRANSIT)||(loc == NOWHERE)) { wxASSERT(false); --- 936,940 ---- std::vector<tsSpotInfo>* loc_vector = GetLocVector(loc); ! if ((loc == TAKEOFF)||(loc == NOWHERE)) { wxASSERT(false); *************** *** 937,943 **** --- 992,1011 ---- tcAirState* airstate = units.at(n); + SetObjectDestination(airstate, loc, position); + } + + /** + * + */ + void tcFlightPort::SetObjectDestination(tcAirState* airstate, teLocation loc, unsigned int position) + { + wxASSERT(airstate != 0); + teLocation currentLoc = airstate->current_location; bool validMove = false; + validMove = (currentLoc != loc); + + /* if (loc == HANGAR) { *************** *** 954,957 **** --- 1022,1026 ---- } + */ if (!validMove) return; *************** *** 970,977 **** } void tcFlightPort::UpdateRelPos(tcAirState *airstate, double time) { // tcGameObject *pGameObj = airstate->obj; ! if (airstate->current_location == TRANSIT) { if (time >= airstate->ready_time) --- 1039,1047 ---- } + void tcFlightPort::UpdateRelPos(tcAirState *airstate, double time) { // tcGameObject *pGameObj = airstate->obj; ! if (airstate->inTransit) { if (time >= airstate->ready_time) *************** *** 979,985 **** if (airstate->current_location == HANGAR) inHangarCount--; if (airstate->goal_location == HANGAR) inHangarCount++; ! airstate->current_location = airstate->goal_location; ! airstate->current_spot = airstate->goal_spot; airstate->op = OP_NONE; wxASSERT(inHangarCount <= hangarCapacity); --- 1049,1056 ---- if (airstate->current_location == HANGAR) inHangarCount--; if (airstate->goal_location == HANGAR) inHangarCount++; ! airstate->op = OP_NONE; + airstate->inTransit = false; + wxASSERT(inHangarCount <= hangarCapacity); *************** *** 1050,1059 **** /** * */ ! void tcFlightPort::Update(double afStatusTime) { ! if ((afStatusTime - last_update_time < 0.1f) && !tcGameObject::IsEditMode()) return; // restrict to slower update ! last_update_time = afStatusTime; // in mp client mode, update relative pos for display purposes, omit other updates --- 1121,1160 ---- /** + * @return next location if jumping more than one stage + * e.g. HANGAR to LAUNCH would stop at READY first + */ + teLocation tcFlightPort::GetNextStop(teLocation current, teLocation destination) + { + if (destination == HANGAR) return HANGAR; + else if (destination == READY) return READY; + else if (destination == LAUNCH) + { + return (current == HANGAR) ? READY : LAUNCH; + } + else if (destination == TAKEOFF) + { + switch (current) + { + case HANGAR: return READY; break; + case READY: return LAUNCH; break; + case LAUNCH: return TAKEOFF; break; + default: wxASSERT(false); return current; break; + } + } + else + { + wxASSERT(false); + return current; + } + + } + + /** * */ ! void tcFlightPort::Update(double t) { ! if ((t - last_update_time < 0.1f) && !tcGameObject::IsEditMode()) return; // restrict to slower update ! last_update_time = t; // in mp client mode, update relative pos for display purposes, omit other updates *************** *** 1063,1067 **** for(size_t n=0;n<obj_count;n++) { ! UpdateRelPos(units[n], afStatusTime); } return; --- 1164,1168 ---- for(size_t n=0;n<obj_count;n++) { ! UpdateRelPos(units[n], t); } return; *************** *** 1070,1073 **** --- 1171,1176 ---- UpdateLanded(); + std::vector<long> idsToLaunch; // queue to launch when done updating all airstates + size_t obj_count = units.size(); for(size_t n=0;n<obj_count;n++) *************** *** 1078,1095 **** ** check for a free spot in goal location. If there is a free spot in ** goal location, then take spot and set current location to TRANSIT */ ! bool inTransit = airstate->current_location == TRANSIT; if ((!inTransit)&&(airstate->current_location != airstate->goal_location)) { ! if (!IsSpotEmpty(airstate->goal_location, airstate->goal_spot)) { ! std::vector<tsSpotInfo> *loc_vector = 0; ! int spot_idx = FindEmptySpot(airstate->goal_location, loc_vector); ! airstate->goal_spot = spot_idx; } - airstate->ready_time = tcGameObject::IsEditMode() ? afStatusTime : afStatusTime + 30.0f; // short times for test - MoveObjectToGoal(airstate); } ! UpdateRelPos(airstate, afStatusTime); } } --- 1181,1217 ---- ** check for a free spot in goal location. If there is a free spot in ** goal location, then take spot and set current location to TRANSIT */ ! bool inTransit = airstate->inTransit; if ((!inTransit)&&(airstate->current_location != airstate->goal_location)) { ! if ((airstate->goal_location == TAKEOFF) && (airstate->current_location == LAUNCH)) { ! idsToLaunch.push_back(airstate->obj->mnID); ! } ! else ! { ! teLocation nextLoc = GetNextStop(airstate->current_location, airstate->goal_location); ! int nextSpot = airstate->goal_spot; // guess goal_spot ! ! // goal_spot has spot for next destination if more than one move is required ! if (!IsSpotEmpty(nextLoc, nextSpot)) ! { ! std::vector<tsSpotInfo> *loc_vector = 0; ! int spot_idx = FindEmptySpot(nextLoc, loc_vector); ! nextSpot = spot_idx; ! } ! airstate->ready_time = tcGameObject::IsEditMode() ? t : t + 30.0f; // short times for test ! ! MoveObjectToDestination(airstate, nextLoc, nextSpot); } } ! UpdateRelPos(airstate, t); } + + for (size_t n=0; n<idsToLaunch.size(); n++) + { + LaunchID(idsToLaunch[n]); + } + + if (missionManager != 0) missionManager->Update(t); } *************** *** 1118,1122 **** : localId(10), parent(0), ! mpDBObject(0) { --- 1240,1245 ---- : localId(10), parent(0), ! mpDBObject(0), ! missionManager(0) { |
From: Dewitt C. <ddc...@us...> - 2006-09-28 02:01:57
|
Update of /cvsroot/gcblue/gcb_wx/xml In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32752/xml Modified Files: options.xml Log Message: Initial airbase automation work Index: options.xml =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/xml/options.xml,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** options.xml 24 Sep 2006 19:50:21 -0000 1.29 --- options.xml 28 Sep 2006 02:01:53 -0000 1.30 *************** *** 1,6 **** <Options> <HostAddress>192.168.0.100</HostAddress> ! <LastScenarioPath>Tutorial.SubmarineOperations.py</LastScenarioPath> ! <LastScenarioName>SubmarineOperations</LastScenarioName> <noCopyDatabase /> <noWriteXmlDatabase /> --- 1,6 ---- <Options> <HostAddress>192.168.0.100</HostAddress> ! <LastScenarioPath>SinglePlayer.IranStrike_II.py</LastScenarioPath> ! <LastScenarioName>IranStrike_II</LastScenarioName> <noCopyDatabase /> <noWriteXmlDatabase /> |
From: Dewitt C. <ddc...@us...> - 2006-09-28 02:01:57
|
Update of /cvsroot/gcblue/gcb_wx/include/ai In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32752/include/ai Added Files: tcCAPMission.h tcMission.h tcMissionManager.h Log Message: Initial airbase automation work --- NEW FILE: tcMissionManager.h --- /** ** @file tcMissionManager.h */ /* Copyright (C) 2006 Dewitt Colclough (de...@gc...) ** 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 _TCMISSIONMANAGER_H_ #define _TCMISSIONMANAGER_H_ #include <map> #include <vector> class tcFlightPort; class tcMission; class tcAirObject; /** * Organizes and controls missions for aircraft in flightport. * * Select aircraft based on mission type and outfits according to mission * type. Set AI tasks (waypoints, etc) for aircraft to carry out mission. * Schedule launches. * * @see tcFlightPort */ class tcMissionManager { public: void AddMission(tcMission* mission_); std::vector<long>& GetAvailableAircraft(int targetMask); tcAirObject* GetAircraft(long id); void LaunchAircraft(long id); void Update(double t); tcMissionManager(tcFlightPort* fp); virtual ~tcMissionManager(); private: tcFlightPort* flightPort; std::vector<tcMission*> missions; std::map<long, unsigned int> reserved; ///< map of reserved aircraft (aircraft id, mission id) double lastUpdate; bool IsAircraftReserved(long id) const; void UpdateReserved(); }; #endif --- NEW FILE: tcCAPMission.h --- /** ** @file tcCAPMission.h */ /* Copyright (C) 2006 Dewitt Colclough (de...@gc...) ** 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 _TCCAPMISSION_H_ #define _TCCAPMISSION_H_ #include "ai/tcMission.h" #include "simmath.h" class tcFlightPort; class tcPoint; class tcCAPMission : public tcMission { public: void SetStation(float lon_rad, float lat_rad); virtual void Update(double t); const tcCAPMission& operator=(const tcCAPMission& src); tcCAPMission(const tcCAPMission& src); tcCAPMission(); virtual ~tcCAPMission(); protected: unsigned int quantity; // number aircraft for mission tcPoint station; }; #endif --- NEW FILE: tcMission.h --- /** ** @file tcMission.h */ /* Copyright (C) 2006 Dewitt Colclough (de...@gc...) ** 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 _TCMISSION_H_ #define _TCMISSION_H_ #include <string> #include <vector> class tcMissionManager; /** * Base class for air missions * * @see tcFlightPort, tcMissionManager */ class tcMission { public: unsigned int GetId() const; const std::vector<long>& GetMissionAircraft() const; void SetMissionManager(tcMissionManager* mm); virtual void Update(double t); const tcMission& operator=(const tcMission& src); tcMission(); tcMission(const tcMission& src); virtual ~tcMission(); protected: tcMissionManager* missionManager; std::vector<long> missionAircraft; std::string stage; private: static unsigned long nextId; ///< for assigning unique mission id unsigned int id; ///< unique identifier for mission }; #endif |
From: Dewitt C. <ddc...@us...> - 2006-09-28 02:01:56
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32752/include/sim Modified Files: tcFlightPort.h tcPlatformObject.h Log Message: Initial airbase automation work Index: tcFlightPort.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcFlightPort.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcFlightPort.h 22 Mar 2006 01:23:29 -0000 1.14 --- tcFlightPort.h 28 Sep 2006 02:01:52 -0000 1.15 *************** *** 1,4 **** ! /* ! ** Copyright (C) 2003 Dewitt Colclough (de...@gc...) ** All rights reserved. --- 1,9 ---- ! /** ! ** @file tcFlightPort.h ! ** ! ** tcFlightPort object: descibes objects that allow air objects to take off ! ** and land. This includes land-based runways, carrier runways, helipads, VTOL pads. ! */ ! /* Copyright (C) 2003-2006 Dewitt Colclough (de...@gc...) ** All rights reserved. *************** *** 17,22 **** ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ** ! ** tcFlightPort object: descibes objects that allow air objects to take off ! ** and land. This includes land-based runways, carrier runways, helipads, VTOL pads. */ --- 22,26 ---- ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ** ! */ *************** *** 32,35 **** --- 36,41 ---- class tcUpdateStream; + class tcMissionManager; + namespace database { *************** *** 44,50 **** NOWHERE = 0, HANGAR = 1, ///< longer term storage or repair ! READY = 2, ///< out of hangar LAUNCH = 3, ///< ready to take off ! TRANSIT = 4 ///< moving }; enum teOperation --- 50,56 ---- NOWHERE = 0, HANGAR = 1, ///< longer term storage or repair ! READY = 2, ///< out of hangar, on deck LAUNCH = 3, ///< ready to take off ! TAKEOFF = 5 ///< move to launch and take off }; enum teOperation *************** *** 69,72 **** --- 75,79 ---- teLocation goal_location; int goal_spot; // destination within deck1, deck2, or launch + bool inTransit; teOperation op; double ready_time; // time for op to be completed *************** *** 115,120 **** int FindEmptySpot(teLocation loc, std::vector<tsSpotInfo>*& loc_vector); tcAirState* GetAirState(unsigned n); int GetAirStateIdx(long id); ! size_t GetCount() {return units.size();} tsSpotInfo* GetCurrentSpotInfo(tcAirState *airstate); tcFlightportDBObject* GetDatabaseObject() const; --- 122,128 ---- int FindEmptySpot(teLocation loc, std::vector<tsSpotInfo>*& loc_vector); tcAirState* GetAirState(unsigned n); + const tcAirState* GetAirState(unsigned n) const; int GetAirStateIdx(long id); ! size_t GetCount() const {return units.size();} tsSpotInfo* GetCurrentSpotInfo(tcAirState *airstate); tcFlightportDBObject* GetDatabaseObject() const; *************** *** 122,125 **** --- 130,134 ---- tcTrack GetLandingData(const tcGameObject* obj); tcGameObject* GetObject(unsigned n); + tcGameObject* GetObjectById(long id); std::vector<tsSpotInfo>* GetLocVector(teLocation loc); *************** *** 129,142 **** int Launch(int runway); // order unit on runway to take off int LaunchID(long id); // order unit with id to take off (if on runway) ! void MoveObjectToGoal(tcAirState *airstate); bool MoveToLaunchQueue(tcAirState *airstate); void SetObjectDestination(unsigned n, teLocation loc, unsigned int position = 0); void SetParent(tcGameObject *newparent) {parent=newparent;} void SetHangarCapacity(unsigned cap) {hangarCapacity = cap;} ! void Update(double afStatusTime); void UpdateLanded(); void UpdateRelPos(tcAirState *airstate, double time); void UpdateUnitKin(tcAirState *airstate); // update unit kinematics based on parent info and rel_pos tcCommandStream& operator<<(tcCommandStream& stream); tcCreateStream& operator<<(tcCreateStream& stream); --- 138,154 ---- int Launch(int runway); // order unit on runway to take off int LaunchID(long id); // order unit with id to take off (if on runway) ! bool MoveToLaunchQueue(tcAirState *airstate); void SetObjectDestination(unsigned n, teLocation loc, unsigned int position = 0); + void SetObjectDestination(tcAirState* airstate, teLocation loc, unsigned int position = 0); void SetParent(tcGameObject *newparent) {parent=newparent;} void SetHangarCapacity(unsigned cap) {hangarCapacity = cap;} ! void Update(double t); void UpdateLanded(); void UpdateRelPos(tcAirState *airstate, double time); void UpdateUnitKin(tcAirState *airstate); // update unit kinematics based on parent info and rel_pos + tcMissionManager* GetMissionManager(); + tcCommandStream& operator<<(tcCommandStream& stream); tcCreateStream& operator<<(tcCreateStream& stream); *************** *** 171,175 **** --- 183,190 ---- }; std::vector<CommandInfo> commandList; + tcMissionManager* missionManager; + teLocation GetNextStop(teLocation current, teLocation destination); + void MoveObjectToDestination(tcAirState *airstate, teLocation destination, int spot); bool IsSpotEmpty(teLocation loc, unsigned int spot); void ResyncSpots(); Index: tcPlatformObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcPlatformObject.h,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** tcPlatformObject.h 5 Sep 2006 01:04:24 -0000 1.36 --- tcPlatformObject.h 28 Sep 2006 02:01:52 -0000 1.37 *************** *** 126,129 **** --- 126,136 ---- bool IsRefueling() const; + bool IsCapableVsTargetType(int targetFlag); + bool IsEquippedForTargetType(int targetFlag); + bool AllLaunchersEmpty(); + void UnloadAllLaunchers(); + void EquipForTargetType(int targetFlag); + void EquipForTargetType(const std::string& targetType); + virtual void Launch(tnPoolIndex& rnKey, unsigned& rnLauncher); virtual void RandInitNear(float afLon_deg, float afLat_deg); |