[Gcblue-commits] gcb_wx/src/scriptinterface tcFlightPortInterface.cpp,1.7,1.8 tcPlatformInterface.cp
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2005-06-22 01:22:24
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2354/src/scriptinterface Modified Files: tcFlightPortInterface.cpp tcPlatformInterface.cpp tcScenarioInterface.cpp Log Message: Misc housekeeping, updates for infrared and anti-radiation seekers, more info for multiplayer airfield units, icon gui enhancements Index: tcPlatformInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterface.cpp,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** tcPlatformInterface.cpp 1 Jun 2005 00:13:32 -0000 1.46 --- tcPlatformInterface.cpp 22 Jun 2005 01:22:08 -0000 1.47 *************** *** 64,68 **** std::string tcPlatformInterface::GetPlatformName() { std::string s; ! if (mpPlatformObj == NULL) { s == "err"; } --- 64,68 ---- std::string tcPlatformInterface::GetPlatformName() { std::string s; ! if (mpPlatformObj == 0) { s == "err"; } *************** *** 75,79 **** std::string tcPlatformInterface::GetPlatformClass() { std::string s; ! if (mpPlatformObj == NULL) { s == "err"; } --- 75,79 ---- std::string tcPlatformInterface::GetPlatformClass() { std::string s; ! if (mpPlatformObj == 0) { s == "err"; } *************** *** 217,221 **** void tcPlatformInterface::SetSpeedToMax() { ! if (mpPlatformObj == NULL) {return;} if (tcAeroAirObject* aaObj = dynamic_cast<tcAeroAirObject*>(mpPlatformObj)) { --- 217,221 ---- void tcPlatformInterface::SetSpeedToMax() { ! if (mpPlatformObj == 0) {return;} if (tcAeroAirObject* aaObj = dynamic_cast<tcAeroAirObject*>(mpPlatformObj)) { *************** *** 241,245 **** tcGameObject* tcPlatformInterface::GetTargetObj() { ! wxASSERT(mpSimState != NULL); return mpSimState->GetObject(GetTarget()); } --- 241,245 ---- tcGameObject* tcPlatformInterface::GetTargetObj() { ! wxASSERT(mpSimState != 0); return mpSimState->GetObject(GetTarget()); } *************** *** 565,569 **** int tcPlatformInterface::GetLauncherCount() { ! if (mpPlatformObj == NULL) { return 0; --- 565,569 ---- int tcPlatformInterface::GetLauncherCount() { ! if (mpPlatformObj == 0) { return 0; *************** *** 832,836 **** t.mnID = -1; ! if (mpSensorMap == NULL) {return t;} if (mpSensorMap->GetTrackCount()==0) { --- 832,836 ---- t.mnID = -1; ! if (mpSensorMap == 0) {return t;} if (mpSensorMap->GetTrackCount()==0) { *************** *** 844,848 **** int tcPlatformInterface::GetTrackCount() { ! if (mpSensorMap == NULL) {return 0;} return mpSensorMap->GetTrackCount(); } --- 844,848 ---- int tcPlatformInterface::GetTrackCount() { ! if (mpSensorMap == 0) {return 0;} return mpSensorMap->GetTrackCount(); } *************** *** 896,900 **** tcSensorMapTrack *pTrack; ! if (mpSensorMap == NULL) {return track;} int nCount = mpSensorMap->GetTrackCount(); if (nCount==0) --- 896,900 ---- tcSensorMapTrack *pTrack; ! if (mpSensorMap == 0) {return track;} int nCount = mpSensorMap->GetTrackCount(); if (nCount==0) *************** *** 1030,1034 **** const tcSensorState* sensor_state = mpPlatformObj->GetSensor(n); ! info.isActive = sensor_state->GetActive(); info.type = 0; --- 1030,1034 ---- const tcSensorState* sensor_state = mpPlatformObj->GetSensor(n); ! info.isActive = sensor_state->IsActive(); info.type = 0; *************** *** 1127,1131 **** void tcPlatformInterface::GetUserInput(std::string callback, std::string uitype) { ! if (mpCommandQueue == NULL) return; mpCommandQueue->GetUserInput(callback.c_str(),uitype.c_str()); } --- 1127,1131 ---- void tcPlatformInterface::GetUserInput(std::string callback, std::string uitype) { ! if (mpCommandQueue == 0) return; mpCommandQueue->GetUserInput(callback.c_str(),uitype.c_str()); } *************** *** 1179,1185 **** * such as activating the flight deck control panel. */ ! void tcPlatformInterface::SendCommand(std::string command) { ! if (mpCommandQueue == NULL) return; mpCommandQueue->AddCommand(command.c_str(),-1); } --- 1179,1185 ---- * such as activating the flight deck control panel. */ ! void tcPlatformInterface::SendCommand(const std::string& command) { ! if (mpCommandQueue == 0) return; mpCommandQueue->AddCommand(command.c_str(),-1); } *************** *** 1296,1300 **** tcFlightOpsObject* flightOps = dynamic_cast<tcFlightOpsObject*>(mpPlatformObj); ! if (flightOps != NULL) { fpi.flightport = flightOps->GetFlightPort(); --- 1296,1300 ---- tcFlightOpsObject* flightOps = dynamic_cast<tcFlightOpsObject*>(mpPlatformObj); ! if (flightOps != 0) { fpi.flightport = flightOps->GetFlightPort(); *************** *** 1343,1352 **** ! tcPlatformObject* tcPlatformInterface::mpStaticPlatformObj = NULL; ! tcSimState* tcPlatformInterface::mpSimState = NULL; ! tcAllianceSensorMap* tcPlatformInterface::mpSensorMap = NULL; ! tcSoundConsole* tcPlatformInterface::mpConsole = NULL; ! tcCommandQueue* tcPlatformInterface::mpCommandQueue = NULL; ! tcMapData* tcPlatformInterface::mapData = NULL; tcPlatformInterface::tcPlatformInterface() --- 1343,1352 ---- ! tcPlatformObject* tcPlatformInterface::mpStaticPlatformObj = 0; ! tcSimState* tcPlatformInterface::mpSimState = 0; ! tcAllianceSensorMap* tcPlatformInterface::mpSensorMap = 0; ! tcSoundConsole* tcPlatformInterface::mpConsole = 0; ! tcCommandQueue* tcPlatformInterface::mpCommandQueue = 0; ! tcMapData* tcPlatformInterface::mapData = 0; tcPlatformInterface::tcPlatformInterface() Index: tcScenarioInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcScenarioInterface.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** tcScenarioInterface.cpp 12 Jun 2005 20:46:59 -0000 1.28 --- tcScenarioInterface.cpp 22 Jun 2005 01:22:08 -0000 1.29 *************** *** 206,210 **** ! bool tcScenarioInterface::AddUnitToAlliance(tcScenarioUnit unit, int alliance) { lastObjectAdded = 0; --- 206,210 ---- ! bool tcScenarioInterface::AddUnitToAlliance(scriptinterface::tcScenarioUnit unit, int alliance) { lastObjectAdded = 0; Index: tcFlightPortInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcFlightPortInterface.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcFlightPortInterface.cpp 1 Jun 2005 00:13:32 -0000 1.7 --- tcFlightPortInterface.cpp 22 Jun 2005 01:22:08 -0000 1.8 *************** *** 1,6 **** ! /* ! ** tcFlightPortInterface.cpp ! ** ! ** Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** ! ** @file tcFlightPortInterface.cpp ! */ ! /* Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 73,90 **** } ! tcFlightPort* tcFlightPortInterface::static_flightport = NULL; ! tcSimState* tcFlightPortInterface::mpSimState = NULL; ! tcSoundConsole* tcFlightPortInterface::mpConsole = NULL; // Interface function declaration double tcFlightPortInterface::GetTime() { ! if (flightport==NULL) return 1e32; return flightport->last_update_time; } ! int tcFlightPortInterface::GetUnitCount(void) { ! if (flightport==NULL) return 0; return (int)flightport->units.size(); } --- 73,90 ---- } ! tcFlightPort* tcFlightPortInterface::static_flightport = 0; ! tcSimState* tcFlightPortInterface::mpSimState = 0; ! tcSoundConsole* tcFlightPortInterface::mpConsole = 0; // Interface function declaration double tcFlightPortInterface::GetTime() { ! if (flightport==0) return 1e32; return flightport->last_update_time; } ! int tcFlightPortInterface::GetUnitCount() { ! if (flightport==0) return 0; return (int)flightport->units.size(); } *************** *** 92,96 **** long tcFlightPortInterface::GetUnitID(int n) { ! if (flightport==NULL) return -1; if ((n<=0)||(n>=(int)flightport->units.size())) return -1; tcAirState* airstate = flightport->units.at(n); --- 92,96 ---- long tcFlightPortInterface::GetUnitID(int n) { ! if (flightport==0) return -1; if ((n<=0)||(n>=(int)flightport->units.size())) return -1; tcAirState* airstate = flightport->units.at(n); *************** *** 100,104 **** std::string tcFlightPortInterface::GetUnitName(int n) { ! if (flightport==NULL) return "err"; if ((n<0)||(n>=(int)flightport->units.size())) return "err"; tcAirState* airstate = flightport->units.at(n); --- 100,104 ---- std::string tcFlightPortInterface::GetUnitName(int n) { ! if (flightport==0) return "err"; if ((n<0)||(n>=(int)flightport->units.size())) return "err"; tcAirState* airstate = flightport->units.at(n); *************** *** 108,112 **** std::string tcFlightPortInterface::GetUnitLocation(int n) { ! if (flightport==NULL) return "err"; if ((n<0)||(n>=(int)flightport->units.size())) return "err"; tcAirState* airstate = flightport->units.at(n); --- 108,112 ---- std::string tcFlightPortInterface::GetUnitLocation(int n) { ! if (flightport==0) return "err"; if ((n<0)||(n>=(int)flightport->units.size())) return "err"; tcAirState* airstate = flightport->units.at(n); *************** *** 122,126 **** std::string tcFlightPortInterface::GetUnitGoalLocation(int n) { ! if (flightport==NULL) return "err"; if ((n<0)||(n>=(int)flightport->units.size())) return "err"; tcAirState* airstate = flightport->units.at(n); --- 122,126 ---- std::string tcFlightPortInterface::GetUnitGoalLocation(int n) { ! if (flightport==0) return "err"; if ((n<0)||(n>=(int)flightport->units.size())) return "err"; tcAirState* airstate = flightport->units.at(n); *************** *** 135,139 **** status.runway = -1; ! if (flightport==NULL) return status; if ((n<0)||(n>=(int)flightport->units.size())) return status; tcAirState* airstate = flightport->units.at(n); --- 135,139 ---- status.runway = -1; ! if (flightport==0) return status; if ((n<0)||(n>=(int)flightport->units.size())) return status; tcAirState* airstate = flightport->units.at(n); *************** *** 156,165 **** bool tcFlightPortInterface::IsValid() { ! return (flightport != NULL); } void tcFlightPortInterface::Launch(int runway) { ! if (flightport==NULL) return; flightport->Launch(runway); } --- 156,165 ---- bool tcFlightPortInterface::IsValid() { ! return (flightport != 0); } void tcFlightPortInterface::Launch(int runway) { ! if (flightport==0) return; flightport->Launch(runway); } *************** *** 167,171 **** void tcFlightPortInterface::LaunchID(long id) { ! if (flightport==NULL) return; flightport->LaunchID(id); } --- 167,171 ---- void tcFlightPortInterface::LaunchID(long id) { ! if (flightport==0) return; flightport->LaunchID(id); } *************** *** 178,182 **** void tcFlightPortInterface::SetDestination(int n, int dest_code) { ! if (flightport==NULL) return; teLocation dest; --- 178,182 ---- void tcFlightPortInterface::SetDestination(int n, int dest_code) { ! if (flightport==0) return; teLocation dest; *************** *** 188,194 **** tcFlightPortInterface::tcFlightPortInterface() { - flightport = NULL; } tcFlightPortInterface::~tcFlightPortInterface() { --- 188,195 ---- tcFlightPortInterface::tcFlightPortInterface() + : flightport(0) { } + tcFlightPortInterface::~tcFlightPortInterface() { |