[Gcblue-commits] gcb_wx/src/graphics tc3DModel.cpp, 1.38, 1.39 tc3DViewer.cpp, 1.36, 1.37 tc3DWindo
Status: Alpha
Brought to you by:
ddcforge
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv24958/src/graphics Modified Files: tc3DModel.cpp tc3DViewer.cpp tc3DWindow.cpp tcButton.cpp tcFlightPortGui.cpp tcMapView.cpp tcPlatformGui.cpp Log Message: Index: tcFlightPortGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcFlightPortGui.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcFlightPortGui.cpp 18 Jun 2006 00:45:00 -0000 1.8 --- tcFlightPortGui.cpp 5 Sep 2006 01:04:25 -0000 1.9 *************** *** 400,405 **** wxPoint pos = wxWindow::GetPosition(); wxSize size = wxWindow::GetSize(); tcPlatformGui* gui = new tcPlatformGui(platform->mnID, platformId, wxPoint(pos.x, pos.y + size.GetHeight() + 10), ! "xml/platform_gui_default.xml"); wxASSERT(item); item->SetGui(gui); --- 400,416 ---- wxPoint pos = wxWindow::GetPosition(); wxSize size = wxWindow::GetSize(); + + wxString xmlFile; + if (tcAirObject* air = dynamic_cast<tcAirObject*>(platform)) + { + xmlFile = "xml/platform_gui_air.xml"; + } + else + { + xmlFile = "xml/platform_gui_default.xml"; + } + tcPlatformGui* gui = new tcPlatformGui(platform->mnID, platformId, wxPoint(pos.x, pos.y + size.GetHeight() + 10), ! xmlFile.c_str()); wxASSERT(item); item->SetGui(gui); Index: tc3DModel.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DModel.cpp,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** tc3DModel.cpp 17 Aug 2006 01:28:04 -0000 1.38 --- tc3DModel.cpp 5 Sep 2006 01:04:25 -0000 1.39 *************** *** 615,619 **** { if (modelNode.valid()) return; // model already loaded ! if (tcOptions::Get()->OptionStringExists("Log3DModelDetails")) { std::cout << "Loading 3D model: " << model_name << " \n"; --- 615,622 ---- { if (modelNode.valid()) return; // model already loaded ! ! const bool log3Ddetails = tcOptions::Get()->OptionStringExists("Log3DModelDetails"); ! ! if (log3Ddetails) { std::cout << "Loading 3D model: " << model_name << " \n"; *************** *** 632,639 **** { osgUtil::SmoothingVisitor smoothingVisitor; ! modelNode->accept(smoothingVisitor); } ! fprintf(stdout, "tc3DModel--Loaded 3D model: %s\n", model_name.c_str()); #ifdef _DEBUG --- 635,645 ---- { osgUtil::SmoothingVisitor smoothingVisitor; ! modelNode->accept(smoothingVisitor); } ! if (log3Ddetails) ! { ! fprintf(stdout, "tc3DModel--Loaded 3D model: %s\n", model_name.c_str()); ! } #ifdef _DEBUG *************** *** 644,648 **** #endif - } --- 650,653 ---- Index: tcPlatformGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcPlatformGui.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcPlatformGui.cpp 18 Jun 2006 00:45:00 -0000 1.10 --- tcPlatformGui.cpp 5 Sep 2006 01:04:25 -0000 1.11 *************** *** 49,52 **** --- 49,108 ---- #endif + BEGIN_EVENT_TABLE(tcPlatformGui, tcXmlWindow) + EVT_COMMAND(10, wxEVT_COMMAND_BUTTON_CLICKED, tcPlatformGui::OnLoadoutCommand) + EVT_COMMAND(11, wxEVT_COMMAND_BUTTON_CLICKED, tcPlatformGui::OnLoadoutCommand) + EVT_COMMAND(12, wxEVT_COMMAND_BUTTON_CLICKED, tcPlatformGui::OnLoadoutCommand) + EVT_COMMAND(13, wxEVT_COMMAND_BUTTON_CLICKED, tcPlatformGui::OnLoadoutCommand) + EVT_COMMAND(14, wxEVT_COMMAND_BUTTON_CLICKED, tcPlatformGui::OnLoadoutCommand) + EVT_COMMAND(86, wxEVT_COMMAND_BUTTON_CLICKED, tcContainerGui::OnCloseCommand) + END_EVENT_TABLE() + + + + + void tcPlatformGui::OnLoadoutCommand(wxCommandEvent& event) + { + std::string loadoutType; + switch (event.GetId()) + { + case 10: loadoutType = "Empty"; break; + case 11: loadoutType = "AAW"; break; + case 12: loadoutType = "ASuW"; break; + case 13: loadoutType = "ASW"; break; + case 14: loadoutType = "Strike"; break; + default: loadoutType = "Error"; break; + } + + tcPlatformObject* platform = GetPlatform(); + tcPlatformObject* host = 0; + + if (hostId != -1) + { + host = dynamic_cast<tcPlatformObject*>(tcSimState::Get()->GetObject(hostId)); + } + else + { + host = platform; + } + + wxASSERT(platform != 0); + wxASSERT(host != 0); + + size_t nStores = host->GetMagazineCount(); + for (size_t n=0; n<nStores; n++) + { + tcStores* mag = host->GetMagazine(n); + wxASSERT(mag); + + if (mag->HasStoresForThisObject(platform)) + { + mag->AddAutomationOp(loadoutType, platform); + return; + } + } + + fprintf(stderr, "tcPlatformGui::OnLoadoutCommand -- No compatible magazine found\n"); + } + /** * If slot has tcLauncherContainerItem then update it, otherwise create Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapView.cpp,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** tcMapView.cpp 17 Aug 2006 01:28:04 -0000 1.46 --- tcMapView.cpp 5 Sep 2006 01:04:25 -0000 1.47 *************** *** 1981,1985 **** osg::Geometry* rangeCircle; ! if (pMO->mfArc_deg >= 360.0f) { rangeCircle = CreatePieGeometry(width, height, -180, 180, --- 1981,1985 ---- osg::Geometry* rangeCircle; ! if ((pMO->mfArc_deg >= 360.0f) || (pMO->mfArc_deg <= 0)) { rangeCircle = CreatePieGeometry(width, height, -180, 180, Index: tcButton.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcButton.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** tcButton.cpp 21 Apr 2006 23:29:09 -0000 1.24 --- tcButton.cpp 5 Sep 2006 01:04:25 -0000 1.25 *************** *** 377,382 **** --- 377,384 ---- mouseOverCaptionPosition.x = width / 2; + #ifdef _DEBUG fprintf(stdout,"Created button %s, pos (%d,%d), size: (%d,%d)\n", caption.c_str(), x, y, width, height); + #endif } Index: tc3DWindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DWindow.cpp,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** tc3DWindow.cpp 20 Aug 2006 22:24:02 -0000 1.38 --- tc3DWindow.cpp 5 Sep 2006 01:04:25 -0000 1.39 *************** *** 1928,1932 **** text->setText("UNINTIALIZED"); ! text->setUseDisplayList(true); --- 1928,1932 ---- text->setText("UNINTIALIZED"); ! text->setUseDisplayList(false); Index: tc3DViewer.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DViewer.cpp,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** tc3DViewer.cpp 17 Aug 2006 01:28:04 -0000 1.36 --- tc3DViewer.cpp 5 Sep 2006 01:04:25 -0000 1.37 *************** *** 2213,2217 **** */ #else ! osg::setNotifyLevel(osg::NOTICE); #endif --- 2213,2217 ---- */ #else ! osg::setNotifyLevel(osg::WARN); #endif |