[Gcblue-commits] gcb_wx/src/graphics tc3DWindow.cpp,NONE,1.1 ObjectUpdater.cpp,1.8,1.9 tc3DModel.cpp
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-09-14 02:01:56
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14891/src/graphics Modified Files: ObjectUpdater.cpp tc3DModel.cpp tcCreditView.cpp tcGraphicsEngine.cpp tcMapObject.cpp tcPanel.cpp tcPopupControl.cpp tcScenarioSelectView.cpp tcWindow.cpp Added Files: tc3DWindow.cpp Log Message: Index: tcPanel.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcPanel.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcPanel.cpp 5 Sep 2004 01:02:02 -0000 1.1 --- tcPanel.cpp 14 Sep 2004 02:01:46 -0000 1.2 *************** *** 110,114 **** void tcPanel::Clear() { ! int nItems = (int)panelItems.size(); panelItems.clear(); --- 110,114 ---- void tcPanel::Clear() { ! // int nItems = (int)panelItems.size(); panelItems.clear(); Index: tc3DModel.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DModel.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tc3DModel.cpp 6 Sep 2004 01:08:03 -0000 1.13 --- tc3DModel.cpp 14 Sep 2004 02:01:46 -0000 1.14 *************** *** 481,485 **** , 10000.0, 20000.0); ! unsigned nRanges = modelGroup->getNumRanges(); --- 481,485 ---- , 10000.0, 20000.0); ! // unsigned nRanges = modelGroup->getNumRanges(); Index: tcMapObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapObject.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcMapObject.cpp 8 Aug 2004 00:31:34 -0000 1.3 --- tcMapObject.cpp 14 Sep 2004 02:01:46 -0000 1.4 *************** *** 50,58 **** float x = pscreen.x; float y = pscreen.y; ! Pen *pen = mapView->GetPen(); pen->SetColor(color); ! graphics->DrawLine(pen,x-8,y-8,x+8,y+8); ! graphics->DrawLine(pen,x+8,y-8,x-8,y+8); } --- 50,62 ---- float x = pscreen.x; float y = pscreen.y; ! ! Pen* pen = mapView->GetPen(); pen->SetColor(color); ! if (markerEnabled) ! { ! graphics->DrawLine(pen,x-8,y-8,x+8,y+8); ! graphics->DrawLine(pen,x+8,y-8,x-8,y+8); ! } } *************** *** 63,67 **** { wxASSERT(mapView); ! return mapView->GeoToScreen(lon_rad,lat_rad); } --- 67,79 ---- { wxASSERT(mapView); ! if (useRelativeCoords) ! { ! wxRealPoint p = mapView->RelativeToScreen(_x, _y); ! return tcPoint(p.x, p.y); ! } ! else ! { ! return mapView->GeoToScreen(_x, _y); ! } } *************** *** 80,89 **** } ! tcMapObject::tcMapObject(double lon_deg, double lat_deg) { ! lon_rad = lon_deg * C_PIOVER180; ! lat_rad = lat_deg * C_PIOVER180; color = 0xFE64FF64; // green default isActive = true; } --- 92,111 ---- } ! tcMapObject::tcMapObject(double x, double y, bool useRel) ! : useRelativeCoords(useRel) { ! if (useRel) ! { ! _x = x; ! _y = y; ! } ! else ! { ! _x = x * C_PIOVER180; // convert to radian lon/lat ! _y = y * C_PIOVER180; ! } color = 0xFE64FF64; // green default isActive = true; + markerEnabled = true; } *************** *** 112,117 **** x+5.0f, y); ! graphics->DrawLine(pen,x-8,y-8,x+8,y+8); ! graphics->DrawLine(pen,x+8,y-8,x-8,y+8); } --- 134,142 ---- x+5.0f, y); ! if (markerEnabled) // avoids parent draw overhead this way ! { ! graphics->DrawLine(pen,x-8,y-8,x+8,y+8); ! graphics->DrawLine(pen,x+8,y-8,x-8,y+8); ! } } *************** *** 122,127 **** } ! tcMapTextObject::tcMapTextObject(std::string text, double lon_deg, double lat_deg) ! : tcMapObject(lon_deg, lat_deg), caption(text) { --- 147,152 ---- } ! tcMapTextObject::tcMapTextObject(std::string text, double x, double y, bool useRel) ! : tcMapObject(x, y, useRel), caption(text) { Index: tcCreditView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcCreditView.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcCreditView.cpp 6 Sep 2004 01:08:03 -0000 1.2 --- tcCreditView.cpp 14 Sep 2004 02:01:46 -0000 1.3 *************** *** 68,72 **** AddCredit(s, 60.0f, 0); ! AddCredit(tcString("Other contributors"), 23.0f, 1); AddCredit(tcString("Xavi Rubio (Linux)"), 12.0f, 2); AddCredit(tcString(""), 25.0f, 2); --- 68,73 ---- AddCredit(s, 60.0f, 0); ! AddCredit(tcString("Contributors"), 25.0f, 1); ! AddCredit(tcString("Grahame Flint (Naval research)"), 12.0f, 2); AddCredit(tcString("Xavi Rubio (Linux)"), 12.0f, 2); AddCredit(tcString(""), 25.0f, 2); *************** *** 76,79 **** --- 77,81 ---- AddCredit(tcString("Dust"), 12.0f, 2); + AddCredit(tcString("Harpy"), 12.0f, 2); AddCredit(tcString("Marcelo C\341ceres"), 12.0f, 2); AddCredit(tcString(""), 60.0f, 2); Index: tcScenarioSelectView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcScenarioSelectView.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcScenarioSelectView.cpp 6 Sep 2004 01:08:03 -0000 1.2 --- tcScenarioSelectView.cpp 14 Sep 2004 02:01:46 -0000 1.3 *************** *** 67,71 **** wxString scenarioDir(SCENARIO_PATH); ! size_t scenarioDirLength = scenarioDir.size(); int findIdx = filename.find(scenarioDir); --- 67,71 ---- wxString scenarioDir(SCENARIO_PATH); ! // size_t scenarioDirLength = scenarioDir.size(); int findIdx = filename.find(scenarioDir); *************** *** 206,210 **** totalPath += filePath; ! mpSimState->mpPythonInterface->LoadScenario(totalPath.c_str(), filePath.c_str()); if (mpSimState->msScenarioInfo.mbLoaded) --- 206,217 ---- totalPath += filePath; ! if (!wxString(caption.c_str()).Contains("Random")) ! { ! mpSimState->mpPythonInterface->LoadScenario(totalPath.c_str(), filePath.c_str()); ! } ! else ! { ! mpSimState->RandInit(); ! } if (mpSimState->msScenarioInfo.mbLoaded) Index: tcPopupControl.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcPopupControl.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcPopupControl.cpp 5 Sep 2004 01:02:02 -0000 1.1 --- tcPopupControl.cpp 14 Sep 2004 02:01:46 -0000 1.2 *************** *** 207,211 **** void tcPopupControl::OnLButtonDown(wxMouseEvent& event) { ! int builtInCommand; std::string pythonCommand; std::string uiCommand; --- 207,211 ---- void tcPopupControl::OnLButtonDown(wxMouseEvent& event) { ! int builtInCommand = -1; std::string pythonCommand; std::string uiCommand; Index: tcGraphicsEngine.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcGraphicsEngine.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** tcGraphicsEngine.cpp 8 Aug 2004 00:31:34 -0000 1.17 --- tcGraphicsEngine.cpp 14 Sep 2004 02:01:46 -0000 1.18 *************** *** 39,42 **** --- 39,43 ---- #include "wx/dcscreen.h" #include "tcDisplayModes.h" + #include <osg/MatrixTransform> #if _MSC_VER > 1000 *************** *** 155,158 **** --- 156,160 ---- } + /** * @return string with driver name and version *************** *** 731,734 **** --- 733,738 ---- } + + void tcGraphicsEngine::CheckGLError() { *************** *** 768,773 **** bool hw_accel =(!(flags & PFD_GENERIC_FORMAT) && !(flags & PFD_GENERIC_ACCELERATED)); bool supportsGL = (flags & PFD_SUPPORT_OPENGL) != 0; ! bool doubleBuffer = (flags & PFD_DOUBLEBUFFER) != 0; ! int nAlpha = pfd.cAlphaBits; if (hw_accel && supportsGL) return true; --- 772,777 ---- bool hw_accel =(!(flags & PFD_GENERIC_FORMAT) && !(flags & PFD_GENERIC_ACCELERATED)); bool supportsGL = (flags & PFD_SUPPORT_OPENGL) != 0; ! // bool doubleBuffer = (flags & PFD_DOUBLEBUFFER) != 0; ! // int nAlpha = pfd.cAlphaBits; if (hw_accel && supportsGL) return true; *************** *** 800,804 **** bool hw_accel =(!(flags & PFD_GENERIC_FORMAT) && !(flags & PFD_GENERIC_ACCELERATED)); bool supportsGL = (flags & PFD_SUPPORT_OPENGL) != 0; ! bool doubleBuffer = (flags & PFD_DOUBLEBUFFER) != 0; int nAlpha = pfd.cAlphaBits; --- 804,808 ---- bool hw_accel =(!(flags & PFD_GENERIC_FORMAT) && !(flags & PFD_GENERIC_ACCELERATED)); bool supportsGL = (flags & PFD_SUPPORT_OPENGL) != 0; ! // bool doubleBuffer = (flags & PFD_DOUBLEBUFFER) != 0; int nAlpha = pfd.cAlphaBits; Index: ObjectUpdater.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/ObjectUpdater.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ObjectUpdater.cpp 4 Jun 2004 21:39:22 -0000 1.8 --- ObjectUpdater.cpp 14 Sep 2004 02:01:46 -0000 1.9 *************** *** 104,112 **** model->SetDistanceFromCamera(distanceFromCamera); ! if ((distanceFromCamera <= 20)&&(gameObject->parent == 0)) { int xx = 8; } /* if ((abs(x) < 4000)&&(gameObject->parent == 0)) --- 104,113 ---- model->SetDistanceFromCamera(distanceFromCamera); ! /* if ((distanceFromCamera <= 20)&&(gameObject->parent == 0)) { int xx = 8; } + */ /* if ((abs(x) < 4000)&&(gameObject->parent == 0)) --- NEW FILE: tc3DWindow.cpp --- /** ** @file tc3DWindow.cpp: implementation of the tc3DWindow class. */ /* Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA [...1032 lines suppressed...] CreateBackgroundQuad(); LoadBackgroundImage("console_b.jpg"); SetBackgroundDraw(true); LEFT_BASE_LINE = osgText::Text::LEFT_BASE_LINE; CENTER_CENTER = osgText::Text::CENTER_CENTER; } tc3DWindow::~tc3DWindow() { #ifdef _DEBUG fprintf(stdout, "Destroying 3D window %s, %d text obj, %d image quad obj" ", line obj %d\n", wxWindow::GetName().c_str(), textPool.size(), imageQuadPool.size(), linePool.size()); #endif } Index: tcWindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcWindow.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcWindow.cpp 8 Aug 2004 00:31:34 -0000 1.7 --- tcWindow.cpp 14 Sep 2004 02:01:46 -0000 1.8 *************** *** 225,228 **** --- 225,241 ---- } + /** + * Converts relative coordinates to screen coordinates + */ + wxRealPoint tcWindow::RelativeToScreen(float x, float y) + { + wxRealPoint p; + + p.x = x * float(mnWidth); + p.y = (1-y) * float(mnHeight); + + return p; + } + bool tcWindow::ReleaseDrawDC(HDC hdc) { |