[Gcblue-commits] gcb_wx/src/sim tcObjectControl.cpp,1.30,1.31 tcPlatformObject.cpp,1.36,1.37
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2005-02-20 18:20:31
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23561/src/sim Modified Files: tcObjectControl.cpp tcPlatformObject.cpp Log Message: Parallel ai update Index: tcPlatformObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcPlatformObject.cpp,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** tcPlatformObject.cpp 18 Feb 2005 17:41:51 -0000 1.36 --- tcPlatformObject.cpp 20 Feb 2005 18:20:20 -0000 1.37 *************** *** 79,83 **** void tcPlatformObject::DesignateTarget(long anID) { ! mcAI.SetTarget(anID); unsigned nLaunchers = mcLauncherState.GetLauncherCount(); for (size_t n=0; n<nLaunchers; n++) --- 79,83 ---- void tcPlatformObject::DesignateTarget(long anID) { ! brain->SetTarget(anID); unsigned nLaunchers = mcLauncherState.GetLauncherCount(); for (size_t n=0; n<nLaunchers; n++) *************** *** 415,419 **** wxASSERT(id >= 0); ! return mcAI.GetTarget() == id; } --- 415,419 ---- wxASSERT(id >= 0); ! return brain->GetTarget() == id; } Index: tcObjectControl.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcObjectControl.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** tcObjectControl.cpp 27 Jan 2005 01:01:55 -0000 1.30 --- tcObjectControl.cpp 20 Feb 2005 18:20:20 -0000 1.31 *************** *** 46,49 **** --- 46,50 ---- #include "tcLauncherPopup.h" #include "tcCommandQueue.h" + #include "ai/Brain.h" #include <osg/Geometry> *************** *** 65,69 **** const float fontSize = 12.0f; ! if (mpAIData == NULL) {return;} wxASSERT(context); --- 66,70 ---- const float fontSize = 12.0f; ! if (!brain) return; wxASSERT(context); *************** *** 78,82 **** texty += 15.0f; ! long nTargetID = mpAIData->GetTarget(); if (nTargetID != NULL_INDEX) { --- 79,83 ---- texty += 15.0f; ! long nTargetID = brain->GetTarget(); if (nTargetID != NULL_INDEX) { *************** *** 94,121 **** texty += 15.0f; ! int nOrders = mpAIData->GetOrderCount(); ! if (nOrders > 0) { ! int nCurrentOrder = mpAIData->GetCurrentOrderIdx(); ! int n = 0; ! while ((n < nOrders) && (texty < 200.0f)) { ! if (n == nCurrentOrder) ! { ! color.set(0.8f, 1.0f, 0.8f, 1.0f); ! } ! else ! { ! color.set(0.4f, 0.5f, 0.4f, 1.0f); ! } tcOrder order; ! mpAIData->GetOrder(order ,n); ! sprintf(zBuff, "%d %s", n, order.mstrOrdername.c_str()); ! context->DrawTextR(order.mstrOrdername.c_str(), textx, texty, font, color, fontSize, LEFT_BASE_LINE); ! texty += 10.0f; n++; } --- 95,117 ---- texty += 15.0f; ! std::vector<std::string> taskList = brain->GetTaskList(); ! size_t nTasks = taskList.size(); ! ! if (nTasks > 0) { ! size_t n = 0; ! while ((n < nTasks) && (texty < 200.0f)) { ! color.set(0.8f, 1.0f, 0.8f, 1.0f); tcOrder order; ! ! double priority = brain->GetTaskPriority(taskList[n]); ! sprintf(zBuff, "%s %.0f", taskList[n].c_str(), priority); ! context->DrawTextR(zBuff, textx, texty, font, color, fontSize, LEFT_BASE_LINE); ! texty += 12.0f; n++; } *************** *** 124,128 **** { color.set(0.4f, 0.5f, 0.4f, 1.0f); ! context->DrawTextR("No orders", textx, texty, font, color, fontSize, LEFT_BASE_LINE); texty += 10.0f; --- 120,124 ---- { color.set(0.4f, 0.5f, 0.4f, 1.0f); ! context->DrawTextR("No tasks", textx, texty, font, color, fontSize, LEFT_BASE_LINE); texty += 10.0f; *************** *** 136,140 **** tcAIPanel::tcAIPanel() : ! mpAIData(0), mzCaption("ORDERS STATUS") { --- 132,136 ---- tcAIPanel::tcAIPanel() : ! brain(0), mzCaption("ORDERS STATUS") { *************** *** 480,490 **** ftexty += 12; - /*** mnClassID, mnModelType, mnType (classification) ***/ - /* - GetObjectInfo(s ,mpHookedGameObj->mpDBObject, mpHookedGameObj); - DrawTextR(s.GetBuffer(), ftextx, ftexty, - defaultFont.get(), color, fontSize, LEFT_BASE_LINE); - ftexty += 12; - */ /*** speed, heading, altitude, terrain info ***/ --- 476,479 ---- *************** *** 1609,1619 **** { tcPlatformObject *pPlatformObj = dynamic_cast<tcPlatformObject*> (mpHookedGameObj); ! if (pPlatformObj != NULL) { ! mcAIPanel.SetAIData(&pPlatformObj->mcAI); } else { ! mcAIPanel.SetAIData(NULL); } } --- 1598,1608 ---- { tcPlatformObject *pPlatformObj = dynamic_cast<tcPlatformObject*> (mpHookedGameObj); ! if (pPlatformObj) { ! mcAIPanel.SetAIData(pPlatformObj->GetBrain()); } else { ! mcAIPanel.SetAIData(0); } } |