gcblue-commits Mailing List for Global Conflict Blue (Page 2)
Status: Alpha
Brought to you by:
ddcforge
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(112) |
Feb
(106) |
Mar
(88) |
Apr
(111) |
May
(53) |
Jun
(60) |
Jul
(58) |
Aug
(61) |
Sep
(45) |
Oct
(31) |
Nov
(71) |
Dec
(70) |
2005 |
Jan
(33) |
Feb
(57) |
Mar
(98) |
Apr
(47) |
May
(53) |
Jun
(79) |
Jul
(79) |
Aug
|
Sep
(33) |
Oct
(1) |
Nov
(20) |
Dec
(64) |
2006 |
Jan
(20) |
Feb
(1) |
Mar
(43) |
Apr
(11) |
May
(8) |
Jun
(23) |
Jul
|
Aug
(28) |
Sep
(58) |
Oct
(25) |
Nov
(47) |
Dec
(70) |
From: Dewitt C. <ddc...@us...> - 2006-12-15 03:38:51
|
Update of /cvsroot/gcblue/gcb_wx In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32056 Modified Files: GCblue.vcproj Log Message: Index: GCblue.vcproj =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/GCblue.vcproj,v retrieving revision 1.110 retrieving revision 1.111 diff -C2 -d -r1.110 -r1.111 *** GCblue.vcproj 13 Dec 2006 22:48:47 -0000 1.110 --- GCblue.vcproj 15 Dec 2006 03:38:48 -0000 1.111 *************** *** 1115,1118 **** --- 1115,1122 ---- </File> <File + RelativePath=".\src\ai\tcAttackMission.cpp" + > + </File> + <File RelativePath=".\src\ai\tcCAPMission.cpp" > *************** *** 2461,2464 **** --- 2465,2472 ---- </File> <File + RelativePath=".\include\ai\tcAttackMission.h" + > + </File> + <File RelativePath=".\include\ai\tcCAPMission.h" > |
From: Dewitt C. <ddc...@us...> - 2006-12-15 03:38:50
|
Update of /cvsroot/gcblue/gcb_wx/docs In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32056/docs Modified Files: CHANGES.txt Log Message: Index: CHANGES.txt =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/docs/CHANGES.txt,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** CHANGES.txt 28 Sep 2006 02:01:52 -0000 1.59 --- CHANGES.txt 15 Dec 2006 03:38:49 -0000 1.60 *************** *** 1,4 **** --- 1,11 ---- CHANGES + Fixed bug that caused crash when rewinding time. + + *** 2006-10-23 *** + - Multiplayer updates for recent versions + - Added fuel consumption penalty for ships at higher speeds + - Started scroll bars for chat text and info text windows + *** 2006-09-27 *** - More airbase automation work |
From: Dewitt C. <ddc...@us...> - 2006-12-15 03:38:50
|
Update of /cvsroot/gcblue/gcb_wx/include/scriptinterface In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32056/include/scriptinterface Modified Files: tcFlightPortInterface.h Log Message: Index: tcFlightPortInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcFlightPortInterface.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcFlightPortInterface.h 13 Dec 2006 02:10:58 -0000 1.13 --- tcFlightPortInterface.h 15 Dec 2006 03:38:49 -0000 1.14 *************** *** 107,110 **** --- 107,111 ---- void AddCAPMission(float lon_rad, float lat_rad); + void AddAttackMission(long targetId); tcFlightPortInterface(); |
From: Dewitt C. <ddc...@us...> - 2006-12-15 03:38:50
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32056/include/graphics Modified Files: tcOOBView.h Added Files: tcMapMissionObject.h Log Message: --- NEW FILE: tcMapMissionObject.h --- /** ** @file tcMapMissionObject.h */ /* Copyright (C) 2006 Dewitt Colclough (de...@gc...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _TCMAPMISSIONOBJECT_H_ #define _TCMAPMISSIONOBJECT_H_ #if _MSC_VER > 1000 #pragma once #endif #ifndef WX_PRECOMP #include "wx/wx.h" #endif // WX_PRECOMP #include "tcMapObject.h" class tc3DWindow; class tcStream; class tcCommandStream; class tcCreateStream; class tcUpdateStream; namespace ai { class tcMission; } /** * Class for displaying text */ class tcMapMissionObject : public tcMapObject { public: virtual void Draw(tc3DWindow* host); virtual tcUpdateStream& operator<<(tcUpdateStream& stream); virtual tcUpdateStream& operator>>(tcUpdateStream& stream); virtual void MoveToScreenPoint(const wxPoint& pos); void SetDragActive(bool state); bool ProcessKey(int keyCode); tcMapMissionObject(long platformId_, unsigned int missionId_); virtual ~tcMapMissionObject(); private: std::string caption; ///< text to display const long platformId; ///< platform id of mission host const unsigned int missionId; int updateCounter; ai::tcMission* GetMission(); void Update(); }; #endif Index: tcOOBView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcOOBView.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcOOBView.h 2 Dec 2006 02:23:48 -0000 1.9 --- tcOOBView.h 15 Dec 2006 03:38:49 -0000 1.10 *************** *** 103,106 **** --- 103,107 ---- void Draw(); void OnLButtonDown(wxMouseEvent& event); + void OnLButtonDClick(wxMouseEvent& event); void OnLButtonUp(wxMouseEvent& event); void OnMouseMove(wxMouseEvent& event); |
From: Dewitt C. <ddc...@us...> - 2006-12-14 00:27:44
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv23951/src/database Modified Files: tcPlatformDBObject.cpp Log Message: Index: tcPlatformDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcPlatformDBObject.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcPlatformDBObject.cpp 20 Nov 2006 00:17:41 -0000 1.1 --- tcPlatformDBObject.cpp 14 Dec 2006 00:27:42 -0000 1.2 *************** *** 168,171 **** --- 168,176 ---- columnString += ","; + columnString += "InitialYear number(4),"; + columnString += "FinalYear number(4),"; + columnString += "Country varchar(30),"; + columnString += "Designation varchar(5),"; + columnString += "MaxSpeed_kts number(8),"; columnString += "Accel_ktsps number(8),"; *************** *** 206,209 **** --- 211,218 ---- tcDatabaseObject::ReadSql(entry); + initialYear = entry.GetLong("InitialYear"); + finalYear = entry.GetLong("FinalYear"); + country = entry.GetString("Country"); + designation= entry.GetString("Designation"); mfMaxSpeed_kts = entry.GetDouble("MaxSpeed_kts"); mfAccel_ktsps = entry.GetDouble("Accel_ktsps"); *************** *** 272,275 **** --- 281,288 ---- s << ","; + s << initialYear; + s << finalYear; + s << "'" << country.c_str() << "',"; + s << "'" << designation.c_str() << "',"; s << mfMaxSpeed_kts << ","; s << mfAccel_ktsps << ","; |
From: Dewitt C. <ddc...@us...> - 2006-12-14 00:27:44
|
Update of /cvsroot/gcblue/gcb_wx/database In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv23951/database Modified Files: database.db Log Message: Index: database.db =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/database/database.db,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 Binary files /tmp/cvs2XnJr6 and /tmp/cvsQP1rSS differ |
From: Dewitt C. <ddc...@us...> - 2006-12-14 00:27:44
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv23951/include/database Modified Files: tcPlatformDBObject.h Log Message: Index: tcPlatformDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcPlatformDBObject.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcPlatformDBObject.h 20 Nov 2006 00:16:28 -0000 1.1 --- tcPlatformDBObject.h 14 Dec 2006 00:27:42 -0000 1.2 *************** *** 55,58 **** --- 55,62 ---- MAXMAGAZINES = 3 }; + int initialYear; ///< initial year platform was introduced + int finalYear; ///< final year platform was operational + std::string country; ///< country affiliation + std::string designation; ///< designation code, e.g. DDG, SSN float mfMaxSpeed_kts; ///< max speed, [kts] float mfAccel_ktsps; ///< [kts/s] acceleration, simple model |
From: Dewitt C. <ddc...@us...> - 2006-12-13 22:48:50
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv16403/src/sim Modified Files: tcRadar.cpp Log Message: Index: tcRadar.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcRadar.cpp,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** tcRadar.cpp 20 Nov 2006 00:17:44 -0000 1.42 --- tcRadar.cpp 13 Dec 2006 22:48:49 -0000 1.43 *************** *** 650,653 **** --- 650,658 ---- nClassification = PTYPE_SMALLSURFACE; } + else if (nClassification == PTYPE_CARRIER) + { + nClassification = PTYPE_LARGESURFACE; + } + pSMTrack->UpdateClassification(nClassification, eAffil, NULL_INDEX); pReport->mbClassified = 1; |
From: Dewitt C. <ddc...@us...> - 2006-12-13 22:48:50
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv16403/include/sim Modified Files: tcMapData.h Log Message: Index: tcMapData.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcMapData.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcMapData.h 17 Aug 2006 01:27:11 -0000 1.15 --- tcMapData.h 13 Dec 2006 22:48:48 -0000 1.16 *************** *** 46,51 **** #define M_LOWRES (int)180*120/K_DEC_LOWRES // latitude cells for low res global map #define N_LOWRES (int)360*120/K_DEC_LOWRES // longitude ! #define M_HIGHRES 800 ! #define N_HIGHRES 1200 #define N_DEMFILES 16 #define MAX_TILES 256 // maximum number of tiles available to hold high res map data --- 46,51 ---- #define M_LOWRES (int)180*120/K_DEC_LOWRES // latitude cells for low res global map #define N_LOWRES (int)360*120/K_DEC_LOWRES // longitude ! #define M_HIGHRES 1000 ! #define N_HIGHRES 1500 #define N_DEMFILES 16 #define MAX_TILES 256 // maximum number of tiles available to hold high res map data |
From: Dewitt C. <ddc...@us...> - 2006-12-13 22:48:50
|
Update of /cvsroot/gcblue/gcb_wx/database In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv16403/database Modified Files: database.db Log Message: Index: database.db =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/database/database.db,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 Binary files /tmp/cvsBgSMg5 and /tmp/cvsqQUUvW differ |
From: Dewitt C. <ddc...@us...> - 2006-12-13 22:48:49
|
Update of /cvsroot/gcblue/gcb_wx In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv16403 Modified Files: GCblue.vcproj Log Message: Index: GCblue.vcproj =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/GCblue.vcproj,v retrieving revision 1.109 retrieving revision 1.110 diff -C2 -d -r1.109 -r1.110 *** GCblue.vcproj 25 Nov 2006 19:26:34 -0000 1.109 --- GCblue.vcproj 13 Dec 2006 22:48:47 -0000 1.110 *************** *** 175,178 **** --- 175,179 ---- OptimizeReferences="2" EnableCOMDATFolding="2" + LinkTimeCodeGeneration="0" TargetMachine="1" /> *************** *** 466,469 **** --- 467,474 ---- </File> <File + RelativePath=".\src\graphics\tcMapMissionObject.cpp" + > + </File> + <File RelativePath="src\graphics\tcMapObject.cpp" > *************** *** 1796,1799 **** --- 1801,1808 ---- </File> <File + RelativePath=".\include\graphics\tcMapMissionObject.h" + > + </File> + <File RelativePath="include\graphics\tcMapObject.h" > |
From: Dewitt C. <ddc...@us...> - 2006-12-13 02:11:05
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32556/src/sim Modified Files: tcFlightPort.cpp Log Message: Interactive GUI icon for CAP station Index: tcFlightPort.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcFlightPort.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** tcFlightPort.cpp 6 Dec 2006 01:20:43 -0000 1.33 --- tcFlightPort.cpp 13 Dec 2006 02:10:59 -0000 1.34 *************** *** 739,742 **** --- 739,747 ---- tcMissionManager* tcFlightPort::GetMissionManager() { + return missionManager; + } + + tcMissionManager* tcFlightPort::GetOrCreateMissionManager() + { if (missionManager == 0) { |
From: Dewitt C. <ddc...@us...> - 2006-12-13 02:11:04
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32556/src/graphics Modified Files: tcFlightPortGui.cpp tcMapObject.cpp tcMapOverlay.cpp tcMapView.cpp Log Message: Interactive GUI icon for CAP station Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapView.cpp,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** tcMapView.cpp 11 Dec 2006 01:20:42 -0000 1.53 --- tcMapView.cpp 13 Dec 2006 02:10:58 -0000 1.54 *************** *** 2609,2612 **** --- 2609,2618 ---- int nChar = event.GetKeyCode(); + if (overlay->IsInteracting()) + { + overlay->OnChar(event); + return; + } + if (nChar == WXK_ESCAPE) { *************** *** 2656,2663 **** CheckForNavPointEdit(buttonDownPoint); ! if (hookedId.size() == 0) { overlay->OnLButtonDown(event); ! if (overlay->IsInteracting()) return; } --- 2662,2673 ---- CheckForNavPointEdit(buttonDownPoint); ! if (editPointIdx < 0) { overlay->OnLButtonDown(event); ! if (overlay->IsInteracting()) ! { ! ClearHook(); ! return; ! } } Index: tcMapOverlay.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapOverlay.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcMapOverlay.cpp 11 Dec 2006 01:20:42 -0000 1.5 --- tcMapOverlay.cpp 13 Dec 2006 02:10:58 -0000 1.6 *************** *** 110,113 **** --- 110,114 ---- { overlayObjects[hookedIdx]->SetIsHooked(false); + overlayObjects[hookedIdx]->SetDragActive(false); } *************** *** 127,135 **** --- 128,191 ---- redraw = true; + isInteracting = false; + } + + /** + * Safely delete objects that are IsFlaggedForDelete() + */ + void tcMapOverlay::DeleteFlaggedObjects() + { + tcMapObject* hookedObj = 0; + + if (isInteracting && (hookedIdx < overlayObjects.size())) + { + hookedObj = overlayObjects[hookedIdx]; + } + + std::vector<tcMapObject*> temp; + + for (size_t n=0; n<overlayObjects.size(); n++) + { + if (!overlayObjects[n]->IsFlaggedForDelete()) + { + temp.push_back(overlayObjects[n]); + } + else + { + redraw = true; + } + } + + overlayObjects = temp; + + if (hookedObj != 0) + { + for (size_t n=0; n<overlayObjects.size(); n++) + { + if (overlayObjects[n] == hookedObj) + { + hookedIdx = n; + return; + } + } + } + + ClearInteraction(); // hooked object was deleted + + } void tcMapOverlay::Draw() { + static int updateCounter = 0; + + if (updateCounter++ % 10 == 0) + { + redraw = true; + } + if (!redraw) return; + + DeleteFlaggedObjects(); for (size_t n=0; n < overlayObjects.size(); n++) *************** *** 145,153 **** void tcMapOverlay::HookObject(size_t idx) { ! if (isInteracting && (hookedIdx == idx)) return; // already hooked if (hookedIdx < overlayObjects.size()) { overlayObjects[hookedIdx]->SetIsHooked(false); // clear previous hook } --- 201,213 ---- void tcMapOverlay::HookObject(size_t idx) { ! if (isInteracting && (hookedIdx == idx)) ! { ! return; // already hooked ! } if (hookedIdx < overlayObjects.size()) { overlayObjects[hookedIdx]->SetIsHooked(false); // clear previous hook + overlayObjects[hookedIdx]->SetDragActive(false); } *************** *** 172,175 **** --- 232,250 ---- } + + void tcMapOverlay::OnChar(wxKeyEvent& event) + { + if (isInteracting && (hookedIdx < overlayObjects.size())) + { + int nChar = event.GetKeyCode(); + overlayObjects[hookedIdx]->ProcessKey(nChar); + } + else + { + event.Skip(); + } + } + + void tcMapOverlay::OnLButtonDown(wxMouseEvent& event) { *************** *** 186,189 **** --- 261,265 ---- { HookObject(n); + overlayObjects[n]->SetDragActive(true); Redraw(); return; *************** *** 198,202 **** void tcMapOverlay::OnLButtonUp(wxMouseEvent& event) { ! ClearInteraction(); } --- 274,283 ---- void tcMapOverlay::OnLButtonUp(wxMouseEvent& event) { ! if (!isInteracting) return; ! ! if (hookedIdx < overlayObjects.size()) ! { ! overlayObjects[hookedIdx]->SetDragActive(false); ! } } *************** *** 211,216 **** } ! overlayObjects[hookedIdx]->MoveToScreenPoint(event.GetPosition()); ! Redraw(); } --- 292,300 ---- } ! if (overlayObjects[hookedIdx]->IsDragActive()) ! { ! overlayObjects[hookedIdx]->MoveToScreenPoint(event.GetPosition()); ! Redraw(); ! } } Index: tcFlightPortGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcFlightPortGui.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcFlightPortGui.cpp 6 Dec 2006 01:20:42 -0000 1.14 --- tcFlightPortGui.cpp 13 Dec 2006 02:10:58 -0000 1.15 *************** *** 233,237 **** } ! if (flightPort->GetMissionManager()->IsAircraftReserved(air->mnID)) { itemColor = itemColor * 0.7; --- 233,237 ---- } ! if (flightPort->GetOrCreateMissionManager()->IsAircraftReserved(air->mnID)) { itemColor = itemColor * 0.7; Index: tcMapObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapObject.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcMapObject.cpp 11 Dec 2006 01:20:42 -0000 1.12 --- tcMapObject.cpp 13 Dec 2006 02:10:58 -0000 1.13 *************** *** 162,165 **** --- 162,172 ---- } + void tcMapObject::FlagForDelete() + { + flaggedForDelete = true; + isActive = false; + } + + /** * @return screen distance from screen point pos *************** *** 173,176 **** --- 180,195 ---- } + bool tcMapObject::IsDragActive() const + { + return dragActive; + } + + + bool tcMapObject::IsFlaggedForDelete() const + { + return flaggedForDelete; + } + + bool tcMapObject::IsInteractive() const { *************** *** 211,214 **** --- 230,246 ---- } + /** + * @return false if keyCode is valid command for this object + */ + bool tcMapObject::ProcessKey(int keyCode) + { + return false; + } + + void tcMapObject::SetDragActive(bool state) + { + dragActive = state; + } + void tcMapObject::SetIsHooked(bool state) *************** *** 231,237 **** } ! tcMapObject::tcMapObject() { - tcMapObject(0,0); } --- 263,274 ---- } ! tcMapObject::tcMapObject() : ! _x(0), _y(0), ! useRelativeCoords(false), ! isInteractive(false), ! isHooked(false), ! flaggedForDelete(false), ! dragActive(false) { } *************** *** 239,243 **** : useRelativeCoords(useRel), isInteractive(false), ! isHooked(false) { if (useRel) --- 276,282 ---- : useRelativeCoords(useRel), isInteractive(false), ! isHooked(false), ! flaggedForDelete(false), ! dragActive(false) { if (useRel) |
From: Dewitt C. <ddc...@us...> - 2006-12-13 02:11:04
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32556/src/scriptinterface Modified Files: tcFlightPortInterface.cpp tcSimPythonInterface.cpp Log Message: Interactive GUI icon for CAP station Index: tcFlightPortInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcFlightPortInterface.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcFlightPortInterface.cpp 24 Oct 2006 01:34:05 -0000 1.13 --- tcFlightPortInterface.cpp 13 Dec 2006 02:10:59 -0000 1.14 *************** *** 32,35 **** --- 32,37 ---- #include "tcFlightPortInterface.h" #include "tcPlatformInterface.h" + #include "tcMapOverlay.h" + #include "tcMapMissionObject.h" #include "tcSimState.h" #include "simmath.h" *************** *** 81,84 **** --- 83,87 ---- tcSimState* tcFlightPortInterface::mpSimState = 0; tcSoundConsole* tcFlightPortInterface::mpConsole = 0; + tcMapOverlay* tcFlightPortInterface::overlay = 0; *************** *** 87,91 **** if (flightport == 0) return; ! tcMissionManager* missionManager = flightport->GetMissionManager(); tcCAPMission* cap = new tcCAPMission(); --- 90,94 ---- if (flightport == 0) return; ! tcMissionManager* missionManager = flightport->GetOrCreateMissionManager(); tcCAPMission* cap = new tcCAPMission(); *************** *** 94,97 **** --- 97,104 ---- missionManager->AddMission(cap); + tcMapMissionObject* missionObj = new tcMapMissionObject(flightport->parent->mnID, cap->GetId()); + missionObj->SetInteractive(true); + + overlay->AddMapObject(missionObj); } Index: tcSimPythonInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcSimPythonInterface.cpp,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** tcSimPythonInterface.cpp 6 Dec 2006 01:20:43 -0000 1.47 --- tcSimPythonInterface.cpp 13 Dec 2006 02:10:59 -0000 1.48 *************** *** 433,436 **** --- 433,437 ---- overlay = mo; tcScenarioInterface::AttachMapOverlay(mo); + tcFlightPortInterface::AttachMapOverlay(mo); } |
From: Dewitt C. <ddc...@us...> - 2006-12-13 02:11:04
|
Update of /cvsroot/gcblue/gcb_wx/src/ai In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32556/src/ai Modified Files: tcCAPMission.cpp tcMissionManager.cpp Log Message: Interactive GUI icon for CAP station Index: tcCAPMission.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/ai/tcCAPMission.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcCAPMission.cpp 24 Oct 2006 01:34:01 -0000 1.3 --- tcCAPMission.cpp 13 Dec 2006 02:10:58 -0000 1.4 *************** *** 44,47 **** --- 44,49 ---- void tcCAPMission::CalculatePatrolOffset() { + if (missionManager == 0) return; + tcGameObject* parent = missionManager->GetFlightportParent(); if (parent == 0) *************** *** 55,58 **** --- 57,66 ---- } + void tcCAPMission::GetPatrolOffset(float& range_km_, float& az_deg_) const + { + range_km_ = range_km; + az_deg_ = az_deg; + } + /** *************** *** 81,84 **** --- 89,94 ---- station.x = lon_rad; station.y = lat_rad; + + CalculatePatrolOffset(); } *************** *** 109,113 **** if (missionAircraft.size() == 0) return; // none available ! CalculatePatrolOffset(); stage = "outfit"; --- 119,123 ---- if (missionAircraft.size() == 0) return; // none available ! CalculatePatrolOffset(); stage = "outfit"; *************** *** 186,189 **** --- 196,227 ---- } + void tcCAPMission::UpdateStation() + { + if (missionManager == 0) + { + wxASSERT(false); + return; + } + + tcSimState* simState = tcSimState::Get(); + + for (size_t n=0; n<missionAircraft.size(); n++) + { + tcPlatformObject* obj = dynamic_cast<tcPlatformObject*>(simState->GetObjectByName(missionAircraft[n].name)); + if (obj != 0) + { + ai::Brain* brain = obj->GetBrain(); + ai::BlackboardInterface bb = brain->GetBlackboardInterface(); + + wxString s; + s.Printf("%.1f", range_km); + bb.Write("PatrolRange_km", s.c_str()); + + s.Printf("%.1f", az_deg); + bb.Write("PatrolAzimuth_deg", s.c_str()); + } + } + } + const tcCAPMission& tcCAPMission::operator=(const tcCAPMission& src) *************** *** 210,215 **** : tcMission(), quantity(2), ! range_km(80), ! az_deg(225) { --- 248,253 ---- : tcMission(), quantity(2), ! range_km(0), ! az_deg(0) { Index: tcMissionManager.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/ai/tcMissionManager.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcMissionManager.cpp 24 Oct 2006 01:34:02 -0000 1.3 --- tcMissionManager.cpp 13 Dec 2006 02:10:58 -0000 1.4 *************** *** 98,101 **** --- 98,114 ---- } + tcMission* tcMissionManager::GetMission(unsigned int id) + { + for (size_t n=0; n<missions.size(); n++) + { + if (missions[n]->GetId() == id) + { + return missions[n]; + } + } + + return 0; + } + bool tcMissionManager::IsAircraftReserved(long id) const { |
From: Dewitt C. <ddc...@us...> - 2006-12-13 02:11:04
|
Update of /cvsroot/gcblue/gcb_wx/scripts In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32556/scripts Modified Files: AirMissions.py Log Message: Interactive GUI icon for CAP station Index: AirMissions.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/AirMissions.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AirMissions.py 23 Nov 2006 00:08:15 -0000 1.2 --- AirMissions.py 13 Dec 2006 02:10:58 -0000 1.3 *************** *** 62,67 **** return ! patrol_range_km = TI.GetMemoryValue(10) ! patrol_az_rad = TI.GetMemoryValue(11) anchor_id = TI.GetMemoryValue(12) --- 62,67 ---- return ! patrol_range_km = GetMessageParam(BB, 'PatrolRange_km') ! patrol_az_rad = deg_to_rad * GetMessageParam(BB, 'PatrolAzimuth_deg') # rel to north anchor_id = TI.GetMemoryValue(12) |
From: Dewitt C. <ddc...@us...> - 2006-12-13 02:11:04
|
Update of /cvsroot/gcblue/gcb_wx/include/scriptinterface In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32556/include/scriptinterface Modified Files: tcFlightPortInterface.h Log Message: Interactive GUI icon for CAP station Index: tcFlightPortInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcFlightPortInterface.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcFlightPortInterface.h 24 Oct 2006 01:34:00 -0000 1.12 --- tcFlightPortInterface.h 13 Dec 2006 02:10:58 -0000 1.13 *************** *** 38,41 **** --- 38,42 ---- class tcSimState; class tcSoundConsole; + class tcMapOverlay; using namespace boost::python; *************** *** 109,115 **** tcFlightPortInterface(); virtual ~tcFlightPortInterface(); private: ! static tcSimState *mpSimState; ! static tcSoundConsole *mpConsole; char buff[128]; }; --- 110,120 ---- tcFlightPortInterface(); virtual ~tcFlightPortInterface(); + + static void AttachMapOverlay(tcMapOverlay* mo) {overlay = mo;} + private: ! static tcSimState* mpSimState; ! static tcSoundConsole* mpConsole; ! static tcMapOverlay* overlay; char buff[128]; }; |
From: Dewitt C. <ddc...@us...> - 2006-12-13 02:11:04
|
Update of /cvsroot/gcblue/gcb_wx/include/ai In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32556/include/ai Modified Files: tcCAPMission.h tcMissionManager.h Log Message: Interactive GUI icon for CAP station Index: tcMissionManager.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/ai/tcMissionManager.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcMissionManager.h 24 Oct 2006 01:33:57 -0000 1.3 --- tcMissionManager.h 13 Dec 2006 02:10:58 -0000 1.4 *************** *** 62,65 **** --- 62,67 ---- void Update(double t); + tcMission* GetMission(unsigned int id); + tcMissionManager(tcFlightPort* fp); virtual ~tcMissionManager(); Index: tcCAPMission.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/ai/tcCAPMission.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcCAPMission.h 24 Oct 2006 01:33:57 -0000 1.2 --- tcCAPMission.h 13 Dec 2006 02:10:58 -0000 1.3 *************** *** 41,45 **** --- 41,48 ---- void SetStation(float lon_rad, float lat_rad); + void GetPatrolOffset(float& range_km_, float& az_deg_) const; + virtual void Update(double t); + void UpdateStation(); const tcCAPMission& operator=(const tcCAPMission& src); |
From: Dewitt C. <ddc...@us...> - 2006-12-13 02:11:04
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32556/include/graphics Modified Files: tcMapObject.h tcMapOverlay.h Log Message: Interactive GUI icon for CAP station Index: tcMapOverlay.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMapOverlay.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcMapOverlay.h 11 Dec 2006 01:20:41 -0000 1.6 --- tcMapOverlay.h 13 Dec 2006 02:10:58 -0000 1.7 *************** *** 58,63 **** void ClearMapObjects(); void Draw(); ! /// declared public here to allow parent MapView to call ! void OnSize(wxSizeEvent& event); /// redraw overlay during next call to Draw() void Redraw(); --- 58,62 ---- void ClearMapObjects(); void Draw(); ! /// redraw overlay during next call to Draw() void Redraw(); *************** *** 66,73 **** bool IsInteracting() const; void OnLButtonDown(wxMouseEvent& event); void OnLButtonUp(wxMouseEvent& event); void OnMouseMove(wxMouseEvent& event); ! virtual tcUpdateStream& operator<<(tcUpdateStream& stream); --- 65,73 ---- bool IsInteracting() const; + void OnChar(wxKeyEvent& event); void OnLButtonDown(wxMouseEvent& event); void OnLButtonUp(wxMouseEvent& event); void OnMouseMove(wxMouseEvent& event); ! void OnSize(wxSizeEvent& event); virtual tcUpdateStream& operator<<(tcUpdateStream& stream); *************** *** 87,91 **** size_t hookedIdx; ! void ClearInteraction(); void HookObject(size_t idx); }; --- 87,92 ---- size_t hookedIdx; ! void ClearInteraction(); ! void DeleteFlaggedObjects(); void HookObject(size_t idx); }; Index: tcMapObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMapObject.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcMapObject.h 11 Dec 2006 01:20:41 -0000 1.13 --- tcMapObject.h 13 Dec 2006 02:10:58 -0000 1.14 *************** *** 74,82 **** bool IsInteractive() const; void SetInteractive(bool state); float GetScreenDistanceFrom(const wxPoint& pos); void SetIsHooked(bool state); ! void MoveToScreenPoint(const wxPoint& pos); static void SetMapView(tcMapView *mv); --- 74,88 ---- bool IsInteractive() const; void SetInteractive(bool state); + + void FlagForDelete(); + bool IsFlaggedForDelete() const; float GetScreenDistanceFrom(const wxPoint& pos); void SetIsHooked(bool state); ! virtual void MoveToScreenPoint(const wxPoint& pos); ! bool IsDragActive() const; ! virtual void SetDragActive(bool state); ! virtual bool ProcessKey(int keyCode); static void SetMapView(tcMapView *mv); *************** *** 93,97 **** bool markerEnabled; ///< true to draw X marker with text bool isInteractive; ///< true if object can be hooked on map ! bool isHooked; /// true if obj is hooked tcPoint GetScreenPoint() const; --- 99,109 ---- bool markerEnabled; ///< true to draw X marker with text bool isInteractive; ///< true if object can be hooked on map ! bool isHooked; ///< true if obj is hooked ! bool flaggedForDelete; ///< true to safely delete (in overlay) ! bool dragActive; ! ! bool useRelativeCoords; ///< interpret lat_rad and lon_rad as rel screen coords [0-1] ! double _x; ///< radian latitude or relative screen x coord ! double _y; ///< radian longitude or relative screen y coord tcPoint GetScreenPoint() const; *************** *** 101,107 **** private: - bool useRelativeCoords; ///< interpret lat_rad and lon_rad as rel screen coords [0-1] - double _x; ///< radian latitude or relative screen x coord - double _y; ///< radian longitude or relative screen y coord }; --- 113,116 ---- |
From: Dewitt C. <ddc...@us...> - 2006-12-13 02:11:04
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32556/include/sim Modified Files: tcFlightPort.h Log Message: Interactive GUI icon for CAP station Index: tcFlightPort.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcFlightPort.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcFlightPort.h 27 Nov 2006 00:46:24 -0000 1.18 --- tcFlightPort.h 13 Dec 2006 02:10:58 -0000 1.19 *************** *** 155,158 **** --- 155,159 ---- ai::tcMissionManager* GetMissionManager(); + ai::tcMissionManager* GetOrCreateMissionManager(); tcCommandStream& operator<<(tcCommandStream& stream); |
From: Dewitt C. <ddc...@us...> - 2006-12-11 01:20:46
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32130/src/graphics Modified Files: tcMapObject.cpp tcMapOverlay.cpp tcMapView.cpp Log Message: Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapView.cpp,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** tcMapView.cpp 6 Dec 2006 01:20:42 -0000 1.52 --- tcMapView.cpp 11 Dec 2006 01:20:42 -0000 1.53 *************** *** 2656,2659 **** --- 2656,2665 ---- CheckForNavPointEdit(buttonDownPoint); + if (hookedId.size() == 0) + { + overlay->OnLButtonDown(event); + if (overlay->IsInteracting()) return; + } + isLButtonDown = true; *************** *** 2730,2733 **** --- 2736,2745 ---- tcDragStatus::Get()->StopDrag(); + if (overlay->IsInteracting()) + { + overlay->OnLButtonUp(event); + return; + } + if (!isLButtonDown) return; *************** *** 2829,2832 **** --- 2841,2849 ---- UpdateEdgeScroll(point); } + + if (overlay->IsInteracting()) + { + overlay->OnMouseMove(event); + } } Index: tcMapOverlay.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapOverlay.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcMapOverlay.cpp 17 Aug 2006 01:28:04 -0000 1.4 --- tcMapOverlay.cpp 11 Dec 2006 01:20:42 -0000 1.5 *************** *** 105,108 **** --- 105,121 ---- } + void tcMapOverlay::ClearInteraction() + { + if (hookedIdx < overlayObjects.size()) + { + overlayObjects[hookedIdx]->SetIsHooked(false); + } + + isInteracting = false; + hookedIdx = 99999; + + Redraw(); + } + void tcMapOverlay::ClearMapObjects() { *************** *** 130,133 **** --- 143,218 ---- } + void tcMapOverlay::HookObject(size_t idx) + { + if (isInteracting && (hookedIdx == idx)) return; // already hooked + + if (hookedIdx < overlayObjects.size()) + { + overlayObjects[hookedIdx]->SetIsHooked(false); // clear previous hook + } + + if (idx >= overlayObjects.size()) // clear hook + { + ClearInteraction(); + return; + } + + overlayObjects[idx]->SetIsHooked(true); + hookedIdx = idx; + isInteracting = true; + } + + + /** + * @return true if player is interacting with overlay + */ + bool tcMapOverlay::IsInteracting() const + { + return isInteracting; + } + + void tcMapOverlay::OnLButtonDown(wxMouseEvent& event) + { + wxPoint pos = event.GetPosition(); + + for (size_t n=0; n < overlayObjects.size(); n++) + { + tcMapObject* obj = overlayObjects[n]; + + if (true || obj->IsInteractive()) + { + float dist = overlayObjects[n]->GetScreenDistanceFrom(pos); + if (dist < 5.0f) + { + HookObject(n); + Redraw(); + return; + } + } + } + + ClearInteraction(); + + } + + void tcMapOverlay::OnLButtonUp(wxMouseEvent& event) + { + ClearInteraction(); + } + + void tcMapOverlay::OnMouseMove(wxMouseEvent& event) + { + if (!isInteracting) return; + + if (hookedIdx >= overlayObjects.size()) + { + wxASSERT(false); + return; + } + + overlayObjects[hookedIdx]->MoveToScreenPoint(event.GetPosition()); + Redraw(); + } + void tcMapOverlay::OnSize(wxSizeEvent& event) *************** *** 156,160 **** const wxString& name) : tc3DWindow(parent, pos, size, name, 0), ! redraw(false) { --- 241,247 ---- const wxString& name) : tc3DWindow(parent, pos, size, name, 0), ! redraw(false), ! isInteracting(false), ! hookedIdx(0) { Index: tcMapObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapObject.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcMapObject.cpp 17 Aug 2006 01:28:04 -0000 1.11 --- tcMapObject.cpp 11 Dec 2006 01:20:42 -0000 1.12 *************** *** 155,158 **** --- 155,179 ---- host->DrawLineR(x+8, y-8, x-8, y+8, color); } + + if (isHooked) + { + host->DrawLineR(x-8, y-10, x+8, y-10, color); + } + } + + /** + * @return screen distance from screen point pos + */ + float tcMapObject::GetScreenDistanceFrom(const wxPoint& pos) + { + tcPoint screenPoint = GetScreenPoint(); + tcPoint refPoint((float)pos.x, (float)pos.y); + + return screenPoint.DistanceTo(refPoint); + } + + bool tcMapObject::IsInteractive() const + { + return isInteractive; } *************** *** 174,177 **** --- 195,225 ---- } + void tcMapObject::MoveToScreenPoint(const wxPoint& pos) + { + wxASSERT(mapView); + if (!useRelativeCoords) + { + tcPoint p = mapView->ScreenToGeo((float)pos.x, (float)pos.y); + _x = p.x; + _y = p.y; + } + else + { + _x = (double)pos.x; + _y = (double)pos.y; + } + } + + + void tcMapObject::SetIsHooked(bool state) + { + isHooked = state; + } + + void tcMapObject::SetInteractive(bool state) + { + isInteractive = state; + } + /** * mapView is used to translate lat/lon coords into screen coords. *************** *** 189,193 **** tcMapObject::tcMapObject(double x, double y, bool useRel) ! : useRelativeCoords(useRel) { if (useRel) --- 237,243 ---- tcMapObject::tcMapObject(double x, double y, bool useRel) ! : useRelativeCoords(useRel), ! isInteractive(false), ! isHooked(false) { if (useRel) *************** *** 259,262 **** --- 309,323 ---- } + if (isHooked) + { + const osg::Vec4 hookColor(1, 1, 1, 1); + const float a = 10.0f; + + host->DrawLineR(x-a, y-a, x+a, y-a, hookColor); + host->DrawLineR(x-a, y+a, x+a, y+a, hookColor); + host->DrawLineR(x-a, y-a, x-a, y+a, hookColor); + host->DrawLineR(x+a, y-a, x+a, y+a, hookColor); + } + } |
From: Dewitt C. <ddc...@us...> - 2006-12-11 01:20:46
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32130/include/graphics Modified Files: tcMapObject.h tcMapOverlay.h Log Message: Index: tcMapOverlay.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMapOverlay.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcMapOverlay.h 24 Oct 2006 01:33:57 -0000 1.5 --- tcMapOverlay.h 11 Dec 2006 01:20:41 -0000 1.6 *************** *** 64,67 **** --- 64,74 ---- void SetColor(osg::Vec4& color); + bool IsInteracting() const; + + void OnLButtonDown(wxMouseEvent& event); + void OnLButtonUp(wxMouseEvent& event); + void OnMouseMove(wxMouseEvent& event); + + virtual tcUpdateStream& operator<<(tcUpdateStream& stream); virtual tcUpdateStream& operator>>(tcUpdateStream& stream); *************** *** 76,80 **** std::vector<tcMapObject*> overlayObjects; // objects to draw /// used to redraw (create and add objects to scenegraph) only when necessary ! bool redraw; }; --- 83,92 ---- std::vector<tcMapObject*> overlayObjects; // objects to draw /// used to redraw (create and add objects to scenegraph) only when necessary ! bool redraw; ! bool isInteracting; ! size_t hookedIdx; ! ! void ClearInteraction(); ! void HookObject(size_t idx); }; Index: tcMapObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMapObject.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcMapObject.h 17 Aug 2006 01:27:10 -0000 1.12 --- tcMapObject.h 11 Dec 2006 01:20:41 -0000 1.13 *************** *** 68,73 **** void SetActive(bool active) {isActive = active;} void SetColor(osg::Vec4 c) {color = c;} void SetMarkerActive(bool active) {markerEnabled = active;} ! void SetUseScreenCoords(bool active) {useRelativeCoords = active;} static void SetMapView(tcMapView *mv); --- 68,83 ---- void SetActive(bool active) {isActive = active;} void SetColor(osg::Vec4 c) {color = c;} + void SetMarkerActive(bool active) {markerEnabled = active;} ! void SetUseScreenCoords(bool active) {useRelativeCoords = active;} ! ! bool IsInteractive() const; ! void SetInteractive(bool state); ! ! float GetScreenDistanceFrom(const wxPoint& pos); ! void SetIsHooked(bool state); ! ! void MoveToScreenPoint(const wxPoint& pos); ! static void SetMapView(tcMapView *mv); *************** *** 82,85 **** --- 92,97 ---- protected: bool markerEnabled; ///< true to draw X marker with text + bool isInteractive; ///< true if object can be hooked on map + bool isHooked; /// true if obj is hooked tcPoint GetScreenPoint() const; |
From: Dewitt C. <ddc...@us...> - 2006-12-11 01:20:46
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32130/src/sim Modified Files: tcLauncherState.cpp Log Message: Index: tcLauncherState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcLauncherState.cpp,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** tcLauncherState.cpp 6 Dec 2006 01:20:43 -0000 1.40 --- tcLauncherState.cpp 11 Dec 2006 01:20:42 -0000 1.41 *************** *** 342,347 **** if (!tcSimState::Get()->IsMultiplayerServer()) { ! wxString msg = wxString::Format("Out of range (%.1f km)", ! maxRange_km); tcGame::DisplayMessage(msg.c_str()); } --- 342,347 ---- if (!tcSimState::Get()->IsMultiplayerServer()) { ! wxString msg = wxString::Format("%s gun out of range (%.1f km)", ! parent->GetName(), maxRange_km); tcGame::DisplayMessage(msg.c_str()); } |
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv22513/src/sim Modified Files: Game.cpp tcAero.cpp tcFlightPort.cpp tcLauncherState.cpp tcMissileObject.cpp tcOpticalSensor.cpp tcSensorState.cpp Log Message: Index: tcMissileObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMissileObject.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** tcMissileObject.cpp 20 Nov 2006 00:17:44 -0000 1.37 --- tcMissileObject.cpp 6 Dec 2006 01:20:43 -0000 1.38 *************** *** 54,66 **** stream >> mfGoalHeading_rad; stream >> mfGoalPitch_rad; - stream >> mfGoalSpeed_kts; - stream >> mfInterceptTime; - stream >> mfLastGuidanceUpdate; - stream >> mfGuidanceUpdateInterval; - msWaypoint << stream; stream >> mfRangeToObjective_km; - stream >> mnCurrentSegment; msKState << stream; tcSensorState* sensor = GetSensorMutable(0); if (sensor) --- 54,71 ---- stream >> mfGoalHeading_rad; stream >> mfGoalPitch_rad; stream >> mfRangeToObjective_km; msKState << stream; + + // update msKState params from mcKin to save bandwidth + msKState.mfSpeed_mps = C_KTSTOMPS * mcKin.mfSpeed_kts; + msKState.mfGroundSpeed_mps = cosf(mcKin.mfClimbAngle_rad) * msKState.mfSpeed_mps; + msKState.mfPitch_rad = mcKin.mfPitch_rad; + msKState.mfHeading_rad = mcKin.mfHeading_rad; + msKState.mfAltitude_m = mcKin.mfAlt_m; + + mfInterceptTime = (msKState.mfSpeed_mps > 0) ? 1000.0f * mfRangeToObjective_km / msKState.mfSpeed_mps : 999.9; + + tcSensorState* sensor = GetSensorMutable(0); if (sensor) *************** *** 81,91 **** stream << mfGoalHeading_rad; stream << mfGoalPitch_rad; - stream << mfGoalSpeed_kts; - stream << mfInterceptTime; - stream << mfLastGuidanceUpdate; - stream << mfGuidanceUpdateInterval; - msWaypoint >> stream; stream << mfRangeToObjective_km; - stream << mnCurrentSegment; msKState >> stream; --- 86,90 ---- *************** *** 769,773 **** tcGameObject::SaveToFile(file); file.Write(&mfGoalHeading_rad,sizeof(mfGoalHeading_rad)); - file.Write(&mfGoalSpeed_kts,sizeof(mfGoalSpeed_kts)); file.Write(&mfInterceptTime,sizeof(mfInterceptTime)); file.Write(&mfLastGuidanceUpdate,sizeof(mfLastGuidanceUpdate)); --- 768,771 ---- *************** *** 792,796 **** tcGameObject::LoadFromFile(file); file.Read(&mfGoalHeading_rad,sizeof(mfGoalHeading_rad)); - file.Read(&mfGoalSpeed_kts,sizeof(mfGoalSpeed_kts)); file.Read(&mfInterceptTime,sizeof(mfInterceptTime)); file.Read(&mfLastGuidanceUpdate,sizeof(mfLastGuidanceUpdate)); --- 790,793 ---- *************** *** 852,856 **** mfGoalHeading_rad = o.mfGoalHeading_rad; mfGoalPitch_rad = o.mfGoalPitch_rad; - mfGoalSpeed_kts = o.mfGoalSpeed_kts; mfInterceptTime = o.mfInterceptTime; subSurfaceLaunch = o.subSurfaceLaunch; --- 849,852 ---- Index: tcFlightPort.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcFlightPort.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** tcFlightPort.cpp 2 Dec 2006 02:23:48 -0000 1.32 --- tcFlightPort.cpp 6 Dec 2006 01:20:43 -0000 1.33 *************** *** 93,97 **** tcUpdateStream& tcAirState::operator<<(tcUpdateStream& stream) { ! char val; stream >> val; --- 93,99 ---- tcUpdateStream& tcAirState::operator<<(tcUpdateStream& stream) { ! bool detailedUpdate = (stream.GetDetailLevel() > 0); ! ! char val; stream >> val; *************** *** 115,119 **** // if this obj is in a ready or launch spot, then update launcher and fuel state ! if (current_location != HANGAR) { if (tcPlatformObject* platform = dynamic_cast<tcPlatformObject*>(obj)) --- 117,121 ---- // if this obj is in a ready or launch spot, then update launcher and fuel state ! if (detailedUpdate || (current_location != HANGAR)) { if (tcPlatformObject* platform = dynamic_cast<tcPlatformObject*>(obj)) *************** *** 149,152 **** --- 151,161 ---- tcUpdateStream& tcAirState::operator>>(tcUpdateStream& stream) { + bool detailedUpdate = (stream.GetDetailLevel() > 0); + + if (detailedUpdate) + { + int jj = 55; + } + char val; *************** *** 169,173 **** stream << x; ! if (current_location != HANGAR) { if (tcPlatformObject* platform = dynamic_cast<tcPlatformObject*>(obj)) --- 178,182 ---- stream << x; ! if (detailedUpdate || (current_location != HANGAR)) { if (tcPlatformObject* platform = dynamic_cast<tcPlatformObject*>(obj)) *************** *** 210,213 **** --- 219,234 ---- unsigned short nChildren = GetCount(); + unsigned char detailedUpdate; + stream >> detailedUpdate; + + if (detailedUpdate == 1) + { + stream.SetDetailLevel(1); + } + else + { + stream.SetDetailLevel(0); + } + unsigned char nUpdate; stream >> nUpdate; *************** *** 293,304 **** tcUpdateStream& tcFlightPort::operator>>(tcUpdateStream& stream) { - long freeSpace = stream.GetMaxSize() - stream.size() - 1; // 1 byte for update count header - // if freeSpace < 0, the message should be rejected anyway so don't worry about special case // for this tcUpdateStream tempStream1; tcUpdateStream tempStream2; unsigned short nChildren = GetCount(); if (nextUpdateIdx >= nChildren) nextUpdateIdx = 0; --- 314,335 ---- tcUpdateStream& tcFlightPort::operator>>(tcUpdateStream& stream) { // if freeSpace < 0, the message should be rejected anyway so don't worry about special case // for this + long freeSpace = stream.GetMaxSize() - stream.size() - 2; // 1 byte for update count header, 1 for detailedUpdate tcUpdateStream tempStream1; tcUpdateStream tempStream2; + unsigned char detailedUpdate; + if (stream.GetDetailLevel() > 0) + { + detailedUpdate = 1; + } + else + { + detailedUpdate = 0; + } + + unsigned short nChildren = GetCount(); if (nextUpdateIdx >= nChildren) nextUpdateIdx = 0; *************** *** 311,314 **** --- 342,346 ---- { tempStream1.clear(); + tempStream1.SetDetailLevel(stream.GetDetailLevel()); tcAirState* airState = GetAirState(nextUpdateIdx); *************** *** 335,339 **** --- 367,373 ---- } + stream << detailedUpdate; stream << nUpdates; + stream << tempStream2; Index: tcAero.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcAero.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcAero.cpp 20 Nov 2006 00:17:43 -0000 1.10 --- tcAero.cpp 6 Dec 2006 01:20:43 -0000 1.11 *************** *** 42,51 **** { stream >> mfFlightTime; ! stream >> mfSpeed_mps; ! stream >> mfGroundSpeed_mps; ! stream >> mfPitch_rad; ! stream >> mfHeading_rad; ! stream >> mfAltitude_m; ! stream >> mfHeadingControl; return stream; --- 42,50 ---- { stream >> mfFlightTime; ! //stream >> mfSpeed_mps; ! //stream >> mfGroundSpeed_mps; ! //stream >> mfPitch_rad; ! //stream >> mfHeading_rad; ! //stream >> mfAltitude_m; return stream; *************** *** 58,67 **** { stream << mfFlightTime; ! stream << mfSpeed_mps; ! stream << mfGroundSpeed_mps; ! stream << mfPitch_rad; ! stream << mfHeading_rad; ! stream << mfAltitude_m; ! stream << mfHeadingControl; return stream; --- 57,65 ---- { stream << mfFlightTime; ! //stream << mfSpeed_mps; ! //stream << mfGroundSpeed_mps; ! //stream << mfPitch_rad; ! //stream << mfHeading_rad; ! //stream << mfAltitude_m; return stream; Index: tcOpticalSensor.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcOpticalSensor.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcOpticalSensor.cpp 23 Nov 2006 00:07:33 -0000 1.15 --- tcOpticalSensor.cpp 6 Dec 2006 01:20:43 -0000 1.16 *************** *** 88,92 **** else { ! return 0; } } --- 88,92 ---- else { ! return 1.0f; } } Index: tcLauncherState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcLauncherState.cpp,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** tcLauncherState.cpp 28 Nov 2006 01:57:37 -0000 1.39 --- tcLauncherState.cpp 6 Dec 2006 01:20:43 -0000 1.40 *************** *** 340,346 **** if (parent->mcKin.RangeToKm(lon_rad, lat_rad) > maxRange_km) { ! wxString msg = wxString::Format("Out of range (%.1f km)", ! maxRange_km); ! tcGame::DisplayMessage(msg.c_str()); return false; } --- 340,349 ---- if (parent->mcKin.RangeToKm(lon_rad, lat_rad) > maxRange_km) { ! if (!tcSimState::Get()->IsMultiplayerServer()) ! { ! wxString msg = wxString::Format("Out of range (%.1f km)", ! maxRange_km); ! tcGame::DisplayMessage(msg.c_str()); ! } return false; } Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.165 retrieving revision 1.166 diff -C2 -d -r1.165 -r1.166 *** Game.cpp 2 Dec 2006 02:23:48 -0000 1.165 --- Game.cpp 6 Dec 2006 01:20:43 -0000 1.166 *************** *** 2910,2914 **** } ! tcFlightPortGui* gui = new tcFlightPortGui(platform->mnID, wxPoint(250, 200), xmlFile.c_str()); } } --- 2910,2922 ---- } ! tcFlightPortGui* existingGui = tcFlightPortGui::GetExistingGui(platform->mnID); ! if (existingGui == 0) ! { ! tcFlightPortGui* gui = new tcFlightPortGui(platform->mnID, wxPoint(250, 200), xmlFile.c_str()); ! } ! else// toggle close if exists already ! { ! existingGui->DestroyGui(); ! } } } *************** *** 2917,2924 **** if (tcPlatformObject* obj = tcSimPythonInterface::Get()->GetHookedObj()) { ! if (tcStores* stores = obj->GetMagazine(0)) ! { ! tcStoresGui* gui = new tcStoresGui(obj->mnID, -1, 0, wxPoint(500, 200), "xml/stores_gui_table.xml"); ! } } } --- 2925,2941 ---- if (tcPlatformObject* obj = tcSimPythonInterface::Get()->GetHookedObj()) { ! if (tcStores* stores = obj->GetMagazine(0)) ! { ! tcStoresGui* existingGui = tcStoresGui::GetExistingGui(obj->mnID, -1); ! if (existingGui == 0) ! { ! tcStoresGui* gui = new tcStoresGui(obj->mnID, -1, 0, wxPoint(500, 200), "xml/stores_gui_table.xml"); ! } ! else// toggle close if exists already ! { ! existingGui->DestroyGui(); ! } ! ! } } } *************** *** 2928,2932 **** if (obj) { ! tcPlatformGui* gui = new tcPlatformGui(obj->mnID, -1, wxPoint(220, 70), "xml/platform_gui_default.xml"); } } --- 2945,2957 ---- if (obj) { ! tcPlatformGui* existingGui = tcPlatformGui::GetExistingGui(obj->mnID, -1); ! if (existingGui == 0) ! { ! tcPlatformGui* gui = new tcPlatformGui(obj->mnID, -1, wxPoint(220, 70), "xml/platform_gui_default.xml"); ! } ! else // toggle close if exists already ! { ! existingGui->DestroyGui(); ! } } } Index: tcSensorState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSensorState.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** tcSensorState.cpp 24 Oct 2006 01:34:06 -0000 1.19 --- tcSensorState.cpp 6 Dec 2006 01:20:43 -0000 1.20 *************** *** 46,59 **** { stream >> mbActive; - //stream >> mnDBKey; - - stream >> mfLastScan; - stream >> mfCurrentScanPeriod_s; - stream >> mnMode; - mcTrack << stream; ! stream >> fireControlId; ! stream >> fireControlIdx; //stream >> mountAz_rad; //stream >> mfSensorHeight_m; --- 46,59 ---- { stream >> mbActive; ! stream >> mfCurrentScanPeriod_s; // need for antenna animation ! ! //mcTrack << stream; + //stream >> mnDBKey; + //stream >> mfLastScan; + //stream >> mnMode; + //stream >> fireControlId; + //stream >> fireControlIdx; //stream >> mountAz_rad; //stream >> mfSensorHeight_m; *************** *** 68,81 **** { stream << mbActive; - //stream << mnDBKey; - stream << mfLastScan; stream << mfCurrentScanPeriod_s; ! stream << mnMode; ! mcTrack >> stream; ! ! stream << fireControlId; ! stream << fireControlIdx; //stream << mountAz_rad; //stream << mfSensorHeight_m; --- 68,81 ---- { stream << mbActive; stream << mfCurrentScanPeriod_s; ! ! //mcTrack >> stream; + //stream << mnDBKey; + //stream << mfLastScan; + //stream << mnMode; + //stream << fireControlId; + //stream << fireControlIdx; //stream << mountAz_rad; //stream << mfSensorHeight_m; |
From: Dewitt C. <ddc...@us...> - 2006-12-06 01:21:14
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv22513/src/scriptinterface Modified Files: tcSimPythonInterface.cpp Log Message: Index: tcSimPythonInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcSimPythonInterface.cpp,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** tcSimPythonInterface.cpp 1 Dec 2006 03:39:54 -0000 1.46 --- tcSimPythonInterface.cpp 6 Dec 2006 01:20:43 -0000 1.47 *************** *** 749,755 **** s += ")\n"; ! CallPython(s.c_str(), "Exception occurred in ProcessCommand\n"); ! PopMode(); } --- 749,772 ---- s += ")\n"; ! if (!mpSimState->IsMultiplayerClient()) ! { ! CallPython(s.c_str(), "Exception occurred in ProcessCommand\n"); ! } ! else ! { ! ClientCommand cmd; ! cmd.menuMode = meMenuMode; ! cmd.idList = id; ! cmd.commandText = s; ! if (cmd.idList.size() == 0) ! { ! cmd.idList = groupInterface->GetUnits(); ! } ! ! clientCommands.push_back(cmd); ! } ! ! PopMode(); } |