[Gcblue-commits] gcb_wx/src/sim Game.cpp, 1.161, 1.162 tcESMSensor.cpp, 1.18, 1.19 tcGameObject.cpp
Status: Alpha
Brought to you by:
ddcforge
From: Dewitt C. <ddc...@us...> - 2006-10-24 01:34:11
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv8446/src/sim Modified Files: Game.cpp tcESMSensor.cpp tcGameObject.cpp tcLauncher.cpp tcOpticalSensor.cpp tcPlatformObject.cpp tcRadar.cpp tcSensorMapTrack.cpp tcSensorState.cpp tcSimState.cpp tcStores.cpp tcTorpedoObject.cpp Log Message: Index: tcLauncher.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcLauncher.cpp,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** tcLauncher.cpp 5 Sep 2006 01:04:25 -0000 1.38 --- tcLauncher.cpp 24 Oct 2006 01:34:05 -0000 1.39 *************** *** 483,486 **** --- 483,488 ---- bool tcLauncher::IsEffective(unsigned int targetClassification) const { + if (mnCurrent == 0) return false; + if ((targetClassification & PTYPE_SURFACE)&&(mnTargetFlags & SURFACE_TARGET)) { Index: tcPlatformObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcPlatformObject.cpp,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** tcPlatformObject.cpp 1 Oct 2006 21:07:41 -0000 1.65 --- tcPlatformObject.cpp 24 Oct 2006 01:34:06 -0000 1.66 *************** *** 230,234 **** if (mpDBObject->mfFuelCapacity_kg > 0) { ! fuel_kg -= dt_s * mpDBObject->GetFuelConsumptionConstant() * mcKin.mfSpeed_kts; if (fuel_kg < 0) fuel_kg = 0; --- 230,234 ---- if (mpDBObject->mfFuelCapacity_kg > 0) { ! fuel_kg -= dt_s * mpDBObject->GetFuelConsumptionConstant(mcKin.mfSpeed_kts) * mcKin.mfSpeed_kts; if (fuel_kg < 0) fuel_kg = 0; *************** *** 1019,1023 **** if (stream.GetDetailLevel() == tcStream::WRITE_ALL) updateMask = 0xFF; ! if (IsClientMode()) updateMask &= (~UPDATE_AI); // don't do ai updates at client stream << updateMask; --- 1019,1023 ---- if (stream.GetDetailLevel() == tcStream::WRITE_ALL) updateMask = 0xFF; ! //if (IsClientMode()) updateMask &= (~UPDATE_AI); // don't do ai updates at client stream << updateMask; *************** *** 1156,1160 **** bool tcPlatformObject::HasNewCommand() const { ! bool newBrainCommand = !IsClientMode() && brain->HasNewCommand(); if (newBrainCommand) return true; --- 1156,1160 ---- bool tcPlatformObject::HasNewCommand() const { ! bool newBrainCommand = brain->HasNewCommand(); if (newBrainCommand) return true; *************** *** 1169,1173 **** --- 1169,1183 ---- } + void tcPlatformObject::SetController(const std::string& username) + { + // set controller for all children + size_t nChildren = children.size(); + for (size_t n=0; n<nChildren; n++) + { + children[n]->SetController(username); + } + tcControllableObject::SetController(username); + } /** Index: tcTorpedoObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcTorpedoObject.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** tcTorpedoObject.cpp 24 Sep 2006 19:50:20 -0000 1.20 --- tcTorpedoObject.cpp 24 Oct 2006 01:34:06 -0000 1.21 *************** *** 365,372 **** --- 365,374 ---- { ApplyDamage(1.0f, 0); // self-destruct + #ifdef _DEBUG tcString s; s.Format("Torpedo %s shut down at time %.1f lon %.3f, lat %.3f", mzUnit.c_str(), afStatusTime, mcKin.mfLon_rad*C_180OVERPI, mcKin.mfLat_rad*C_180OVERPI); WTL(s.GetBuffer()); + #endif } Index: tcESMSensor.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcESMSensor.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcESMSensor.cpp 26 Mar 2006 00:32:15 -0000 1.18 --- tcESMSensor.cpp 24 Oct 2006 01:34:05 -0000 1.19 *************** *** 294,303 **** mcTrack.mnID = NULL_INDEX; if(simState->mpUserInfo->IsOwnAlliance(parent->GetAlliance())) { char zBuff[128]; ! sprintf(zBuff,"Missile %d shut down\n", parent->mnID); tcMessageInterface::Get()->ConsoleMessage(zBuff); } return; } --- 294,305 ---- mcTrack.mnID = NULL_INDEX; + #ifdef _DEBUG if(simState->mpUserInfo->IsOwnAlliance(parent->GetAlliance())) { char zBuff[128]; ! _snprintf(zBuff, 128, "Mis %d shut down (%s)\n", parent->mnID, parent->mzClass.c_str()); tcMessageInterface::Get()->ConsoleMessage(zBuff); } + #endif return; } Index: tcGameObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcGameObject.cpp,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** tcGameObject.cpp 17 Aug 2006 01:28:05 -0000 1.46 --- tcGameObject.cpp 24 Oct 2006 01:34:05 -0000 1.47 *************** *** 765,768 **** --- 765,770 ---- mcKin << stream; + stream >> mcTerrain.mfHeight_m; + stream >> mfDamageLevel; *************** *** 791,794 **** --- 793,798 ---- mcKin >> stream; + stream << mcTerrain.mfHeight_m; + stream << mfDamageLevel; Index: tcSimState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSimState.cpp,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** tcSimState.cpp 18 Jun 2006 00:45:04 -0000 1.99 --- tcSimState.cpp 24 Oct 2006 01:34:06 -0000 1.100 *************** *** 353,357 **** unsigned nLauncher; ! UpdateObjTerrainInfo(); bool usePositionRegistry = (positionRegistry != 0); --- 353,360 ---- unsigned nLauncher; ! if (multiplayerMode != MM_CLIENT) ! { ! UpdateObjTerrainInfo(); ! } bool usePositionRegistry = (positionRegistry != 0); *************** *** 1166,1170 **** void tcSimState::ReportDamage(tcGameObject* obj) { ! tcSound::Get()->PlayEffect("Implosion"); std::string damageString = "reports light damage"; --- 1169,1173 ---- void tcSimState::ReportDamage(tcGameObject* obj) { ! PlayEntitySoundEffect(obj, "Implosion"); std::string damageString = "reports light damage"; *************** *** 1438,1456 **** AddPlatform(child); ! // sound effects ! if (mpUserInfo->IsOwnAlliance(gameObj->GetAlliance())) ! { ! if (dynamic_cast<tcHeloObject*>(child)) ! { ! tcSound::Get()->PlayEffect("helolaunch"); ! } ! else if (dynamic_cast<tcAirObject*>(child)) ! { ! tcSound::Get()->PlayEffect("jetlaunch"); ! } ! } ! } if (launch_count) { --- 1441,1455 ---- AddPlatform(child); ! if (dynamic_cast<tcHeloObject*>(child)) ! { ! PlayEntitySoundEffect(gameObj, "helolaunch"); ! } ! else if (dynamic_cast<tcAirObject*>(child)) ! { ! PlayEntitySoundEffect(gameObj, "jetlaunch"); ! } ! } if (launch_count) { *************** *** 2456,2459 **** --- 2455,2459 ---- mcSensorMap.GetSensorMapTrack(obj->mnID, alliance); if (pTrack) track = *pTrack; + else return false; // track not found } Index: tcOpticalSensor.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcOpticalSensor.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcOpticalSensor.cpp 17 Aug 2006 01:28:05 -0000 1.12 --- tcOpticalSensor.cpp 24 Oct 2006 01:34:06 -0000 1.13 *************** *** 238,241 **** --- 238,243 ---- } // shut down missile if track lost for > 7 seconds + + parent->SetHeading(parent->mcKin.mfHeading_rad); // stop turning if track lost if ((mnMode == SSMODE_SEEKERTRACK)&& (t - mcTrack.mfTimestamp) > 7.0) *************** *** 243,252 **** parent->SelfDestruct(); mcTrack.mnID = NULL_INDEX; if(simState->mpUserInfo->IsOwnAlliance(parent->GetAlliance())) { char zBuff[128]; ! sprintf(zBuff,"Missile %d shut down\n", parent->mnID); simState->mpCommandInterface->DisplayInfoMessage(zBuff); } return; } --- 245,256 ---- parent->SelfDestruct(); mcTrack.mnID = NULL_INDEX; + #ifdef _DEBUG if(simState->mpUserInfo->IsOwnAlliance(parent->GetAlliance())) { char zBuff[128]; ! _snprintf(zBuff, 128, "Mis %d shut down (%s)\n", parent->mnID, parent->mzClass.c_str()); simState->mpCommandInterface->DisplayInfoMessage(zBuff); } + #endif return; } Index: tcSensorState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSensorState.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcSensorState.cpp 23 Mar 2006 01:11:02 -0000 1.18 --- tcSensorState.cpp 24 Oct 2006 01:34:06 -0000 1.19 *************** *** 444,448 **** { // release fire control track ! if (fireControlId != -1) { if (tcRadar *illuminator = GetFireControlRadar()) --- 444,448 ---- { // release fire control track ! if ((!simState->IsMultiplayerClient()) && (fireControlId != -1)) { if (tcRadar *illuminator = GetFireControlRadar()) Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.161 retrieving revision 1.162 diff -C2 -d -r1.161 -r1.162 *** Game.cpp 1 Oct 2006 21:07:41 -0000 1.161 --- Game.cpp 24 Oct 2006 01:34:05 -0000 1.162 *************** *** 1079,1083 **** "xml/info_console.xml", "InfoConsole", gameWindow); infoConsole->SetBaseRenderBin(30); ! infoConsole->LoadBackgroundImage("start_background.jpg"); messageConsole = infoConsole; --- 1079,1084 ---- "xml/info_console.xml", "InfoConsole", gameWindow); infoConsole->SetBaseRenderBin(30); ! infoConsole->LoadBackgroundImage("start_background_plain.jpg"); ! infoConsole->MoveToTop(); messageConsole = infoConsole; *************** *** 2140,2143 **** --- 2141,2146 ---- int ownAlliance = userInfo->GetOwnAlliance(); + if (ownAlliance == 0) return; // no alliance selected yet (multiplayer) + unsigned count = simState->GetAlliancePlatforms(&id[0], maxPlats, ownAlliance); Index: tcSensorMapTrack.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSensorMapTrack.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcSensorMapTrack.cpp 18 Jun 2006 00:45:03 -0000 1.7 --- tcSensorMapTrack.cpp 24 Oct 2006 01:34:06 -0000 1.8 *************** *** 489,493 **** { ! if (autoKillAssess) { if (!IsNew() && !IsDestroyed()) --- 489,493 ---- { ! if (autoKillAssess && (!simState->IsMultiplayerClient())) { if (!IsNew() && !IsDestroyed()) Index: tcStores.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcStores.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcStores.cpp 1 Oct 2006 21:07:41 -0000 1.14 --- tcStores.cpp 24 Oct 2006 01:34:06 -0000 1.15 *************** *** 187,196 **** unsigned long quantity; unsigned char launcherIdx; ! stream >> id; stream >> op; ! stream >> itemId; ! stream >> quantity; ! stream >> launcherIdx; bool ok = true; --- 187,205 ---- unsigned long quantity; unsigned char launcherIdx; ! std::string type; ! stream >> id; stream >> op; ! ! if (op != StoreOperation::AUTOMATION) ! { ! stream >> itemId; ! stream >> quantity; ! stream >> launcherIdx; ! } ! else ! { ! stream >> type; ! } bool ok = true; *************** *** 209,213 **** std::string item; ! if (op != StoreOperation::UNLOAD) { tcDatabaseObject* databaseObj = tcDatabase::Get()->GetObject(itemId); --- 218,222 ---- std::string item; ! if ((op != StoreOperation::UNLOAD) && (op != StoreOperation::AUTOMATION)) { tcDatabaseObject* databaseObj = tcDatabase::Get()->GetObject(itemId); *************** *** 221,227 **** } } if (ok) { ! if (op == StoreOperation::LOAD) { LoadLauncher(launcherIdx, item, obj); --- 230,241 ---- } } + if (ok) { ! if (op == StoreOperation::AUTOMATION) ! { ! AddAutomationOp(type, obj); ! } ! else if (op == StoreOperation::LOAD) { LoadLauncher(launcherIdx, item, obj); *************** *** 261,267 **** stream << cmd.id; stream << cmd.op; ! stream << cmd.itemId; ! stream << cmd.quantity; ! stream << cmd.launcherIdx; } --- 275,288 ---- stream << cmd.id; stream << cmd.op; ! if (cmd.op != StoreOperation::AUTOMATION) ! { ! stream << cmd.itemId; ! stream << cmd.quantity; ! stream << cmd.launcherIdx; ! } ! else ! { ! stream << cmd.type; ! } } *************** *** 294,297 **** --- 315,342 ---- } + if (parent->IsClientMode()) + { + CommandInfo cmd; + + if (child->parent != 0) + { + cmd.id = child->mnID; + } + else + { + cmd.id = -1; + } + + cmd.op = StoreOperation::AUTOMATION; + cmd.itemId = -1; + cmd.quantity = 0; + cmd.launcherIdx = 0; + cmd.type = type; + + commandList.push_back(cmd); + + return; + } + // first search for any existing ops with this child and remove std::vector<AutomationOperation> temp; Index: tcRadar.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcRadar.cpp,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** tcRadar.cpp 5 Sep 2006 01:04:25 -0000 1.40 --- tcRadar.cpp 24 Oct 2006 01:34:06 -0000 1.41 *************** *** 224,227 **** --- 224,228 ---- bool isSurface = false; bool isAir = false; + bool isMissile = false; bool isGround = false; float rcs_dBsm; *************** *** 243,247 **** { rcs_dBsm = missileObj->mpDBObject->mfRcs_dbsm; ! isAir = true; } else if (const tcGroundObject* groundObj = dynamic_cast<const tcGroundObject*>(target)) --- 244,248 ---- { rcs_dBsm = missileObj->mpDBObject->mfRcs_dbsm; ! isMissile = true; } else if (const tcGroundObject* groundObj = dynamic_cast<const tcGroundObject*>(target)) *************** *** 264,268 **** rcs_dBsm = sub->mpDBObject->mfRcs_dbsm; isSurface = true; ! targetHeight_m += 2.0f + 0.4f * surfaceObj->GetZmaxConst(); } else --- 265,269 ---- rcs_dBsm = sub->mpDBObject->mfRcs_dbsm; isSurface = true; ! targetHeight_m += 2.0f + 0.4f * sub->GetZmaxConst(); } else *************** *** 310,313 **** --- 311,315 ---- bool bTargetTypeMatch = (mpDBObj->mbDetectsAir && isAir) || + (mpDBObj->mbDetectsMissile && isMissile) || (mpDBObj->mbDetectsSurface && isSurface) || (mpDBObj->mbDetectsGround && isGround); *************** *** 545,554 **** parent->SelfDestruct(); mcTrack.mnID = -1; if(simState->mpUserInfo->IsOwnAlliance(parent->GetAlliance())) { char zBuff[128]; ! sprintf(zBuff,"Missile %d shut down\n", parent->mnID); simState->mpCommandInterface->DisplayInfoMessage(zBuff); } return; } --- 547,558 ---- parent->SelfDestruct(); mcTrack.mnID = -1; + #ifdef _DEBUG if(simState->mpUserInfo->IsOwnAlliance(parent->GetAlliance())) { char zBuff[128]; ! _snprintf(zBuff, 128, "Mis %d shut down (%s)\n", parent->mnID, parent->mzClass.c_str()); simState->mpCommandInterface->DisplayInfoMessage(zBuff); } + #endif return; } |