[Gcblue-commits] gcb_wx/src/graphics tcCreditView.cpp,1.13,1.14 tcGameView.cpp,1.8,1.9 tcMapView.cpp
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2005-05-06 23:58:02
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11225/src/graphics Modified Files: tcCreditView.cpp tcGameView.cpp tcMapView.cpp tcMessageCenter.cpp tcMessageInterface.cpp Log Message: added player name to connection status, update rates are slower for non-controlled objects, non-controlled objects now display as green, added chat text popup Index: tcMessageCenter.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMessageCenter.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcMessageCenter.cpp 29 Mar 2005 00:12:26 -0000 1.6 --- tcMessageCenter.cpp 6 May 2005 23:57:50 -0000 1.7 *************** *** 133,136 **** --- 133,141 ---- } + bool tcMessageCenter::GetPopupChatText() const + { + return popupChatText; + } + /** * *************** *** 203,206 **** --- 208,225 ---- + void tcMessageCenter::PostChatText(const std::string& msg) + { + if (popupChatText) + { + PopupMessage(msg); + } + } + + + void tcMessageCenter::SetPopupChatText(bool state) + { + popupChatText = state; + } + /** *************** *** 213,217 **** popupBase(205, 70), popupCount(0), ! console(0) { channelTab.Set(10, 140, 10, 30); --- 232,237 ---- popupBase(205, 70), popupCount(0), ! console(0), ! popupChatText(false) { channelTab.Set(10, 140, 10, 30); Index: tcCreditView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcCreditView.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcCreditView.cpp 29 Mar 2005 00:12:26 -0000 1.13 --- tcCreditView.cpp 6 May 2005 23:57:50 -0000 1.14 *************** *** 77,84 **** --- 77,89 ---- AddCredit(s, 60.0f, 1); + + s = "--- Test ---"; AddCredit(s, 25.0f, 1); s = "Dust"; + AddCredit(s, 25.0f, 1); + + s = "Havoc"; AddCredit(s, 125.0f, 1); Index: tcMessageInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMessageInterface.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcMessageInterface.cpp 29 Mar 2005 00:12:26 -0000 1.3 --- tcMessageInterface.cpp 6 May 2005 23:57:50 -0000 1.4 *************** *** 72,75 **** --- 72,89 ---- } + void tcMessageInterface::PostChatText(const std::string& msg) + { + wxASSERT(messageCenter); + + messageCenter->PostChatText(msg); + } + + void tcMessageInterface::SetPopupChatText(bool state) + { + wxASSERT(messageCenter); + + messageCenter->SetPopupChatText(state); + } + /** * Must be called before using DisplayChannelMessage Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapView.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** tcMapView.cpp 29 Apr 2005 18:52:53 -0000 1.24 --- tcMapView.cpp 6 May 2005 23:57:50 -0000 1.25 *************** *** 1618,1622 **** * Call after tables are built. */ ! void tcTacticalMapView::CreateFadedSymbols() { for (int nAffiliation=0; nAffiliation<4; nAffiliation++) --- 1618,1622 ---- * Call after tables are built. */ ! void tcTacticalMapView::CreateAlternateSymbols() { for (int nAffiliation=0; nAffiliation<4; nAffiliation++) *************** *** 1633,1636 **** --- 1633,1637 ---- maSymbolA_fade[nAffiliation][nSymbol] = fadedA; + } { *************** *** 1643,1646 **** --- 1644,1667 ---- maSymbolB_fade[nAffiliation][nSymbol] = fadedB; } + { + osg::Geometry* altA = new osg::Geometry(*maSymbolA[nAffiliation][nSymbol]); + + osg::Vec4Array* colors = new osg::Vec4Array; + colors->push_back(osg::Vec4(0.5, 0.8, 0.5, 1.0)); + altA->setColorArray(colors); + altA->setColorBinding(osg::Geometry::BIND_OVERALL); + + maSymbolA_alt[nAffiliation][nSymbol] = altA; + + } + { + osg::Geometry* altB = new osg::Geometry(*maSymbolB[nAffiliation][nSymbol]); + osg::Vec4Array* colors = new osg::Vec4Array; + colors->push_back(osg::Vec4(0.5, 0.8, 0.5, 1.0)); + altB->setColorArray(colors); + altB->setColorBinding(osg::Geometry::BIND_OVERALL); + + maSymbolB_alt[nAffiliation][nSymbol] = altB; + } } *************** *** 1667,1670 **** --- 1688,1712 ---- } + + /** + * Altered version of symbols for objects not controlled by player in multiplayer mode + * @returns symbol image pointer based on symbology mode + */ + osg::Geometry* tcTacticalMapView::GetSymbolAltered(teAffiliation aeAffiliation, teSymbol aeSymbol) + { + int nAffilIdx = (int)aeAffiliation; + int nSymbolIdx = (int)aeSymbol; + + if (meSymbology == NTDS) + { + return maSymbolA_alt[nAffilIdx][nSymbolIdx].get(); + } + else + { + return maSymbolB_alt[nAffilIdx][nSymbolIdx].get(); + } + } + + /** * Faded version of symbols for stale tracks *************** *** 1850,1858 **** { osg::Geometry* pSymbol = 0; ! if (!pMO->isStaleTrack) { pSymbol = tcTacticalMapView::GetSymbol(pMO->meAffiliation, pMO->meSymbol); } ! else { pSymbol = tcTacticalMapView::GetSymbolFaded(pMO->meAffiliation, pMO->meSymbol); --- 1892,1907 ---- { osg::Geometry* pSymbol = 0; ! if ((!pMO->isStaleTrack) && (!pMO->useAltered)) { pSymbol = tcTacticalMapView::GetSymbol(pMO->meAffiliation, pMO->meSymbol); } ! else if (pMO->useAltered) ! { ! pSymbol = tcTacticalMapView::GetSymbolAltered(pMO->meAffiliation, pMO->meSymbol); ! symbolColor._v[0] *= 0.5; ! symbolColor._v[1] *= 0.8; ! symbolColor._v[2] *= 0.5; ! } ! else { pSymbol = tcTacticalMapView::GetSymbolFaded(pMO->meAffiliation, pMO->meSymbol); *************** *** 2166,2170 **** BuildNTDS(); Build2525(); ! CreateFadedSymbols(); } --- 2215,2219 ---- BuildNTDS(); Build2525(); ! CreateAlternateSymbols(); } Index: tcGameView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcGameView.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcGameView.cpp 29 Apr 2005 18:52:53 -0000 1.8 --- tcGameView.cpp 6 May 2005 23:57:50 -0000 1.9 *************** *** 626,629 **** --- 626,631 ---- mpMapView->maMapObj[rnIndex].isStaleTrack = false; mpMapView->maMapObj[rnIndex].isDestroyed = false; + mpMapView->maMapObj[rnIndex].useAltered = (po->IsClientMode() && !po->IsControlled()); + if ((mpMapView->maMapObj[rnIndex].meSymbol != SYMBOL_FIXED) && *************** *** 714,718 **** mpMapView->maMapObj[rnIndex].isStaleTrack = pSMTrack->IsStale(); mpMapView->maMapObj[rnIndex].isDestroyed = pSMTrack->IsDestroyed(); ! tcPoint point(track.mfLon_rad, track.mfLat_rad); --- 716,720 ---- mpMapView->maMapObj[rnIndex].isStaleTrack = pSMTrack->IsStale(); mpMapView->maMapObj[rnIndex].isDestroyed = pSMTrack->IsDestroyed(); ! mpMapView->maMapObj[rnIndex].useAltered = false; tcPoint point(track.mfLon_rad, track.mfLat_rad); |