gcblue-commits Mailing List for Global Conflict Blue (Page 19)
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-09-10 21:47:46
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1255/src/common Modified Files: simmath.cpp tcSoundConsole.cpp tcStream.cpp Log Message: GCB 0.8.0 release Index: tcSoundConsole.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/tcSoundConsole.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcSoundConsole.cpp 27 Jan 2005 01:01:48 -0000 1.12 --- tcSoundConsole.cpp 10 Sep 2005 21:47:38 -0000 1.13 *************** *** 133,136 **** --- 133,137 ---- int topMargin = 0; int bottomMargin = 0; + int wrap = 25; if (current) { *************** *** 138,141 **** --- 139,143 ---- elt->Attribute("TopMargin", &topMargin); elt->Attribute("BottomMargin", &bottomMargin); + elt->Attribute("Wrap", &wrap); } *************** *** 145,148 **** --- 147,152 ---- size.GetWidth(), size.GetHeight() - (topMargin + bottomMargin)); + SetWrap(wrap); + } Index: simmath.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/simmath.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** simmath.cpp 20 Jul 2005 16:24:53 -0000 1.28 --- simmath.cpp 10 Sep 2005 21:47:38 -0000 1.29 *************** *** 475,498 **** /******************************* tcTerrainInfo *******************************/ ! void tcTerrainInfo::Clear() { mfHeight_m = 0; mfLatDatum = 0; mfLonDatum = 0; - mnType = 0; } ! void tcTerrainInfo::Serialize(tcFile& file, bool abLoad) { ! if (abLoad) { ! file.Read(&mnType,sizeof(mnType)); ! file.Read(&mfHeight_m,sizeof(mfHeight_m)); ! file.Read(&mfLonDatum,sizeof(mfLonDatum)); ! file.Read(&mfLatDatum,sizeof(mfLatDatum)); ! } ! else { ! file.Write(&mnType,sizeof(mnType)); ! file.Write(&mfHeight_m,sizeof(mfHeight_m)); ! file.Write(&mfLonDatum,sizeof(mfLonDatum)); ! file.Write(&mfLatDatum,sizeof(mfLatDatum)); ! } } --- 475,501 ---- /******************************* tcTerrainInfo *******************************/ ! void tcTerrainInfo::Clear() ! { mfHeight_m = 0; + lookAheadHeight_m = 0; mfLatDatum = 0; mfLonDatum = 0; } ! void tcTerrainInfo::Serialize(tcFile& file, bool abLoad) ! { ! wxASSERT(false); ! if (abLoad) ! { ! file.Read(&mfHeight_m,sizeof(mfHeight_m)); ! file.Read(&mfLonDatum,sizeof(mfLonDatum)); ! file.Read(&mfLatDatum,sizeof(mfLatDatum)); ! } ! else ! { ! file.Write(&mfHeight_m,sizeof(mfHeight_m)); ! file.Write(&mfLonDatum,sizeof(mfLonDatum)); ! file.Write(&mfLatDatum,sizeof(mfLatDatum)); ! } } Index: tcStream.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/tcStream.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcStream.cpp 26 Jul 2005 00:37:03 -0000 1.12 --- tcStream.cpp 10 Sep 2005 21:47:38 -0000 1.13 *************** *** 200,203 **** --- 200,209 ---- { size_t len = val.size(); + if (len >= 2048) + { + fprintf(stderr, "tcStream::operator<<(std::string& val) - length overflow, truncating (%d)\n", + len); + len = 2047; // truncate + } write((char*)&len, sizeof(len)); write(val.c_str(), (std::streamsize)len); |
|
From: Dewitt C. <ddc...@us...> - 2005-09-10 21:47:46
|
Update of /cvsroot/gcblue/gcb_wx/src/ai In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1255/src/ai Modified Files: Nav.cpp Log Message: GCB 0.8.0 release Index: Nav.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/ai/Nav.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Nav.cpp 29 Jul 2005 02:35:52 -0000 1.3 --- Nav.cpp 10 Sep 2005 21:47:38 -0000 1.4 *************** *** 110,113 **** --- 110,118 ---- } + bool Nav::GetLoopState() const + { + return loop; + } + /** * @return waypoint vector of GeoPoint *************** *** 118,121 **** --- 123,131 ---- } + void Nav::SetLoopState(bool state) + { + loop = state; + } + void Nav::Update(double t) { *************** *** 124,129 **** if (currentWaypoint >= waypoints.size()) { ! EndTask(); ! return; } --- 134,147 ---- if (currentWaypoint >= waypoints.size()) { ! if (loop) ! { ! currentWaypoint = 0; ! wxASSERT(waypoints.size() > 0); ! } ! else ! { ! EndTask(); ! return; ! } } *************** *** 165,169 **** long id_, double priority_, const std::string& taskName_) : Task(platform_, bb, id_, priority_, taskName_), ! currentWaypoint(0) { wxASSERT(platform); --- 183,188 ---- long id_, double priority_, const std::string& taskName_) : Task(platform_, bb, id_, priority_, taskName_), ! currentWaypoint(0), ! loop(false) { wxASSERT(platform); |
|
From: Dewitt C. <ddc...@us...> - 2005-07-29 02:36:02
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28827/src/sim Modified Files: Game.cpp tcPlatformObject.cpp tcSensorPlatform.cpp tcSurfaceObject.cpp Log Message: 0.7.2 pre-release test build, added waypoints to client display, fixed multiplayer message overload bug, added better throttling for bad multiplayer connections Index: tcSensorPlatform.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSensorPlatform.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcSensorPlatform.cpp 28 Jun 2005 02:51:35 -0000 1.8 --- tcSensorPlatform.cpp 29 Jul 2005 02:35:53 -0000 1.9 *************** *** 191,194 **** --- 191,198 ---- { if (idx >= sensorState.size()) return; // error + + tcSensorState* sensor = sensorState[idx]; + if (sensor->IsActive() == state) return; // no change, return + sensorState[idx]->SetActive(state); sensorCommandObj.SetNewCommand(0x01 << idx); Index: tcPlatformObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcPlatformObject.cpp,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** tcPlatformObject.cpp 20 Jul 2005 16:24:55 -0000 1.53 --- tcPlatformObject.cpp 29 Jul 2005 02:35:53 -0000 1.54 *************** *** 852,855 **** --- 852,862 ---- unsigned char nMagazines; stream >> nMagazines; + if (magazines.size() != nMagazines) + { + fprintf(stderr, "tcPlatformObject::operator<< - bad platform update\n"); + wxASSERT(false); + return stream; + } + for (unsigned char n=0; n<nMagazines; n++) { Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.138 retrieving revision 1.139 diff -C2 -d -r1.138 -r1.139 *** Game.cpp 26 Jul 2005 00:37:05 -0000 1.138 --- Game.cpp 29 Jul 2005 02:35:53 -0000 1.139 *************** *** 247,250 **** --- 247,273 ---- UninitGame(); + + + if (!simState->IsMultiplayerActive()) + { + simState->RandInit(); // generate new random scenario + + HookRandomFriendly(); + + // reset time + gameTime = 0; + directorTime = 0; + nLastCount = 0; + + // clear briefing console text + briefingConsoleLeft->Clear(); + briefingConsoleLeft->SetDelayedTextEffect(true); + + // reset director + director->ClearEvents(); + director->SetStartTime(0); + director->InitTest(); // load test event sequence (for random scen) + } + // if in multiplayer client mode, switch to multiplayer off mode if (networkView->GetNetworkMode() == tcNetworkView::MULTIPLAYER_CLIENT) *************** *** 257,276 **** } ! simState->RandInit(); // generate new random scenario ! HookRandomFriendly(); ! ! // reset time ! gameTime = 0; ! directorTime = 0; ! nLastCount = 0; ! ! // clear briefing console text ! briefingConsoleLeft->Clear(); ! briefingConsoleLeft->SetDelayedTextEffect(true); ! ! // reset director ! director->ClearEvents(); ! director->SetStartTime(0); ! director->InitTest(); // load test event sequence (for random scen) // set viewer back to object display mode --- 280,284 ---- } ! tcMessageInterface::Get()->SetPopupState(false); // set viewer back to object display mode *************** *** 326,329 **** --- 334,338 ---- // clear message center messageCenter->Clear(); + tcMessageInterface::Get()->SetPopupState(true); tcString s; *************** *** 555,558 **** --- 564,569 ---- pythonInterface->AttachDirector(director); + tcMessageInterface::Get()->SetPopupState(false); + viewer->Raise(); Index: tcSurfaceObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSurfaceObject.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** tcSurfaceObject.cpp 28 Jun 2005 02:51:35 -0000 1.20 --- tcSurfaceObject.cpp 29 Jul 2005 02:35:53 -0000 1.21 *************** *** 130,138 **** } ! mcKin.mfAlt_m -= 0.1f * dt_s; mcKin.mfRoll_rad += 0.01f * dt_s; mcKin.mfPitch_rad += 0.001f * dt_s; ! if (mcKin.mfAlt_m <= -20.0f) { doneSinking = true; --- 130,138 ---- } ! mcKin.mfAlt_m -= 0.2 * dt_s; mcKin.mfRoll_rad += 0.01f * dt_s; mcKin.mfPitch_rad += 0.001f * dt_s; ! if (mcKin.mfAlt_m <= -10.0f) { doneSinking = true; |
|
From: Dewitt C. <ddc...@us...> - 2005-07-29 02:36:02
|
Update of /cvsroot/gcblue/gcb_wx/src/network In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28827/src/network Modified Files: tcConnectionData.cpp tcMessage.cpp tcMultiplayerInterface.cpp Log Message: 0.7.2 pre-release test build, added waypoints to client display, fixed multiplayer message overload bug, added better throttling for bad multiplayer connections Index: tcMessage.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/network/tcMessage.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcMessage.cpp 22 Jun 2005 01:22:08 -0000 1.10 --- tcMessage.cpp 29 Jul 2005 02:35:53 -0000 1.11 *************** *** 58,61 **** --- 58,63 ---- } + + unsigned int tcMessage::GetAckId() const { *************** *** 155,158 **** --- 157,168 ---- /** + * Used to set or clear the ack request flag of this message + */ + void tcMessage::SetAck(bool state) + { + data.header.ackFlag = state ? 1 : 0; + } + + /** * Sets timestamp using current time */ Index: tcConnectionData.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/network/tcConnectionData.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcConnectionData.cpp 29 Apr 2005 18:52:53 -0000 1.13 --- tcConnectionData.cpp 29 Jul 2005 02:35:53 -0000 1.14 *************** *** 30,33 **** --- 30,34 ---- #include "tcTime.h" #include <iostream> + #include <math.h> #ifdef _DEBUG *************** *** 354,358 **** void tcConnectionData::ResendFailedAcks() { ! const unsigned int ackTimeout = 26; const unsigned short maxResends = 2; unsigned int t = tcTime::Get()->Get30HzCount(); --- 355,367 ---- void tcConnectionData::ResendFailedAcks() { ! // calculate ackTimeout based on ping time ! unsigned int ackTimeout; ! float ping_s = GetPingTime(); ! ackTimeout = (unsigned int)(floorf(45.0f * ping_s)); ! if (ackTimeout < 10) ackTimeout = 10; // 0.33 s minimum ! else if (ackTimeout > 45) ackTimeout = 45; // 1.5 s maximum ! ! const unsigned int resendLimit_sec = 8; ! const unsigned short maxResends = 2; unsigned int t = tcTime::Get()->Get30HzCount(); *************** *** 365,369 **** if ((msg->GetMessageTimestamp() - t) > ackTimeout) { ! if (msg->resendCount < maxResends) { msg->StampTime(); --- 374,378 ---- if ((msg->GetMessageTimestamp() - t) > ackTimeout) { ! if ((msg->resendCount < maxResends) && (resentCount_sec < resendLimit_sec)) { msg->StampTime(); *************** *** 377,386 **** } else ! { ! fprintf(stdout, "* Max resend of msg %d reached, deleting\n", ! bufferId); ! networkInterface->ReturnMessage(bufferId); ! } ! waitForAck.erase(iter++); } else --- 386,403 ---- } else ! { ! if (resentCount_sec < resendLimit_sec) ! { ! fprintf(stdout, "* Max resend of msg %d reached, deleting\n", ! bufferId); ! } ! else ! { ! fprintf(stdout, "*Resend limit reached, deleting msg %d\n", ! bufferId); ! } ! networkInterface->ReturnMessage(bufferId); ! } ! waitForAck.erase(iter++); } else *************** *** 451,456 **** --- 468,476 ---- readCount_sec = readCount - lastReadCount; writeCount_sec = writeCount - lastWriteCount; + resentCount_sec = resentCount - lastResentCount; + lastReadCount = readCount; lastWriteCount = writeCount; + lastResentCount = resentCount; } } *************** *** 539,542 **** --- 559,575 ---- } + // cancel ack if maxWaitingForAck has been exceeded + if (message->GetAck() && (waitForAck.size() > maxWaitingForAck)) + { + message->SetAck(false); + + static unsigned errorCount = 0; + if (errorCount++ < 8) + { + fprintf(stderr, "tcConnectionData::WriteUDP() - Ack canceled due to overload (id:%d)\n", + message->GetId()); + } + } + // attach rider to message with ids of packets to ack AttachAckRider(message); *************** *** 584,593 **** lastReadCount(0), lastWriteCount(0), readCount_sec(0), writeCount_sec(0), pingTime_s(0), lastCountUpdate(0), lastResendUpdate(0), ! resentCount(0) { --- 617,629 ---- lastReadCount(0), lastWriteCount(0), + lastResentCount(0), readCount_sec(0), writeCount_sec(0), + resentCount_sec(0), pingTime_s(0), lastCountUpdate(0), lastResendUpdate(0), ! resentCount(0), ! maxWaitingForAck(16) { Index: tcMultiplayerInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/network/tcMultiplayerInterface.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** tcMultiplayerInterface.cpp 26 Jul 2005 00:37:04 -0000 1.30 --- tcMultiplayerInterface.cpp 29 Jul 2005 02:35:53 -0000 1.31 *************** *** 490,495 **** static std::string s; ! s = GetPlayerName(connectionId).c_str(); ! s += " "; s += networkInterface->GetConnectionStatus(connectionId).c_str(); --- 490,500 ---- static std::string s; ! const tcPlayerStatus& status = GetPlayerStatus(connectionId); ! ! wxString s2 = wxString::Format("%s (%d) ", status.GetName().c_str(), ! status.GetAlliance()); ! ! s = s2.c_str(); ! s += networkInterface->GetConnectionStatus(connectionId).c_str(); |
|
From: Dewitt C. <ddc...@us...> - 2005-07-29 02:36:02
|
Update of /cvsroot/gcblue/gcb_wx/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28827/xml Modified Files: options.xml Log Message: 0.7.2 pre-release test build, added waypoints to client display, fixed multiplayer message overload bug, added better throttling for bad multiplayer connections Index: options.xml =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/xml/options.xml,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** options.xml 30 Jun 2005 01:06:12 -0000 1.19 --- options.xml 29 Jul 2005 02:35:53 -0000 1.20 *************** *** 1,7 **** <Options> ! <HostAddress>192.168.0.100</HostAddress> <DisplaySettings>default</DisplaySettings> ! <LastScenarioPath>TaiwanTest.py</LastScenarioPath> ! <LastScenarioName>TaiwanTest</LastScenarioName> <noCopyDatabase /> <noWriteXmlDatabase /> --- 1,7 ---- <Options> ! <HostAddress>192.168.0.102</HostAddress> <DisplaySettings>default</DisplaySettings> ! <LastScenarioPath>TaiwanNavalBattle.py</LastScenarioPath> ! <LastScenarioName>TaiwanNavalBattle</LastScenarioName> <noCopyDatabase /> <noWriteXmlDatabase /> |
|
From: Dewitt C. <ddc...@us...> - 2005-07-29 02:36:01
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28827/src/graphics Modified Files: tcMessageInterface.cpp tcScenarioSelectView.cpp Log Message: 0.7.2 pre-release test build, added waypoints to client display, fixed multiplayer message overload bug, added better throttling for bad multiplayer connections Index: tcMessageInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMessageInterface.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcMessageInterface.cpp 26 Jul 2005 00:37:04 -0000 1.5 --- tcMessageInterface.cpp 29 Jul 2005 02:35:53 -0000 1.6 *************** *** 79,83 **** wxASSERT(messageCenter); ! messageCenter->PopupMessage(msg); } --- 79,86 ---- wxASSERT(messageCenter); ! if (popupsEnabled) ! { ! messageCenter->PopupMessage(msg); ! } } *************** *** 96,99 **** --- 99,107 ---- } + void tcMessageInterface::SetPopupState(bool state) + { + popupsEnabled = state; + } + /** * Must be called before using DisplayChannelMessage *************** *** 109,112 **** --- 117,121 ---- */ tcMessageInterface::tcMessageInterface() + : popupsEnabled(true) { Index: tcScenarioSelectView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcScenarioSelectView.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcScenarioSelectView.cpp 22 Jun 2005 01:22:08 -0000 1.11 --- tcScenarioSelectView.cpp 29 Jul 2005 02:35:53 -0000 1.12 *************** *** 206,209 **** --- 206,214 ---- using network::tcMultiplayerInterface; + if (mpSimState->IsMultiplayerClient()) + { + return; // don't load scenarios as multiplayer client (need remote way of doing this) + } + std::string totalPath = SCENARIO_PATH; totalPath += "\\"; // generalize this for Linux? |
|
From: Dewitt C. <ddc...@us...> - 2005-07-29 02:36:01
|
Update of /cvsroot/gcblue/gcb_wx/src/ai In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28827/src/ai Modified Files: Brain.cpp Nav.cpp Log Message: 0.7.2 pre-release test build, added waypoints to client display, fixed multiplayer message overload bug, added better throttling for bad multiplayer connections Index: Brain.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/ai/Brain.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Brain.cpp 5 May 2005 02:14:45 -0000 1.8 --- Brain.cpp 29 Jul 2005 02:35:52 -0000 1.9 *************** *** 79,82 **** --- 79,88 ---- } + // update waypoints if nav task exists + if (ai::Nav* nav = GetNavTask()) + { + nav->operator<<(stream); + } + return stream; } *************** *** 106,109 **** --- 112,121 ---- } + // update waypoints if nav task exists + if (ai::Nav* nav = GetNavTask()) + { + nav->operator>>(stream); + } + return stream; } *************** *** 160,163 **** --- 172,183 ---- /** + * For multiplayer, call when task is added or deleted, or nav task waypoints have changed + */ + void Brain::SetNewCommand() + { + hasNewCommand = true; + } + + /** * Set target id for platform */ Index: Nav.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/ai/Nav.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Nav.cpp 1 Jun 2005 00:13:28 -0000 1.2 --- Nav.cpp 29 Jul 2005 02:35:52 -0000 1.3 *************** *** 27,33 **** --- 27,37 ---- #include "ai/Nav.h" + #include "ai/Brain.h" #include "scriptinterface/tcPlatformInterface.h" #include "simmath.h" + #include "common/tcStream.h" + #include "common/tcObjStream.h" + #ifdef _DEBUG #define new DEBUG_NEW *************** *** 37,40 **** --- 41,91 ---- using scriptinterface::tcPlatformInterface; + + /** + * Saves state to command stream + * Used to save waypoints for client to display + */ + tcCommandStream& Nav::operator>>(tcCommandStream& stream) + { + unsigned char nWaypoints = waypoints.size(); + stream << nWaypoints; + + for (unsigned char n=0; n<nWaypoints; n++) + { + stream << waypoints[n].mfLon_rad; + stream << waypoints[n].mfLat_rad; + stream << waypoints[n].mfAlt_m; + } + + return stream; + } + + /** + * Loads state to command stream + * Used to load waypoints for client to display + */ + tcCommandStream& Nav::operator<<(tcCommandStream& stream) + { + waypoints.clear(); + + unsigned char nWaypoints; + stream >> nWaypoints; + + for (unsigned char n=0; n<nWaypoints; n++) + { + float lon_rad, lat_rad, alt_m; + + stream >> lon_rad; + stream >> lat_rad; + stream >> alt_m; + + GeoPoint waypoint; + waypoint.Set(lon_rad, lat_rad, alt_m); + waypoints.push_back(waypoint); + } + + return stream; + } + void Nav::AddWaypoint(double lon_rad, double lat_rad, float alt_m) { *************** *** 43,51 **** --- 94,111 ---- waypoints.push_back(waypoint); + + platform->GetBrain()->SetNewCommand(); } void Nav::ClearWaypoints() { + if (waypoints.size()) + { + platform->GetBrain()->SetNewCommand(); + } + waypoints.clear(); + + } |
|
From: Dewitt C. <ddc...@us...> - 2005-07-29 02:36:01
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28827/src/database Modified Files: tcAccountDatabase.cpp Log Message: 0.7.2 pre-release test build, added waypoints to client display, fixed multiplayer message overload bug, added better throttling for bad multiplayer connections Index: tcAccountDatabase.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcAccountDatabase.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcAccountDatabase.cpp 6 May 2005 23:57:52 -0000 1.1 --- tcAccountDatabase.cpp 29 Jul 2005 02:35:52 -0000 1.2 *************** *** 372,374 **** --- 372,375 ---- { delete accountDatabase; + delete md5; } |
|
From: Dewitt C. <ddc...@us...> - 2005-07-29 02:36:00
|
Update of /cvsroot/gcblue/gcb_wx/include/network In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28827/include/network Modified Files: tcConnectionData.h tcMessage.h Log Message: 0.7.2 pre-release test build, added waypoints to client display, fixed multiplayer message overload bug, added better throttling for bad multiplayer connections Index: tcMessage.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/network/tcMessage.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcMessage.h 22 Jun 2005 01:21:26 -0000 1.8 --- tcMessage.h 29 Jul 2005 02:35:52 -0000 1.9 *************** *** 71,74 **** --- 71,75 ---- const unsigned char *messageData); void Reset(); + void SetAck(bool state); void StampTime(); Index: tcConnectionData.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/network/tcConnectionData.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcConnectionData.h 29 Apr 2005 18:52:02 -0000 1.10 --- tcConnectionData.h 29 Jul 2005 02:35:52 -0000 1.11 *************** *** 93,98 **** --- 93,101 ---- unsigned long lastReadCount; ///< read count at last second mark unsigned long lastWriteCount; ///< write count at last second mark + unsigned long lastResentCount; ///< resent count at last second mark + unsigned int readCount_sec; ///< bytes read over last full second unsigned int writeCount_sec; ///< bytes written over last full second + unsigned int resentCount_sec; ///< bytes resent over last full second float pingTime_s; ///< last ping time for this connection wxIPV4address UDPaddress; *************** *** 100,104 **** unsigned int lastCountUpdate; unsigned int lastResendUpdate; ! unsigned int resentCount; ///< number of packets resent because of ack timeout void AttachAckRider(tcMessage* message); --- 103,112 ---- unsigned int lastCountUpdate; unsigned int lastResendUpdate; ! unsigned long resentCount; ///< number of packets resent because of ack timeout ! ! /** max number of packets that will be held waiting for ack. If this is exceeded ! ** UDP packets will be sent without ack request ! */ ! const unsigned int maxWaitingForAck; void AttachAckRider(tcMessage* message); |
|
From: Dewitt C. <ddc...@us...> - 2005-07-29 02:36:00
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28827/include/graphics Modified Files: tcMessageInterface.h Log Message: 0.7.2 pre-release test build, added waypoints to client display, fixed multiplayer message overload bug, added better throttling for bad multiplayer connections Index: tcMessageInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMessageInterface.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcMessageInterface.h 26 Jul 2005 00:37:02 -0000 1.5 --- tcMessageInterface.h 29 Jul 2005 02:35:52 -0000 1.6 *************** *** 46,49 **** --- 46,51 ---- void PopupMessage(const std::string& msg); void SetPopupChatText(bool state); + + void SetPopupState(bool state); static tcMessageInterface* Get(); ///< singleton accessor *************** *** 52,55 **** --- 54,58 ---- private: static tcMessageCenter* messageCenter; + bool popupsEnabled; ///< true if popup message should be displayed tcMessageInterface(); |
|
From: Dewitt C. <ddc...@us...> - 2005-07-29 02:36:00
|
Update of /cvsroot/gcblue/gcb_wx/include/ai In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28827/include/ai Modified Files: Brain.h Nav.h Log Message: 0.7.2 pre-release test build, added waypoints to client display, fixed multiplayer message overload bug, added better throttling for bad multiplayer connections Index: Brain.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/ai/Brain.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Brain.h 29 Apr 2005 18:52:01 -0000 1.7 --- Brain.h 29 Jul 2005 02:35:52 -0000 1.8 *************** *** 82,85 **** --- 82,86 ---- void ClearNewCommand(); bool HasNewCommand() const; + void SetNewCommand(); Index: Nav.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/ai/Nav.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Nav.h 4 Mar 2005 00:46:19 -0000 1.1 --- Nav.h 29 Jul 2005 02:35:52 -0000 1.2 *************** *** 38,41 **** --- 38,46 ---- class GeoPoint; + class tcStream; + class tcCommandStream; + class tcCreateStream; + class tcUpdateStream; + namespace ai { *************** *** 53,56 **** --- 58,64 ---- + tcCommandStream& operator<<(tcCommandStream& stream); + tcCommandStream& operator>>(tcCommandStream& stream); + Nav(tcPlatformObject* platform_, Blackboard* bb, long id_, double priority_, const std::string& taskName_); |
|
From: Dewitt C. <ddc...@us...> - 2005-07-26 00:37:50
|
Update of /cvsroot/gcblue/gcb_wx/include/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13788/include/scriptinterface Modified Files: tcPlatformInterface.h tcScenarioInterface.h Log Message: Added mission goal status to "Mission" channel (hit F7), added sub periscope and mast ops to multiplayer, changed torpedo behavior to resume s-search if track lost early, made afterburner smoke thin a little more uniformly Index: tcPlatformInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcPlatformInterface.h,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** tcPlatformInterface.h 2 Jul 2005 16:51:08 -0000 1.43 --- tcPlatformInterface.h 26 Jul 2005 00:37:03 -0000 1.44 *************** *** 149,155 **** void SetThrottle(float throttleFraction); /// sets heading in degrees ! void SetHeading(float heading_deg) {mpPlatformObj->SetHeading(C_PIOVER180*heading_deg);} /// sets heading in radians ! void SetHeadingRad(float heading_rad) {mpPlatformObj->SetHeading(heading_rad);} /// get heading to (lon,lat) datum in degrees float GetHeadingToDatum(float afLon_rad, float afLat_rad); --- 149,155 ---- void SetThrottle(float throttleFraction); /// sets heading in degrees ! void SetHeading(float heading_deg); /// sets heading in radians ! void SetHeadingRad(float heading_rad); /// get heading to (lon,lat) datum in degrees float GetHeadingToDatum(float afLon_rad, float afLat_rad); Index: tcScenarioInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcScenarioInterface.h,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** tcScenarioInterface.h 2 Jul 2005 16:51:09 -0000 1.21 --- tcScenarioInterface.h 26 Jul 2005 00:37:03 -0000 1.22 *************** *** 154,158 **** tcCompoundGoal CompoundGoal(int type); tcTimeGoal TimeGoal(); ! tcDestroyGoal DestroyGoal(std::string target); // non-python methods --- 154,159 ---- tcCompoundGoal CompoundGoal(int type); tcTimeGoal TimeGoal(); ! tcDestroyGoal DestroyGoal(const std::string& target); ! tcProtectGoal ProtectGoal(const std::string& target); // non-python methods |
|
From: Dewitt C. <ddc...@us...> - 2005-07-26 00:37:50
|
Update of /cvsroot/gcblue/gcb_wx/include/network In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13788/include/network Modified Files: tcMultiplayerInterface.h tcUpdateMessageHandler.h Log Message: Added mission goal status to "Mission" channel (hit F7), added sub periscope and mast ops to multiplayer, changed torpedo behavior to resume s-search if track lost early, made afterburner smoke thin a little more uniformly Index: tcUpdateMessageHandler.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/network/tcUpdateMessageHandler.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcUpdateMessageHandler.h 8 May 2005 23:27:56 -0000 1.9 --- tcUpdateMessageHandler.h 26 Jul 2005 00:37:02 -0000 1.10 *************** *** 62,66 **** SOUND_EFFECT = 8, ///< play sound effect for object SCRIPT_COMMANDS = 9, ///< script commands to execute on server ! SCENARIO_INFO = 10 ///< info on scenario }; --- 62,67 ---- SOUND_EFFECT = 8, ///< play sound effect for object SCRIPT_COMMANDS = 9, ///< script commands to execute on server ! SCENARIO_INFO = 10, ///< info on scenario ! GOAL_STATUS = 11 ///< goal status for client }; *************** *** 72,75 **** --- 73,77 ---- static void AddCreateRequest(long id, tcStream& stream); static void AddDestroy(long id, tcStream& stream); + static void AddGoalStatus(long alliance, tcUpdateStream& stream); static void AddScenarioInfo(tcUpdateStream& stream); static void AddSensorUpdateHeader(long alliance, tcStream& stream); *************** *** 87,90 **** --- 89,93 ---- void HandleCreateRequest(tcStream& stream, int connectionId); void HandleDestroy(tcStream& stream); + void HandleGoalStatus(tcUpdateStream& stream); void HandleScenarioInfo(tcUpdateStream& stream); void HandleScriptCommands(tcStream& stream, int connectionId); Index: tcMultiplayerInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/network/tcMultiplayerInterface.h,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** tcMultiplayerInterface.h 8 May 2005 23:27:56 -0000 1.25 --- tcMultiplayerInterface.h 26 Jul 2005 00:37:02 -0000 1.26 *************** *** 182,185 **** --- 182,186 ---- const unsigned int entityUpdateInterval; ///< 30 Hz tics const unsigned int sensorUpdateInterval; ///< 30 Hz tics + const unsigned int goalUpdateInterval; ///< 30 Hz tics void ClearMessageMap(); *************** *** 201,204 **** --- 202,206 ---- void UpdateEntityCommands(int connectionId, bool clearNewCmdFlag); void UpdateEntities(); + void UpdateGoalStatus(); void UpdatePing(); void UpdatePlayerInfo(); |
|
From: Dewitt C. <ddc...@us...> - 2005-07-26 00:37:50
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13788/include/sim Modified Files: tcControllableObject.h tcGoal.h tcGoalTracker.h tcSensorMapTrack.h tcSimState.h tcSubObject.h Log Message: Added mission goal status to "Mission" channel (hit F7), added sub periscope and mast ops to multiplayer, changed torpedo behavior to resume s-search if track lost early, made afterburner smoke thin a little more uniformly Index: tcGoal.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcGoal.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcGoal.h 22 Jun 2005 01:21:27 -0000 1.5 --- tcGoal.h 26 Jul 2005 00:37:03 -0000 1.6 *************** *** 62,66 **** bool IsUnresolved() {return goalState == UNRESOLVED;} virtual void Update(); ///< updates goal state using on simState ! virtual void WriteStatus(std::stringstream& stream); virtual tcGoal* Clone(); --- 62,66 ---- bool IsUnresolved() {return goalState == UNRESOLVED;} virtual void Update(); ///< updates goal state using on simState ! virtual void WriteStatus(std::stringstream& stream, unsigned int level = 0); virtual tcGoal* Clone(); *************** *** 68,71 **** --- 68,73 ---- tcGoal(const tcGoal& goal); virtual ~tcGoal(); + protected: + const std::string indentString; }; *************** *** 88,92 **** void SetLogic(int logic) {logicType = logic;} virtual void Update(); ///< updates goal state using on simState ! virtual void WriteStatus(std::stringstream& stream); virtual tcGoal* Clone(); --- 90,94 ---- void SetLogic(int logic) {logicType = logic;} virtual void Update(); ///< updates goal state using on simState ! virtual void WriteStatus(std::stringstream& stream, unsigned int level = 0); virtual tcGoal* Clone(); *************** *** 108,112 **** void SetPassTimeout(double t) {passTimeout = t;} virtual void Update(); ///< updates goal state using on simState ! virtual void WriteStatus(std::stringstream& stream); virtual tcGoal* Clone(); --- 110,114 ---- void SetPassTimeout(double t) {passTimeout = t;} virtual void Update(); ///< updates goal state using on simState ! virtual void WriteStatus(std::stringstream& stream, unsigned int level = 0); virtual tcGoal* Clone(); *************** *** 125,129 **** virtual void Update(); ! virtual void WriteStatus(std::stringstream& stream); virtual tcGoal* Clone(); --- 127,131 ---- virtual void Update(); ! virtual void WriteStatus(std::stringstream& stream, unsigned int level = 0); virtual tcGoal* Clone(); *************** *** 132,135 **** --- 134,153 ---- }; + /** + * goal to protect specific unit + */ + class tcProtectGoal : public tcGoal + { + public: + std::string targetString; + + virtual void Update(); + virtual void WriteStatus(std::stringstream& stream, unsigned int level = 0); + + virtual tcGoal* Clone(); + tcProtectGoal(const tcProtectGoal& goal); + tcProtectGoal(std::string s) : targetString(s) {} + }; + Index: tcSubObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSubObject.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcSubObject.h 14 Jul 2005 23:41:50 -0000 1.9 --- tcSubObject.h 26 Jul 2005 00:37:03 -0000 1.10 *************** *** 86,89 **** --- 86,99 ---- virtual ~tcSubObject(); protected: + enum + { + MAST_CMD = 0x01 ///< flag for periscope, radar mast, or snorkeling cmds + }; + enum + { + PERISCOPE = 0x01, + RADARMAST = 0x02, + SNORKEL = 0x04 + }; tcCommandObject commandObj; const float maxPitch_rad; Index: tcGoalTracker.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcGoalTracker.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcGoalTracker.h 6 Sep 2004 01:08:03 -0000 1.3 --- tcGoalTracker.h 26 Jul 2005 00:37:03 -0000 1.4 *************** *** 6,14 **** #define _GOALTRACKER_H_ - #include <vector> #include <map> class tcGoal; class tcGoalTracker { --- 6,20 ---- #define _GOALTRACKER_H_ #include <map> + #include <sstream> + #include <vector> + class tcStream; + class tcCommandStream; + class tcCreateStream; + class tcUpdateStream; class tcGoal; + class tcGoalTracker { *************** *** 21,24 **** --- 27,31 ---- void Clear(); + const std::string& GetAllianceGoalStatusDescription(int alliance); bool HasAllianceFailed(int alliance); bool HasAllianceSucceeded(int alliance); *************** *** 29,38 **** void WriteStatus(std::stringstream& stream, int alliance); tcGoalTracker(); ~tcGoalTracker(); ! private: double lastUpdateTime; const double updateInterval; ///< game time between updates std::map<int, int> previousGoalStatus; ///< status at last update }; --- 36,56 ---- void WriteStatus(std::stringstream& stream, int alliance); + tcUpdateStream& operator<<(tcUpdateStream& stream); + tcUpdateStream& operator>>(tcUpdateStream& stream); + + static tcGoalTracker* Get(); + private: tcGoalTracker(); ~tcGoalTracker(); ! double lastUpdateTime; const double updateInterval; ///< game time between updates std::map<int, int> previousGoalStatus; ///< status at last update + + // variables for multiplayer client + std::string goalStatusDescription; ///< for client alliance only + bool allianceFailed; ///< true if client alliance has failed + bool allianceSucceeded; ///< true if client alliance has succeeded + bool statusChanged; ///< true if allianceFailed or allianceSucceeded has changed }; Index: tcSimState.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSimState.h,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** tcSimState.h 22 Jun 2005 01:21:27 -0000 1.42 --- tcSimState.h 26 Jul 2005 00:37:03 -0000 1.43 *************** *** 125,129 **** tcGameObject* CreateGameObject(tcDatabaseObject *apDBObject); tcGameObject* CreateRandomPlatform(UINT platform_type); ! void DeleteAllPlatforms(void); void DeleteObject(long key); void DesignateTarget(long anKey, long anTargetKey); --- 125,129 ---- tcGameObject* CreateGameObject(tcDatabaseObject *apDBObject); tcGameObject* CreateRandomPlatform(UINT platform_type); ! void DeleteAllPlatforms(); void DeleteObject(long key); void DesignateTarget(long anKey, long anTargetKey); *************** *** 137,141 **** void GetDateZulu(DateZulu& dz) {dz = dateZulu;} void GetDescription(long anKey, tcString& s); - tcGoalTracker* GetGoalTracker() {return goalTracker;} void GetNextPlatform(tnPoolIndex& pos, tnPoolIndex& key, tcGameObject*& obj) { --- 137,140 ---- *************** *** 171,175 **** void RandInit(); ! void RemoveDestroyedObjects(void); void RequestLaunch(long anKey,int anLauncher); void SaveTimeToStream(tcStream& stream); --- 170,174 ---- void RandInit(); ! void RemoveDestroyedObjects(); void RequestLaunch(long anKey,int anLauncher); void SaveTimeToStream(tcStream& stream); Index: tcControllableObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcControllableObject.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcControllableObject.h 6 May 2005 23:57:16 -0000 1.1 --- tcControllableObject.h 26 Jul 2005 00:37:03 -0000 1.2 *************** *** 72,75 **** --- 72,76 ---- static void AttachUserInfo(); + static void SetSinglePlayerMode(bool state); tcControllableObject(); *************** *** 82,85 **** --- 83,87 ---- static tcUserInfo* userInfo; + static bool singlePlayerMode; ///< bypass control check in single play }; Index: tcSensorMapTrack.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSensorMapTrack.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcSensorMapTrack.h 28 Jun 2005 02:51:20 -0000 1.3 --- tcSensorMapTrack.h 26 Jul 2005 00:37:03 -0000 1.4 *************** *** 61,65 **** double mfStartTime; ///< birth time of track from report long mnTrackID; - long trackDatabaseID; ///< database id of track (usually from visual ident), -1 is unknown long mnSensorPlatformID; ///< id of contributing sensor UINT8 mnFlags; --- 61,64 ---- *************** *** 105,109 **** tsEmitterInfo maEmitterInfo[MAX_EMITTERS]; int mnEmitters; - long mnDatabaseID; ///< database ID of track, -1 for unknown float assessedDamage; std::vector<long> intercepts; ///< vector of platform ids that are intercepting this track --- 104,107 ---- *************** *** 142,145 **** --- 140,144 ---- unsigned GetContributorCount() const; const char* GetContributorName(unsigned idx) const; + long GetDatabaseId() const; tc3DModel* GetModel() const; *************** *** 187,191 **** --- 186,192 ---- enum {TRACK_STALE = 1, TRACK_DESTROYED = 2}; unsigned char sensorFlags; ///< 1 - stale, 2 - destroyed + long mnDatabaseID; ///< database ID of track, -1 for unknown tc3DModel* model; + void KillAssess(); }; |
|
From: Dewitt C. <ddc...@us...> - 2005-07-26 00:37:49
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13788/include/graphics Modified Files: ObjectUpdater.h SmokeTrailEmitter.h tcMessageCenter.h tcMessageChannel.h tcMessageInterface.h Log Message: Added mission goal status to "Mission" channel (hit F7), added sub periscope and mast ops to multiplayer, changed torpedo behavior to resume s-search if track lost early, made afterburner smoke thin a little more uniformly Index: SmokeTrailEmitter.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/SmokeTrailEmitter.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SmokeTrailEmitter.h 1 Sep 2004 02:55:35 -0000 1.1 --- SmokeTrailEmitter.h 26 Jul 2005 00:37:02 -0000 1.2 *************** *** 68,75 **** osg::ref_ptr<tcParticlePlacer> placer_; ! /// template for close up particles used to make smoke trail look continuous near missile ! Particle closeUpTemplate; ! ! void InitializeCloseupTemplate(); }; --- 68,72 ---- osg::ref_ptr<tcParticlePlacer> placer_; ! void InitializeStandardTemplate(); }; Index: ObjectUpdater.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/ObjectUpdater.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ObjectUpdater.h 1 Jun 2005 00:13:26 -0000 1.8 --- ObjectUpdater.h 26 Jul 2005 00:37:02 -0000 1.9 *************** *** 62,65 **** --- 62,66 ---- void UpdateAnimations(); + void UpdateTrackAnimations(); void UpdateTrack(Node* node); void UpdateTrue(Node* node); Index: tcMessageCenter.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMessageCenter.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcMessageCenter.h 6 May 2005 23:57:15 -0000 1.4 --- tcMessageCenter.h 26 Jul 2005 00:37:02 -0000 1.5 *************** *** 43,47 **** { public: ! void AddMessage(const std::string& channel, const std::string& msg); void ConsoleMessage(const std::string& msg); void PopupMessage(const std::string& msg); --- 43,48 ---- { public: ! void AddMessage(const std::string& channelName, const std::string& msg); ! void ClearChannel(const std::string& channelName); void ConsoleMessage(const std::string& msg); void PopupMessage(const std::string& msg); Index: tcMessageChannel.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMessageChannel.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcMessageChannel.h 4 Mar 2005 00:46:15 -0000 1.2 --- tcMessageChannel.h 26 Jul 2005 00:37:02 -0000 1.3 *************** *** 47,52 **** void AddMessage(const std::string& msg); void Draw(tc3DWindow* graphics); ! std::string GetName(); bool IsActive() const; bool IsPointInActivationRect(const wxPoint& p) const; --- 47,53 ---- void AddMessage(const std::string& msg); + void Clear(); void Draw(tc3DWindow* graphics); ! const std::string& GetName() const; bool IsActive() const; bool IsPointInActivationRect(const wxPoint& p) const; Index: tcMessageInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMessageInterface.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcMessageInterface.h 6 May 2005 23:57:15 -0000 1.4 --- tcMessageInterface.h 26 Jul 2005 00:37:02 -0000 1.5 *************** *** 41,44 **** --- 41,45 ---- public: void ChannelMessage(const std::string& channelName, const std::string& msg); + void ClearChannel(const std::string& channelName); void ConsoleMessage(const std::string& msg); void PostChatText(const std::string& msg); |
|
From: Dewitt C. <ddc...@us...> - 2005-07-26 00:37:40
|
Update of /cvsroot/gcblue/gcb_wx/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13788/database Modified Files: database.db Log Message: Added mission goal status to "Mission" channel (hit F7), added sub periscope and mast ops to multiplayer, changed torpedo behavior to resume s-search if track lost early, made afterburner smoke thin a little more uniformly Index: database.db =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/database/database.db,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 Binary files /tmp/cvsEe2Hqy and /tmp/cvscvWXkp differ |
|
From: Dewitt C. <ddc...@us...> - 2005-07-26 00:37:31
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13788/src/graphics Modified Files: ObjectUpdater.cpp SmokeTrailEmitter.cpp tc3DModel.cpp tcCreditView.cpp tcGameView.cpp tcHookInfo.cpp tcMessageCenter.cpp tcMessageChannel.cpp tcMessageInterface.cpp tcNetworkView.cpp Log Message: Added mission goal status to "Mission" channel (hit F7), added sub periscope and mast ops to multiplayer, changed torpedo behavior to resume s-search if track lost early, made afterburner smoke thin a little more uniformly Index: tcNetworkView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcNetworkView.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcNetworkView.cpp 29 Apr 2005 18:52:53 -0000 1.9 --- tcNetworkView.cpp 26 Jul 2005 00:37:04 -0000 1.10 *************** *** 233,236 **** --- 233,237 ---- tcMultiplayerInterface::Get()->MakeServer(); tcSimState::Get()->SetMultiplayerServer(); + tcUserInfo::Get()->SetScore(10.0e6); // set high score for high server "rank" } else Index: tcMessageCenter.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMessageCenter.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcMessageCenter.cpp 6 May 2005 23:57:50 -0000 1.7 --- tcMessageCenter.cpp 26 Jul 2005 00:37:04 -0000 1.8 *************** *** 65,68 **** --- 65,75 ---- } + void tcMessageCenter::ClearChannel(const std::string& channelName) + { + tcMessageChannel* channel = GetOrCreateChannel(channelName); + + channel->Clear(); + } + /** * Writes a message to the text console Index: tcCreditView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcCreditView.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcCreditView.cpp 2 Jul 2005 16:51:11 -0000 1.15 --- tcCreditView.cpp 26 Jul 2005 00:37:04 -0000 1.16 *************** *** 221,225 **** const float height = float(mnHeight); ! float fY = 0.25f*(float)nDeltaTime; float fX = 0.5f*(float)mnWidth; --- 221,225 ---- const float height = float(mnHeight); ! float fY = 0.35f*(float)nDeltaTime; float fX = 0.5f*(float)mnWidth; Index: tcMessageChannel.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMessageChannel.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcMessageChannel.cpp 4 Mar 2005 00:46:17 -0000 1.3 --- tcMessageChannel.cpp 26 Jul 2005 00:37:04 -0000 1.4 *************** *** 41,44 **** --- 41,51 ---- } + /** + * Clears all messages from channel + */ + void tcMessageChannel::Clear() + { + messages.clear(); + } /** *************** *** 101,112 **** std::deque<std::string>::reverse_iterator iter; float x = textRect.left + 10.0; ! float y = textRect.top; ! wxSize size; ! graphics->MeasureText(font, fontSize, "Tg", size); ! float lineSpacing = float(size.GetHeight()) + 2.0; for (iter = messages.rbegin(); iter != messages.rend(); ++iter) { y -= lineSpacing; if (y >= textRect.bottom + 10) --- 108,123 ---- std::deque<std::string>::reverse_iterator iter; float x = textRect.left + 10.0; ! float y = textRect.top - 5.0f; ! //wxSize size; ! //graphics->MeasureText(font, fontSize, "Tg", size); ! //float lineSpacing = float(size.GetHeight()) + 2.0; for (iter = messages.rbegin(); iter != messages.rend(); ++iter) { + wxSize size; + graphics->MeasureText(font, fontSize, iter->c_str(), size); + float lineSpacing = float(size.GetHeight()) + 2.0; + y -= lineSpacing; if (y >= textRect.bottom + 10) *************** *** 124,128 **** * */ ! std::string tcMessageChannel::GetName() { return channelName; --- 135,139 ---- * */ ! const std::string& tcMessageChannel::GetName() const { return channelName; Index: tc3DModel.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DModel.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** tc3DModel.cpp 20 Jul 2005 16:24:54 -0000 1.29 --- tc3DModel.cpp 26 Jul 2005 00:37:04 -0000 1.30 *************** *** 853,858 **** void tc3DModel::UpdateEffects() { - wxASSERT(gameObj || sensorTrack); - bool disableSmoke = ((smokeMode == tcParticleEffect::OFF) || (gameObj && gameObj->parent) || (distanceFromCamera > 2000)); --- 853,856 ---- Index: tcMessageInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMessageInterface.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcMessageInterface.cpp 6 May 2005 23:57:50 -0000 1.4 --- tcMessageInterface.cpp 26 Jul 2005 00:37:04 -0000 1.5 *************** *** 45,48 **** --- 45,58 ---- } + /** + * Clears contents of indicated message channel + */ + void tcMessageInterface::ClearChannel(const std::string& channelName) + { + wxASSERT(messageCenter); + + messageCenter->ClearChannel(channelName); + } + void tcMessageInterface::ConsoleMessage(const std::string& msg) { Index: tcHookInfo.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcHookInfo.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcHookInfo.cpp 14 Jul 2005 23:42:22 -0000 1.13 --- tcHookInfo.cpp 26 Jul 2005 00:37:04 -0000 1.14 *************** *** 72,76 **** color.set(0.4f, 1.0f, 0.4f, 1.0f); ! if (pSMTrack->mnDatabaseID == -1) { DrawTextR(zBuff, ftextx-2.0f, ftexty, defaultFont.get(), --- 72,76 ---- color.set(0.4f, 1.0f, 0.4f, 1.0f); ! if (!pSMTrack->IsIdentified()) { DrawTextR(zBuff, ftextx-2.0f, ftexty, defaultFont.get(), *************** *** 80,84 **** else // track is identified, look up class name { ! if (tcDatabaseObject* databaseObj = database->GetObject(pSMTrack->mnDatabaseID)) { s = databaseObj->mzClass.mz; --- 80,84 ---- else // track is identified, look up class name { ! if (tcDatabaseObject* databaseObj = database->GetObject(pSMTrack->GetDatabaseId())) { s = databaseObj->mzClass.mz; *************** *** 183,187 **** ** is detected, and detailed identification is not ** available */ ! if ((nEmitters > 0) && (pSMTrack->mnDatabaseID == -1)) { unsigned nCandidates = pSMTrack->ambiguityList.size(); --- 183,187 ---- ** is detected, and detailed identification is not ** available */ ! if ((nEmitters > 0) && (!pSMTrack->IsIdentified())) { unsigned nCandidates = pSMTrack->ambiguityList.size(); *************** *** 510,513 **** --- 510,516 ---- } + /** + * TODO: This code duplicates similar code in tcObjectControl. Needs to be merged. + */ void tcHookInfo::GetObjectInfo(std::string& s, tcDatabaseObject *apDBObject, tcGameObject *apGameObject) { *************** *** 524,619 **** } ! switch (apDBObject->mnClassID) ! { ! case DTYPE_GENERIC: ! strcpy(zClass,"GEN"); ! break; ! case DTYPE_MISSILE: ! strcpy(zClass,"MIS"); ! break; ! case DTYPE_LAUNCHER: ! strcpy(zClass,"LAU"); ! break; ! case DTYPE_AIR: ! strcpy(zClass,"AIR"); ! break; ! default: ! strcpy(zClass,"ERR"); ! break; ! } ! switch (apGameObject->mnModelType) ! { ! case MTYPE_SURFACE: ! strcpy(zModel,"SUR"); ! break; ! case MTYPE_CARRIER: ! strcpy(zModel,"CV"); ! break; ! case MTYPE_MISSILE: ! strcpy(zModel,"MIS"); ! break; ! case MTYPE_OBJECT: ! strcpy(zModel,"OBJ"); ! break; ! case MTYPE_AIR: ! strcpy(zModel,"AIR"); ! break; ! case MTYPE_FIXEDWING: ! strcpy(zModel,"FWAIR"); ! break; ! case MTYPE_FIXEDWINGX: ! strcpy(zModel,"FXAIR"); ! break; ! default: ! strcpy(zModel,"ERR"); ! break; ! } ! switch (apDBObject->mnType) ! { // classification type ! case PTYPE_UNKNOWN: ! strcpy(zType,"UNK"); ! break; ! case PTYPE_SURFACE: ! strcpy(zType,"USURF"); ! break; ! case PTYPE_SMALLSURFACE: ! strcpy(zType,"SSURF"); ! break; ! case PTYPE_LARGESURFACE: ! strcpy(zType,"LSURF"); ! break; ! case PTYPE_AIR: ! strcpy(zType,"UAIR"); ! break; ! case PTYPE_FIXEDWING: ! strcpy(zType,"FWAIR"); ! break; ! case PTYPE_MISSILE: ! strcpy(zType,"MIS"); ! break; ! case PTYPE_HELO: ! strcpy(zType,"HELO"); ! break; ! case PTYPE_SUBSURFACE: ! strcpy(zType,"USUB"); ! break; ! case PTYPE_SUBMARINE: ! strcpy(zType,"SUB"); ! break; ! case PTYPE_TORPEDO: ! strcpy(zType,"TORP"); ! break; ! case PTYPE_FIXED: ! strcpy(zType,"LAND"); ! break; ! default: ! strcpy(zType,"ERR"); ! break; ! } ! char zBuff[128]; ! sprintf(zBuff,"%s %s %s",zClass,zModel,zType); ! s = zBuff; } --- 527,653 ---- } ! switch (apDBObject->mnClassID) ! { ! case DTYPE_GENERIC: ! strcpy(zClass,"GEN"); ! break; ! case DTYPE_MISSILE: ! strcpy(zClass,"MIS"); ! break; ! case DTYPE_LAUNCHER: ! strcpy(zClass,"LAU"); ! break; ! case DTYPE_AIR: ! strcpy(zClass,"AIR"); ! break; ! case DTYPE_BALLISTIC: ! strcpy(zClass,"BAL"); ! break; ! case DTYPE_TORPEDO: ! strcpy(zClass, "TOR"); ! break; ! case DTYPE_SUBMARINE: ! strcpy(zClass, "SUB"); ! break; ! default: ! strcpy(zClass,"UNK"); ! break; ! } ! switch (apGameObject->mnModelType) ! { ! case MTYPE_SURFACE: ! strcpy(zModel,"SUR"); ! break; ! case MTYPE_CARRIER: ! strcpy(zModel,"CV"); ! break; ! case MTYPE_MISSILE: ! strcpy(zModel,"MIS"); ! break; ! case MTYPE_OBJECT: ! strcpy(zModel,"OBJ"); ! break; ! case MTYPE_AIR: ! strcpy(zModel,"AIR"); ! break; ! case MTYPE_FIXEDWING: ! strcpy(zModel,"FWAIR"); ! break; ! case MTYPE_FIXEDWINGX: ! strcpy(zModel,"FXAIR"); ! break; ! case MTYPE_HELO: ! strcpy(zModel,"HELO"); ! break; ! case MTYPE_BALLISTIC: ! strcpy(zModel,"BAL"); ! break; ! case MTYPE_AIRFIELD: ! strcpy(zModel,"FIELD"); ! break; ! case MTYPE_SUBMARINE: ! strcpy(zModel,"SUB"); ! break; ! case MTYPE_TORPEDO: ! strcpy(zModel, "TOR"); ! break; ! case MTYPE_FIXED: ! strcpy(zModel, "GND"); ! break; ! default: ! strcpy(zModel,"UNK"); ! break; ! } ! switch (apDBObject->mnType) // classification type ! { ! case PTYPE_UNKNOWN: ! strcpy(zType,"UNK"); ! break; ! case PTYPE_SURFACE: ! strcpy(zType,"USURF"); ! break; ! case PTYPE_SMALLSURFACE: ! strcpy(zType,"SSURF"); ! break; ! case PTYPE_LARGESURFACE: ! strcpy(zType,"LSURF"); ! break; ! case PTYPE_AIR: ! strcpy(zType,"UAIR"); ! break; ! case PTYPE_FIXEDWING: ! strcpy(zType,"FWAIR"); ! break; ! case PTYPE_MISSILE: ! strcpy(zType,"MIS"); ! break; ! case PTYPE_HELO: ! strcpy(zType,"HELO"); ! break; ! case PTYPE_SUBSURFACE: ! strcpy(zType,"USUB"); ! break; ! case PTYPE_SUBMARINE: ! strcpy(zType,"SUB"); ! break; ! case PTYPE_TORPEDO: ! strcpy(zType,"TORP"); ! break; ! case PTYPE_FIXED: ! strcpy(zType,"LAND"); ! break; ! case PTYPE_BALLISTIC: ! strcpy(zType,"BAL"); ! break; ! default: ! strcpy(zType,"ERR"); ! break; ! } ! ! char zBuff[128]; ! sprintf(zBuff,"%s %s %s",zClass,zModel,zType); ! s = zBuff; } Index: tcGameView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcGameView.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcGameView.cpp 28 Jun 2005 02:51:34 -0000 1.13 --- tcGameView.cpp 26 Jul 2005 00:37:04 -0000 1.14 *************** *** 630,634 **** mpMapView->maMapObj[rnIndex].isStaleTrack = false; mpMapView->maMapObj[rnIndex].isDestroyed = false; ! mpMapView->maMapObj[rnIndex].useAltered = (po->IsClientMode() && !po->IsControlled()); --- 630,634 ---- mpMapView->maMapObj[rnIndex].isStaleTrack = false; mpMapView->maMapObj[rnIndex].isDestroyed = false; ! mpMapView->maMapObj[rnIndex].useAltered = (!po->IsControlled()); Index: ObjectUpdater.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/ObjectUpdater.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** ObjectUpdater.cpp 17 Jul 2005 12:58:04 -0000 1.20 --- ObjectUpdater.cpp 26 Jul 2005 00:37:04 -0000 1.21 *************** *** 69,72 **** --- 69,73 ---- tcGameObject* gameObject = model->GetGameObj(); + wxASSERT(gameObject); *************** *** 105,108 **** --- 106,151 ---- /** + * This version updates animations for models attached to sensor tracks + */ + void ObjectUpdater::UpdateTrackAnimations() + { + size_t nAnimations = model->animationInfo.size(); + if (nAnimations == 0) return; + + tcSensorMapTrack* track = model->GetSensorTrack(); + wxASSERT(track); + + // do not update animations if camera is beyond animation LOD distance + //if (distanceFromCamera > 10000.0f) return; + + for(size_t n=0;n<nAnimations;n++) + { + tcAnimationInfo& info = model->animationInfo[n]; + + if (info.bound) + { + osg::MatrixTransform *xform = info.transform; + //osg::Matrix matrix = xform->getMatrix(); + double dt = viewer->GetGameTimeStep(); + double theta = info.omega * dt; // change in angle + + // scale rotation rate by platform speed for propeller animation type + if (info.animationType == 0) + { + /* for subs and surface ships change rate with speed (omega is radians per second per knot) + ** aircraft including helos use a fixed rate (omega is radians per second) + */ + if (track->mfSpeed_kts < 50.0f) + { + theta *= track->mfSpeed_kts ; + } + } + + xform->preMult(osg::Matrix::rotate(theta , info.axis)); + } + } + } + + /** * Omits child (captive object) updates */ *************** *** 122,126 **** // first case assumes track identification is never wrong (currently true) ! if (track->mnDatabaseID != -1) genericMode = tc3DModel::USE_TRUE_MODEL; else if (track->IsSurface()) genericMode = tc3DModel::USE_SURFACE_GENERIC; else if (track->IsAir()) genericMode = tc3DModel::USE_AIR_GENERIC; --- 165,169 ---- // first case assumes track identification is never wrong (currently true) ! if (track->GetDatabaseId() != -1) genericMode = tc3DModel::USE_TRUE_MODEL; else if (track->IsSurface()) genericMode = tc3DModel::USE_SURFACE_GENERIC; else if (track->IsAir()) genericMode = tc3DModel::USE_AIR_GENERIC; *************** *** 244,248 **** { UpdateTrack(node); ! UpdateAnimations(); // must call any nested node callbacks and continue subgraph traversal. --- 287,291 ---- { UpdateTrack(node); ! UpdateTrackAnimations(); // must call any nested node callbacks and continue subgraph traversal. Index: SmokeTrailEmitter.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/SmokeTrailEmitter.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SmokeTrailEmitter.cpp 2 Nov 2004 04:23:56 -0000 1.2 --- SmokeTrailEmitter.cpp 26 Jul 2005 00:37:04 -0000 1.3 *************** *** 28,31 **** --- 28,32 ---- #include <graphics/SmokeTrailEmitter.h> #include <osgParticle/Emitter> + #include "common/randfn.h" #ifdef _DEBUG *************** *** 35,45 **** //#pragma warning (disable: 4273) // inconsistent dll linkage ! void osgParticle::SmokeTrailEmitter::InitializeCloseupTemplate() { Particle standardTemplate; standardTemplate.setLifeTime(2); ! standardTemplate.setSizeRange(osgParticle::rangef(0.5f, 1.0f)); ! standardTemplate.setAlphaRange(osgParticle::rangef(0.2f, 0.5f)); standardTemplate.setColorRange(osgParticle::rangev4( osg::Vec4(0.5f, 0.5f, 0.5f, 0.5f), --- 36,46 ---- //#pragma warning (disable: 4273) // inconsistent dll linkage ! void osgParticle::SmokeTrailEmitter::InitializeStandardTemplate() { Particle standardTemplate; standardTemplate.setLifeTime(2); ! standardTemplate.setSizeRange(osgParticle::rangef(0.6f, 1.0f)); ! standardTemplate.setAlphaRange(osgParticle::rangef(0.4f, 0.1f)); standardTemplate.setColorRange(osgParticle::rangev4( osg::Vec4(0.5f, 0.5f, 0.5f, 0.5f), *************** *** 48,60 **** standardTemplate.setMass(0.05f); setParticleTemplate(standardTemplate); - - closeUpTemplate.setLifeTime(0.2); - closeUpTemplate.setSizeRange(osgParticle::rangef(0.4f, 0.5f)); - closeUpTemplate.setAlphaRange(osgParticle::rangef(0.3f, 0.1f)); - closeUpTemplate.setColorRange(osgParticle::rangev4( - osg::Vec4(0.5f, 0.5f, 0.5f, 1.0f), - osg::Vec4(0.7, 0.7f, 0.7f, 0.5f))); - //closeUpTemplate.setRadius(0.1f); - closeUpTemplate.setMass(0.05f); } --- 49,52 ---- *************** *** 63,67 **** placer_(new tcParticlePlacer) { ! InitializeCloseupTemplate(); } --- 55,59 ---- placer_(new tcParticlePlacer) { ! InitializeStandardTemplate(); } *************** *** 70,94 **** placer_(static_cast<tcParticlePlacer*>(copyop(copy.placer_.get()))) { ! InitializeCloseupTemplate(); } void osgParticle::SmokeTrailEmitter::emit(double dt) { ! int n = 30; ! for (int i=0; i<n; ++i) { ! if (i==0) ! { ! if (Particle* P = getParticleSystem()->createParticle(&getParticleTemplate())) ! { ! placer_->placeAlongPath(P, 1.2f); ! } ! } ! else if (Particle* P = ! getParticleSystem()->createParticle(&closeUpTemplate)) { ! float fractionalDistance = 0.2f + float(i) / float(n); placer_->placeAlongPath(P, fractionalDistance); } } } --- 62,86 ---- placer_(static_cast<tcParticlePlacer*>(copyop(copy.placer_.get()))) { ! InitializeStandardTemplate(); } void osgParticle::SmokeTrailEmitter::emit(double dt) { ! int nEmit = (dt > 0) ? 30 : 0; ! float inv_nEmit = (nEmit > 0) ? 1.0 / float(nEmit) : 1.0f; ! ! for (int i=0; i<nEmit; ++i) { ! if (Particle* P = ! getParticleSystem()->createParticle(&getParticleTemplate())) { ! float fractionalDistance = 0.2f + float(i) * inv_nEmit; placer_->placeAlongPath(P, fractionalDistance); + + float rand_val = randf(1.0f); + P->setLifeTime(0.5f + 1.5 * rand_val); + P->setRadius(0.5 + 0.25*rand_val); } + } } |
|
From: Dewitt C. <ddc...@us...> - 2005-07-26 00:37:31
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13788/src/scriptinterface Modified Files: tcPlatformInterface.cpp tcScenarioInterface.cpp Log Message: Added mission goal status to "Mission" channel (hit F7), added sub periscope and mast ops to multiplayer, changed torpedo behavior to resume s-search if track lost early, made afterburner smoke thin a little more uniformly Index: tcPlatformInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterface.cpp,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** tcPlatformInterface.cpp 14 Jul 2005 23:42:23 -0000 1.50 --- tcPlatformInterface.cpp 26 Jul 2005 00:37:04 -0000 1.51 *************** *** 180,183 **** --- 180,184 ---- void tcPlatformInterface::SetAltitude(float alt_m) { + if (!mpPlatformObj->IsControlled()) return; mpPlatformObj->SetAltitude(alt_m); } *************** *** 189,192 **** --- 190,194 ---- void tcPlatformInterface::SetLandingState(int state) { + if (!mpPlatformObj->IsControlled()) return; if (tcAirObject *air = dynamic_cast<tcAirObject*>(mpPlatformObj)) { *************** *** 209,212 **** --- 211,215 ---- void tcPlatformInterface::SetSpeed(float speed_kts) { + if (!mpPlatformObj->IsControlled()) return; mpPlatformObj->SetSpeed(speed_kts); } *************** *** 218,221 **** --- 221,226 ---- { if (mpPlatformObj == 0) {return;} + if (!mpPlatformObj->IsControlled()) return; + if (tcAeroAirObject* aaObj = dynamic_cast<tcAeroAirObject*>(mpPlatformObj)) { *************** *** 232,235 **** --- 237,241 ---- void tcPlatformInterface::SetThrottle(float throttleFraction) { + if (!mpPlatformObj->IsControlled()) return; if (tcAeroAirObject* aaObj = dynamic_cast<tcAeroAirObject*>(mpPlatformObj)) { *************** *** 247,250 **** --- 253,257 ---- void tcPlatformInterface::SetTarget(long anID) { + if (!mpPlatformObj->IsControlled()) return; mpPlatformObj->DesignateTarget(anID); } *************** *** 357,360 **** --- 364,386 ---- } + /** + * + */ + void tcPlatformInterface::SetHeading(float heading_deg) + { + if (!mpPlatformObj->IsControlled()) return; + + mpPlatformObj->SetHeading(C_PIOVER180*heading_deg); + } + + /** + * + */ + void tcPlatformInterface::SetHeadingRad(float heading_rad) + { + if (!mpPlatformObj->IsControlled()) return; + mpPlatformObj->SetHeading(heading_rad); + } + /** * If target is valid, sets heading to intercept target. *************** *** 363,366 **** --- 389,393 ---- float tcPlatformInterface::SetHeadingToInterceptTarget() { + if (!mpPlatformObj->IsControlled()) return 0; tcSensorMapTrack track; float fHeading_rad, fTTI; *************** *** 599,602 **** --- 626,630 ---- void tcPlatformInterface::Launch(int anLauncher, int quantity) { + if (!mpPlatformObj->IsControlled()) return; int launcherStatus = mpPlatformObj->SetLaunch(anLauncher, quantity); if (launcherStatus != tcLauncher::LAUNCHER_READY) *************** *** 676,679 **** --- 704,708 ---- void tcPlatformInterface::LoadLauncher(int anLauncher, std::string item) { + if (!mpPlatformObj->IsControlled()) return; // verify launcher is empty and item is compatible with launcher tcLauncher* launcher = mpPlatformObj->GetLauncher(anLauncher); *************** *** 705,708 **** --- 734,738 ---- void tcPlatformInterface::UnloadLauncher(int anLauncher) { + if (!mpPlatformObj->IsControlled()) return; tcLauncher* launcher = mpPlatformObj->GetLauncher(anLauncher); if (!launcher) return; *************** *** 984,987 **** --- 1014,1018 ---- float tcPlatformInterface::SetHeadingToInterceptTrack(tcSensorMapTrack track) { + if (!mpPlatformObj->IsControlled()) return 0; float fHeading_rad, fTTI; *************** *** 1053,1056 **** --- 1084,1088 ---- void tcPlatformInterface::SetAllSensorState(int anState) { + if (!mpPlatformObj->IsControlled()) return; unsigned nSensors = mpPlatformObj->GetSensorCount(); *************** *** 1063,1066 **** --- 1095,1099 ---- void tcPlatformInterface::SetSensorState(int n, int state) { + if (!mpPlatformObj->IsControlled()) return; mpPlatformObj->SetSensorState((unsigned)n, state != 0); } *************** *** 1087,1091 **** if (mpPlatformObj->IsControlled()) { ! tcMultiplayerInterface::Get()->SendControlRelease(mpPlatformObj->mnID); } } --- 1120,1131 ---- if (mpPlatformObj->IsControlled()) { ! if (tcMultiplayerInterface::Get()->IsServer()) ! { ! mpPlatformObj->SetController(""); ! } ! else ! { ! tcMultiplayerInterface::Get()->SendControlRelease(mpPlatformObj->mnID); ! } } } *************** *** 1097,1101 **** if (mpPlatformObj->IsAvailable()) { ! tcMultiplayerInterface::Get()->SendControlRequest(mpPlatformObj->mnID); } } --- 1137,1148 ---- if (mpPlatformObj->IsAvailable()) { ! if (tcMultiplayerInterface::Get()->IsServer()) ! { ! mpPlatformObj->SetController(tcUserInfo::Get()->GetUsername()); ! } ! else ! { ! tcMultiplayerInterface::Get()->SendControlRequest(mpPlatformObj->mnID); ! } } } *************** *** 1122,1127 **** bool tcPlatformInterface::IsPlayerControlled() const { ! // single player or server, check for alliance match only ! if (!mpPlatformObj->IsClientMode()) { return mpSimState->mpUserInfo->IsOwnAlliance(mpPlatformObj->GetAlliance()); --- 1169,1174 ---- bool tcPlatformInterface::IsPlayerControlled() const { ! // single player, check for alliance match only ! if (!mpSimState->IsMultiplayerActive()) { return mpSimState->mpUserInfo->IsOwnAlliance(mpPlatformObj->GetAlliance()); Index: tcScenarioInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcScenarioInterface.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** tcScenarioInterface.cpp 17 Jul 2005 12:58:05 -0000 1.32 --- tcScenarioInterface.cpp 26 Jul 2005 00:37:04 -0000 1.33 *************** *** 202,205 **** --- 202,206 ---- .def("TimeGoal",&tcScenarioInterface::TimeGoal) .def("DestroyGoal",&tcScenarioInterface::DestroyGoal) + .def("ProtectGoal",&tcScenarioInterface::ProtectGoal) ; return InterfaceType; *************** *** 527,534 **** { wxASSERT(simState); ! wxASSERT(simState->GetGoalTracker()); tcGoal *allianceGoal = goal.Clone(); ! simState->GetGoalTracker()->SetAllianceGoal(alliance, allianceGoal); } --- 528,535 ---- { wxASSERT(simState); ! wxASSERT(tcGoalTracker::Get()); tcGoal *allianceGoal = goal.Clone(); ! tcGoalTracker::Get()->SetAllianceGoal(alliance, allianceGoal); } *************** *** 809,813 **** * workaround to construct goal class */ ! tcDestroyGoal tcScenarioInterface::DestroyGoal(std::string target) { tcDestroyGoal goal(target); --- 810,814 ---- * workaround to construct goal class */ ! tcDestroyGoal tcScenarioInterface::DestroyGoal(const std::string& target) { tcDestroyGoal goal(target); *************** *** 815,818 **** --- 816,825 ---- } + tcProtectGoal tcScenarioInterface::ProtectGoal(const std::string& target) + { + tcProtectGoal goal(target); + return goal; + } + tcScenarioInterface::tcScenarioInterface() : lon_theater_deg(0), |
|
From: Dewitt C. <ddc...@us...> - 2005-07-26 00:37:30
|
Update of /cvsroot/gcblue/gcb_wx/src/network In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13788/src/network Modified Files: tcMultiplayerInterface.cpp tcUpdateMessageHandler.cpp Log Message: Added mission goal status to "Mission" channel (hit F7), added sub periscope and mast ops to multiplayer, changed torpedo behavior to resume s-search if track lost early, made afterburner smoke thin a little more uniformly Index: tcUpdateMessageHandler.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/network/tcUpdateMessageHandler.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tcUpdateMessageHandler.cpp 8 May 2005 23:28:58 -0000 1.16 --- tcUpdateMessageHandler.cpp 26 Jul 2005 00:37:04 -0000 1.17 *************** *** 34,37 **** --- 34,38 ---- #include "common/tcStream.h" #include "common/tcObjStream.h" + #include "tcGoalTracker.h" #include "tcSimPythonInterface.h" #include "tcScenarioInterface.h" *************** *** 126,129 **** --- 127,139 ---- } + void tcUpdateMessageHandler::AddGoalStatus(long alliance, tcUpdateStream& stream) + { + stream.SetDetailLevel(alliance); + + tcGoalTracker* goalTracker = tcGoalTracker::Get(); + + goalTracker->operator>>(stream); + } + void tcUpdateMessageHandler::AddScenarioInfo(tcUpdateStream& stream) { *************** *** 229,232 **** --- 239,244 ---- case SCENARIO_INFO: break; + case GOAL_STATUS: + break; default: fprintf(stderr, "tcUpdateMessageHandler::InitializeMessage - bad message type\n"); *************** *** 352,355 **** --- 364,374 ---- } break; + case GOAL_STATUS: + { + tcUpdateStream stream((const char*)data, messageSize); + stream >> messageType; + HandleGoalStatus(stream); + } + break; default: fprintf(stderr, "tcUpdateMessageHandler::Handle - " *************** *** 640,643 **** --- 659,675 ---- } + /** + * Handle message from server to client updating goal status + */ + void tcUpdateMessageHandler::HandleGoalStatus(tcUpdateStream& stream) + { + wxASSERT(tcSimState::Get()->IsMultiplayerClient()); + + tcGoalTracker* goalTracker = tcGoalTracker::Get(); + + goalTracker->operator<<(stream); + } + + void tcUpdateMessageHandler::HandleScenarioInfo(tcUpdateStream& stream) { Index: tcMultiplayerInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/network/tcMultiplayerInterface.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** tcMultiplayerInterface.cpp 22 Jun 2005 01:22:08 -0000 1.29 --- tcMultiplayerInterface.cpp 26 Jul 2005 00:37:04 -0000 1.30 *************** *** 1489,1492 **** --- 1489,1494 ---- { UpdateSensorMaps(); + + UpdateGoalStatus(); } *************** *** 1609,1612 **** --- 1611,1653 ---- } + /** + * Periodically sends goal status (win/loss) to all clients + */ + void tcMultiplayerInterface::UpdateGoalStatus() + { + static unsigned int lastUpdate = 0; + + wxASSERT(IsServer()); + + unsigned t = tcTime::Get()->Get30HzCount(); + if (t - lastUpdate < goalUpdateInterval) return; + lastUpdate = t; + + const std::list<int>& connectionList = networkInterface->GetConnectionList(); + + std::list<int>::const_iterator iter = connectionList.begin(); + unsigned n = 0; + for( ; iter != connectionList.end(); ++iter) + { + int connectionId = *iter; + + tcPlayerStatus& player = GetPlayerStatus(connectionId); + + if (player.isAuthenticated) + { + tcUpdateStream updateStream; + + tcUpdateMessageHandler::InitializeMessage(tcUpdateMessageHandler::GOAL_STATUS, updateStream); + tcUpdateMessageHandler::AddGoalStatus(player.GetAlliance(), updateStream); + + SendUpdateMessageAck(connectionId, updateStream); + + fprintf(stdout, "Performed goal status update, conn %d, t: %d\n", + connectionId, t); + } + } + + } + /** *************** *** 1987,1991 **** evtHandler(0), entityUpdateInterval(50), ! sensorUpdateInterval(50) { networkInterface = new tcNetworkInterface(); --- 2028,2033 ---- evtHandler(0), entityUpdateInterval(50), ! sensorUpdateInterval(50), ! goalUpdateInterval(600) { networkInterface = new tcNetworkInterface(); *************** *** 2012,2016 **** tcMultiplayerInterface::tcMultiplayerInterface(const tcMultiplayerInterface& source) : entityUpdateInterval(50), ! sensorUpdateInterval(50) { wxASSERT(false); --- 2054,2059 ---- tcMultiplayerInterface::tcMultiplayerInterface(const tcMultiplayerInterface& source) : entityUpdateInterval(50), ! sensorUpdateInterval(50), ! goalUpdateInterval(600) { wxASSERT(false); |
|
From: Dewitt C. <ddc...@us...> - 2005-07-26 00:37:20
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13788/src/common Modified Files: tcSound.cpp tcStream.cpp Log Message: Added mission goal status to "Mission" channel (hit F7), added sub periscope and mast ops to multiplayer, changed torpedo behavior to resume s-search if track lost early, made afterburner smoke thin a little more uniformly Index: tcSound.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/tcSound.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** tcSound.cpp 20 Jul 2005 16:24:54 -0000 1.33 --- tcSound.cpp 26 Jul 2005 00:37:03 -0000 1.34 *************** *** 87,91 **** bool tcSound::Init() { ! InitOpenAL(); effectMap["Explosion"] = LoadSample("Explosion.wav"); --- 87,101 ---- bool tcSound::Init() { ! try ! { ! InitOpenAL(); ! } ! catch (openalpp::InitError e) ! { ! e.what(); ! wxMessageBox(e.what(), ! "Error", wxICON_ERROR); ! throw e; ! } effectMap["Explosion"] = LoadSample("Explosion.wav"); Index: tcStream.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/tcStream.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcStream.cpp 22 Jun 2005 01:22:07 -0000 1.11 --- tcStream.cpp 26 Jul 2005 00:37:03 -0000 1.12 *************** *** 289,293 **** if (len >= 2048) { ! std::cerr << "tcStream::operator>>(std::string& val) - length overflow\n"; } else --- 289,294 ---- if (len >= 2048) { ! fprintf(stderr, "tcStream::operator>>(std::string& val) - length overflow (%d)\n", ! len); } else |
|
From: Dewitt C. <ddc...@us...> - 2005-07-26 00:37:19
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13788/src/sim Modified Files: Game.cpp tcControllableObject.cpp tcGoal.cpp tcGoalTracker.cpp tcLauncher.cpp tcObjectControl.cpp tcSensorMapTrack.cpp tcSimState.cpp tcSubObject.cpp tcTorpedoObject.cpp Log Message: Added mission goal status to "Mission" channel (hit F7), added sub periscope and mast ops to multiplayer, changed torpedo behavior to resume s-search if track lost early, made afterburner smoke thin a little more uniformly Index: tcSubObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSubObject.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcSubObject.cpp 20 Jul 2005 16:24:55 -0000 1.14 --- tcSubObject.cpp 26 Jul 2005 00:37:05 -0000 1.15 *************** *** 51,54 **** --- 51,63 ---- tcPlatformObject::operator<<(stream); + unsigned char mastFlags; + stream >> mastFlags; + + SetPeriscopeState((mastFlags & PERISCOPE) != 0); + SetRadarMastState((mastFlags & RADARMAST) != 0); + SetSnorkelState((mastFlags & SNORKEL) != 0); + + commandObj.ClearNewCommand(); + return stream; } *************** *** 61,64 **** --- 70,80 ---- tcPlatformObject::operator>>(stream); + unsigned char mastFlags = 0; + if (periscopeRaised) mastFlags |= PERISCOPE; + if (radarMastRaised) mastFlags |= RADARMAST; + if (isSnorkeling) mastFlags |= SNORKEL; + + stream << mastFlags; + return stream; } *************** *** 265,268 **** --- 281,286 ---- void tcSubObject::SetPeriscopeState(bool state) { + if (periscopeRaised == state) return; + periscopeRaised = state; *************** *** 276,279 **** --- 294,299 ---- tcMessageInterface::Get()->PopupMessage(s); } + + commandObj.SetNewCommand(MAST_CMD); } *************** *** 283,286 **** --- 303,308 ---- void tcSubObject::SetRadarMastState(bool state) { + if (radarMastRaised == state) return; + radarMastRaised = state; *************** *** 294,297 **** --- 316,321 ---- tcMessageInterface::Get()->PopupMessage(s); } + + commandObj.SetNewCommand(MAST_CMD); } *************** *** 303,307 **** --- 327,336 ---- if (!IsDieselElectric()) return; + if (isSnorkeling == state) return; + isSnorkeling = state; + + + commandObj.SetNewCommand(MAST_CMD); } *************** *** 531,535 **** else { ! sensor->SetActive(false); } } --- 560,564 ---- else { ! SetSensorState(n, false); // vs. sensor->SetActive(false) to have correct multiplayer messages sent } } Index: tcSimState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSimState.cpp,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** tcSimState.cpp 14 Jul 2005 23:42:24 -0000 1.87 --- tcSimState.cpp 26 Jul 2005 00:37:05 -0000 1.88 *************** *** 741,744 **** --- 741,751 ---- afDamage = afDamage * damageEffectiveness; // scale damage by effectiveness + // allow small chance of quadruple damage critical hit + if (damageEffectiveness > 0.98f) + { + afDamage *= 4.0f; + } + + tcPlatformObject *pPlatformObj = dynamic_cast<tcPlatformObject*>(apGameObj); if (pPlatformObj != NULL) *************** *** 2617,2620 **** --- 2624,2628 ---- tcGameObject::SetClientMode(false); tcCommandObject::SetClientMode(false); + tcControllableObject::SetSinglePlayerMode(true); if (tcOptions::Get()->OptionStringExists("UsePositionRegistry")) *************** *** 2643,2646 **** --- 2651,2655 ---- tcGameObject::SetClientMode(true); tcCommandObject::SetClientMode(true); + tcControllableObject::SetSinglePlayerMode(false); if (positionRegistry) *************** *** 2661,2664 **** --- 2670,2674 ---- tcGameObject::SetClientMode(false); tcCommandObject::SetClientMode(false); + tcControllableObject::SetSinglePlayerMode(false); if (tcOptions::Get()->OptionStringExists("UsePositionRegistry")) *************** *** 2772,2776 **** strcpy(msScenarioInfo.mzDescription,""); msScenarioInfo.mbLoaded = false; ! goalTracker = new tcGoalTracker(); tcGoal::AttachSimState(this); --- 2782,2786 ---- strcpy(msScenarioInfo.mzDescription,""); msScenarioInfo.mbLoaded = false; ! goalTracker = tcGoalTracker::Get(); tcGoal::AttachSimState(this); *************** *** 2818,2822 **** { Clear(); ! if (goalTracker) delete goalTracker; if (positionRegistry) delete positionRegistry; } --- 2828,2832 ---- { Clear(); ! if (positionRegistry) delete positionRegistry; } Index: tcSensorMapTrack.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSensorMapTrack.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcSensorMapTrack.cpp 20 Jul 2005 16:24:55 -0000 1.4 --- tcSensorMapTrack.cpp 26 Jul 2005 00:37:05 -0000 1.5 *************** *** 70,74 **** } ! stream >> mnDatabaseID; stream >> sensorFlags; --- 70,77 ---- } ! long databaseId; ! stream >> databaseId; ! IdentifyTrack(databaseId); ! stream >> sensorFlags; *************** *** 194,198 **** void tcSensorMapTrack::SetModel(tc3DModel* model_) { ! if (model) delete model; model = model_; } --- 197,208 ---- void tcSensorMapTrack::SetModel(tc3DModel* model_) { ! if (model) ! { ! // why isn't this part of tc3DModel destructor? (same issue in tcGameObject) ! model->SetSmokeMode(0); ! model->UpdateEffects(); // clear smoke particle generator ! model->DetachFromParent(); ! delete model; ! } model = model_; } *************** *** 366,370 **** if ((ambiguityList.size() == 1) && (mnDatabaseID == -1)) { ! mnDatabaseID = ambiguityList[0]; } --- 376,380 ---- if ((ambiguityList.size() == 1) && (mnDatabaseID == -1)) { ! IdentifyTrack(ambiguityList[0]); } *************** *** 419,423 **** if (databaseID != -1) { ! mnDatabaseID = databaseID; } --- 429,433 ---- if (databaseID != -1) { ! IdentifyTrack(databaseID); } *************** *** 561,564 **** --- 571,582 ---- } + /** + * @returns database id of track or -1 if not identified + */ + long tcSensorMapTrack::GetDatabaseId() const + { + return mnDatabaseID; + } + void tcSensorMapTrack::IdentifyTrack(long id) { *************** *** 567,572 **** // load new 3D mode ! //tcDatabaseObject* objData = tcDatabase::Get()->GetObject(id); ! //SetModel(objData->Get3DModel()); } --- 585,590 ---- // load new 3D mode ! tcDatabaseObject* objData = tcDatabase::Get()->GetObject(id); ! SetModel(objData->Copy3DModel()); } Index: tcGoal.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcGoal.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcGoal.cpp 2 Nov 2004 04:23:56 -0000 1.6 --- tcGoal.cpp 26 Jul 2005 00:37:05 -0000 1.7 *************** *** 68,71 **** --- 68,75 ---- class_<tcDestroyGoal, bases<tcGoal> >("DestroyGoal", init<std::string>()) ; + + object ProtectGoalType = + class_<tcProtectGoal, bases<tcGoal> >("ProtectGoal", init<std::string>()) + ; } *************** *** 121,130 **** * Writes status summary of goal condition to file */ ! void tcGoal::WriteStatus(std::stringstream& stream) { stream << "* Generic goal" << GoalStateToString(goalState) << "\n"; } tcGoal::tcGoal() { goalState = UNRESOLVED; --- 125,140 ---- * Writes status summary of goal condition to file */ ! void tcGoal::WriteStatus(std::stringstream& stream, unsigned int level) { + for (unsigned int n=0; n<level; n++) + { + stream << indentString; + } + stream << "* Generic goal" << GoalStateToString(goalState) << "\n"; } tcGoal::tcGoal() + : indentString(" ") { goalState = UNRESOLVED; *************** *** 132,135 **** --- 142,146 ---- tcGoal::tcGoal(const tcGoal& goal) + : indentString(goal.indentString) { goalState = goal.goalState; *************** *** 161,165 **** { wxASSERT(simState); - if (goalState != UNRESOLVED) return; // resolved, return immediately // use children to determine pass/fail --- 172,175 ---- *************** *** 190,195 **** } } ! void tcCompoundGoal::WriteStatus(std::stringstream& stream) { std::string typeString; --- 200,210 ---- } } ! void tcCompoundGoal::WriteStatus(std::stringstream& stream, unsigned int level) { + for (unsigned int n=0; n<level; n++) + { + stream << indentString; + } + std::string typeString; *************** *** 204,208 **** stream << "* Compound Goal -- " ! "Mission to achieve " << typeString << " of these subgoals "; if (goalState == PASSED) --- 219,223 ---- stream << "* Compound Goal -- " ! "Mission to achieve " << typeString << " of the following subgoals "; if (goalState == PASSED) *************** *** 224,230 **** for (size_t n=0; n<nChildren; n++) { - stream << " "; tcGoal* childGoal = children.at(n); ! childGoal->WriteStatus(stream); } } --- 239,244 ---- for (size_t n=0; n<nChildren; n++) { tcGoal* childGoal = children.at(n); ! childGoal->WriteStatus(stream, level + 1); } } *************** *** 282,287 **** } ! void tcTimeGoal::WriteStatus(std::stringstream& stream) { if (simState->GetTime() >= passTimeout) { --- 296,306 ---- } ! void tcTimeGoal::WriteStatus(std::stringstream& stream, unsigned int level) { + for (unsigned int n=0; n<level; n++) + { + stream << indentString; + } + if (simState->GetTime() >= passTimeout) { *************** *** 337,365 **** if (goalState != UNRESOLVED) return; // resolved, return immediately ! unsigned int nSize = simState->GetPlatformCount(); ! tnPoolIndex pos = simState->GetPlatformStartPosition(); ! tnPoolIndex key; ! bool unitFound = false; ! // inefficient linear search for now ! for(unsigned i=0;(i<nSize)&&(!unitFound);i++) ! { ! tcGameObject *obj; ! simState->GetNextPlatform(pos,key,obj); ! if (targetString == obj->mzUnit.mz) unitFound = true; ! } ! if (!unitFound) { ! goalState = PASSED; } } ! void tcDestroyGoal::WriteStatus(std::stringstream& stream) { ! stream << "* Destroy Goal -- Platform " << targetString; ! if (goalState == PASSED) { stream << " was DESTROYED.\n"; --- 356,433 ---- if (goalState != UNRESOLVED) return; // resolved, return immediately + tcGameObject* obj = simState->GetObjectByName(targetString); + if (obj == 0) + { + goalState = PASSED; + } ! } ! void tcDestroyGoal::WriteStatus(std::stringstream& stream, unsigned int level) ! { ! for (unsigned int n=0; n<level; n++) ! { ! stream << indentString; ! } ! ! stream << "* Destroy Goal -- " << targetString; ! ! if (goalState == PASSED) ! { ! stream << " was DESTROYED.\n"; ! } ! else ! { ! stream << " NOT DESTROYED.\n"; ! } ! } ! ! ! tcDestroyGoal::tcDestroyGoal(const tcDestroyGoal& goal) ! : tcGoal(goal) ! { ! targetString = goal.targetString; ! } ! ! /*** tcProtectGoal ***/ ! ! tcGoal* tcProtectGoal::Clone() ! { ! tcGoal *goal = new tcProtectGoal(*this); ! return goal; ! } ! ! ! void tcProtectGoal::Update() ! { ! wxASSERT(simState); ! ! tcGameObject* obj = simState->GetObjectByName(targetString); ! ! if (obj == 0) { ! goalState = FAILED; } + else if (obj->mfDamageLevel >= 1.0) + { + goalState = FAILED; + } + else + { + goalState = PASSED; + } } ! void tcProtectGoal::WriteStatus(std::stringstream& stream, unsigned int level) { ! for (unsigned int n=0; n<level; n++) ! { ! stream << indentString; ! } ! stream << "* Protect Goal -- " << targetString; ! ! if (goalState == FAILED) { stream << " was DESTROYED.\n"; *************** *** 367,378 **** else { ! stream << " NOT DESTROYED.\n"; } } ! tcDestroyGoal::tcDestroyGoal(const tcDestroyGoal& goal) : tcGoal(goal) { targetString = goal.targetString; ! } \ No newline at end of file --- 435,446 ---- else { ! stream << " REMAINS SAFE.\n"; } } ! tcProtectGoal::tcProtectGoal(const tcProtectGoal& goal) : tcGoal(goal) { targetString = goal.targetString; ! } Index: tcLauncher.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcLauncher.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** tcLauncher.cpp 14 Jul 2005 23:42:23 -0000 1.27 --- tcLauncher.cpp 26 Jul 2005 00:37:05 -0000 1.28 *************** *** 101,105 **** { mpChildDBObj = tcDatabase::Get()->GetObject(mnChildDBKey); ! InitForNewChild(); } --- 101,108 ---- { mpChildDBObj = tcDatabase::Get()->GetObject(mnChildDBKey); ! if (mpChildDBObj) ! { ! InitForNewChild(); ! } } *************** *** 448,451 **** --- 451,455 ---- /** * Use to change child class (e.g. while changing loadout via tcStores) + * Use SetChildClass("") to clear previous child for empty launcher */ void tcLauncher::SetChildClass(const std::string& childClass) *************** *** 453,456 **** --- 457,467 ---- if (mpChildDBObj && (childClass == mpChildDBObj->mzClass.mz)) return; + if (childClass.size() == 0) + { + mnChildDBKey = -1; + mpChildDBObj = 0; + return; + } + mpChildDBObj = tcDatabase::Get()->GetObject(childClass); if (mpChildDBObj) *************** *** 479,482 **** --- 490,494 ---- void tcLauncher::InitForNewChild() { + if (mpChildDBObj == 0) return; mbActive = 1; *************** *** 618,621 **** --- 630,637 ---- { status = LAUNCHER_EMPTY; + if (mpChildDBObj != 0) + { + SetChildClass(""); + } return; } Index: tcGoalTracker.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcGoalTracker.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcGoalTracker.cpp 5 Dec 2004 02:49:48 -0000 1.7 --- tcGoalTracker.cpp 26 Jul 2005 00:37:05 -0000 1.8 *************** *** 24,34 **** #ifndef WX_PRECOMP #include "wx/wx.h" - #include "wx/msw/private.h" // for MS Windows specific definitions #endif - #include "tcGoalTracker.h" - #include "tcGoal.h" #include <sstream> #include <fstream> #ifdef _DEBUG --- 24,38 ---- #ifndef WX_PRECOMP #include "wx/wx.h" #endif #include <sstream> #include <fstream> + #include "tcGoalTracker.h" + #include "tcGoal.h" + #include "tcSimState.h" + #include "tcUserInfo.h" + #include "common/tcStream.h" + #include "common/tcObjStream.h" + #ifdef _DEBUG *************** *** 37,40 **** --- 41,91 ---- /** + * Singleton accessor + */ + tcGoalTracker* tcGoalTracker::Get() + { + static tcGoalTracker instance; + + return &instance; + } + + /** + * Loads state from update stream + */ + tcUpdateStream& tcGoalTracker::operator<<(tcUpdateStream& stream) + { + bool allianceFailedPrev = allianceFailed; + bool allianceSucceededPrev = allianceSucceeded; + + stream >> allianceFailed; + stream >> allianceSucceeded; + stream >> goalStatusDescription; + + statusChanged = (allianceFailed != allianceFailedPrev) || + (allianceSucceeded != allianceSucceededPrev); + + return stream; + } + + /** + * Saves state to update stream + * alliance value must be stored with stream.SetDetailLevel + */ + tcUpdateStream& tcGoalTracker::operator>>(tcUpdateStream& stream) + { + int alliance = stream.GetDetailLevel(); // a hack, really should not do this + + allianceFailed = HasAllianceFailed(alliance); + allianceSucceeded = HasAllianceSucceeded(alliance); + goalStatusDescription = GetAllianceGoalStatusDescription(alliance); + + stream << allianceFailed; + stream << allianceSucceeded; + stream << goalStatusDescription; + + return stream; + } + + /** * Clears all alliance goals. */ *************** *** 50,53 **** --- 101,134 ---- } } + + allianceFailed = false; + allianceSucceeded = false; + statusChanged = false; + goalStatusDescription.clear(); + } + + const std::string& tcGoalTracker::GetAllianceGoalStatusDescription(int alliance) + { + static std::string resultString; + + if (tcSimState::Get()->IsMultiplayerClient()) + { + if (tcUserInfo::Get()->IsOwnAlliance(alliance)) + { + return goalStatusDescription; + } + else + { + resultString = "Error"; + return resultString; + } + } + + std::stringstream statusStream; + + WriteStatus(statusStream, alliance); + + resultString = statusStream.str(); + return resultString; } *************** *** 101,104 **** --- 182,196 ---- bool tcGoalTracker::HasStatusChanged(int alliance) { + if (tcSimState::Get()->IsMultiplayerClient()) + { + if (statusChanged) + { + // set false so that HasStatusChanged returns true only once per change + statusChanged = false; + return true; + } + return false; + } + tcGoal* allianceGoal = allianceGoals[alliance]; if (!allianceGoal) return false; *************** *** 147,150 **** --- 239,245 ---- if (currentTime - lastUpdateTime < updateInterval) return; lastUpdateTime = currentTime; + + if (tcSimState::Get()->IsMultiplayerClient()) return; + for(int i=0;i<MAX_ALLIANCES;i++) { *************** *** 171,175 **** tcGoalTracker::tcGoalTracker() ! : updateInterval(9.01) { lastUpdateTime = 0; --- 266,273 ---- tcGoalTracker::tcGoalTracker() ! : updateInterval(9.01), ! allianceFailed(false), ! allianceSucceeded(false), ! statusChanged(false) { lastUpdateTime = 0; Index: tcTorpedoObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcTorpedoObject.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcTorpedoObject.cpp 14 Jul 2005 23:42:24 -0000 1.15 --- tcTorpedoObject.cpp 26 Jul 2005 00:37:05 -0000 1.16 *************** *** 172,176 **** { seeker->SetPassiveSonar(); - seeker->SetActive(false); // override default for passive to always be active } else --- 172,175 ---- *************** *** 178,181 **** --- 177,181 ---- seeker->SetActiveSonar(); } + seeker->SetActive(false); // override default for passive to always be active wxString s = wxString::Format("Torp %d-%d", obj->mnID, rand() % 1000); *************** *** 231,235 **** float tcTorpedoObject::GetSonarSourceLevel() const { ! float SLp = 120.0f + mcKin.mfSpeed_kts; if (!IsEnsonifying()) return SLp; --- 231,235 ---- float tcTorpedoObject::GetSonarSourceLevel() const { ! float SLp = 120.0f + goalSpeed_kts; if (!IsEnsonifying()) return SLp; *************** *** 457,461 **** float tti_s; float range_km; ! goalDepth_m = -seeker->mcTrack.mfAlt_m; seeker->mcTrack.GetPrediction(predictedtrack, t); --- 457,461 ---- float tti_s; float range_km; ! goalDepth_m = -seeker->mcTrack.mfAlt_m; seeker->mcTrack.GetPrediction(predictedtrack, t); *************** *** 476,483 **** interceptPitch_rad, tti_s, range_km); ! useInterceptPitch = true; ! interceptTime = tti_s; ! } ! } else if (seeker->mnMode == SSMODE_SEEKERSEARCH) { --- 476,488 ---- interceptPitch_rad, tti_s, range_km); ! useInterceptPitch = true; ! interceptTime = tti_s; ! ! if (interceptTime < 100) ! { ! searchMode = SEARCH_LEFTCIRCLE; // to revert to circle search if we lose track when close ! } ! } ! } else if (seeker->mnMode == SSMODE_SEEKERSEARCH) { *************** *** 502,506 **** { goalHeading_rad = mcKin.mfHeading_rad; // maintain heading during acquire - searchMode = SEARCH_LEFTCIRCLE; // to revert to circle search if acq fails } else // error --- 507,510 ---- Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.137 retrieving revision 1.138 diff -C2 -d -r1.137 -r1.138 *** Game.cpp 2 Jul 2005 16:51:12 -0000 1.137 --- Game.cpp 26 Jul 2005 00:37:05 -0000 1.138 *************** *** 120,123 **** --- 120,131 ---- int alliance = allianceList[idx]; + if (tcUserInfo::Get()->IsOwnAlliance(alliance)) + { + tcMessageInterface::Get()->ClearChannel("Mission"); + tcMessageInterface::Get()->ChannelMessage("Mission", + goalTracker->GetAllianceGoalStatusDescription(alliance)); + tcMessageInterface::Get()->ChannelMessage("Mission", ""); + } + if (goalTracker->HasAllianceFailed(alliance)) { *************** *** 446,450 **** std::cout << "InitializeSound() completed" << std::endl; } ! catch(...) { wxMessageBox("Unknown sound initialization error, attempting to disable sound", --- 454,458 ---- std::cout << "InitializeSound() completed" << std::endl; } ! catch (...) { wxMessageBox("Unknown sound initialization error, attempting to disable sound", *************** *** 2565,2569 **** pythonInterface = tcSimPythonInterface::Get(); ! goalTracker = simState->GetGoalTracker(); userInfo = tcUserInfo::Get(); --- 2573,2577 ---- pythonInterface = tcSimPythonInterface::Get(); ! goalTracker = tcGoalTracker::Get(); userInfo = tcUserInfo::Get(); Index: tcControllableObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcControllableObject.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcControllableObject.cpp 6 May 2005 23:57:52 -0000 1.1 --- tcControllableObject.cpp 26 Jul 2005 00:37:05 -0000 1.2 *************** *** 35,38 **** --- 35,39 ---- #endif + bool tcControllableObject::singlePlayerMode = true; tcUserInfo* tcControllableObject::userInfo = 0; *************** *** 42,45 **** --- 43,50 ---- } + void tcControllableObject::SetSinglePlayerMode(bool state) + { + singlePlayerMode = state; + } /** *************** *** 148,152 **** bool tcControllableObject::IsControlled() const { ! return controller == userInfo->GetUsername(); } --- 153,157 ---- bool tcControllableObject::IsControlled() const { ! return singlePlayerMode || (controller == userInfo->GetUsername()); } Index: tcObjectControl.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcObjectControl.cpp,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** tcObjectControl.cpp 14 Jul 2005 23:42:24 -0000 1.45 --- tcObjectControl.cpp 26 Jul 2005 00:37:05 -0000 1.46 *************** *** 1225,1230 **** strcpy(zClass,"BAL"); break; default: ! strcpy(zClass,"ERR"); break; } --- 1225,1236 ---- strcpy(zClass,"BAL"); break; + case DTYPE_TORPEDO: + strcpy(zClass, "TOR"); + break; + case DTYPE_SUBMARINE: + strcpy(zClass, "SUB"); + break; default: ! strcpy(zClass,"UNK"); break; } *************** *** 1265,1270 **** strcpy(zModel,"SUB"); break; default: ! strcpy(zModel,"ERR"); break; } --- 1271,1282 ---- strcpy(zModel,"SUB"); break; + case MTYPE_TORPEDO: + strcpy(zModel, "TOR"); + break; + case MTYPE_FIXED: + strcpy(zModel, "GND"); + break; default: ! strcpy(zModel,"UNK"); break; } *************** *** 1833,1837 **** else { ! hintText = "Error"; } xhint = lastMousePos.x + 10; --- 1845,1849 ---- else { ! hintText = ""; // nothing loaded in launcher } xhint = lastMousePos.x + 10; |
|
From: Dewitt C. <ddc...@us...> - 2005-07-20 16:25:36
|
Update of /cvsroot/gcblue/gcb_wx/3d In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4256/3d Modified Files: kilo.xml Log Message: Index: kilo.xml =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/3d/kilo.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** kilo.xml 9 Jul 2005 14:44:13 -0000 1.1 --- kilo.xml 20 Jul 2005 16:24:51 -0000 1.2 *************** *** 1,4 **** <Model File="kilo.ive"/> <Info Author="TLAM-Strike, Spookymufu" Notes=""/> ! <Animation Object="brass2_bmp" Type="Propeller" AzisX="0" AxisY="1" AxisZ="0" AngleRate="0.1"/> ! <Smoke X="0.0" Y="-39.0" Z="-2.0"/> --- 1,4 ---- <Model File="kilo.ive"/> <Info Author="TLAM-Strike, Spookymufu" Notes=""/> ! <Animation Object="prop" Type="Propeller" AzisX="0" AxisY="1" AxisZ="0" AngleRate="-0.1"/> ! <Smoke X="0.0" Y="-40.5" Z="-3.2"/> |
|
From: Dewitt C. <ddc...@us...> - 2005-07-20 16:25:36
|
Update of /cvsroot/gcblue/gcb_wx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4256 Modified Files: GCblue.vcproj Log Message: Index: GCblue.vcproj =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/GCblue.vcproj,v retrieving revision 1.96 retrieving revision 1.97 diff -C2 -d -r1.96 -r1.97 *** GCblue.vcproj 10 Jul 2005 20:31:58 -0000 1.96 --- GCblue.vcproj 20 Jul 2005 16:24:52 -0000 1.97 *************** *** 39,43 **** Name="VCLinkerTool" IgnoreImportLibrary="FALSE" ! AdditionalDependencies="python23.lib boost_python_debug.lib winmm.lib opengl32.lib glu32.lib GLaux.lib comctl32.lib rpcrt4.lib wsock32.lib wxmswd.lib zlibd.lib pngd.lib jpegd.lib tiffd.lib osgd.lib osgDBd.lib osgParticled.lib osgTextd.lib osgUtild.lib DemeterDebug.lib DemeterOSGDebug.lib sqlited.lib ogg_static_d.lib vorbis_static_d.lib vorbisfile_static_d.lib wrap_oald.lib ALutd.lib oalppd.lib" ShowProgress="0" OutputFile="$(ProjectDir)/bin/GCblueD.exe" --- 39,43 ---- Name="VCLinkerTool" IgnoreImportLibrary="FALSE" ! AdditionalDependencies="python23.lib boost_python_debug.lib winmm.lib opengl32.lib glu32.lib GLaux.lib comctl32.lib rpcrt4.lib wsock32.lib wxmswd.lib zlibd.lib pngd.lib jpegd.lib tiffd.lib osgd.lib osgDBd.lib osgParticled.lib osgTextd.lib osgUtild.lib DemeterDebug.lib DemeterOSGDebug.lib sqlited.lib ogg_static_d.lib vorbis_static_d.lib vorbisfile_static_d.lib gcb_wrap_oald.lib ALutd.lib oalpp_gcbd.lib" ShowProgress="0" OutputFile="$(ProjectDir)/bin/GCblueD.exe" *************** *** 89,93 **** FavorSizeOrSpeed="1" OmitFramePointers="TRUE" ! OptimizeForProcessor="3" OptimizeForWindowsApplication="TRUE" AdditionalIncludeDirectories="include;include/sim;include/scriptinterface;include/common;include/graphics;"C:\wxWindows-2.4.1\lib\msw";include\database" --- 89,93 ---- FavorSizeOrSpeed="1" OmitFramePointers="TRUE" ! OptimizeForProcessor="0" OptimizeForWindowsApplication="TRUE" AdditionalIncludeDirectories="include;include/sim;include/scriptinterface;include/common;include/graphics;"C:\wxWindows-2.4.1\lib\msw";include\database" *************** *** 105,109 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="boost_python.lib python23.lib opengl32.lib winmm.lib GLaux.lib glu32.lib comctl32.lib rpcrt4.lib wsock32.lib wxmsw.lib png.lib zlib.lib jpeg.lib tiff.lib osg.lib osgDB.lib osgParticle.lib osgUtil.lib osgText.lib Demeter.lib DemeterOSG.lib sqlite.lib OpenThreadsWin32.lib wrap_oal.lib ALut.lib oalpp.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib" OutputFile="$(ProjectDir)/bin/$(ProjectName).exe" LinkIncremental="1" --- 105,109 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="boost_python.lib python23.lib opengl32.lib winmm.lib GLaux.lib glu32.lib comctl32.lib rpcrt4.lib wsock32.lib wxmsw.lib png.lib zlib.lib jpeg.lib tiff.lib osg.lib osgDB.lib osgParticle.lib osgUtil.lib osgText.lib Demeter.lib DemeterOSG.lib sqlite.lib OpenThreadsWin32.lib gcb_wrap_oal.lib ALut.lib oalpp_gcb.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib" OutputFile="$(ProjectDir)/bin/$(ProjectName).exe" LinkIncremental="1" |
|
From: Dewitt C. <ddc...@us...> - 2005-07-20 16:25:04
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4256/src/sim Modified Files: tcAeroAirObject.cpp tcFlightPort.cpp tcGuidanceState.cpp tcHeloObject.cpp tcMapData.cpp tcPlatformObject.cpp tcSensorMapTrack.cpp tcSubObject.cpp Log Message: Index: tcSubObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSubObject.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcSubObject.cpp 14 Jul 2005 23:42:24 -0000 1.13 --- tcSubObject.cpp 20 Jul 2005 16:24:55 -0000 1.14 *************** *** 610,620 **** UpdateFormationGuidance(); // formation heading/speed calculation - UpdateHeading(dt_s); ! UpdateSpeed(dt_s); ! UpdateClimb(dt_s); ! ApplyRestrictions(); // crash check Move(dt_s); --- 610,629 ---- UpdateFormationGuidance(); // formation heading/speed calculation ! /* In multiplayer mode, skip command based updates for client objects not controlled ! ** by client. This will cause object to jump more but avoids having to broadcast command ! ** changes to all alliance clients. The controller of the object will see smoother ! ** behavior. ! */ ! if (!IsClientMode() || IsControlled()) ! { ! UpdateHeading(dt_s); ! UpdateSpeed(dt_s); ! UpdateClimb(dt_s); ! ! ApplyRestrictions(); // crash check ! } Move(dt_s); Index: tcHeloObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcHeloObject.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcHeloObject.cpp 28 Jun 2005 02:51:35 -0000 1.5 --- tcHeloObject.cpp 20 Jul 2005 16:24:54 -0000 1.6 *************** *** 145,149 **** void tcHeloObject::UpdateSpeed(float dt_s) { ! tcPlatformObject::UpdateSpeed(dt_s); } --- 145,173 ---- void tcHeloObject::UpdateSpeed(float dt_s) { ! float ds_kts = mcGS.mfGoalSpeed_kts - mcKin.mfSpeed_kts; ! float ds_max = mpDBObject->mfAccel_ktsps*dt_s; ! float ds_min = -ds_max; ! ! if (ds_kts < ds_min) {ds_kts = ds_min;} // restrict to acceleration ! else if (ds_kts > ds_max) {ds_kts = ds_max;} ! mcKin.mfSpeed_kts += ds_kts; ! ! if (mcKin.mfSpeed_kts < 0) mcKin.mfSpeed_kts = 0; ! ! // if a fuel capacity is indicated then update fuel consumption ! if (mpDBObject->mfFuelCapacity_kg > 0) ! { ! // do not allow fuel consumption to be less than a minimum value (hover consumes fuel) ! float fuelConsumptionSpeed = max(mcKin.mfSpeed_kts, 50.0f); ! ! fuel_kg -= dt_s * mpDBObject->GetFuelConsumptionConstant() * fuelConsumptionSpeed; ! if (fuel_kg < 0) fuel_kg = 0; ! ! if (fuel_kg == 0) ! { ! if (mcKin.mfSpeed_kts > 0) mcKin.mfSpeed_kts -= 2*ds_max; ! if (mcKin.mfAlt_m > 0) mcKin.mfAlt_m -= dt_s * 10; ! } ! } } *************** *** 171,182 **** UpdateFormationGuidance(); // formation heading/speed calculation ! // don't use air method since we don't care about roll ! tcPlatformObject::UpdateHeading(dt_s); ! UpdateSpeed(dt_s); ! UpdateClimb(dt_s); ! ApplyRestrictions(); // crash check Move(dt_s); --- 195,214 ---- UpdateFormationGuidance(); // formation heading/speed calculation ! /* In multiplayer mode, skip command based updates for client objects not controlled ! ** by client. This will cause object to jump more but avoids having to broadcast command ! ** changes to all alliance clients. The controller of the object will see smoother ! ** behavior. ! */ ! if (!IsClientMode() || IsControlled()) ! { ! // don't use air method since we don't care about roll ! tcPlatformObject::UpdateHeading(dt_s); ! UpdateSpeed(dt_s); ! UpdateClimb(dt_s); ! ApplyRestrictions(); // crash check ! } Move(dt_s); Index: tcGuidanceState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcGuidanceState.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcGuidanceState.cpp 2 Nov 2004 04:23:56 -0000 1.4 --- tcGuidanceState.cpp 20 Jul 2005 16:24:54 -0000 1.5 *************** *** 37,42 **** file.Read(&mfGoalSpeed_kts,sizeof(mfGoalSpeed_kts)); file.Read(&mfGoalAltitude_m,sizeof(mfGoalAltitude_m)); - mcKinIntercept.Serialize(file, true); - file.Read(&mbIntercept,sizeof(mbIntercept)); } else --- 37,40 ---- *************** *** 45,50 **** file.Write(&mfGoalSpeed_kts,sizeof(mfGoalSpeed_kts)); file.Write(&mfGoalAltitude_m,sizeof(mfGoalAltitude_m)); - mcKinIntercept.Serialize(file, false); - file.Write(&mbIntercept,sizeof(mbIntercept)); } } --- 43,46 ---- *************** *** 68,73 **** stream >> mfGoalSpeed_kts; stream >> mfGoalAltitude_m; - mcKinIntercept << stream; - stream >> mbIntercept; return stream; --- 64,67 ---- *************** *** 82,87 **** stream << mfGoalSpeed_kts; stream << mfGoalAltitude_m; - mcKinIntercept >> stream; - stream << mbIntercept; return stream; --- 76,79 ---- Index: tcMapData.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMapData.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** tcMapData.cpp 16 Jul 2005 23:12:38 -0000 1.23 --- tcMapData.cpp 20 Jul 2005 16:24:54 -0000 1.24 *************** *** 1033,1036 **** --- 1033,1039 ---- { pval = (anMapID==0) ? maGlobal[m][n] : maTheater[m][n]; + + if (pval > 1000) pval = 1000; + if (pval <= 0) { Index: tcFlightPort.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcFlightPort.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** tcFlightPort.cpp 22 Jun 2005 01:22:09 -0000 1.21 --- tcFlightPort.cpp 20 Jul 2005 16:24:54 -0000 1.22 *************** *** 32,35 **** --- 32,37 ---- #include "tcFlightportDBObject.h" #include "tcGenericDBObject.h" + #include "ai/BlackboardInterface.h" + #include "ai/Brain.h" #include "common/tcStream.h" #include "common/tcObjStream.h" *************** *** 971,974 **** --- 973,980 ---- } + /** + * Update the kinematics of entities in launch queue. Called once + * when moving to launch queue. + */ void tcFlightPort::UpdateUnitKin(tcAirState *airstate) { *************** *** 989,1007 **** unit->mcKin.mfLon_rad = childPos.mfLon_rad; - // correct latitude and longitude for relative position on parent - /* - float parent_hdg = parent->mcKin.mfHeading_rad; - float cos_parent_hdg = cosf(parent_hdg); - float sin_parent_hdg = sinf(parent_hdg); - float delta_x_rad = unit->rel_pos.dx*C_MTORAD; - float delta_z_rad = -unit->rel_pos.dz*C_MTORAD; - double delta_lat = delta_z_rad*cos_parent_hdg - delta_x_rad*sin_parent_hdg; - double delta_lon = delta_z_rad*sin_parent_hdg + delta_x_rad*cos_parent_hdg; - delta_lon = delta_lon/cosf((float)parent->mcKin.mfLat_rad); // correct for latitude - unit->mcKin.mfLat_rad += delta_lat; - unit->mcKin.mfLon_rad += delta_lon; - */ ! if (tcAeroAirObject* aa_unit = dynamic_cast<tcAeroAirObject*>(unit)) { aa_unit->mcKin.mfSpeed_kts += 200.0f; --- 995,1013 ---- unit->mcKin.mfLon_rad = childPos.mfLon_rad; ! ! tcAirObject* air_unit = dynamic_cast<tcAirObject*>(unit); ! ! // write base name to unit blackboard to allow it to RTB when mission complete ! if (air_unit != 0) ! { ! ai::Brain* brain = air_unit->GetBrain(); ! wxASSERT(brain); ! ai::BlackboardInterface bb = brain->GetBlackboardInterface(); ! ! bb.Write("Home", parent->mzUnit.mz); ! } ! ! if (tcAeroAirObject* aa_unit = dynamic_cast<tcAeroAirObject*>(air_unit)) { aa_unit->mcKin.mfSpeed_kts += 200.0f; *************** *** 1010,1014 **** aa_unit->SetLandingState(0); } ! else if (tcHeloObject* helo_unit = dynamic_cast<tcHeloObject*>(unit)) { helo_unit->mcKin.mfClimbAngle_rad = 1.5f; --- 1016,1020 ---- aa_unit->SetLandingState(0); } ! else if (tcHeloObject* helo_unit = dynamic_cast<tcHeloObject*>(air_unit)) { helo_unit->mcKin.mfClimbAngle_rad = 1.5f; *************** *** 1017,1021 **** helo_unit->SetLandingState(0); } ! else if (tcAirObject *air_unit = dynamic_cast<tcAirObject*>(unit)) { air_unit->mcKin.mfSpeed_kts += 200.0f; --- 1023,1027 ---- helo_unit->SetLandingState(0); } ! else if (air_unit != 0) { air_unit->mcKin.mfSpeed_kts += 200.0f; Index: tcPlatformObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcPlatformObject.cpp,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** tcPlatformObject.cpp 2 Jul 2005 16:51:12 -0000 1.52 --- tcPlatformObject.cpp 20 Jul 2005 16:24:55 -0000 1.53 *************** *** 226,230 **** if (mpDBObject->mfFuelCapacity_kg > 0) { ! fuel_kg -= dt_s * mpDBObject->GetFuelConsumptionConstant(); if (fuel_kg < 0) fuel_kg = 0; --- 226,230 ---- if (mpDBObject->mfFuelCapacity_kg > 0) { ! fuel_kg -= dt_s * mpDBObject->GetFuelConsumptionConstant() * mcKin.mfSpeed_kts; if (fuel_kg < 0) fuel_kg = 0; *************** *** 699,710 **** stream >> mcGS.mfGoalSpeed_kts; stream >> mcGS.mfGoalAltitude_m; - stream >> mcGS.mbIntercept; - if (mcGS.mbIntercept) - { - mcGS.mcKinIntercept << stream; - } - } - if (updateMask & UPDATE_LAUNCHERS) { --- 699,704 ---- stream >> mcGS.mfGoalSpeed_kts; stream >> mcGS.mfGoalAltitude_m; + } if (updateMask & UPDATE_LAUNCHERS) { *************** *** 782,791 **** stream << mcGS.mfGoalSpeed_kts; stream << mcGS.mfGoalAltitude_m; - - stream << mcGS.mbIntercept; - if (mcGS.mbIntercept) - { - mcGS.mcKinIntercept >> stream; - } } --- 776,779 ---- Index: tcSensorMapTrack.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSensorMapTrack.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcSensorMapTrack.cpp 28 Jun 2005 02:51:35 -0000 1.3 --- tcSensorMapTrack.cpp 20 Jul 2005 16:24:55 -0000 1.4 *************** *** 67,72 **** --- 67,74 ---- { stream >> maSensorReport[n].mfTimestamp; + stream >> maSensorReport[n].mnSensorPlatformID; } + stream >> mnDatabaseID; stream >> sensorFlags; *************** *** 85,90 **** --- 87,94 ---- { stream << maSensorReport[n].mfTimestamp; + stream << maSensorReport[n].mnSensorPlatformID; } + stream << mnDatabaseID; stream << sensorFlags; Index: tcAeroAirObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcAeroAirObject.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcAeroAirObject.cpp 1 Jun 2005 00:13:32 -0000 1.18 --- tcAeroAirObject.cpp 20 Jul 2005 16:24:54 -0000 1.19 *************** *** 50,53 **** --- 50,56 ---- stream >> throttleFraction; + fprintf(stdout, "received aero guidance update, id: %d, HSA %f, %f, %f\n", mnID, + mcGS.mfGoalHeading_deg, mcGS.mfGoalSpeed_kts, mcGS.mfGoalAltitude_m); + return stream; } *************** *** 59,62 **** --- 62,67 ---- stream << throttleFraction; + fprintf(stdout, "sending aero guidance update, id: %d, HSA %f, %f, %f\n", mnID, + mcGS.mfGoalHeading_deg, mcGS.mfGoalSpeed_kts, mcGS.mfGoalAltitude_m); return stream; } *************** *** 200,212 **** } ! UpdateFormationGuidance(); // formation heading/speed calculation ! UpdateHeading(dt_s); ! UpdateSpeed(dt_s); ! UpdateClimb(dt_s); ! ApplyRestrictions(); // crash check Move(dt_s); --- 205,225 ---- } ! /* In multiplayer mode, skip command based updates for client objects not controlled ! ** by client. This will cause object to jump more but avoids having to broadcast command ! ** changes to all alliance clients. The controller of the object will see smoother ! ** behavior. ! */ ! if (!IsClientMode() || IsControlled()) ! { ! UpdateHeading(dt_s); ! UpdateSpeed(dt_s); ! UpdateClimb(dt_s); ! ApplyRestrictions(); ! } ! UpdateFormationGuidance(); // formation heading/speed calculation Move(dt_s); |
|
From: Dewitt C. <ddc...@us...> - 2005-07-20 16:25:03
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4256/src/common Modified Files: simmath.cpp tcOptions.cpp tcSound.cpp Log Message: Index: simmath.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/simmath.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** simmath.cpp 28 Jun 2005 02:51:34 -0000 1.27 --- simmath.cpp 20 Jul 2005 16:24:53 -0000 1.28 *************** *** 366,414 **** if (isBearingOnly) { ! if (bearingRateValid) ! { ! const float dh_max = C_PIOVER180 * 15.0f; ! const float dh_min = -C_PIOVER180 * 15.0f; ! float dHeading = dt_s * bearingRate_radps; ! if (dHeading < dh_min) dHeading = dh_min; ! else if (dHeading > dh_max) dHeading = dh_max; ! td.mfHeading_rad = mfHeading_rad + dHeading; ! } ! else ! { ! td.mfHeading_rad = mfHeading_rad; ! } ! } ! else if (bHeadingValid) ! { ! td.mfHeading_rad = mfHeading_rad; } else { ! td.mfHeading_rad = 0; ! } ! if (bSpeedValid && bHeadingValid) ! { ! float fGroundSpeed_kts; ! if (bClimbValid) ! { ! fGroundSpeed_kts = mfSpeed_kts*cosf(mfClimbAngle_rad); ! } ! else ! { ! fGroundSpeed_kts = mfSpeed_kts; ! } ! float fRange_rad = fGroundSpeed_kts*C_KTSTORADPS*dt_s; ! nsNav::OffsetApprox(mfLat_rad,mfLon_rad, td.mfLat_rad,td.mfLon_rad, mfHeading_rad,fRange_rad); ! td.mfSpeed_kts = mfSpeed_kts; ! } ! else ! { ! td.mfLat_rad = mfLat_rad; ! td.mfLon_rad = mfLon_rad; ! td.mfSpeed_kts = 0; } --- 366,422 ---- if (isBearingOnly) { ! if (bearingRateValid) ! { ! const float dh_max = C_PIOVER180 * 15.0f; ! const float dh_min = -C_PIOVER180 * 15.0f; ! float dHeading = dt_s * bearingRate_radps; ! if (dHeading < dh_min) dHeading = dh_min; ! else if (dHeading > dh_max) dHeading = dh_max; ! td.mfHeading_rad = mfHeading_rad + dHeading; ! } ! else ! { ! td.mfHeading_rad = mfHeading_rad; ! } ! ! // bearing-only track arbitrarily plotted 10 km from sensing platform ! td.mfLat_rad = mfLat_rad; ! td.mfLon_rad = mfLon_rad; ! td.Offset(10.0f, td.mfHeading_rad); } else { ! if (bHeadingValid) ! { ! td.mfHeading_rad = mfHeading_rad; ! } ! else ! { ! td.mfHeading_rad = 0; ! } ! if (bSpeedValid && bHeadingValid) ! { ! float fGroundSpeed_kts; ! if (bClimbValid) ! { ! fGroundSpeed_kts = mfSpeed_kts*cosf(mfClimbAngle_rad); ! } ! else ! { ! fGroundSpeed_kts = mfSpeed_kts; ! } ! float fRange_rad = fGroundSpeed_kts*C_KTSTORADPS*dt_s; ! nsNav::OffsetApprox(mfLat_rad,mfLon_rad, td.mfLat_rad,td.mfLon_rad, mfHeading_rad,fRange_rad); ! td.mfSpeed_kts = mfSpeed_kts; ! } ! else ! { ! td.mfLat_rad = mfLat_rad; ! td.mfLon_rad = mfLon_rad; ! td.mfSpeed_kts = 0; ! } } *************** *** 418,421 **** --- 426,431 ---- td.mfAlt_m = mfAlt_m + fClimbRate_mps*dt_s; td.mfClimbAngle_rad = mfClimbAngle_rad; + + if ((mfAlt_m >= 0)&&(td.mfAlt_m < 0)) {td.mfAlt_m = 0;} } else *************** *** 425,428 **** --- 435,440 ---- } + wxASSERT((td.mfHeading_rad < 10.0f)&&(td.mfHeading_rad > -10.0f)); + td.bearingRate_radps = bearingRate_radps; // for bearing only tracks, copy rate td.mnFlags = mnFlags; *************** *** 432,436 **** td.mnAlliance = mnAlliance; td.mnClassification = mnClassification; - if ((mfAlt_m >= 0)&&(td.mfAlt_m < 0)) {td.mfAlt_m = 0;} } --- 444,447 ---- Index: tcSound.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/tcSound.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** tcSound.cpp 5 May 2005 02:14:51 -0000 1.32 --- tcSound.cpp 20 Jul 2005 16:24:54 -0000 1.33 *************** *** 133,150 **** void tcSound::InitOpenAL() { // create Sources's to use as buffers for (size_t n=0; n<N_EFFECT_BUFFERS; n++) ! { wxString stateName = wxString::Format("state%d", n); openalpp::ref_ptr<Source> source = new Source; source->stop(); source->setAmbient(); source->setGain(0.5f); // volume source->setLooping(false); effectBuffer.push_back(source); available.push_back(n); } } --- 133,161 ---- void tcSound::InitOpenAL() { + fprintf(stdout, "InitOpenAL - Initializing buffer "); + // create Sources's to use as buffers for (size_t n=0; n<N_EFFECT_BUFFERS; n++) ! { ! fprintf(stdout, "%d", n); wxString stateName = wxString::Format("state%d", n); openalpp::ref_ptr<Source> source = new Source; + fprintf(stdout, "."); source->stop(); + fprintf(stdout, "."); source->setAmbient(); + fprintf(stdout, "."); source->setGain(0.5f); // volume + fprintf(stdout, "."); source->setLooping(false); + fprintf(stdout, "."); effectBuffer.push_back(source); available.push_back(n); + + } + fprintf(stdout, "\n"); } Index: tcOptions.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/tcOptions.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** tcOptions.cpp 16 Jul 2005 23:12:38 -0000 1.17 --- tcOptions.cpp 20 Jul 2005 16:24:54 -0000 1.18 *************** *** 79,85 **** oi.mnValue = 1; oi.mpAssociated = &mnMapMode; ! oi.mzCaption[0] = "MM 0"; ! oi.mzCaption[1] = "MM 1"; ! oi.mzCaption[2] = "MM 2"; AddOption(oi); --- 79,85 ---- oi.mnValue = 1; oi.mpAssociated = &mnMapMode; ! oi.mzCaption[0] = "Copper-Blue Map"; ! oi.mzCaption[1] = "Yellow-Blue Map"; ! oi.mzCaption[2] = "Black-Blue Map"; AddOption(oi); |