[Gcblue-commits] gcb_wx/src/graphics tc3DWindow.cpp,1.15,1.16 tcConsoleBox.cpp,1.11,1.12 tcGameView.
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2005-03-02 22:29:25
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15614/src/graphics Modified Files: tc3DWindow.cpp tcConsoleBox.cpp tcGameView.cpp tcMapView.cpp tcNetworkView.cpp tcNumberWidget.cpp Log Message: Better sensor ageout behavior, more ai work, misc cleanup Index: tcNetworkView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcNetworkView.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcNetworkView.cpp 21 Oct 2004 04:10:59 -0000 1.3 --- tcNetworkView.cpp 2 Mar 2005 22:28:43 -0000 1.4 *************** *** 274,277 **** --- 274,278 ---- chatBox = new tcConsoleBox(this, current); chatBox->SetActive(true); + tcMultiplayerInterface::Get()->AddChatSubscriber(chatBox); Index: tcConsoleBox.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcConsoleBox.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcConsoleBox.cpp 2 Nov 2004 04:23:56 -0000 1.11 --- tcConsoleBox.cpp 2 Mar 2005 22:28:43 -0000 1.12 *************** *** 110,114 **** } ! mbRedraw = true; return 0; } --- 110,114 ---- } ! redraw = true; return 0; } *************** *** 122,128 **** cursorLine = 0; cursorCol = 0; ! mbRedraw = true; } /** * --- 122,129 ---- cursorLine = 0; cursorCol = 0; ! redraw = true; } + /** * *************** *** 135,139 **** UpdateCursor(); // update cursor position for delayed draw effect ! if (!mbRedraw) return; // DrawRectangleR(0, 0, mnWidth, mnHeight, osg::Vec4(1, 1, 1, 1)); --- 136,140 ---- UpdateCursor(); // update cursor position for delayed draw effect ! if (!redraw && !forceRedraw) return; // DrawRectangleR(0, 0, mnWidth, mnHeight, osg::Vec4(1, 1, 1, 1)); *************** *** 168,173 **** } ! mbForceRedraw = false; ! mbRedraw = false; HideUnusedObjects(); --- 169,174 ---- } ! forceRedraw = false; ! redraw = false; HideUnusedObjects(); *************** *** 253,257 **** if (cursorLine == (int)textArray.GetCount()) { ! mbRedraw = false; return; } --- 254,258 ---- if (cursorLine == (int)textArray.GetCount()) { ! redraw = false; return; } *************** *** 266,270 **** cursorCol = 0; } ! mbRedraw = true; return; } --- 267,271 ---- cursorCol = 0; } ! redraw = true; return; } *************** *** 279,283 **** if ((cursorLine == (int)textArray.GetCount()) && EOL) { ! mbRedraw = false; return; // do nothing, cursor has caught up to buffer } --- 280,284 ---- if ((cursorLine == (int)textArray.GetCount()) && EOL) { ! redraw = false; return; // do nothing, cursor has caught up to buffer } *************** *** 291,295 **** cursorCol++; } ! mbRedraw = true; } --- 292,296 ---- cursorCol++; } ! redraw = true; } *************** *** 307,312 **** nwrapcol(80), useDelayedTextEffect(false), ! mbRedraw(true), ! mbForceRedraw(true), nlinespace(15), isMouseOver(false), --- 308,313 ---- nwrapcol(80), useDelayedTextEffect(false), ! redraw(true), ! forceRedraw(true), nlinespace(15), isMouseOver(false), Index: tcNumberWidget.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcNumberWidget.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcNumberWidget.cpp 31 Jan 2005 01:33:07 -0000 1.2 --- tcNumberWidget.cpp 2 Mar 2005 22:28:43 -0000 1.3 *************** *** 144,148 **** SendRedraw(); ! tcSound::Get()->PlayEffect(19); } --- 144,148 ---- SendRedraw(); ! tcSound::Get()->PlayEffect("MutedBeep"); } Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapView.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** tcMapView.cpp 21 Feb 2005 18:26:12 -0000 1.17 --- tcMapView.cpp 2 Mar 2005 22:28:43 -0000 1.18 *************** *** 841,848 **** /* osg::Vec4Array* colors = new osg::Vec4Array; ! colors->push_back(GetAffiliationColor(affil)); symbol->setColorArray(colors); ! symbol->setColorBinding(osg::Geometry::BIND_OVERALL); ! */ // create vertex array --- 841,849 ---- /* osg::Vec4Array* colors = new osg::Vec4Array; ! colors->push_back(osg::Vec4(0.5, 0.5, 1.0, 0.5)); symbol->setColorArray(colors); ! symbol->setColorBinding(osg::Geometry::BIND_OVERALL); ! */ ! // create vertex array *************** *** 1554,1557 **** --- 1555,1593 ---- /** + * Creates faded copies of symbol tables. + * Call after tables are built. + */ + void tcTacticalMapView::CreateFadedSymbols() + { + for (int nAffiliation=0; nAffiliation<4; nAffiliation++) + { + for (int nSymbol=0; nSymbol<MAX_SYMBOL; nSymbol++) + { + { + osg::Geometry* fadedA = new osg::Geometry(*maSymbolA[nAffiliation][nSymbol]); + + osg::Vec4Array* colors = new osg::Vec4Array; + colors->push_back(osg::Vec4(0.4, 0.4, 0.4, 1.0)); + fadedA->setColorArray(colors); + fadedA->setColorBinding(osg::Geometry::BIND_OVERALL); + + maSymbolA_fade[nAffiliation][nSymbol] = fadedA; + } + { + osg::Geometry* fadedB = new osg::Geometry(*maSymbolB[nAffiliation][nSymbol]); + osg::Vec4Array* colors = new osg::Vec4Array; + colors->push_back(osg::Vec4(0.4, 0.4, 0.4, 1.0)); + fadedB->setColorArray(colors); + fadedB->setColorBinding(osg::Geometry::BIND_OVERALL); + + maSymbolB_fade[nAffiliation][nSymbol] = fadedB; + } + + } + } + } + + + /** * @returns symbol image pointer based on symbology mode */ *************** *** 1571,1574 **** --- 1607,1629 ---- } + /** + * Faded version of symbols for stale tracks + * @returns symbol image pointer based on symbology mode + */ + osg::Geometry* tcTacticalMapView::GetSymbolFaded(teAffiliation aeAffiliation, teSymbol aeSymbol) + { + int nAffilIdx = (int)aeAffiliation; + int nSymbolIdx = (int)aeSymbol; + + if (meSymbology == NTDS) + { + return maSymbolA_fade[nAffilIdx][nSymbolIdx].get(); + } + else + { + return maSymbolB_fade[nAffilIdx][nSymbolIdx].get(); + } + } + *************** *** 1588,1592 **** teSymbol type; const float passive_vect_size = 75.0f; ! h = pMO->mfHeading; int bHeadingValid = pMO->mnFlags & TRACK_HEADING_VALID; --- 1643,1647 ---- teSymbol type; const float passive_vect_size = 75.0f; ! h = pMO->mfHeading; int bHeadingValid = pMO->mnFlags & TRACK_HEADING_VALID; *************** *** 1729,1734 **** else { ! osg::Geometry* pSymbol = tcTacticalMapView::GetSymbol(pMO->meAffiliation, pMO->meSymbol); DrawGeometryR(pSymbol, x, y); } --- 1784,1808 ---- else { ! osg::Geometry* pSymbol = 0; ! if (!pMO->isStaleTrack) ! { ! pSymbol = tcTacticalMapView::GetSymbol(pMO->meAffiliation, pMO->meSymbol); ! } ! else ! { ! pSymbol = tcTacticalMapView::GetSymbolFaded(pMO->meAffiliation, pMO->meSymbol); ! symbolColor *= 0.5; ! } ! DrawGeometryR(pSymbol, x, y); + + // draw 'X' if destroyed + if (pMO->isDestroyed) + { + const osg::Vec4 red(1.0, 0, 0, 1.0); + const float halfWidth = 10.0f; + DrawLineR(x-halfWidth, y-halfWidth, x+halfWidth, y+halfWidth, red); + DrawLineR(x-halfWidth, y+halfWidth, x+halfWidth, y-halfWidth, red); + } } *************** *** 2023,2029 **** --- 2097,2105 ---- mpMapData->GetTheaterArea(mrectViewBounds); // restrict view to theater area SetView(p, C_PIOVER180*32.0f); + // Build symbologies BuildNTDS(); Build2525(); + CreateFadedSymbols(); } *************** *** 2325,2332 **** ! void tcTacticalMapView::UpdateNavPoints(vector<tcPoint> *mpPoints) { maNavPointGeo.clear(); int n = (int)mpPoints->size(); ! for (int i=0;i<n;i++) { maNavPointGeo.push_back(mpPoints->at(i)); } --- 2401,2410 ---- ! void tcTacticalMapView::UpdateNavPoints(vector<GeoPoint> *mpPoints) ! { maNavPointGeo.clear(); int n = (int)mpPoints->size(); ! for (int i=0;i<n;i++) ! { maNavPointGeo.push_back(mpPoints->at(i)); } *************** *** 2334,2343 **** } ! void tcTacticalMapView::UpdateScreenNavPoints(void) { maNavPointScreen.clear(); int n = (int)maNavPointGeo.size(); ! for (int i=0;i<n;i++) { ! tcPoint p = maNavPointGeo[i]; ! p = GeoToScreen(p); maNavPointScreen.push_back(p); } --- 2412,2423 ---- } ! void tcTacticalMapView::UpdateScreenNavPoints(void) ! { maNavPointScreen.clear(); int n = (int)maNavPointGeo.size(); ! for (int i=0;i<n;i++) ! { ! tcPoint p = GeoToScreen(maNavPointGeo[i].mfLon_rad, ! maNavPointGeo[i].mfLat_rad); maNavPointScreen.push_back(p); } Index: tcGameView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcGameView.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcGameView.cpp 20 Feb 2005 18:20:19 -0000 1.4 --- tcGameView.cpp 2 Mar 2005 22:28:43 -0000 1.5 *************** *** 38,41 **** --- 38,42 ---- #include "tcMissileObject.h" #include "ai/Brain.h" + #include "ai/Nav.h" #ifdef _DEBUG *************** *** 131,150 **** } ! void tcGameView::UpdateNavPoints(void) { ! vector<tcPoint> navpoints; ! tcPlatformObject *pPlatformObj = dynamic_cast<tcPlatformObject*>(mpHookedObj); ! if (pPlatformObj == NULL) ! { ! navpoints.clear(); ! } ! else { ! tcPoint pcurrent; ! pcurrent.x = (float)pPlatformObj->mcKin.mfLon_rad; ! pcurrent.y = (float)pPlatformObj->mcKin.mfLat_rad; ! navpoints.push_back(pcurrent); // add current position ! pPlatformObj->mcAI.GetNavPoints(&navpoints); } mpMapView->UpdateNavPoints(&navpoints); } --- 132,162 ---- } ! void tcGameView::UpdateNavPoints() { ! vector<GeoPoint> navpoints; ! ! if (tcPlatformObject *platformObj = dynamic_cast<tcPlatformObject*>(mpHookedObj)) { ! if (ai::Nav* nav = platformObj->GetBrain()->GetNavTask()) ! { ! const vector<GeoPoint>& waypoints = nav->GetWaypoints(); ! // use current position as first point ! if (waypoints.size()) ! { ! GeoPoint pcurrent; ! pcurrent.mfLon_rad = (float)platformObj->mcKin.mfLon_rad; ! pcurrent.mfLat_rad = (float)platformObj->mcKin.mfLat_rad; ! pcurrent.mfAlt_m = platformObj->mcKin.mfAlt_m; ! navpoints.push_back(pcurrent); // add current position ! } ! // copy waypoints ! for (size_t k=0; k<waypoints.size(); k++) ! { ! navpoints.push_back(waypoints[k]); ! } ! } ! } + mpMapView->UpdateNavPoints(&navpoints); } *************** *** 693,696 **** --- 705,711 ---- mpMapView->maMapObj[rnIndex].mnID = track.mnID; mpMapView->maMapObj[rnIndex].mnColor = 0; + mpMapView->maMapObj[rnIndex].isStaleTrack = pSMTrack->IsStale(); + mpMapView->maMapObj[rnIndex].isDestroyed = pSMTrack->IsDestroyed(); + tcPoint point(track.mfLon_rad, track.mfLat_rad); Index: tc3DWindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DWindow.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tc3DWindow.cpp 21 Feb 2005 18:26:12 -0000 1.15 --- tc3DWindow.cpp 2 Mar 2005 22:28:42 -0000 1.16 *************** *** 406,410 **** for(size_t n=0;n<nChildren;n++) { ! // children[n]->SetActive(abActive); //children[n]->SetBaseRenderBin(baseRenderBin + 30); } --- 406,410 ---- for(size_t n=0;n<nChildren;n++) { ! children[n]->SetActive(abActive); //children[n]->SetBaseRenderBin(baseRenderBin + 30); } |