gcblue-commits Mailing List for Global Conflict Blue (Page 5)
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-11-23 00:08:01
|
Update of /cvsroot/gcblue/gcb_wx/xml In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv22658/xml Modified Files: options.xml platform_gui_air.xml Log Message: Index: options.xml =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/xml/options.xml,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** options.xml 20 Nov 2006 00:19:52 -0000 1.31 --- options.xml 23 Nov 2006 00:07:59 -0000 1.32 *************** *** 1,6 **** <Options> <HostAddress>192.168.1.5</HostAddress> ! <LastScenarioPath>Test.HornetTest.py</LastScenarioPath> ! <LastScenarioName>HornetTest</LastScenarioName> <noCopyDatabase /> <noWriteXmlDatabase /> --- 1,6 ---- <Options> <HostAddress>192.168.1.5</HostAddress> ! <LastScenarioPath>MultiPlayer.CVBGDuel.py</LastScenarioPath> ! <LastScenarioName>CVBGDuel</LastScenarioName> <noCopyDatabase /> <noWriteXmlDatabase /> Index: platform_gui_air.xml =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/xml/platform_gui_air.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** platform_gui_air.xml 5 Sep 2006 01:04:25 -0000 1.1 --- platform_gui_air.xml 23 Nov 2006 00:07:59 -0000 1.2 *************** *** 1,3 **** ! <Window Width="420" Height="190" BackgroundImage="dblue031.jpg" > <Button X="402" Y="2" Width="16" Height="16" Command="86" Caption=""> <Image Off="close.png" On="close.png" /> --- 1,3 ---- ! <Window Width="420" Height="190" BackgroundImage="platform_background_air.jpg" > <Button X="402" Y="2" Width="16" Height="16" Command="86" Caption=""> <Image Off="close.png" On="close.png" /> |
From: Dewitt C. <ddc...@us...> - 2006-11-23 00:07:35
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv22565/src/sim Modified Files: Game.cpp tcObjectControl.cpp tcOpticalSensor.cpp tcPlatformObject.cpp tcStores.cpp Log Message: Index: tcOpticalSensor.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcOpticalSensor.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcOpticalSensor.cpp 20 Nov 2006 00:17:44 -0000 1.14 --- tcOpticalSensor.cpp 23 Nov 2006 00:07:33 -0000 1.15 *************** *** 27,30 **** --- 27,31 ---- #include "tcGameObject.h" #include "tcSurfaceObject.h" + #include "tcAeroAirObject.h" #include "tcAirObject.h" #include "tcMissileObject.h" *************** *** 64,74 **** } ! float tcOpticalSensor::CalculateNightPenalty(float lon_rad) const { static DateZulu dz; simState->GetDateZulu(dz); ! ! float localHours = float(dz.getHour()) + C_RADTOHRS * lon_rad; if (localHours >= 24.0) localHours -= 24.0; else if (localHours < 0) localHours += 24.0; --- 65,76 ---- } ! float tcOpticalSensor::CalculateNightPenalty(const tcGameObject* target) const { static DateZulu dz; simState->GetDateZulu(dz); ! ! ! float localHours = float(dz.getHour()) + C_RADTOHRS * target->mcKin.mfLon_rad; if (localHours >= 24.0) localHours -= 24.0; else if (localHours < 0) localHours += 24.0; *************** *** 76,79 **** --- 78,87 ---- if ((localHours < 6) || (localHours > 18)) { + // for jet target check if afterburners are active + if (const tcAeroAirObject* air = dynamic_cast<const tcAeroAirObject*>(target)) + { + if (air->GetThrottleFraction() > 1.0f) return 2.0f; + } + return mpDBObj->nightFactor; } *************** *** 163,167 **** // calculate night penalty ! float nightPenalty = CalculateNightPenalty(tgt_kin->mfLon_rad); float margin_dB = --- 171,175 ---- // calculate night penalty ! float nightPenalty = CalculateNightPenalty(target); float margin_dB = Index: tcPlatformObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcPlatformObject.cpp,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** tcPlatformObject.cpp 20 Nov 2006 00:17:44 -0000 1.67 --- tcPlatformObject.cpp 23 Nov 2006 00:07:33 -0000 1.68 *************** *** 37,40 **** --- 37,41 ---- #include "tcLauncher.h" #include "tc3DModel.h" + #include "tcSimState.h" #include "tcStores.h" #include "common/tcStream.h" *************** *** 82,85 **** --- 83,93 ---- void tcPlatformObject::DesignateTarget(long anID) { + tcSensorMapTrack track; + bool trackFound = tcSimState::Get()->GetTrack(anID, GetAlliance(), track); + if (!trackFound) + { + return; + } + brain->SetTarget(anID); unsigned nLaunchers = mcLauncherState.GetLauncherCount(); *************** *** 87,90 **** --- 95,99 ---- { mcLauncherState.SetLauncherTarget(n, anID); + mcLauncherState.SetLauncherDatum(n, track.mfLon_rad, track.mfLat_rad, 0); } } Index: tcObjectControl.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcObjectControl.cpp,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** tcObjectControl.cpp 20 Nov 2006 00:17:44 -0000 1.53 --- tcObjectControl.cpp 23 Nov 2006 00:07:33 -0000 1.54 *************** *** 1711,1714 **** --- 1711,1715 ---- mcWeaponPanel.SetPage(0); mcSensorPanel.SetPage(0); + UpdateControlObjects(); } *************** *** 1896,1900 **** SetControlGameObject(mpHookedGameObj); ! if (!bFound) {return;} { --- 1897,1906 ---- SetControlGameObject(mpHookedGameObj); ! if (!bFound) ! { ! mcAIPanel.SetAIData(0); ! wxASSERT(false); ! return; ! } { Index: tcStores.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcStores.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tcStores.cpp 20 Nov 2006 00:17:45 -0000 1.16 --- tcStores.cpp 23 Nov 2006 00:07:33 -0000 1.17 *************** *** 542,546 **** wxASSERT(obj); ! if (obj == 0) return; tcLauncher* launcher = obj->GetLauncher(op.launcherIdx); --- 542,549 ---- wxASSERT(obj); ! if (obj == 0) ! { ! return; ! } tcLauncher* launcher = obj->GetLauncher(op.launcherIdx); *************** *** 1106,1109 **** --- 1109,1122 ---- void tcStores::UpdateAutomation() { + const int finishOp = 86; + + // first verify valid op target, otherwise set stage to finishOp + for (size_t n=0; n<automationOps.size(); n++) + { + AutomationOperation& op = automationOps[n]; + tcGameObject* obj = GetChildOrParent(op.obj); + if (obj == 0) op.stage = finishOp; + } + for (size_t n=0; n<automationOps.size(); n++) { *************** *** 1118,1122 **** else { ! op.stage = 86; } } --- 1131,1135 ---- else { ! op.stage = finishOp; } } *************** *** 1127,1131 **** if (op.type == "Empty") { ! op.stage = 86; } else --- 1140,1144 ---- if (op.type == "Empty") { ! op.stage = finishOp; } else *************** *** 1137,1141 **** else { ! op.stage = 86; } } --- 1150,1154 ---- else { ! op.stage = finishOp; } } *************** *** 1146,1164 **** if (AllLaunchersReady(op.obj)) { ! op.stage = 86; } } else { ! op.stage = 86; } } ! // remove all automation ops at delete stage (op.stage == 86) std::vector<AutomationOperation> temp; for (size_t n=0; n<automationOps.size(); n++) { ! if (automationOps[n].stage != 86) { temp.push_back(automationOps[n]); --- 1159,1177 ---- if (AllLaunchersReady(op.obj)) { ! op.stage = finishOp; } } else { ! op.stage = finishOp; } } ! // remove all automation ops at delete stage (op.stage == finishOp) std::vector<AutomationOperation> temp; for (size_t n=0; n<automationOps.size(); n++) { ! if (automationOps[n].stage != finishOp) { temp.push_back(automationOps[n]); *************** *** 1448,1452 **** { tcPlatformObject* obj = dynamic_cast<tcPlatformObject*>(GetChildOrParent(child)); ! size_t nLaunchers = obj->GetLauncherCount(); for (size_t n=0; n<nLaunchers; n++) --- 1461,1469 ---- { tcPlatformObject* obj = dynamic_cast<tcPlatformObject*>(GetChildOrParent(child)); ! if (obj == 0) ! { ! return false; ! } ! size_t nLaunchers = obj->GetLauncherCount(); for (size_t n=0; n<nLaunchers; n++) *************** *** 1470,1474 **** { tcPlatformObject* obj = dynamic_cast<tcPlatformObject*>(GetChildOrParent(child)); ! size_t nLaunchers = obj->GetLauncherCount(); for (size_t n=0; n<nLaunchers; n++) --- 1487,1495 ---- { tcPlatformObject* obj = dynamic_cast<tcPlatformObject*>(GetChildOrParent(child)); ! if (obj == 0) ! { ! return false; ! } ! size_t nLaunchers = obj->GetLauncherCount(); for (size_t n=0; n<nLaunchers; n++) Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.163 retrieving revision 1.164 diff -C2 -d -r1.163 -r1.164 *** Game.cpp 20 Nov 2006 00:17:43 -0000 1.163 --- Game.cpp 23 Nov 2006 00:07:33 -0000 1.164 *************** *** 3008,3013 **** commandQueue = tcCommandQueue::Get(); ! database->LogSqlColumns("column_log.csv"); int attribList[15]; --- 3008,3014 ---- commandQueue = tcCommandQueue::Get(); ! #ifdef _DEBUG database->LogSqlColumns("column_log.csv"); + #endif int attribList[15]; |
From: Dewitt C. <ddc...@us...> - 2006-11-23 00:07:34
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv22565/src/database Modified Files: tcJetDBObject.cpp Log Message: Index: tcJetDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcJetDBObject.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcJetDBObject.cpp 20 Nov 2006 00:17:41 -0000 1.1 --- tcJetDBObject.cpp 23 Nov 2006 00:07:33 -0000 1.2 *************** *** 128,132 **** else { ! cruise_penalty = cruise_penalty * cruise_penalty; } --- 128,132 ---- else { ! cruise_penalty = cruise_penalty; } |
From: Dewitt C. <ddc...@us...> - 2006-11-23 00:07:16
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv22517/include/sim Modified Files: tcAeroAirObject.h tcOpticalSensor.h Log Message: Index: tcOpticalSensor.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcOpticalSensor.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcOpticalSensor.h 20 Nov 2006 00:16:29 -0000 1.5 --- tcOpticalSensor.h 23 Nov 2006 00:07:13 -0000 1.6 *************** *** 65,69 **** protected: ! float CalculateNightPenalty(float lon_rad) const; // bool isSemiactive; //tcRadar* GetSemiactiveIlluminator(); // add semi-active later for laser designated guidance --- 65,69 ---- protected: ! float CalculateNightPenalty(const tcGameObject* target) const; // bool isSemiactive; //tcRadar* GetSemiactiveIlluminator(); // add semi-active later for laser designated guidance Index: tcAeroAirObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcAeroAirObject.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tcAeroAirObject.h 20 Nov 2006 00:16:29 -0000 1.16 --- tcAeroAirObject.h 23 Nov 2006 00:07:13 -0000 1.17 *************** *** 55,59 **** void SaveToFile(tcFile& file); ! float GetThrottleFraction() {return throttleFraction;} void SetThrottleFraction(float fract); --- 55,59 ---- void SaveToFile(tcFile& file); ! float GetThrottleFraction() const {return throttleFraction;} void SetThrottleFraction(float fract); |
From: Dewitt C. <ddc...@us...> - 2006-11-20 22:28:44
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv3930/src/database Removed Files: tcGenericDBObject.cpp Log Message: --- tcGenericDBObject.cpp DELETED --- |
From: Dewitt C. <ddc...@us...> - 2006-11-20 22:28:35
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv3916/include/database Removed Files: tcGenericDBObject.h Log Message: --- tcGenericDBObject.h DELETED --- |
From: Dewitt C. <ddc...@us...> - 2006-11-20 00:21:03
|
Update of /cvsroot/gcblue/gcb_wx In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv31148 Modified Files: GCblue.vcproj Log Message: Index: GCblue.vcproj =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/GCblue.vcproj,v retrieving revision 1.107 retrieving revision 1.108 diff -C2 -d -r1.107 -r1.108 *** GCblue.vcproj 28 Sep 2006 02:01:50 -0000 1.107 --- GCblue.vcproj 20 Nov 2006 00:21:01 -0000 1.108 *************** *** 5,8 **** --- 5,9 ---- Name="GCblue" ProjectGUID="{76C3883D-96DD-4A32-91C5-2ADA4CA505E7}" + RootNamespace="GCblue" Keyword="Win32Proj" > *************** *** 70,74 **** Name="VCLinkerTool" IgnoreImportLibrary="false" ! AdditionalDependencies="python24.lib boost_python_debug.lib winmm.lib opengl32.lib glu32.lib GLaux.lib comctl32.lib rpcrt4.lib wsock32.lib wxmswd.lib zlibd.lib pngd.lib jpegd.lib tiffd.lib osgd.lib osgDBd.lib osgParticled.lib osgTextd.lib osgUtild.lib DemeterDebug.lib DemeterOSGDebug.lib sqlited.lib ogg_static_d.lib vorbis_static_d.lib vorbisfile_static_d.lib OpenAL32.lib ALut.lib oalpp_gcbd.lib" ShowProgress="0" OutputFile="$(ProjectDir)/bin/GCblueD.exe" --- 71,75 ---- Name="VCLinkerTool" IgnoreImportLibrary="false" ! AdditionalDependencies="python24.lib boost_python_debug.lib winmm.lib opengl32.lib glu32.lib GLaux.lib comctl32.lib rpcrt4.lib wsock32.lib wxmswd.lib zlibd.lib pngd.lib jpegd.lib tiffd.lib osgd.lib osgDBd.lib osgParticled.lib osgTextd.lib osgUtild.lib osgEphemerisd.lib DemeterDebug.lib DemeterOSGDebug.lib sqlited.lib ogg_static_d.lib vorbis_static_d.lib vorbisfile_static_d.lib OpenAL32.lib ALut.lib oalpp_gcbd.lib" ShowProgress="0" OutputFile="$(ProjectDir)/bin/GCblueD.exe" *************** *** 115,118 **** --- 116,120 ---- UseOfMFC="0" CharacterSet="2" + WholeProgramOptimization="1" > <Tool *************** *** 139,142 **** --- 141,145 ---- FavorSizeOrSpeed="1" OmitFramePointers="true" + WholeProgramOptimization="false" AdditionalIncludeDirectories="include;include/sim;include/scriptinterface;include/common;include/graphics;"C:\wxWindows-2.4.1\lib\msw";include\database" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;__WINDOWS__;__WXMSW__;__WIN95__;__WIN32__;WINVER=0x0400;STRICT;_WIN32_IMPLEMENTATION;TIXML_USE_STL" *************** *** 871,875 **** </File> <File ! RelativePath="src\database\tcAirDBObject.cpp" > </File> --- 874,882 ---- </File> <File ! RelativePath=".\src\database\tcAirDBObject.cpp" ! > ! </File> ! <File ! RelativePath=".\src\database\tcAirDetectionDBObject.cpp" > </File> *************** *** 907,919 **** </File> <File ! RelativePath="src\database\tcFixedDBObject.cpp" > </File> <File ! RelativePath="src\database\tcFlightportDBObject.cpp" > </File> <File ! RelativePath="src\database\tcGenericDBObject.cpp" > </File> --- 914,926 ---- </File> <File ! RelativePath="src\database\tcFlightportDBObject.cpp" > </File> <File ! RelativePath=".\src\database\tcFuelTankDBObject.cpp" > </File> <File ! RelativePath=".\src\database\tcGroundDBObject.cpp" > </File> *************** *** 923,926 **** --- 930,937 ---- </File> <File + RelativePath=".\src\database\tcJetDBObject.cpp" + > + </File> + <File RelativePath="src\database\tcLauncherDBObject.cpp" > *************** *** 935,938 **** --- 946,953 ---- </File> <File + RelativePath=".\src\database\tcPlatformDBObject.cpp" + > + </File> + <File RelativePath="src\database\tcRadarDBObject.cpp" > *************** *** 947,950 **** --- 962,973 ---- </File> <File + RelativePath=".\src\database\tcShipDBObject.cpp" + > + </File> + <File + RelativePath=".\src\database\tcSimpleAirDBObject.cpp" + > + </File> + <File RelativePath=".\src\database\tcSonarDBObject.cpp" > *************** *** 971,974 **** --- 994,1001 ---- </File> <File + RelativePath=".\src\database\tcWaterDetectionDBObject.cpp" + > + </File> + <File RelativePath=".\src\database\tcWeaponDBObject.cpp" > *************** *** 2189,2193 **** </File> <File ! RelativePath="include\database\tcAirDBObject.h" > </File> --- 2216,2224 ---- </File> <File ! RelativePath=".\include\database\tcAirDBObject.h" ! > ! </File> ! <File ! RelativePath=".\include\database\tcAirDetectionDBObject.h" > </File> *************** *** 2233,2245 **** </File> <File ! RelativePath="include\database\tcFixedDBObject.h" > </File> <File ! RelativePath="include\database\tcFlightportDBObject.h" > </File> <File ! RelativePath="include\database\tcGenericDBObject.h" > </File> --- 2264,2276 ---- </File> <File ! RelativePath="include\database\tcFlightportDBObject.h" > </File> <File ! RelativePath=".\include\database\tcFuelTankDBObject.h" > </File> <File ! RelativePath=".\include\database\tcGroundDBObject.h" > </File> *************** *** 2249,2252 **** --- 2280,2287 ---- </File> <File + RelativePath=".\include\database\tcJetDBObject.h" + > + </File> + <File RelativePath="include\database\tcLauncherDBObject.h" > *************** *** 2261,2264 **** --- 2296,2303 ---- </File> <File + RelativePath=".\include\database\tcPlatformDBObject.h" + > + </File> + <File RelativePath=".\include\database\tcPlayerDatabase.h" > *************** *** 2277,2280 **** --- 2316,2327 ---- </File> <File + RelativePath=".\include\database\tcShipDBObject.h" + > + </File> + <File + RelativePath=".\include\database\tcSimpleAirDBObject.h" + > + </File> + <File RelativePath=".\include\database\tcSonarDBObject.h" > *************** *** 2301,2304 **** --- 2348,2355 ---- </File> <File + RelativePath=".\include\database\tcWaterDetectionDBObject.h" + > + </File> + <File RelativePath=".\include\database\tcWeaponDBObject.h" > *************** *** 2373,2376 **** --- 2424,2431 ---- </File> <File + RelativePath=".\include\ai\MissionAircraftInfo.h" + > + </File> + <File RelativePath=".\include\ai\Nav.h" > |
From: Dewitt C. <ddc...@us...> - 2006-11-20 00:19:54
|
Update of /cvsroot/gcblue/gcb_wx/xml In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv30750/xml Modified Files: flightport_gui_default.xml options.xml Added Files: flightport_gui_large.xml stores_gui_table.xml Log Message: Index: options.xml =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/xml/options.xml,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** options.xml 28 Sep 2006 02:01:53 -0000 1.30 --- options.xml 20 Nov 2006 00:19:52 -0000 1.31 *************** *** 1,6 **** <Options> ! <HostAddress>192.168.0.100</HostAddress> ! <LastScenarioPath>SinglePlayer.IranStrike_II.py</LastScenarioPath> ! <LastScenarioName>IranStrike_II</LastScenarioName> <noCopyDatabase /> <noWriteXmlDatabase /> --- 1,6 ---- <Options> ! <HostAddress>192.168.1.5</HostAddress> ! <LastScenarioPath>Test.HornetTest.py</LastScenarioPath> ! <LastScenarioName>HornetTest</LastScenarioName> <noCopyDatabase /> <noWriteXmlDatabase /> *************** *** 10,14 **** <ShakeAirCamera /> <ShowPythonErrors /> ! <UserName>EnterNameHere</UserName> <DisplaySettings>default</DisplaySettings> </Options> --- 10,15 ---- <ShakeAirCamera /> <ShowPythonErrors /> ! <CacheFullDatabase /> ! <UserName>Dewitt2</UserName> <DisplaySettings>default</DisplaySettings> </Options> --- NEW FILE: stores_gui_table.xml --- <Window Width="200" Height="250" BackgroundImage="stores_background.jpg" > <Button X="182" Y="2" Width="16" Height="16" Command="86" Caption=""> <Image Off="close.png" On="close.png" /> </Button> <Stores SlotSize="16" UpperLeftX="12" UpperLeftY="30" HorizontalSpacing="90" VerticalSpacing="21" RowSize="444" /> </Window> --- NEW FILE: flightport_gui_large.xml --- <Window Width="500" Height="315" BackgroundImage="flightport_background_large.jpg" > <Button X="482" Y="2" Width="16" Height="16" Command="86" Caption=""> <Image Off="close.png" On="close.png" /> </Button> <FlightPort SlotSize="32" LaunchX="15" LaunchY="30" LaunchSpacing="40" ReadyX="15" ReadyY="90" ReadySpacing="40" HangarX="15" HangarY="155" HangarSlotSize="20" HangarSpacingH="24" HangarSpacingV="40" HangarRowSize="18" MagazineLocX="340" MagazineLocY="30" MagazineOffsetX="40" /> </Window> Index: flightport_gui_default.xml =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/xml/flightport_gui_default.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** flightport_gui_default.xml 5 Jan 2006 03:47:22 -0000 1.1 --- flightport_gui_default.xml 20 Nov 2006 00:19:52 -0000 1.2 *************** *** 3,7 **** <Image Off="close.png" On="close.png" /> </Button> ! <FlightPort SlotSize="32" LaunchX="15" LaunchY="30" LaunchSpacing="40" ReadyX="15" ReadyY="90" ReadySpacing="40" HangarX="15" HangarY="155" HangarSpacingH="40" HangarSpacingV="55" HangarRowSize="10" /> --- 3,7 ---- <Image Off="close.png" On="close.png" /> </Button> ! <FlightPort SlotSize="32" LaunchX="15" LaunchY="30" LaunchSpacing="40" ReadyX="15" ReadyY="90" ReadySpacing="40" HangarX="15" HangarY="155" HangarSpacingH="40" HangarSpacingV="55" HangarRowSize="10" MagazineLocX="300" MagazineLocY="30" MagazineOffsetX="40" /> |
From: Dewitt C. <ddc...@us...> - 2006-11-20 00:19:16
|
Update of /cvsroot/gcblue/gcb_wx/database In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv30633/database Modified Files: database.db Log Message: Index: database.db =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/database/database.db,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 Binary files /tmp/cvs38u6WR and /tmp/cvsjGklvt differ |
From: Dewitt C. <ddc...@us...> - 2006-11-20 00:18:49
|
Update of /cvsroot/gcblue/gcb_wx/scripts In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv30348/scripts Modified Files: AI.py AirManagement.py Landing.py UnitCommands.py Log Message: Index: AirManagement.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/AirManagement.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AirManagement.py 17 Aug 2006 01:29:11 -0000 1.1 --- AirManagement.py 20 Nov 2006 00:18:47 -0000 1.2 *************** *** 9,13 **** TI.SetUpdateInterval(20) - nUnits = FP.GetUnitCount() --- 9,12 ---- *************** *** 18,23 **** UI_n = FP.GetUnitPlatformInterface(n) if (UI_n.GetFuel() < 1.0) and (not UI_n.IsRefueling()): ! UI_n.DisplayMessage('Refueling %s' % unitName) UI_n.LoadOther('Fuel') --- 17,23 ---- UI_n = FP.GetUnitPlatformInterface(n) if (UI_n.GetFuel() < 1.0) and (not UI_n.IsRefueling()): ! #UI_n.DisplayMessage('Refueling %s' % unitName) UI_n.LoadOther('Fuel') + return # only start one refueling at a time Index: AI.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/AI.py,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** AI.py 24 Oct 2006 01:34:37 -0000 1.30 --- AI.py 20 Nov 2006 00:18:47 -0000 1.31 *************** *** 474,484 **** UI.DisplayMessage('Dropping all bombs') - - nLaunchers = UI.GetLauncherCount() for n in range(0, nLaunchers): launcher_info = UI.GetLauncherInfo(n) ! if (launcher_info.LaunchMode == 2): UI.SendDatumToLauncher(tgt_lon,tgt_lat,tgt_alt,n) UI.Launch(n, 32) --- 474,482 ---- UI.DisplayMessage('Dropping all bombs') nLaunchers = UI.GetLauncherCount() for n in range(0, nLaunchers): launcher_info = UI.GetLauncherInfo(n) ! if (launcher_info.LaunchMode == 3): UI.SendDatumToLauncher(tgt_lon,tgt_lat,tgt_alt,n) UI.Launch(n, 32) Index: UnitCommands.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/UnitCommands.py,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** UnitCommands.py 24 Oct 2006 01:34:37 -0000 1.31 --- UnitCommands.py 20 Nov 2006 00:18:47 -0000 1.32 *************** *** 464,469 **** for n in range(0, nLaunchers): info = UI.GetLauncherInfo(n) ! # LaunchMode == 2 is gravity bomb ! if (info.LaunchMode == 2) and (info.Quantity > 0): return 1 return 0 --- 464,469 ---- for n in range(0, nLaunchers): info = UI.GetLauncherInfo(n) ! # LaunchMode == 3 is gravity bomb ! if (info.LaunchMode == 3) and (info.Quantity > 0): return 1 return 0 Index: Landing.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/Landing.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Landing.py 24 Oct 2006 01:34:37 -0000 1.3 --- Landing.py 20 Nov 2006 00:18:47 -0000 1.4 *************** *** 56,60 **** if (land_state <= 1): if (land_state == 0): ! UI.DisplayMessage('Landing on platform %d' % track_info.ID) UI.SetAlt(1200 + alt_m) TI.SetMemoryValue(2, 1) --- 56,61 ---- if (land_state <= 1): if (land_state == 0): ! base_name = UI.LookupFriendlyName(track_info.ID) ! UI.DisplayMessage('Landing %s' % base_name) UI.SetAlt(1200 + alt_m) TI.SetMemoryValue(2, 1) |
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv29807/src/graphics Modified Files: cspSky.cpp tc3DModel.cpp tc3DViewer.cpp tcAltitudeBarControl.cpp tcBriefingView.cpp tcContainerGui.cpp tcContainerItem.cpp tcCreditView.cpp tcDatabaseInfoPanel.cpp tcDatabaseInfoWindow.cpp tcFlightPortGui.cpp tcHookInfo.cpp tcLauncherPopup.cpp tcPlatformGui.cpp tcScenarioSelectView.cpp tcStoresGui.cpp Log Message: Index: tcDatabaseInfoPanel.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcDatabaseInfoPanel.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcDatabaseInfoPanel.cpp 24 Sep 2006 19:50:20 -0000 1.3 --- tcDatabaseInfoPanel.cpp 20 Nov 2006 00:17:42 -0000 1.4 *************** *** 28,35 **** #include "tcDatabaseInfoPanel.h" #include "tcDatabaseObject.h" ! #include "tcGenericDBObject.h" #include "tcLauncherDBObject.h" #include "tcMissileDBObject.h" #include "tcTorpedoDBObject.h" #include "tc3DModel.h" #include "tcSensorMap.h" --- 28,38 ---- #include "tcDatabaseInfoPanel.h" #include "tcDatabaseObject.h" ! #include "tcPlatformDBObject.h" #include "tcLauncherDBObject.h" #include "tcMissileDBObject.h" #include "tcTorpedoDBObject.h" + #include "tcShipDBObject.h" + #include "tcAirDBObject.h" + #include "tcGroundDBObject.h" #include "tc3DModel.h" #include "tcSensorMap.h" *************** *** 99,110 **** PrintText(textx, texty, "Unit cost: %s", databaseObj->GetCostString()); ! PrintText(textx, texty, "%s", databaseObj->mzDescription); texty += 5.0f; ! if (tcGenericDBObject* generic = dynamic_cast<tcGenericDBObject*>(databaseObj)) { ! DrawDatabaseInfo(generic, texty); } else if (tcMissileDBObject* missile = dynamic_cast<tcMissileDBObject*>(databaseObj)) --- 102,121 ---- PrintText(textx, texty, "Unit cost: %s", databaseObj->GetCostString()); ! PrintText(textx, texty, "%s", databaseObj->mzDescription.c_str()); texty += 5.0f; ! if (tcShipDBObject* shipData = dynamic_cast<tcShipDBObject*>(databaseObj)) { ! DrawDatabaseInfo(shipData, texty); ! } ! else if (tcAirDBObject* airData = dynamic_cast<tcAirDBObject*>(databaseObj)) ! { ! DrawDatabaseInfo(airData, texty); ! } ! else if (tcGroundDBObject* groundData = dynamic_cast<tcGroundDBObject*>(databaseObj)) ! { ! DrawDatabaseInfo(groundData, texty); } else if (tcMissileDBObject* missile = dynamic_cast<tcMissileDBObject*>(databaseObj)) *************** *** 124,128 **** ! void tcDatabaseInfoPanel::DrawDatabaseInfo(database::tcGenericDBObject* genericData, float yStart) { float textx = 10.0f; --- 135,144 ---- ! void DrawDatabaseInfo(database::tcShipDBObject* shipData, float yStart); ! void DrawDatabaseInfo(database::tcAirDBObject* airData, float yStart); ! void DrawDatabaseInfo(database::tcGroundDBObject* groundData, float yStart); ! ! ! void tcDatabaseInfoPanel::DrawDatabaseInfo(database::tcShipDBObject* shipData, float yStart) { float textx = 10.0f; *************** *** 133,167 **** ! PrintText(textx, texty, "Max speed: %.0f kts", genericData->mfMaxSpeed_kts); if (IsEmbedded()) { ! PrintText(textx, texty, "Turn rate: %.1f deg/s", genericData->mfTurnRate_degps); } ! PrintText(textx, texty, "Survivability: %.0f", genericData->mfToughness); ! PrintText(textx, texty, "RCS %.0f dBsm", genericData->mfRcs_dbsm); ! if ((genericData->mfFuelRate_kgps > 0) && IsEmbedded()) { ! float fuelTimeHours = 2.778e-4 * genericData->mfFuelCapacity_kg / genericData->mfFuelRate_kgps; ! switch (genericData->mnModelType) { case MTYPE_SURFACE: case MTYPE_CARRIER: case MTYPE_AIR: ! PrintText(textx, texty, "Cruise range %.0f km", fuelTimeHours * genericData->mfMaxSpeed_kts * C_NMITOKM); break; case MTYPE_FIXEDWINGX: ! PrintText(textx, texty, "Fuel capacity %.0f kg", genericData->mfFuelCapacity_kg); break; case MTYPE_HELO: PrintText(textx, texty, "Endurance %.1f hrs", 2.0f * fuelTimeHours); break; ! case MTYPE_SUBMARINE: ! PrintText(textx, texty, "Fuel capacity %.0f kg", genericData->mfFuelCapacity_kg); break; } --- 149,229 ---- ! PrintText(textx, texty, "Max speed: %.0f kts", shipData->mfMaxSpeed_kts); if (IsEmbedded()) { ! PrintText(textx, texty, "Turn rate: %.1f deg/s", shipData->mfTurnRate_degps); } ! PrintText(textx, texty, "Survivability: %.0f", shipData->mfToughness); ! PrintText(textx, texty, "RCS %.0f dBsm", shipData->RCS_dBsm); ! if ((shipData->mfFuelRate_kgps > 0) && IsEmbedded()) { ! float fuelTimeHours = 2.778e-4 * shipData->GetInternalFuelCapacity() / shipData->mfFuelRate_kgps; ! switch (shipData->mnModelType) { case MTYPE_SURFACE: case MTYPE_CARRIER: + PrintText(textx, texty, "Cruise range %.0f km", fuelTimeHours * shipData->mfMaxSpeed_kts * C_NMITOKM); + break; + default: + PrintText(textx, texty, "MODEL TYPE ERROR (%d)", shipData->mnModelType); + break; + } + } + + texty += 10.0f; + DrawLauncherInfo(shipData, texty); + + texty += 10.0f; + DrawSensorInfo(shipData, texty); + + yCurrent = texty; + } + + + void tcDatabaseInfoPanel::DrawDatabaseInfo(database::tcAirDBObject* airData, float yStart) + { + float textx = 10.0f; + float maxWidth = float(mnWidth) - textx - 5.0f; + float texty = yStart; + osg::BoundingBox textBox; + osg::Vec4 color(0.4f, 1.0f, 0.4f, 1.0f); + + + PrintText(textx, texty, "Max speed: %.0f kts", airData->mfMaxSpeed_kts); + + if (IsEmbedded()) + { + PrintText(textx, texty, "Turn rate: %.1f deg/s", airData->mfTurnRate_degps); + } + + + PrintText(textx, texty, "Survivability: %.0f", airData->mfToughness); + + PrintText(textx, texty, "RCS %.0f dBsm", airData->RCS_dBsm); + + if ((airData->mfFuelRate_kgps > 0) && IsEmbedded()) + { + float fuelTimeHours = 2.778e-4 * airData->GetInternalFuelCapacity() / airData->mfFuelRate_kgps; + + switch (airData->mnModelType) + { case MTYPE_AIR: ! case MTYPE_FIXEDWING: ! PrintText(textx, texty, "Cruise range %.0f km", fuelTimeHours * airData->mfMaxSpeed_kts * C_NMITOKM); break; case MTYPE_FIXEDWINGX: ! PrintText(textx, texty, "Internal fuel cap %.0f kg", airData->GetInternalFuelCapacity()); break; case MTYPE_HELO: PrintText(textx, texty, "Endurance %.1f hrs", 2.0f * fuelTimeHours); break; ! default: ! PrintText(textx, texty, "MODEL TYPE ERROR (%d)", airData->mnModelType); break; } *************** *** 169,176 **** texty += 10.0f; ! DrawLauncherInfo(genericData, texty); texty += 10.0f; ! DrawSensorInfo(genericData, texty); yCurrent = texty; --- 231,273 ---- texty += 10.0f; ! DrawLauncherInfo(airData, texty); texty += 10.0f; ! DrawSensorInfo(airData, texty); ! ! yCurrent = texty; ! } ! ! ! void tcDatabaseInfoPanel::DrawDatabaseInfo(database::tcGroundDBObject* groundData, float yStart) ! { ! float textx = 10.0f; ! float maxWidth = float(mnWidth) - textx - 5.0f; ! float texty = yStart; ! osg::BoundingBox textBox; ! osg::Vec4 color(0.4f, 1.0f, 0.4f, 1.0f); ! ! ! if (groundData->mfMaxSpeed_kts > 0) ! { ! PrintText(textx, texty, "Max speed: %.0f kts", groundData->mfMaxSpeed_kts); ! ! if (IsEmbedded()) ! { ! PrintText(textx, texty, "Turn rate: %.1f deg/s", groundData->mfTurnRate_degps); ! } ! } ! ! ! PrintText(textx, texty, "Survivability: %.0f", groundData->mfToughness); ! ! PrintText(textx, texty, "RCS %.0f dBsm", groundData->RCS_dBsm); ! ! ! texty += 10.0f; ! DrawLauncherInfo(groundData, texty); ! ! texty += 10.0f; ! DrawSensorInfo(groundData, texty); yCurrent = texty; *************** *** 222,226 **** ! void tcDatabaseInfoPanel::DrawLauncherInfo(database::tcGenericDBObject* genericData, float& y) { wxASSERT(genericData != 0); --- 319,323 ---- ! void tcDatabaseInfoPanel::DrawLauncherInfo(database::tcPlatformDBObject* genericData, float& y) { wxASSERT(genericData != 0); *************** *** 258,262 **** } ! void tcDatabaseInfoPanel::DrawSensorInfo(database::tcGenericDBObject* genericData, float& y) { wxASSERT(genericData != 0); --- 355,359 ---- } ! void tcDatabaseInfoPanel::DrawSensorInfo(database::tcPlatformDBObject* genericData, float& y) { wxASSERT(genericData != 0); Index: tcFlightPortGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcFlightPortGui.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcFlightPortGui.cpp 1 Oct 2006 21:07:40 -0000 1.11 --- tcFlightPortGui.cpp 20 Nov 2006 00:17:42 -0000 1.12 *************** *** 2,7 **** ** @file tcFlightPortGui.cpp */ ! /* ! ** Copyright (C) 2005 Dewitt Colclough (de...@gc...) ** All rights reserved. --- 2,6 ---- ** @file tcFlightPortGui.cpp */ ! /* Copyright (C) 2005-2006 Dewitt Colclough (de...@gc...) ** All rights reserved. *************** *** 37,40 **** --- 36,41 ---- #include "tcPlatformObject.h" #include "tcSimState.h" + #include "tcStores.h" + #include "tcStoresGui.h" #include <osg/Geometry> #include "ai/tcMissionManager.h" *************** *** 134,138 **** { size_t nSlots = slots.size(); ! for (size_t n=readyOffset; n<nSlots; n++) { tcContainerSlot& slot = slots[n]; --- 135,139 ---- { size_t nSlots = slots.size(); ! for (size_t n=readyOffset; n<magazineIdx; n++) { tcContainerSlot& slot = slots[n]; *************** *** 175,188 **** { tcContainerSlot& slot = slots[n]; ! tcEntityContainerItem* item = dynamic_cast<tcEntityContainerItem*>(slot.GetItem()); 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 --- 176,193 ---- { tcContainerSlot& slot = slots[n]; ! tcContainerItem* item = slot.GetItem(); ! tcEntityContainerItem* entityItem = dynamic_cast<tcEntityContainerItem*>(item); bool isMouseOver = slot.IsMouseOver(); bool unitQueuedForTakeoff = false; ! osg::Vec4 itemColor(1, 1, 1, 1); ! std::string caption; ! ! if (entityItem != 0) { ! int drawState = item->GetDrawState(); ! ! /* Determine entityItem color (color mixed with image color) ** Damaged - red ** Not fully equipped and refueled - yellow *************** *** 190,201 **** ** 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); --- 195,206 ---- ** Reserved for mission - darken 50% */ ! tcAirObject* air = dynamic_cast<tcAirObject*>(entityItem->GetEntity()); ! if (air != 0) { ! if (air->GetDamageLevel() > 0) { itemColor.set(1, 0, 0, 1); } ! else if (!air->IsReadyForLaunch()) { itemColor.set(1, 1, 0.5, 1); *************** *** 206,218 **** } ! 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 --- 211,234 ---- } ! if (flightPort->GetMissionManager()->IsAircraftReserved(air->mnID)) { itemColor = itemColor * 0.7; } ! unitQueuedForTakeoff = flightPort->IsQueuedForTakeoff(air->mnID); } ! // draw description caption if mouse is over slot ! if (isMouseOver) ! { ! caption = entityItem->GetDescription(); ! } ! } ! ! if (item != 0) ! { ! int drawState = item->GetDrawState(); ! ! osg::Geometry* icon = slot.GetIcon(); osg::Vec4Array* colorArray = dynamic_cast<osg::Vec4Array*>(icon->getColorArray()); // assumes color array already created *************** *** 222,234 **** ! // draw description caption if mouse is over slot ! if (isMouseOver) ! { const osg::Vec4 color(1.0f, 1.0f, 1.0f, 1.0f); ! DrawTextR(item->GetDescription().c_str(), slot.loc.GetLeft(), slot.loc.GetTop() + 15.0f, defaultFont.get(), color, 14.0f, LEFT_BASE_LINE); ! } } ! // draw expanded rectangle for slot border tcRect r = slot.loc; --- 238,256 ---- ! if (isMouseOver) ! { ! if (caption.size() == 0) ! { ! caption = item->GetItemName().c_str(); ! } ! const osg::Vec4 color(1.0f, 1.0f, 1.0f, 1.0f); ! DrawTextR(caption.c_str(), slot.loc.GetLeft(), slot.loc.GetTop() + 15.0f, defaultFont.get(), color, 14.0f, LEFT_BASE_LINE); ! } ! } ! ! // draw expanded rectangle for slot border tcRect r = slot.loc; *************** *** 352,361 **** // add hangar slots hangarOffset = GetNumSlots(); ! slotLoc.Set(hangarLoc.x, hangarLoc.x + slotSize, ! hangarLoc.y, hangarLoc.y + slotSize); size_t nRow = 0; for (size_t n=0; n<databaseObj->hangarCapacity; n++) { ! AddSlot(slotLoc); slotLoc.Offset(hangarHorizontalSpacing, 0); nRow++; --- 374,384 ---- // add hangar slots hangarOffset = GetNumSlots(); ! slotLoc.Set(hangarLoc.x, hangarLoc.x + hangarSlotSize, ! hangarLoc.y, hangarLoc.y + hangarSlotSize); size_t nRow = 0; + tcContainerGui::IconSize hangarIconSize = useSmallHangarSlots ? tcContainerGui::SMALL_ICON_SIZE : tcContainerGui::NORMAL_ICON_SIZE; for (size_t n=0; n<databaseObj->hangarCapacity; n++) { ! AddSlot(slotLoc, hangarIconSize); slotLoc.Offset(hangarHorizontalSpacing, 0); nRow++; *************** *** 366,369 **** --- 389,414 ---- } } + + // add magazine slots + magazineIdx = GetNumSlots(); + tcPlatformObject* platform = dynamic_cast<tcPlatformObject*>(tcSimState::Get()->GetObject(platformId)); + if (platform == 0) + { + wxASSERT(false); + return; + } + + slotLoc.Set(magazineLoc.x, magazineLoc.x + slotSize, + magazineLoc.y, magazineLoc.y + slotSize); + nMagazines = platform->GetMagazineCount(); + for (size_t n=0; n<nMagazines; n++) + { + AddSlot(slotLoc); + + slotLoc.Offset(magazineOffset.x, magazineOffset.y); + } + + // load icons + magazineIcon = tc3DWindow::CreateTexturedSymbol("icons\\magazine.jpg", slotSize); } *************** *** 425,429 **** size_t nSlots = slots.size(); ! for (size_t n=launchOffset; n<nSlots; n++) { tcContainerSlot& slot = slots[n]; --- 470,474 ---- size_t nSlots = slots.size(); ! for (size_t n=launchOffset; n<magazineIdx; n++) { tcContainerSlot& slot = slots[n]; *************** *** 445,452 **** --- 490,548 ---- } + // check if cursor is over a magazine slot + for (size_t n=magazineIdx; n<magazineIdx+nMagazines; n++) + { + tcContainerSlot& slot = slots[n]; + + if (slot.loc.ContainsPoint(x, y)) + { + tcContainerItem* item = slot.GetItem(); + wxASSERT(item); + if (item == 0) return; + + tcContainerGui* gui = item->GetGui(); + + // toggle gui + if (gui == 0) + { + OpenMagazineGui(n - magazineIdx, item); + } + else + { + gui->DestroyGui(); + item->SetGui(0); + } + return; + } + } + } + + + /** + * Open magazine gui + * Copied from tcPlatformGui, needs refactoring + */ + void tcFlightPortGui::OpenMagazineGui(unsigned int idx, tcContainerItem* item) + { + tcPlatformObject* platform = dynamic_cast<tcPlatformObject*>(tcSimState::Get()->GetObject(platformId)); + if (platform == 0) return; + + tcStores* magazine = platform->GetMagazine(idx); + if (magazine) + { + wxPoint pos = wxWindow::GetPosition(); + wxSize size = wxWindow::GetSize(); + tcStoresGui* gui = new tcStoresGui(platformId, -1, idx, wxPoint(pos.x + size.GetWidth() + 10, pos.y), + "xml/stores_gui_table.xml"); + wxASSERT(item); + item->SetGui(gui); + gui->SetParentItem(item); + } + } + void tcFlightPortGui::OpenPlatformGui(tcContainerItem* item) { *************** *** 495,499 **** TiXmlElement* elt = current->ToElement(); ! double slotSizeXml = 16.0; double launchX = 0; double launchY = 0; --- 591,595 ---- TiXmlElement* elt = current->ToElement(); ! double slotSizeXml = 32.0; double launchX = 0; double launchY = 0; *************** *** 507,511 **** --- 603,613 ---- double hangarSpacingV = 10.0; int hangarRowSizeXml = 10; + double hangarSlotSizeXml = 0; + double magazineLocX = 0; + double magazineLocY = 0; + double magazineOffsetX = 0; + double magazineOffsetY = 0; + elt->Attribute("SlotSize", &slotSizeXml); elt->Attribute("LaunchX", &launchX); *************** *** 517,524 **** --- 619,633 ---- elt->Attribute("HangarX", &hangarX); elt->Attribute("HangarY", &hangarY); + elt->Attribute("HangarSlotSize", &hangarSlotSizeXml); elt->Attribute("HangarSpacingH", &hangarSpacingH); elt->Attribute("HangarSpacingV", &hangarSpacingV); elt->Attribute("HangarRowSize", &hangarRowSizeXml); + elt->Attribute("MagazineLocX", &magazineLocX); + elt->Attribute("MagazineLocY", &magazineLocY); + elt->Attribute("MagazineOffsetX", &magazineOffsetX); + elt->Attribute("MagazineOffsetY", &magazineOffsetY); + + slotSize = slotSizeXml; *************** *** 536,540 **** hangarVerticalSpacing = hangarSpacingV; hangarRowSize = hangarRowSizeXml; ! } --- 645,656 ---- hangarVerticalSpacing = hangarSpacingV; hangarRowSize = hangarRowSizeXml; ! hangarSlotSize = hangarSlotSizeXml; ! useSmallHangarSlots = ((hangarSlotSize < 32.0) && (hangarSlotSize > 0)); ! if (hangarSlotSize <= 0) hangarSlotSize = slotSize; ! ! magazineLoc.x = magazineLocX; ! magazineLoc.y = magazineLocY; ! magazineOffset.x = magazineOffsetX; ! magazineOffset.y = magazineOffsetY; } *************** *** 616,619 **** --- 732,759 ---- } + + // update magazine slots (add item if not added yet) + tcPlatformObject* platform = dynamic_cast<tcPlatformObject*>(tcSimState::Get()->GetObject(platformId)); + if (platform != 0) + { + for (size_t n=magazineIdx; n<magazineIdx+nMagazines; n++) + { + tcContainerSlot& slot = slots[n]; + + tcContainerItem* item = slot.GetItem(); + if (item == 0) + { + tcStores* magazine = platform->GetMagazine(n - magazineIdx); + const std::string& magazineName = magazine->GetDisplayName(); + item = new tcContainerItem(); + slot.SetItem(item); + item->SetIcon(magazineIcon.get()); + item->SetItemName(magazineName); + } + slot.SetUpdated(true); + } + } + + // delete items that were not updated for (size_t n=0; n<slots.size(); n++) Index: tcLauncherPopup.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcLauncherPopup.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcLauncherPopup.cpp 23 Mar 2006 01:11:02 -0000 1.12 --- tcLauncherPopup.cpp 20 Nov 2006 00:17:42 -0000 1.13 *************** *** 53,56 **** --- 53,57 ---- wxPoint tcLauncherPopup::userPositions[MAX_LAUNCHERS]; bool tcLauncherPopup::userPositionsInitialized = false; + std::map<long, bool> tcLauncherPopup::registry; const wxPoint& tcLauncherPopup::GetUserPosition(unsigned int idx) *************** *** 60,64 **** for (unsigned int k=0; k<MAX_LAUNCHERS; k++) { ! userPositions[k] = wxPoint(220 + k*210, 200); } userPositionsInitialized = true; --- 61,65 ---- for (unsigned int k=0; k<MAX_LAUNCHERS; k++) { ! userPositions[k] = wxPoint(220 + (k%3)*210, 200 + 155*(k/3)); } userPositionsInitialized = true; *************** *** 96,99 **** --- 97,192 ---- + bool tcLauncherPopup::ForceClose(long id, unsigned idx) + { + long key = GetKey(id, idx); + + std::map<long, bool>::iterator iter = + registry.find(key); + if (iter != registry.end()) + { + iter->second = true; + return true; + } + else + { + return false; // not found + } + } + + bool tcLauncherPopup::GetForceClose(long id, unsigned idx) + { + long key = GetKey(id, idx); + + std::map<long, bool>::iterator iter = + registry.find(key); + if (iter != registry.end()) + { + return iter->second; + } + else + { + fprintf(stderr, "tcLauncherPopup::GetForceClose - not in registry!\n"); + wxASSERT(false); + return false; // not found + } + } + + long tcLauncherPopup::GetKey(long id, unsigned idx) + { + return long((id << 4) + idx); + } + + void tcLauncherPopup::RegisterWindow(long id, unsigned idx) + { + long key = GetKey(id, idx); + + std::map<long, bool>::iterator iter = + registry.find(key); + + if (iter != registry.end()) + { + fprintf(stderr, "tcLauncherPopup::RegisterWindow - already exists!\n"); + wxASSERT(false); + return; + } + + registry[key] = false; + } + + void tcLauncherPopup::UnregisterWindow(long id, unsigned idx) + { + long key = GetKey(id, idx); + + std::map<long, bool>::iterator iter = + registry.find(key); + + if (iter == registry.end()) + { + fprintf(stderr, "tcLauncherPopup::UnregisterWindow - does not exist!\n"); + wxASSERT(false); + return; + } + + registry.erase(iter); + } + + + void tcLauncherPopup::UnregisterAll() + { + registry.clear(); + } + + bool tcLauncherPopup::WindowExists(long id, unsigned idx) + { + long key = GetKey(id, idx); + + std::map<long, bool>::iterator iter = + registry.find(key); + + return (iter != registry.end()); + } + + + /** * *************** *** 101,104 **** --- 194,199 ---- void tcLauncherPopup::Draw() { + if (GetForceClose(platformId, launcherIdx)) destroy = true; + if (destroy) { *************** *** 530,533 **** --- 625,630 ---- InitTorpedoControls(); + RegisterWindow(id, idx); + SetActive(true); } *************** *** 535,539 **** tcLauncherPopup::~tcLauncherPopup() { ! } --- 632,636 ---- tcLauncherPopup::~tcLauncherPopup() { ! UnregisterWindow(platformId, launcherIdx); } Index: tcDatabaseInfoWindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcDatabaseInfoWindow.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcDatabaseInfoWindow.cpp 20 Aug 2006 22:24:02 -0000 1.8 --- tcDatabaseInfoWindow.cpp 20 Nov 2006 00:17:42 -0000 1.9 *************** *** 28,32 **** #include "tcDatabaseInfoWindow.h" #include "tcDatabaseObject.h" ! #include "tcGenericDBObject.h" #include "tcLauncherDBObject.h" #include "tcMissileDBObject.h" --- 28,32 ---- #include "tcDatabaseInfoWindow.h" #include "tcDatabaseObject.h" ! #include "tcPlatformDBObject.h" #include "tcLauncherDBObject.h" #include "tcMissileDBObject.h" Index: tc3DModel.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DModel.cpp,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** tc3DModel.cpp 5 Sep 2006 01:04:25 -0000 1.39 --- tc3DModel.cpp 20 Nov 2006 00:17:42 -0000 1.40 *************** *** 34,38 **** #include "tcParticlePlacer.h" #include "tcSound.h" ! #include "tcGenericDBObject.h" #include "tcSensorMapTrack.h" #include "tcSimState.h" --- 34,38 ---- #include "tcParticlePlacer.h" #include "tcSound.h" ! #include "tcPlatformDBObject.h" #include "tcSensorMapTrack.h" #include "tcSimState.h" *************** *** 878,882 **** if (info.param >= (int)plat->GetSensorCount()) { ! std::cerr << "sensor animation param out of range\n"; wxASSERT(0); return; --- 878,882 ---- if (info.param >= (int)plat->GetSensorCount()) { ! fprintf(stderr, "tc3DModel::SetupAnimation - Sensor animation param out of range (%s)\n", obj->mzClass.c_str()); wxASSERT(0); return; Index: tcHookInfo.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcHookInfo.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** tcHookInfo.cpp 18 Jun 2006 00:45:00 -0000 1.20 --- tcHookInfo.cpp 20 Nov 2006 00:17:42 -0000 1.21 *************** *** 520,524 **** void tcHookInfo::GetObjectInfo(std::string& s, tcDatabaseObject *apDBObject, tcGameObject *apGameObject) { ! char zClass[8], zModel[8], zType[8]; if (apDBObject == NULL) { --- 520,524 ---- void tcHookInfo::GetObjectInfo(std::string& s, tcDatabaseObject *apDBObject, tcGameObject *apGameObject) { ! char zClass[24], zModel[8], zType[8]; if (apDBObject == NULL) { *************** *** 532,562 **** } ! switch (apDBObject->mnClassID) ! { ! case DTYPE_GENERIC: ! strcpy(zClass,"GEN"); ! break; ! case DTYPE_MISSILE: ! strcpy(zClass,"MIS"); ! break; ! case DTYPE_LAUNCHER: ! strcpy(zClass,"LAU"); ! break; ! case DTYPE_AIR: ! strcpy(zClass,"AIR"); ! break; ! case DTYPE_BALLISTIC: ! strcpy(zClass,"BAL"); ! break; ! case DTYPE_TORPEDO: ! strcpy(zClass, "TOR"); ! break; ! case DTYPE_SUBMARINE: ! strcpy(zClass, "SUB"); ! break; ! default: ! strcpy(zClass,"UNK"); ! break; ! } switch (apGameObject->mnModelType) --- 532,538 ---- } ! std::string databaseClass = apDBObject->GetClassName(); ! ! strcpy_s(zClass, 24, databaseClass.c_str()); switch (apGameObject->mnModelType) Index: tcAltitudeBarControl.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcAltitudeBarControl.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcAltitudeBarControl.cpp 23 Mar 2006 01:11:02 -0000 1.3 --- tcAltitudeBarControl.cpp 20 Nov 2006 00:17:42 -0000 1.4 *************** *** 33,37 **** #include "tcPlatformObject.h" #include "tcSubObject.h" ! #include "tcGenericDBObject.h" #include <osg/Texture2D> #include <osg/Vec4> --- 33,39 ---- #include "tcPlatformObject.h" #include "tcSubObject.h" ! #include "tcAirDBObject.h" ! #include "tcPlatformDBObject.h" ! #include "tcSubDBObject.h" #include <osg/Texture2D> #include <osg/Vec4> *************** *** 204,211 **** void tcAltitudeBarControl::UpdateDrawParameters() { ! tcPlatformObject* platform = dynamic_cast<tcPlatformObject*>(obj); ! if (!platform) return; ! isDepth = platform->mpDBObject->mfMaxDepth_m > 0; float limit, terrain; --- 206,215 ---- void tcAltitudeBarControl::UpdateDrawParameters() { ! tcAirObject* air = dynamic_cast<tcAirObject*>(obj); ! tcSubObject* sub = dynamic_cast<tcSubObject*>(obj); ! if ((air == 0) && (sub == 0)) return; ! ! isDepth = (sub != 0); float limit, terrain; *************** *** 213,227 **** if (isDepth) { ! currentValue = -platform->mcKin.mfAlt_m; ! limit = platform->mpDBObject->mfMaxDepth_m; ! terrain = -platform->mcTerrain.mfHeight_m; ! currentGoal = -platform->mcGS.mfGoalAltitude_m; } else { ! currentValue = platform->mcKin.mfAlt_m; ! limit = platform->mpDBObject->mfMaxAltitude_m; ! terrain = platform->mcTerrain.mfHeight_m; ! currentGoal = platform->mcGS.mfGoalAltitude_m; if (terrain < 0) terrain = 0; } --- 217,231 ---- if (isDepth) { ! currentValue = -sub->mcKin.mfAlt_m; ! limit = sub->mpDBObject->mfMaxDepth_m; ! terrain = -sub->mcTerrain.mfHeight_m; ! currentGoal = -sub->mcGS.mfGoalAltitude_m; } else { ! currentValue = air->mcKin.mfAlt_m; ! limit = air->mpDBObject->maxAltitude_m; ! terrain = air->mcTerrain.mfHeight_m; ! currentGoal = air->mcGS.mfGoalAltitude_m; if (terrain < 0) terrain = 0; } Index: tcPlatformGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcPlatformGui.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcPlatformGui.cpp 28 Sep 2006 02:01:53 -0000 1.13 --- tcPlatformGui.cpp 20 Nov 2006 00:17:42 -0000 1.14 *************** *** 32,36 **** #include "tcFlightOpsObject.h" #include "tcDatabaseObject.h" ! #include "tcGenericDBObject.h" #include "common/tinyxml.h" #include "tcTime.h" --- 32,37 ---- #include "tcFlightOpsObject.h" #include "tcDatabaseObject.h" ! #include "tcAirDBObject.h" ! #include "tcPlatformDBObject.h" #include "common/tinyxml.h" #include "tcTime.h" *************** *** 197,200 **** --- 198,222 ---- captionColor, 18.0f, LEFT_BASE_LINE, 400.0f); + if (tcAirObject* air = dynamic_cast<tcAirObject*>(platform)) + { + if (air->parent != 0) + { + float loadedWeight_kg = air->GetTotalWeight(); + float maxTakeoffWeight_kg = air->mpDBObject->maxTakeoffWeight_kg; + if (loadedWeight_kg <= maxTakeoffWeight_kg) + { + wxString s = wxString::Format("%.0f / %.0f kg", loadedWeight_kg, maxTakeoffWeight_kg); + DrawTextR(s.c_str(), 10.0f, 85.0f, defaultFont.get(), + osg::Vec4(0.4, 1, 0.4, 1), 14.0f, LEFT_BASE_LINE, 400.0f); + } + else + { + DrawTextR("OVERWEIGHT", 10.0f, 85.0f, defaultFont.get(), + osg::Vec4(1, 1, 0, 1), 14.0f, LEFT_BASE_LINE, 400.0f); + } + + } + } + // draw slots and items *************** *** 278,282 **** float x = fuelSlot.loc.GetLeft(); float y = fuelSlot.loc.GetTop() + 15.0f; ! float fuelCapacity_kg = platform->mpDBObject->mfFuelCapacity_kg; wxString caption; --- 300,304 ---- float x = fuelSlot.loc.GetLeft(); float y = fuelSlot.loc.GetTop() + 15.0f; ! float fuelCapacity_kg = platform->GetFuelCapacity(); wxString caption; *************** *** 529,534 **** wxPoint pos = wxWindow::GetPosition(); wxSize size = wxWindow::GetSize(); tcFlightPortGui* gui = new tcFlightPortGui(platform->mnID, wxPoint(pos.x, pos.y + size.GetHeight() + 10), ! "xml/flightport_gui_default.xml"); wxASSERT(item); item->SetGui(gui); --- 551,567 ---- wxPoint pos = wxWindow::GetPosition(); wxSize size = wxWindow::GetSize(); + + std::string xmlFile; + if (flightPort->GetHangarCapacity() > 20) + { + xmlFile = "xml/flightport_gui_large.xml"; + } + else + { + xmlFile = "xml/flightport_gui_default.xml"; + } + tcFlightPortGui* gui = new tcFlightPortGui(platform->mnID, wxPoint(pos.x, pos.y + size.GetHeight() + 10), ! xmlFile.c_str()); wxASSERT(item); item->SetGui(gui); *************** *** 550,554 **** wxSize size = wxWindow::GetSize(); tcStoresGui* gui = new tcStoresGui(platformId, hostId, idx, wxPoint(pos.x + size.GetWidth() + 10, pos.y), ! "xml/stores_gui_default.xml"); wxASSERT(item); item->SetGui(gui); --- 583,587 ---- wxSize size = wxWindow::GetSize(); tcStoresGui* gui = new tcStoresGui(platformId, hostId, idx, wxPoint(pos.x + size.GetWidth() + 10, pos.y), ! "xml/stores_gui_table.xml"); wxASSERT(item); item->SetGui(gui); Index: tcCreditView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcCreditView.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** tcCreditView.cpp 24 Oct 2006 01:34:04 -0000 1.22 --- tcCreditView.cpp 20 Nov 2006 00:17:42 -0000 1.23 *************** *** 77,80 **** --- 77,83 ---- AddCredit(s, 25.0f, 1); + s = "GulfKnight"; + AddCredit(s, 25.0f, 1); + s = "Jason Simpson"; AddCredit(s, 25.0f, 1); Index: tcContainerItem.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcContainerItem.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcContainerItem.cpp 1 Oct 2006 21:07:40 -0000 1.4 --- tcContainerItem.cpp 20 Nov 2006 00:17:42 -0000 1.5 *************** *** 53,56 **** --- 53,61 ---- } + osg::Geometry* tcContainerItem::GetIconSmall() + { + return iconSmall.get(); + } + long tcContainerItem::GetId() const { *************** *** 69,72 **** --- 74,100 ---- /** + * @return quantity label, characters k and M are used for thousands and millions + */ + const char* tcContainerItem::GetQuantityLabel() const + { + static wxString s; + + if (quantity > 99999) + { + s.Printf("%.1fM", 1e-6 * float(quantity)); + } + else if (quantity > 999) + { + s.Printf("%.1fk", 1e-3 * float(quantity)); + } + else + { + s.Printf("%d", quantity); + } + + return s.c_str(); + } + + /** * @return true if val matches id of this item AND val != 0 * 0 is used as an invalid id *************** *** 95,98 **** --- 123,138 ---- { icon = new osg::Geometry(*icon_, osg::CopyOp(osg::CopyOp::DEEP_COPY_DRAWABLES)); + + iconSmall = new osg::Geometry(*icon_, osg::CopyOp(osg::CopyOp::DEEP_COPY_DRAWABLES)); + if (!iconSmall.valid()) return; + + // scale by 0.625 (32 -> 20) + osg::Vec3Array* vertices = dynamic_cast<osg::Vec3Array*>(iconSmall.get()->getVertexArray()); + + size_t nVertices = vertices->size(); + for (size_t n=0; n<nVertices; n++) + { + vertices->at(n) *= 0.625; + } } Index: cspSky.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/cspSky.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** cspSky.cpp 24 Oct 2006 01:34:03 -0000 1.18 --- cspSky.cpp 20 Nov 2006 00:17:42 -0000 1.19 *************** *** 165,169 **** float phi, theta; for (i=0; i<n; i++) { ! float I = 0.5f * randf(); //_catalog->_stars[i].I; // C is used to reduce star color saturation as an // ad hoc approximation to human color vision response --- 165,169 ---- float phi, theta; for (i=0; i<n; i++) { ! float I = 0.3f * randf(); //_catalog->_stars[i].I; // C is used to reduce star color saturation as an // ad hoc approximation to human color vision response *************** *** 813,820 **** SkyShader::SkyShader() { m_OverLuminescence = 1.2; ! m_HaloSharpness = 0.5; m_SunsetSharpness = 4.0; m_NightBase = 0.02; ! m_FullMoonColor = Color(0.008, 0.035, 0.140, Color::RGB); setTurbidity(TURBIDITY); setSunElevation(0.0); --- 813,821 ---- SkyShader::SkyShader() { m_OverLuminescence = 1.2; ! m_HaloSharpness = 0.6; m_SunsetSharpness = 4.0; m_NightBase = 0.02; ! //m_FullMoonColor = Color(0.008, 0.035, 0.140, Color::RGB); ! m_FullMoonColor = Color(0.008, 0.035, 0.170, Color::RGB); setTurbidity(TURBIDITY); setSunElevation(0.0); *************** *** 1388,1392 **** double jitter = 0.0; int i, j, ci = 0; ! m_AverageIntensity = 0.0; float dark = m_Moon.getApparentBrightness(); osg::Vec4 horizon_average; --- 1389,1393 ---- double jitter = 0.0; int i, j, ci = 0; ! m_AverageIntensity = 0.5; float dark = m_Moon.getApparentBrightness(); osg::Vec4 horizon_average; Index: tcScenarioSelectView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcScenarioSelectView.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** tcScenarioSelectView.cpp 27 Aug 2006 21:28:54 -0000 1.17 --- tcScenarioSelectView.cpp 20 Nov 2006 00:17:42 -0000 1.18 *************** *** 230,244 **** - /* random loading broken for now - if (!wxString(caption.c_str()).Contains("Random")) - { - - } - else - { - mpSimState->mpPythonInterface->LoadScenario("", ""); // to clear director - mpSimState->RandInit(); - } - */ if (mpSimState->msScenarioInfo.mbLoaded) --- 230,233 ---- Index: tcStoresGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcStoresGui.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcStoresGui.cpp 17 Aug 2006 01:28:04 -0000 1.9 --- tcStoresGui.cpp 20 Nov 2006 00:17:42 -0000 1.10 *************** *** 107,113 **** // draw slots and items ! size_t nSlots = slots.size(); ! for (size_t n=0; n<nSlots; n++) { tcContainerSlot& slot = slots[n]; --- 107,121 ---- + // calculate slots to draw based on page info + size_t startIdx = currentPage * slotsPerPage; + size_t stopIdx = startIdx + slotsPerPage; + size_t nSlots = slots.size(); + if (stopIdx > nSlots) stopIdx = nSlots; + if ((startIdx+1) > nSlots) startIdx = nSlots - 1; // won't draw anyway if nSlots==0 + + // draw slots and items ! ! for (size_t n=startIdx; n<stopIdx; n++) { tcContainerSlot& slot = slots[n]; *************** *** 126,164 **** DrawGeometryR(icon, slot.loc.XCenter(), slot.loc.YCenter()); // draw quantity label ! wxString quantityText = wxString::Format("%d", item->GetQuantity()); ! const osg::Vec4 color(1.0f, 1.0f, 1.0f, 1.0f); ! DrawTextR(quantityText.c_str(), slot.loc.GetLeft() + 2.0f, slot.loc.GetTop() - 3.0f, defaultFont.get(), color, 12.0f, LEFT_BASE_LINE); - } ! // draw description caption if mouse is over slot ! if (isMouseOver) ! { ! const osg::Vec4 color(1.0f, 1.0f, 1.0f, 1.0f); ! float left = slot.loc.GetLeft(); float maxWidth = guiWidth - left - 10.0f; ! DrawTextR(item->GetItemName().c_str(), left, slot.loc.GetTop() + 15.0f, defaultFont.get(), color, 14.0f, LEFT_BASE_LINE, maxWidth); ! ! } } ! ! // draw expanded rectangle for slot border ! tcRect r = slot.loc; ! r.Expand(1.0, 1.0); ! if (isMouseOver) ! { ! DrawRectangleR(r, osg::Vec4(1, 1, 1, 1), tc3DWindow::FILL_OFF); ! } ! else ! { ! DrawRectangleR(r, osg::Vec4(0.5, 0.5, 0.5, 1), tc3DWindow::FILL_OFF); ! } ! } DrawBorder(); --- 134,192 ---- DrawGeometryR(icon, slot.loc.XCenter(), slot.loc.YCenter()); + osg::Vec4 color; + if (!isMouseOver) color.set(0.6f, 0.6f, 0.6f, 1.0f); + else color.set(1.0f, 1.0f, 1.0f, 1.0f); + // draw quantity label ! DrawTextR(item->GetQuantityLabel(), slot.loc.GetRight() + 5.0f, slot.loc.GetTop() - 2.0f, defaultFont.get(), color, 12.0f, LEFT_BASE_LINE); ! // draw item name ! float left = slot.loc.GetRight() + 32.0f; float maxWidth = guiWidth - left - 10.0f; ! DrawTextR(item->GetItemName().c_str(), left, slot.loc.GetTop() - 2.0f, defaultFont.get(), color, 14.0f, LEFT_BASE_LINE, maxWidth); ! } ! ! // draw description caption if mouse is over slot ! //if (isMouseOver) ! //{ ! // const osg::Vec4 color(1.0f, 1.0f, 1.0f, 1.0f); ! // float left = slot.loc.GetLeft(); ! // float maxWidth = guiWidth - left - 10.0f; ! ! // DrawTextR(item->GetItemName().c_str(), left, slot.loc.GetTop() + 15.0f, defaultFont.get(), ! // color, 14.0f, LEFT_BASE_LINE, maxWidth); ! //} ! ! // draw expanded rectangle for slot border ! tcRect r = slot.loc; ! r.Expand(1.0, 1.0); ! if (isMouseOver) ! { ! DrawRectangleR(r, osg::Vec4(1, 1, 1, 1), tc3DWindow::FILL_OFF); ! } ! else ! { ! DrawRectangleR(r, osg::Vec4(0.5, 0.5, 0.5, 1), tc3DWindow::FILL_OFF); ! } ! } ! } + // draw page boxes + for (size_t n=0; n<pageBoxes.size(); n++) + { + int fillMode = (n == currentPage) ? tc3DWindow::FILL_ON : tc3DWindow::FILL_OFF; + osg::Vec4 color(0.5, 0.5, 0.5, 0.5); + if (n == mouseOverPage) color.set(1, 1, 1, 1); + + DrawRectangleR(pageBoxes[n], color, fillMode); + } + + DrawBorder(); *************** *** 231,252 **** wxASSERT(storesData); ! size_t nSlots = 16; // use magic number for now ! tcRect slotLoc(upperLeft.x, upperLeft.x + slotSize, ! upperLeft.y, upperLeft.y + slotSize); ! size_t nRow = 0; ! for (size_t n=0; n<nSlots; n++) { ! AddSlot(slotLoc); ! slotLoc.Offset(horizontalSpacing, 0); ! if (++nRow >= rowSize) ! { ! slotLoc.Offset(upperLeft.x - slotLoc.GetLeft(), verticalSpacing); ! nRow = 0; } } } --- 259,313 ---- wxASSERT(storesData); ! for (size_t n=0; n<maxSlots; n++) ! { ! tcRect slotLoc(upperLeft.x, upperLeft.x + slotSize, ! upperLeft.y, upperLeft.y + slotSize + float(n%slotsPerPage)*verticalSpacing); ! AddSlot(slotLoc, tcContainerGui::SMALL_ICON_SIZE); ! } ! SetCurrentPage(0); ! } ! ! /** ! * Change page if click in page box ! */ ! void tcStoresGui::OnLButtonDown(wxMouseEvent& event) ! { ! wxPoint pos = event.GetPosition(); ! ! size_t nPages = pageBoxes.size(); ! for (size_t n=0; n<nPages; n++) { ! if (pageBoxes[n].ContainsPoint(float(pos.x), float(pos.y))) ! { ! if (n != currentPage) SetCurrentPage(n); ! return; ! } ! } ! tcContainerGui::OnLButtonDown(event); ! } ! /** ! * Update mouseOverPage ! */ ! void tcStoresGui::OnMouseMove(wxMouseEvent& event) ! { ! wxPoint pos = event.GetPosition(); ! ! mouseOverPage = 9999; ! ! size_t nPages = pageBoxes.size(); ! for (size_t n=0; n<nPages; n++) ! { ! if (pageBoxes[n].ContainsPoint(float(pos.x), float(pos.y))) ! { ! mouseOverPage = n; ! return; } } + + tcContainerGui::OnMouseMove(event); } *************** *** 304,307 **** --- 365,395 ---- } + void tcStoresGui::SetCurrentPage(size_t page) + { + if (page >= nPages) return; + + currentPage = page; + + size_t startIdx = slotsPerPage * currentPage; + size_t stopIdx = startIdx + slotsPerPage; + + for (size_t n=0; n<maxSlots; n++) + { + if ((n >= startIdx) && (n < stopIdx)) + { + float yOffset = float(n%slotsPerPage)*verticalSpacing; + + slots[n].loc.Set(upperLeft.x, upperLeft.x + slotSize, + upperLeft.y + yOffset, upperLeft.y + slotSize + yOffset); + } + else + { + slots[n].loc.Set(0, 0, -10.0, -10.0); + } + + } + + } + /** * Update slot items based on tcStores state *************** *** 318,322 **** } ! size_t nTypes = stores->GetNumberItemTypes(); for (size_t n=0; (n<nTypes)&&(n<slots.size()); n++) --- 406,410 ---- } ! std::string s; size_t nTypes = stores->GetNumberItemTypes(); for (size_t n=0; (n<nTypes)&&(n<slots.size()); n++) *************** *** 325,329 **** const std::string& itemName = stores->GetItemName(n); ! unsigned int itemQuantity = stores->CurrentItemQuantity(itemName); AddOrUpdateItem(slot, itemName, itemQuantity, stores); --- 413,417 ---- const std::string& itemName = stores->GetItemName(n); ! unsigned int itemQuantity = stores->CurrentItemQuantity(itemName, s); AddOrUpdateItem(slot, itemName, itemQuantity, stores); *************** *** 339,343 **** } } ! } --- 427,451 ---- } } ! ! nPages = ((slotsPerPage - 1 + stores->GetNumberItemTypes()) / slotsPerPage); ! size_t maxPages = (maxSlots - 1 + slotsPerPage) / slotsPerPage; ! if (nPages > maxPages) nPages = maxPages; ! ! // update page boxes ! pageBoxes.clear(); ! if (nPages > 1) // don't bother showing icon for single page ! { ! float xPageBox = float(mnWidth) - 10.0f; ! float yPageBox = 30.0f; ! float wPageBox = 7.0f; ! ! ! for (size_t n=0; n<nPages; n++) ! { ! float yOffset = float(n)*wPageBox; ! pageBoxes.push_back(tcRect(xPageBox, xPageBox + wPageBox, yPageBox, yPageBox + wPageBox)); ! yPageBox += wPageBox + 2.0f; ! } ! } } *************** *** 350,354 **** platformId(id), hostId(host), ! storesIdx(idx) { ReadGuiParameters(); --- 458,467 ---- platformId(id), hostId(host), ! storesIdx(idx), ! slotsPerPage(10), ! nPages(1), ! currentPage(0), ! maxSlots(100), ! mouseOverPage(9999) { ReadGuiParameters(); Index: tc3DViewer.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DViewer.cpp,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** tc3DViewer.cpp 24 Oct 2006 01:34:04 -0000 1.40 --- tc3DViewer.cpp 20 Nov 2006 00:17:42 -0000 1.41 *************** *** 690,693 **** --- 690,701 ---- terrainManager->SetOrigin(lon, lat); } + + if (sky.valid()) + { + wxASSERT(simState != 0); + DateZulu dz; + simState->GetDateZulu(dz); + sky->update(latOrigin_rad, lonOrigin_rad, dz); + } } *************** *** 1547,1551 **** --- 1555,1567 ---- } + const tcPoint& tc3DViewer::GetOrigin() const + { + static tcPoint p; + + p.x = lonOrigin_rad; + p.y = latOrigin_rad; + return p; + } /** Index: tcContainerGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcContainerGui.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcContainerGui.cpp 17 Aug 2006 01:28:04 -0000 1.10 --- tcContainerGui.cpp 20 Nov 2006 00:17:42 -0000 1.11 *************** *** 51,60 **** return 0; } ! else { return item->GetIcon(); } } tcContainerItem* tcContainerSlot::GetItem() const { --- 51,65 ---- return 0; } ! else if (!useSmallIcon) { return item->GetIcon(); } + else + { + return item->GetIconSmall(); + } } + tcContainerItem* tcContainerSlot::GetItem() const { *************** *** 97,104 **** } tcContainerSlot::tcContainerSlot() : item(0), updated(false), ! isMouseOver(false) { } --- 102,115 ---- } + void tcContainerSlot::SetUseSmallIcon(bool state) + { + useSmallIcon = state; + } + tcContainerSlot::tcContainerSlot() : item(0), updated(false), ! isMouseOver(false), ! useSmallIcon(false) { } *************** *** 108,112 **** item(src.item), updated(src.updated), ! isMouseOver(src.isMouseOver) { } --- 119,124 ---- item(src.item), updated(src.updated), ! isMouseOver(src.isMouseOver), ! useSmallIcon(src.useSmallIcon) { } *************** *** 138,142 **** ! void tcContainerGui::AddSlot(tcRect& loc) { tcContainerSlot slot; --- 150,154 ---- ! void tcContainerGui::AddSlot(tcRect& loc, IconSize iconSize) { tcContainerSlot slot; *************** *** 145,148 **** --- 157,165 ---- slot.updated = false; + if (iconSize == SMALL_ICON_SIZE) + { + slot.SetUseSmallIcon(true); + } + slots.push_back(slot); } Index: tcBriefingView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcBriefingView.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcBriefingView.cpp 23 Mar 2006 01:11:02 -0000 1.2 --- tcBriefingView.cpp 20 Nov 2006 00:17:42 -0000 1.3 *************** *** 55,59 **** const std::string& briefingText = scenarioInterface->GetSimpleBriefing(userAlliance); ! float x = 55.0f; float y = 150.0f; float fontSize; --- 55,59 ---- const std::string& briefingText = scenarioInterface->GetSimpleBriefing(userAlliance); ! float x = 65.0f; float y = 150.0f; float fontSize; |
From: Dewitt C. <ddc...@us...> - 2006-11-20 00:18:19
|
Update of /cvsroot/gcblue/gcb_wx/src/network In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv29807/src/network Modified Files: tcAuthenticationMessageHandler.cpp tcConnectionData.cpp tcTextMessageHandler.cpp Log Message: Index: tcConnectionData.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/network/tcConnectionData.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcConnectionData.cpp 23 Mar 2006 01:11:02 -0000 1.15 --- tcConnectionData.cpp 20 Nov 2006 00:17:43 -0000 1.16 *************** *** 51,55 **** // max number of acks assuming 2 bytes per ack unsigned int maxAcks = (tcMessage::MESSAGE_SIZE - messageSize) / sizeof(unsigned short); ! unsigned int nAcks = sendAck.size(); unsigned char* data = message->GetMessageData(); --- 51,55 ---- // max number of acks assuming 2 bytes per ack unsigned int maxAcks = (tcMessage::MESSAGE_SIZE - messageSize) / sizeof(unsigned short); ! unsigned int nAcks = (unsigned int)sendAck.size(); unsigned char* data = message->GetMessageData(); Index: tcTextMessageHandler.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/network/tcTextMessageHandler.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcTextMessageHandler.cpp 23 Mar 2006 01:11:02 -0000 1.8 --- tcTextMessageHandler.cpp 20 Nov 2006 00:17:43 -0000 1.9 *************** *** 35,39 **** if (messageSize > maxSize) messageSize = maxSize; ! strncpy((char*)data, text.c_str(), messageSize); data[messageSize++] = 0; // append terminating null } --- 35,41 ---- if (messageSize > maxSize) messageSize = maxSize; ! //strncpy((char*)data, text.c_str(), messageSize); ! strncpy_s((char*)data, maxSize, text.c_str(), messageSize); ! data[messageSize++] = 0; // append terminating null } Index: tcAuthenticationMessageHandler.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/network/tcAuthenticationMessageHandler.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcAuthenticationMessageHandler.cpp 23 Mar 2006 01:11:02 -0000 1.2 --- tcAuthenticationMessageHandler.cpp 20 Nov 2006 00:17:43 -0000 1.3 *************** *** 68,72 **** stream << hash; ! messageSize = stream.size(); stream.read((char*)data, messageSize); --- 68,72 ---- stream << hash; ! messageSize = (unsigned int)stream.size(); stream.read((char*)data, messageSize); |
From: Dewitt C. <ddc...@us...> - 2006-11-20 00:18:18
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv29807/src/scriptinterface Modified Files: tcPlatformInterface.cpp tcScenarioInterface.cpp tcSimPythonInterface.cpp Log Message: Index: tcPlatformInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterface.cpp,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** tcPlatformInterface.cpp 24 Oct 2006 01:34:05 -0000 1.66 --- tcPlatformInterface.cpp 20 Nov 2006 00:17:43 -0000 1.67 *************** *** 44,49 **** #include "tcFlightOpsObject.h" #include "tcHeloObject.h" #include "tcBallisticDBObject.h" ! #include "tcGenericDBObject.h" #include "tcSonarDBObject.h" #include "tcTorpedoDBObject.h" --- 44,50 ---- #include "tcFlightOpsObject.h" #include "tcHeloObject.h" + #include "tcAirDBObject.h" #include "tcBallisticDBObject.h" ! #include "tcPlatformDBObject.h" #include "tcSonarDBObject.h" #include "tcTorpedoDBObject.h" *************** *** 106,115 **** float tcPlatformInterface::GetFuel() const { ! return mpPlatformObj->fuel_kg / mpPlatformObj->mpDBObject->mfFuelCapacity_kg; } float tcPlatformInterface::GetMaxAltitude() { ! return mpPlatformObj->mpDBObject->mfMaxAltitude_m; } --- 107,123 ---- float tcPlatformInterface::GetFuel() const { ! return mpPlatformObj->fuel_kg / mpPlatformObj->GetFuelCapacity(); } float tcPlatformInterface::GetMaxAltitude() { ! if (tcAirObject* air = dynamic_cast<tcAirObject*>(mpPlatformObj)) ! { ! return air->mpDBObject->maxAltitude_m; ! } ! else ! { ! return 0; ! } } *************** *** 781,792 **** int tcPlatformInterface::GetMagazineQuantity(std::string item) { ! int quantity = 0; ! unsigned int nMagazines = mpPlatformObj->GetMagazineCount(); ! for (unsigned int n=0; n<nMagazines; n++) ! { ! tcStores* mag = mpPlatformObj->GetMagazine(n); ! quantity += mag->CurrentItemQuantity(item); ! } ! return quantity; } --- 789,793 ---- int tcPlatformInterface::GetMagazineQuantity(std::string item) { ! return (int)mpPlatformObj->GetMagazineQuantity(item); } *************** *** 807,817 **** if (!launcher->IsItemCompatible(item)) return; unsigned int nMagazines = mpPlatformObj->GetMagazineCount(); for (unsigned int n=0; n<nMagazines; n++) { tcStores* mag = mpPlatformObj->GetMagazine(n); ! if (mag->CurrentItemQuantity(item)) { ! mag->LoadLauncher(anLauncher, item); return; } --- 808,819 ---- if (!launcher->IsItemCompatible(item)) return; + std::string exactItem; unsigned int nMagazines = mpPlatformObj->GetMagazineCount(); for (unsigned int n=0; n<nMagazines; n++) { tcStores* mag = mpPlatformObj->GetMagazine(n); ! if (mag->CurrentItemQuantity(item, exactItem)) { ! mag->LoadLauncher(anLauncher, exactItem); return; } *************** *** 826,836 **** if (!mpPlatformObj->IsControlled()) return; size_t nMagazines = mpPlatformObj->GetMagazineCount(); for (size_t n=0; n<nMagazines; n++) { tcStores* mag = mpPlatformObj->GetMagazine(n); ! if (mag->CurrentItemQuantity(item)) { ! mag->LoadOther(item, mpPlatformObj); return; } --- 828,839 ---- if (!mpPlatformObj->IsControlled()) return; + std::string exactItem; size_t nMagazines = mpPlatformObj->GetMagazineCount(); for (size_t n=0; n<nMagazines; n++) { tcStores* mag = mpPlatformObj->GetMagazine(n); ! if (mag->CurrentItemQuantity(item, exactItem)) { ! mag->LoadOther(exactItem, mpPlatformObj); return; } *************** *** 843,849 **** { tcStores* mag = parent->GetMagazine(n); ! if (mag->CurrentItemQuantity(item)) { ! mag->LoadOther(item, mpPlatformObj); return; } --- 846,852 ---- { tcStores* mag = parent->GetMagazine(n); ! if (mag->CurrentItemQuantity(item, exactItem)) { ! mag->LoadOther(exactItem, mpPlatformObj); return; } *************** *** 1188,1194 **** } ! bool thisPlatformIsHelo = (dynamic_cast<tcHeloObject*>(mpPlatformObj) != 0); ! bool carrierCompatible = mpPlatformObj->mpDBObject->IsCarrierCompatible(); if (findAirbases) // find friendly flight objs within maxRange_km --- 1191,1199 ---- } + tcAirObject* air = dynamic_cast<tcAirObject*>(mpPlatformObj); + tcAirObject* helo = dynamic_cast<tcHeloObject*>(air); ! bool thisPlatformIsHelo = (helo != 0); ! bool carrierCompatible = (air != 0) && (air->mpDBObject->IsCarrierCompatible()); if (findAirbases) // find friendly flight objs within maxRange_km *************** *** 1591,1595 **** if (tcSurfaceObject* surface = dynamic_cast<tcSurfaceObject*>(obj)) { ! if (!mpPlatformObj->mpDBObject->IsCarrierCompatible()) { tcTrack data; --- 1596,1601 ---- if (tcSurfaceObject* surface = dynamic_cast<tcSurfaceObject*>(obj)) { ! tcAirObject* air = dynamic_cast<tcAirObject*>(mpPlatformObj); ! if ((air == 0) || !air->mpDBObject->IsCarrierCompatible()) { tcTrack data; Index: tcSimPythonInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcSimPythonInterface.cpp,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** tcSimPythonInterface.cpp 24 Sep 2006 19:50:20 -0000 1.44 --- tcSimPythonInterface.cpp 20 Nov 2006 00:17:43 -0000 1.45 *************** *** 553,557 **** --- 553,563 ---- wxASSERT(overlay); + // start with clear state for new scenario mpSimState->Clear(); + + // clear db if using dynamic load so that only units from scenario are in memory + tcDatabase* database = tcDatabase::Get(); + if (database->IsUsingDynamicLoad()) database->Clear(); + director->ClearEvents(); overlay->ClearMapObjects(); Index: tcScenarioInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcScenarioInterface.cpp,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** tcScenarioInterface.cpp 27 Aug 2006 21:28:54 -0000 1.44 --- tcScenarioInterface.cpp 20 Nov 2006 00:17:43 -0000 1.45 *************** *** 34,38 **** #include "tcDirector.h" #include "tcDirectorEvent.h" ! #include "tcGenericDBObject.h" #include "tcGoal.h" #include "tcGoalTracker.h" --- 34,38 ---- #include "tcDirector.h" #include "tcDirectorEvent.h" ! #include "tcPlatformDBObject.h" #include "tcGoal.h" #include "tcGoalTracker.h" |
From: Dewitt C. <ddc...@us...> - 2006-11-20 00:18:12
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv29807/src/common Modified Files: simmath.cpp Log Message: Index: simmath.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/simmath.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** simmath.cpp 24 Oct 2006 01:34:02 -0000 1.34 --- simmath.cpp 20 Nov 2006 00:17:39 -0000 1.35 *************** *** 622,635 **** } /** * Predicts position ahead by dt_s seconds */ void tcKinematics::PredictPosition(float dt_s, ! double& lon_rad, double& lat_rad, float& alt_m) { float v = C_KTSTOMPS*mfSpeed_kts; - float vz = v*sinf(mfPitch_rad); ! float cospitch = cosf(mfPitch_rad); float k = C_MTORAD * dt_s * v * cospitch; float dlon = k * sinf(mfHeading_rad) / cosf(mfLat_rad); --- 622,662 ---- } + + /** + * Extrapolates position ahead in time by dt_s (or behind if dt_s < 0) + */ + void tcKinematics::Extrapolate(float dt_s) + { + double lon_rad; + double lat_rad; + float alt_m; + + PredictPosition(dt_s, lon_rad, lat_rad, alt_m); + + mfLon_rad = lon_rad; + mfLat_rad = lat_rad; + mfAlt_m = alt_m; + } + /** * Predicts position ahead by dt_s seconds */ void tcKinematics::PredictPosition(float dt_s, ! double& lon_rad, double& lat_rad, float& alt_m) const { float v = C_KTSTOMPS*mfSpeed_kts; ! float vz, cospitch; ! if (mfPitch_rad == 0) ! { ! vz = 0; ! cospitch = 1.0f; ! } ! else ! { ! vz = v*sinf(mfPitch_rad); ! cospitch = cosf(mfPitch_rad); ! } ! float k = C_MTORAD * dt_s * v * cospitch; float dlon = k * sinf(mfHeading_rad) / cosf(mfLat_rad); |
From: Dewitt C. <ddc...@us...> - 2006-11-20 00:16:57
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv29360/include/common Modified Files: cspDate.h math_constants.h simmath.h Log Message: Index: cspDate.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/cspDate.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** cspDate.h 13 Apr 2004 21:37:39 -0000 1.3 --- cspDate.h 20 Nov 2006 00:16:24 -0000 1.4 *************** *** 462,466 **** */ bool overflow() const { ! return m_time >= 86400.0f; } --- 462,466 ---- */ bool overflow() const { ! return (m_time >= 86400.0f) || (m_time < 0); } Index: simmath.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/simmath.h,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** simmath.h 24 Oct 2006 01:33:57 -0000 1.37 --- simmath.h 20 Nov 2006 00:16:25 -0000 1.38 *************** *** 194,198 **** mfYaw_rad=0;mfPitch_rad=0;mfRoll_rad=0;} ! void PredictPosition(float dt_s, double& lon_rad, double& lat_rad, float& alt_m); float BearingRateTo(float range_km, float bearing_rad, float speed_kts, float heading_rad); float HeadingToTrack(const tcTrack& track); --- 194,199 ---- mfYaw_rad=0;mfPitch_rad=0;mfRoll_rad=0;} ! void PredictPosition(float dt_s, double& lon_rad, double& lat_rad, float& alt_m) const; ! void Extrapolate(float dt_s); float BearingRateTo(float range_km, float bearing_rad, float speed_kts, float heading_rad); float HeadingToTrack(const tcTrack& track); Index: math_constants.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/math_constants.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** math_constants.h 21 Apr 2006 23:28:31 -0000 1.13 --- math_constants.h 20 Nov 2006 00:16:25 -0000 1.14 *************** *** 56,60 **** #define C_RADARHOR 3.92482f ///< radar horizon in km = constant*sqrt(h in meters) #define C_VISUALHOR 2.78f ///< visible horizon in km = constant*sqrt(h in meters) ! class UnitConversions --- 56,60 ---- #define C_RADARHOR 3.92482f ///< radar horizon in km = constant*sqrt(h in meters) #define C_VISUALHOR 2.78f ///< visible horizon in km = constant*sqrt(h in meters) ! #define C_RADTOHRS 3.819719f class UnitConversions |
From: Dewitt C. <ddc...@us...> - 2006-11-20 00:16:34
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv29360/include/sim Modified Files: Game.h tcAeroAirObject.h tcAirObject.h tcAirfieldObject.h tcCarrierObject.h tcGroundObject.h tcGroundVehicleObject.h tcHeloObject.h tcLauncher.h tcOpticalSensor.h tcPlatformObject.h tcStores.h tcSurfaceObject.h Log Message: Index: tcGroundVehicleObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcGroundVehicleObject.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcGroundVehicleObject.h 18 Jun 2006 00:47:51 -0000 1.1 --- tcGroundVehicleObject.h 20 Nov 2006 00:16:29 -0000 1.2 *************** *** 33,37 **** namespace database { ! class tcGenericDBObject; } --- 33,37 ---- namespace database { ! class tcPlatformDBObject; } *************** *** 44,48 **** { public: ! tcGenericDBObject* mpDBObject; virtual void Clear(); --- 44,48 ---- { public: ! tcPlatformDBObject* mpDBObject; virtual void Clear(); *************** *** 65,69 **** tcGroundVehicleObject(); tcGroundVehicleObject(tcGroundVehicleObject&); ! tcGroundVehicleObject(tcGenericDBObject* obj); ~tcGroundVehicleObject(); --- 65,69 ---- tcGroundVehicleObject(); tcGroundVehicleObject(tcGroundVehicleObject&); ! tcGroundVehicleObject(tcPlatformDBObject* obj); ~tcGroundVehicleObject(); Index: tcLauncher.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcLauncher.h,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** tcLauncher.h 5 Sep 2006 01:04:24 -0000 1.27 --- tcLauncher.h 20 Nov 2006 00:16:29 -0000 1.28 *************** *** 75,79 **** DAMAGED = 15, ///< cannot operate due to damage INVALID_TARGET = 16, ///< not effective vs. target type ! OUT_OF_RANGE = 17 ///< target is beyond 1.5 x max range }; ///< launcher status codes --- 75,80 ---- DAMAGED = 15, ///< cannot operate due to damage INVALID_TARGET = 16, ///< not effective vs. target type ! OUT_OF_RANGE = 17, ///< target is beyond 1.5 x max range ! INVALID_FUEL_OPERATION = 18 ///< invalid op for external fuel tank }; ///< launcher status codes *************** *** 85,88 **** --- 86,91 ---- long mnChildDBKey; tcDatabaseObject *mpChildDBObj; + bool isExternalFuelTank; ///< true if child is fuel tank + float itemWeight_kg; ///< current unit weight of loaded items float mfTimeToReady; *************** *** 135,138 **** --- 138,142 ---- float GetSectorCenter() const; ///< returns center of engagement sector in radians float GetSectorWidth() const; ///< returns width of engagement sector in radians + float GetWeight() const; bool IsAutoPoint() const; bool IsDamaged() const; Index: tcOpticalSensor.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcOpticalSensor.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcOpticalSensor.h 22 Mar 2006 01:23:29 -0000 1.4 --- tcOpticalSensor.h 20 Nov 2006 00:16:29 -0000 1.5 *************** *** 65,68 **** --- 65,69 ---- protected: + float CalculateNightPenalty(float lon_rad) const; // bool isSemiactive; //tcRadar* GetSemiactiveIlluminator(); // add semi-active later for laser designated guidance *************** *** 75,79 **** ** (didn't want to modify virtual method CanDetectTarget to pass this info directly) */ long detectionCandidate; ! float detectionScore; }; --- 76,80 ---- ** (didn't want to modify virtual method CanDetectTarget to pass this info directly) */ long detectionCandidate; ! float last_margin_dB; // detection margin from last CanDetectTarget call }; Index: tcGroundObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcGroundObject.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcGroundObject.h 22 Mar 2006 01:23:29 -0000 1.2 --- tcGroundObject.h 20 Nov 2006 00:16:29 -0000 1.3 *************** *** 49,53 **** tcGroundObject(); tcGroundObject(tcGroundObject&); ! tcGroundObject(tcGenericDBObject* obj); virtual ~tcGroundObject(); }; --- 49,53 ---- tcGroundObject(); tcGroundObject(tcGroundObject&); ! tcGroundObject(tcPlatformDBObject* obj); virtual ~tcGroundObject(); }; Index: tcAirfieldObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcAirfieldObject.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcAirfieldObject.h 27 Mar 2006 01:08:30 -0000 1.6 --- tcAirfieldObject.h 20 Nov 2006 00:16:29 -0000 1.7 *************** *** 1,18 **** ! /* @file tcAirfieldObject.h */ ! /* ! ** Copyright (C) 2004 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 --- 1,18 ---- ! /** ! ** @file tcAirfieldObject.h */ ! /* Copyright (C) 2004-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 *************** *** 31,34 **** --- 31,39 ---- #include "tcFlightOpsObject.h" + namespace database + { + class tcGroundDBObject; + } + namespace scriptinterface { *************** *** 75,80 **** tcAirfieldObject(); ! tcAirfieldObject(tcAirfieldObject&); ! tcAirfieldObject(tcGenericDBObject* obj); virtual ~tcAirfieldObject(); }; --- 80,84 ---- tcAirfieldObject(); ! tcAirfieldObject(tcGroundDBObject* obj); virtual ~tcAirfieldObject(); }; Index: tcHeloObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcHeloObject.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcHeloObject.h 22 Mar 2006 01:23:29 -0000 1.4 --- tcHeloObject.h 20 Nov 2006 00:16:29 -0000 1.5 *************** *** 52,57 **** tcHeloObject(); ! tcHeloObject(tcHeloObject&); ! tcHeloObject(tcGenericDBObject* obj); virtual ~tcHeloObject(); }; --- 52,56 ---- tcHeloObject(); ! tcHeloObject(tcAirDBObject* obj); virtual ~tcHeloObject(); }; Index: tcAeroAirObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcAeroAirObject.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcAeroAirObject.h 22 Mar 2006 01:23:29 -0000 1.15 --- tcAeroAirObject.h 20 Nov 2006 00:16:29 -0000 1.16 *************** *** 29,33 **** namespace database { ! class tcAirDBObject; } namespace scriptinterface --- 29,33 ---- namespace database { ! class tcJetDBObject; } namespace scriptinterface *************** *** 46,50 **** { public: ! tcAirDBObject *mpDBObject; virtual void ApplyRestrictions(); --- 46,50 ---- { public: ! tcJetDBObject *mpDBObject; virtual void ApplyRestrictions(); *************** *** 70,74 **** tcAeroAirObject(); tcAeroAirObject(tcAeroAirObject&); ! tcAeroAirObject(tcAirDBObject *obj); virtual ~tcAeroAirObject(); protected: --- 70,74 ---- tcAeroAirObject(); tcAeroAirObject(tcAeroAirObject&); ! tcAeroAirObject(tcJetDBObject *obj); virtual ~tcAeroAirObject(); protected: *************** *** 89,93 **** float GetParasiticDragCoefficient(float vmach) const; ! float UpdateThrust(float dt_s); }; --- 89,93 ---- float GetParasiticDragCoefficient(float vmach) const; ! float UpdateThrust(float dt_s, float inv_ias_mps); }; Index: tcStores.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcStores.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcStores.h 24 Oct 2006 01:34:01 -0000 1.11 --- tcStores.h 20 Nov 2006 00:16:29 -0000 1.12 *************** *** 95,99 **** bool AddItems(const std::string& item, unsigned long quantity); ! unsigned long CurrentItemQuantity(const std::string& item) const; unsigned long CurrentQuantity() const; unsigned long IncomingQuantity() const; --- 95,100 ---- bool AddItems(const std::string& item, unsigned long quantity); ! ! unsigned long CurrentItemQuantity(const std::string& itemMask, std::string& matchingItem) const; unsigned long CurrentQuantity() const; unsigned long IncomingQuantity() const; *************** *** 111,115 **** bool IsFull() const; bool LoadLauncher(unsigned int idx, const std::string& item, ! tcGameObject* child = 0); bool LoadOther(const std::string& item, tcGameObject* child = 0); virtual void SaveToPython(scriptinterface::tcScenarioLogger& logger); --- 112,116 ---- bool IsFull() const; bool LoadLauncher(unsigned int idx, const std::string& item, ! tcGameObject* child = 0, unsigned int maxToLoad = 12345); bool LoadOther(const std::string& item, tcGameObject* child = 0); virtual void SaveToPython(scriptinterface::tcScenarioLogger& logger); *************** *** 141,144 **** --- 142,154 ---- private: + struct WeaponInfo + { + std::string name; + size_t quantity; // quantity avail in stores + size_t capacity; // capacity of launcher + float range_km; + int targetFlags; + float weight_kg; + }; tcStoresDBObject* storesDBObj; tcPlatformObject* parent; *************** *** 172,176 **** bool UnloadPlatform(tcGameObject* child); bool LoadPlatform(tcGameObject* child, const std::string& type); ! void GetWeaponInfo(const std::string& name, float& range_km, int& targetFlags) const; }; #endif \ No newline at end of file --- 182,186 ---- bool UnloadPlatform(tcGameObject* child); bool LoadPlatform(tcGameObject* child, const std::string& type); ! void GetWeaponInfo(WeaponInfo& info) const; }; #endif \ No newline at end of file Index: tcAirObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcAirObject.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcAirObject.h 22 Mar 2006 01:23:29 -0000 1.15 --- tcAirObject.h 20 Nov 2006 00:16:29 -0000 1.16 *************** *** 30,33 **** --- 30,38 ---- #include "tcCommandObject.h" + namespace database + { + class tcAirDBObject; + } + class tcUpdateStream; class tcCommandStream; *************** *** 46,50 **** }; ! tcGenericDBObject *mpDBObject; int readyForLanding; ///< 1 if gear down/ready for landing, 0 otherwise --- 51,55 ---- }; ! tcAirDBObject* mpDBObject; int readyForLanding; ///< 1 if gear down/ready for landing, 0 otherwise *************** *** 54,61 **** --- 59,71 ---- virtual bool IsDestroyed(); virtual void RandInitNear(float afLon_deg, float afLat_deg); + float GetTotalWeight() const; + virtual void SetAltitude(float new_altitude_m); virtual void SetLandingState(int state); void SetPitchLimit(float limit_rad); virtual void UpdateClimb(float dt_s); virtual void Update(double afStatusTime); + + bool IsOverweight() const; + bool IsReadyForLaunch(); void PrintToFile(tcFile& file); *************** *** 75,83 **** tcAirObject(); tcAirObject(tcAirObject&); ! tcAirObject(tcGenericDBObject *obj); virtual ~tcAirObject(); protected: tcCommandObject commandObj; virtual void UpdateDestroyed(double t); virtual void UpdateEffects(); --- 85,94 ---- tcAirObject(); tcAirObject(tcAirObject&); ! tcAirObject(tcAirDBObject* obj); virtual ~tcAirObject(); protected: tcCommandObject commandObj; + float GlimitedHeadingRate() const; virtual void UpdateDestroyed(double t); virtual void UpdateEffects(); Index: tcPlatformObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcPlatformObject.h,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** tcPlatformObject.h 24 Oct 2006 01:34:01 -0000 1.39 --- tcPlatformObject.h 20 Nov 2006 00:16:29 -0000 1.40 *************** *** 48,52 **** namespace database { ! class tcGenericDBObject; } --- 48,52 ---- namespace database { ! class tcPlatformDBObject; } *************** *** 89,92 **** --- 89,94 ---- double fuel_kg; ///< current fuel + float externalFuelCapacity_kg; ///< for external fuel tanks + tcLauncherState mcLauncherState; std::vector<tcStores*> magazines; *************** *** 99,103 **** GeoPoint msTargetDatum; tsFormationParameters msFormationParameters; ! tcGenericDBObject *mpDBObject; tcCommandObject commandObj; --- 101,105 ---- GeoPoint msTargetDatum; tsFormationParameters msFormationParameters; ! tcPlatformDBObject *mpDBObject; tcCommandObject commandObj; *************** *** 112,115 **** --- 114,118 ---- virtual void GetDatum(GeoPoint& p) {p=msTargetDatum;} virtual tcLauncher* GetLauncher(unsigned idx); + virtual const tcLauncher* GetLauncher(unsigned idx) const; unsigned int GetLauncherCount() const; wxString GetLauncherDescription(); *************** *** 125,132 **** virtual bool IsInterceptingTrack(long id); bool IsRefueling() const; bool IsCapableVsTargetType(int targetFlag); bool IsEquippedForTargetType(int targetFlag); - bool IsReadyForLaunch(); bool AllLaunchersEmpty(); bool AllLaunchersFull(); --- 128,136 ---- virtual bool IsInterceptingTrack(long id); bool IsRefueling() const; + float GetFuelCapacity() const; + void AdjustExternalFuelCapacity(float change_kg); bool IsCapableVsTargetType(int targetFlag); bool IsEquippedForTargetType(int targetFlag); bool AllLaunchersEmpty(); bool AllLaunchersFull(); *************** *** 166,170 **** tcPlatformObject(); tcPlatformObject(tcPlatformObject&); ! tcPlatformObject(tcGenericDBObject *obj); virtual ~tcPlatformObject(); --- 170,174 ---- tcPlatformObject(); tcPlatformObject(tcPlatformObject&); ! tcPlatformObject(tcPlatformDBObject *obj); virtual ~tcPlatformObject(); *************** *** 176,180 **** virtual void ApplyRestrictions(); virtual void SetFireControlSensors(); - virtual void Move(float dt_s); --- 180,183 ---- Index: Game.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/Game.h,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** Game.h 24 Sep 2006 19:50:19 -0000 1.71 --- Game.h 20 Nov 2006 00:16:29 -0000 1.72 *************** *** 250,253 **** --- 250,254 ---- void CheckGoals(); ///< checks if any win/loss goals satisfied void ConsoleMessage(const char *s); ///< print string to info console + const char* GetTimeString(); void HookRandomFriendly(); ///< hooks random friendly platform void NewGroupHook(wxCommandEvent& event); ///< event for group of units hooked Index: tcSurfaceObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSurfaceObject.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcSurfaceObject.h 18 Jun 2006 00:47:51 -0000 1.14 --- tcSurfaceObject.h 20 Nov 2006 00:16:29 -0000 1.15 *************** *** 1,19 **** /** ! * Copyright (C) 2003 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 */ --- 1,21 ---- /** ! ** @file tcSurfaceObject.h ! */ ! /* Copyright (C) 2003 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 */ *************** *** 31,35 **** namespace database { ! class tcGenericDBObject; } --- 33,37 ---- namespace database { ! class tcShipDBObject; } *************** *** 42,46 **** { public: ! tcGenericDBObject *mpDBObject; virtual void Clear(); --- 44,48 ---- { public: ! tcShipDBObject *mpDBObject; virtual void Clear(); *************** *** 60,64 **** tcSurfaceObject(); tcSurfaceObject(tcSurfaceObject&); ! tcSurfaceObject(tcGenericDBObject *obj); ~tcSurfaceObject(); --- 62,66 ---- tcSurfaceObject(); tcSurfaceObject(tcSurfaceObject&); ! tcSurfaceObject(tcShipDBObject* obj); ~tcSurfaceObject(); Index: tcCarrierObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcCarrierObject.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcCarrierObject.h 27 Mar 2006 01:08:30 -0000 1.15 --- tcCarrierObject.h 20 Nov 2006 00:16:29 -0000 1.16 *************** *** 74,78 **** tcCarrierObject(); tcCarrierObject(tcCarrierObject&); ! tcCarrierObject(tcGenericDBObject *obj); virtual ~tcCarrierObject(); }; --- 74,78 ---- tcCarrierObject(); tcCarrierObject(tcCarrierObject&); ! tcCarrierObject(tcShipDBObject* obj); virtual ~tcCarrierObject(); }; |
From: Dewitt C. <ddc...@us...> - 2006-11-20 00:16:32
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv29360/include/graphics Modified Files: tc3DViewer.h tcContainerGui.h tcContainerItem.h tcDatabaseInfoPanel.h tcDatabaseInfoWindow.h tcFlightportGui.h tcLauncherPopup.h tcStoresGui.h Log Message: Index: tcDatabaseInfoPanel.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcDatabaseInfoPanel.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcDatabaseInfoPanel.h 17 Aug 2006 01:27:10 -0000 1.1 --- tcDatabaseInfoPanel.h 20 Nov 2006 00:16:28 -0000 1.2 *************** *** 35,41 **** { class tcDatabaseObject; ! class tcGenericDBObject; class tcMissileDBObject; class tcTorpedoDBObject; } --- 35,44 ---- { class tcDatabaseObject; ! class tcPlatformDBObject; class tcMissileDBObject; class tcTorpedoDBObject; + class tcShipDBObject; + class tcAirDBObject; + class tcGroundDBObject; } *************** *** 82,91 **** void DrawDatabaseInfo(); ! void DrawDatabaseInfo(database::tcGenericDBObject* genericData, float yStart); void DrawDatabaseInfo(database::tcMissileDBObject* missileData, float yStart); void DrawDatabaseInfo(database::tcTorpedoDBObject* torpedoData, float yStart); ! void DrawLauncherInfo(database::tcGenericDBObject* genericData, float& y); ! void DrawSensorInfo(database::tcGenericDBObject* genericData, float& y); void PrintText(float x, float& y, const char* formatString, ...); --- 85,96 ---- void DrawDatabaseInfo(); ! void DrawDatabaseInfo(database::tcShipDBObject* shipData, float yStart); ! void DrawDatabaseInfo(database::tcAirDBObject* airData, float yStart); ! void DrawDatabaseInfo(database::tcGroundDBObject* groundData, float yStart); void DrawDatabaseInfo(database::tcMissileDBObject* missileData, float yStart); void DrawDatabaseInfo(database::tcTorpedoDBObject* torpedoData, float yStart); ! void DrawLauncherInfo(database::tcPlatformDBObject* genericData, float& y); ! void DrawSensorInfo(database::tcPlatformDBObject* genericData, float& y); void PrintText(float x, float& y, const char* formatString, ...); Index: tcFlightportGui.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcFlightportGui.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcFlightportGui.h 28 Sep 2006 02:01:52 -0000 1.5 --- tcFlightportGui.h 20 Nov 2006 00:16:28 -0000 1.6 *************** *** 88,94 **** size_t readyOffset; ///< slot index of first ready spot size_t hangarOffset; ///< slot index of first hangar spot ! float slotSize; ///< dimension of (square) slot wxRealPoint launchLoc; ///< upper-left of first launch spot float launchHorizontalSpacing; --- 88,96 ---- size_t readyOffset; ///< slot index of first ready spot size_t hangarOffset; ///< slot index of first hangar spot ! size_t magazineIdx; ///< slot index of first magazine slot ! size_t nMagazines; ///< number of magazines float slotSize; ///< dimension of (square) slot + float hangarSlotSize; ///< for hangar slots wxRealPoint launchLoc; ///< upper-left of first launch spot float launchHorizontalSpacing; *************** *** 99,107 **** float hangarVerticalSpacing; ///< spacing between rows unsigned int hangarRowSize; ///< number of hangar spots across ! void AddOrUpdateItem(tcContainerSlot& slot, tcAirState* airState); void CloseAllPlatformGuis(); tcFlightPort* GetFlightPort(); void InitializeGui(); void OpenPlatformGui(tcContainerItem* item); void ReadGuiParameters(); --- 101,114 ---- float hangarVerticalSpacing; ///< spacing between rows unsigned int hangarRowSize; ///< number of hangar spots across ! bool useSmallHangarSlots; ! wxRealPoint magazineLoc; ///< upper-left of first magazine ! wxRealPoint magazineOffset; ///< (x, y) offset between magazines ! osg::ref_ptr<osg::Geometry> magazineIcon; ! void AddOrUpdateItem(tcContainerSlot& slot, tcAirState* airState); void CloseAllPlatformGuis(); tcFlightPort* GetFlightPort(); void InitializeGui(); + void OpenMagazineGui(unsigned int idx, tcContainerItem* item); void OpenPlatformGui(tcContainerItem* item); void ReadGuiParameters(); Index: tc3DViewer.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DViewer.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** tc3DViewer.h 24 Oct 2006 01:33:57 -0000 1.17 --- tc3DViewer.h 20 Nov 2006 00:16:28 -0000 1.18 *************** *** 47,50 **** --- 47,51 ---- class Sky; class wxGLCanvas; + class tcPoint; /** *************** *** 147,150 **** --- 148,152 ---- bool IsActive() {return isActive;} void LoadModel(tcGameObject *obj); + const tcPoint& GetOrigin() const; void SetActive(bool b); Index: tcDatabaseInfoWindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcDatabaseInfoWindow.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcDatabaseInfoWindow.h 17 Aug 2006 01:27:10 -0000 1.6 --- tcDatabaseInfoWindow.h 20 Nov 2006 00:16:28 -0000 1.7 *************** *** 35,39 **** { class tcDatabaseObject; ! class tcGenericDBObject; class tcMissileDBObject; class tcTorpedoDBObject; --- 35,39 ---- { class tcDatabaseObject; ! class tcPlatformDBObject; class tcMissileDBObject; class tcTorpedoDBObject; Index: tcContainerGui.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcContainerGui.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcContainerGui.h 22 Mar 2006 01:23:28 -0000 1.5 --- tcContainerGui.h 20 Nov 2006 00:16:28 -0000 1.6 *************** *** 41,44 **** --- 41,45 ---- bool updated; bool isMouseOver; ///< true if mouse is over slot + bool useSmallIcon; void ClearItem(); *************** *** 48,51 **** --- 49,53 ---- bool IsMouseOver() const; bool IsUpdated() const; + void SetUseSmallIcon(bool state); void SetItem(tcContainerItem* item_); void SetMouseOver(bool state); *************** *** 66,70 **** { public: ! void AddSlot(tcRect& loc); void ClearSlots(); size_t GetNumSlots() const; --- 68,77 ---- { public: ! enum IconSize ! { ! NORMAL_ICON_SIZE = 1, ! SMALL_ICON_SIZE = 2 ! }; ! void AddSlot(tcRect& loc, IconSize iconSize = NORMAL_ICON_SIZE); void ClearSlots(); size_t GetNumSlots() const; Index: tcStoresGui.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcStoresGui.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcStoresGui.h 22 Mar 2006 01:23:29 -0000 1.3 --- tcStoresGui.h 20 Nov 2006 00:16:28 -0000 1.4 *************** *** 45,52 **** //virtual void OnChar(wxKeyEvent& event); //virtual void OnEnterWindow(wxMouseEvent& event); ! //virtual void OnLButtonDown(wxMouseEvent& event); //virtual void OnLButtonUp(wxMouseEvent& event); //virtual void OnLeaveWindow(wxMouseEvent& event); ! //virtual void OnMouseMove(wxMouseEvent& event); virtual void OnRButtonDown(wxMouseEvent& event); --- 45,52 ---- //virtual void OnChar(wxKeyEvent& event); //virtual void OnEnterWindow(wxMouseEvent& event); ! virtual void OnLButtonDown(wxMouseEvent& event); //virtual void OnLButtonUp(wxMouseEvent& event); //virtual void OnLeaveWindow(wxMouseEvent& event); ! virtual void OnMouseMove(wxMouseEvent& event); virtual void OnRButtonDown(wxMouseEvent& event); *************** *** 66,69 **** --- 66,76 ---- float verticalSpacing; unsigned int rowSize; + + size_t slotsPerPage; + size_t nPages; + size_t currentPage; + size_t mouseOverPage; + const size_t maxSlots; + std::vector<tcRect> pageBoxes; void AddOrUpdateItem(tcContainerSlot& slot, const std::string& itemName, *************** *** 73,76 **** --- 80,84 ---- void InitializeGui(); void ReadGuiParameters(); + void SetCurrentPage(size_t page); void UpdateGui(); }; Index: tcContainerItem.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcContainerItem.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcContainerItem.h 22 Mar 2006 01:23:28 -0000 1.2 --- tcContainerItem.h 20 Nov 2006 00:16:28 -0000 1.3 *************** *** 53,56 **** --- 53,57 ---- osg::ref_ptr<osg::Geometry> icon; + osg::ref_ptr<osg::Geometry> iconSmall; int drawState; *************** *** 58,64 **** --- 59,67 ---- tcContainerGui* GetGui() const; osg::Geometry* GetIcon(); + osg::Geometry* GetIconSmall(); ///< half sized icon long GetId() const; const std::string& GetItemName() const; unsigned int GetQuantity() const; + const char* GetQuantityLabel() const; bool IdMatches(long val) const; bool ItemGuiIsActive() const; Index: tcLauncherPopup.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcLauncherPopup.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcLauncherPopup.h 22 Mar 2006 01:23:29 -0000 1.8 --- tcLauncherPopup.h 20 Nov 2006 00:16:28 -0000 1.9 *************** *** 52,55 **** --- 52,58 ---- static void SetUserPosition(unsigned int idx, const wxPoint& pos); + static bool ForceClose(long id, unsigned idx); ///< message to close matching popup + static bool WindowExists(long id, unsigned idx); ///< to check if popup is already open + tcLauncherPopup(long id, unsigned idx, const wxPoint& pos); virtual ~tcLauncherPopup(); *************** *** 76,80 **** virtual void OnMouseMove(wxMouseEvent& event); virtual void OnRButtonDown(wxMouseEvent& event); ! --- 79,84 ---- virtual void OnMouseMove(wxMouseEvent& event); virtual void OnRButtonDown(wxMouseEvent& event); ! ! *************** *** 114,117 **** --- 118,129 ---- static wxPoint userPositions[MAX_LAUNCHERS]; ///< saves last user move position for each launcher static bool userPositionsInitialized; + static std::map<long, bool> registry; ///< means of checking which windows are open and forcing closed without having pointer + + + static bool GetForceClose(long id, unsigned idx); + static long GetKey(long id, unsigned idx); + static void RegisterWindow(long id, unsigned idx); + static void UnregisterWindow(long id, unsigned idx); + static void UnregisterAll(); DECLARE_EVENT_TABLE() |
From: Dewitt C. <ddc...@us...> - 2006-10-28 21:50:58
|
Update of /cvsroot/gcblue/gcb_wx/include/ai In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv13711/include/ai Added Files: MissionAircraftInfo.h Log Message: --- NEW FILE: MissionAircraftInfo.h --- /** ** @file tcMissionAircraftInfo.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 _MISSIONAIRCRAFTINFO_H_ #define _MISSIONAIRCRAFTINFO_H_ #include <string> struct MissionAircraftInfo { long id; std::string name; }; #endif |
From: Dewitt C. <ddc...@us...> - 2006-10-28 00:04:35
|
Update of /cvsroot/gcblue/gcb_wx/database In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv27011/database Modified Files: database.db Log Message: Index: database.db =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/database/database.db,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 Binary files /tmp/cvsLI2y33 and /tmp/cvsQ5atCz differ |
From: Dewitt C. <ddc...@us...> - 2006-10-24 01:34:39
|
Update of /cvsroot/gcblue/gcb_wx/scripts In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv8966/scripts Modified Files: AI.py GCBcommon.py HotKey.py Landing.py Menu.py UnitCommands.py Added Files: AirMissions.py Log Message: Index: GCBcommon.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/GCBcommon.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GCBcommon.py 18 Jun 2006 00:47:42 -0000 1.1 --- GCBcommon.py 24 Oct 2006 01:34:37 -0000 1.2 *************** *** 1,4 **** --- 1,5 ---- import math + deg_to_rad = 0.01745329252 def GetMessageParam(BB, messageName): *************** *** 24,26 **** - --- 25,26 ---- Index: UnitCommands.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/UnitCommands.py,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** UnitCommands.py 28 Sep 2006 02:01:52 -0000 1.30 --- UnitCommands.py 24 Oct 2006 01:34:37 -0000 1.31 *************** *** 62,66 **** BB = UI.GetBlackboardInterface() current_time = UI.GetTime() ! BB.Write('Home', home_name) BB.Write('Bingo', '%f' % bingo_fuel) BB.Write('RTBtime', '%f' % (current_time + rtb_time)) --- 62,67 ---- BB = UI.GetBlackboardInterface() current_time = UI.GetTime() ! if (not BB.KeyExists('Home')): ! BB.Write('Home', home_name) BB.Write('Bingo', '%f' % bingo_fuel) BB.Write('RTBtime', '%f' % (current_time + rtb_time)) *************** *** 144,147 **** --- 145,197 ---- + + # gets info on closest (known) enemy or unknown platform within search range + def ClosestOfType(UI, class_mask, search_range_km): + track_list = UI.GetTrackList(class_mask, search_range_km, 3) + + current_time = UI.GetTime() + nTracks = track_list.Size() + closest_range = 1e6 + closest_id = -1 + + for n in range(0, nTracks): + track_info = track_list.GetTrack(n) + track_id = track_info.ID + staleness = current_time - track_info.Time + range_km = UI.GetRangeToTrack(track_info) + + if ((staleness <= 15.0) and (range_km < closest_range)): + closest_range = range_km + closest_id = track_id + + return (closest_id, closest_range) + + + # gets info on closest (known) enemy or unknown platform within search range + def ClosestOfTypeUnengaged(UI, class_mask, search_range_km): + track_list = UI.GetTrackList(class_mask, search_range_km, 3) + + current_time = UI.GetTime() + nTracks = track_list.Size() + closest_range = 1e6 + closest_id = -1 + closest_bearing = 0 + + for n in range(0, nTracks): + track_info = track_list.GetTrack(n) + track_id = track_info.ID + nEngaged = track_info.GetEngagedCount() + staleness = current_time - track_info.Time + range_km = UI.GetRangeToTrack(track_info) + + if ((nEngaged == 0) and (staleness <= 15.0) and (range_km < closest_range)): + closest_range = range_km + closest_id = track_id + closest_bearing = UI.GetHeadingToDatum(track_info.Lon, track_info.Lat) + + + return (closest_id, closest_range, closest_bearing) + + # clears all orders, moves to location and starts patrol *************** *** 427,435 **** ! def AddCAPMission(UI): if (not UI.HasFlightPort()): return FP = UI.GetFlightPortInfo() ! FP.AddCAPMission() --- 477,485 ---- ! def AddCAPMission(UI, lon, lat): if (not UI.HasFlightPort()): return FP = UI.GetFlightPortInfo() ! FP.AddCAPMission(lon, lat) --- NEW FILE: AirMissions.py --- from GCBcommon import * from UnitCommands import * import math # patrol relative to airbase or carrier location def CAP(TI): UI = TI.GetPlatformInterface() BB = TI.GetBlackboardInterface() iteration = TI.GetMemoryValue(1) # will return 0 first time if (iteration == 0): # do initialization TI.SetMemoryValue(2, UI.GetHeading()) TI.SetMemoryValue(3, 0) # 1 is heading to station, 0 patroling TI.SetMemoryValue(4, 30.0 + 15.0 * UI.Rand()) # random turn interval in seconds TI.SetMemoryText('Description', 'Perform surveillance along a zig-zag course') patrol_range_km = GetMessageParam(BB, 'PatrolRange_km') patrol_az_rad = deg_to_rad * GetMessageParam(BB, 'PatrolAzimuth_deg') # rel to north anchor_id = GetMessageParam(BB, 'AnchorPlatformId') # platform id to center patrol about TI.SetMemoryValue(10, patrol_range_km) TI.SetMemoryValue(11, patrol_az_rad) TI.SetMemoryValue(12, anchor_id) iteration = iteration + 1 TI.SetMemoryValue(1, iteration) # if low on fuel or out of ammo, rtb if ((UI.GetFuel() < 0.1) or (not UI.IsEquippedForTargetType(0x0020))): UI.DeleteTask('EngageAll') TI.EndTask() AddRTBtask(UI, '', 0.1, 0) return # activate all sensors can_radiate = GetSensorControl(BB) if (can_radiate and not UI.IsSub()): ActivateAllSensors(UI) else: ActivatePassiveSensors(UI) # return if conn is not available if (not GetConnControl(BB)): return # check for nearby air target intercept_target = 0 closest_id, closest_range, closest_bearing = ClosestOfTypeUnengaged(UI, 0x0020, 120) if (closest_id != -1): intercept_target = 1 UI.SetHeading(closest_bearing) # lag intercept if (UI.GetFuel() > 0.5): UI.SetThrottle(1.1) else: UI.SetThrottle(1.0) UI.SetActionText('Intercept %d' % closest_id) return patrol_range_km = TI.GetMemoryValue(10) patrol_az_rad = TI.GetMemoryValue(11) anchor_id = TI.GetMemoryValue(12) if (UI.IsAir()): if (UI.GetAlt() < 6000): UI.SetThrottle(1.1) UI.SetAlt(6000) else: UI.SetThrottle(0.8) # calculate station point anchor_track = UI.GetTrackById(long(anchor_id)) anchor_track.Offset(patrol_range_km, patrol_az_rad) if (not anchor_track.IsValid()): TI.EndTask() return station_lon = anchor_track.Lon station_lat = anchor_track.Lat station_range = UI.GetRangeToDatum(station_lon, station_lat) isTravelingToStation = TI.GetMemoryValue(3) if (isTravelingToStation): range_thresh = 1.0 UI.SetSpeedToMax() else: range_thresh = 10.0 if (UI.IsAir()): range_thresh = range_thresh * 4.0 if (station_range > range_thresh): new_heading = UI.GetHeadingToDatum(station_lon, station_lat) TI.SetMemoryValue(3, 1) # to indicate traveling to station UI.SetActionText('-> Station') TI.SetUpdateInterval(10.0) else: new_heading = UI.GetHeading() + 30 TI.SetMemoryValue(3, 0) # to indicate traveling to station UI.SetActionText('CAP') TI.SetUpdateInterval(TI.GetMemoryValue(4)) UI.SetHeading(new_heading) Index: HotKey.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/HotKey.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** HotKey.py 24 Sep 2006 19:50:20 -0000 1.10 --- HotKey.py 24 Oct 2006 01:34:37 -0000 1.11 *************** *** 68,71 **** --- 68,78 ---- # e.g. flags == 6 indicates ctrl and alt were pressed during dclick def ProcessDoubleClickHook(UnitInfo, flags): + # in multiplayer try to take control of available unit first + ## if (UnitInfo.IsMultiplayerActive()): + ## if (not UnitInfo.IsPlayerControlled()): + ## if (UnitInfo.IsAvailable()): + ## UnitInfo.SendCommand('TakeControl') + ## return + # for units with aircraft show the flight panel unless shift is pressed # otherwise show the platform panel Index: AI.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/AI.py,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** AI.py 16 Sep 2006 14:01:24 -0000 1.29 --- AI.py 24 Oct 2006 01:34:37 -0000 1.30 *************** *** 3,6 **** --- 3,8 ---- from Landing import * from AirManagement import * + from AirMissions import * + import math *************** *** 467,491 **** - - # gets info on closest (known) enemy or unknown platform within search range - def ClosestOfType(UI, class_mask, search_range_km): - track_list = UI.GetTrackList(class_mask, search_range_km, 3) - - current_time = UI.GetTime() - nTracks = track_list.Size() - closest_range = 1e6 - closest_id = -1 - - for n in range(0, nTracks): - track_info = track_list.GetTrack(n) - track_id = track_info.ID - staleness = current_time - track_info.Time - range_km = UI.GetRangeToTrack(track_info) - - if ((staleness <= 15.0) and (range_km < closest_range)): - closest_range = range_km - closest_id = track_id - - return (closest_id, closest_range) --- 469,472 ---- *************** *** 945,948 **** --- 926,935 ---- # attack target + can_radiate = GetSensorControl(BB) + if (can_radiate and not UI.IsSub()): + ActivateAllSensors(UI) + else: + ActivatePassiveSensors(UI) + range_km = 0.0 Index: Landing.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/Landing.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Landing.py 27 Aug 2006 21:28:54 -0000 1.2 --- Landing.py 24 Oct 2006 01:34:37 -0000 1.3 *************** *** 22,25 **** --- 22,29 ---- dest_name = BB.ReadMessage('LandTarget') dest_id = UI.LookupFriendlyId(dest_name) + if (dest_id == -1): + UI.DisplayMessage('Bad landing target (%s)' % dest_name) + TI.EndTask() + return TI.SetMemoryValue(3, dest_id) *************** *** 34,38 **** alt_m = track_info.Alt if (track_info.ID == -1): ! UI.DisplayMessage('Bad track ID for landing') TI.EndTask() return # invalid id --- 38,43 ---- alt_m = track_info.Alt if (track_info.ID == -1): ! dest_name = BB.ReadMessage('LandTarget') ! UI.DisplayMessage('Bad track ID for landing (%d, %s)' % (dest_id, dest_name)) TI.EndTask() return # invalid id *************** *** 198,202 **** if ((fuel <= bingo_fuel) or (time >= rtb_time)): home_base = BB.ReadMessage('Home') ! BB.Write('LandTarget', home_base) UI.AddTask('Land', 2.0, 0) TI.EndTask() --- 203,213 ---- if ((fuel <= bingo_fuel) or (time >= rtb_time)): home_base = BB.ReadMessage('Home') ! dest_id = UI.LookupFriendlyId(home_base) ! if (dest_id == -1): ! UI.DisplayMessage('Bad base for rtb (%s)' % home_base) ! TI.EndTask() ! return ! BB_global = UI.GetBlackboardInterface() # so msg isn't erased on endtask ! BB_global.Write('LandTarget', home_base) UI.AddTask('Land', 2.0, 0) TI.EndTask() Index: Menu.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/Menu.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** Menu.py 28 Sep 2006 02:01:52 -0000 1.27 --- Menu.py 24 Oct 2006 01:34:37 -0000 1.28 *************** *** 157,161 **** UnitMenu.AddItem('Add mission', '') UnitMenu.BeginSubMenu() ! UnitMenu.AddItem('CAP test', 'AddCAPMission') UnitMenu.EndSubMenu() --- 157,161 ---- UnitMenu.AddItem('Add mission', '') UnitMenu.BeginSubMenu() ! UnitMenu.AddItemUI('CAP', 'AddCAPMission', 'Datum') UnitMenu.EndSubMenu() |
From: Dewitt C. <ddc...@us...> - 2006-10-24 01:34:35
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv8446/src/database Modified Files: tcGenericDBObject.cpp tcRadarDBObject.cpp Log Message: Index: tcRadarDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcRadarDBObject.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcRadarDBObject.cpp 23 Mar 2006 01:11:02 -0000 1.18 --- tcRadarDBObject.cpp 24 Oct 2006 01:34:03 -0000 1.19 *************** *** 207,210 **** --- 207,211 ---- columnString += "DetectsSurface number(1),"; columnString += "DetectsAir number(1),"; + columnString += "DetectsMissile number(1),"; columnString += "DetectsGround number(1)"; } *************** *** 220,223 **** --- 221,225 ---- mbDetectsSurface = entry.GetInt("DetectsSurface") != 0; mbDetectsAir = entry.GetInt("DetectsAir") != 0; + mbDetectsMissile = entry.GetInt("DetectsMissile") != 0; mbDetectsGround = entry.GetInt("DetectsGround") != 0; *************** *** 238,241 **** --- 240,244 ---- s << (long)mbDetectsSurface << ","; s << (long)mbDetectsAir << ","; + s << (long)mbDetectsMissile << ","; s << (long)mbDetectsGround; *************** *** 255,258 **** --- 258,262 ---- mbDetectsSurface = true; mbDetectsAir = true; + mbDetectsMissile = true; mbDetectsGround = true; isSemiactive = false; *************** *** 261,273 **** tcRadarDBObject::tcRadarDBObject(tcRadarDBObject& obj) ! : tcSensorDBObject(obj) { ! mnClassID = DTYPE_RADAR; ! mfERP_dBW = obj.mfERP_dBW; ! mbDetectsSurface = obj.mbDetectsSurface; ! mbDetectsAir = obj.mbDetectsAir; ! mbDetectsGround = obj.mbDetectsGround; ! isSemiactive = obj.isSemiactive; ! isCommandReceiver = obj.isCommandReceiver; } --- 265,280 ---- tcRadarDBObject::tcRadarDBObject(tcRadarDBObject& obj) ! : ! tcSensorDBObject(obj), ! mfERP_dBW(obj.mfERP_dBW), ! mbDetectsSurface(obj.mbDetectsSurface), ! mbDetectsAir(obj.mbDetectsAir), ! mbDetectsMissile(obj.mbDetectsMissile), ! mbDetectsGround(obj.mbDetectsGround), ! isSemiactive(obj.isSemiactive), ! isCommandReceiver(obj.isCommandReceiver) { ! mnClassID = DTYPE_RADAR; ! } Index: tcGenericDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcGenericDBObject.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** tcGenericDBObject.cpp 18 Jun 2006 00:44:59 -0000 1.26 --- tcGenericDBObject.cpp 24 Oct 2006 01:34:02 -0000 1.27 *************** *** 56,60 **** void tcGenericDBObject::CalculateParams() { ! fuelConsumptionConstant = mfMaxSpeed_kts > 0 ? (mfFuelRate_kgps / mfMaxSpeed_kts) : 0; } --- 56,62 ---- void tcGenericDBObject::CalculateParams() { ! fuelConsumptionConstant = (mfMaxSpeed_kts > 0) ? (mfFuelRate_kgps / mfMaxSpeed_kts) : 0; ! ! invMaxSpeed = (mfMaxSpeed_kts > 0) ? (1.0f / mfMaxSpeed_kts) : 0; } *************** *** 72,78 **** } ! float tcGenericDBObject::GetFuelConsumptionConstant() const { ! return fuelConsumptionConstant; } --- 74,91 ---- } ! float tcGenericDBObject::GetFuelConsumptionConstant(float speed_kts) const { ! // Fuel burn penalty: ! // penalty = 0 for speed <= 2/3 max, above 2/3 penalty increases to 2 at max speed ! float excess_speed_penalty = 6.0 * ((speed_kts * invMaxSpeed) - 0.67f); ! ! if (excess_speed_penalty < 0) ! { ! return fuelConsumptionConstant; ! } ! else ! { ! return fuelConsumptionConstant * (1.0 + excess_speed_penalty); ! } } *************** *** 702,706 **** tcGenericDBObject::tcGenericDBObject() : tcDatabaseObject(), tcSensorPlatformDBObject(), ! fuelConsumptionConstant(0) { mnClassID = DTYPE_GENERIC; --- 715,720 ---- tcGenericDBObject::tcGenericDBObject() : tcDatabaseObject(), tcSensorPlatformDBObject(), ! fuelConsumptionConstant(0), ! invMaxSpeed(0) { mnClassID = DTYPE_GENERIC; |
From: Dewitt C. <ddc...@us...> - 2006-10-24 01:34:34
|
Update of /cvsroot/gcblue/gcb_wx/src/ai In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv8446/src/ai Modified Files: Blackboard.cpp Brain.cpp tcCAPMission.cpp tcMission.cpp tcMissionManager.cpp Log Message: Index: Blackboard.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/ai/Blackboard.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Blackboard.cpp 12 Dec 2005 02:37:01 -0000 1.3 --- Blackboard.cpp 24 Oct 2006 01:34:01 -0000 1.4 *************** *** 29,32 **** --- 29,34 ---- #include "ai/BlackboardItem.h" #include "tcScenarioLogger.h" + #include "common/tcStream.h" + #include "common/tcObjStream.h" #ifdef _DEBUG *************** *** 37,40 **** --- 39,164 ---- + bool Blackboard::multiplayerClientMode = false; + + bool Blackboard::GetMultiplayerClientMode() + { + return multiplayerClientMode; + } + + void Blackboard::SetMultiplayerClientMode(bool state) + { + multiplayerClientMode = state; + } + + + + /** + * Loads state from command stream + */ + tcCommandStream& Blackboard::operator<<(tcCommandStream& stream) + { + unsigned char nItems; + stream >> nItems; + + if (multiplayerClientMode) + { + content.clear(); + } + + // add items to blackboard + for (unsigned char n=0; n<nItems; n++) + { + bool valid; + stream >> valid; + if (valid) + { + std::string key; + std::string message; + float priority; + + stream >> key; + stream >> message; + stream >> priority; + + if (multiplayerClientMode) + { + //fprintf(stdout, "CLIENT BB wrote (%s, %s)\n", key.c_str(), message.c_str()); + content[key] = BlackboardItem(0, priority, message); + } + else + { + //fprintf(stdout, "SERVER BB wrote (%s, %s)\n", key.c_str(), message.c_str()); + Write(key, 0, priority, message); + } + } + } + + return stream; + } + + /** + * Saves state to command stream + * Only saves top level (author 0) blackboard items + */ + tcCommandStream& Blackboard::operator>>(tcCommandStream& stream) + { + std::map<std::string, BlackboardItem>* map = 0; + + if (multiplayerClientMode) + { + map = &clientContent; + } + else + { + map = &content; + } + + unsigned char nItems = (unsigned char)map->size(); + wxASSERT(map->size() <= 255); + + stream << nItems; + + // iterate through clientContent + std::map<std::string, BlackboardItem>::iterator iter = map->begin(); + std::map<std::string, BlackboardItem>::iterator& done = map->end(); + for (;iter != done; ++iter) + { + BlackboardItem item = iter->second; + + // only send items written at top level (author = 0) + bool sendItem = (item.author == 0); + stream << sendItem; + + if (sendItem) + { + stream << iter->first; + stream << item.message; + float priority = float(item.priority); + stream << priority; + + //fprintf(stdout, "BB sent (%s, %s)\n", iter->first.c_str(), item.message.c_str()); + } + else + { + //fprintf(stdout, "BB skipped (%s, %s, %d)\n", iter->first.c_str(), item.message.c_str(), item.author); + } + } + + return stream; + } + + void Blackboard::ClearNewCommand() + { + clientContent.clear(); + hasNewCommand = false; + } + + bool Blackboard::HasNewCommand() const + { + return hasNewCommand; + } + + + void Blackboard::Erase(const std::string& key, double priority) *************** *** 204,208 **** content[key] = item; } ! return true; } --- 328,338 ---- content[key] = item; } ! ! if (multiplayerClientMode) ! { ! clientContent[key] = item; ! } ! hasNewCommand = true; ! return true; } *************** *** 232,239 **** --- 362,376 ---- } + if (multiplayerClientMode) + { + clientContent[key] = BlackboardItem(author, priority, message); + } + hasNewCommand = true; + return true; } Blackboard::Blackboard() + : hasNewCommand(false) { } Index: Brain.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/ai/Brain.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Brain.cpp 27 Aug 2006 21:28:54 -0000 1.13 --- Brain.cpp 24 Oct 2006 01:34:01 -0000 1.14 *************** *** 62,90 **** tcCommandStream& Brain::operator<<(tcCommandStream& stream) { ! wxASSERT(platform->IsClientMode()); ! unsigned char nTasks; ! stream >> nTasks; ! RemoveAllTasks(); ! for (unsigned char n=0; n<nTasks; n++) ! { ! std::string taskName; ! stream >> taskName; ! float priority; ! stream >> priority; ! int attributes; ! stream >> attributes; ! AddTask(taskName, (double)priority, attributes); ! } ! // update waypoints if nav task exists ! if (ai::Nav* nav = GetNavTask()) { ! nav->operator<<(stream); } --- 62,117 ---- tcCommandStream& Brain::operator<<(tcCommandStream& stream) { ! // client update ! if (platform->IsClientMode()) ! { ! unsigned char nTasks; ! stream >> nTasks; ! RemoveAllTasks(); ! for (unsigned char n=0; n<nTasks; n++) ! { ! std::string taskName; ! stream >> taskName; ! float priority; ! stream >> priority; ! int attributes; ! stream >> attributes; ! AddTaskDirectly(taskName, (double)priority, attributes); ! } ! // update waypoints if nav task exists ! if (ai::Nav* nav = GetNavTask()) ! { ! nav->operator<<(stream); ! } ! //fprintf(stdout, "CLIENT loading board cmds (%s)\n", platform->mzUnit.c_str()); ! board.operator<<(stream); ! } ! // server update ! else { ! clientTasks.clear(); ! ! unsigned char nTasks; ! stream >> nTasks; ! ! for (unsigned char n=0; n<nTasks; n++) ! { ! AddTaskCommand cmd; ! ! stream >> cmd.taskName; ! stream >> cmd.priority; ! stream >> cmd.attributes; ! ! clientTasks.push_back(cmd); // queue for add in next update ! } ! ! //fprintf(stdout, "SERVER loading board cmds (%s)\n", platform->mzUnit.c_str()); ! board.operator<<(stream); } *************** *** 97,126 **** tcCommandStream& Brain::operator>>(tcCommandStream& stream) { ! wxASSERT(!platform->IsClientMode()); ! unsigned char nTasks = taskMap.size(); ! stream << nTasks; ! // iterate through task map and update tasks ! std::map<std::string, Task*>::iterator iter = taskMap.begin(); ! std::map<std::string, Task*>::iterator& done = taskMap.end(); ! for (;iter != done; ++iter) ! { ! Task* task = iter->second; ! wxASSERT(task); ! stream << task->GetTaskName(); ! float priority = (float)task->GetPriority(); ! stream << priority; ! int attributes = task->GetAttributes(); ! stream << attributes; ! } ! // update waypoints if nav task exists ! if (ai::Nav* nav = GetNavTask()) { ! nav->operator>>(stream); } --- 124,174 ---- tcCommandStream& Brain::operator>>(tcCommandStream& stream) { ! if (!platform->IsClientMode()) ! { ! unsigned char nTasks = taskMap.size(); ! stream << nTasks; ! // iterate through task map and update tasks ! std::map<std::string, Task*>::iterator iter = taskMap.begin(); ! std::map<std::string, Task*>::iterator& done = taskMap.end(); ! for (;iter != done; ++iter) ! { ! Task* task = iter->second; ! wxASSERT(task); ! stream << task->GetTaskName(); ! float priority = (float)task->GetPriority(); ! stream << priority; ! int attributes = task->GetAttributes(); ! stream << attributes; ! } ! // update waypoints if nav task exists ! if (ai::Nav* nav = GetNavTask()) ! { ! nav->operator>>(stream); ! } ! //fprintf(stdout, "SERVER writing board cmds (%s)\n", platform->mzUnit.c_str()); ! board.operator>>(stream); ! } ! else { ! unsigned char nTasks = (unsigned char)clientTasks.size(); ! wxASSERT(clientTasks.size() <= 255); ! ! stream << nTasks; ! for (unsigned char n=0; n<nTasks; n++) ! { ! stream << clientTasks[n].taskName; ! stream << clientTasks[n].priority; ! stream << clientTasks[n].attributes; ! } ! ! ! //fprintf(stdout, "CLIENT writing board cmds (%s)\n", platform->mzUnit.c_str()); ! board.operator>>(stream); } *************** *** 132,140 **** hasNewCommand = false; } bool Brain::HasNewCommand() const { ! return hasNewCommand; } --- 180,194 ---- hasNewCommand = false; + if (platform->IsClientMode()) + { + clientTasks.clear(); + } + + board.ClearNewCommand(); } bool Brain::HasNewCommand() const { ! return hasNewCommand || board.HasNewCommand(); } *************** *** 268,273 **** --- 322,353 ---- } + /** + * Version that pushes task to command list and marks new command for multiplayer + */ void Brain::AddTask(const std::string& taskName, double priority_, int attributes_) { + if (platform->IsClientMode()) + { + AddTaskCommand cmd; + cmd.taskName = taskName; + cmd.priority = float(priority_); + cmd.attributes = attributes_; + + clientTasks.push_back(cmd); + + SetNewCommand(); + return; + } + + hasNewCommand = true; + + AddTaskDirectly(taskName, priority_, attributes_); + } + + /** + * Adds task without any multiplayer operations + */ + void Brain::AddTaskDirectly(const std::string& taskName, double priority_, int attributes_) + { // if task already exists, update priority and attributes std::map<std::string, Task*>::iterator tm_iter = taskMap.find(taskName); *************** *** 281,286 **** } - hasNewCommand = true; - // check taskNameMap for C++ task, otherwise assume python script task std::map<std::string, int>::iterator iter = taskNameLookup.find(taskName); --- 361,364 ---- *************** *** 398,401 **** --- 476,490 ---- RemovePending(); + // in multiplayer, add pending client tasks + size_t nPendingClientTasks = clientTasks.size(); + if (nPendingClientTasks > 0) + { + for (size_t n=0; n<nPendingClientTasks; n++) + { + AddTask(clientTasks[n].taskName, clientTasks[n].priority, clientTasks[n].attributes); + } + clientTasks.clear(); + } + updating = true; Index: tcMission.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/ai/tcMission.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcMission.cpp 1 Oct 2006 21:07:40 -0000 1.2 --- tcMission.cpp 24 Oct 2006 01:34:02 -0000 1.3 *************** *** 33,36 **** --- 33,38 ---- #endif + using namespace ai; + unsigned long tcMission::nextId = 1; *************** *** 43,47 **** for (size_t n=0; n<missionAircraft.size(); n++) { ! if (missionManager->GetAircraft(missionAircraft[n]) != 0) { return false; --- 45,49 ---- for (size_t n=0; n<missionAircraft.size(); n++) { ! if (missionManager->GetAircraft(missionAircraft[n].id) != 0) { return false; *************** *** 65,69 **** } ! const std::vector<long>& tcMission::GetMissionAircraft() const { return missionAircraft; --- 67,71 ---- } ! const std::vector<MissionAircraftInfo>& tcMission::GetMissionAircraft() const { return missionAircraft; *************** *** 86,89 **** --- 88,92 ---- stage = src.stage; missionAircraft = src.missionAircraft; + lastUpdate = src.lastUpdate; return *this; *************** *** 95,99 **** id(src.id), stage(src.stage), ! missionAircraft(src.missionAircraft) { } --- 98,103 ---- id(src.id), stage(src.stage), ! missionAircraft(src.missionAircraft), ! lastUpdate(src.lastUpdate) { } *************** *** 102,106 **** : missionManager(0), id(nextId++), ! stage("init") { --- 106,111 ---- : missionManager(0), id(nextId++), ! stage("init"), ! lastUpdate(0) { Index: tcCAPMission.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/ai/tcCAPMission.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcCAPMission.cpp 1 Oct 2006 21:07:40 -0000 1.2 --- tcCAPMission.cpp 24 Oct 2006 01:34:01 -0000 1.3 *************** *** 28,33 **** --- 28,37 ---- #include "ai/tcCAPMission.h" #include "ai/tcMissionManager.h" + #include "ai/Brain.h" + #include "ai/BlackboardInterface.h" #include "tcWeaponDBObject.h" #include "tcAirObject.h" + #include "tcPlatformObject.h" + #include "tcSimState.h" #ifdef _DEBUG *************** *** 35,38 **** --- 39,79 ---- #endif + using namespace ai; + + + void tcCAPMission::CalculatePatrolOffset() + { + tcGameObject* parent = missionManager->GetFlightportParent(); + if (parent == 0) + { + wxASSERT(false); + return; + } + + range_km = parent->mcKin.RangeToKm(station.x, station.y); + az_deg = C_180OVERPI * parent->mcKin.HeadingToGeoRad(station.x, station.y); + } + + + /** + * If no mission aircraft are in flight with an active "CAP" task, + * then restart the mission + */ + void tcCAPMission::MonitorMissionInProgress() + { + tcSimState* simState = tcSimState::Get(); + + bool anyInFlight = false; + for (size_t n=0; (n<missionAircraft.size()) && (!anyInFlight); n++) + { + tcPlatformObject* obj = dynamic_cast<tcPlatformObject*>(simState->GetObjectByName(missionAircraft[n].name)); + if (obj != 0) + { + if (obj->GetBrain()->TaskExists("CAP")) anyInFlight = true; + } + } + + if (!anyInFlight) stage = "init"; // launch another patrol + } void tcCAPMission::SetStation(float lon_rad, float lat_rad) *************** *** 52,56 **** // step 3, create tasks for mission on each aircraft // step 4, order launch of aircraft ! // step 5, when all aircraft launched, delete mission --- 93,98 ---- // step 3, create tasks for mission on each aircraft // step 4, order launch of aircraft ! // step 5, when all aircraft launched, wait until aircraft landed ! // step 6, start over (recurring mission) *************** *** 58,63 **** { // 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++) { --- 100,106 ---- { // query available aircraft and take first from list ! std::vector<MissionAircraftInfo> candidates = missionManager->GetAvailableAircraft(AIR_TARGET); missionAircraft.clear(); + for (size_t n=0; (n<quantity)&&(n<candidates.size()); n++) { *************** *** 66,69 **** --- 109,114 ---- if (missionAircraft.size() == 0) return; // none available + CalculatePatrolOffset(); + stage = "outfit"; } *************** *** 74,78 **** for (size_t n=0; n<missionAircraft.size(); n++) { ! tcAirObject* aircraft = missionManager->GetAircraft(missionAircraft[n]); if (aircraft != 0) { --- 119,123 ---- for (size_t n=0; n<missionAircraft.size(); n++) { ! tcAirObject* aircraft = missionManager->GetAircraft(missionAircraft[n].id); if (aircraft != 0) { *************** *** 88,91 **** --- 133,158 ---- else if (stage == "task") { + wxString s; + for (size_t n=0; n<missionAircraft.size(); n++) + { + tcAirObject* aircraft = missionManager->GetAircraft(missionAircraft[n].id); + if (aircraft != 0) + { + ai::Brain* brain = aircraft->GetBrain(); + brain->AddTask("CAP", 2.0); + brain->AddTask("EngageAll", 3.0); + ai::BlackboardInterface bb = brain->GetBlackboardInterface(); + + s.Printf("%.1f", range_km); + bb.Write("PatrolRange_km", s.c_str()); + + s.Printf("%.1f", az_deg); + bb.Write("PatrolAzimuth_deg", s.c_str()); + + s.Printf("%d", missionManager->GetFlightportParentId()); + bb.Write("AnchorPlatformId", s.c_str()); + } + } + stage = "launch"; } *************** *** 94,110 **** 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 if (AllMissionAircraftDeparted()) { ! EndMission(); } } } --- 161,187 ---- for (size_t n=0; n<missionAircraft.size(); n++) { ! missionManager->LaunchAircraft(missionAircraft[n].id); } ! stage = "waitlaunch"; } ! else if (stage == "waitlaunch") { // verify all aircraft have launched and end mission if (AllMissionAircraftDeparted()) { ! stage = "waitland"; } } + // do following at slower update + double dt = t - lastUpdate; + if (dt < 20.0) return; + lastUpdate = t; + + if (stage == "waitland") + { + MonitorMissionInProgress(); + } + } *************** *** 122,126 **** tcCAPMission::tcCAPMission(const tcCAPMission& src) ! : tcMission(src) { } --- 199,207 ---- tcCAPMission::tcCAPMission(const tcCAPMission& src) ! : tcMission(src), ! quantity(src.quantity), ! range_km(src.range_km), ! az_deg(src.az_deg), ! station(src.station) { } *************** *** 128,132 **** tcCAPMission::tcCAPMission() : tcMission(), ! quantity(2) { --- 209,215 ---- tcCAPMission::tcCAPMission() : tcMission(), ! quantity(2), ! range_km(80), ! az_deg(225) { Index: tcMissionManager.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/ai/tcMissionManager.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcMissionManager.cpp 1 Oct 2006 21:07:40 -0000 1.2 --- tcMissionManager.cpp 24 Oct 2006 01:34:02 -0000 1.3 *************** *** 36,40 **** #endif ! --- 36,40 ---- #endif ! using namespace ai; *************** *** 55,61 **** } ! std::vector<long>& tcMissionManager::GetAvailableAircraft(int targetMask) { ! static std::vector<long> availableAircraft; availableAircraft.clear(); --- 55,61 ---- } ! std::vector<MissionAircraftInfo>& tcMissionManager::GetAvailableAircraft(int targetMask) { ! static std::vector<MissionAircraftInfo> availableAircraft; availableAircraft.clear(); *************** *** 75,79 **** if ((platform != 0) && (platform->IsCapableVsTargetType(targetMask))) { ! availableAircraft.push_back(id); } } --- 75,82 ---- if ((platform != 0) && (platform->IsCapableVsTargetType(targetMask))) { ! MissionAircraftInfo info; ! info.id = id; ! info.name = airState->obj->mzUnit.c_str(); ! availableAircraft.push_back(info); } } *************** *** 85,88 **** --- 88,100 ---- } + tcGameObject* tcMissionManager::GetFlightportParent() + { + return flightPort->parent; + } + + long tcMissionManager::GetFlightportParentId() const + { + return flightPort->parent->mnID; + } bool tcMissionManager::IsAircraftReserved(long id) const *************** *** 152,161 **** 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; } } --- 164,173 ---- for (size_t n=0; n<missions.size(); n++) { ! const std::vector<MissionAircraftInfo>& missionAircraft = missions[n]->GetMissionAircraft(); unsigned int missionId = missions[n]->GetId(); for (size_t k=0; k<missionAircraft.size(); k++) { ! reserved[missionAircraft[k].id] = missionId; } } |
From: Dewitt C. <ddc...@us...> - 2006-10-24 01:34:34
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv8446/src/common Modified Files: simmath.cpp tcOptions.cpp Log Message: Index: simmath.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/simmath.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** simmath.cpp 5 Sep 2006 01:04:25 -0000 1.33 --- simmath.cpp 24 Oct 2006 01:34:02 -0000 1.34 *************** *** 678,681 **** --- 678,691 ---- (float)apGeoPoint->mfLat_rad,(float)apGeoPoint->mfLon_rad); } + + /** + * @returns radian heading to (lat,lon) point + */ + float tcKinematics::HeadingToGeoRad(float lon_rad, float lat_rad) + { + return nsNav::GCHeadingApprox_rad((float)mfLat_rad,(float)mfLon_rad, + lat_rad, lon_rad); + } + /** * @returns range in km Index: tcOptions.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/tcOptions.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** tcOptions.cpp 1 Oct 2006 21:07:40 -0000 1.20 --- tcOptions.cpp 24 Oct 2006 01:34:02 -0000 1.21 *************** *** 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); --- 94,102 ---- oi.meType = tsOptionInfo::OT_RADIOBUTTON; ! oi.mnStateCount = 2; oi.mnValue = 0; oi.mpAssociated = &symbologyType; oi.mzCaption[0] = "Icon (2525B) symbols"; oi.mzCaption[1] = "NTDS symbols"; AddOption(oi); |
From: Dewitt C. <ddc...@us...> - 2006-10-24 01:34:31
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv8449/include/graphics Modified Files: tc3DViewer.h tcConsoleBox.h tcMapOverlay.h tcMapView.h tcScrollBar.h Log Message: Index: tcScrollBar.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcScrollBar.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcScrollBar.h 17 Aug 2006 01:27:10 -0000 1.1 --- tcScrollBar.h 24 Oct 2006 01:33:57 -0000 1.2 *************** *** 47,52 **** --- 47,55 ---- virtual void Draw(); + virtual void SetActive(bool abActive); void SetBackgroundAlpha(float val); void SetBarFraction(float val); + void SetScrollFromBottom(bool state); + void SetSendRedraw(bool state); tcScrollBar(tc3DWindow *parent, const wxPoint& pos, const wxSize& size, *************** *** 75,80 **** float autoScrollIncrement; ///< set to 0 when left button is not down over up/down arrow unsigned int buttonDownTime; ! ! float backgroundAlpha; ///< transparency value for solid color background --- 78,83 ---- float autoScrollIncrement; ///< set to 0 when left button is not down over up/down arrow unsigned int buttonDownTime; ! bool sendRedraw; ///< true to send redraw messages to parent ! bool scrollFromBottom; ///< true to scroll from bottom (console mode) float backgroundAlpha; ///< transparency value for solid color background *************** *** 98,101 **** --- 101,105 ---- void LoadImages(); void SendScrollbarUpdated(); + void SendRedrawMessage(); void UpdateAutoScroll(); void UpdateYbar(float ynew); Index: tcConsoleBox.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcConsoleBox.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcConsoleBox.h 22 Mar 2006 01:23:28 -0000 1.9 --- tcConsoleBox.h 24 Oct 2006 01:33:57 -0000 1.10 *************** *** 38,41 **** --- 38,44 ---- class TiXmlNode; + + class tcScrollBar; + /** * Class based on tcConsole modified to use 3D window graphics *************** *** 74,77 **** --- 77,81 ---- virtual void OnSize(wxSizeEvent& event); bool Redraw() const {return redraw != 0;} ///< @return true if console will be updated + void SetDelayedTextEffect(bool effectOn) {useDelayedTextEffect = effectOn;} void SetLineOffset(unsigned int offset); *************** *** 93,97 **** --- 97,110 ---- osg::Vec4 fontColor; + tcScrollBar* scrollBar; + float yOffset; ///< offset for scrolling + float yCurrent; ///< used to track how much space the text needs for scrolling + + void InitFromXml(TiXmlNode* config); + void OnChildRedraw(wxCommandEvent& event); + void OnScrollbarUpdated(wxCommandEvent& event); + + DECLARE_EVENT_TABLE() }; Index: tcMapView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMapView.h,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** tcMapView.h 1 Oct 2006 21:07:40 -0000 1.33 --- tcMapView.h 24 Oct 2006 01:33:57 -0000 1.34 *************** *** 84,88 **** NTDS = 0, M2525 = 1, - NTDS_IMAGE = 2 }; --- 84,87 ---- *************** *** 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; --- 356,367 ---- Index: tc3DViewer.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DViewer.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tc3DViewer.h 24 Sep 2006 19:50:19 -0000 1.16 --- tc3DViewer.h 24 Oct 2006 01:33:57 -0000 1.17 *************** *** 36,39 **** --- 36,40 ---- #include <osgText/Text> #include <osgParticle/ParticleSystemUpdater> + #include <osgEphemeris/EphemerisModel> #include "cspDate.h" *************** *** 95,98 **** --- 96,101 ---- osg::ref_ptr<Sky> sky; osg::ref_ptr<osg::Group> skyLights; + osg::ref_ptr<osg::Group> waterLights; + osg::ref_ptr<osgEphemeris::EphemerisModel> sky2; // these methods are copied from tcWindow *************** *** 243,246 **** --- 246,255 ---- tc3DModel* defaultSensorModel; ///< default sensor model for non-ID'd tracks + // fog colors + osg::Vec4 airFog; + osg::Vec4 waterFog; + int fogMode; + + void InitLight(); Index: tcMapOverlay.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMapOverlay.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcMapOverlay.h 17 Aug 2006 01:27:10 -0000 1.4 --- tcMapOverlay.h 24 Oct 2006 01:33:57 -0000 1.5 *************** *** 29,35 **** #include "wx/wx.h" - #ifdef WIN32 - #include "wx/msw/private.h" //for MS Windows specific definitions - #endif #include "tc3DWindow.h" --- 29,32 ---- |
From: Dewitt C. <ddc...@us...> - 2006-10-24 01:34:31
|
Update of /cvsroot/gcblue/gcb_wx/include/ai In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv8449/include/ai Modified Files: Blackboard.h Brain.h tcCAPMission.h tcMission.h tcMissionManager.h Log Message: Index: tcMissionManager.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/ai/tcMissionManager.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcMissionManager.h 1 Oct 2006 21:07:39 -0000 1.2 --- tcMissionManager.h 24 Oct 2006 01:33:57 -0000 1.3 *************** *** 29,36 **** #include <map> #include <vector> class tcFlightPort; - class tcMission; class tcAirObject; /** --- 29,41 ---- #include <map> #include <vector> + #include "ai/MissionAircraftInfo.h" class tcFlightPort; class tcAirObject; + class tcGameObject; + + namespace ai { + + class tcMission; /** *************** *** 46,55 **** { public: - 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); --- 51,61 ---- { public: void AddMission(tcMission* mission_); void DeleteMission(unsigned int missionId); ! std::vector<MissionAircraftInfo>& GetAvailableAircraft(int targetMask); tcAirObject* GetAircraft(long id); + long GetFlightportParentId() const; + tcGameObject* GetFlightportParent(); bool IsAircraftReserved(long id) const; void LaunchAircraft(long id); *************** *** 71,74 **** --- 77,83 ---- }; + } // namespace + + #endif Index: tcCAPMission.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/ai/tcCAPMission.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcCAPMission.h 28 Sep 2006 02:01:53 -0000 1.1 --- tcCAPMission.h 24 Oct 2006 01:33:57 -0000 1.2 *************** *** 33,36 **** --- 33,37 ---- class tcPoint; + namespace ai { class tcCAPMission : public tcMission *************** *** 50,57 **** unsigned int quantity; // number aircraft for mission tcPoint station; ! }; --- 51,63 ---- unsigned int quantity; // number aircraft for mission tcPoint station; + float range_km; // calculated + float az_deg; // calculated ! void CalculatePatrolOffset(); ! void MonitorMissionInProgress(); + }; + } // namespace Index: Blackboard.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/ai/Blackboard.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Blackboard.h 12 Dec 2005 02:37:01 -0000 1.3 --- Blackboard.h 24 Oct 2006 01:33:57 -0000 1.4 *************** *** 30,33 **** --- 30,36 ---- #include <string> + class tcStream; + class tcCommandStream; + namespace scriptinterface { *************** *** 43,46 **** --- 46,52 ---- { public: + static bool GetMultiplayerClientMode(); + static void SetMultiplayerClientMode(bool state); + void Erase(const std::string& key, double priority); void EraseAll(); *************** *** 56,63 **** bool Write(const std::string& key, long author, double priority, const std::string& message); ! Blackboard(); ~Blackboard(); private: std::map<std::string, BlackboardItem> content; }; } --- 62,78 ---- bool Write(const std::string& key, long author, double priority, const std::string& message); ! tcCommandStream& operator<<(tcCommandStream& stream); ! tcCommandStream& operator>>(tcCommandStream& stream); ! void ClearNewCommand(); ! bool HasNewCommand() const; ! ! Blackboard(); ~Blackboard(); private: std::map<std::string, BlackboardItem> content; + + std::map<std::string, BlackboardItem> clientContent; // for multiplayer client + bool hasNewCommand; ///< for multiplayer, true if task or bb state has been changed + static bool multiplayerClientMode; ///< true to use multiplayer client mode }; } Index: tcMission.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/ai/tcMission.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcMission.h 1 Oct 2006 21:07:39 -0000 1.2 --- tcMission.h 24 Oct 2006 01:33:57 -0000 1.3 *************** *** 29,35 **** #include <string> #include <vector> ! class tcMissionManager; /** --- 29,37 ---- #include <string> #include <vector> + #include "ai/MissionAircraftInfo.h" ! namespace ai { + class tcMissionManager; /** *************** *** 43,47 **** void EndMission(); unsigned int GetId() const; ! const std::vector<long>& GetMissionAircraft() const; bool AllMissionAircraftDeparted() const; --- 45,49 ---- void EndMission(); unsigned int GetId() const; ! const std::vector<MissionAircraftInfo>& GetMissionAircraft() const; bool AllMissionAircraftDeparted() const; *************** *** 56,61 **** protected: tcMissionManager* missionManager; ! std::vector<long> missionAircraft; std::string stage; private: --- 58,64 ---- protected: tcMissionManager* missionManager; ! std::vector<MissionAircraftInfo> missionAircraft; std::string stage; + double lastUpdate; private: *************** *** 65,69 **** ! --- 68,72 ---- ! } // namespace Index: Brain.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/ai/Brain.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Brain.h 27 Aug 2006 21:28:53 -0000 1.11 --- Brain.h 24 Oct 2006 01:33:57 -0000 1.12 *************** *** 69,72 **** --- 69,73 ---- void AddTask(const std::string& taskName, double priority_, int attributes_ = 0); + void AddTaskDirectly(const std::string& taskName, double priority_, int attributes_); /// gets a low priority, anonymous interface to board BlackboardInterface GetBlackboardInterface(); *************** *** 95,98 **** --- 96,106 ---- ~Brain(); private: + struct AddTaskCommand + { + std::string taskName; + float priority; + int attributes; + }; + tcPlatformObject* const platform; const float updateInterval; *************** *** 105,108 **** --- 113,117 ---- std::map<std::string, Task*> taskMap; std::queue<std::string> removeList; ///< list of tasks to remove at next update + std::vector<AddTaskCommand> clientTasks; static std::map<std::string, int> taskNameLookup; |