[Gcblue-commits] gcb_wx/src/sim Game.cpp,1.46,1.47 tc3DViewer.cpp,1.23,1.24 tcDirectorEvent.cpp,1.4,
Status: Alpha
Brought to you by:
ddcforge
From: <ddc...@us...> - 2004-01-03 00:45:18
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1:/tmp/cvs-serv548/src/sim Modified Files: Game.cpp tc3DViewer.cpp tcDirectorEvent.cpp tcMapView.cpp Log Message: briefing camera features Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** Game.cpp 31 Dec 2003 00:23:23 -0000 1.46 --- Game.cpp 3 Jan 2004 00:45:13 -0000 1.47 *************** *** 77,80 **** --- 77,81 ---- EVT_COMMAND(ID_SETPAUSE, wxEVT_COMMAND_BUTTON_CLICKED, tcGame::SetPauseMode) EVT_COMMAND(ID_SET3D, wxEVT_COMMAND_BUTTON_CLICKED, tcGame::Set3D) + EVT_COMMAND(ID_SKIPBRIEFING, wxEVT_COMMAND_BUTTON_CLICKED, tcGame::SkipBriefing) END_EVENT_TABLE() *************** *** 120,123 **** --- 121,125 ---- mbSwitchToPlay = false; gameTime = 0; + directorTime = 0; mnBriefingWidth = 350; *************** *** 181,184 **** --- 183,198 ---- } + /** + * Skips to the end of the briefing and starts game + */ + void tcGame::SkipBriefing(wxCommandEvent& event) + { + if (meScreenMode != TACTICALBRIEF) return; // ignore if not in tactical briefing mode + directorTime = 1e10; // set directorTime to large value to skip to end + + // deactivate delayed text so that briefing text is quickly available + briefingConsoleLeft->SetDelayedTextEffect(false); + } + void tcGame::StartGame(wxCommandEvent& event) { *************** *** 271,275 **** r.height = mnHeight; } ! viewer->SetSize(r); } --- 285,289 ---- r.height = mnHeight; } ! viewer->Freeze(); viewer->SetSize(r); } *************** *** 460,465 **** void tcGame::InitializeBriefingConsoles() { ! briefingConsoleLeft = new tcSoundConsole(this, wxPoint(0,0), ! wxSize(mnBriefingWidth,mnHeight-mnBottomMargin)); if (!briefingConsoleLeft) { --- 474,480 ---- void tcGame::InitializeBriefingConsoles() { ! int leftConsoleHeight = mnHeight-mnBottomMargin; ! briefingConsoleLeft = new tcButtonConsole(this, wxPoint(0,0), ! wxSize(mnBriefingWidth,leftConsoleHeight)); if (!briefingConsoleLeft) { *************** *** 482,485 **** --- 497,502 ---- briefingConsoleLeft->LoadBackgroundImage("briefing_left.jpg"); briefingConsoleLeft->Print(" "); // need this to get it to display + // add buttons + briefingConsoleLeft->AddButton(wxRect(10,leftConsoleHeight-20,50,10), ID_SKIPBRIEFING, "SKIP"); briefingConsoleBottom = new tcSoundConsole(this, wxPoint(0,mnHeight-mnBottomMargin), *************** *** 916,920 **** if (mapSize == tacticalMapSize) return; int w = (mapSize == TM_MEDIUM) ? mnBriefingWidth : mnLeftMargin; ! tacticalMap->SetSize(wxRect(w,0,mnWidth-w,mnHeight-mnBottomMargin)); tacticalMapSize = mapSize; --- 933,938 ---- if (mapSize == tacticalMapSize) return; int w = (mapSize == TM_MEDIUM) ? mnBriefingWidth : mnLeftMargin; ! ! tacticalMap->Freeze(); // call Freeze() to prevent flicker on resize tacticalMap->SetSize(wxRect(w,0,mnWidth-w,mnHeight-mnBottomMargin)); tacticalMapSize = mapSize; *************** *** 1126,1130 **** const float dateZuluScale = 1.0f; // for testing sky effects static std::string dateTimeString = "---"; - static double directorTime = 0; // kind of a hack to keep director going during pause tcTime::Update(); --- 1144,1147 ---- *************** *** 1264,1268 **** wxMessageBox("pre Frame()\n"); } ! viewer->Frame(); --- 1281,1285 ---- wxMessageBox("pre Frame()\n"); } ! viewer->Frame(); *************** *** 1464,1469 **** { meScreenMode = TACTICALBRIEF; ! briefingConsoleLeft->Print("BRIEFING INIT via key 1234567890123456789012345678901234567890"); ! briefingConsoleBottom->Print(" "); } else if (meScreenMode == TACTICALBRIEF) --- 1481,1486 ---- { meScreenMode = TACTICALBRIEF; ! // briefingConsoleLeft->Print("BRIEFING VIEW via F5"); ! // briefingConsoleBottom->Print(" "); } else if (meScreenMode == TACTICALBRIEF) Index: tc3DViewer.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tc3DViewer.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** tc3DViewer.cpp 1 Jan 2004 23:44:47 -0000 1.23 --- tc3DViewer.cpp 3 Jan 2004 00:45:13 -0000 1.24 *************** *** 447,450 **** --- 447,455 ---- void tc3DViewer::Frame() { + if (isFrozen) + { + wxWindow::Thaw(); + isFrozen = false; + } if (isActive && camera_group.valid()) // if (isActive && camera_group) *************** *** 460,463 **** --- 465,480 ---- /** + * Override of wxWindow::Freeze. + * Call before size event to prevent flicker. + * viewer is thawed automatically in Frame() method + */ + void tc3DViewer::Freeze() + { + if (isFrozen) return; // already frozen, return + isFrozen = true; + wxWindow::Freeze(); + } + + /** * Loads OSG model for object, setting obj->model field. */ *************** *** 872,875 **** --- 889,893 ---- isMouseDown = false; isActive = true; + isFrozen = false; viewWireframe = false; useRelativeChildPos = true; Index: tcDirectorEvent.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcDirectorEvent.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcDirectorEvent.cpp 1 Jan 2004 23:44:47 -0000 1.4 --- tcDirectorEvent.cpp 3 Jan 2004 00:45:13 -0000 1.5 *************** *** 432,441 **** if (viewerText->getNumParents() == 0) { - wxSize viewerSize = viewer->GetSize(); - float x = textx * (float)viewerSize.GetWidth(); - float y = texty * (float)viewerSize.GetHeight(); - viewerText->setPosition(osg::Vec3(x,y,0.0f)); viewer->AddText(viewerText.get()); } if (effectCode == 1) // alpha blend { --- 432,443 ---- if (viewerText->getNumParents() == 0) { viewer->AddText(viewerText.get()); } + + wxSize viewerSize = viewer->GetSize(); + float x = textx * (float)viewerSize.GetWidth(); + float y = texty * (float)viewerSize.GetHeight(); + viewerText->setPosition(osg::Vec3(x,y,0.0f)); + if (effectCode == 1) // alpha blend { Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMapView.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcMapView.cpp 22 Dec 2003 02:32:37 -0000 1.12 --- tcMapView.cpp 3 Jan 2004 00:45:13 -0000 1.13 *************** *** 101,104 **** --- 101,115 ---- // if(mpDDS_Terrain!=NULL) mpMapData->UpdateSurface(mpDDS_Terrain,mrectCurrentView); } + /** + * Works with Thaw to prevent flicker on resize + * @see tcMapView::Thaw + * @see tcWindow::Thaw + */ + void tcMapView::Freeze() + { + tcWindow::Freeze(); + terrainView->Freeze(); + } + /***********************************************************************************/ tcPoint tcMapView::GeoToScreen(tcPoint pgeo) { *************** *** 135,138 **** --- 146,158 ---- /** + * Works with Freeze to prevent flicker on resize + */ + void tcMapView::Thaw() + { + tcWindow::Thaw(); + terrainView->Thaw(); + } + + /** * Call OnSize for base class and for terrainView */ *************** *** 464,467 **** --- 484,489 ---- Graphics *pGraphics; int i; + + tcMapView::Thaw(); // unfreeze every Draw() call, works with Freeze() to stop resize flicker if (mnScrollState >= SCROLL_DELAY) { |