gcblue-commits Mailing List for Global Conflict Blue (Page 23)
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...> - 2005-06-25 22:10:47
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21991/src/database Modified Files: tcLauncherDBObject.cpp Log Message: Fixed bug with crashing when too many range circles were displayed Index: tcLauncherDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcLauncherDBObject.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tcLauncherDBObject.cpp 1 Jun 2005 00:13:29 -0000 1.16 --- tcLauncherDBObject.cpp 25 Jun 2005 22:10:34 -0000 1.17 *************** *** 2,6 **** ** @file tcLauncherDBObject.cpp */ ! /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 2,6 ---- ** @file tcLauncherDBObject.cpp */ ! /* Copyright (C) 2003-2005 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 43,47 **** namespace database { ! /** * workaround for write serialization issue --- 43,111 ---- namespace database { ! /** ! * This can be a substitute for IsItemCompatible by testing != 0 ! * @see IsItemCompatible ! */ ! unsigned short tcLauncherDBObject::GetCapacityForItem(const std::string& item) const ! { ! unsigned nTypes = childClassList.size(); ! for (unsigned k=0; k<nTypes; k++) ! { ! if (item == childClassList[k]) ! { ! wxASSERT(childClassList.size() == childCapacityList.size()); ! return childCapacityList[k]; ! } ! } ! ! return 0; ! } ! ! unsigned short tcLauncherDBObject::GetConfigurationCapacity(unsigned int idx) const ! { ! wxASSERT(idx < childCapacityList.size()); ! return childCapacityList[idx]; ! } ! ! const std::string& tcLauncherDBObject::GetConfigurationClass(unsigned int idx) const ! { ! wxASSERT(idx < childClassList.size()); ! return childClassList[idx]; ! } ! ! unsigned int tcLauncherDBObject::GetNumberConfigurations() const ! { ! return childClassList.size(); ! } ! ! ! unsigned short tcLauncherDBObject::GetDefaultChildCapacity() const ! { ! if (childCapacityList.size() == 0) ! { ! return 0; ! } ! else ! { ! return childCapacityList[0]; ! } ! } ! ! /** ! * @returns first configuration in childClassList as a default, or "" if error ! */ ! const char* tcLauncherDBObject::GetDefaultChildClass() const ! { ! static std::string errorString = ""; ! if (childClassList.size() == 0) ! { ! return errorString.c_str(); ! } ! else ! { ! return childClassList[0].c_str(); ! } ! } ! /** * workaround for write serialization issue *************** *** 60,64 **** tcDatabaseObject::PrintToFile(file); ! s.Format(" child class:%s mnCapacity:%d\n", mzChildClass.mz,mnCapacity); file.WriteString(s.GetBuffer()); } --- 124,129 ---- tcDatabaseObject::PrintToFile(file); ! s.Format(" default child class: %s mnCapacity:%d\n", ! GetDefaultChildClass(), GetDefaultChildCapacity()); file.WriteString(s.GetBuffer()); } *************** *** 66,69 **** --- 131,136 ---- int tcLauncherDBObject::Serialize(tcFile& file, bool mbLoad, UINT32 anVersion) { + wxASSERT(false); // not updated + /* tcDatabaseObject::Serialize(file,mbLoad, anVersion); if (mbLoad) *************** *** 90,93 **** --- 157,161 ---- } } + */ return true; } *************** *** 95,98 **** --- 163,168 ---- int tcLauncherDBObject::SerializeCSV(CsvTranslator *csv, bool mbLoad) { + wxASSERT(false); // not updated + /* tcDatabaseObject::SerializeCSV(csv, mbLoad); if (mbLoad) *************** *** 141,144 **** --- 211,215 ---- csv->WriteLine(); } + */ return 1; } *************** *** 156,168 **** localNode->SetAttribute("cycleTime", cycleTime); - localNode->SetAttribute("capacity", (int)mnCapacity); - localNode->SetAttribute("childClass", mzChildClass.mz); localNode->SetAttribute("fcSensorClass", fireControlSensorClass); ! for(unsigned int i=0;(i<mnConfigurations)&&(i<MAX_LAUNCHER_CONFIGURATIONS);i++) { TiXmlElement* childNode = node->InsertEndChild(TiXmlElement("config"))->ToElement(); ! childNode->SetAttribute("capacity", (int)maCapacity[i]); ! childNode->SetAttribute("childClass", maChildClass[i].mz); } --- 227,237 ---- localNode->SetAttribute("cycleTime", cycleTime); localNode->SetAttribute("fcSensorClass", fireControlSensorClass); ! for(unsigned int i=0;(i<childClassList.size())&&(i<MAX_LAUNCHER_CONFIGURATIONS);i++) { TiXmlElement* childNode = node->InsertEndChild(TiXmlElement("config"))->ToElement(); ! childNode->SetAttribute("capacity", (int)childCapacityList[i]); ! childNode->SetAttribute("childClass", childClassList[i].c_str()); } *************** *** 174,182 **** int tcLauncherDBObject::WriteCSVHeader(database::CsvTranslator *csv) { tcDatabaseObject::WriteCSVHeader(csv); *csv << "Cycle time"; - *csv << "Basic capacity"; - *csv << "Basic class"; *csv << "Fire control sensor class"; --- 243,251 ---- int tcLauncherDBObject::WriteCSVHeader(database::CsvTranslator *csv) { + wxASSERT(false); // not updated + /* tcDatabaseObject::WriteCSVHeader(csv); *csv << "Cycle time"; *csv << "Fire control sensor class"; *************** *** 191,194 **** --- 260,264 ---- csv->WriteLine(); + */ return 1; } *************** *** 206,221 **** columnString += "CycleTime_s number(5),"; columnString += "IsAutoPoint number(1),"; - columnString += "BasicCap number(4),"; - columnString += "BasicClass varchar(30),"; columnString += "FireControlSens varchar(30),"; for(unsigned i=0;i<MAX_LAUNCHER_CONFIGURATIONS;i++) { ! tcString s; ! s.Format("Cap%d number(4),",i+1); columnString += s.GetBuffer(); ! s.Format("Class%d varchar(30)",i+1); columnString += s.GetBuffer(); if (i < MAX_LAUNCHER_CONFIGURATIONS - 1) columnString += ","; } --- 276,290 ---- columnString += "CycleTime_s number(5),"; columnString += "IsAutoPoint number(1),"; columnString += "FireControlSens varchar(30),"; for(unsigned i=0;i<MAX_LAUNCHER_CONFIGURATIONS;i++) { ! tcString s; ! s.Format("Class%d varchar(30),",i+1); columnString += s.GetBuffer(); ! s.Format("Cap%d number(4)",i+1); columnString += s.GetBuffer(); + if (i < MAX_LAUNCHER_CONFIGURATIONS - 1) columnString += ","; } *************** *** 228,249 **** cycleTime = entry.GetDouble("CycleTime_s"); isAutoPoint = entry.GetInt("IsAutoPoint") != 0; - mnCapacity = entry.GetInt("BasicCap"); - mzChildClass = entry.GetString("BasicClass").c_str(); fireControlSensorClass = entry.GetString("FireControlSens"); - mnConfigurations = 0; for (unsigned i=0;i<MAX_LAUNCHER_CONFIGURATIONS;i++) { tcString s; ! ! s.Format("Cap%d", i+1); ! maCapacity[mnConfigurations] = entry.GetInt(s.GetBuffer()); ! s.Format("Class%d", i+1); ! maChildClass[mnConfigurations] = entry.GetString(s.GetBuffer()).c_str(); ! ! if (strlen(maChildClass[mnConfigurations].mz) > 2) { ! mnConfigurations++; } } --- 297,316 ---- cycleTime = entry.GetDouble("CycleTime_s"); isAutoPoint = entry.GetInt("IsAutoPoint") != 0; fireControlSensorClass = entry.GetString("FireControlSens"); for (unsigned i=0;i<MAX_LAUNCHER_CONFIGURATIONS;i++) { tcString s; ! s.Format("Class%d", i+1); ! std::string classString = entry.GetString(s.GetBuffer()); ! ! s.Format("Cap%d", i+1); ! unsigned short capacity = entry.GetInt(s.GetBuffer()); ! ! if (classString.size() > 2) { ! childClassList.push_back(classString); ! childCapacityList.push_back(capacity); } } *************** *** 260,278 **** s << cycleTime << ","; s << isAutoPoint << ","; - s << mnCapacity << ","; - s << "'" << mzChildClass.mz << "',"; s << "'" << fireControlSensorClass << "',"; for(unsigned i=0;i<MAX_LAUNCHER_CONFIGURATIONS;i++) { ! if (i < mnConfigurations) { ! s << (long)maCapacity[i] << ","; ! s << "'" << maChildClass[i].mz << "'"; } else { s << "0,"; - s << "''"; } --- 327,343 ---- s << cycleTime << ","; s << isAutoPoint << ","; s << "'" << fireControlSensorClass << "',"; for(unsigned i=0;i<MAX_LAUNCHER_CONFIGURATIONS;i++) { ! if (i < childClassList.size()) { ! s << "'" << childClassList[i] << "'"; ! s << (long)childCapacityList[i] << ","; } else { + s << "''"; s << "0,"; } *************** *** 287,304 **** cycleTime(0), isAutoPoint(false), ! mnCapacity(0), ! mzChildClass("NOCHILDCLASS"), ! fireControlSensorClass(""), ! mnConfigurations(0) { mzClass = "Default Launcher"; mnClassID = DTYPE_LAUNCHER; - - for(unsigned i=0;i<MAX_LAUNCHER_CONFIGURATIONS;i++) - { - maChildClass[i] = ""; - maCapacity[i] = 0; - } - } --- 352,359 ---- cycleTime(0), isAutoPoint(false), ! fireControlSensorClass("") { mzClass = "Default Launcher"; mnClassID = DTYPE_LAUNCHER; } *************** *** 306,321 **** : tcDatabaseObject(obj), cycleTime(obj.cycleTime), ! mzChildClass(obj.mzChildClass), ! mnCapacity(obj.mnCapacity), ! mnConfigurations(obj.mnConfigurations), fireControlSensorClass(obj.fireControlSensorClass) { mnClassID = DTYPE_LAUNCHER; - - for(unsigned i=0;i<MAX_LAUNCHER_CONFIGURATIONS;i++) - { - maChildClass[i] = obj.maChildClass[i]; - maCapacity[i] = obj.maCapacity[i]; - } } --- 361,369 ---- : tcDatabaseObject(obj), cycleTime(obj.cycleTime), ! childClassList(obj.childClassList), ! childCapacityList(obj.childCapacityList), fireControlSensorClass(obj.fireControlSensorClass) { mnClassID = DTYPE_LAUNCHER; } |
|
From: Dewitt C. <ddc...@us...> - 2005-06-25 22:09:56
|
Update of /cvsroot/gcblue/gcb_wx/include/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21427/include/scriptinterface Modified Files: tcSimPythonInterface.h Log Message: Index: tcSimPythonInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcSimPythonInterface.h,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** tcSimPythonInterface.h 11 Jun 2005 21:01:43 -0000 1.26 --- tcSimPythonInterface.h 25 Jun 2005 22:09:47 -0000 1.27 *************** *** 144,147 **** --- 144,149 ---- void SetMenuPlatform(long anID); void SetMenuGroup(const std::vector<long>& unitIds); + + void Update(); ///< call periodically to send output and error text to console tcCommandStream& operator<<(tcCommandStream& stream); *************** *** 157,160 **** --- 159,164 ---- ~tcSimPythonInterface(); + bool showPythonErrors; ///< true to send python errors to F7 console in game + object PlatformInterface; ///< python tcPlatformInterface tcPlatformInterface *platformInterface; ///< C++ handle to PlatformInterface *************** *** 206,209 **** --- 210,214 ---- + void UpdateLogs(); }; } |
|
From: Dewitt C. <ddc...@us...> - 2005-06-25 22:09:56
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21427/include/sim Modified Files: tcLauncher.h tcObjectControl.h tcSubObject.h Log Message: Index: tcSubObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSubObject.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcSubObject.h 17 Apr 2005 22:35:00 -0000 1.4 --- tcSubObject.h 25 Jun 2005 22:09:47 -0000 1.5 *************** *** 81,84 **** --- 81,85 ---- bool periscopeRaised; float periscopeDepth_m; ///< periscope depth (positive number) + float invPeriscopeDepth; ///< 1/periscopeDepth_m float lastDepth_m; ///< for depth notification messages bool doneSinking; Index: tcObjectControl.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcObjectControl.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tcObjectControl.h 1 Jun 2005 00:13:28 -0000 1.16 --- tcObjectControl.h 25 Jun 2005 22:09:47 -0000 1.17 *************** *** 139,160 **** ! ! #define MAX_OCSYMBOLS 8 ///< symbols to be drawn on map, move this feature out of tcObjectControl eventually ! ! struct tsOCSymbolList { ! struct ! { ! float mfLat_rad; ! float mfLon_rad; ! float mfLatExtent_rad; ! float mfLonExtent_rad; ! float mfArcCenter_deg; ! float mfArcLength_deg; ! UINT32 mnColor; ! } maSymbol[MAX_OCSYMBOLS]; ! unsigned mnSymbols; }; /** * Old code, needs refactoring --- 139,157 ---- ! /** ! * For drawing range circles for weapons and sensors on map ! */ ! struct MapSymbolInfo { ! float mfLat_rad; ! float mfLon_rad; ! float mfLatExtent_rad; ! float mfLonExtent_rad; ! float mfArcCenter_deg; ! float mfArcLength_deg; ! UINT32 mnColor; }; + /** * Old code, needs refactoring *************** *** 167,171 **** void AttachUserInfo(tcUserInfo *apUserInfo) {mpUserInfo=apUserInfo;} bool ButtonContainingPoint(wxPoint point, int& rnRow, int& rnColumn); ! void GetSymbols(tsOCSymbolList*& rpOCSymbolList) {rpOCSymbolList=&msOCSymbolList;} void SetHookID(tnPoolIndex anID) {mnHookID=anID;} void OnLButtonDown(wxMouseEvent& event); --- 164,168 ---- void AttachUserInfo(tcUserInfo *apUserInfo) {mpUserInfo=apUserInfo;} bool ButtonContainingPoint(wxPoint point, int& rnRow, int& rnColumn); ! const std::vector<MapSymbolInfo>& GetMapSymbols() const; void SetHookID(tnPoolIndex anID) {mnHookID=anID;} void OnLButtonDown(wxMouseEvent& event); *************** *** 195,199 **** int mnLaunchers; int mnSensors; ! tsOCSymbolList msOCSymbolList; osg::ref_ptr<osg::Geometry> headingCircle; osg::ref_ptr<osg::Geometry> headingCircleLight; --- 192,196 ---- int mnLaunchers; int mnSensors; ! std::vector<MapSymbolInfo> symbolList; osg::ref_ptr<osg::Geometry> headingCircle; osg::ref_ptr<osg::Geometry> headingCircleLight; Index: tcLauncher.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcLauncher.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** tcLauncher.h 22 Jun 2005 01:21:27 -0000 1.19 --- tcLauncher.h 25 Jun 2005 22:09:47 -0000 1.20 *************** *** 1,5 **** ! /** @file tcLauncher.h ! ** ! ** Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** --- 1,6 ---- ! /** ! ** @file tcLauncher.h ! */ ! /* Copyright (C) 2003-2005 Dewitt Colclough (de...@tw...) ** All rights reserved. ** *************** *** 119,122 **** --- 120,124 ---- const std::string& GetChildClassName() const; tcDatabaseObject* GetChildDatabaseObject() const; + const std::string& GetLauncherName() const; float GetCycleTime() const; *************** *** 138,142 **** void SetParent(tcGameObject *obj); /// @return max quantity of item that launcher can hold, 0 if not compatible ! unsigned int GetCapacityForItem(const std::string& item) const; unsigned int GetCompatibleCount() const; const std::string& GetCompatibleName(unsigned int idx) const; --- 140,144 ---- void SetParent(tcGameObject *obj); /// @return max quantity of item that launcher can hold, 0 if not compatible ! unsigned short GetCapacityForItem(const std::string& item) const; unsigned int GetCompatibleCount() const; const std::string& GetCompatibleName(unsigned int idx) const; *************** *** 162,164 **** }; ! #endif \ No newline at end of file --- 164,166 ---- }; ! #endif |
|
From: Dewitt C. <ddc...@us...> - 2005-06-25 22:09:56
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21427/include/database Modified Files: tcDatabaseObject.h tcLauncherDBObject.h tcStoresDBObject.h Log Message: Index: tcDatabaseObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcDatabaseObject.h,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** tcDatabaseObject.h 12 Jun 2005 20:46:27 -0000 1.24 --- tcDatabaseObject.h 25 Jun 2005 22:09:46 -0000 1.25 *************** *** 94,97 **** --- 94,98 ---- #define MTYPE_BALLISTIC 14 #define MTYPE_SONOBUOY 15 + #define MTYPE_CM 16 // generic countermeasure model *************** *** 115,118 **** --- 116,120 ---- #define DTYPE_SONOBUOY 16 #define DTYPE_ITEM 17 + #define DTYPE_CM 18 #define DTYPE_NULL 0xFFFFFFFF Index: tcStoresDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcStoresDBObject.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcStoresDBObject.h 12 Jun 2005 20:46:27 -0000 1.4 --- tcStoresDBObject.h 25 Jun 2005 22:09:46 -0000 1.5 *************** *** 36,40 **** class tcSqlReader; - #define MAX_LAUNCHER_CONFIGURATIONS 8 // number of weapon class/capacity options supported /** * Database object to describe storage, used for weapons magazines, etc. --- 36,39 ---- Index: tcLauncherDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcLauncherDBObject.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcLauncherDBObject.h 1 Jun 2005 00:13:26 -0000 1.13 --- tcLauncherDBObject.h 25 Jun 2005 22:09:46 -0000 1.14 *************** *** 1,6 **** ! /* ! ** tcLauncherDBObject.h ! ** ! ** Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** ! ** @file tcLauncherDBObject.h ! */ ! /* Copyright (C) 2003-2005 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 28,31 **** --- 28,32 ---- #include "tcDatabaseObject.h" + #include <vector> class TiXmlElement; *************** *** 35,39 **** class tcSqlReader; - #define MAX_LAUNCHER_CONFIGURATIONS 8 // number of weapon class/capacity options supported /** * --- 36,39 ---- *************** *** 42,56 **** { public: float cycleTime; ///< down time between shots bool isAutoPoint; ///< true to always point launcher toward target ! tcDBString mzChildClass; ///< class of platform to launch (simple model) ! unsigned short mnCapacity; ///< max number of launch objects held (simple model) ! tcDBString maChildClass[MAX_LAUNCHER_CONFIGURATIONS]; ///< array for multiple options ! unsigned short maCapacity[MAX_LAUNCHER_CONFIGURATIONS]; ///< array for mult configs ! unsigned short mnConfigurations; std::string fireControlSensorClass; ///< class of sensor on platform for fire control ///< (track required to launch) virtual const char* GetClassName() {return "Launcher";} ///< returns class name of database object bool IsLeaf() const; ///< returns true if db obj is a leaf obj virtual void PrintToFile(tcFile& file); --- 42,65 ---- { public: + enum + { + MAX_LAUNCHER_CONFIGURATIONS = 8 ///< number of weapon class/capacity options supported + }; float cycleTime; ///< down time between shots bool isAutoPoint; ///< true to always point launcher toward target ! ! std::string fireControlSensorClass; ///< class of sensor on platform for fire control ///< (track required to launch) + unsigned short GetCapacityForItem(const std::string& item) const; virtual const char* GetClassName() {return "Launcher";} ///< returns class name of database object + + unsigned short GetConfigurationCapacity(unsigned int idx) const; + const std::string& GetConfigurationClass(unsigned int idx) const; + unsigned int GetNumberConfigurations() const; + + unsigned short GetDefaultChildCapacity() const; + const char* GetDefaultChildClass() const; ///< @returns default class name for this launcher bool IsLeaf() const; ///< returns true if db obj is a leaf obj virtual void PrintToFile(tcFile& file); *************** *** 67,70 **** --- 76,84 ---- tcLauncherDBObject(tcLauncherDBObject& obj); ///< copy constructor virtual ~tcLauncherDBObject(); + + private: + std::vector<std::string> childClassList; ///< vector of different loadout configs + std::vector<unsigned short> childCapacityList; ///< corresponding vector of max quantities + }; |
|
From: Dewitt C. <ddc...@us...> - 2005-06-22 01:23:48
|
Update of /cvsroot/gcblue/gcb_wx/scenarios In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3582/scenarios Added Files: TaiwanTest.py Log Message: Taiwan theater test scenario, added airfields, Su-27, Su-30MKK, F-16 --- NEW FILE: TaiwanTest.py --- # SM is ScenarioManager object def CreateScenario(SM): # using variables for these to make it easy to switch sides in single player alliance_a = 1 alliance_b = 2 SM.CreateAlliance(alliance_a, 'Taiwan ROC') SM.CreateAlliance(alliance_b, 'China PLA') SM.SetUserAlliance(1) SM.SetScenarioDescription('Taiwan test scenario 2') SM.SetScenarioLoaded(1) SM.SetScenarioName('Taiwan Test 2') SM.SetDateTime(2005, 8, 12, 10, 0, 0) SM.SetStartTheater(120, 25) # (lon, lat) in degrees, negative is West or South AddOverlayGraphics(SM) unit = SM.GetDefaultUnit() ### Alliance A (Taiwan) units AddAirbase(SM, 'Cha Shan AB', 121.617, 24.0167, 0, alliance_a) AddAircraftToBase(SM, 'Cha Shan AB', 'F-16C', 'Tiger', 8) AddAirbase(SM, 'Chiayi AB', 120.392778, 23.461667, 0, alliance_a) AddAircraftToBase(SM, 'Chiayi AB', 'F-16C', 'Cougar', 8) AddAirbase(SM, 'Ching Chuan Kang AB', 120.620556, 24.264444, 0, alliance_a) AddAircraftToBase(SM, 'Ching Chuan Kang AB', 'F-16C', 'Skunk', 8) AddAirbase(SM, 'Hsinchu AB', 120.939167, 24.818056, 0, alliance_a) AddAircraftToBase(SM, 'Hsinchu AB', 'F-16C', 'Frog', 8) AddAirbase(SM, 'Pingtung AB North', 120.477778, 22.695278, 0, alliance_a) AddAircraftToBase(SM, 'Pingtung AB North', 'F-16C', 'Squirrel', 8) AddAirbase(SM, 'Pingtung AB South', 120.461667, 22.672222, 0, alliance_a) AddAircraftToBase(SM, 'Pingtung AB South', 'F-16C', 'Lion', 8) AddAirbase(SM, 'Tainan AB', 120.205556, 22.950278, 0, alliance_a) AddAircraftToBase(SM, 'Tainan AB', 'F-16C', 'Rabbit', 8) AddAirbase(SM, 'Taitung AB', 121.181944, 22.793056, 0, alliance_a) AddAircraftToBase(SM, 'Taitung AB', 'F-16C', 'Dragon', 8) ### Alliance B (China) units AddAirbase(SM, 'Longtian AB', 119.417, 25.583, 0, alliance_b) AddAircraftToBase(SM, 'Longtian AB', 'Su-27', 'Laser', 8) AddAirbase(SM, 'Fuzhou AB', 119.367, 26.0167, 0, alliance_b) AddAircraftToBase(SM, 'Fuzhou AB', 'Su-30MKK', 'Dancer', 8) AddAirbase(SM, 'Chin Chiang AB', 118.583, 24.783, 0, alliance_b) AddAircraftToBase(SM, 'Chin Chiang AB', 'Su-27', 'Thunder', 8) AddAirbase(SM, 'Chang-Chou AB', 117.667, 24.583, 0, alliance_b) AddAircraftToBase(SM, 'Chang-Chou AB', 'Su-27', 'Pacer', 8) AddAirbase(SM, 'Shantou AB', 116.75, 23.417, 0, alliance_b) AddAircraftToBase(SM, 'Shantou AB', 'Su-30MKK', 'Hunter', 8) AddAirbase(SM, 'Mei-Xian AB', 116.133, 24.25, 0, alliance_b) AddAircraftToBase(SM, 'Mei-Xian AB', 'Su-27', 'Dagger', 8) unit = SM.GetDefaultUnit() unit.className = 'E2-C' unit.unitName = 'Eye 1' unit.SetPosition(120.0, 25.0, 1500) # lon, lat, alt unit.heading = 120 unit.speed = 150 unit.throttle = 0.8 SM.AddUnitToAlliance(unit, alliance_b) UI = SM.GetUnitInterface('Eye 1') if (alliance_b == 2): UI.AddTask('Patrol', 2.0) unit.className = 'Su-27' unit.unitName = 'Red-1' unit.SetPosition(120.2, 25.1, 7500) # lon, lat, alt unit.heading = 120 unit.speed = 500 unit.throttle = 0.8 SM.AddUnitToAlliance(unit, alliance_b) UI = SM.GetUnitInterface(unit.unitName) if (alliance_b == 2): UI.AddTask('EngageAll', 2.0) ### Add goals for each side AddGoals(SM, alliance_a, alliance_b) def AddAirbase(SM, base_name, lon_deg, lat_deg, orientation_deg, alliance): unit = SM.GetDefaultUnit() unit.className = 'Airstrip' unit.unitName = base_name unit.SetPosition(lon_deg, lat_deg, 0) unit.heading = orientation_deg unit.speed = 0.0 SM.AddUnitToAlliance(unit, alliance) SM.AddToUnitMagazine(base_name, 'Fuel', 100000) # adds aircraft to base, attempts to add to fastest launch position first def AddAircraftToBase(SM, base_name, aircraft_class, root_name, quantity): for n in range(0, quantity): unitName = '%s-%d' % (root_name, n) # AddUnitToFlightDeck(<carrier name>,<unit class>,<name>, <location>) # <location>: 1 = HANGAR, 2 = DECK, 3 = CATAPULT/RUNWAY SM.AddUnitToFlightDeck(base_name, aircraft_class, unitName, 3) def AddGoals(SM, side_a, side_b): # alliance 1 goals goal_1 = SM.TimeGoal() goal_1.SetFailTimeout(1800) # 30 min time limit SM.SetAllianceGoal(side_a, goal_1) # alliance 2 goals goal_2 = SM.TimeGoal() goal_2.SetPassTimeout(1800) SM.SetAllianceGoal(side_b, goal_2) # BM is BriefingManager (same as ScenarioManager for now) object def CreateBriefing(BM): BM.SetEventTime(0) BM.Pause() BM.PauseAudio() BM.SetBriefingMode(1) # 0 - normal tactical display, 1 - briefing disp BM.Set3DMode(0) # 0 - off, 1 - small, 2 - med, 3 - full screen BM.ConsoleText('Briefing follows...') BM.Set3DMode(1) BM.SetBriefingMode(0) # leave briefing mode BM.PlayAudio('tension1',0) # name, seek time from beginning of song BM.Resume() # resumes game def AddOverlayGraphics(SM): SM.OverlayText('Taipei', 121.533, 25.083) # China airbases SM.OverlayText('Longtian AB', 119.417, 25.583) SM.OverlayText('Fuzhou AB', 119.367, 26.0167) SM.OverlayText('Chin Chiang AB', 118.583, 24.783) SM.OverlayText('Chang-Chou AB', 117.667, 24.583) SM.OverlayText('Shantou AB', 116.75, 23.417) SM.OverlayText('Mei-Xian AB', 116.133, 24.25) # Taiwan airbases SM.OverlayText('Cha Shan AB', 121.617, 24.0167) SM.OverlayText('Chiayi AB', 120.392778, 23.461667) SM.OverlayText('Ching Chuan Kang AB', 120.620556, 24.264444) SM.OverlayText('Hsinchu AB', 120.939167, 24.818056) SM.OverlayText('Pingtung AB North', 120.477778, 22.695278) SM.OverlayText('Pingtung AB South', 120.461667, 22.672222) SM.OverlayText('Tainan AB', 120.205556, 22.950278) SM.OverlayText('Taitung AB', 121.181944, 22.793056) |
|
From: Dewitt C. <ddc...@us...> - 2005-06-22 01:22:46
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2354/src/common Modified Files: simmath.cpp tcStream.cpp Log Message: Misc housekeeping, updates for infrared and anti-radiation seekers, more info for multiplayer airfield units, icon gui enhancements Index: simmath.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/simmath.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** simmath.cpp 6 May 2005 23:57:49 -0000 1.25 --- simmath.cpp 22 Jun 2005 01:22:04 -0000 1.26 *************** *** 23,28 **** --- 23,30 ---- #include "simmath.h" #include "nsNav.h" + #include "tcMapData.h" #include "common/tcStream.h" + void ConformLonLatRad(float &lon_rad, float &lat_rad) { if (lon_rad < -C_PI) {lon_rad = -C_PI;} *************** *** 328,331 **** --- 330,343 ---- return 1000.0f; } + else if (mnClassification & PTYPE_FIXED) + { + float terrain_height_m = + tcMapData::Get()->GetTerrainHeight(C_180OVERPI*mfLon_rad, C_180OVERPI*mfLat_rad, mfTimestamp); + return terrain_height_m + 5.0f; + } + else if (mnClassification & PTYPE_SUBSURFACE) + { + return -20.0f; + } else { *************** *** 422,425 **** --- 434,460 ---- } + /** + * copy track + */ + tcTrack& tcTrack::operator==(const tcTrack& src) + { + mfLon_rad = src.mfLon_rad; + mfLat_rad = src.mfLat_rad; + mfAlt_m = src.mfAlt_m; + mfSpeed_kts = src.mfSpeed_kts; + mfHeading_rad = src.mfHeading_rad; + mfClimbAngle_rad = src.mfClimbAngle_rad; + bearingRate_radps = src.bearingRate_radps; + mfTimestamp = src.mfTimestamp; + mnID = src.mnID; + mnPassivePlatformID = src.mnPassivePlatformID; + mnClassification = src.mnClassification; + mnAffiliation = src.mnAffiliation; + mnAlliance = src.mnAlliance; + mnFlags = src.mnFlags; + + return *this; + } + /******************************* tcTerrainInfo *******************************/ void tcTerrainInfo::Clear() { Index: tcStream.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/tcStream.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcStream.cpp 5 May 2005 02:14:51 -0000 1.10 --- tcStream.cpp 22 Jun 2005 01:22:07 -0000 1.11 *************** *** 173,176 **** --- 173,182 ---- } + tcStream& tcStream::operator<<(unsigned long& val) + { + write((char*)&val, sizeof(val)); + return *this; + } + tcStream& tcStream::operator<<(bool& val) { *************** *** 252,255 **** --- 258,267 ---- } + tcStream& tcStream::operator>>(unsigned long& val) + { + read((char*)&val, sizeof(val)); + return *this; + } + tcStream& tcStream::operator>>(bool& val) { |
|
From: Dewitt C. <ddc...@us...> - 2005-06-22 01:22:24
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2354/src/graphics Modified Files: tc3DViewer.cpp tcFlightPortGui.cpp tcGameView.cpp tcLauncherContainerItem.cpp tcMapView.cpp tcPlatformGui.cpp tcScenarioSelectView.cpp tcStoresContainerItem.cpp tcStoresGui.cpp Log Message: Misc housekeeping, updates for infrared and anti-radiation seekers, more info for multiplayer airfield units, icon gui enhancements Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapView.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** tcMapView.cpp 11 Jun 2005 21:01:44 -0000 1.27 --- tcMapView.cpp 22 Jun 2005 01:22:08 -0000 1.28 *************** *** 436,447 **** void tcTacticalMapView::DrawScaleBar() { ! float fKmPerPel, fKmScale; ! int nScaleBarWidth, nBarX1, nBarX2; - fKmPerPel = mfScaleX_radppel*C_RADTOKM; - // calculate closest power of 10 km dist that corresponds to (about) 100 pixels - fKmScale = expf(logf(10.0f)*floorf(log10f(fKmPerPel*120.0f))); - nScaleBarWidth = (int)(fKmScale*C_KMTORAD*mfScaleX_pelprad); tcString sText; --- 436,460 ---- void tcTacticalMapView::DrawScaleBar() { ! float fKmPerPel; ! int nBarX1, nBarX2; ! ! // faster, but this only works if only one tcTacticalMapView is instantiated ! // Move to private members ! static float lastScaleX = 0; ! static float fKmScale; ! static int nScaleBarWidth; ! ! if (mfScaleX_radppel != lastScaleX) ! { ! fKmPerPel = mfScaleX_radppel*C_RADTOKM; ! // calculate closest power of 10 km dist that corresponds to (about) 100 pixels ! fKmScale = expf(logf(10.0f)*floorf(log10f(fKmPerPel*180.0f))); ! nScaleBarWidth = (int)(fKmScale*C_KMTORAD*mfScaleX_pelprad); ! ! lastScaleX = mfScaleX_radppel; ! } ! tcString sText; Index: tcFlightPortGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcFlightPortGui.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcFlightPortGui.cpp 11 Jun 2005 21:01:44 -0000 1.1 --- tcFlightPortGui.cpp 22 Jun 2005 01:22:08 -0000 1.2 *************** *** 36,39 **** --- 36,40 ---- #include "tcPlatformGui.h" #include "tcPlatformObject.h" + #include "tcSimState.h" #ifdef _DEBUG *************** *** 50,54 **** tcGameObject* tcEntityContainerItem::GetEntity() const { ! return entity; } --- 51,63 ---- tcGameObject* tcEntityContainerItem::GetEntity() const { ! if (hostId == -1) ! { ! return tcSimState::Get()->GetObject(platformId); ! } ! ! tcGameObject* parent = tcSimState::Get()->GetObject(hostId); ! if (parent == 0) return 0; ! ! return parent->GetChildById(platformId); } *************** *** 63,74 **** } ! void tcEntityContainerItem::SetEntity(tcGameObject* obj) { ! entity = obj; } tcEntityContainerItem::tcEntityContainerItem() : description(""), ! entity(0) { } --- 72,85 ---- } ! void tcEntityContainerItem::SetEntity(long id, long host) { ! platformId = id; ! hostId = host; } tcEntityContainerItem::tcEntityContainerItem() : description(""), ! platformId(-1), ! hostId(-1) { } *************** *** 97,101 **** item->SetDescription(airState->obj->mzClass.mz); ! item->SetEntity(airState->obj); item->SetIcon(icon); item->SetId(reinterpret_cast<long>(airState)); --- 108,112 ---- item->SetDescription(airState->obj->mzClass.mz); ! item->SetEntity(airState->obj->mnID, platformId); item->SetIcon(icon); item->SetId(reinterpret_cast<long>(airState)); *************** *** 131,138 **** void tcFlightPortGui::Draw() { - if (FinishDestroy()) return; - if (drawCount++ % 4 != 0) return; // update draw every 4th frame UpdateGui(); --- 142,151 ---- void tcFlightPortGui::Draw() { if (drawCount++ % 4 != 0) return; // update draw every 4th frame + tcFlightPort* flightPort = GetFlightPort(); + if (flightPort == 0) DestroyGui(); + if (FinishDestroy()) return; + UpdateGui(); *************** *** 207,214 **** DrawBorder(); ! HideUnusedObjects(); } void tcFlightPortGui::HandleDrop(size_t slotIdx, tcContainerItem* item) { --- 220,236 ---- DrawBorder(); ! FinishDraw(); } + tcFlightPort* tcFlightPortGui::GetFlightPort() + { + tcFlightOpsObject* flightOps = + dynamic_cast<tcFlightOpsObject*>(tcSimState::Get()->GetObject(platformId)); + if (flightOps == 0) return 0; + + return flightOps->GetFlightPort(); + } + void tcFlightPortGui::HandleDrop(size_t slotIdx, tcContainerItem* item) { *************** *** 219,222 **** --- 241,247 ---- if (entityItem == 0) return; // only handle entity items + tcFlightPort* flightPort = GetFlightPort(); + if (flightPort == 0) return; + tcGameObject* entity = entityItem->GetEntity(); int unitIdx = flightPort->FindAirState(entity); *************** *** 242,247 **** void tcFlightPortGui::InitializeGui() { wxASSERT(flightPort); ! tcFlightportDBObject* databaseObj = flightPort->GetDatabaseObject(); wxASSERT(databaseObj); --- 267,274 ---- void tcFlightPortGui::InitializeGui() { + tcFlightPort* flightPort = GetFlightPort(); wxASSERT(flightPort); ! if (flightPort == 0) return; ! tcFlightportDBObject* databaseObj = flightPort->GetDatabaseObject(); wxASSERT(databaseObj); *************** *** 301,304 **** --- 328,334 ---- void tcFlightPortGui::OnRButtonDown(wxMouseEvent& event) { + tcFlightPort* flightPort = GetFlightPort(); + if (flightPort == 0) return; + wxPoint point = event.GetPosition(); *************** *** 351,355 **** wxPoint pos = wxWindow::GetPosition(); wxSize size = wxWindow::GetSize(); ! tcPlatformGui* gui = new tcPlatformGui(platform, wxPoint(pos.x, pos.y + size.GetHeight() + 10), "xml/platform_gui_default.xml"); wxASSERT(item); --- 381,385 ---- wxPoint pos = wxWindow::GetPosition(); wxSize size = wxWindow::GetSize(); ! tcPlatformGui* gui = new tcPlatformGui(platform->mnID, platformId, wxPoint(pos.x, pos.y + size.GetHeight() + 10), "xml/platform_gui_default.xml"); wxASSERT(item); *************** *** 420,423 **** --- 450,454 ---- } + /** * Update slot items based on flightPort state *************** *** 425,428 **** --- 456,462 ---- void tcFlightPortGui::UpdateGui() { + tcFlightPort* flightPort = GetFlightPort(); + if (flightPort == 0) return; + // mark all slots not updated for (size_t n=0; n<slots.size(); n++) *************** *** 432,437 **** size_t nextHangarIdx = hangarOffset; // slot idx for next hangar unit ! ! wxASSERT(flightPort); size_t nUnits = flightPort->GetCount(); for (size_t n=0; n<nUnits; n++) --- 466,470 ---- size_t nextHangarIdx = hangarOffset; // slot idx for next hangar unit ! size_t nUnits = flightPort->GetCount(); for (size_t n=0; n<nUnits; n++) *************** *** 508,521 **** * */ ! tcFlightPortGui::tcFlightPortGui(tcFlightPort* obj, const wxPoint& pos, const wxString& configFile) ! : tcContainerGui(pos, configFile, "FlightPortGui"), flightPort(obj) { ReadGuiParameters(); InitializeGui(); - - - SetActive(true); --- 541,552 ---- * */ ! tcFlightPortGui::tcFlightPortGui(long id, const wxPoint& pos, const wxString& configFile) ! : tcContainerGui(pos, configFile, "FlightPortGui"), ! platformId(id) { ReadGuiParameters(); InitializeGui(); SetActive(true); *************** *** 526,531 **** #endif - - } --- 557,560 ---- Index: tc3DViewer.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DViewer.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** tc3DViewer.cpp 1 Jun 2005 00:13:30 -0000 1.17 --- tc3DViewer.cpp 22 Jun 2005 01:22:08 -0000 1.18 *************** *** 1157,1161 **** wxASSERT(track); ! tc3DModel* model = track->GetModel(); if (model) { --- 1157,1161 ---- wxASSERT(track); ! tc3DModel* model = (track != 0) ? track->GetModel() : 0; if (model) { Index: tcScenarioSelectView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcScenarioSelectView.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcScenarioSelectView.cpp 8 May 2005 23:28:58 -0000 1.10 --- tcScenarioSelectView.cpp 22 Jun 2005 01:22:08 -0000 1.11 *************** *** 181,185 **** DrawTextR(item.caption.c_str(), item.drawBox.x + xIndent, item.drawBox.y + item.drawBox.height - 3, defaultFont.get(), ! color, 12.0f, LEFT_BASE_LINE); if (item.showChildren) --- 181,185 ---- DrawTextR(item.caption.c_str(), item.drawBox.x + xIndent, item.drawBox.y + item.drawBox.height - 3, defaultFont.get(), ! color, fontSizeDirectory, LEFT_BASE_LINE); if (item.showChildren) *************** *** 192,196 **** DrawTextR(item.caption.c_str(), item.drawBox.x, item.drawBox.y + item.drawBox.height - 3, ! defaultFont.get(), color, 11.0f, LEFT_BASE_LINE); } --- 192,196 ---- DrawTextR(item.caption.c_str(), item.drawBox.x, item.drawBox.y + item.drawBox.height - 3, ! defaultFont.get(), color, fontSizeScenario, LEFT_BASE_LINE); } *************** *** 484,490 **** xStart(55), xWidth(120), ! yHeight(16), ! yHeightDir(24), yStart(220), basePosition(xStart, yStart), loadedScenarioCaption("") --- 484,492 ---- xStart(55), xWidth(120), ! yHeight(24), ! yHeightDir(32), yStart(220), + fontSizeDirectory(15.0), + fontSizeScenario(13.0), basePosition(xStart, yStart), loadedScenarioCaption("") Index: tcStoresGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcStoresGui.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcStoresGui.cpp 12 Jun 2005 20:46:58 -0000 1.2 --- tcStoresGui.cpp 22 Jun 2005 01:22:08 -0000 1.3 *************** *** 36,39 **** --- 36,40 ---- #include "tcLauncherContainerItem.h" #include "tcLauncher.h" + #include "tcSimState.h" #ifdef _DEBUG *************** *** 47,52 **** */ void tcStoresGui::AddOrUpdateItem(tcContainerSlot& slot, const std::string& itemName, ! unsigned int quantity) { tcStoresContainerItem* item = dynamic_cast<tcStoresContainerItem*>(slot.GetItem()); --- 48,55 ---- */ void tcStoresGui::AddOrUpdateItem(tcContainerSlot& slot, const std::string& itemName, ! unsigned int quantity, tcStores* stores) { + wxASSERT(stores); + tcStoresContainerItem* item = dynamic_cast<tcStoresContainerItem*>(slot.GetItem()); *************** *** 67,71 **** item->SetItemName(itemName); item->SetQuantity(quantity); ! item->SetStores(stores); } else --- 70,74 ---- item->SetItemName(itemName); item->SetQuantity(quantity); ! item->SetStores(platformId, hostId, storesIdx); } else *************** *** 80,86 **** void tcStoresGui::Draw() { if (FinishDestroy()) return; - if (drawCount++ % 4 != 0) return; // update draw every 4th frame UpdateGui(); --- 83,92 ---- void tcStoresGui::Draw() { + if (drawCount++ % 4 != 0) return; // update draw every 4th frame + + tcStores* stores = GetStores(); + if (stores == 0) DestroyGui(); if (FinishDestroy()) return; UpdateGui(); *************** *** 154,162 **** DrawBorder(); ! HideUnusedObjects(); } /** * Handles two cases: * - Transfer of item from one tcStores to this tcStores --- 160,193 ---- DrawBorder(); ! FinishDraw(); } /** + * @return pointer to stores object + * This is done dynamically to handle case where object is deleted + */ + tcStores* tcStoresGui::GetStores() + { + tcPlatformObject* platform = 0; + + if (hostId == -1) + { + platform = dynamic_cast<tcPlatformObject*> + (tcSimState::Get()->GetObject(platformId)); + } + else + { + tcGameObject* parent = tcSimState::Get()->GetObject(hostId); + if (parent == 0) return 0; + platform = dynamic_cast<tcPlatformObject*>(parent->GetChildById(platformId)); + } + + if (platform == 0) return 0; + + return platform->GetMagazine(storesIdx); + } + + /** * Handles two cases: * - Transfer of item from one tcStores to this tcStores *************** *** 165,168 **** --- 196,202 ---- void tcStoresGui::HandleDrop(size_t slotIdx, tcContainerItem* item) { + tcStores* stores = GetStores(); + if (stores == 0) return; + tcStoresContainerItem* storesItem = dynamic_cast<tcStoresContainerItem*>(item); if (storesItem) *************** *** 187,192 **** void tcStoresGui::InitializeGui() { wxASSERT(stores); ! tcStoresDBObject* databaseObj = stores->GetDatabaseObject(); wxASSERT(databaseObj); --- 221,228 ---- void tcStoresGui::InitializeGui() { + tcStores* stores = GetStores(); wxASSERT(stores); ! if (stores == 0) return; ! tcStoresDBObject* databaseObj = stores->GetDatabaseObject(); wxASSERT(databaseObj); *************** *** 270,273 **** --- 306,312 ---- void tcStoresGui::UpdateGui() { + tcStores* stores = GetStores(); + if (stores == 0) return; + // mark all slots not updated for (size_t n=0; n<slots.size(); n++) *************** *** 276,280 **** } ! wxASSERT(stores); size_t nTypes = stores->GetNumberItemTypes(); for (size_t n=0; (n<nTypes)&&(n<slots.size()); n++) --- 315,319 ---- } ! size_t nTypes = stores->GetNumberItemTypes(); for (size_t n=0; (n<nTypes)&&(n<slots.size()); n++) *************** *** 285,289 **** unsigned int itemQuantity = stores->CurrentItemQuantity(itemName); ! AddOrUpdateItem(slot, itemName, itemQuantity); slot.SetUpdated(true); } --- 324,328 ---- unsigned int itemQuantity = stores->CurrentItemQuantity(itemName); ! AddOrUpdateItem(slot, itemName, itemQuantity, stores); slot.SetUpdated(true); } *************** *** 303,316 **** * */ ! tcStoresGui::tcStoresGui(tcStores* obj, const wxPoint& pos, const wxString& configFile) ! : tcContainerGui(pos, configFile, "StoresGui"), stores(obj) { ReadGuiParameters(); InitializeGui(); - - - SetActive(true); --- 342,355 ---- * */ ! tcStoresGui::tcStoresGui(long id, long host, unsigned int idx, const wxPoint& pos, const wxString& configFile) ! : tcContainerGui(pos, configFile, "StoresGui"), ! platformId(id), ! hostId(host), ! storesIdx(idx) { ReadGuiParameters(); InitializeGui(); SetActive(true); Index: tcGameView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcGameView.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcGameView.cpp 1 Jun 2005 00:13:30 -0000 1.10 --- tcGameView.cpp 22 Jun 2005 01:22:08 -0000 1.11 *************** *** 502,508 **** } } ! else if ((pMissileObj != NULL)&&(pMissileObj->GetAlliance() == nOwnAlliance)) { ! bShowTarget = mpSS->GetSeekerTrack(mnHookID,track) != 0; } --- 502,512 ---- } } ! else if ((pMissileObj != 0)&&(pMissileObj->GetAlliance() == nOwnAlliance)) { ! tcSensorState* sensor = pMissileObj->GetSeekerSensor(); ! if (sensor != 0) ! { ! bShowTarget = sensor->GetTrack(track); ! } } Index: tcPlatformGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcPlatformGui.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcPlatformGui.cpp 12 Jun 2005 20:46:58 -0000 1.2 --- tcPlatformGui.cpp 22 Jun 2005 01:22:08 -0000 1.3 *************** *** 38,41 **** --- 38,42 ---- #include "tcLauncher.h" #include "tcLauncherContainerItem.h" + #include "tcSimState.h" #include "tcStoresContainerItem.h" #include "tcStoresGui.h" *************** *** 72,76 **** std::string itemName = child->mzClass.mz; item->SetItemName(itemName); ! item->SetLauncher(launcher, launcherIdx); item->SetQuantity(quantity); --- 73,77 ---- std::string itemName = child->mzClass.mz; item->SetItemName(itemName); ! item->SetLauncher(platformId, hostId, launcherIdx); item->SetQuantity(quantity); *************** *** 96,103 **** void tcPlatformGui::Draw() { - if (FinishDestroy()) return; - if (drawCount++ % 4 != 0) return; // update draw every 4th frame UpdateGui(); --- 97,106 ---- void tcPlatformGui::Draw() { if (drawCount++ % 4 != 0) return; // update draw every 4th frame + tcPlatformObject* platform = GetPlatform(); + if (platform == 0) DestroyGui(); + if (FinishDestroy()) return; + UpdateGui(); *************** *** 161,165 **** else if (n < nLaunchers) { ! GetLauncherCompatibilityCaption(n, caption); } else --- 164,168 ---- else if (n < nLaunchers) { ! GetLauncherCompatibilityCaption(n, caption, platform); } else *************** *** 214,225 **** DrawBorder(); ! HideUnusedObjects(); } /** * Creates caption that describes compatible items for launcher */ ! void tcPlatformGui::GetLauncherCompatibilityCaption(unsigned int launcherIdx, wxString& caption) { caption = ""; --- 217,233 ---- DrawBorder(); ! FinishDraw(); } + tcFlightOpsObject* tcPlatformGui::GetFlightOps() + { + return dynamic_cast<tcFlightOpsObject*>(tcSimState::Get()->GetObject(platformId)); + } + /** * Creates caption that describes compatible items for launcher */ ! void tcPlatformGui::GetLauncherCompatibilityCaption(unsigned int launcherIdx, wxString& caption, tcPlatformObject* platform) { caption = ""; *************** *** 237,240 **** --- 245,261 ---- } + tcPlatformObject* tcPlatformGui::GetPlatform() + { + if (hostId == -1) + { + return dynamic_cast<tcPlatformObject*>(tcSimState::Get()->GetObject(platformId)); + } + + tcGameObject* parent = tcSimState::Get()->GetObject(hostId); + if (parent == 0) return 0; + + return dynamic_cast<tcPlatformObject*>(parent->GetChildById(platformId)); + } + void tcPlatformGui::HandleDrop(size_t slotIdx, tcContainerItem* item) { *************** *** 248,251 **** --- 269,275 ---- } + tcPlatformObject* platform = GetPlatform(); + if (platform == 0) return; + if (slotIdx >= nLaunchers) return; // only accept drops to launchers *************** *** 254,260 **** tcStores* magazine = storesItem->GetStores(); ! magazine->LoadLauncher(slotIdx, storesItem->GetItemName(), platform); ! tcSound::Get()->PlayEffect("Thuck"); } --- 278,287 ---- tcStores* magazine = storesItem->GetStores(); ! if (magazine) ! { ! magazine->LoadLauncher(slotIdx, storesItem->GetItemName(), platform); ! tcSound::Get()->PlayEffect("Thuck"); ! } } *************** *** 266,272 **** tcStores* stores = item->GetStores(); - wxASSERT(stores); if (stores == 0) return; stores->LoadOther(itemName, platform); --- 293,301 ---- tcStores* stores = item->GetStores(); if (stores == 0) return; + tcPlatformObject* platform = GetPlatform(); + if (platform == 0) return; + stores->LoadOther(itemName, platform); *************** *** 276,280 **** --- 305,311 ---- void tcPlatformGui::InitializeGui() { + tcPlatformObject* platform = GetPlatform(); wxASSERT(platform); + if (platform == 0) return; // add launcher slots *************** *** 302,306 **** // add flightport slot if applicable ! flightOps = dynamic_cast<tcFlightOpsObject*>(platform); flightPortIdx = nLaunchers + nMagazines; if (flightOps != 0) --- 333,337 ---- // add flightport slot if applicable ! tcFlightOpsObject* flightOps = GetFlightOps(); flightPortIdx = nLaunchers + nMagazines; if (flightOps != 0) *************** *** 393,403 **** void tcPlatformGui::OpenFlightPortGui(tcContainerItem* item) { if (flightOps == 0) return; tcFlightPort* flightPort = flightOps->GetFlightPort(); if (flightPort == 0) return; wxPoint pos = wxWindow::GetPosition(); wxSize size = wxWindow::GetSize(); ! tcFlightPortGui* gui = new tcFlightPortGui(flightPort, wxPoint(pos.x, pos.y + size.GetHeight() + 10), "xml/flightport_gui_default.xml"); wxASSERT(item); --- 424,439 ---- void tcPlatformGui::OpenFlightPortGui(tcContainerItem* item) { + tcFlightOpsObject* flightOps = GetFlightOps(); if (flightOps == 0) return; tcFlightPort* flightPort = flightOps->GetFlightPort(); if (flightPort == 0) return; + tcPlatformObject* platform = GetPlatform(); + wxASSERT(platform != 0); + if (platform == 0) return; + 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); *************** *** 411,414 **** --- 447,453 ---- void tcPlatformGui::OpenMagazineGui(unsigned int idx, tcContainerItem* item) { + tcPlatformObject* platform = GetPlatform(); + if (platform == 0) return; + tcStores* magazine = platform->GetMagazine(idx); if (magazine) *************** *** 416,420 **** wxPoint pos = wxWindow::GetPosition(); wxSize size = wxWindow::GetSize(); ! tcStoresGui* gui = new tcStoresGui(magazine, wxPoint(pos.x + size.GetWidth() + 10, pos.y), "xml/stores_gui_default.xml"); wxASSERT(item); --- 455,459 ---- wxPoint pos = wxWindow::GetPosition(); 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); *************** *** 503,506 **** --- 542,548 ---- void tcPlatformGui::UpdateGui() { + tcPlatformObject* platform = GetPlatform(); + if (platform == 0) return; + // mark all slots not updated for (size_t n=0; n<slots.size(); n++) *************** *** 598,604 **** * */ ! tcPlatformGui::tcPlatformGui(tcPlatformObject* obj, const wxPoint& pos, const wxString& configFile) ! : tcContainerGui(pos, configFile, "PlatformGui"), platform(obj) { ReadGuiParameters(); --- 640,648 ---- * */ ! tcPlatformGui::tcPlatformGui(long id, long host, const wxPoint& pos, const wxString& configFile) ! : tcContainerGui(pos, configFile, "PlatformGui"), ! platformId(id), ! hostId(host) { ReadGuiParameters(); Index: tcStoresContainerItem.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcStoresContainerItem.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcStoresContainerItem.cpp 11 Jun 2005 21:01:44 -0000 1.1 --- tcStoresContainerItem.cpp 22 Jun 2005 01:22:08 -0000 1.2 *************** *** 28,32 **** #include "tcStoresContainerItem.h" ! #ifdef _DEBUG --- 28,33 ---- #include "tcStoresContainerItem.h" ! #include "tcSimState.h" ! #include "tcPlatformObject.h" #ifdef _DEBUG *************** *** 35,51 **** ! tcStores* tcStoresContainerItem::GetStores() const { ! return parent; } ! void tcStoresContainerItem::SetStores(tcStores* stores) { ! parent = stores; } tcStoresContainerItem::tcStoresContainerItem() ! : parent(0) { } --- 36,75 ---- ! /** ! * @return pointer to stores object ! * This is done dynamically to handle case where object is deleted ! */ tcStores* tcStoresContainerItem::GetStores() const { ! tcPlatformObject* platform = 0; ! ! if (hostId == -1) ! { ! platform = dynamic_cast<tcPlatformObject*> ! (tcSimState::Get()->GetObject(platformId)); ! } ! else ! { ! tcGameObject* parent = tcSimState::Get()->GetObject(hostId); ! if (parent == 0) return 0; ! platform = dynamic_cast<tcPlatformObject*>(parent->GetChildById(platformId)); ! } ! ! if (platform == 0) return 0; ! ! return platform->GetMagazine(storesIdx); } ! void tcStoresContainerItem::SetStores(long id, long host, unsigned int idx) { ! platformId = id; ! hostId = host; ! storesIdx = idx; } tcStoresContainerItem::tcStoresContainerItem() ! : platformId(-1), ! hostId(-1), ! storesIdx(0) { } Index: tcLauncherContainerItem.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcLauncherContainerItem.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcLauncherContainerItem.cpp 11 Jun 2005 21:01:44 -0000 1.1 --- tcLauncherContainerItem.cpp 22 Jun 2005 01:22:08 -0000 1.2 *************** *** 28,32 **** #include "tcLauncherContainerItem.h" ! #ifdef _DEBUG --- 28,33 ---- #include "tcLauncherContainerItem.h" ! #include "tcPlatformObject.h" ! #include "tcSimState.h" #ifdef _DEBUG *************** *** 37,41 **** tcLauncher* tcLauncherContainerItem::GetLauncher() const { ! return parent; } --- 38,58 ---- tcLauncher* tcLauncherContainerItem::GetLauncher() const { ! tcPlatformObject* platform = 0; ! ! if (hostId == -1) ! { ! platform = dynamic_cast<tcPlatformObject*> ! (tcSimState::Get()->GetObject(platformId)); ! } ! else ! { ! tcGameObject* parent = tcSimState::Get()->GetObject(hostId); ! if (parent == 0) return 0; ! platform = dynamic_cast<tcPlatformObject*>(parent->GetChildById(platformId)); ! } ! ! if (platform == 0) return 0; ! ! return platform->GetLauncher(launcherIdx); } *************** *** 45,51 **** } ! void tcLauncherContainerItem::SetLauncher(tcLauncher* launcher, unsigned int idx) { ! parent = launcher; launcherIdx = idx; } --- 62,69 ---- } ! void tcLauncherContainerItem::SetLauncher(long id, long host, unsigned int idx) { ! platformId = id; ! hostId = host; launcherIdx = idx; } *************** *** 53,57 **** tcLauncherContainerItem::tcLauncherContainerItem() ! : parent(0), launcherIdx(0) { --- 71,76 ---- tcLauncherContainerItem::tcLauncherContainerItem() ! : platformId(-1), ! hostId(-1), launcherIdx(0) { |
|
From: Dewitt C. <ddc...@us...> - 2005-06-22 01:22:24
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2354/src/database Modified Files: tcDatabase.cpp tcMissileDBObject.cpp tcSensorDBObject.cpp Log Message: Misc housekeeping, updates for infrared and anti-radiation seekers, more info for multiplayer airfield units, icon gui enhancements Index: tcMissileDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcMissileDBObject.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcMissileDBObject.cpp 1 Jun 2005 00:13:29 -0000 1.18 --- tcMissileDBObject.cpp 22 Jun 2005 01:22:08 -0000 1.19 *************** *** 66,82 **** } ! long tcMissileDBObject::GetPrimarySeekerKey() { wxASSERT(database); ! if (primarySeekerKey != NULL_INDEX) return primarySeekerKey; ! primarySeekerKey = database->GetKey(maSensorClass[0]); // do not report error for missiles with no sensor (e.g. some AGMs) ! if ((primarySeekerKey == NULL_INDEX) && (strlen(maSensorClass[0].mz) > 0)) { ! fprintf(stderr, "tcMissileDBObject::GetPrimarySeekerKey -- not found " ! "(%s)\n", maSensorClass[0].mz); } ! return primarySeekerKey; } --- 66,82 ---- } ! long tcMissileDBObject::GetSensorKey() { wxASSERT(database); ! if (sensorKey != NULL_INDEX) return sensorKey; ! sensorKey = database->GetKey(maSensorClass); // do not report error for missiles with no sensor (e.g. some AGMs) ! if ((sensorKey == NULL_INDEX) && (strlen(maSensorClass.mz) > 0)) { ! fprintf(stderr, "tcMissileDBObject::GetSensorKey -- not found " ! "(%s)\n", maSensorClass.mz); } ! return sensorKey; } *************** *** 88,92 **** if (seekerFOV_rad >= 0) return seekerFOV_rad; ! long seekerKey = GetPrimarySeekerKey(); tcDatabaseObject* obj = database->GetObject(seekerKey); if (tcSensorDBObject* sensor = dynamic_cast<tcSensorDBObject*>(obj)) --- 88,92 ---- if (seekerFOV_rad >= 0) return seekerFOV_rad; ! long seekerKey = GetSensorKey(); tcDatabaseObject* obj = database->GetObject(seekerKey); if (tcSensorDBObject* sensor = dynamic_cast<tcSensorDBObject*>(obj)) *************** *** 115,119 **** unsigned int nEmitters = emitters.size(); ! long seekerKey = GetPrimarySeekerKey(); for (unsigned int k=0; k<nEmitters; k++) --- 115,119 ---- unsigned int nEmitters = emitters.size(); ! long seekerKey = GetSensorKey(); for (unsigned int k=0; k<nEmitters; k++) *************** *** 127,130 **** --- 127,138 ---- /** + * @return true if this missile relies on a fire control sensor from the parent platform for any of its guidance + */ + bool tcMissileDBObject::NeedsFireControl() const + { + return needsFireControl; + } + + /** * workaround for write serialization issue * @return true if db obj is a leaf obj *************** *** 170,175 **** file.Read(&mfRange_km,sizeof(mfRange_km)); file.Read(&mfShutdownSpeed_mps,sizeof(mfShutdownSpeed_mps)); ! maSensorClass[0].Serialize(file,mbLoad); ! maSensorClass[1].Serialize(file,mbLoad); file.Read(&mnNumSegments,sizeof(mnNumSegments)); if (mnNumSegments > MAX_MISSILE_FLIGHT_SEGMENTS) --- 178,182 ---- file.Read(&mfRange_km,sizeof(mfRange_km)); file.Read(&mfShutdownSpeed_mps,sizeof(mfShutdownSpeed_mps)); ! maSensorClass.Serialize(file,mbLoad); file.Read(&mnNumSegments,sizeof(mnNumSegments)); if (mnNumSegments > MAX_MISSILE_FLIGHT_SEGMENTS) *************** *** 203,208 **** file.Write(&mfRange_km,sizeof(mfRange_km)); file.Write(&mfShutdownSpeed_mps,sizeof(mfShutdownSpeed_mps)); ! maSensorClass[0].Serialize(file,mbLoad); ! maSensorClass[1].Serialize(file,mbLoad); file.Write(&mnNumSegments,sizeof(mnNumSegments)); for(unsigned i=0;i<mnNumSegments;i++) { --- 210,214 ---- file.Write(&mfRange_km,sizeof(mfRange_km)); file.Write(&mfShutdownSpeed_mps,sizeof(mfShutdownSpeed_mps)); ! maSensorClass.Serialize(file,mbLoad); file.Write(&mnNumSegments,sizeof(mnNumSegments)); for(unsigned i=0;i<mnNumSegments;i++) { *************** *** 240,245 **** *csv >> mfRange_km; *csv >> mfShutdownSpeed_mps; ! *csv >> s; maSensorClass[0] = s.c_str(); ! *csv >> s; maSensorClass[1] = s.c_str(); mnNumSegments = 0; for(unsigned i=0;i<MAX_MISSILE_FLIGHT_SEGMENTS;i++) --- 246,251 ---- *csv >> mfRange_km; *csv >> mfShutdownSpeed_mps; ! *csv >> s; maSensorClass = s.c_str(); ! mnNumSegments = 0; for(unsigned i=0;i<MAX_MISSILE_FLIGHT_SEGMENTS;i++) *************** *** 262,266 **** // set other params that do not come from database file ! primarySeekerKey = NULL_INDEX; } else --- 268,272 ---- // set other params that do not come from database file ! sensorKey = NULL_INDEX; } else *************** *** 285,290 **** *csv << mfRange_km; *csv << mfShutdownSpeed_mps; ! *csv << std::string(maSensorClass[0].mz); ! *csv << std::string(maSensorClass[1].mz); for(unsigned i=0;i<MAX_MISSILE_FLIGHT_SEGMENTS;i++) { --- 291,296 ---- *csv << mfRange_km; *csv << mfShutdownSpeed_mps; ! *csv << std::string(maSensorClass.mz); ! for(unsigned i=0;i<MAX_MISSILE_FLIGHT_SEGMENTS;i++) { *************** *** 340,345 **** localNode->SetAttribute("range_km", mfRange_km); localNode->SetAttribute("shutdownSpeed_mps", mfShutdownSpeed_mps); ! localNode->SetAttribute("primarySensor", maSensorClass[0].mz); ! localNode->SetAttribute("secondarySensor", maSensorClass[1].mz); for(unsigned int i=0;(i<mnNumSegments)&&(i<MAX_MISSILE_FLIGHT_SEGMENTS);i++) --- 346,350 ---- localNode->SetAttribute("range_km", mfRange_km); localNode->SetAttribute("shutdownSpeed_mps", mfShutdownSpeed_mps); ! localNode->SetAttribute("primarySensor", maSensorClass.mz); for(unsigned int i=0;(i<mnNumSegments)&&(i<MAX_MISSILE_FLIGHT_SEGMENTS);i++) *************** *** 428,433 **** columnString += "Range_km number(5),"; columnString += "ShutdownSpeed_mps number(5),"; ! columnString += "SensorClass1 varchar(30),"; ! columnString += "SensorClass2 varchar(30),"; for(unsigned i=0;i<MAX_MISSILE_FLIGHT_SEGMENTS;i++) --- 433,438 ---- columnString += "Range_km number(5),"; columnString += "ShutdownSpeed_mps number(5),"; ! columnString += "SensorClass varchar(30),"; ! columnString += "NeedsFireControl number(1),"; for(unsigned i=0;i<MAX_MISSILE_FLIGHT_SEGMENTS;i++) *************** *** 475,480 **** mfRange_km = entry.GetDouble("Range_km"); mfShutdownSpeed_mps = entry.GetDouble("ShutdownSpeed_mps"); ! maSensorClass[0] = entry.GetString("SensorClass1").c_str(); ! maSensorClass[1] = entry.GetString("SensorClass2").c_str(); mnNumSegments = 0; --- 480,485 ---- mfRange_km = entry.GetDouble("Range_km"); mfShutdownSpeed_mps = entry.GetDouble("ShutdownSpeed_mps"); ! maSensorClass = entry.GetString("SensorClass").c_str(); ! needsFireControl = entry.GetInt("NeedsFireControl") != 0; mnNumSegments = 0; *************** *** 500,504 **** // set other params that do not come from database file ! primarySeekerKey = NULL_INDEX; } --- 505,509 ---- // set other params that do not come from database file ! sensorKey = NULL_INDEX; } *************** *** 529,534 **** s << mfRange_km << ","; s << mfShutdownSpeed_mps << ","; ! s << "'" << std::string(maSensorClass[0].mz) << "',"; ! s << "'" << std::string(maSensorClass[1].mz) << "',"; for(unsigned i=0;i<MAX_MISSILE_FLIGHT_SEGMENTS;i++) --- 534,539 ---- s << mfRange_km << ","; s << mfShutdownSpeed_mps << ","; ! s << "'" << std::string(maSensorClass.mz) << "',"; ! s << needsFireControl << ","; for(unsigned i=0;i<MAX_MISSILE_FLIGHT_SEGMENTS;i++) *************** *** 587,592 **** mfRange_km = obj.mfRange_km; ! maSensorClass[0] = obj.maSensorClass[0]; ! maSensorClass[1] = obj.maSensorClass[1]; mnNumSegments = obj.mnNumSegments; --- 592,597 ---- mfRange_km = obj.mfRange_km; ! maSensorClass = obj.maSensorClass; ! needsFireControl = obj.needsFireControl; mnNumSegments = obj.mnNumSegments; *************** *** 595,599 **** maFlightProfile[i] = obj.maFlightProfile[i]; } ! primarySeekerKey = NULL_INDEX; } --- 600,604 ---- maFlightProfile[i] = obj.maFlightProfile[i]; } ! sensorKey = NULL_INDEX; } *************** *** 625,630 **** mfRange_km = 123.4f; // sensor info ! maSensorClass[0] = ""; ! maSensorClass[1] = ""; // flight profile, array of flight segment info mnNumSegments = 1; --- 630,636 ---- mfRange_km = 123.4f; // sensor info ! maSensorClass = ""; ! needsFireControl = false; ! // flight profile, array of flight segment info mnNumSegments = 1; *************** *** 633,637 **** maFlightProfile[0].meAltitudeMode = AM_ASL; maFlightProfile[0].meGuidanceMode = GM_COMMAND; ! primarySeekerKey = NULL_INDEX; } --- 639,643 ---- maFlightProfile[0].meAltitudeMode = AM_ASL; maFlightProfile[0].meGuidanceMode = GM_COMMAND; ! sensorKey = NULL_INDEX; } Index: tcSensorDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcSensorDBObject.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcSensorDBObject.cpp 1 Jun 2005 00:13:29 -0000 1.12 --- tcSensorDBObject.cpp 22 Jun 2005 01:22:08 -0000 1.13 *************** *** 191,216 **** ! tcSensorDBObject::tcSensorDBObject() : tcDatabaseObject() { mzClass = "Default Sensor"; mnClassID = DTYPE_SENSOR; ! mfMaxRange_km = 100.0f; ! mfRefRange_km = 80.0f; ! mfFieldOfView_deg = 360.0f; ! mfScanPeriod_s = 4.0f; ! isSurveillance = true; } tcSensorDBObject::tcSensorDBObject(tcSensorDBObject& obj) ! : tcDatabaseObject(obj) { mnClassID = DTYPE_SENSOR; - - mfMaxRange_km = obj.mfMaxRange_km; - mfRefRange_km = obj.mfRefRange_km; - mfFieldOfView_deg = obj.mfFieldOfView_deg; - mfScanPeriod_s = obj.mfScanPeriod_s; - isSurveillance = obj.isSurveillance; } --- 191,216 ---- ! tcSensorDBObject::tcSensorDBObject() : tcDatabaseObject(), ! mfMaxRange_km(100.0f), ! mfRefRange_km(80.0f), ! mfFieldOfView_deg(360.0f), ! mfScanPeriod_s(4.0f), ! isSurveillance(true) { mzClass = "Default Sensor"; mnClassID = DTYPE_SENSOR; ! } tcSensorDBObject::tcSensorDBObject(tcSensorDBObject& obj) ! : tcDatabaseObject(obj), ! mfMaxRange_km(obj.mfMaxRange_km), ! mfRefRange_km(obj.mfRefRange_km), ! mfFieldOfView_deg(obj.mfFieldOfView_deg), ! mfScanPeriod_s(obj.mfScanPeriod_s), ! isSurveillance(obj.isSurveillance) { mnClassID = DTYPE_SENSOR; } Index: tcDatabase.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcDatabase.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** tcDatabase.cpp 12 Jun 2005 20:46:57 -0000 1.28 --- tcDatabase.cpp 22 Jun 2005 01:22:07 -0000 1.29 *************** *** 520,736 **** } - void tcDatabase::CreateDefaultDB() { - tnPoolIndex nKey; - tcGenericDBObject *pgeneric; - tcLauncherDBObject *plauncher; - - int nResult; - - mcObjectData.RemoveAll(); - - pgeneric = new tcGenericDBObject; - strcpy(pgeneric->mzClass.mz,"Destroyer"); - pgeneric->mfMaxSpeed_kts = 30; - pgeneric->mfAccel_ktsps = 1; - pgeneric->mfTurnRate_degps = 2; - pgeneric->mnType = PTYPE_LARGESURFACE; - pgeneric->mnModelType = MTYPE_SURFACE; - mcObjectData.AddElement(pgeneric,nKey); - pgeneric->mnKey = nKey; - - pgeneric = new tcGenericDBObject; - strcpy(pgeneric->mzClass.mz,"Cruiser"); - pgeneric->mfMaxSpeed_kts = 32; - pgeneric->mfAccel_ktsps = 1; - pgeneric->mfTurnRate_degps = 1; - pgeneric->mnType = PTYPE_LARGESURFACE; - pgeneric->mnModelType = MTYPE_SURFACE; - pgeneric->mnNumLaunchers = 1; - pgeneric->maLauncherClass[0] = "ML1"; - mcObjectData.AddElement(pgeneric,nKey); - pgeneric->mnKey = nKey; - - pgeneric = new tcGenericDBObject; - strcpy(pgeneric->mzClass.mz,"Patrol Boat"); - pgeneric->mfMaxSpeed_kts = 50; - pgeneric->mfAccel_ktsps = 2; - pgeneric->mfTurnRate_degps = 5; - pgeneric->mnType = PTYPE_SMALLSURFACE; - pgeneric->mnModelType = MTYPE_SURFACE; - mcObjectData.AddElement(pgeneric,nKey); - pgeneric->mnKey = nKey; - - pgeneric = new tcGenericDBObject; - strcpy(pgeneric->mzClass.mz,"Aircraft"); - pgeneric->mfMaxSpeed_kts = 500; - pgeneric->mfAccel_ktsps = 10; - pgeneric->mfTurnRate_degps = 20; - pgeneric->mnType = PTYPE_FIXEDWING; - pgeneric->mnModelType = MTYPE_AIR; - mcObjectData.AddElement(pgeneric,nKey); - pgeneric->mnKey = nKey; - - pgeneric = new tcGenericDBObject; - strcpy(pgeneric->mzClass.mz,"Missile"); - pgeneric->mfMaxSpeed_kts = 1400; - pgeneric->mfAccel_ktsps = 100; - pgeneric->mfTurnRate_degps = 30; - pgeneric->mfAltitudeRate_mps = 20.0f; - pgeneric->mnType = PTYPE_MISSILE; - pgeneric->mnModelType = MTYPE_MISSILE; - pgeneric->mnNumLaunchers = 0; - pgeneric->maLauncherClass[0] = "NONE"; - mcObjectData.AddElement(pgeneric,nKey); - pgeneric->mnKey = nKey; - - pgeneric = new tcGenericDBObject; - strcpy(pgeneric->mzClass.mz,"Missile2"); - pgeneric->mfMaxSpeed_kts = 1400; - pgeneric->mfAccel_ktsps = 100; - pgeneric->mfTurnRate_degps = 30; - pgeneric->mnType = PTYPE_MISSILE; - pgeneric->mnModelType = MTYPE_MISSILE; - pgeneric->mnNumLaunchers = 0; - pgeneric->maLauncherClass[0] = "NONE"; - mcObjectData.AddElement(pgeneric,nKey); - pgeneric->mnKey = nKey; - - pgeneric = new tcGenericDBObject; - strcpy(pgeneric->mzClass.mz,"Carrier 1"); - pgeneric->mfMaxSpeed_kts = 29; - pgeneric->mfAccel_ktsps = 2; - pgeneric->mfTurnRate_degps = 1; - pgeneric->mnType = PTYPE_LARGESURFACE; - pgeneric->mnModelType = MTYPE_SURFACE; - mcObjectData.AddElement(pgeneric,nKey); - pgeneric->mnKey = nKey; - - pgeneric = new tcGenericDBObject; - strcpy(pgeneric->mzClass.mz,"Submarine 1"); - pgeneric->mfMaxSpeed_kts = 35; - pgeneric->mfAccel_ktsps = 2; - pgeneric->mfTurnRate_degps = 1; - pgeneric->mnType = PTYPE_SUBMARINE; - pgeneric->mnModelType = MTYPE_SUBMARINE; - mcObjectData.AddElement(pgeneric,nKey); - pgeneric->mnKey = nKey; - - pgeneric = new tcGenericDBObject; - strcpy(pgeneric->mzClass.mz,"Torpedo 1"); - pgeneric->mfMaxSpeed_kts = 42; - pgeneric->mfAccel_ktsps = 2; - pgeneric->mfTurnRate_degps = 1; - pgeneric->mnType = PTYPE_TORPEDO; - pgeneric->mnModelType = MTYPE_TORPEDO; - mcObjectData.AddElement(pgeneric,nKey); - pgeneric->mnKey = nKey; - - pgeneric = new tcGenericDBObject; - strcpy(pgeneric->mzClass.mz,"Helo 1"); - pgeneric->mfMaxSpeed_kts = 150; - pgeneric->mfAccel_ktsps = 2; - pgeneric->mfTurnRate_degps = 5; - pgeneric->mnType = PTYPE_HELO; - pgeneric->mnModelType = MTYPE_HELO; - mcObjectData.AddElement(pgeneric,nKey); - pgeneric->mnKey = nKey; - - pgeneric = new tcGenericDBObject; - strcpy(pgeneric->mzClass.mz,"Fixed Wing 1"); - pgeneric->mfMaxSpeed_kts = 350; - pgeneric->mfAccel_ktsps = 5; - pgeneric->mfTurnRate_degps = 7; - pgeneric->mnType = PTYPE_FIXEDWING; - pgeneric->mnModelType = MTYPE_FIXEDWING; - pgeneric->mnNumLaunchers = 1; - pgeneric->maLauncherClass[0] = "ML1"; - mcObjectData.AddElement(pgeneric,nKey); - pgeneric->mnKey = nKey; - - pgeneric = new tcGenericDBObject; - strcpy(pgeneric->mzClass.mz,"Fixed 1"); - pgeneric->mfMaxSpeed_kts = 0; - pgeneric->mfAccel_ktsps = 1; - pgeneric->mfTurnRate_degps = 1; - pgeneric->mnType = PTYPE_FIXED; - pgeneric->mnModelType = MTYPE_FIXED; - mcObjectData.AddElement(pgeneric,nKey); - pgeneric->mnKey = nKey; - - plauncher = new tcLauncherDBObject; - plauncher->mzClass = "ML1"; - plauncher->mzChildClass = "Missile"; - plauncher->mnCapacity = 10; - mcObjectData.AddElement(plauncher,nKey); - plauncher->mnKey = nKey; - - tcMissileDBObject *pmissile = new tcMissileDBObject; - pmissile->mnClassID = DTYPE_MISSILE; - pgeneric->mnModelType = MTYPE_MISSILE; - pmissile->mzClass = "Inspired Dart"; - // flight model - pmissile->mfMass_kg = 100.0f; - pmissile->mfDragArea_sm = 1.0f; - pmissile->mfGmax = 20.0f; - pmissile->mfMaxTurnRate_degps = 15.0f; - pmissile->mfCdpsub = 0.2f; - pmissile->mfCdptran = 0.4f; - pmissile->mfCdpsup = 0.3f; - pmissile->mfMcm = 0.9f; - pmissile->mfMsupm = 1.1f; - pmissile->mfKdi = 0.1f; - pmissile->mfBoostThrust_N = 4000.0f; - pmissile->mfBoostTime_s = 20.0f; - pmissile->mfSustThrust_N = 400.0f; - pmissile->mfSustTime_s = 60.0f; - pmissile->mfShutdownSpeed_mps = 400.0f; - // other parameters - pmissile->mfDamage = 100.0f; - //pmissile->meDamageType = DT_GENERIC; - pmissile->mfRcs_dbsm = 0.0f; - pmissile->mfRange_km = 123.4f; - // sensor info - pmissile->maSensorClass[0] = ""; - pmissile->maSensorClass[1] = ""; - // flight profile, array of flight segment info - pmissile->mnNumSegments = 1; - pmissile->maFlightProfile[0].mfRange_km = 0.0f; - pmissile->maFlightProfile[0].mfAltitude_m = 10000.0f; - pmissile->maFlightProfile[0].meAltitudeMode = AM_ASL; - pmissile->maFlightProfile[0].meGuidanceMode = GM_COMMAND; - mcObjectData.AddElement(pmissile,nKey); - pmissile->mnKey = nKey; - - tcRadarDBObject* pRadarDBObj = new tcRadarDBObject; - pRadarDBObj->mzClass = "Airborne radar"; - mcObjectData.AddElement(pRadarDBObj,nKey); - pRadarDBObj->mnKey = nKey; - - pRadarDBObj = new tcRadarDBObject; - pRadarDBObj->mzClass = "Surface radar"; - pRadarDBObj->mfRefRange_km = 50.0f; - mcObjectData.AddElement(pRadarDBObj,nKey); - pRadarDBObj->mnKey = nKey; - - /* store to new database */ - tcFile file; - nResult = file.Open("defaultdb.dat", tcFile::modeCreate|tcFile::modeWrite); - if (nResult==false) { - MessageBox(NULL,"Error - failed to open defaultdb.dat","Error",MB_OK); - return; - } - - nResult = Serialize(file,false); - file.Close(); - if (nResult==false) { - MessageBox(NULL,"tcDatabase - CreateDefaultDB - serialization error","Error",MB_OK); - return; - } - } /** * creates default object of class anClassID */ ! int tcDatabase::CreateObjectByType(UINT anClassID) { tnPoolIndex nKey; --- 520,529 ---- } /** * creates default object of class anClassID */ ! int tcDatabase::CreateObjectByType(UINT anClassID) ! { tnPoolIndex nKey; |
|
From: Dewitt C. <ddc...@us...> - 2005-06-22 01:22:24
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2354/src/scriptinterface Modified Files: tcFlightPortInterface.cpp tcPlatformInterface.cpp tcScenarioInterface.cpp Log Message: Misc housekeeping, updates for infrared and anti-radiation seekers, more info for multiplayer airfield units, icon gui enhancements Index: tcPlatformInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterface.cpp,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** tcPlatformInterface.cpp 1 Jun 2005 00:13:32 -0000 1.46 --- tcPlatformInterface.cpp 22 Jun 2005 01:22:08 -0000 1.47 *************** *** 64,68 **** std::string tcPlatformInterface::GetPlatformName() { std::string s; ! if (mpPlatformObj == NULL) { s == "err"; } --- 64,68 ---- std::string tcPlatformInterface::GetPlatformName() { std::string s; ! if (mpPlatformObj == 0) { s == "err"; } *************** *** 75,79 **** std::string tcPlatformInterface::GetPlatformClass() { std::string s; ! if (mpPlatformObj == NULL) { s == "err"; } --- 75,79 ---- std::string tcPlatformInterface::GetPlatformClass() { std::string s; ! if (mpPlatformObj == 0) { s == "err"; } *************** *** 217,221 **** void tcPlatformInterface::SetSpeedToMax() { ! if (mpPlatformObj == NULL) {return;} if (tcAeroAirObject* aaObj = dynamic_cast<tcAeroAirObject*>(mpPlatformObj)) { --- 217,221 ---- void tcPlatformInterface::SetSpeedToMax() { ! if (mpPlatformObj == 0) {return;} if (tcAeroAirObject* aaObj = dynamic_cast<tcAeroAirObject*>(mpPlatformObj)) { *************** *** 241,245 **** tcGameObject* tcPlatformInterface::GetTargetObj() { ! wxASSERT(mpSimState != NULL); return mpSimState->GetObject(GetTarget()); } --- 241,245 ---- tcGameObject* tcPlatformInterface::GetTargetObj() { ! wxASSERT(mpSimState != 0); return mpSimState->GetObject(GetTarget()); } *************** *** 565,569 **** int tcPlatformInterface::GetLauncherCount() { ! if (mpPlatformObj == NULL) { return 0; --- 565,569 ---- int tcPlatformInterface::GetLauncherCount() { ! if (mpPlatformObj == 0) { return 0; *************** *** 832,836 **** t.mnID = -1; ! if (mpSensorMap == NULL) {return t;} if (mpSensorMap->GetTrackCount()==0) { --- 832,836 ---- t.mnID = -1; ! if (mpSensorMap == 0) {return t;} if (mpSensorMap->GetTrackCount()==0) { *************** *** 844,848 **** int tcPlatformInterface::GetTrackCount() { ! if (mpSensorMap == NULL) {return 0;} return mpSensorMap->GetTrackCount(); } --- 844,848 ---- int tcPlatformInterface::GetTrackCount() { ! if (mpSensorMap == 0) {return 0;} return mpSensorMap->GetTrackCount(); } *************** *** 896,900 **** tcSensorMapTrack *pTrack; ! if (mpSensorMap == NULL) {return track;} int nCount = mpSensorMap->GetTrackCount(); if (nCount==0) --- 896,900 ---- tcSensorMapTrack *pTrack; ! if (mpSensorMap == 0) {return track;} int nCount = mpSensorMap->GetTrackCount(); if (nCount==0) *************** *** 1030,1034 **** const tcSensorState* sensor_state = mpPlatformObj->GetSensor(n); ! info.isActive = sensor_state->GetActive(); info.type = 0; --- 1030,1034 ---- const tcSensorState* sensor_state = mpPlatformObj->GetSensor(n); ! info.isActive = sensor_state->IsActive(); info.type = 0; *************** *** 1127,1131 **** void tcPlatformInterface::GetUserInput(std::string callback, std::string uitype) { ! if (mpCommandQueue == NULL) return; mpCommandQueue->GetUserInput(callback.c_str(),uitype.c_str()); } --- 1127,1131 ---- void tcPlatformInterface::GetUserInput(std::string callback, std::string uitype) { ! if (mpCommandQueue == 0) return; mpCommandQueue->GetUserInput(callback.c_str(),uitype.c_str()); } *************** *** 1179,1185 **** * such as activating the flight deck control panel. */ ! void tcPlatformInterface::SendCommand(std::string command) { ! if (mpCommandQueue == NULL) return; mpCommandQueue->AddCommand(command.c_str(),-1); } --- 1179,1185 ---- * such as activating the flight deck control panel. */ ! void tcPlatformInterface::SendCommand(const std::string& command) { ! if (mpCommandQueue == 0) return; mpCommandQueue->AddCommand(command.c_str(),-1); } *************** *** 1296,1300 **** tcFlightOpsObject* flightOps = dynamic_cast<tcFlightOpsObject*>(mpPlatformObj); ! if (flightOps != NULL) { fpi.flightport = flightOps->GetFlightPort(); --- 1296,1300 ---- tcFlightOpsObject* flightOps = dynamic_cast<tcFlightOpsObject*>(mpPlatformObj); ! if (flightOps != 0) { fpi.flightport = flightOps->GetFlightPort(); *************** *** 1343,1352 **** ! tcPlatformObject* tcPlatformInterface::mpStaticPlatformObj = NULL; ! tcSimState* tcPlatformInterface::mpSimState = NULL; ! tcAllianceSensorMap* tcPlatformInterface::mpSensorMap = NULL; ! tcSoundConsole* tcPlatformInterface::mpConsole = NULL; ! tcCommandQueue* tcPlatformInterface::mpCommandQueue = NULL; ! tcMapData* tcPlatformInterface::mapData = NULL; tcPlatformInterface::tcPlatformInterface() --- 1343,1352 ---- ! tcPlatformObject* tcPlatformInterface::mpStaticPlatformObj = 0; ! tcSimState* tcPlatformInterface::mpSimState = 0; ! tcAllianceSensorMap* tcPlatformInterface::mpSensorMap = 0; ! tcSoundConsole* tcPlatformInterface::mpConsole = 0; ! tcCommandQueue* tcPlatformInterface::mpCommandQueue = 0; ! tcMapData* tcPlatformInterface::mapData = 0; tcPlatformInterface::tcPlatformInterface() Index: tcScenarioInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcScenarioInterface.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** tcScenarioInterface.cpp 12 Jun 2005 20:46:59 -0000 1.28 --- tcScenarioInterface.cpp 22 Jun 2005 01:22:08 -0000 1.29 *************** *** 206,210 **** ! bool tcScenarioInterface::AddUnitToAlliance(tcScenarioUnit unit, int alliance) { lastObjectAdded = 0; --- 206,210 ---- ! bool tcScenarioInterface::AddUnitToAlliance(scriptinterface::tcScenarioUnit unit, int alliance) { lastObjectAdded = 0; Index: tcFlightPortInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcFlightPortInterface.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcFlightPortInterface.cpp 1 Jun 2005 00:13:32 -0000 1.7 --- tcFlightPortInterface.cpp 22 Jun 2005 01:22:08 -0000 1.8 *************** *** 1,6 **** ! /* ! ** tcFlightPortInterface.cpp ! ** ! ** Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** ! ** @file tcFlightPortInterface.cpp ! */ ! /* Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 73,90 **** } ! tcFlightPort* tcFlightPortInterface::static_flightport = NULL; ! tcSimState* tcFlightPortInterface::mpSimState = NULL; ! tcSoundConsole* tcFlightPortInterface::mpConsole = NULL; // Interface function declaration double tcFlightPortInterface::GetTime() { ! if (flightport==NULL) return 1e32; return flightport->last_update_time; } ! int tcFlightPortInterface::GetUnitCount(void) { ! if (flightport==NULL) return 0; return (int)flightport->units.size(); } --- 73,90 ---- } ! tcFlightPort* tcFlightPortInterface::static_flightport = 0; ! tcSimState* tcFlightPortInterface::mpSimState = 0; ! tcSoundConsole* tcFlightPortInterface::mpConsole = 0; // Interface function declaration double tcFlightPortInterface::GetTime() { ! if (flightport==0) return 1e32; return flightport->last_update_time; } ! int tcFlightPortInterface::GetUnitCount() { ! if (flightport==0) return 0; return (int)flightport->units.size(); } *************** *** 92,96 **** long tcFlightPortInterface::GetUnitID(int n) { ! if (flightport==NULL) return -1; if ((n<=0)||(n>=(int)flightport->units.size())) return -1; tcAirState* airstate = flightport->units.at(n); --- 92,96 ---- long tcFlightPortInterface::GetUnitID(int n) { ! if (flightport==0) return -1; if ((n<=0)||(n>=(int)flightport->units.size())) return -1; tcAirState* airstate = flightport->units.at(n); *************** *** 100,104 **** std::string tcFlightPortInterface::GetUnitName(int n) { ! if (flightport==NULL) return "err"; if ((n<0)||(n>=(int)flightport->units.size())) return "err"; tcAirState* airstate = flightport->units.at(n); --- 100,104 ---- std::string tcFlightPortInterface::GetUnitName(int n) { ! if (flightport==0) return "err"; if ((n<0)||(n>=(int)flightport->units.size())) return "err"; tcAirState* airstate = flightport->units.at(n); *************** *** 108,112 **** std::string tcFlightPortInterface::GetUnitLocation(int n) { ! if (flightport==NULL) return "err"; if ((n<0)||(n>=(int)flightport->units.size())) return "err"; tcAirState* airstate = flightport->units.at(n); --- 108,112 ---- std::string tcFlightPortInterface::GetUnitLocation(int n) { ! if (flightport==0) return "err"; if ((n<0)||(n>=(int)flightport->units.size())) return "err"; tcAirState* airstate = flightport->units.at(n); *************** *** 122,126 **** std::string tcFlightPortInterface::GetUnitGoalLocation(int n) { ! if (flightport==NULL) return "err"; if ((n<0)||(n>=(int)flightport->units.size())) return "err"; tcAirState* airstate = flightport->units.at(n); --- 122,126 ---- std::string tcFlightPortInterface::GetUnitGoalLocation(int n) { ! if (flightport==0) return "err"; if ((n<0)||(n>=(int)flightport->units.size())) return "err"; tcAirState* airstate = flightport->units.at(n); *************** *** 135,139 **** status.runway = -1; ! if (flightport==NULL) return status; if ((n<0)||(n>=(int)flightport->units.size())) return status; tcAirState* airstate = flightport->units.at(n); --- 135,139 ---- status.runway = -1; ! if (flightport==0) return status; if ((n<0)||(n>=(int)flightport->units.size())) return status; tcAirState* airstate = flightport->units.at(n); *************** *** 156,165 **** bool tcFlightPortInterface::IsValid() { ! return (flightport != NULL); } void tcFlightPortInterface::Launch(int runway) { ! if (flightport==NULL) return; flightport->Launch(runway); } --- 156,165 ---- bool tcFlightPortInterface::IsValid() { ! return (flightport != 0); } void tcFlightPortInterface::Launch(int runway) { ! if (flightport==0) return; flightport->Launch(runway); } *************** *** 167,171 **** void tcFlightPortInterface::LaunchID(long id) { ! if (flightport==NULL) return; flightport->LaunchID(id); } --- 167,171 ---- void tcFlightPortInterface::LaunchID(long id) { ! if (flightport==0) return; flightport->LaunchID(id); } *************** *** 178,182 **** void tcFlightPortInterface::SetDestination(int n, int dest_code) { ! if (flightport==NULL) return; teLocation dest; --- 178,182 ---- void tcFlightPortInterface::SetDestination(int n, int dest_code) { ! if (flightport==0) return; teLocation dest; *************** *** 188,194 **** tcFlightPortInterface::tcFlightPortInterface() { - flightport = NULL; } tcFlightPortInterface::~tcFlightPortInterface() { --- 188,195 ---- tcFlightPortInterface::tcFlightPortInterface() + : flightport(0) { } + tcFlightPortInterface::~tcFlightPortInterface() { |
|
From: Dewitt C. <ddc...@us...> - 2005-06-22 01:22:23
|
Update of /cvsroot/gcblue/gcb_wx/src/network In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2354/src/network Modified Files: tcMessage.cpp tcMultiplayerInterface.cpp Log Message: Misc housekeeping, updates for infrared and anti-radiation seekers, more info for multiplayer airfield units, icon gui enhancements Index: tcMessage.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/network/tcMessage.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcMessage.cpp 16 Apr 2005 20:44:43 -0000 1.9 --- tcMessage.cpp 22 Jun 2005 01:22:08 -0000 1.10 *************** *** 36,39 **** --- 36,47 ---- BEGIN_NAMESPACE(network) + /** + * @returns maximum UDP message size in bytes (payload size) + */ + unsigned int tcMessage::GetMaxMessageSize() + { + return MESSAGE_SIZE; + } + void tcMessage::ClearRider() Index: tcMultiplayerInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/network/tcMultiplayerInterface.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** tcMultiplayerInterface.cpp 1 Jun 2005 00:13:31 -0000 1.28 --- tcMultiplayerInterface.cpp 22 Jun 2005 01:22:08 -0000 1.29 *************** *** 1661,1664 **** --- 1661,1665 ---- unsigned createCount = 0; unsigned updateCount = 0; + const unsigned int maxMessageSize = tcMessage::GetMaxMessageSize(); for (iter.First(); iter.NotDone(); iter.Next()) *************** *** 1683,1687 **** // create new message if updateCount gets too large ! if (updateCount >= 4) { SendUpdateMessage(connId, updateStream); --- 1684,1688 ---- // create new message if updateCount gets too large ! if ((updateCount >= 4) || (updateStream.size() > maxMessageSize - 512)) { SendUpdateMessage(connId, updateStream); *************** *** 1705,1709 **** #endif ! if (createCount >= 8) { SendUpdateMessage(connId, createStream); --- 1706,1710 ---- #endif ! if ((createCount >= 8) || (createStream.size() > maxMessageSize - 1024)) { SendUpdateMessage(connId, createStream); |
|
From: Dewitt C. <ddc...@us...> - 2005-06-22 01:22:04
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2118/include/common Modified Files: simmath.h tcStream.h Log Message: Misc housekeeping, updates for infrared and anti-radiation seekers, more info for multiplayer airfield units, icon gui enhancements Index: tcStream.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/tcStream.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcStream.h 5 May 2005 02:14:17 -0000 1.10 --- tcStream.h 22 Jun 2005 01:21:25 -0000 1.11 *************** *** 61,64 **** --- 61,65 ---- tcStream& operator<<(unsigned short& val); tcStream& operator<<(unsigned int& val); + tcStream& operator<<(unsigned long& val); tcStream& operator<<(float& val); tcStream& operator<<(double& val); *************** *** 75,78 **** --- 76,80 ---- tcStream& operator>>(unsigned short& val); tcStream& operator>>(unsigned int& val); + tcStream& operator>>(unsigned long& val); tcStream& operator>>(float& val); tcStream& operator>>(double& val); Index: simmath.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/simmath.h,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** simmath.h 11 Jun 2005 21:01:42 -0000 1.30 --- simmath.h 22 Jun 2005 01:21:25 -0000 1.31 *************** *** 75,78 **** --- 75,81 ---- }; + /** + * + */ enum teAffiliation { *************** *** 135,138 **** --- 138,143 ---- tcStream& operator<<(tcStream& stream); tcStream& operator>>(tcStream& stream); + + tcTrack& operator==(const tcTrack& src); }; |
|
From: Dewitt C. <ddc...@us...> - 2005-06-22 01:21:39
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2118/include/sim Modified Files: Game.h tcESMSensor.h tcGameObject.h tcGoal.h tcLauncher.h tcLauncherState.h tcMapData.h tcMissileObject.h tcPlatformObject.h tcRadar.h tcSensorPlatform.h tcSensorState.h tcSimState.h tcStores.h Log Message: Misc housekeeping, updates for infrared and anti-radiation seekers, more info for multiplayer airfield units, icon gui enhancements Index: tcGameObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcGameObject.h,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** tcGameObject.h 1 Jun 2005 00:13:28 -0000 1.39 --- tcGameObject.h 22 Jun 2005 01:21:27 -0000 1.40 *************** *** 121,124 **** --- 121,125 ---- float BearingToRad(tcGameObject& p) const; void AddChild(tcGameObject *child); + tcGameObject* GetChildById(long id) const; bool IsChild(const tcGameObject* child) const; void RemoveChild(tcGameObject *child); Index: tcMapData.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcMapData.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcMapData.h 24 Feb 2005 22:19:14 -0000 1.10 --- tcMapData.h 22 Jun 2005 01:21:27 -0000 1.11 *************** *** 103,106 **** --- 103,108 ---- * generations of code are jumbled together here. This sorely * needs refactoring. + * + * Converted into singleton class. */ class tcMapData *************** *** 134,144 **** void LoadHighResB(float startLon_deg, float startLat_deg); int LoadHighResDefault(float afStartLon_deg, float afStartLat_deg); ! void SaveHighRes(void); ! int LoadLowRes(void); void CreateDefaultMap(float afStartLat_deg, float afStartLon_deg, unsigned anWidth, unsigned anHeight); tcMapData(); ~tcMapData(); ! private: tcOptions *mpOptions; tsDemInfo maDemInfo[N_DEMFILES]; --- 136,149 ---- void LoadHighResB(float startLon_deg, float startLat_deg); int LoadHighResDefault(float afStartLon_deg, float afStartLat_deg); ! void SaveHighRes(); ! int LoadLowRes(); void CreateDefaultMap(float afStartLat_deg, float afStartLon_deg, unsigned anWidth, unsigned anHeight); + + static tcMapData* Get(); ///< singleton accessor + private: tcMapData(); ~tcMapData(); ! tcOptions *mpOptions; tsDemInfo maDemInfo[N_DEMFILES]; Index: tcStores.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcStores.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcStores.h 12 Jun 2005 20:46:33 -0000 1.5 --- tcStores.h 22 Jun 2005 01:21:27 -0000 1.6 *************** *** 61,65 **** tcDatabaseObject* GetDatabaseObject() const; ! StoreItem(); StoreItem(const StoreItem& src); --- 61,66 ---- tcDatabaseObject* GetDatabaseObject() const; ! void SetDatabaseObject(tcDatabaseObject* obj); ! StoreItem(); StoreItem(const StoreItem& src); *************** *** 113,118 **** tcUpdateStream& operator>>(tcUpdateStream& stream); ! bool CommandInfoMatches(const tcStores& launcher); ! void CopyCommandInfoFrom(const tcStores& launcher); tcStores(tcStoresDBObject* dbObj); --- 114,119 ---- tcUpdateStream& operator>>(tcUpdateStream& stream); ! void ClearNewCommand(); ! bool HasNewCommand() const; tcStores(tcStoresDBObject* dbObj); *************** *** 126,132 **** --- 127,148 ---- int errorCode; ///< used in multiplayer to pass error code to client double lastUpdate; + + // data for multiplayer commands + struct CommandInfo + { + short int id; ///< id of unit that command applies to, -1 for local unit + unsigned char op; ///< UNLOAD = 0, LOAD = 1, REFUEL = 2 + long itemId; ///< database id of item (if applicable) + unsigned long quantity; + unsigned char launcherIdx; + }; + std::vector<CommandInfo> commandList; + + bool AddOperation(const std::string& itemName, unsigned int launcherIdx, unsigned long quantity, + int opType, tcGameObject* obj); void CompleteOperation(StoreOperation& op); tcGameObject* GetChildOrParent(tcGameObject* child); + bool ValidateOpObject(tcGameObject* obj); }; #endif \ No newline at end of file Index: tcSimState.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSimState.h,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** tcSimState.h 1 Jun 2005 00:13:28 -0000 1.41 --- tcSimState.h 22 Jun 2005 01:21:27 -0000 1.42 *************** *** 152,156 **** const char* GetScenarioDescription() const; const char* GetScenarioName() const; - int GetSeekerTrack(long anKey, tcTrack& track); tcSensorMap* GetSensorMap(); double GetTime() {return mfSimTime;} --- 152,155 ---- *************** *** 165,170 **** void PrintToFile(tcString); void ProcessLanding(tcGameObject *receiver, tcGameObject *landing_unit); ! bool RadarCanDetect(tnPoolIndex anSensorKey, const tcGameObject* target, tcGameObject* reference, float afSensorAz, long fcID = -1, unsigned fcIdx = 0); void RandInit(); void RemoveDestroyedObjects(void); --- 164,173 ---- void PrintToFile(tcString); void ProcessLanding(tcGameObject *receiver, tcGameObject *landing_unit); ! ! bool RadarCanDetect(long anSensorKey, const tcGameObject* target, tcGameObject* reference, float afSensorAz, long fcID = -1, unsigned fcIdx = 0); + bool SensorCanDetect(long sensorKey, const tcGameObject* target, + tcGameObject* reference, float sensorAz, long fcID = -1, unsigned fcIdx = 0); + void RandInit(); void RemoveDestroyedObjects(void); Index: Game.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/Game.h,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** Game.h 11 Jun 2005 21:01:43 -0000 1.59 --- Game.h 22 Jun 2005 01:21:26 -0000 1.60 *************** *** 39,43 **** #include "tcGameView.h" #include "tcUserInfo.h" - #include "tcMapData.h" #include "tcOptions.h" #include "tcOptionsView.h" --- 39,42 ---- *************** *** 72,75 **** --- 71,75 ---- class tc3DWindow; class tcDraggedIconDisplay; + class tcMapData; using namespace scriptinterface; *************** *** 165,169 **** tcDatabase* database; tcSimState* simState; ! tcMapData mcMapData; tcCommandQueue* commandQueue; tcSimPythonInterface* pythonInterface; --- 165,169 ---- tcDatabase* database; tcSimState* simState; ! tcMapData* mapData; tcCommandQueue* commandQueue; tcSimPythonInterface* pythonInterface; Index: tcESMSensor.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcESMSensor.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcESMSensor.h 1 Jun 2005 00:13:28 -0000 1.8 --- tcESMSensor.h 22 Jun 2005 01:21:27 -0000 1.9 *************** *** 43,46 **** --- 43,47 ---- tcESMDBObject* mpDBObj; + virtual bool CanDetectTarget(const tcGameObject* target, float& range_km); virtual bool InitFromDatabase(long key); ///< initializes sensor using database data at key bool IsDetected(const tcRadar* emitter, float& rfAz_rad); *************** *** 56,64 **** tcESMSensor(tcESMDBObject* dbObj); virtual ~tcESMSensor(); ! protected: void ProcessESMDetection(tcGameObject* target, double t); void UpdateSensorMap(const tcGameObject* target, long* emitters, unsigned int nEmitters, float az_rad, double t); }; ! #endif \ No newline at end of file --- 57,70 ---- tcESMSensor(tcESMDBObject* dbObj); virtual ~tcESMSensor(); ! ! private: ! float targetRange_km; ///< target range from last call to IsDetected void ProcessESMDetection(tcGameObject* target, double t); void UpdateSensorMap(const tcGameObject* target, long* emitters, unsigned int nEmitters, float az_rad, double t); + void UpdateSeeker(double t); + void UpdateSurveillance(double t); + void UpdateTrack(const tcGameObject* target, double t); }; ! #endif Index: tcGoal.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcGoal.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcGoal.h 5 Sep 2004 02:38:44 -0000 1.4 --- tcGoal.h 22 Jun 2005 01:21:27 -0000 1.5 *************** *** 67,71 **** tcGoal(); tcGoal(const tcGoal& goal); ! ~tcGoal(); }; --- 67,71 ---- tcGoal(); tcGoal(const tcGoal& goal); ! virtual ~tcGoal(); }; Index: tcLauncher.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcLauncher.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcLauncher.h 12 Jun 2005 20:46:28 -0000 1.18 --- tcLauncher.h 22 Jun 2005 01:21:27 -0000 1.19 *************** *** 159,162 **** --- 159,164 ---- static tcSimState* simState; + void InitForNewChild(); + }; #endif \ No newline at end of file Index: tcMissileObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcMissileObject.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcMissileObject.h 1 Jun 2005 00:13:28 -0000 1.18 --- tcMissileObject.h 22 Jun 2005 01:21:27 -0000 1.19 *************** *** 55,59 **** float mfRangeToObjective_km; // for segment determination UINT mnCurrentSegment; ! tcRadar mcSensorState; Aero::tsMissileKState msKState; tcMissileDBObject *mpDBObject; // pointer to valid database obj --- 55,59 ---- float mfRangeToObjective_km; // for segment determination UINT mnCurrentSegment; ! tcSensorState* sensor; ///< missile seeker Aero::tsMissileKState msKState; tcMissileDBObject *mpDBObject; // pointer to valid database obj *************** *** 70,74 **** float GetDistanceFromLaunch() const; virtual void SetSpeed(float afNewSpeed) {mfGoalSpeed_kts=afNewSpeed;} ! virtual tcRadar* GetSensorState(); virtual void DesignateTarget(long anID); virtual int GetGuidanceParameters(tsGuidanceParameters& gp); --- 70,75 ---- float GetDistanceFromLaunch() const; virtual void SetSpeed(float afNewSpeed) {mfGoalSpeed_kts=afNewSpeed;} ! virtual tcRadar* GetSeekerRadar() const; ! virtual tcSensorState* GetSeekerSensor() const; virtual void DesignateTarget(long anID); virtual int GetGuidanceParameters(tsGuidanceParameters& gp); Index: tcLauncherState.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcLauncherState.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tcLauncherState.h 1 Jun 2005 00:13:28 -0000 1.16 --- tcLauncherState.h 22 Jun 2005 01:21:27 -0000 1.17 *************** *** 44,48 **** class tcGameObject; class tcSimState; ! class tcRadar; class tcStream; class tcCommandStream; --- 44,48 ---- class tcGameObject; class tcSimState; ! class tcSensorState; class tcStream; class tcCommandStream; *************** *** 90,94 **** void Serialize(tcFile& file, bool abLoad); ! void SetFireControlSensor(unsigned nLauncher, tcRadar* radar, unsigned sensorIdx); int SetLaunch(int nLauncher, int quantity); bool SetLauncherDatum(unsigned nLauncher, --- 90,94 ---- void Serialize(tcFile& file, bool abLoad); ! void SetFireControlSensor(unsigned nLauncher, tcSensorState* sensor, unsigned sensorIdx); int SetLaunch(int nLauncher, int quantity); bool SetLauncherDatum(unsigned nLauncher, Index: tcRadar.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcRadar.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcRadar.h 1 Jun 2005 00:13:28 -0000 1.15 --- tcRadar.h 22 Jun 2005 01:21:27 -0000 1.16 *************** *** 69,74 **** // semi-active and command mode vars - long illuminatorID; ///< id of SA illuminating platform - unsigned char illuminatorSensorIdx; ///< sensor index of illum platform virtual bool CanDetectTarget(const tcGameObject* target, float& range_km); --- 69,72 ---- *************** *** 83,87 **** virtual bool IsSemiactive() const {return isSemiactive;} virtual void SetCommandState(bool state); ! virtual void SetIlluminator(long illum_id, unsigned char sensor_idx); void Serialize(tcFile& file, bool mbLoad); --- 81,85 ---- virtual bool IsSemiactive() const {return isSemiactive;} virtual void SetCommandState(bool state); ! virtual void SetFireControlSensor(long id, unsigned char idx); void Serialize(tcFile& file, bool mbLoad); *************** *** 104,108 **** bool isCommandReceiver; - tcRadar* GetSemiactiveIlluminator(); void UpdateSeeker(double t); void UpdateSensorMap(double t, const tcGameObject* target, float range_km); --- 102,105 ---- Index: tcPlatformObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcPlatformObject.h,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** tcPlatformObject.h 12 Jun 2005 20:46:33 -0000 1.30 --- tcPlatformObject.h 22 Jun 2005 01:21:27 -0000 1.31 *************** *** 77,81 **** UPDATE_LAUNCHERS = 0x02, UPDATE_SENSORS = 0x04, ! UPDATE_AI = 0x08 }; --- 77,82 ---- UPDATE_LAUNCHERS = 0x02, UPDATE_SENSORS = 0x04, ! UPDATE_AI = 0x08, ! UPDATE_STORES = 0x10 }; Index: tcSensorState.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSensorState.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcSensorState.h 1 Jun 2005 00:13:28 -0000 1.18 --- tcSensorState.h 22 Jun 2005 01:21:27 -0000 1.19 *************** *** 45,48 **** --- 45,49 ---- #define SSMODE_FC 5 // fire control only + class tcRadar; class tcSimState; class tcGameObject; *************** *** 70,76 **** static void AttachDatabase(tcDatabase* db) {database = db;} static void AttachSimState(tcSimState* ss) {simState = ss;} ! bool GetActive() const {return mbActive != 0;} void GetTestArea(tcRect& region); virtual bool InitFromDatabase(long key); ///< initializes sensor using database data at key bool IsDamaged() const; bool IsHidden() const; --- 71,83 ---- static void AttachDatabase(tcDatabase* db) {database = db;} static void AttachSimState(tcSimState* ss) {simState = ss;} ! virtual bool CanDetectTarget(const tcGameObject* target, float& range_km); ! ! tcRadar* GetFireControlRadar(); ! tcSensorState* GetFireControlSensor(); void GetTestArea(tcRect& region); + bool GetTrack(tcTrack& track_); + bool HasFireControlSensor() const; virtual bool InitFromDatabase(long key); ///< initializes sensor using database data at key + bool IsActive() const; bool IsDamaged() const; bool IsHidden() const; *************** *** 87,90 **** --- 94,98 ---- virtual void SetActive(bool active); void SetDamaged(bool state); + virtual void SetFireControlSensor(long id, unsigned char idx); void SetMountAz(float az); void SetParent(tcGameObject *obj) {parent = obj;} *************** *** 104,107 **** --- 112,118 ---- bool isHidden; ///< hidden sensors are not displayed in object control view bool isDamaged; + long fireControlId; ///< id of platform with fire control sensor (semi-active illuminator, or command guidance sensor) + unsigned char fireControlIdx; ///< sensor index of fire control sensor platform + }; #endif \ No newline at end of file Index: tcSensorPlatform.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSensorPlatform.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcSensorPlatform.h 1 Jun 2005 00:13:28 -0000 1.3 --- tcSensorPlatform.h 22 Jun 2005 01:21:27 -0000 1.4 *************** *** 62,67 **** unsigned int GetSensorCount() const; bool HasActivatedSensor(); ! bool IsRadiating(); ! const tcSensorState* GetSensor(unsigned idx); wxString GetSensorDescription(); tcSensorState* GetSensorMutable(unsigned idx); --- 62,67 ---- unsigned int GetSensorCount() const; bool HasActivatedSensor(); ! bool IsRadiating() const; ! const tcSensorState* GetSensor(unsigned idx) const; wxString GetSensorDescription(); tcSensorState* GetSensorMutable(unsigned idx); |
|
From: Dewitt C. <ddc...@us...> - 2005-06-22 01:21:35
|
Update of /cvsroot/gcblue/gcb_wx/include/network In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2118/include/network Modified Files: tcMessage.h Log Message: Misc housekeeping, updates for infrared and anti-radiation seekers, more info for multiplayer airfield units, icon gui enhancements Index: tcMessage.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/network/tcMessage.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcMessage.h 16 Apr 2005 20:43:55 -0000 1.7 --- tcMessage.h 22 Jun 2005 01:21:26 -0000 1.8 *************** *** 73,76 **** --- 73,78 ---- void StampTime(); + static unsigned int GetMaxMessageSize(); + tcMessage(); tcMessage(const tcMessage& source); |
|
From: Dewitt C. <ddc...@us...> - 2005-06-22 01:21:35
|
Update of /cvsroot/gcblue/gcb_wx/include/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2118/include/scriptinterface Modified Files: tcFlightPortInterface.h tcPlatformInterface.h tcSubInterface.h tcTrackInterface.h Log Message: Misc housekeeping, updates for infrared and anti-radiation seekers, more info for multiplayer airfield units, icon gui enhancements Index: tcPlatformInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcPlatformInterface.h,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** tcPlatformInterface.h 1 Jun 2005 00:13:27 -0000 1.41 --- tcPlatformInterface.h 22 Jun 2005 01:21:26 -0000 1.42 *************** *** 56,63 **** int mnQuantity; int mnTargetFlags; ///< 0x01 - surface, 0x02 - air, 0x04 - land ! float mfRange_km; float maxDepth_m; ///< max depth for subsurface launch int mnLaunchMode; ///< 0 - datum, 1 - handoff ! int launcherStatus; double sectorCenter; ///< az of center of launch engagement sector in deg double sectorWidth; ///< width of engagement sector in deg --- 56,63 ---- int mnQuantity; int mnTargetFlags; ///< 0x01 - surface, 0x02 - air, 0x04 - land ! float mfRange_km; ///< range that ai uses for engaging with this launcher float maxDepth_m; ///< max depth for subsurface launch int mnLaunchMode; ///< 0 - datum, 1 - handoff ! int launcherStatus; ///< see @see tcLauncher::teLauncherStatus double sectorCenter; ///< az of center of launch engagement sector in deg double sectorWidth; ///< width of engagement sector in deg *************** *** 75,79 **** }; ! // wrapper around tcSensorMapTrack with additional info for iterating class tcTrackIterator : public tcSensorMapTrack { --- 75,79 ---- }; ! /// wrapper around tcSensorMapTrack with additional info for iterating class tcTrackIterator : public tcSensorMapTrack { *************** *** 108,116 **** // basic nav commands: heading, speed, altitude ! /// gets platform altitude in meters float GetAltitude() {return mpPlatformObj->mcKin.mfAlt_m;} /// gets fraction of fuel remaining from 0 - 1 float GetFuel() const; ! /// gets max altitude in meters indicated in database entry. float GetMaxAltitude(); /// gets current platform speed in kts --- 108,116 ---- // basic nav commands: heading, speed, altitude ! /// [Python: GetAlt] gets platform altitude in meters float GetAltitude() {return mpPlatformObj->mcKin.mfAlt_m;} /// gets fraction of fuel remaining from 0 - 1 float GetFuel() const; ! /// [Python: GetMaxAlt] gets max altitude in meters indicated in database entry float GetMaxAltitude(); /// gets current platform speed in kts *************** *** 129,133 **** --- 129,135 ---- bool HasThrottle(); /// set goal altitude for platform in meters + /** + * [Python: SetAlt] * For air objects * @param alt_m goal altitude of platform in meters *************** *** 169,180 **** --- 171,185 ---- ||(nModelType == MTYPE_AIR)||(nModelType == MTYPE_HELO); } + /// returns true if platform is a helo bool IsHelo() { return (mpPlatformObj->mnModelType == MTYPE_HELO); } + /// returns true if platform is a submarine bool IsSub() { return (mpPlatformObj->mnModelType == MTYPE_SUBMARINE); } + /// returns a sub interface object, @see scriptinterface::tcSubInterface tcSubInterface GetSubInterface(); *************** *** 215,220 **** /// true if launcher can launch using datum only (i.e. no track just a set of coordinates) bool IsDatumLaunch(int anLauncher) {return mpPlatformObj->mcLauncherState.IsDatumLaunch(anLauncher);} bool GetLauncherInfo(tcLauncherInfo& info, int anLauncher); ! /// version for python tcLauncherInfo GetLauncherInfoByValue(int launcher); --- 220,226 ---- /// true if launcher can launch using datum only (i.e. no track just a set of coordinates) bool IsDatumLaunch(int anLauncher) {return mpPlatformObj->mcLauncherState.IsDatumLaunch(anLauncher);} + /// C++ only bool GetLauncherInfo(tcLauncherInfo& info, int anLauncher); ! /// [Python: GetLauncherInfo] returns launcher info object tcLauncherInfo GetLauncherInfoByValue(int launcher); *************** *** 234,238 **** // order related commands ! /// adds generic order void AddTask(const std::string& taskName, double priority); /// adds navigation waypoint (creates nav task if necessary) --- 240,244 ---- // order related commands ! /// add a task void AddTask(const std::string& taskName, double priority); /// adds navigation waypoint (creates nav task if necessary) *************** *** 288,301 **** --- 294,316 ---- /// true if platform has a flight port (e.g. carrier) bool HasFlightPort(); + /// return flightport interface object tcFlightPortInterface GetFlightPortInfo(); + /// returns track with landing data for landing on platform matching id tcTrack GetLandingData(long id); + /// Get landing state (gear up = 0, down = 1) int GetLandingState(); + /// Set gear up (state = 0) or gear down (state = 1) void SetLandingState(int state); // multiplayer related + /// return name of player controlling this platform std::string GetController() const; + /// true if platform is available for control by client bool IsAvailable() const; + /// true if game is in multiplayer mode bool IsMultiplayerActive() const; + /// release control of this platform (multiplayer) void ReleaseControl(); + /// take control of this platform (multiplayer) void TakeControl(); *************** *** 313,317 **** bool IsPlayerControlled() const; bool IsValid() const; ! void SendCommand(std::string command); /// display text message in user console void DisplayMessage(const std::string& text); --- 328,332 ---- bool IsPlayerControlled() const; bool IsValid() const; ! void SendCommand(const std::string& command); /// display text message in user console void DisplayMessage(const std::string& text); Index: tcTrackInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcTrackInterface.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcTrackInterface.h 1 Jun 2005 00:13:27 -0000 1.7 --- tcTrackInterface.h 22 Jun 2005 01:21:26 -0000 1.8 *************** *** 39,42 **** --- 39,43 ---- public: // platform info + /// Sets affiliation of track, see @see teAffiliation void SetAffiliation(UINT8 anAffil); void DeclareFriendly(); *************** *** 44,47 **** --- 45,49 ---- void DeclareHostile(); void DropTrack(); + /// Updates the ambiguity list for this track based on ESM intercepts void UpdateAmbiguityList(); Index: tcSubInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcSubInterface.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcSubInterface.h 1 Jun 2005 00:13:27 -0000 1.2 --- tcSubInterface.h 22 Jun 2005 01:21:26 -0000 1.3 *************** *** 42,54 **** --- 42,64 ---- { public: + /// max depth of this sub float GetMaxDepth() const; + /// command depth to periscope depth void GoToPeriscopeDepth(); + /// true if at periscope depth bool IsAtPeriscopeDepth(); + /// true if periscope is raised bool IsPeriscopeRaised() const; + /// true if radar mast is raised bool IsRadarMastRaised() const; + /// true if this is a valid interface bool IsValid() const; + /// lower the scope void LowerPeriscope(); + /// lower the radar mast void LowerRadarMast(); + /// raise the scope (must be at periscope depth or shallower) void RaisePeriscope(); + /// raise the radar mast (must be at periscope depth or shallower) void RaiseRadarMast(); Index: tcFlightPortInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcFlightPortInterface.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcFlightPortInterface.h 1 Jun 2005 00:13:27 -0000 1.7 --- tcFlightPortInterface.h 22 Jun 2005 01:21:26 -0000 1.8 *************** *** 43,46 **** --- 43,49 ---- namespace scriptinterface { + /** + * + */ class tcFlightUnitStatus { *************** *** 51,55 **** bool atDestination; bool isIdle; ! int runway; // -1 if not on a runway, otherwise runway number double ready_time; }; --- 54,58 ---- bool atDestination; bool isIdle; ! int runway; ///< -1 if not on a runway, otherwise runway number double ready_time; }; *************** *** 58,61 **** --- 61,67 ---- ** associated with the static vars, etc. */ + /** + * Interface for control of flightport (airfield, helo deck, carrier deck) + */ class tcFlightPortInterface { *************** *** 75,88 **** // Interface functions to be called through Python bool IsValid(); double GetTime(); ! int GetUnitCount(void); long GetUnitID(int n); // long used for compatibility with Python tcFlightUnitStatus GetUnitStatus(int n); std::string GetUnitName(int n); std::string GetUnitLocation(int n); std::string GetUnitGoalLocation(int n); void Launch(int runway); void LaunchID(long id); ! void SetDestination(int n, int dest_code); // 0 - hangar, 1 - ready, 2 - runway/launch tcFlightPortInterface(); --- 81,103 ---- // Interface functions to be called through Python bool IsValid(); + /// @returns simulation time of last update of this flightport double GetTime(); ! /// @returns number of air units in this flightport ! int GetUnitCount(); ! /// @returns id of unit n (index starts at 0) long GetUnitID(int n); // long used for compatibility with Python + /// @returns status object for unit n, @see scriptinterface::tcFlightUnitStatus tcFlightUnitStatus GetUnitStatus(int n); std::string GetUnitName(int n); + /// @returns string for loc, @see tcAirState::LocationToString std::string GetUnitLocation(int n); + /// @returns string for goal loc, @see tcAirState::LocationToString std::string GetUnitGoalLocation(int n); + /// launch unit on indicated runway void Launch(int runway); + /// launch unit matching id (if unit is on runway) void LaunchID(long id); ! /// sets destination of unit n; dest_code: 0 - hangar, 1 - ready, 2 - runway/launch ! void SetDestination(int n, int dest_code); tcFlightPortInterface(); |
|
From: Dewitt C. <ddc...@us...> - 2005-06-22 01:21:35
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2118/include/graphics Modified Files: tcFlightportGui.h tcLauncherContainerItem.h tcPlatformGui.h tcScenarioSelectView.h tcStoresContainerItem.h tcStoresGui.h Log Message: Misc housekeeping, updates for infrared and anti-radiation seekers, more info for multiplayer airfield units, icon gui enhancements Index: tcStoresContainerItem.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcStoresContainerItem.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcStoresContainerItem.h 11 Jun 2005 21:01:43 -0000 1.1 --- tcStoresContainerItem.h 22 Jun 2005 01:21:26 -0000 1.2 *************** *** 40,50 **** public: tcStores* GetStores() const; ! void SetStores(tcStores* stores); tcStoresContainerItem(); virtual ~tcStoresContainerItem(); private: ! ! tcStores* parent; ///< stores object that holds this item }; --- 40,51 ---- public: tcStores* GetStores() const; ! void SetStores(long id, long host, unsigned int idx); tcStoresContainerItem(); virtual ~tcStoresContainerItem(); private: ! long platformId; ! long hostId; ! unsigned int storesIdx; }; Index: tcLauncherContainerItem.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcLauncherContainerItem.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcLauncherContainerItem.h 11 Jun 2005 21:01:43 -0000 1.1 --- tcLauncherContainerItem.h 22 Jun 2005 01:21:26 -0000 1.2 *************** *** 41,50 **** tcLauncher* GetLauncher() const; unsigned int GetLauncherIndex() const; ! void SetLauncher(tcLauncher* launcher, unsigned int idx); tcLauncherContainerItem(); virtual ~tcLauncherContainerItem(); private: ! tcLauncher* parent; ///< launcher object that holds this item unsigned int launcherIdx; ///< index of launcher on parent platform }; --- 41,51 ---- tcLauncher* GetLauncher() const; unsigned int GetLauncherIndex() const; ! void SetLauncher(long id, long host, unsigned int idx); tcLauncherContainerItem(); virtual ~tcLauncherContainerItem(); private: ! long platformId; ! long hostId; unsigned int launcherIdx; ///< index of launcher on parent platform }; Index: tcStoresGui.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcStoresGui.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcStoresGui.h 11 Jun 2005 21:01:43 -0000 1.1 --- tcStoresGui.h 22 Jun 2005 01:21:26 -0000 1.2 *************** *** 52,61 **** ! tcStoresGui(tcStores* obj, const wxPoint& pos, const wxString& configFile); virtual ~tcStoresGui(); private: ! tcStores* stores; float slotSize; ///< dimension of (square) slot --- 52,63 ---- ! tcStoresGui(long id, long host, unsigned int idx, const wxPoint& pos, const wxString& configFile); virtual ~tcStoresGui(); private: ! const long platformId; ///< id of platform that holds the stores object ! const long hostId; ///< -1 if none, or id of host platform ! const unsigned int storesIdx; ///< idx of stores on platform float slotSize; ///< dimension of (square) slot *************** *** 66,70 **** void AddOrUpdateItem(tcContainerSlot& slot, const std::string& itemName, ! unsigned int quantity); void HandleDrop(size_t slotIdx, tcContainerItem* item); void InitializeGui(); --- 68,73 ---- void AddOrUpdateItem(tcContainerSlot& slot, const std::string& itemName, ! unsigned int quantity, tcStores* stores); ! tcStores* GetStores(); void HandleDrop(size_t slotIdx, tcContainerItem* item); void InitializeGui(); Index: tcScenarioSelectView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcScenarioSelectView.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcScenarioSelectView.h 6 Nov 2004 15:13:40 -0000 1.3 --- tcScenarioSelectView.h 22 Jun 2005 01:21:26 -0000 1.4 *************** *** 107,110 **** --- 107,112 ---- const float yHeightDir; ///< vertical spacing between directory and next item const float yStart; + const float fontSizeDirectory; ///< font size for directory name + const float fontSizeScenario; ///< font size for scenario file name const wxRealPoint basePosition; wxPoint mousePosition; Index: tcFlightportGui.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcFlightportGui.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcFlightportGui.h 11 Jun 2005 21:01:43 -0000 1.1 --- tcFlightportGui.h 22 Jun 2005 01:21:26 -0000 1.2 *************** *** 43,47 **** void SetDescription(const std::string& s); void SetDescription(const char* s); ! void SetEntity(tcGameObject* obj); tcEntityContainerItem(); --- 43,47 ---- void SetDescription(const std::string& s); void SetDescription(const char* s); ! void SetEntity(long id, long host); tcEntityContainerItem(); *************** *** 49,53 **** private: std::string description; ! tcGameObject* entity; }; --- 49,54 ---- private: std::string description; ! long platformId; ! long hostId; }; *************** *** 72,76 **** ! tcFlightPortGui(tcFlightPort* obj, const wxPoint& pos, const wxString& configFile); --- 73,77 ---- ! tcFlightPortGui(long id, const wxPoint& pos, const wxString& configFile); *************** *** 80,84 **** private: ! tcFlightPort* flightPort; size_t launchOffset; ///< slot index of first launch spot (normally 0) size_t readyOffset; ///< slot index of first ready spot --- 81,86 ---- private: ! const long platformId; ///< id of platform that holds flightport ! size_t launchOffset; ///< slot index of first launch spot (normally 0) size_t readyOffset; ///< slot index of first ready spot *************** *** 98,101 **** --- 100,104 ---- void AddOrUpdateItem(tcContainerSlot& slot, tcAirState* airState); void CloseAllPlatformGuis(); + tcFlightPort* GetFlightPort(); void InitializeGui(); void OpenPlatformGui(tcContainerItem* item); Index: tcPlatformGui.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcPlatformGui.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcPlatformGui.h 12 Jun 2005 20:46:27 -0000 1.2 --- tcPlatformGui.h 22 Jun 2005 01:21:26 -0000 1.3 *************** *** 68,78 **** ! tcPlatformGui(tcPlatformObject* obj, const wxPoint& pos, const wxString& configFile); virtual ~tcPlatformGui(); private: ! tcPlatformObject* platform; ! tcFlightOpsObject* flightOps; osg::ref_ptr<osg::Geometry> magazineIcon; --- 68,78 ---- ! tcPlatformGui(long id, long host, const wxPoint& pos, const wxString& configFile); virtual ~tcPlatformGui(); private: ! const long platformId; ! const long hostId; ///< -1 for none, or id of parent that is holding this platform, e.g. flightport osg::ref_ptr<osg::Geometry> magazineIcon; *************** *** 98,102 **** void AddOrUpdateLauncherItem(tcContainerSlot& slot, tcDatabaseObject* child, tcLauncher* launcher, unsigned int launcherIdx, unsigned int quantity); ! void GetLauncherCompatibilityCaption(unsigned int launcherIdx, wxString& caption); void HandleDrop(size_t slotIdx, tcContainerItem* item); void HandleFuelDrop(tcStoresContainerItem* item); --- 98,104 ---- void AddOrUpdateLauncherItem(tcContainerSlot& slot, tcDatabaseObject* child, tcLauncher* launcher, unsigned int launcherIdx, unsigned int quantity); ! void GetLauncherCompatibilityCaption(unsigned int launcherIdx, wxString& caption, tcPlatformObject* platform); ! tcFlightOpsObject* GetFlightOps(); ! tcPlatformObject* GetPlatform(); void HandleDrop(size_t slotIdx, tcContainerItem* item); void HandleFuelDrop(tcStoresContainerItem* item); |
|
From: Dewitt C. <ddc...@us...> - 2005-06-22 01:21:34
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2118/include/database Modified Files: tcDatabase.h tcMissileDBObject.h tcSensorDBObject.h Log Message: Misc housekeeping, updates for infrared and anti-radiation seekers, more info for multiplayer airfield units, icon gui enhancements Index: tcDatabase.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcDatabase.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcDatabase.h 1 Jun 2005 00:13:25 -0000 1.11 --- tcDatabase.h 22 Jun 2005 01:21:25 -0000 1.12 *************** *** 75,79 **** void BuildDictionaries(); void Clear(); - void CreateDefaultDB(); int CreateObjectCopy(tnPoolIndex anKey); int CreateObjectByType(UINT anClassID); --- 75,78 ---- Index: tcSensorDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcSensorDBObject.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcSensorDBObject.h 1 Jun 2005 00:13:26 -0000 1.10 --- tcSensorDBObject.h 22 Jun 2005 01:21:26 -0000 1.11 *************** *** 45,49 **** float mfScanPeriod_s; ///< [s] bool isSurveillance; ///< true if this sensor contributes reports to alliance map ! virtual tcSensorState* CreateSensor(tcGameObject* parent); ///< factory method virtual const char* GetClassName() {return "Sensor";} ///< returns class name of database object --- 45,49 ---- float mfScanPeriod_s; ///< [s] bool isSurveillance; ///< true if this sensor contributes reports to alliance map ! virtual tcSensorState* CreateSensor(tcGameObject* parent); ///< factory method virtual const char* GetClassName() {return "Sensor";} ///< returns class name of database object Index: tcMissileDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcMissileDBObject.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** tcMissileDBObject.h 1 Jun 2005 00:13:26 -0000 1.20 --- tcMissileDBObject.h 22 Jun 2005 01:21:25 -0000 1.21 *************** *** 66,74 **** enum teGuidanceMode { ! GM_COMMAND = 0, ///< command guidance ! GM_NAV = 1, ///< inertial, GPS ! GM_SENSOR1 = 2, ///< use primary sensor ! GM_SENSOR2 = 3, ///< use secondary sensor ! GM_SENSORALL = 4 ///< use all sensors, not supported }; --- 66,72 ---- enum teGuidanceMode { ! GM_COMMAND = 0, ///< command guidance ! GM_NAV = 1, ///< inertial, GPS ! GM_SENSOR1 = 2 ///< use seeker }; *************** *** 120,130 **** // other parameters ! //float mfDamage; ///< damage value ! //teDamageType meDamageType; ///< damage type enumeration float mfRcs_dbsm; ///< radar cross section, [dBsm] float mfRange_km; ///< [km] nominal range // sensor info ! tcDBString maSensorClass[2]; ///< primary and secondary ! tnPoolIndex primarySeekerKey; ///< key for fast access of primary seeker float seekerFOV_rad; ///< for fast lookup of seeker field of view /// flight profile, array of flight segment info --- 118,130 ---- // other parameters ! //float mfDamage; ///< damage value ! //teDamageType meDamageType; ///< damage type enumeration float mfRcs_dbsm; ///< radar cross section, [dBsm] float mfRange_km; ///< [km] nominal range + // sensor info ! tcDBString maSensorClass; ///< seeker database class name ! tnPoolIndex sensorKey; ///< key for fast access of primary seeker ! bool needsFireControl; ///< true if seeker depends on a fire control sensor for guidance float seekerFOV_rad; ///< for fast lookup of seeker field of view /// flight profile, array of flight segment info *************** *** 135,141 **** bool IsLeaf() const; ///< returns true if db obj is a leaf obj teWeaponLaunchMode GetLaunchMode(); ! long GetPrimarySeekerKey(); float GetSeekerFOV(); bool HasAllEmitters(std::vector<long>& emitters); virtual void PrintToFile(tcFile& file); int Serialize(tcFile& file, bool mbLoad, UINT32 anVersion); --- 135,142 ---- bool IsLeaf() const; ///< returns true if db obj is a leaf obj teWeaponLaunchMode GetLaunchMode(); ! long GetSensorKey(); float GetSeekerFOV(); bool HasAllEmitters(std::vector<long>& emitters); + bool NeedsFireControl() const; virtual void PrintToFile(tcFile& file); int Serialize(tcFile& file, bool mbLoad, UINT32 anVersion); |
|
From: Dewitt C. <ddc...@us...> - 2005-06-12 20:47:10
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv840/src/sim Modified Files: tcLauncher.cpp tcPlatformObject.cpp tcStores.cpp Log Message: Drag and drop icon gui updates Index: tcLauncher.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcLauncher.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** tcLauncher.cpp 11 Jun 2005 21:01:45 -0000 1.22 --- tcLauncher.cpp 12 Jun 2005 20:46:59 -0000 1.23 *************** *** 252,260 **** * @see tcLauncher::GetCompatibleCount */ ! std::string tcLauncher::GetCompatibleName(unsigned int idx) const { wxASSERT(mpLauncherDBObj); ! if (idx >= mpLauncherDBObj->mnConfigurations) return std::string(""); ! return std::string(mpLauncherDBObj->maChildClass[idx].mz); } --- 252,288 ---- * @see tcLauncher::GetCompatibleCount */ ! const std::string& tcLauncher::GetCompatibleName(unsigned int idx) const { + static std::string s; + wxASSERT(mpLauncherDBObj); ! if (idx >= mpLauncherDBObj->mnConfigurations) ! { ! s = ""; ! } ! else ! { ! s = mpLauncherDBObj->maChildClass[idx].mz; ! } ! ! return s; ! } ! ! /** ! * The names of this method and the GetCompatibleCount method are confusing, ! * should be renamed. ! * @see tcLauncher::GetCompatibleCount ! * @return quantity of configuration <idx> that can be loaded into launcher ! */ ! unsigned int tcLauncher::GetCompatibleQuantity(unsigned int idx) const ! { ! if (idx >= mpLauncherDBObj->mnConfigurations) ! { ! return 0; ! } ! else ! { ! return mpLauncherDBObj->maCapacity[idx]; ! } } Index: tcPlatformObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcPlatformObject.cpp,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** tcPlatformObject.cpp 1 Jun 2005 00:13:33 -0000 1.47 --- tcPlatformObject.cpp 12 Jun 2005 20:47:00 -0000 1.48 *************** *** 504,507 **** --- 504,511 ---- } + bool tcPlatformObject::IsRefueling() const + { + return isRefueling; + } /** *************** *** 531,534 **** --- 535,542 ---- } + void tcPlatformObject::SetRefueling(bool state) + { + isRefueling = state; + } /** *************** *** 885,889 **** tcPlatformObject::tcPlatformObject(tcGenericDBObject *obj) ! : tcGameObject(obj), tcSensorPlatform() { using namespace database; --- 893,898 ---- tcPlatformObject::tcPlatformObject(tcGenericDBObject *obj) ! : tcGameObject(obj), tcSensorPlatform(), ! isRefueling(false) { using namespace database; *************** *** 958,962 **** tcGameObject(o), tcSensorPlatform(o), ! commandObj(o.commandObj) { brain = new Brain(this); // need copy constructor for this --- 967,972 ---- tcGameObject(o), tcSensorPlatform(o), ! commandObj(o.commandObj), ! isRefueling(o.isRefueling) { brain = new Brain(this); // need copy constructor for this Index: tcStores.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcStores.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcStores.cpp 11 Jun 2005 21:01:45 -0000 1.4 --- tcStores.cpp 12 Jun 2005 20:47:00 -0000 1.5 *************** *** 32,35 **** --- 32,36 ---- #include "common/tcObjStream.h" #include "tcDatabase.h" + #include "tcGenericDBObject.h" #ifdef _DEBUG *************** *** 70,74 **** } ! tcStores::StoreItem::StoreItem(const std::string& name, unsigned int qty) : className(name), quantity(qty) --- 71,75 ---- } ! tcStores::StoreItem::StoreItem(const std::string& name, unsigned long qty) : className(name), quantity(qty) *************** *** 178,185 **** * */ ! bool tcStores::AddItems(const std::string& item, unsigned int quantity) { wxASSERT(storesDBObj); ! int freeCapacity = storesDBObj->capacity - CurrentQuantity(); if ((freeCapacity > 0) && IsCompatible(item)) { --- 179,186 ---- * */ ! bool tcStores::AddItems(const std::string& item, unsigned long quantity) { wxASSERT(storesDBObj); ! long freeCapacity = storesDBObj->capacity - CurrentQuantity(); if ((freeCapacity > 0) && IsCompatible(item)) { *************** *** 204,208 **** * Complete load or unload operation, updating stores and launcher */ ! void tcStores::CompleteOperation(StoreOperation& op) { tcGameObject* obj = GetChildOrParent(op.obj); --- 205,209 ---- * Complete load or unload operation, updating stores and launcher */ ! void tcStores::CompleteOperation(tcStores::StoreOperation& op) { tcGameObject* obj = GetChildOrParent(op.obj); *************** *** 219,223 **** launcher->SetChildQuantity(op.quantity); // assumes empty launcher } ! else { wxASSERT(launcher->mnCurrent == op.quantity); // no partial unloading --- 220,237 ---- launcher->SetChildQuantity(op.quantity); // assumes empty launcher } ! else if (op.transferType == StoreOperation::REFUEL) ! { ! if (tcPlatformObject* platform = dynamic_cast<tcPlatformObject*>(obj)) ! { ! platform->fuel_kg += float(op.quantity); ! float fuelCapacity_kg = platform->mpDBObject->mfFuelCapacity_kg; ! if (platform->fuel_kg > fuelCapacity_kg) ! { ! platform->fuel_kg = fuelCapacity_kg; ! } ! platform->SetRefueling(false); ! } ! } ! else // UNLOAD { wxASSERT(launcher->mnCurrent == op.quantity); // no partial unloading *************** *** 230,234 **** * @return current quantity of item available in magazine */ ! unsigned int tcStores::CurrentItemQuantity(const std::string& item) const { for (size_t n=0; n<stores.size(); n++) --- 244,248 ---- * @return current quantity of item available in magazine */ ! unsigned long tcStores::CurrentItemQuantity(const std::string& item) const { for (size_t n=0; n<stores.size(); n++) *************** *** 247,253 **** * @see tcStores::IncomingQuantity */ ! unsigned int tcStores::CurrentQuantity() const { ! unsigned currentCount = 0; for (size_t n=0; n<stores.size(); n++) { --- 261,267 ---- * @see tcStores::IncomingQuantity */ ! unsigned long tcStores::CurrentQuantity() const { ! unsigned long currentCount = 0; for (size_t n=0; n<stores.size(); n++) { *************** *** 305,308 **** --- 319,329 ---- } + const std::string& tcStores::GetDisplayName() const + { + wxASSERT(storesDBObj != 0); + + return storesDBObj->displayName; + } + const std::string& tcStores::GetItemName(unsigned int idx) const { *************** *** 336,342 **** * @see tcStores::CurrentQuantity */ ! unsigned int tcStores::IncomingQuantity() const { ! unsigned currentCount = 0; for (size_t k=0; k<ops.size(); k++) --- 357,363 ---- * @see tcStores::CurrentQuantity */ ! unsigned long tcStores::IncomingQuantity() const { ! unsigned long currentCount = 0; for (size_t k=0; k<ops.size(); k++) *************** *** 376,381 **** bool tcStores::IsFull() const { ! unsigned currentQuantity = CurrentQuantity(); ! unsigned incomingQuantity = IncomingQuantity(); return ((currentQuantity + incomingQuantity) >= storesDBObj->capacity); --- 397,402 ---- bool tcStores::IsFull() const { ! unsigned long currentQuantity = CurrentQuantity(); ! unsigned long incomingQuantity = IncomingQuantity(); return ((currentQuantity + incomingQuantity) >= storesDBObj->capacity); *************** *** 390,395 **** tcGameObject* obj = GetChildOrParent(child); ! wxASSERT(obj); ! if (obj == 0) return false; tcLauncher* launcher = obj->GetLauncher(idx); --- 411,425 ---- tcGameObject* obj = GetChildOrParent(child); ! if (obj == 0) ! { ! if (parent->IsOwnAlliance()) ! { ! wxString s = wxString::Format("%s (%s) - Cannot load launcher, no access to magazine\n", ! parent->mzUnit.mz, parent->mzClass.mz); ! tcMessageInterface::Get()->ChannelMessage("Info", s.c_str()); ! } ! return false; ! } ! tcLauncher* launcher = obj->GetLauncher(idx); *************** *** 424,428 **** bool found = false; int nStores = (int)stores.size(); ! unsigned int loadQuantity = 0; for (int k=nStores-1; (k>=0) && !found; k--) { --- 454,458 ---- bool found = false; int nStores = (int)stores.size(); ! unsigned long loadQuantity = 0; for (int k=nStores-1; (k>=0) && !found; k--) { *************** *** 521,524 **** --- 551,694 ---- /** + * Used to load a non-launcher item (e.g. fuel) from stores to platform + */ + bool tcStores::LoadOther(const std::string& item, tcGameObject* child) + { + tcGameObject* obj = GetChildOrParent(child); + + if (obj == 0) + { + if (parent->IsOwnAlliance()) + { + wxString s = wxString::Format("%s (%s) - Cannot load item, no access to stores\n", + parent->mzUnit.mz, parent->mzClass.mz); + tcMessageInterface::Get()->ChannelMessage("Info", s.c_str()); + } + return false; + } + + tcPlatformObject* platform = dynamic_cast<tcPlatformObject*>(obj); + if (platform == 0) + { + if (obj->IsOwnAlliance()) + { + wxString s = wxString::Format("%s (%s) - Cannot load item, not platform object\n", + parent->mzUnit.mz, parent->mzClass.mz); + tcMessageInterface::Get()->ChannelMessage("Info", s.c_str()); + } + return false; + } + + // only support refueling right now + if (item != "Fuel") + { + wxASSERT(false); + return false; + } + + long fuelNeeded_kg = long(platform->mpDBObject->mfFuelCapacity_kg - platform->fuel_kg); + + if (fuelNeeded_kg <= 0) + { + if (obj->IsOwnAlliance()) + { + wxString s = wxString::Format("%s (%s) - platform already refueled\n", + obj->mzUnit.mz, obj->mzClass.mz); + tcMessageInterface::Get()->ChannelMessage("Info", s.c_str()); + } + return false; // item not compatible with launcher + } + + std::vector<StoreItem>::iterator iter; + bool found = false; + int nStores = (int)stores.size(); + unsigned long loadQuantity = 0; + for (int k=nStores-1; (k>=0) && !found; k--) + { + if (stores[k].className == item) + { + found = true; + wxASSERT(stores[k].quantity); + if (stores[k].quantity >= (unsigned long)fuelNeeded_kg) + { + loadQuantity = fuelNeeded_kg; + } + else + { + loadQuantity = stores[k].quantity; + } + stores[k].quantity -= loadQuantity; + if (stores[k].quantity == 0) + { + stores.erase(stores.begin()+k); + } + } + } + + if (!found) + { + if (obj->IsOwnAlliance()) + { + wxString s = wxString::Format("%s (%s) - No %s in %s\n", + obj->mzUnit.mz, obj->mzClass.mz, + item.c_str(), storesDBObj->displayName.c_str()); + tcMessageInterface::Get()->ChannelMessage("Info", s.c_str()); + } + return false; // stores not available + } + + // search for existing op with launcher + found = false; + std::vector<StoreOperation>::iterator opIter; + std::vector<StoreOperation>::iterator matchIter; + for (opIter = ops.begin(); (opIter != ops.end()) && (!found); ++opIter) + { + if ((opIter->transferType == StoreOperation::REFUEL) && (opIter->obj == child)) + { + matchIter = opIter; + found = true; + } + } + + if (found) // modify existing op + { + wxASSERT(matchIter->transferType == StoreOperation::REFUEL); + if (matchIter->item == item) + { + if (obj->IsOwnAlliance()) + { + wxString s = wxString::Format("%s (%s) - Already refueling\n", + obj->mzUnit.mz, obj->mzClass.mz); + tcMessageInterface::Get()->ChannelMessage("Info", s.c_str()); + } + } + return false; + } + else // add new op + { + StoreOperation op; + op.item = item; + op.launcherIdx = 0; + op.quantity = loadQuantity; + op.timeToComplete = storesDBObj->moveTime; + op.transferType = StoreOperation::REFUEL; + op.obj = child; + + ops.push_back(op); + + platform->SetRefueling(true); + } + + if (obj->IsOwnAlliance()) + { + wxString s = wxString::Format("%s (%s) - Refueling\n", + obj->mzUnit.mz, obj->mzClass.mz); + tcMessageInterface::Get()->ChannelMessage("Info", s.c_str()); + } + + return true; + } + + /** * */ *************** *** 535,540 **** tcGameObject* obj = GetChildOrParent(child); ! wxASSERT(obj); ! if (obj == 0) return false; tcLauncher* launcher = obj->GetLauncher(idx); --- 705,718 ---- tcGameObject* obj = GetChildOrParent(child); ! if (obj == 0) ! { ! if (parent->IsOwnAlliance()) ! { ! wxString s = wxString::Format("%s (%s) - Cannot unload launcher, no access to magazine\n", ! parent->mzUnit.mz, parent->mzClass.mz); ! tcMessageInterface::Get()->ChannelMessage("Info", s.c_str()); ! } ! return false; ! } tcLauncher* launcher = obj->GetLauncher(idx); |
|
From: Dewitt C. <ddc...@us...> - 2005-06-12 20:47:10
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv840/src/scriptinterface Modified Files: tcScenarioInterface.cpp Log Message: Drag and drop icon gui updates Index: tcScenarioInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcScenarioInterface.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** tcScenarioInterface.cpp 1 Jun 2005 00:13:32 -0000 1.27 --- tcScenarioInterface.cpp 12 Jun 2005 20:46:59 -0000 1.28 *************** *** 345,349 **** */ void tcScenarioInterface::AddToUnitMagazine(const std::string& unitName, ! const std::string& item, unsigned int quantity) { wxASSERT(simState); --- 345,349 ---- */ void tcScenarioInterface::AddToUnitMagazine(const std::string& unitName, ! const std::string& item, unsigned long quantity) { wxASSERT(simState); |
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv840/src/database Modified Files: CsvTranslator.cpp tcDBString.cpp tcDatabase.cpp tcDatabaseObject.cpp tcSqlReader.cpp tcStoresDBObject.cpp Added Files: tcItemDBObject.cpp Log Message: Drag and drop icon gui updates Index: CsvTranslator.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/CsvTranslator.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CsvTranslator.cpp 1 Jun 2005 00:13:29 -0000 1.7 --- CsvTranslator.cpp 12 Jun 2005 20:46:57 -0000 1.8 *************** *** 203,206 **** --- 203,233 ---- /** + * @return field as long integer. This will truncate a float. + * Zero is returned if the field is empty. If the field + * has a bad format (e.g. a string field instead of a + * numerical field), zero is returned and an error is logged. + */ + long CsvTranslator::GetFieldAsLong(int n) + { + long val; + + if (n < 0 || n >= nfield) + { + cerr << "Field out of bounds (GetFieldAsInt)\n"; + return -1; + } + if (field[n].size() == 0) return 0; // do not log an error for null fields + + int scanCount = sscanf(field[n].c_str(), "%d", &val); + if (scanCount != 1) + { + fprintf(stderr, "Bad field type: '%s'(GetFieldAsLong)\n", + field[n].c_str()); + return 0; + } + return val; + } + + /** * Set output stream. Reset field vector in case object has * been used for reading. *************** *** 294,297 **** --- 321,330 ---- } + CsvTranslator& CsvTranslator::operator>>(unsigned long& val) + { + val = GetFieldAsInt(fieldIdx++); + return *this; + } + CsvTranslator& CsvTranslator::operator>>(std::string& s) { Index: tcDBString.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcDBString.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcDBString.cpp 1 Jun 2005 00:13:29 -0000 1.7 --- tcDBString.cpp 12 Jun 2005 20:46:57 -0000 1.8 *************** *** 168,181 **** return true; } ! tcDBString::tcDBString(const char *buff) { strncpy(mz,buff,DB_STRING_SIZE); } ! tcDBString::tcDBString() ! { ! strcpy(mz,"DEFAULT"); ! } tcDBString::~tcDBString() { --- 168,188 ---- return true; } ! ! tcDBString::tcDBString() ! { ! strcpy(mz, "DEFAULT"); ! } ! tcDBString::tcDBString(const char *buff) { strncpy(mz,buff,DB_STRING_SIZE); } + + tcDBString::tcDBString(const tcDBString& src) + { + strncpy(mz, src.mz, DB_STRING_SIZE); + } ! tcDBString::~tcDBString() { Index: tcSqlReader.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcSqlReader.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcSqlReader.cpp 1 Jun 2005 00:13:29 -0000 1.4 --- tcSqlReader.cpp 12 Jun 2005 20:46:58 -0000 1.5 *************** *** 50,54 **** * @return data element from column name <field> as double */ ! double tcSqlReader::GetDouble(std::string& field) { unsigned int index = LookupFieldIndex(field); --- 50,54 ---- * @return data element from column name <field> as double */ ! double tcSqlReader::GetDouble(const std::string& field) { unsigned int index = LookupFieldIndex(field); *************** *** 76,80 **** * @return data element from column name <field> as int */ ! int tcSqlReader::GetInt(std::string& field) { unsigned int index = LookupFieldIndex(field); --- 76,80 ---- * @return data element from column name <field> as int */ ! int tcSqlReader::GetInt(const std::string& field) { unsigned int index = LookupFieldIndex(field); *************** *** 100,106 **** /** * throws exception if column <field> not found in map * @return data element from column name <field> as string */ ! std::string tcSqlReader::GetString(std::string& field) { unsigned int index = LookupFieldIndex(field); --- 100,132 ---- /** * throws exception if column <field> not found in map + * @return data element from column name <field> as int + */ + long tcSqlReader::GetLong(const std::string& field) + { + unsigned int index = LookupFieldIndex(field); + + return data.getlong((int)index); + } + + /** + * Version that accepts format string with variable arguments + * to create field string. + */ + long tcSqlReader::GetLong(const char* fmt, ...) + { + va_list argp; + + va_start(argp, fmt); + vsprintf(buffer, fmt, argp); + va_end(argp); + + return GetLong(std::string(buffer)); + } + + /** + * throws exception if column <field> not found in map * @return data element from column name <field> as string */ ! std::string tcSqlReader::GetString(const std::string& field) { unsigned int index = LookupFieldIndex(field); *************** *** 125,129 **** ! unsigned int tcSqlReader::LookupFieldIndex(std::string& field) { std::map<std::string, unsigned int>::const_iterator mapIter; --- 151,155 ---- ! unsigned int tcSqlReader::LookupFieldIndex(const std::string& field) { std::map<std::string, unsigned int>::const_iterator mapIter; --- NEW FILE: tcItemDBObject.cpp --- /** ** @file tcItemDBObject.cpp */ /* Copyright (C) 2005 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "stdwx.h" #if _MSC_VER > 1000 #pragma warning(disable:4786) // suppress warning for STL bug in VC6, see Q167355 in the MSDN Library. #endif // _MSC_VER > 1000 #include "tcItemDBObject.h" #include "CsvTranslator.h" #include "common/tinyxml.h" #include "database/tcSqlReader.h" #include <sstream> #ifdef _DEBUG #define new DEBUG_NEW #endif using namespace std; namespace database { /** * workaround for write serialization issue * @return true if db obj is a leaf obj */ bool tcItemDBObject::IsLeaf() const { return mnClassID == DTYPE_ITEM; } void tcItemDBObject::PrintToFile(tcFile& file) { tcDatabaseObject::PrintToFile(file); } int tcItemDBObject::Serialize(tcFile& file, bool mbLoad, UINT32 anVersion) { tcDatabaseObject::Serialize(file,mbLoad, anVersion); return 1; } int tcItemDBObject::SerializeCSV(CsvTranslator *csv, bool mbLoad) { tcDatabaseObject::SerializeCSV(csv, mbLoad); return 1; } /** * Loads/saves XML data for database object * @param load true to load, false to save */ void tcItemDBObject::SerializeXml(TiXmlElement* node, bool load) { if (load) return; // write only for now tcDatabaseObject::SerializeXml(node, load); } int tcItemDBObject::WriteCSVHeader(database::CsvTranslator *csv) { tcDatabaseObject::WriteCSVHeader(csv); csv->WriteLine(); return 1; } /** * Adds sql column definitions to columnString. This is used for * SQL create table command */ void tcItemDBObject::AddSqlColumns(std::string& columnString) { tcDatabaseObject::AddSqlColumns(columnString); } void tcItemDBObject::ReadSql(tcSqlReader& entry) { tcDatabaseObject::ReadSql(entry); } void tcItemDBObject::WriteSql(std::string& valueString) { tcDatabaseObject::WriteSql(valueString); } tcItemDBObject::tcItemDBObject() { mzClass = "Default Item"; mnClassID = DTYPE_ITEM; } tcItemDBObject::tcItemDBObject(const tcItemDBObject& obj) : tcDatabaseObject(obj) { } tcItemDBObject::~tcItemDBObject() { } } Index: tcStoresDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcStoresDBObject.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcStoresDBObject.cpp 1 Jun 2005 00:13:29 -0000 1.3 --- tcStoresDBObject.cpp 12 Jun 2005 20:46:58 -0000 1.4 *************** *** 179,183 **** displayName = entry.GetString("DisplayName"); ! capacity = entry.GetInt("Capacity"); moveTime = entry.GetDouble("MoveTime_s"); --- 179,183 ---- displayName = entry.GetString("DisplayName"); ! capacity = entry.GetLong("Capacity"); moveTime = entry.GetDouble("MoveTime_s"); Index: tcDatabaseObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcDatabaseObject.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcDatabaseObject.cpp 11 Jun 2005 21:01:44 -0000 1.18 --- tcDatabaseObject.cpp 12 Jun 2005 20:46:57 -0000 1.19 *************** *** 378,395 **** mnClassID = DTYPE_OBJECT; mnType = PTYPE_UNKNOWN; ! model = NULL; } ! tcDatabaseObject::tcDatabaseObject(tcDatabaseObject& obj) { - mzClass = obj.mzClass; mnKey = obj.mnKey; mnClassID = obj.mnClassID; mnType = obj.mnType; mnModelType = obj.mnModelType; ! mzImageFileName = obj.mzImageFileName; ! mz3DModelFileName = obj.mz3DModelFileName; strcpy(mzDescription, obj.mzDescription); // BAD, assumes obj has legal string ! model = NULL; // model not copied } --- 378,396 ---- mnClassID = DTYPE_OBJECT; mnType = PTYPE_UNKNOWN; ! model = 0; } ! tcDatabaseObject::tcDatabaseObject(const tcDatabaseObject& obj) : ! mzClass(obj.mzClass), ! mzImageFileName(obj.mzImageFileName), ! mz3DModelFileName(obj.mz3DModelFileName) { mnKey = obj.mnKey; mnClassID = obj.mnClassID; mnType = obj.mnType; mnModelType = obj.mnModelType; ! strcpy(mzDescription, obj.mzDescription); // BAD, assumes obj has legal string ! model = 0; // model not copied } Index: tcDatabase.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcDatabase.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** tcDatabase.cpp 1 Jun 2005 00:13:29 -0000 1.27 --- tcDatabase.cpp 12 Jun 2005 20:46:57 -0000 1.28 *************** *** 37,40 **** --- 37,41 ---- #include "tcDBObjSerializerSql.h" #include "tcGenericDBObject.h" + #include "tcItemDBObject.h" #include "tcMissileDBObject.h" #include "tcLauncherDBObject.h" *************** *** 325,328 **** --- 326,337 ---- else serializer.Save(); } + // tcItemDBObject + { + tcDBObjSerializerSql<tcItemDBObject> + serializer(this, sqlConnection, "items"); + if (load) serializer.Load(); + else serializer.Save(); + } + |
|
From: Dewitt C. <ddc...@us...> - 2005-06-12 20:47:09
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv840/src/graphics Modified Files: tcContainerGui.cpp tcPlatformGui.cpp tcStoresGui.cpp Log Message: Drag and drop icon gui updates Index: tcStoresGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcStoresGui.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcStoresGui.cpp 11 Jun 2005 21:01:44 -0000 1.1 --- tcStoresGui.cpp 12 Jun 2005 20:46:58 -0000 1.2 *************** *** 94,98 **** const osg::Vec4 captionColor(1.0f, 1.0f, 1.0f, 1.0f); const char* unitName = parent->mzUnit.mz; ! wxString captionText = wxString::Format("%s Stores", unitName); DrawTextR(captionText.c_str(), 10.0f, 20.0f, defaultFont.get(), captionColor, 18.0f, LEFT_BASE_LINE); --- 94,100 ---- const osg::Vec4 captionColor(1.0f, 1.0f, 1.0f, 1.0f); const char* unitName = parent->mzUnit.mz; ! const std::string& storesDisplayName = stores->GetDisplayName(); ! ! wxString captionText = wxString::Format("%s: %s", unitName, storesDisplayName.c_str()); DrawTextR(captionText.c_str(), 10.0f, 20.0f, defaultFont.get(), captionColor, 18.0f, LEFT_BASE_LINE); Index: tcPlatformGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcPlatformGui.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcPlatformGui.cpp 11 Jun 2005 21:01:44 -0000 1.1 --- tcPlatformGui.cpp 12 Jun 2005 20:46:58 -0000 1.2 *************** *** 32,35 **** --- 32,36 ---- #include "tcFlightOpsObject.h" #include "tcDatabaseObject.h" + #include "tcGenericDBObject.h" #include "common/tinyxml.h" #include "tcTime.h" *************** *** 119,124 **** tcContainerSlot& slot = slots[n]; tcContainerItem* item = slot.GetItem(); ! tcStoresContainerItem* storesItem = dynamic_cast<tcStoresContainerItem*>(item); ! bool isMouseOver = slot.IsMouseOver(); --- 120,124 ---- tcContainerSlot& slot = slots[n]; tcContainerItem* item = slot.GetItem(); ! tcLauncherContainerItem* launcherItem = dynamic_cast<tcLauncherContainerItem*>(item); bool isMouseOver = slot.IsMouseOver(); *************** *** 144,157 **** } - // draw caption if mouse is over slot - if (isMouseOver) - { - const osg::Vec4 color(1.0f, 1.0f, 1.0f, 1.0f); - DrawTextR(item->GetItemName().c_str(), slot.loc.GetLeft(), slot.loc.GetTop() + 15.0f, defaultFont.get(), - color, 14.0f, LEFT_BASE_LINE); - - } } // draw expanded rectangle for slot border --- 144,176 ---- } } + + /* draw caption if mouse is over slot + ** If slot has item use item name, otherwise if launcher draw launcher + ** compatibility info + */ + if (isMouseOver) + { + const osg::Vec4 color(1.0f, 1.0f, 1.0f, 1.0f); + wxString caption; + if (item) + { + caption = item->GetItemName().c_str(); + } + else if (n < nLaunchers) + { + GetLauncherCompatibilityCaption(n, caption); + } + else + { + caption = ""; + } + + 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 *************** *** 169,172 **** --- 188,215 ---- } + // draw fuel state info under fuel icon if mouse is not over icon + tcContainerSlot& fuelSlot = slots[fuelIdx]; + if (!fuelSlot.IsMouseOver()) + { + float x = fuelSlot.loc.GetLeft(); + float y = fuelSlot.loc.GetTop() + 15.0f; + float fuelCapacity_kg = platform->mpDBObject->mfFuelCapacity_kg; + + wxString caption; + if (fuelCapacity_kg > 0) + { + caption = wxString::Format("Fuel: %.0f / %.0f kg", platform->fuel_kg, + fuelCapacity_kg); + } + else + { + caption = "Fuel: N/A"; + } + const osg::Vec4 color(1.0f, 1.0f, 1.0f, 1.0f); + + DrawTextR(caption.c_str(), x, y, defaultFont.get(), + color, 14.0f, LEFT_BASE_LINE); + } + DrawBorder(); *************** *** 175,178 **** --- 218,240 ---- } + /** + * Creates caption that describes compatible items for launcher + */ + void tcPlatformGui::GetLauncherCompatibilityCaption(unsigned int launcherIdx, wxString& caption) + { + caption = ""; + + tcLauncher* launcher = platform->GetLauncher(launcherIdx); + wxASSERT(launcher); + + unsigned int nTypes = launcher->GetCompatibleCount(); + for (unsigned int n=0; n<nTypes; n++) + { + wxString s = wxString::Format("%s(%d) ", launcher->GetCompatibleName(n).c_str(), + launcher->GetCompatibleQuantity(n)); + caption += s; + } + } + void tcPlatformGui::HandleDrop(size_t slotIdx, tcContainerItem* item) { *************** *** 180,183 **** --- 242,251 ---- if (storesItem == 0) return; // only handle entity items + if (slotIdx == fuelIdx) + { + HandleFuelDrop(storesItem); + return; + } + if (slotIdx >= nLaunchers) return; // only accept drops to launchers *************** *** 191,194 **** --- 259,277 ---- } + void tcPlatformGui::HandleFuelDrop(tcStoresContainerItem* item) + { + wxASSERT(item); + const std::string& itemName = item->GetItemName(); + if (itemName != "Fuel") return; + + tcStores* stores = item->GetStores(); + wxASSERT(stores); + if (stores == 0) return; + + stores->LoadOther(itemName, platform); + + tcSound::Get()->PlayEffect("Thuck"); + } + void tcPlatformGui::InitializeGui() { *************** *** 233,240 **** } // load icons magazineIcon = tc3DWindow::CreateTexturedSymbol("icons\\magazine.jpg", 32.0f); flightPortIcon = tc3DWindow::CreateTexturedSymbol("icons\\flightport.jpg", 32.0f); ! } --- 316,329 ---- } + // add fuel slot for refueling + fuelIdx = nLaunchers + nMagazines + nFlightPorts; + slotLoc.Set(fuelLoc.x, fuelLoc.x + slotSize, + fuelLoc.y, fuelLoc.y + slotSize); + AddSlot(slotLoc); + // load icons magazineIcon = tc3DWindow::CreateTexturedSymbol("icons\\magazine.jpg", 32.0f); flightPortIcon = tc3DWindow::CreateTexturedSymbol("icons\\flightport.jpg", 32.0f); ! fuelIcon = tc3DWindow::CreateTexturedSymbol("icons\\refuel.jpg", 32.0f); } *************** *** 367,370 **** --- 456,462 ---- double flightPortLocX = 0; double flightPortLocY = 0; + + double fuelLocX = 0; + double fuelLocY = 0; elt->Attribute("SlotSize", &slotSizeXml); *************** *** 383,386 **** --- 475,481 ---- elt->Attribute("FlightPortLocY", &flightPortLocY); + elt->Attribute("FuelLocX", &fuelLocX); + elt->Attribute("FuelLocY", &fuelLocY); + slotSize = slotSizeXml; *************** *** 397,400 **** --- 492,498 ---- flightPortLoc.x = flightPortLocX; flightPortLoc.y = flightPortLocY; + + fuelLoc.x = fuelLocX; + fuelLoc.y = fuelLocY; } *************** *** 427,431 **** } ! // update magazine slots (just add item if not added yet) for (size_t n=magazineIdx; n<magazineIdx+nMagazines; n++) { --- 525,529 ---- } ! // update magazine slots (add item if not added yet) for (size_t n=magazineIdx; n<magazineIdx+nMagazines; n++) { *************** *** 435,446 **** if (item == 0) { item = new tcContainerItem(); slot.SetItem(item); item->SetIcon(magazineIcon.get()); } slot.SetUpdated(true); } ! // update flightport slots (just add item if not added yet) for (size_t n=flightPortIdx; n<flightPortIdx+nFlightPorts; n++) { --- 533,547 ---- 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); } ! // update flightport slots (add item if not added yet) for (size_t n=flightPortIdx; n<flightPortIdx+nFlightPorts; n++) { *************** *** 453,460 **** slot.SetItem(item); item->SetIcon(flightPortIcon.get()); } slot.SetUpdated(true); } ! --- 554,585 ---- slot.SetItem(item); item->SetIcon(flightPortIcon.get()); + item->SetItemName("Right click to open"); } slot.SetUpdated(true); } ! ! // update refuel slot (add item if not added yet) ! { ! tcContainerSlot& slot = slots[fuelIdx]; ! ! tcContainerItem* item = slot.GetItem(); ! if (item == 0) ! { ! item = new tcContainerItem(); ! slot.SetItem(item); ! item->SetIcon(fuelIcon.get()); ! item->SetItemName("Drag fuel here to refuel"); ! } ! if (platform->IsRefueling()) ! { ! item->SetDrawState(tcContainerItem::BLINK); ! } ! else ! { ! item->SetDrawState(tcContainerItem::NORMAL); ! } ! ! slot.SetUpdated(true); ! } Index: tcContainerGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcContainerGui.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcContainerGui.cpp 11 Jun 2005 21:01:44 -0000 1.1 --- tcContainerGui.cpp 12 Jun 2005 20:46:58 -0000 1.2 *************** *** 220,223 **** --- 220,227 ---- } + /** + * @param slotIdx index of slot that is receiving drop + * @param item pointer to dropped item + */ void tcContainerGui::HandleDrop(size_t slotIdx, tcContainerItem* item) { |
|
From: Dewitt C. <ddc...@us...> - 2005-06-12 20:47:09
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv593/include/graphics Modified Files: tcPlatformGui.h Log Message: Drag and drop icon gui updates Index: tcPlatformGui.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcPlatformGui.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcPlatformGui.h 11 Jun 2005 21:01:43 -0000 1.1 --- tcPlatformGui.h 12 Jun 2005 20:46:27 -0000 1.2 *************** *** 46,49 **** --- 46,50 ---- class tcFlightOpsObject; class tcLauncher; + class tcStoresContainerItem; /** *************** *** 77,80 **** --- 78,82 ---- osg::ref_ptr<osg::Geometry> magazineIcon; osg::ref_ptr<osg::Geometry> flightPortIcon; + osg::ref_ptr<osg::Geometry> fuelIcon; size_t nLaunchers; ///< number of launchers (first idx = 0) *************** *** 83,86 **** --- 85,89 ---- size_t flightPortIdx; ///< slot index of first flightport size_t nFlightPorts; ///< number of flightports (normally 0 or 1) + size_t fuelIdx; ///< slot index of fuel slot float slotSize; ///< dimension of (square) slot *************** *** 90,99 **** wxRealPoint magazineOffset; ///< (x, y) offset between magazines wxRealPoint flightPortLoc; ///< upper-left of flightport ! void AddOrUpdateLauncherItem(tcContainerSlot& slot, tcDatabaseObject* child, tcLauncher* launcher, unsigned int launcherIdx, unsigned int quantity); void HandleDrop(size_t slotIdx, tcContainerItem* item); void InitializeGui(); void OpenFlightPortGui(tcContainerItem* item); --- 93,104 ---- wxRealPoint magazineOffset; ///< (x, y) offset between magazines wxRealPoint flightPortLoc; ///< upper-left of flightport ! wxRealPoint fuelLoc; ///< upper-left of fuel icon void AddOrUpdateLauncherItem(tcContainerSlot& slot, tcDatabaseObject* child, tcLauncher* launcher, unsigned int launcherIdx, unsigned int quantity); + void GetLauncherCompatibilityCaption(unsigned int launcherIdx, wxString& caption); void HandleDrop(size_t slotIdx, tcContainerItem* item); + void HandleFuelDrop(tcStoresContainerItem* item); void InitializeGui(); void OpenFlightPortGui(tcContainerItem* item); |
|
From: Dewitt C. <ddc...@us...> - 2005-06-12 20:47:08
|
Update of /cvsroot/gcblue/gcb_wx/include/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv593/include/scriptinterface Modified Files: tcScenarioInterface.h Log Message: Drag and drop icon gui updates Index: tcScenarioInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcScenarioInterface.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** tcScenarioInterface.h 1 Jun 2005 00:13:27 -0000 1.19 --- tcScenarioInterface.h 12 Jun 2005 20:46:27 -0000 1.20 *************** *** 92,96 **** std::string unitName, int locCode); void AddToUnitMagazine(const std::string& unitName, ! const std::string& item, unsigned int quantity); tcPlatformInterface GetUnitInterface(const std::string& unitName); void SetUnitLauncherItem(const std::string& unitName, --- 92,96 ---- std::string unitName, int locCode); void AddToUnitMagazine(const std::string& unitName, ! const std::string& item, unsigned long quantity); tcPlatformInterface GetUnitInterface(const std::string& unitName); void SetUnitLauncherItem(const std::string& unitName, |
|
From: Dewitt C. <ddc...@us...> - 2005-06-12 20:47:08
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv593/include/database Modified Files: CsvTranslator.h tcDBString.h tcDatabaseObject.h tcSqlReader.h tcStoresDBObject.h Added Files: tcItemDBObject.h Log Message: Drag and drop icon gui updates Index: tcDatabaseObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcDatabaseObject.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** tcDatabaseObject.h 11 Jun 2005 21:01:42 -0000 1.23 --- tcDatabaseObject.h 12 Jun 2005 20:46:27 -0000 1.24 *************** *** 114,117 **** --- 114,118 ---- #define DTYPE_TORPEDO 15 #define DTYPE_SONOBUOY 16 + #define DTYPE_ITEM 17 #define DTYPE_NULL 0xFFFFFFFF *************** *** 164,168 **** tcDatabaseObject(); ! tcDatabaseObject(tcDatabaseObject& obj); ///< copy constructor virtual ~tcDatabaseObject(); protected: --- 165,169 ---- tcDatabaseObject(); ! tcDatabaseObject(const tcDatabaseObject& obj); ///< copy constructor virtual ~tcDatabaseObject(); protected: Index: tcStoresDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcStoresDBObject.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcStoresDBObject.h 1 Jun 2005 00:13:26 -0000 1.3 --- tcStoresDBObject.h 12 Jun 2005 20:46:27 -0000 1.4 *************** *** 45,49 **** enum {MAX_STORES = 4}; std::string displayName; ! unsigned int capacity; float moveTime; ///< time to unload to or load from stores --- 45,49 ---- enum {MAX_STORES = 4}; std::string displayName; ! unsigned long capacity; float moveTime; ///< time to unload to or load from stores Index: tcDBString.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcDBString.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcDBString.h 1 Jun 2005 00:13:25 -0000 1.6 --- tcDBString.h 12 Jun 2005 20:46:27 -0000 1.7 *************** *** 55,58 **** --- 55,59 ---- tcDBString(); tcDBString(const char *buff); + tcDBString(const tcDBString& src); ~tcDBString(); }; Index: tcSqlReader.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcSqlReader.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcSqlReader.h 1 Jun 2005 00:13:26 -0000 1.3 --- tcSqlReader.h 12 Jun 2005 20:46:27 -0000 1.4 *************** *** 53,63 **** { public: ! double GetDouble(std::string& field); double GetDouble(const char* fmt, ...); ! int GetInt(std::string& field); int GetInt(const char* fmt, ...); ! std::string GetString(std::string& field); std::string GetString(const char* fmt, ...); --- 53,66 ---- { public: ! double GetDouble(const std::string& field); double GetDouble(const char* fmt, ...); ! int GetInt(const std::string& field); int GetInt(const char* fmt, ...); ! long GetLong(const std::string& field); ! long GetLong(const char* fmt, ...); ! ! std::string GetString(const std::string& field); std::string GetString(const char* fmt, ...); *************** *** 72,76 **** void BuildColumnLookup(sqlite::reader& tableInfo); ! unsigned int LookupFieldIndex(std::string& field); }; --- 75,79 ---- void BuildColumnLookup(sqlite::reader& tableInfo); ! unsigned int LookupFieldIndex(const std::string& field); }; --- NEW FILE: tcItemDBObject.h --- /** ** @file tcItemDBObject.h */ /* Copyright (C) 2005 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _ITEMDBOBJECT_H_ #define _ITEMDBOBJECT_H_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "tcDatabaseObject.h" #include <vector> class TiXmlElement; namespace database { class tcSqlReader; /** * Database object to describe generic item like fuel */ class tcItemDBObject : public tcDatabaseObject { public: virtual const char* GetClassName() {return "Item";} ///< returns class name of database object bool IsLeaf() const; ///< returns true if db obj is a leaf obj virtual void PrintToFile(tcFile& file); int Serialize(tcFile& file, bool mbLoad, UINT32 anVersion); int SerializeCSV(CsvTranslator* csv, bool mbLoad); ///< CSV serialization virtual void SerializeXml(TiXmlElement* node, bool load); ///< XML serialization static int WriteCSVHeader(CsvTranslator* csv); ///< writes column headings static void AddSqlColumns(std::string& columnString); void ReadSql(tcSqlReader& entry); void WriteSql(std::string& valueString); tcItemDBObject(); tcItemDBObject(const tcItemDBObject& obj); virtual ~tcItemDBObject(); }; } // namespace database #endif Index: CsvTranslator.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/CsvTranslator.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CsvTranslator.h 1 Jun 2005 00:13:25 -0000 1.6 --- CsvTranslator.h 12 Jun 2005 20:46:26 -0000 1.7 *************** *** 49,52 **** --- 49,53 ---- float GetFieldAsFloat(int n); int GetFieldAsInt(int n); + long GetFieldAsLong(int n); int GetFieldCount() const { return nfield; } void SetInputStream(std::istream* _inputStream) {inputStream = _inputStream;} *************** *** 64,68 **** CsvTranslator& operator>>(unsigned int& val); CsvTranslator& operator>>(unsigned short& val); ! CsvTranslator& operator>>(long& val); CsvTranslator& operator>>(std::string& s); --- 65,70 ---- CsvTranslator& operator>>(unsigned int& val); CsvTranslator& operator>>(unsigned short& val); ! CsvTranslator& operator>>(long& val); ! CsvTranslator& operator>>(unsigned long& val); CsvTranslator& operator>>(std::string& s); |
|
From: Dewitt C. <ddc...@us...> - 2005-06-12 20:46:43
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv593/include/sim Modified Files: tcLauncher.h tcPlatformObject.h tcStores.h Log Message: Drag and drop icon gui updates Index: tcLauncher.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcLauncher.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** tcLauncher.h 11 Jun 2005 21:01:43 -0000 1.17 --- tcLauncher.h 12 Jun 2005 20:46:28 -0000 1.18 *************** *** 140,144 **** unsigned int GetCapacityForItem(const std::string& item) const; unsigned int GetCompatibleCount() const; ! std::string GetCompatibleName(unsigned int idx) const; bool IsItemCompatible(const std::string& item) const; --- 140,145 ---- unsigned int GetCapacityForItem(const std::string& item) const; unsigned int GetCompatibleCount() const; ! const std::string& GetCompatibleName(unsigned int idx) const; ! unsigned int GetCompatibleQuantity(unsigned int idx) const; bool IsItemCompatible(const std::string& item) const; Index: tcStores.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcStores.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcStores.h 11 Jun 2005 21:01:43 -0000 1.4 --- tcStores.h 12 Jun 2005 20:46:33 -0000 1.5 *************** *** 58,62 **** public: std::string className; ! unsigned int quantity; tcDatabaseObject* GetDatabaseObject() const; --- 58,62 ---- public: std::string className; ! unsigned long quantity; tcDatabaseObject* GetDatabaseObject() const; *************** *** 64,68 **** StoreItem(); StoreItem(const StoreItem& src); ! StoreItem(const std::string& name, unsigned int qty); private: tcDatabaseObject* databaseObj; --- 64,68 ---- StoreItem(); StoreItem(const StoreItem& src); ! StoreItem(const std::string& name, unsigned long qty); private: tcDatabaseObject* databaseObj; *************** *** 73,79 **** struct StoreOperation { ! enum {UNLOAD = 0, LOAD = 1}; std::string item; ///< item type to transfer ! unsigned int quantity; ///< quantity of item float timeToComplete; ///< time left for op to complete [s] unsigned int launcherIdx; ///< launcher idx to transfer to/from --- 73,79 ---- struct StoreOperation { ! enum {UNLOAD = 0, LOAD = 1, REFUEL = 2}; std::string item; ///< item type to transfer ! unsigned long quantity; ///< quantity of item float timeToComplete; ///< time left for op to complete [s] unsigned int launcherIdx; ///< launcher idx to transfer to/from *************** *** 82,92 **** }; ! bool AddItems(const std::string& item, unsigned int quantity); ! unsigned int CurrentItemQuantity(const std::string& item) const; ! unsigned int CurrentQuantity() const; ! unsigned int IncomingQuantity() const; tcStoresDBObject* GetDatabaseObject() const; tcDatabaseObject* GetDatabaseObjectForItem(const std::string& item) const; ! /// name of <idx> type const std::string& GetItemName(unsigned int idx) const; --- 82,92 ---- }; ! 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; tcStoresDBObject* GetDatabaseObject() const; tcDatabaseObject* GetDatabaseObjectForItem(const std::string& item) const; ! const std::string& GetDisplayName() const; /// name of <idx> type const std::string& GetItemName(unsigned int idx) const; *************** *** 100,103 **** --- 100,104 ---- bool LoadLauncher(unsigned int idx, const std::string& item, tcGameObject* child = 0); + bool LoadOther(const std::string& item, tcGameObject* child = 0); void SetParent(tcPlatformObject* obj); bool UnloadLauncher(unsigned int idx, tcGameObject* child = 0); Index: tcPlatformObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcPlatformObject.h,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** tcPlatformObject.h 1 Jun 2005 00:13:28 -0000 1.29 --- tcPlatformObject.h 12 Jun 2005 20:46:33 -0000 1.30 *************** *** 112,123 **** tcStores* GetMagazine(unsigned int idx); unsigned int GetMagazineQuantity(const std::string& item); ! ! virtual bool IsInterceptingTrack(long id); ! virtual void Launch(tnPoolIndex& rnKey, unsigned& rnLauncher); virtual void RandInitNear(float afLon_deg, float afLat_deg); virtual void SetAltitude(float new_altitude_m); virtual void SetHeading(float afNewHeading); virtual void SetSpeed(float afNewSpeed); virtual int SetLaunch(int anLauncher, int anQuantity); --- 112,124 ---- tcStores* GetMagazine(unsigned int idx); unsigned int GetMagazineQuantity(const std::string& item); ! virtual bool IsInterceptingTrack(long id); ! bool IsRefueling() const; ! virtual void Launch(tnPoolIndex& rnKey, unsigned& rnLauncher); virtual void RandInitNear(float afLon_deg, float afLat_deg); virtual void SetAltitude(float new_altitude_m); virtual void SetHeading(float afNewHeading); + void SetRefueling(bool state); virtual void SetSpeed(float afNewSpeed); virtual int SetLaunch(int anLauncher, int anQuantity); *************** *** 148,151 **** --- 149,153 ---- protected: float lastHeadingDelta; // a workaround to smooth heading rate changes + bool isRefueling; ///< true if refuel is in progress virtual void ApplyRestrictions(); |
|
From: Dewitt C. <ddc...@us...> - 2005-06-11 21:05:17
|
Update of /cvsroot/gcblue/gcb_wx/images/icons/mis In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7400/images/icons/mis Added Files: aam_unk.jpg Log Message: Initial commit for drag and drop icon gui --- NEW FILE: aam_unk.jpg --- (This appears to be a binary file; contents omitted.) |