[Gcblue-commits] gcb_wx/src/scriptinterface tcPlatformInterface.cpp,1.51,1.52 tcPlatformInterfaceExt
Status: Alpha
Brought to you by:
ddcforge
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1255/src/scriptinterface Modified Files: tcPlatformInterface.cpp tcPlatformInterfaceExtensionB.cpp tcScenarioInterface.cpp tcSimPythonInterface.cpp tcTrackInterface.cpp Log Message: GCB 0.8.0 release Index: tcScenarioInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcScenarioInterface.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** tcScenarioInterface.cpp 26 Jul 2005 00:37:04 -0000 1.33 --- tcScenarioInterface.cpp 10 Sep 2005 21:47:38 -0000 1.34 *************** *** 24,30 **** #ifndef WX_PRECOMP #include "wx/wx.h" - #ifdef WIN32 - #include "wx/msw/private.h" // for MS Windows specific definitions - #endif #endif --- 24,27 ---- *************** *** 65,68 **** --- 62,68 ---- using namespace ai; + + + void tcScenarioUnit::AddOrder(tcOrder order) { *************** *** 101,105 **** return true; ! } tcDirector* tcScenarioInterface::director = 0; --- 101,106 ---- return true; ! } ! tcDirector* tcScenarioInterface::director = 0; *************** *** 107,111 **** tcMapOverlay* tcScenarioInterface::overlay = 0; tcSimState* tcScenarioInterface::simState = 0; ! // non-python methods --- 108,113 ---- tcMapOverlay* tcScenarioInterface::overlay = 0; tcSimState* tcScenarioInterface::simState = 0; ! ! // non-python methods *************** *** 203,206 **** --- 205,210 ---- .def("DestroyGoal",&tcScenarioInterface::DestroyGoal) .def("ProtectGoal",&tcScenarioInterface::ProtectGoal) + // simple briefing text + .def("SetSimpleBriefing", &tcScenarioInterface::SetSimpleBriefing) ; return InterfaceType; *************** *** 589,592 **** --- 593,598 ---- wxASSERT(director); director->ClearEvents(); + + ClearSimpleBriefing(); } *************** *** 822,825 **** --- 828,861 ---- } + void tcScenarioInterface::ClearSimpleBriefing() + { + simpleBriefingText.clear(); + } + + const std::string& tcScenarioInterface::GetSimpleBriefing(int alliance) const + { + static std::string errorText = "No briefing found"; + + std::map<int, std::string>::const_iterator iter = + simpleBriefingText.find(alliance); + + if (iter != simpleBriefingText.end()) + { + return iter->second; + } + else + { + return errorText; + } + } + + void tcScenarioInterface::SetSimpleBriefing(int alliance, const std::string& briefingText) + { + simpleBriefingText[alliance] = briefingText; + } + + + + tcScenarioInterface::tcScenarioInterface() : lon_theater_deg(0), Index: tcSimPythonInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcSimPythonInterface.cpp,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** tcSimPythonInterface.cpp 14 Jul 2005 23:42:23 -0000 1.38 --- tcSimPythonInterface.cpp 10 Sep 2005 21:47:38 -0000 1.39 *************** *** 544,548 **** // call CreateBriefing method with ScenarioManager global object // ignore error here ! CallPython("CreateBriefing(ScenarioManager)\n", "Error with CreateBriefing method\n"); } --- 544,548 ---- // call CreateBriefing method with ScenarioManager global object // ignore error here ! //CallPython("CreateBriefing(ScenarioManager)\n", "Error with CreateBriefing method\n"); } *************** *** 949,953 **** { // TODO: this causes exception on game quit sometimes ! if (mpHookedObj && (mpHookedObj->mnID == anID)) return; // already set groupInterface->SetUnit(anID); --- 949,953 ---- { // TODO: this causes exception on game quit sometimes ! //if (mpHookedObj && (mpHookedObj->mnID == anID)) return; // already set groupInterface->SetUnit(anID); Index: tcTrackInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcTrackInterface.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcTrackInterface.cpp 1 Jun 2005 00:13:32 -0000 1.9 --- tcTrackInterface.cpp 10 Sep 2005 21:47:38 -0000 1.10 *************** *** 45,48 **** --- 45,50 ---- void tcTrackInterface::AttachSensorMap(tcAllianceSensorMap *apSM) { + wxASSERT(apSM); + mpSensorMap = apSM; fprintf(stdout, "tcTrackInterface - Attaching sensor map for alliance: %d\n", Index: tcPlatformInterfaceExtensionB.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterfaceExtensionB.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** tcPlatformInterfaceExtensionB.cpp 1 Jun 2005 00:13:32 -0000 1.25 --- tcPlatformInterfaceExtensionB.cpp 10 Sep 2005 21:47:38 -0000 1.26 *************** *** 108,113 **** ! // orders .def("AddNavWaypoint", &tcPlatformInterface::AddNavWaypoint) .def("AddTask", &tcPlatformInterface::AddTask) .def("ClearTasks", &tcPlatformInterface::ClearTasks) --- 108,114 ---- ! // task interface commands .def("AddNavWaypoint", &tcPlatformInterface::AddNavWaypoint) + .def("SetNavLoopState", &tcPlatformInterface::SetNavLoopState) .def("AddTask", &tcPlatformInterface::AddTask) .def("ClearTasks", &tcPlatformInterface::ClearTasks) Index: tcPlatformInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterface.cpp,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** tcPlatformInterface.cpp 26 Jul 2005 00:37:04 -0000 1.51 --- tcPlatformInterface.cpp 10 Sep 2005 21:47:38 -0000 1.52 *************** *** 526,529 **** --- 526,530 ---- bool isBomb = false; + bool isGunRound = false; if (tcMissileDBObject* missileDBObj = *************** *** 541,544 **** --- 542,549 ---- isBomb = true; } + else if (ballisticDBObj->ballisticType == tcBallisticDBObject::GUN_ROUND) + { + isGunRound = true; + } } else if (tcTorpedoDBObject* torpDBObj = *************** *** 566,570 **** info.mnLaunchMode = 0; } ! else if (pLauncher->meLaunchMode == SEEKER_TRACK) { info.mnLaunchMode = 1; --- 571,576 ---- info.mnLaunchMode = 0; } ! else if ((pLauncher->meLaunchMode == SEEKER_TRACK)|| ! (pLauncher->meLaunchMode == FC_TRACK)) { info.mnLaunchMode = 1; *************** *** 787,790 **** --- 793,813 ---- } + void tcPlatformInterface::SetNavLoopState(bool state) + { + if (mpPlatformObj->IsClientMode()) return; + + ai::Brain* brain = mpPlatformObj->GetBrain(); + wxASSERT(brain); + + ai::Nav* nav = brain->GetNavTask(); + if (!nav) + { + wxASSERT(false); + return; + } + + nav->SetLoopState(state); + } + /** * Remove all tasks from ai brain *************** *** 835,839 **** { unsigned int nAlliance = mpPlatformObj->GetAlliance(); ! mpSensorMap = mpSimState->mcSensorMap.GetMap(nAlliance); wxASSERT(mpSensorMap); } --- 858,862 ---- { unsigned int nAlliance = mpPlatformObj->GetAlliance(); ! mpSensorMap = mpSimState->mcSensorMap.GetOrCreateMap(nAlliance); wxASSERT(mpSensorMap); } *************** *** 1183,1187 **** { tcGameObject* obj = mpSimState->GetObjectByName(unitName); ! bool isOwnAlliance = mpPlatformObj->GetAlliance() == obj->GetAlliance(); if ((obj == 0) || !isOwnAlliance) --- 1206,1210 ---- { tcGameObject* obj = mpSimState->GetObjectByName(unitName); ! bool isOwnAlliance = (obj != 0) && (mpPlatformObj->GetAlliance() == obj->GetAlliance()); if ((obj == 0) || !isOwnAlliance) *************** *** 1198,1202 **** { tcGameObject* obj = mpSimState->GetObject(id); ! bool isOwnAlliance = mpPlatformObj->GetAlliance() == obj->GetAlliance(); if ((obj == 0) || !isOwnAlliance) --- 1221,1225 ---- { tcGameObject* obj = mpSimState->GetObject(id); ! bool isOwnAlliance = (obj != 0) && (mpPlatformObj->GetAlliance() == obj->GetAlliance()); if ((obj == 0) || !isOwnAlliance) |