Thread: [Gcblue-commits] gcb_wx/src/sim Game.cpp,1.114,1.115 tcCommandQueue.cpp,1.1,1.2 tcObjectControl.cpp,
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2005-01-10 00:31:13
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27845/src/sim Modified Files: Game.cpp tcCommandQueue.cpp tcObjectControl.cpp tcSimState.cpp tcSonar.cpp Log Message: Fixed group commands Index: tcSimState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSimState.cpp,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** tcSimState.cpp 11 Dec 2004 01:09:08 -0000 1.62 --- tcSimState.cpp 10 Jan 2005 00:30:55 -0000 1.63 *************** *** 1452,1456 **** if (mpUserInfo->IsOwnAlliance(launchingPlatform->mnAlliance)) { ! //tcSound::Get()->PlayEffect(SEFFECT_MISSILELAUNCH); } } --- 1452,1456 ---- if (mpUserInfo->IsOwnAlliance(launchingPlatform->mnAlliance)) { ! tcSound::Get()->PlayEffect(SEFFECT_TORPEDOLAUNCH); } } Index: tcCommandQueue.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcCommandQueue.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcCommandQueue.cpp 11 Dec 2004 01:09:08 -0000 1.1 --- tcCommandQueue.cpp 10 Jan 2005 00:30:55 -0000 1.2 *************** *** 69,73 **** newcmd.mbCallback = false; newcmd.mbGetUserInput = false; ! newcmd.platformID = -1; if (mnCount < MAX_QUEUED_COMMANDS) { --- 69,73 ---- newcmd.mbCallback = false; newcmd.mbGetUserInput = false; ! newcmd.platformID.clear(); if (mnCount < MAX_QUEUED_COMMANDS) { *************** *** 89,93 **** strcpy(newcmd.mzString , azCommand); strcpy(newcmd.mzUserInput, ""); ! newcmd.platformID = -1; if (mnCount < MAX_QUEUED_COMMANDS) { --- 89,93 ---- strcpy(newcmd.mzString , azCommand); strcpy(newcmd.mzUserInput, ""); ! newcmd.platformID.clear(); if (mnCount < MAX_QUEUED_COMMANDS) { *************** *** 109,113 **** strcpy(newcmd.mzString , azCommand); strcpy(newcmd.mzUserInput, ""); ! newcmd.platformID = -1; if (mnCount < MAX_QUEUED_COMMANDS) { --- 109,113 ---- strcpy(newcmd.mzString , azCommand); strcpy(newcmd.mzUserInput, ""); ! newcmd.platformID.clear(); if (mnCount < MAX_QUEUED_COMMANDS) { *************** *** 130,134 **** strcpy(newcmd.mzString , azCommand); strcpy(newcmd.mzUserInput, ""); ! newcmd.platformID = -1; if (mnCount < MAX_QUEUED_COMMANDS) { --- 130,134 ---- strcpy(newcmd.mzString , azCommand); strcpy(newcmd.mzUserInput, ""); ! newcmd.platformID.clear(); if (mnCount < MAX_QUEUED_COMMANDS) { *************** *** 154,158 **** strcpy(newcmd.mzString , azCallback); strcpy(newcmd.mzUserInput, azUserInput); ! newcmd.platformID = -1; if (mnCount < MAX_QUEUED_COMMANDS) { --- 154,158 ---- strcpy(newcmd.mzString , azCallback); strcpy(newcmd.mzUserInput, azUserInput); ! newcmd.platformID.clear(); if (mnCount < MAX_QUEUED_COMMANDS) { *************** *** 170,174 **** */ void tcCommandQueue::GetUserInputForID(const char *azCallback, const char *azUserInput, ! long platformID, int param) { tsCommandInfo newcmd; --- 170,174 ---- */ void tcCommandQueue::GetUserInputForID(const char *azCallback, const char *azUserInput, ! std::vector<long>& platformID, int param) { tsCommandInfo newcmd; *************** *** 205,209 **** strcpy(newcmd.mzString , azCallback); strcpy(newcmd.mzUserInput, azUserInput); ! newcmd.platformID = -1; if (mnCount < MAX_QUEUED_COMMANDS) { --- 205,209 ---- strcpy(newcmd.mzString , azCallback); strcpy(newcmd.mzUserInput, azUserInput); ! newcmd.platformID.clear(); if (mnCount < MAX_QUEUED_COMMANDS) { *************** *** 216,220 **** */ void tcCommandQueue::AddPythonCallbackForID(const char *azCallback, const char *azUserInput, ! long platformID, int param) { tsCommandInfo newcmd; --- 216,220 ---- */ void tcCommandQueue::AddPythonCallbackForID(const char *azCallback, const char *azUserInput, ! std::vector<long>& platformID, int param) { tsCommandInfo newcmd; *************** *** 244,248 **** newcmd.mbUsePython = false; strcpy(newcmd.mzString, azString); ! newcmd.platformID = -1; if (mnCount < MAX_QUEUED_COMMANDS) { --- 244,248 ---- newcmd.mbUsePython = false; strcpy(newcmd.mzString, azString); ! newcmd.platformID.clear(); if (mnCount < MAX_QUEUED_COMMANDS) { Index: tcObjectControl.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcObjectControl.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** tcObjectControl.cpp 21 Dec 2004 02:26:18 -0000 1.28 --- tcObjectControl.cpp 10 Jan 2005 00:30:55 -0000 1.29 *************** *** 39,42 **** --- 39,43 ---- #include "tcAeroAirObject.h" #include "tcAirDBObject.h" + #include "tcTorpedoDBObject.h" #include "tcTime.h" #include "tcLauncher.h" *************** *** 699,703 **** return; // obj not found } ! teButtonState eLauncherState, eDatumState, eTargetState, eLaunchState; tcLauncherState *pLauncherState; mpHookedGameObj->GetLauncherState(pLauncherState); --- 700,704 ---- return; // obj not found } ! teButtonState eLauncherState; tcLauncherState *pLauncherState; mpHookedGameObj->GetLauncherState(pLauncherState); *************** *** 727,761 **** mcWeaponPanel.mastrCaption[i][1].Format("%d", nLaunchCount); ! switch(pLauncher->meLaunchMode) { ! case AUTO: ! mcWeaponPanel.mastrCaption[i][4].Format("L-%s","AUT"); ! break; ! case DATUM_ONLY: ! mcWeaponPanel.mastrCaption[i][4].Format("L-%s","DAT"); ! break; ! case FC_TRACK: ! mcWeaponPanel.mastrCaption[i][4].Format("L-%s","SA"); ! break; ! case SEEKER_TRACK: ! mcWeaponPanel.mastrCaption[i][4].Format("L-%s","SKR"); ! break; ! default: ! mcWeaponPanel.mastrCaption[i][4].Format("L-%s","ERR"); ! break; } bool bDatumActive = (pLauncher->msDatum.mfLat_rad!=0)&&(pLauncher->msDatum.mfLon_rad!=0); bool bTrackActive = (pLauncher->mnTargetID != NULL_INDEX); bool bReadyForLaunch; bool bLauncherActive = (nLaunchCount > 0) && (!pLauncher->isLoading); ! if (bTrackActive) ! { ! mcWeaponPanel.mastrCaption[i][3].Format("U%d",pLauncher->mnTargetID); ! } ! else ! { ! mcWeaponPanel.mastrCaption[i][3] = "FC"; ! } if (pLauncher->meLaunchMode == AUTO) --- 728,747 ---- mcWeaponPanel.mastrCaption[i][1].Format("%d", nLaunchCount); ! // hack to display "P" only when launcher has associated preset (torpedoes only at the moment) ! mcWeaponPanel.mastrCaption[i][2] = ""; ! if (pLauncher) { ! if (tcTorpedoDBObject* torpDBObj = dynamic_cast<tcTorpedoDBObject*>(pLauncher->mpChildDBObj)) ! { ! mcWeaponPanel.mastrCaption[i][2] = "P"; ! } } + bool bDatumActive = (pLauncher->msDatum.mfLat_rad!=0)&&(pLauncher->msDatum.mfLon_rad!=0); bool bTrackActive = (pLauncher->mnTargetID != NULL_INDEX); bool bReadyForLaunch; bool bLauncherActive = (nLaunchCount > 0) && (!pLauncher->isLoading); ! if (pLauncher->meLaunchMode == AUTO) *************** *** 778,784 **** { eLauncherState = BS_DISABLED; - eDatumState = BS_DISABLED; - eTargetState = BS_DISABLED; - eLaunchState = BS_DISABLED; } else --- 764,767 ---- *************** *** 792,798 **** eLauncherState = BS_READYING; } - eTargetState = bTrackActive ? BS_ACTIVE : BS_READY; - eDatumState = bDatumActive ? BS_ACTIVE : BS_READY; - eLaunchState = bReadyForLaunch ? BS_ACTIVE : BS_READY; } --- 775,778 ---- *************** *** 804,810 **** mcWeaponPanel.maButtonState[i][0] = eLauncherState; mcWeaponPanel.maButtonState[i][1] = eLauncherState; ! mcWeaponPanel.maButtonState[i][2] = eDatumState; ! mcWeaponPanel.maButtonState[i][3] = eTargetState; ! mcWeaponPanel.maButtonState[i][4] = eLaunchState; } mcWeaponPanel.Draw((tc3DWindow*)this); --- 784,788 ---- mcWeaponPanel.maButtonState[i][0] = eLauncherState; mcWeaponPanel.maButtonState[i][1] = eLauncherState; ! mcWeaponPanel.maButtonState[i][2] = eLauncherState; } mcWeaponPanel.Draw((tc3DWindow*)this); *************** *** 1399,1406 **** case 2: // "P" launcher programming, e.g. torpedo settings { ! tcLauncherPopup* popupControl = ! new tcLauncherPopup(mpHookedGameObj->mnID, anLauncher, wxPoint(220, 200)); ! ! return true; } break; --- 1377,1389 ---- case 2: // "P" launcher programming, e.g. torpedo settings { ! if (tcLauncher* launcher = mpHookedGameObj->GetLauncher(anLauncher)) ! { ! if (tcTorpedoDBObject* torpDBObj = dynamic_cast<tcTorpedoDBObject*>(launcher->mpChildDBObj)) ! { ! tcLauncherPopup* popupControl = ! new tcLauncherPopup(mpHookedGameObj->mnID, anLauncher, wxPoint(220, 200)); ! return true; ! } ! } } break; Index: tcSonar.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSonar.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcSonar.cpp 21 Dec 2004 02:26:18 -0000 1.4 --- tcSonar.cpp 10 Jan 2005 00:30:55 -0000 1.5 *************** *** 420,424 **** if (simState->mpUserInfo->IsOwnAlliance(parent->mnAlliance)) { ! tcSound::Get()->PlayEffect(SEFFECT_PING); } fprintf(stdout, "%s (%s): target %d (%s) detected by active sonar at %3.1f km at time %.1f " --- 420,424 ---- if (simState->mpUserInfo->IsOwnAlliance(parent->mnAlliance)) { ! tcSound::Get()->PlayEffect(SEFFECT_SONARDETECT); } fprintf(stdout, "%s (%s): target %d (%s) detected by active sonar at %3.1f km at time %.1f " *************** *** 480,484 **** if (simState->mpUserInfo->IsOwnAlliance(parent->mnAlliance)) { ! tcSound::Get()->PlayEffect(SEFFECT_PING); } fprintf(stdout, "%s (%s): target %d (%s) detected by passive sonar at %3.1f km" --- 480,484 ---- if (simState->mpUserInfo->IsOwnAlliance(parent->mnAlliance)) { ! tcSound::Get()->PlayEffect(SEFFECT_SONARDETECT); } fprintf(stdout, "%s (%s): target %d (%s) detected by passive sonar at %3.1f km" Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.114 retrieving revision 1.115 diff -C2 -d -r1.114 -r1.115 *** Game.cpp 30 Dec 2004 17:26:07 -0000 1.114 --- Game.cpp 10 Jan 2005 00:30:54 -0000 1.115 *************** *** 2284,2288 **** else if (cmd_info.mbGetUserInput) { ! if (cmd_info.platformID == -1) cmd_info.platformID = tacticalMap->GetHookID(); GetUserInput(cmd_info.mzString, cmd_info.mzUserInput, cmd_info.platformID, cmd_info.mnData); --- 2284,2288 ---- else if (cmd_info.mbGetUserInput) { ! if (cmd_info.platformID.size() == 0) cmd_info.platformID = tacticalMap->GetHookedGroup(); GetUserInput(cmd_info.mzString, cmd_info.mzUserInput, cmd_info.platformID, cmd_info.mnData); *************** *** 2345,2349 **** * Calls Python callback */ ! void tcGame::ProcessCallback(char *azCallback, char *azUserInput, long id, int param) { if (strcmp(azUserInput,"Heading") == 0) --- 2345,2349 ---- * Calls Python callback */ ! void tcGame::ProcessCallback(char *azCallback, char *azUserInput, std::vector<long>& id, int param) { if (strcmp(azUserInput,"Heading") == 0) *************** *** 2369,2373 **** * Gets user input for Python call back and then calls Python callback */ ! void tcGame::GetUserInput(char *azCallback, char *azUserInput, long id, int param) { tacticalMap->SetMapCmdCallback(azCallback, id, param); --- 2369,2373 ---- * Gets user input for Python call back and then calls Python callback */ ! void tcGame::GetUserInput(char *azCallback, char *azUserInput, std::vector<long>& id, int param) { tacticalMap->SetMapCmdCallback(azCallback, id, param); |