gcblue-commits Mailing List for Global Conflict Blue (Page 14)
Status: Alpha
Brought to you by:
ddcforge
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(112) |
Feb
(106) |
Mar
(88) |
Apr
(111) |
May
(53) |
Jun
(60) |
Jul
(58) |
Aug
(61) |
Sep
(45) |
Oct
(31) |
Nov
(71) |
Dec
(70) |
| 2005 |
Jan
(33) |
Feb
(57) |
Mar
(98) |
Apr
(47) |
May
(53) |
Jun
(79) |
Jul
(79) |
Aug
|
Sep
(33) |
Oct
(1) |
Nov
(20) |
Dec
(64) |
| 2006 |
Jan
(20) |
Feb
(1) |
Mar
(43) |
Apr
(11) |
May
(8) |
Jun
(23) |
Jul
|
Aug
(28) |
Sep
(58) |
Oct
(25) |
Nov
(47) |
Dec
(70) |
|
From: Dewitt C. <ddc...@us...> - 2006-01-05 03:47:29
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30927/include/graphics Modified Files: tc3DWindow.h tcMapView.h Log Message: db fixes, GUI tweaks, random sensor detections Index: tc3DWindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DWindow.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** tc3DWindow.h 2 Jan 2006 15:40:52 -0000 1.22 --- tc3DWindow.h 5 Jan 2006 03:47:22 -0000 1.23 *************** *** 192,195 **** --- 192,197 ---- int GetBaseRenderBin() const; virtual void SetBaseRenderBin(int n); + float GetCornerRadius() const; + void SetCornerRadius(float r); void SetName(const char* s); void SetOpaque(); *************** *** 237,241 **** float fontSizeLarge; ///< default large font size float fontSizeSmall; ///< default small font size ! osg::ref_ptr<osgText::Font> defaultFont; --- 239,243 ---- float fontSizeLarge; ///< default large font size float fontSizeSmall; ///< default small font size ! float cornerRadius; ///< radius of window corners, use 0 for square corners osg::ref_ptr<osgText::Font> defaultFont; *************** *** 315,321 **** ! void CreateBackgroundQuad(); ! void CreateBackgroundShape(); ! void UpdateBackgroundQuadVertices(); void UpdateBackgroundShape(); --- 317,321 ---- ! void UpdateBackgroundQuad(); void UpdateBackgroundShape(); Index: tcMapView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMapView.h,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** tcMapView.h 2 Jan 2006 15:40:52 -0000 1.26 --- tcMapView.h 5 Jan 2006 03:47:22 -0000 1.27 *************** *** 280,283 **** --- 280,284 ---- void SetView(tcPoint center, float afLonSpan); void ScrollMap(float afDirection_deg); + void CancelScroll(); void ClearMapCmd() {meMapCmd = MC_NONE;} void ClearHook(); *************** *** 324,327 **** --- 325,329 ---- void SetTextLeftMargin(float x); void ToggleShowTrackTags() {mbShowTrackID = !mbShowTrackID;} + void UpdateEdgeScroll(const wxPoint& pos); void UpdateViewBounds() {mpMapData->GetTheaterArea(mrectViewBounds);} |
|
From: Dewitt C. <ddc...@us...> - 2006-01-05 03:47:29
|
Update of /cvsroot/gcblue/gcb_wx/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30927/docs Modified Files: CHANGES.txt Log Message: db fixes, GUI tweaks, random sensor detections Index: CHANGES.txt =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/docs/CHANGES.txt,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** CHANGES.txt 26 Dec 2005 22:14:03 -0000 1.49 --- CHANGES.txt 5 Jan 2006 03:47:22 -0000 1.50 *************** *** 4,7 **** --- 4,15 ---- 0.8.1 --------------------------------------------------------------------- + *** 2006-01-04 DDC *** + - Added feature to allow windows to have rounded corners. Only works for + textured backgrounds currently. + - Improved edge scroll a little for tactical map. Should scroll now if mouse is + moved to any edge of the screen + - Added some randomness to sensor detections. Pd is now 0.5 at nominal range and + varies from 0 to 1 over about +/-15% range + *** 2005-12-26 DDC *** - Fixed launcher bug where reloads would not complete correctly. |
|
From: Dewitt C. <ddc...@us...> - 2006-01-05 03:47:29
|
Update of /cvsroot/gcblue/gcb_wx/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30927/database Modified Files: database.db Log Message: db fixes, GUI tweaks, random sensor detections Index: database.db =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/database/database.db,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 Binary files /tmp/cvsWsNXcl and /tmp/cvsNpShrm differ |
|
From: Dewitt C. <ddc...@us...> - 2006-01-02 15:41:07
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21272/src/common Modified Files: tcSoundConsole.cpp Log Message: Game windows use common window as parent Index: tcSoundConsole.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/tcSoundConsole.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcSoundConsole.cpp 10 Sep 2005 21:47:38 -0000 1.13 --- tcSoundConsole.cpp 2 Jan 2006 15:40:52 -0000 1.14 *************** *** 110,115 **** const wxPoint& pos, const wxSize& size, const wxString& configFile, ! const wxString& name) : ! tcXmlWindow(parent, pos, size, configFile, name), soundEffect("consolebeep"), lastEffect(0) --- 110,116 ---- const wxPoint& pos, const wxSize& size, const wxString& configFile, ! const wxString& name, ! tc3DWindow* graphicsHost) : ! tcXmlWindow(parent, pos, size, configFile, name, graphicsHost), soundEffect("consolebeep"), lastEffect(0) |
|
From: Dewitt C. <ddc...@us...> - 2006-01-02 15:41:06
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21272/include/sim Modified Files: Game.h tcObjectControl.h Log Message: Game windows use common window as parent Index: tcObjectControl.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcObjectControl.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** tcObjectControl.h 7 Jul 2005 01:13:23 -0000 1.19 --- tcObjectControl.h 2 Jan 2006 15:40:52 -0000 1.20 *************** *** 176,180 **** tcObjectControl(wxWindow *parent, const wxPoint& pos, const wxSize& size, ! const wxString& name = "ObjectControl"); virtual ~tcObjectControl(); private: --- 176,181 ---- tcObjectControl(wxWindow *parent, const wxPoint& pos, const wxSize& size, ! const wxString& name = "ObjectControl", ! tc3DWindow* graphicsHost = 0); virtual ~tcObjectControl(); private: Index: Game.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/Game.h,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** Game.h 12 Dec 2005 02:37:01 -0000 1.63 --- Game.h 2 Jan 2006 15:40:52 -0000 1.64 *************** *** 153,157 **** int mnLeftMargin; // width of left auxiliary windows int mnBottomMargin; // height of bottom aux windows ! wxGLCanvas* glCanvas; tcSoundConsole* infoConsole; ///< console object for info messages tcSoundConsole* briefingConsoleLeft; ///< console object for briefing text --- 153,158 ---- int mnLeftMargin; // width of left auxiliary windows int mnBottomMargin; // height of bottom aux windows ! wxGLCanvas* glCanvas; ! tc3DWindow* gameWindow; ///< main window for game windows (refactor this) tcSoundConsole* infoConsole; ///< console object for info messages tcSoundConsole* briefingConsoleLeft; ///< console object for briefing text *************** *** 300,303 **** --- 301,305 ---- void InitializeDirector(); void InitializeDisplaySettingsView(); + void InitializeGameWindow(); void InitializeMessageCenter(); void InitializeNetworkView(); |
|
From: Dewitt C. <ddc...@us...> - 2006-01-02 15:41:05
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21272/include/common Modified Files: tcSoundConsole.h Log Message: Game windows use common window as parent Index: tcSoundConsole.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/tcSoundConsole.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcSoundConsole.h 27 Jan 2005 01:01:43 -0000 1.12 --- tcSoundConsole.h 2 Jan 2006 15:40:52 -0000 1.13 *************** *** 49,53 **** const wxPoint& pos, const wxSize& size, const wxString& configFile, ! const wxString& name = "SoundConsole"); virtual ~tcSoundConsole(); private: --- 49,54 ---- const wxPoint& pos, const wxSize& size, const wxString& configFile, ! const wxString& name = "SoundConsole", ! tc3DWindow* graphicsHost = 0); virtual ~tcSoundConsole(); private: |
|
From: Dewitt C. <ddc...@us...> - 2006-01-02 15:41:05
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21272/src/graphics Modified Files: tc3DWindow.cpp tcContainerGui.cpp tcHookInfo.cpp tcMapView.cpp tcOOBView.cpp Log Message: Game windows use common window as parent Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapView.cpp,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** tcMapView.cpp 24 Dec 2005 07:41:20 -0000 1.41 --- tcMapView.cpp 2 Jan 2006 15:40:53 -0000 1.42 *************** *** 325,330 **** tcMapView::tcMapView(wxWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& name) : ! tc3DWindow(parent, pos, size, name, 0), terrainView(NULL) { --- 325,331 ---- tcMapView::tcMapView(wxWindow *parent, const wxPoint& pos, const wxSize& size, + tc3DWindow* graphicsHost, const wxString& name) : ! tc3DWindow(parent, pos, size, name, graphicsHost), terrainView(NULL) { *************** *** 2642,2648 **** tcTacticalMapView::tcTacticalMapView(wxWindow *parent, ! const wxPoint& pos, const wxSize& size, const wxString& name) : ! tcMapView(parent, pos, size, name), scrollActive(false), lastScrollTime(0), --- 2643,2650 ---- tcTacticalMapView::tcTacticalMapView(wxWindow *parent, ! const wxPoint& pos, const wxSize& size, ! tc3DWindow* graphicsHost, const wxString& name) : ! tcMapView(parent, pos, size, graphicsHost, name), scrollActive(false), lastScrollTime(0), *************** *** 2992,2997 **** tcWorldMapView::tcWorldMapView(wxWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& name) : ! tcMapView(parent, pos, size, name) { terrainView = new tcTerrainView(parent, pos, size, false); --- 2994,3000 ---- tcWorldMapView::tcWorldMapView(wxWindow *parent, const wxPoint& pos, const wxSize& size, + tc3DWindow* graphicsHost, const wxString& name) : ! tcMapView(parent, pos, size, graphicsHost, name) { terrainView = new tcTerrainView(parent, pos, size, false); Index: tcHookInfo.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcHookInfo.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tcHookInfo.cpp 18 Dec 2005 04:10:33 -0000 1.16 --- tcHookInfo.cpp 2 Jan 2006 15:40:53 -0000 1.17 *************** *** 666,680 **** tcHookInfo::tcHookInfo(wxWindow *parent, const wxPoint& pos, const wxSize& size, ! const wxString& name) : ! tc3DWindow(parent, pos, size, name) { ! mnHookID = NULL_INDEX; ! mpSS = NULL; ! mpOptions = NULL; ! database = tcDatabase::Get(); ! mpUserInfo = NULL; ! drawEngagedMode = 1; ! ambiguityIdx = 0; ! lastCycleCount = 0; } /***********************************************************************************/ --- 666,682 ---- tcHookInfo::tcHookInfo(wxWindow *parent, const wxPoint& pos, const wxSize& size, ! const wxString& name, ! tc3DWindow* graphicsHost) : ! tc3DWindow(parent, pos, size, name, graphicsHost), ! mnHookID(NULL_INDEX), ! mpSS(0), ! mpOptions(0), ! database(tcDatabase::Get()), ! mpUserInfo(0), ! drawEngagedMode(1), ! ambiguityIdx(0), ! lastCycleCount(0) { ! } /***********************************************************************************/ Index: tcContainerGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcContainerGui.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcContainerGui.cpp 26 Dec 2005 22:14:03 -0000 1.6 --- tcContainerGui.cpp 2 Jan 2006 15:40:53 -0000 1.7 *************** *** 2,7 **** ** @file tcContainerGui.cpp */ ! /* ! ** Copyright (C) 2005 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 2,6 ---- ** @file tcContainerGui.cpp */ ! /* Copyright (C) 2005 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 120,124 **** tc3DWindow* tcContainerGui::parent = 0; ! int tcContainerGui::windowLayer = 2; std::list<tcContainerGui*> tcContainerGui::openContainers; --- 119,123 ---- tc3DWindow* tcContainerGui::parent = 0; ! int tcContainerGui::windowLayer = 4; std::list<tcContainerGui*> tcContainerGui::openContainers; *************** *** 266,270 **** isLButtonDown = true; ! if ((point.y <= 15) || (point.y >= mnHeight)) { windowDragOn = true; --- 265,269 ---- isLButtonDown = true; ! if ((point.y <= 20) || (point.y >= mnHeight)) { windowDragOn = true; Index: tcOOBView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcOOBView.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcOOBView.cpp 14 Jul 2005 23:42:22 -0000 1.10 --- tcOOBView.cpp 2 Jan 2006 15:40:53 -0000 1.11 *************** *** 801,815 **** tcOOBView::tcOOBView(wxWindow *parent, const wxPoint& pos, const wxSize& size, ! const wxString& name) : ! tcXmlWindow(parent, pos, size, "xml/oobview.xml", name), ! mpMapView(0), ! mnAlliance(0), ! mnSelectedKey(NULL_INDEX), ! mbMouseDrag(false), ! mfRowSpacing(12.0f), ! mfYOffset(40.0f), ! mfXOffset(5.0f), ! mfXIndent(15.0f), ! displayMode(SHOW_OWN) { mpSimState = tcSimState::Get(); --- 801,816 ---- tcOOBView::tcOOBView(wxWindow *parent, const wxPoint& pos, const wxSize& size, ! const wxString& name, ! tc3DWindow* graphicsHost) : ! tcXmlWindow(parent, pos, size, "xml/oobview.xml", name, graphicsHost), ! mpMapView(0), ! mnAlliance(0), ! mnSelectedKey(NULL_INDEX), ! mbMouseDrag(false), ! mfRowSpacing(12.0f), ! mfYOffset(40.0f), ! mfXOffset(5.0f), ! mfXIndent(15.0f), ! displayMode(SHOW_OWN) { mpSimState = tcSimState::Get(); Index: tc3DWindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DWindow.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** tc3DWindow.cpp 26 Dec 2005 22:14:03 -0000 1.30 --- tc3DWindow.cpp 2 Jan 2006 15:40:53 -0000 1.31 *************** *** 325,328 **** --- 325,331 ---- void tc3DWindow::UpdateBackgroundQuadVertices() { + //UpdateBackgroundShape(); + //return; + wxASSERT(backgroundQuad.valid()); *************** *** 341,344 **** --- 344,350 ---- void tc3DWindow::CreateBackgroundQuad() { + //CreateBackgroundShape(); + //return; + wxASSERT(!backgroundQuad.valid()); *************** *** 385,388 **** --- 391,497 ---- + /** + * Version to create rounded background quads + */ + void tc3DWindow::CreateBackgroundShape() + { + //wxASSERT(!backgroundQuad.valid()); + + backgroundQuad = new osg::Geometry; + + + + osg::Vec3Array* vertices = new osg::Vec3Array; + osg::Vec2Array* texcoords = new osg::Vec2Array; + + float xc = 0.5; // normalized coords (0-1) + float yc = 0.5; + float rx = 0.5; + float ry = 0.5; + float xp = xc; + float yp = yc + ry; + float width = float(mnWidth); + float height = float(mnHeight); + + int nAngles = 32; + float dangle = C_TWOPI / float(nAngles); + float angle = dangle; + for (int k=0; k<nAngles; k++) + { + float x = xc + rx * sinf(angle); + float y = yc + ry * cosf(angle); + + vertices->push_back(osg::Vec3(width*xc, height*yc, 0)); + texcoords->push_back(osg::Vec2(xc, yc)); + + vertices->push_back(osg::Vec3(width*x, height*y, 0)); + texcoords->push_back(osg::Vec2(x, y)); + + vertices->push_back(osg::Vec3(width*xp, height*yp, 0)); + texcoords->push_back(osg::Vec2(xp, yp)); + + + + xp = x; + yp = y; + angle += dangle; + } + + + backgroundQuad->setVertexArray(vertices); + backgroundQuad->dirtyDisplayList(); + + backgroundQuad->setTexCoordArray(0,texcoords); + + osg::Vec4Array* colors = new osg::Vec4Array; + colors->push_back(osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f)); + backgroundQuad->setColorArray(colors); + backgroundQuad->setColorBinding(osg::Geometry::BIND_OVERALL); + + backgroundQuad->addPrimitiveSet(new osg::DrawArrays(GL_TRIANGLES,0,3*nAngles)); + + /* + osg::StateSet* stateSet = backgroundQuad->getOrCreateStateSet(); + stateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF); + stateSet->setMode(GL_DEPTH_WRITEMASK, osg::StateAttribute::OFF); + stateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF); + //stateSet->setMode(GL_BLEND, osg::StateAttribute::OFF); + stateSet->setRenderBinDetails(baseRenderBin + backgroundRenderBin, "RenderBin"); + */ + + /* + osg::Depth* depth = new osg::Depth(osg::Depth::ALWAYS, 1, 1, false); + depth->setWriteMask(0); + stateSet->setAttribute(depth); + */ + } + + /** + * Call after window size change + */ + void tc3DWindow::UpdateBackgroundShape() + { + wxASSERT(backgroundQuad.valid()); + + osg::Vec2Array* texcoords = dynamic_cast<osg::Vec2Array*>(backgroundQuad->getTexCoordArray(0)); + wxASSERT(texcoords != 0); + + osg::Vec3Array* vertices = new osg::Vec3Array(); + + float width = float(mnWidth); + float height = float(mnHeight); + + for (size_t k=0; k<texcoords->size(); k++) + { + osg::Vec2& t = texcoords->at(k); + vertices->push_back(osg::Vec3(width*t.x(), height*t.y(), 0)); + } + + backgroundQuad->setVertexArray(vertices); + backgroundQuad->dirtyDisplayList(); + + } + + /** * @return wxString with IMAGE_PATH prepended to <fileName> *************** *** 660,721 **** void tc3DWindow::Draw() { ! static int counter = 0; ! ! static float x1 = 0.5f * float(mnWidth); ! static float y1 = 0.5f * float(mnHeight); ! ! static float x2 = 0.5f * float(mnWidth); ! static float y2 = 0.5f * float(mnHeight); ! ! static float x3 = 0.5f * float(mnWidth); ! static float y3 = 0.5f * float(mnHeight); ! ! ! ! wxString s = wxString::Format("Test count %d", counter); ! ! // update random positions ! const float a = 1.0f / float(RAND_MAX); ! ! float xbias = -0.001f * (x1 - 0.5 * float(mnWidth)); ! float ybias = -0.001f * (y1 - 0.5 * float(mnHeight)); ! x1 += 4.0f * (a * float(rand()) - 0.5f + xbias); ! y1 += 4.0f * (a * float(rand()) - 0.5f + ybias); ! ! xbias = -0.001f * (x2 - 0.5 * float(mnWidth)); ! ybias = -0.001f * (y2 - 0.5 * float(mnHeight)); ! x2 += 4.0f * (a * float(rand()) - 0.5f + xbias); ! y2 += 4.0f * (a * float(rand()) - 0.5f + ybias); ! ! xbias = -0.001f * (x3 - 0.5 * float(mnWidth)); ! ybias = -0.001f * (y3 - 0.5 * float(mnHeight)); ! x3 += 4.0f * (a * float(rand()) - 0.5f + xbias); ! y3 += 4.0f * (a * float(rand()) - 0.5f + ybias); ! ! ! DrawImage(defaultTexture.get(), x2, y2, 16, 16); ! ! DrawImage(testSymbol.get(), x3, y3, 40, 40); ! ! DrawLine(x2, y2, 50, 50, osg::Vec4(1.0f, 1.0f, 0.2f, 1.0f)); ! ! ! DrawText(s.c_str(), x1, y1, defaultFont.get(), osg::Vec4(1.0, 1.0, 1.0, 1.0), ! 12.0f, CENTER_CENTER); ! ! DrawText("(0,0)", 0, 0, defaultFont.get(), osg::Vec4(1.0, 1.0, 1.0, 1.0), ! 12.0f, CENTER_CENTER); ! ! DrawText("(w-10,h-10)", mnWidth-10, mnHeight-10, defaultFont.get(), ! osg::Vec4(1.0, 1.0, 1.0, 1.0), 12.0f, CENTER_CENTER); ! ! DrawRectangle(x2 + 5, y2 + 5, 10, 30, osg::Vec4(1.0f, 0.2f, 0.2f, 1.0f)); ! ! DrawBorder(); ! ! counter++; ! ! HideUnusedObjects(); } --- 769,775 ---- void tc3DWindow::Draw() { ! DrawChildren(); + FinishDraw(); } *************** *** 733,740 **** for(size_t n=0;n<nChildren;n++) { ! wxASSERT(children[n]); ! //graphics->TranslateTransform(children[n]->mrectWindow.left, children[n]->mrectWindow.top); ! children[n]->Draw(); ! //graphics->TranslateTransform(-children[n]->mrectWindow.left, -children[n]->mrectWindow.top); } } --- 787,795 ---- for(size_t n=0;n<nChildren;n++) { ! tc3DWindow* child = children[n]; ! wxASSERT(child); ! ! if (child->IsActive()) child->Draw(); ! } } *************** *** 2002,2005 **** --- 2057,2062 ---- { + wxASSERT(viewer); + wxWindow::SetBackgroundColour(*wxBLACK); wxWindow::Show(FALSE); *************** *** 2099,2104 **** SetName(name.c_str()); - wxASSERT(viewer); - --- 2156,2159 ---- |
|
From: Dewitt C. <ddc...@us...> - 2006-01-02 15:41:04
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21272/src/sim Modified Files: Game.cpp tcObjectControl.cpp Log Message: Game windows use common window as parent Index: tcObjectControl.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcObjectControl.cpp,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** tcObjectControl.cpp 18 Dec 2005 04:10:33 -0000 1.48 --- tcObjectControl.cpp 2 Jan 2006 15:40:53 -0000 1.49 *************** *** 2038,2043 **** tcObjectControl::tcObjectControl(wxWindow *parent, const wxPoint& pos, const wxSize& size, ! const wxString& name) : ! tc3DWindow(parent, pos, size, name, 0), mnHookID(NULL_INDEX), mnPreviousHookID(NULL_INDEX), --- 2038,2044 ---- tcObjectControl::tcObjectControl(wxWindow *parent, const wxPoint& pos, const wxSize& size, ! const wxString& name, ! tc3DWindow* graphicsHost) : ! tc3DWindow(parent, pos, size, name, graphicsHost), mnHookID(NULL_INDEX), mnPreviousHookID(NULL_INDEX), Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.148 retrieving revision 1.149 diff -C2 -d -r1.148 -r1.149 *** Game.cpp 26 Dec 2005 22:14:03 -0000 1.148 --- Game.cpp 2 Jan 2006 15:40:53 -0000 1.149 *************** *** 251,254 **** --- 251,255 ---- viewer->SetActive(false); worldMap->SetActive(false); + gameWindow->SetActive(false); briefingView->SetButtonCaption(ID_STARTVIEW, "Return"); *************** *** 514,517 **** --- 515,521 ---- tc3DWindow::Set3DViewer(viewer); + InitializeGameWindow(); + + /* test3DWindow = *************** *** 881,884 **** --- 885,904 ---- } + + void tcGame::InitializeGameWindow() + { + gameWindow = new tc3DWindow(glCanvas, wxPoint(0, 0), wxSize(mnWidth, mnHeight), + "GameWindow"); + gameWindow->SetBaseRenderBin(0); + + if (!gameWindow) + { + fprintf(stderr, "gameWindow init failed\n"); + throw "gameWindow init failed\n"; + } + } + + + /** * Initializes the Select Scenario View screen. *************** *** 906,911 **** mrectMap.right = mnWidth; //GetSystemMetrics(SM_CXFULLSCREEN); mrectMap.bottom = mnHeight - 0*200; //GetSystemMetrics(SM_CYFULLSCREEN); ! tacticalMap = new tcTacticalMapView(glCanvas, wxPoint(mrectMap.left,mrectMap.top), ! wxSize(mrectMap.right-mrectMap.left, mrectMap.bottom-mrectMap.top)); tacticalMap->SetBaseRenderBin(10); tacticalMap->SetTextLeftMargin(200.0f); --- 926,932 ---- mrectMap.right = mnWidth; //GetSystemMetrics(SM_CXFULLSCREEN); mrectMap.bottom = mnHeight - 0*200; //GetSystemMetrics(SM_CYFULLSCREEN); ! ! tacticalMap = new tcTacticalMapView(gameWindow, wxPoint(mrectMap.left,mrectMap.top), ! wxSize(mrectMap.right-mrectMap.left, mrectMap.bottom-mrectMap.top), gameWindow); tacticalMap->SetBaseRenderBin(10); tacticalMap->SetTextLeftMargin(200.0f); *************** *** 937,943 **** mrectWorldMap.top = mrectWorldMap.bottom - 129; ! worldMap = new tcWorldMapView(glCanvas, wxPoint(mrectWorldMap.left, mrectWorldMap.top), ! wxSize(mrectWorldMap.right - mrectWorldMap.left - 1, ! mrectWorldMap.bottom - mrectWorldMap.top - 1)); worldMap->SetBaseRenderBin(25); --- 958,964 ---- mrectWorldMap.top = mrectWorldMap.bottom - 129; ! worldMap = new tcWorldMapView(gameWindow, wxPoint(mrectWorldMap.left, mrectWorldMap.top), ! wxSize(mrectWorldMap.right - mrectWorldMap.left - 1, mrectWorldMap.bottom - mrectWorldMap.top - 1), ! gameWindow); worldMap->SetBaseRenderBin(25); *************** *** 970,974 **** wxPoint(mrectLowerLeft.left, mrectLowerLeft.top), wxSize(panelWidth, mrectLowerLeft.bottom - mrectLowerLeft.top), ! "xml/info_console.xml", "InfoConsole"); infoConsole->SetBaseRenderBin(30); infoConsole->LoadBackgroundImage("start_background.jpg"); --- 991,995 ---- wxPoint(mrectLowerLeft.left, mrectLowerLeft.top), wxSize(panelWidth, mrectLowerLeft.bottom - mrectLowerLeft.top), ! "xml/info_console.xml", "InfoConsole", gameWindow); infoConsole->SetBaseRenderBin(30); infoConsole->LoadBackgroundImage("start_background.jpg"); *************** *** 991,995 **** hookInfo = new tcHookInfo(glCanvas, wxPoint(mrectLowerLeft.right,mrectLowerLeft.top), ! wxSize(panelWidth, mrectLowerLeft.bottom - mrectLowerLeft.top)); hookInfo->SetBaseRenderBin(30); --- 1012,1018 ---- hookInfo = new tcHookInfo(glCanvas, wxPoint(mrectLowerLeft.right,mrectLowerLeft.top), ! wxSize(panelWidth, mrectLowerLeft.bottom - mrectLowerLeft.top), ! "HookInfo", ! gameWindow); hookInfo->SetBaseRenderBin(30); *************** *** 1009,1013 **** objectControl = new tcObjectControl(glCanvas, wxPoint(mrectLowerLeft.right+panelWidth, mrectLowerLeft.top), ! wxSize(mnWidth-2*panelWidth, 200)); //objectControl->SetBaseRenderBin(20); if (!objectControl) --- 1032,1037 ---- objectControl = new tcObjectControl(glCanvas, wxPoint(mrectLowerLeft.right+panelWidth, mrectLowerLeft.top), ! wxSize(mnWidth-2*panelWidth, 200), "ObjectControl", ! gameWindow); //objectControl->SetBaseRenderBin(20); if (!objectControl) *************** *** 1029,1033 **** mrectOOB.bottom = mnHeight-200; oobView = new tcOOBView(glCanvas, wxPoint(mrectOOB.left,mrectOOB.top), ! wxSize(mrectOOB.right-mrectOOB.left, mrectOOB.bottom-mrectOOB.top)); oobView->SetBaseRenderBin(20); oobView->MoveToTop(); --- 1053,1058 ---- mrectOOB.bottom = mnHeight-200; oobView = new tcOOBView(glCanvas, wxPoint(mrectOOB.left,mrectOOB.top), ! wxSize(mrectOOB.right-mrectOOB.left, mrectOOB.bottom-mrectOOB.top), ! "OrderOfBattle", gameWindow); oobView->SetBaseRenderBin(20); oobView->MoveToTop(); *************** *** 1072,1076 **** tcPopupMessage::SetParent(tacticalMap); tcLauncherPopup::SetParent(tacticalMap); ! tcContainerGui::SetParent(tacticalMap); tcTextEntryBox::SetParent(tacticalMap); --- 1097,1101 ---- tcPopupMessage::SetParent(tacticalMap); tcLauncherPopup::SetParent(tacticalMap); ! tcContainerGui::SetParent(gameWindow); tcTextEntryBox::SetParent(tacticalMap); *************** *** 1447,1450 **** --- 1472,1476 ---- chatBox->SetActive(false); briefingView->SetActive(false); + gameWindow->SetActive(false); } *************** *** 1617,1620 **** --- 1643,1647 ---- tcMessageInterface::Get()->SetPopupChatText(false); draggedIconDisplay->SetActive(false); + gameWindow->SetActive(false); } lastMode = meScreenMode; *************** *** 1627,1630 **** --- 1654,1658 ---- if (tacticalMapSize == TM_MEDIUM) SetTacticalMapSize(TM_LARGE); + gameWindow->SetActive(true); tacticalMap->SetActive(drawTacticalMap); worldMap->SetActive(drawTacticalMap); *************** *** 1634,1638 **** --- 1662,1669 ---- oobView->SetActive(drawEdgeWindows); viewer->SetActive(mb3DActive); + gameWindow->SetActive(true); + gameWindow->Draw(); + /* if (drawTacticalMap) { *************** *** 1647,1650 **** --- 1678,1683 ---- objectControl->Draw(); } + */ + if (popupControl->mbActive) popupControl->Draw(); if (chatBox->mbActive) *************** *** 1674,1677 **** --- 1707,1714 ---- worldMap->SetActive(drawTacticalMap); viewer->SetActive(mb3DActive); + gameWindow->SetActive(true); + + gameWindow->Draw(); + /* if (drawTacticalMap) { *************** *** 1679,1682 **** --- 1716,1720 ---- worldMap->Draw(); } + */ if (drawEdgeWindows) { *************** *** 2768,2777 **** tcGame::~tcGame() { - /* - if (pythonInterface) - { - delete pythonInterface; - } - */ messageConsole = 0; --- 2806,2809 ---- |
|
From: Dewitt C. <ddc...@us...> - 2006-01-02 15:41:03
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21272/include/graphics Modified Files: tc3DWindow.h tcHookInfo.h tcMapView.h tcOOBView.h Log Message: Game windows use common window as parent Index: tcHookInfo.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcHookInfo.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcHookInfo.h 1 Jun 2005 00:13:26 -0000 1.5 --- tcHookInfo.h 2 Jan 2006 15:40:52 -0000 1.6 *************** *** 68,72 **** tcHookInfo(wxWindow *parent, const wxPoint& pos, const wxSize& size, ! const wxString& name = "HookInfo"); virtual ~tcHookInfo(); private: --- 68,73 ---- tcHookInfo(wxWindow *parent, const wxPoint& pos, const wxSize& size, ! const wxString& name = "HookInfo", ! tc3DWindow* graphicsHost = 0); virtual ~tcHookInfo(); private: Index: tcOOBView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcOOBView.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcOOBView.h 28 Jun 2005 02:51:19 -0000 1.6 --- tcOOBView.h 2 Jan 2006 15:40:52 -0000 1.7 *************** *** 114,118 **** tcOOBView(wxWindow *parent, const wxPoint& pos, const wxSize& size, ! const wxString& name = "OOBView"); ~tcOOBView(); --- 114,119 ---- tcOOBView(wxWindow *parent, const wxPoint& pos, const wxSize& size, ! const wxString& name = "OOBView", ! tc3DWindow* graphicsHost = 0); ~tcOOBView(); Index: tc3DWindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DWindow.h,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** tc3DWindow.h 18 Dec 2005 18:48:16 -0000 1.21 --- tc3DWindow.h 2 Jan 2006 15:40:52 -0000 1.22 *************** *** 243,246 **** --- 243,247 ---- osg::ref_ptr<osg::Texture2D> backgroundTexture; osg::ref_ptr<osg::Geometry> backgroundQuad; + osg::ref_ptr<osg::Geometry> border; osg::ref_ptr<osg::Texture2D> defaultTexture; osg::ref_ptr<osg::Texture2D> testSymbol; *************** *** 283,287 **** virtual void ReleaseMouse(); void SkipMouseEvent(wxMouseEvent& event); ///< adjusts position to parent frame - //long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); virtual void UpdatePositionAndSize(const wxPoint& pos, const wxSize& size); --- 284,287 ---- *************** *** 316,320 **** --- 316,322 ---- void CreateBackgroundQuad(); + void CreateBackgroundShape(); void UpdateBackgroundQuadVertices(); + void UpdateBackgroundShape(); osg::Geometry* GetImageQuadObject(); Index: tcMapView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMapView.h,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** tcMapView.h 24 Dec 2005 07:41:19 -0000 1.25 --- tcMapView.h 2 Jan 2006 15:40:52 -0000 1.26 *************** *** 193,203 **** float GeoExtentToScreen(float afExtent_rad); osg::Vec4 GetAffiliationColor(teAffiliation a); - /* - Gdiplus::Pen* GetPen() {return mpPen;} - Gdiplus::Pen* GetPenThin() {return mpPenThin;} - Gdiplus::SolidBrush* GetBrush() {return mpBrush;} - Gdiplus::Font* GetFont() {return mpFont;} - Gdiplus::Font* GetFontSmall() {return mpFontSmall;} - */ int PointInView(tcPoint& p); --- 193,196 ---- *************** *** 217,220 **** --- 210,214 ---- tcMapView(wxWindow *parent, const wxPoint& pos, const wxSize& size, + tc3DWindow* graphicsHost, const wxString& name = "MapView"); virtual ~tcMapView(); *************** *** 334,337 **** --- 328,332 ---- tcTacticalMapView(wxWindow *parent, const wxPoint& pos, const wxSize& size, + tc3DWindow* graphicsHost, const wxString& name = "TacticalMapView"); virtual ~tcTacticalMapView(); *************** *** 423,427 **** tcWorldMapView(wxWindow *parent, ! const wxPoint& pos, const wxSize& size, const wxString& name = "WorldMapView"); virtual ~tcWorldMapView(); --- 418,423 ---- tcWorldMapView(wxWindow *parent, ! const wxPoint& pos, const wxSize& size, ! tc3DWindow* graphicsHost, const wxString& name = "WorldMapView"); virtual ~tcWorldMapView(); |
|
From: Dewitt C. <ddc...@us...> - 2005-12-26 22:14:18
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17429/src/sim Modified Files: Game.cpp tcFlightPort.cpp tcLauncher.cpp tcPositionRegistry.cpp tcSimState.cpp Log Message: Launcher reload and helo launch bug fixes Index: tcSimState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSimState.cpp,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** tcSimState.cpp 12 Dec 2005 03:20:29 -0000 1.93 --- tcSimState.cpp 26 Dec 2005 22:14:03 -0000 1.94 *************** *** 2243,2246 **** --- 2243,2248 ---- maPlatformState.RemoveKeyWithoutDelete(key); + UnregisterPlatform(landing_unit); + if (positionRegistry) { Index: tcPositionRegistry.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcPositionRegistry.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcPositionRegistry.cpp 10 Mar 2005 03:28:29 -0000 1.3 --- tcPositionRegistry.cpp 26 Dec 2005 22:14:03 -0000 1.4 *************** *** 170,174 **** //fprintf(stdout, "removing id %d from bin %d\n", id, bin); ! RemoveIdFromBin(bin, id); } --- 170,174 ---- //fprintf(stdout, "removing id %d from bin %d\n", id, bin); ! RemoveIdFromBin(id, bin); } Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.147 retrieving revision 1.148 diff -C2 -d -r1.147 -r1.148 *** Game.cpp 24 Dec 2005 07:41:20 -0000 1.147 --- Game.cpp 26 Dec 2005 22:14:03 -0000 1.148 *************** *** 230,233 **** --- 230,237 ---- pythonInterface->SetMenuPlatform(-1); + // close open gui windows + tcContainerGui::CloseAll(); + UpdateForScreenMode(); // draw one more time for close-on-draw to take effect + // hide all game windows briefingConsoleLeft->SetActive(false); *************** *** 1016,1019 **** --- 1020,1024 ---- objectControl->LoadBackgroundImage("console_b.jpg"); objectControl->SetBaseRenderBin(30); + objectControl->MoveToTop(); objectControl->AttachUserInfo(userInfo); Index: tcFlightPort.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcFlightPort.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** tcFlightPort.cpp 18 Dec 2005 04:10:33 -0000 1.24 --- tcFlightPort.cpp 26 Dec 2005 22:14:03 -0000 1.25 *************** *** 478,483 **** int tcFlightPort::CheckLanding(tcGameObject *obj) { ! bool isAir = dynamic_cast<tcAirObject*>(obj) != 0; ! bool isHelo = dynamic_cast<tcHeloObject*>(obj) != 0; bool compatible = isAir && (!mpDBObject->heloOnly || isHelo); --- 478,485 ---- int tcFlightPort::CheckLanding(tcGameObject *obj) { ! ! tcAirObject* air = dynamic_cast<tcAirObject*>(obj); ! bool isAir = (air != 0); ! bool isHelo = dynamic_cast<tcHeloObject*>(air) != 0; bool compatible = isAir && (!mpDBObject->heloOnly || isHelo); *************** *** 495,498 **** --- 497,502 ---- //if ((dx*dx + dz*dz <= 1600.0f)&&(dy < 25.0f)&&(dy > -25.0f)) { + air->GetBrain()->RemoveAllTasks(); + air->SetLandingState(false); // retract landing gear toLand.push_back(obj); return 1; Index: tcLauncher.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcLauncher.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** tcLauncher.cpp 18 Dec 2005 18:48:17 -0000 1.33 --- tcLauncher.cpp 26 Dec 2005 22:14:03 -0000 1.34 *************** *** 658,662 **** { status = LAUNCHER_EMPTY; ! if (mpChildDBObj != 0) { SetChildClass(""); --- 658,663 ---- { status = LAUNCHER_EMPTY; ! // if empty and not loading then clear child class ! if ((mpChildDBObj != 0) && (!isLoading)) { SetChildClass(""); |
|
From: Dewitt C. <ddc...@us...> - 2005-12-26 22:14:16
|
Update of /cvsroot/gcblue/gcb_wx/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17429/docs Modified Files: CHANGES.txt Log Message: Launcher reload and helo launch bug fixes Index: CHANGES.txt =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/docs/CHANGES.txt,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** CHANGES.txt 24 Dec 2005 07:41:19 -0000 1.48 --- CHANGES.txt 26 Dec 2005 22:14:03 -0000 1.49 *************** *** 4,7 **** --- 4,15 ---- 0.8.1 --------------------------------------------------------------------- + *** 2005-12-26 DDC *** + - Fixed launcher bug where reloads would not complete correctly. + - Fixed helo launch bug where helo would immediately land after being relaunched. + This was due to the AI landing task not being cleared after landing. + - Added code to close all open panel gui's when game ends. Previously these would + be open at the start of the next game with potentially bad data. + + *** 2005-12-24 DDC *** - Improvements to make container GUIs layer on top of one another |
|
From: Dewitt C. <ddc...@us...> - 2005-12-26 22:14:16
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17429/include/graphics Modified Files: tcContainerGui.h Log Message: Launcher reload and helo launch bug fixes Index: tcContainerGui.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcContainerGui.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcContainerGui.h 24 Dec 2005 07:41:19 -0000 1.3 --- tcContainerGui.h 26 Dec 2005 22:14:03 -0000 1.4 *************** *** 88,93 **** void SetParentItem(tcContainerItem* item); static void SetParent(tc3DWindow* win); ! tcContainerGui(const wxPoint& pos, const wxString& configFile, --- 88,94 ---- void SetParentItem(tcContainerItem* item); + static void CloseAll(); ///< close all open tcContainerGui windows static void SetParent(tc3DWindow* win); ! tcContainerGui(const wxPoint& pos, const wxString& configFile, *************** *** 115,118 **** --- 116,123 ---- static tc3DWindow* parent; static int windowLayer; ///< used to achieve some layering of GUI windows (last always on top) + static std::list<tcContainerGui*> openContainers; ///< to allow closing all open GUIs + + void RegisterGui(); + void UnregisterGui(); DECLARE_EVENT_TABLE() |
|
From: Dewitt C. <ddc...@us...> - 2005-12-26 22:14:15
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17429/src/graphics Modified Files: tc3DWindow.cpp tcContainerGui.cpp tcCreditView.cpp tcFlightPortGui.cpp tcPlatformGui.cpp tcStoresGui.cpp Log Message: Launcher reload and helo launch bug fixes Index: tcFlightPortGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcFlightPortGui.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcFlightPortGui.cpp 18 Dec 2005 18:48:17 -0000 1.4 --- tcFlightPortGui.cpp 26 Dec 2005 22:14:03 -0000 1.5 *************** *** 143,152 **** void tcFlightPortGui::Draw() { - if (drawCount++ % 4 != 0) return; // update draw every 4th frame - tcFlightPort* flightPort = GetFlightPort(); if (flightPort == 0) DestroyGui(); if (FinishDestroy()) return; UpdateGui(); --- 143,152 ---- void tcFlightPortGui::Draw() { tcFlightPort* flightPort = GetFlightPort(); if (flightPort == 0) DestroyGui(); if (FinishDestroy()) return; + if (drawCount++ % 4 != 0) return; // update draw every 4th frame + UpdateGui(); Index: tcPlatformGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcPlatformGui.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcPlatformGui.cpp 14 Jul 2005 23:42:22 -0000 1.5 --- tcPlatformGui.cpp 26 Dec 2005 22:14:03 -0000 1.6 *************** *** 96,106 **** void tcPlatformGui::Draw() ! { ! if (drawCount++ % 4 != 0) return; // update draw every 4th frame ! tcPlatformObject* platform = GetPlatform(); if (platform == 0) DestroyGui(); if (FinishDestroy()) return; UpdateGui(); --- 96,106 ---- void tcPlatformGui::Draw() ! { tcPlatformObject* platform = GetPlatform(); if (platform == 0) DestroyGui(); if (FinishDestroy()) return; + if (drawCount++ % 4 != 0) return; // update draw every 4th frame + UpdateGui(); Index: tcCreditView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcCreditView.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** tcCreditView.cpp 10 Sep 2005 21:47:38 -0000 1.17 --- tcCreditView.cpp 26 Dec 2005 22:14:03 -0000 1.18 *************** *** 75,80 **** s = "Jason Simpson"; ! AddCredit(s, 60.0f, 1); --- 75,82 ---- s = "Jason Simpson"; ! AddCredit(s, 25.0f, 1); + s = "Urwumpe"; + AddCredit(s, 60.0f, 1); *************** *** 89,94 **** --- 91,103 ---- s = "Havoc"; + AddCredit(s, 25.0f, 1); + + s = "Suresh"; + AddCredit(s, 25.0f, 1); + + s = "Urwumpe"; AddCredit(s, 75.0f, 1); + s = "--- \"Music\" ---"; AddCredit(s, 25.0f, 1); Index: tcStoresGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcStoresGui.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcStoresGui.cpp 14 Jul 2005 23:42:23 -0000 1.4 --- tcStoresGui.cpp 26 Dec 2005 22:14:03 -0000 1.5 *************** *** 83,92 **** void tcStoresGui::Draw() { - if (drawCount++ % 4 != 0) return; // update draw every 4th frame - tcStores* stores = GetStores(); if (stores == 0) DestroyGui(); if (FinishDestroy()) return; UpdateGui(); --- 83,91 ---- void tcStoresGui::Draw() { tcStores* stores = GetStores(); if (stores == 0) DestroyGui(); if (FinishDestroy()) return; + if (drawCount++ % 4 != 0) return; // update draw every 4th frame UpdateGui(); Index: tc3DWindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DWindow.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** tc3DWindow.cpp 18 Dec 2005 18:48:17 -0000 1.29 --- tc3DWindow.cpp 26 Dec 2005 22:14:03 -0000 1.30 *************** *** 283,293 **** if (child == NULL) return; std::vector<tc3DWindow*>::iterator iter = children.begin(); ! for (iter = children.begin(); iter != children.end(); ++iter) { if ((*iter) == child) { children.erase(iter); - return; } } } --- 283,296 ---- if (child == NULL) return; std::vector<tc3DWindow*>::iterator iter = children.begin(); ! for (iter = children.begin(); iter != children.end(); ) { if ((*iter) == child) { children.erase(iter); } + else + { + ++iter; + } } } Index: tcContainerGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcContainerGui.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcContainerGui.cpp 24 Dec 2005 07:41:20 -0000 1.5 --- tcContainerGui.cpp 26 Dec 2005 22:14:03 -0000 1.6 *************** *** 121,125 **** --- 121,136 ---- tc3DWindow* tcContainerGui::parent = 0; int tcContainerGui::windowLayer = 2; + std::list<tcContainerGui*> tcContainerGui::openContainers; + + void tcContainerGui::CloseAll() + { + for (std::list<tcContainerGui*>::iterator iter = openContainers.begin(); + iter != openContainers.end(); ++iter) + { + (*iter)->DestroyGui(); + } + + } void tcContainerGui::SetParent(tc3DWindow* win) *************** *** 384,387 **** --- 395,421 ---- } + void tcContainerGui::RegisterGui() + { + openContainers.push_back(this); + } + + + void tcContainerGui::UnregisterGui() + { + std::list<tcContainerGui*>::iterator iter = + find(openContainers.begin(), openContainers.end(), this); + + if (iter != openContainers.end()) + { + openContainers.erase(iter); + } + else + { + fprintf(stderr, "tcContainerGui::UnregisterGui - not found in registry %s\n", + wxWindow::GetName().c_str()); + } + } + + void tcContainerGui::UpdateWindowDrag(const wxPoint& pos) { *************** *** 474,477 **** --- 508,513 ---- SetActive(true); + RegisterGui(); + #ifdef _DEBUG fprintf(stdout, "tcContainerGui::tcContainerGui - %s, %d slots\n", name.c_str(), *************** *** 494,497 **** --- 530,535 ---- windowLayer--; + + UnregisterGui(); } |
|
From: Dewitt C. <ddc...@us...> - 2005-12-24 07:41:28
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9801/src/sim Modified Files: Game.cpp Log Message: minor gui updates Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.146 retrieving revision 1.147 diff -C2 -d -r1.146 -r1.147 *** Game.cpp 18 Dec 2005 04:10:33 -0000 1.146 --- Game.cpp 24 Dec 2005 07:41:20 -0000 1.147 *************** *** 311,314 **** --- 311,315 ---- meGameMode = GM_START; meScreenMode = START; + mbScenarioEdit = false; } *************** *** 900,904 **** mrectMap.top = 0; mrectMap.right = mnWidth; //GetSystemMetrics(SM_CXFULLSCREEN); ! mrectMap.bottom = mnHeight - 200; //GetSystemMetrics(SM_CYFULLSCREEN); tacticalMap = new tcTacticalMapView(glCanvas, wxPoint(mrectMap.left,mrectMap.top), wxSize(mrectMap.right-mrectMap.left, mrectMap.bottom-mrectMap.top)); --- 901,905 ---- mrectMap.top = 0; mrectMap.right = mnWidth; //GetSystemMetrics(SM_CXFULLSCREEN); ! mrectMap.bottom = mnHeight - 0*200; //GetSystemMetrics(SM_CYFULLSCREEN); tacticalMap = new tcTacticalMapView(glCanvas, wxPoint(mrectMap.left,mrectMap.top), wxSize(mrectMap.right-mrectMap.left, mrectMap.bottom-mrectMap.top)); *************** *** 928,931 **** --- 929,933 ---- { mrectWorldMap = mrectMap; + mrectWorldMap.bottom -= 200; mrectWorldMap.left = mrectWorldMap.right - 257; mrectWorldMap.top = mrectWorldMap.bottom - 129; *************** *** 1058,1062 **** // tcDraggedIconDisplay init draggedIconDisplay = new tcDraggedIconDisplay(glCanvas); ! draggedIconDisplay->SetBaseRenderBin(50); wxASSERT(tacticalMap); --- 1060,1064 ---- // tcDraggedIconDisplay init draggedIconDisplay = new tcDraggedIconDisplay(glCanvas); ! draggedIconDisplay->SetBaseRenderBin(150); wxASSERT(tacticalMap); *************** *** 1420,1423 **** --- 1422,1426 ---- static teScreenMode lastMode = NONE; static bool musicStarted = false; + static unsigned lastTimeCount = 0; tcTime::Get()->Update(); *************** *** 1478,1486 **** viewer->SetActive(true); - //test3DWindow->Draw(); - - viewer->SetCameraAz(viewer->GetCameraAz() + 0.02f); static float cameraTime = 0; ! cameraTime += 0.03f; viewer->SetCameraEl(0.5f * sinf(0.1f*cameraTime)); --- 1481,1493 ---- viewer->SetActive(true); static float cameraTime = 0; ! unsigned currentTimeCount = tcTime::Get()->Get30HzCount(); ! if (currentTimeCount - lastTimeCount >= 1) ! { ! cameraTime += 0.03f; ! lastTimeCount = currentTimeCount; ! } ! ! viewer->SetCameraAz(cameraTime); viewer->SetCameraEl(0.5f * sinf(0.1f*cameraTime)); |
|
From: Dewitt C. <ddc...@us...> - 2005-12-24 07:41:28
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9801/src/graphics Modified Files: tcContainerGui.cpp tcMapView.cpp Log Message: minor gui updates Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapView.cpp,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** tcMapView.cpp 18 Dec 2005 18:48:17 -0000 1.40 --- tcMapView.cpp 24 Dec 2005 07:41:20 -0000 1.41 *************** *** 38,41 **** --- 38,42 ---- #include "tcMapOverlay.h" #include "tcDragStatus.h" + #include "tcTime.h" #include <osg/Image> *************** *** 646,654 **** tcMapView::Thaw(); // unfreeze every Draw() call, works with Freeze() to stop resize flicker ! if ((mnScrollState >= SCROLL_DELAY) && (mnScrollState % 2 == 0)) ! { ! ScrollMap(mfScrollDirection); } - else if (mnScrollState > 0) {mnScrollState++;} // SetView called here to avoid artifacts from terrainview being out of sync with mapview --- 647,657 ---- tcMapView::Thaw(); // unfreeze every Draw() call, works with Freeze() to stop resize flicker ! unsigned timeCount = tcTime::Get()->Get30HzCount(); ! ! if (scrollActive && (timeCount - lastScrollTime > 1)) ! { ! ScrollMap(scrollDirection); ! lastScrollTime = timeCount; } // SetView called here to avoid artifacts from terrainview being out of sync with mapview *************** *** 2278,2282 **** void tcTacticalMapView::OnLeaveWindow(wxMouseEvent& event) { ! mnScrollState = 0; isLButtonDown = false; } --- 2281,2285 ---- void tcTacticalMapView::OnLeaveWindow(wxMouseEvent& event) { ! scrollActive = false; isLButtonDown = false; } *************** *** 2521,2551 **** if (mpointMouse.x <= nScrollBorder + 200) { ! if (mnScrollState < SCROLL_DELAY) {mnScrollState++;} // allows for delay ! mfScrollDirection = 270.0f; } else if (mpointMouse.x >= mnWidth - nScrollBorder) { ! if (mnScrollState < SCROLL_DELAY) {mnScrollState++;} ! mfScrollDirection = 90.0f; } else if (mpointMouse.y <= nScrollBorder) { ! if (mnScrollState < SCROLL_DELAY) {mnScrollState++;} ! mfScrollDirection = 0.0f; } ! else if (mpointMouse.y >= mnHeight - nScrollBorder) { ! if (mnScrollState < SCROLL_DELAY) {mnScrollState++;} ! mfScrollDirection = 180.0f; } else { ! mnScrollState = 0; ! } ! /* ! if (mbMapCmdActive) { ! mpointMouse = point; } ! */ } --- 2524,2556 ---- if (mpointMouse.x <= nScrollBorder + 200) { ! scrollActive = true; ! scrollDirection = 270.0f; } else if (mpointMouse.x >= mnWidth - nScrollBorder) { ! scrollActive = true; ! scrollDirection = 90.0f; } else if (mpointMouse.y <= nScrollBorder) { ! scrollActive = true; ! scrollDirection = 0.0f; } ! else if (mpointMouse.y >= mnHeight - nScrollBorder - 200) // -200 another similar hack { ! scrollActive = true; ! scrollDirection = 180.0f; } else { ! scrollActive = false; ! scrollDirection = 0.0f; } ! ! if (scrollActive) ! { ! lastScrollTime = tcTime::Get()->Get30HzCount(); ! } ! } *************** *** 2639,2643 **** const wxPoint& pos, const wxSize& size, const wxString& name) : ! tcMapView(parent, pos, size, name) { --- 2644,2651 ---- const wxPoint& pos, const wxSize& size, const wxString& name) : ! tcMapView(parent, pos, size, name), ! scrollActive(false), ! lastScrollTime(0), ! scrollDirection(0.0) { *************** *** 2664,2668 **** mpMapData = NULL; mfFrameRate = 0; ! mnScrollState = 0; maNavPointGeo.clear(); maNavPointScreen.clear(); --- 2672,2676 ---- mpMapData = NULL; mfFrameRate = 0; ! maNavPointGeo.clear(); maNavPointScreen.clear(); Index: tcContainerGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcContainerGui.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcContainerGui.cpp 18 Dec 2005 18:48:17 -0000 1.4 --- tcContainerGui.cpp 24 Dec 2005 07:41:20 -0000 1.5 *************** *** 120,123 **** --- 120,125 ---- tc3DWindow* tcContainerGui::parent = 0; + int tcContainerGui::windowLayer = 2; + void tcContainerGui::SetParent(tc3DWindow* win) *************** *** 253,257 **** isLButtonDown = true; ! if ((point.y <= 10) || (point.y >= mnHeight)) { windowDragOn = true; --- 255,259 ---- isLButtonDown = true; ! if ((point.y <= 15) || (point.y >= mnHeight)) { windowDragOn = true; *************** *** 416,420 **** windowDragOn(false) { ! SetBaseRenderBin(parent->GetBaseRenderBin() + 10); TiXmlNode* root = config->FirstChild("Window"); --- 418,427 ---- windowDragOn(false) { ! ! // put gui window on top ! SetBaseRenderBin(parent->GetBaseRenderBin() + windowLayer*10); ! wxWindow::Raise(); ! ! windowLayer++; TiXmlNode* root = config->FirstChild("Window"); *************** *** 485,488 **** --- 492,497 ---- } } + + windowLayer--; } |
|
From: Dewitt C. <ddc...@us...> - 2005-12-24 07:41:27
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9801/include/graphics Modified Files: tcContainerGui.h tcMapView.h Log Message: minor gui updates Index: tcMapView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMapView.h,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** tcMapView.h 18 Dec 2005 18:48:16 -0000 1.24 --- tcMapView.h 24 Dec 2005 07:41:19 -0000 1.25 *************** *** 228,238 **** tcTerrainView *terrainView; - /* - Gdiplus::Pen *mpPen; ///< GDI+ objects - Gdiplus::Pen *mpPenThin; - Gdiplus::SolidBrush *mpBrush; - Gdiplus::Font *mpFont; - Gdiplus::Font *mpFontSmall; - */ osg::Vec4 ConvertColor(unsigned int nColor); --- 228,231 ---- *************** *** 258,263 **** bool mbShowTrackID; float mfFrameRate; ! int mnScrollState; ! float mfScrollDirection; std::vector<long> hookedId; ///< vector of hooked obj ids --- 251,259 ---- bool mbShowTrackID; float mfFrameRate; ! ! // auto-scroll params ! bool scrollActive; ! unsigned int lastScrollTime; ! float scrollDirection; std::vector<long> hookedId; ///< vector of hooked obj ids Index: tcContainerGui.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcContainerGui.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcContainerGui.h 18 Dec 2005 18:48:16 -0000 1.2 --- tcContainerGui.h 24 Dec 2005 07:41:19 -0000 1.3 *************** *** 114,117 **** --- 114,118 ---- tcContainerItem* parentItem; ///< item that was clicked to popup this gui (if applicable) static tc3DWindow* parent; + static int windowLayer; ///< used to achieve some layering of GUI windows (last always on top) DECLARE_EVENT_TABLE() |
|
From: Dewitt C. <ddc...@us...> - 2005-12-24 07:41:27
|
Update of /cvsroot/gcblue/gcb_wx/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9801/docs Modified Files: CHANGES.txt Log Message: minor gui updates Index: CHANGES.txt =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/docs/CHANGES.txt,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** CHANGES.txt 18 Dec 2005 18:48:14 -0000 1.47 --- CHANGES.txt 24 Dec 2005 07:41:19 -0000 1.48 *************** *** 4,7 **** --- 4,14 ---- 0.8.1 --------------------------------------------------------------------- + *** 2005-12-24 DDC *** + - Improvements to make container GUIs layer on top of one another + - Changed auto map scroll to use time instead of frame count. Scroll was very + jumpy on fast systems with high frame rates. + - Spinning object 3D view at start screen changed to rotate at constant rate + instead of rotating based on frame count + *** 2005-12-18 DDC *** - Added "El" attribute to launcher xml to set launch elevation for surface |
|
From: Dewitt C. <ddc...@us...> - 2005-12-18 18:48:30
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17709/include/sim Modified Files: tcLauncher.h tcLauncherState.h Log Message: mission editor mode changes Index: tcLauncher.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcLauncher.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** tcLauncher.h 18 Dec 2005 04:10:32 -0000 1.23 --- tcLauncher.h 18 Dec 2005 18:48:16 -0000 1.24 *************** *** 130,133 **** --- 130,134 ---- int GetLauncherStatus(); tcGameObject* GetParent() const; + float GetPointingElevation() const; float GetSectorCenter() const; ///< returns center of engagement sector in radians float GetSectorWidth() const; ///< returns width of engagement sector in radians Index: tcLauncherState.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcLauncherState.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** tcLauncherState.h 22 Jun 2005 01:21:27 -0000 1.17 --- tcLauncherState.h 18 Dec 2005 18:48:16 -0000 1.18 *************** *** 65,69 **** static void AttachSimState(tcSimState* ss) {simState = ss;} ! void AddFullLauncher(tnPoolIndex anKey, float azimuth_rad, const std::string& displayName); float EstimateInterceptTimeForLauncher(unsigned nLauncher, tcTrack& track); const char* GetFireControlSensorClass(unsigned nLauncher) const; --- 65,70 ---- static void AttachSimState(tcSimState* ss) {simState = ss;} ! void AddFullLauncher(tnPoolIndex anKey, float azimuth_rad, float elevation_rad, ! const std::string& displayName); float EstimateInterceptTimeForLauncher(unsigned nLauncher, tcTrack& track); const char* GetFireControlSensorClass(unsigned nLauncher) const; |
|
From: Dewitt C. <ddc...@us...> - 2005-12-18 18:48:30
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17709/src/scriptinterface Modified Files: tcScenarioInterface.cpp Log Message: mission editor mode changes Index: tcScenarioInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcScenarioInterface.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** tcScenarioInterface.cpp 18 Dec 2005 04:10:33 -0000 1.35 --- tcScenarioInterface.cpp 18 Dec 2005 18:48:17 -0000 1.36 *************** *** 25,28 **** --- 25,29 ---- #include "wx/wx.h" #endif + #include "wx/datetime.h" #include "tcAeroAirObject.h" *************** *** 204,207 **** --- 205,209 ---- .def("GetSideCode", &tcScenarioInterface::GetSideCode) .def("GetUserAlliance", &tcScenarioInterface::GetUserAlliance) + .def("SaveGame", &tcScenarioInterface::SaveGame) .def("SetAllianceGoal",&tcScenarioInterface::SetAllianceGoal) .def("SetDateTime",&tcScenarioInterface::SetDateTime) *************** *** 594,597 **** --- 596,607 ---- } + void tcScenarioInterface::SaveGame(const std::string& fileName) + { + wxDateTime now = wxDateTime::Now(); + wxString saveName = wxString::Format("scenarios//Saved//%s_%d_%d_%02d%02d%02d", + fileName.c_str(), now.GetMonth()+1, now.GetDay(), now.GetHour(), now.GetMinute(), now.GetSecond()); + simState->SaveToPython(saveName.c_str()); + } + /** * Copies and sets root goal for alliance |
|
From: Dewitt C. <ddc...@us...> - 2005-12-18 18:48:30
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17709/src/database Modified Files: tcGenericDBObject.cpp Log Message: mission editor mode changes Index: tcGenericDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcGenericDBObject.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** tcGenericDBObject.cpp 28 Jun 2005 02:51:34 -0000 1.23 --- tcGenericDBObject.cpp 18 Dec 2005 18:48:17 -0000 1.24 *************** *** 75,97 **** * @return relative az of launcher n or 0 for default or if error */ ! float tcGenericDBObject::GetLauncherAz(unsigned n) { - float az = 0; - if ((int)n >= mnNumLaunchers) { ! fprintf(stderr, "Error - GetLauncherAz - bad launcher index\n"); ! return az; } if (tc3DModel* model = Get3DModel()) { ! float az; osg::Vec3 pos; ! model->GetLauncherInfo(n, pos, az); } ! ! return az; ! } --- 75,98 ---- * @return relative az of launcher n or 0 for default or if error */ ! osg::Vec2 tcGenericDBObject::GetLauncherAttitude(unsigned n) { if ((int)n >= mnNumLaunchers) { ! fprintf(stderr, "Error - GetLauncherAttitude - bad launcher index\n"); ! return osg::Vec2(0, 0); } if (tc3DModel* model = Get3DModel()) { ! float az, el; osg::Vec3 pos; ! model->GetLauncherInfo(n, pos, az, el); ! return osg::Vec2(az, el); } ! else ! { ! fprintf(stderr, "Error - GetLauncherAttitude - null model\n"); ! return osg::Vec2(0, 0); ! } } *************** *** 112,118 **** if (tc3DModel* model = Get3DModel()) { ! float az; osg::Vec3 pos; ! model->GetLauncherInfo(n, pos, az); p.x = pos.x(); p.y = pos.y(); --- 113,119 ---- if (tc3DModel* model = Get3DModel()) { ! float az, el; osg::Vec3 pos; ! model->GetLauncherInfo(n, pos, az, el); p.x = pos.x(); p.y = pos.y(); |
|
From: Dewitt C. <ddc...@us...> - 2005-12-18 18:48:30
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17709/src/sim Modified Files: tcLauncher.cpp tcLauncherState.cpp tcMissileObject.cpp tcPlatformObject.cpp Log Message: mission editor mode changes Index: tcLauncher.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcLauncher.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** tcLauncher.cpp 18 Dec 2005 04:10:33 -0000 1.32 --- tcLauncher.cpp 18 Dec 2005 18:48:17 -0000 1.33 *************** *** 353,356 **** --- 353,364 ---- /** + * @return pointing elevation in radians + */ + float tcLauncher::GetPointingElevation() const + { + return pointingElevation; + } + + /** * */ Index: tcPlatformObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcPlatformObject.cpp,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** tcPlatformObject.cpp 12 Dec 2005 02:37:01 -0000 1.58 --- tcPlatformObject.cpp 18 Dec 2005 18:48:17 -0000 1.59 *************** *** 1064,1070 **** if (nLauncherKey != -1) { ! float launcherAz_deg = mpDBObject->GetLauncherAz(nLauncher); ! mcLauncherState.AddFullLauncher(nLauncherKey, C_PIOVER180*launcherAz_deg, ! mpDBObject->launcherName[nLauncher]); } else --- 1064,1070 ---- if (nLauncherKey != -1) { ! osg::Vec2 attitude = mpDBObject->GetLauncherAttitude(nLauncher); ! mcLauncherState.AddFullLauncher(nLauncherKey, C_PIOVER180*attitude._v[0], ! C_PIOVER180*attitude._v[1], mpDBObject->launcherName[nLauncher]); } else Index: tcLauncherState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcLauncherState.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** tcLauncherState.cpp 10 Sep 2005 21:47:38 -0000 1.35 --- tcLauncherState.cpp 18 Dec 2005 18:48:17 -0000 1.36 *************** *** 51,55 **** * @param displayName name to display in GUI controls, e.g. "Tube 1" */ ! void tcLauncherState::AddFullLauncher(tnPoolIndex anKey, float azimuth_rad, const std::string& displayName) { --- 51,55 ---- * @param displayName name to display in GUI controls, e.g. "Tube 1" */ ! void tcLauncherState::AddFullLauncher(tnPoolIndex anKey, float azimuth_rad, float elevation_rad, const std::string& displayName) { *************** *** 75,79 **** new_launcher->pointingAngle = azimuth_rad; ! new_launcher->pointingElevation = 0; new_launcher->displayName = displayName; --- 75,79 ---- new_launcher->pointingAngle = azimuth_rad; ! new_launcher->pointingElevation = elevation_rad; new_launcher->displayName = displayName; Index: tcMissileObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMissileObject.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** tcMissileObject.cpp 17 Jul 2005 12:58:05 -0000 1.31 --- tcMissileObject.cpp 18 Dec 2005 18:48:17 -0000 1.32 *************** *** 153,165 **** mcKin.mfHeading_rad = obj->mcKin.mfHeading_rad; if (dynamic_cast<tcAirObject*>(obj)) { mcKin.mfPitch_rad = obj->mcKin.mfPitch_rad; } else { ! // point surface launched missiles up ! mcKin.mfPitch_rad = 0.45f * C_PI; } --- 153,166 ---- mcKin.mfHeading_rad = obj->mcKin.mfHeading_rad; + const tcLauncher* pLauncher = obj->GetLauncher(nLauncher); if (dynamic_cast<tcAirObject*>(obj)) { + // assume air launch always aligned with velocity vector of parent platform mcKin.mfPitch_rad = obj->mcKin.mfPitch_rad; } else { ! mcKin.mfPitch_rad = obj->mcKin.mfPitch_rad + pLauncher->GetPointingElevation(); } *************** *** 175,179 **** ! const tcLauncher* pLauncher = obj->GetLauncher(nLauncher); mfGoalHeading_rad = obj->mcKin.mfHeading_rad + pLauncher->pointingAngle; --- 176,180 ---- ! mfGoalHeading_rad = obj->mcKin.mfHeading_rad + pLauncher->pointingAngle; *************** *** 205,212 **** - // add pitch initializer eventually, have to deal with launcher elevation mfStatusTime = obj->mfStatusTime; mcKin.mfHeading_rad += pLauncher->pointingAngle; - mcKin.mfPitch_rad += pLauncher->pointingElevation; mcKin.mfClimbAngle_rad = mcKin.mfPitch_rad; --- 206,211 ---- |
|
From: Dewitt C. <ddc...@us...> - 2005-12-18 18:48:28
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17709/src/graphics Modified Files: tc3DModel.cpp tc3DWindow.cpp tcContainerGui.cpp tcFlightPortGui.cpp tcMapView.cpp Log Message: mission editor mode changes Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapView.cpp,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** tcMapView.cpp 18 Dec 2005 04:10:33 -0000 1.39 --- tcMapView.cpp 18 Dec 2005 18:48:17 -0000 1.40 *************** *** 25,31 **** #ifndef WX_PRECOMP #include "wx/wx.h" - #ifdef WIN32 - #include "wx/msw/private.h" // for MS Windows specific definitions - #endif #endif --- 25,28 ---- *************** *** 40,43 **** --- 37,41 ---- #include "tcMapObject.h" #include "tcMapOverlay.h" + #include "tcDragStatus.h" #include <osg/Image> *************** *** 1966,1970 **** --- 1964,1976 ---- } + void tcTacticalMapView::ClearHook() + { + wxCommandEvent command(wxEVT_COMMAND_BUTTON_CLICKED, ID_NEWHOOK) ; + command.SetEventObject(this); + command.m_extraLong = -1; + AddPendingEvent(command); + hookedId.clear(); + } /** *************** *** 1972,1975 **** --- 1978,1982 ---- * Hooks a single object closest to pscreen * Modified so that hook is not cleared if no object is close to click point + * Use double click or escape key to clear hook */ long tcTacticalMapView::Hook(wxPoint pscreen) *************** *** 1988,2001 **** long nMinID = GetClosest(pscreen); ! /* added quick workaround so that hook can be cleared with two clicks ! ** that don't hook a new unit. Allows access to main popup menu ! */ ! static long lastMinID = 0; ! if ((nMinID == -1)&&(lastMinID != -1)) { - lastMinID = nMinID; return -1; } - lastMinID = nMinID; if (nMinID != currentHook) --- 1995,2002 ---- long nMinID = GetClosest(pscreen); ! if (nMinID == -1) { return -1; } if (nMinID != currentHook) *************** *** 2329,2333 **** void tcTacticalMapView::OnChar(wxKeyEvent& event) { ! event.Skip(); } --- 2330,2345 ---- void tcTacticalMapView::OnChar(wxKeyEvent& event) { ! int nChar = event.GetKeyCode(); ! ! if (nChar == WXK_ESCAPE) ! { ! if (GetHookCount() > 0) ! { ! ClearHook(); ! return; ! } ! } ! ! event.Skip(); } *************** *** 2373,2376 **** --- 2385,2393 ---- } + void tcTacticalMapView::OnLButtonDClick(wxMouseEvent& event) + { + ClearHook(); + } + /** * Check if button is down near a nav waypoint-- if so, start edit *************** *** 2401,2406 **** --- 2418,2427 ---- void tcTacticalMapView::OnLButtonUp(wxMouseEvent& event) { + // a hack to stop incomplete drags when the user lets go of the mouse button + tcDragStatus::Get()->StopDrag(); + if (!isLButtonDown) return; + wxPoint buttonUpPoint = event.GetPosition(); Index: tcFlightPortGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcFlightPortGui.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcFlightPortGui.cpp 7 Jul 2005 01:13:43 -0000 1.3 --- tcFlightPortGui.cpp 18 Dec 2005 18:48:17 -0000 1.4 *************** *** 324,332 **** /** ! * If right button is clicked on launch spot, launch the entity item in spot ! * Otherwise open a platform gui for the entity */ ! void tcFlightPortGui::OnRButtonDown(wxMouseEvent& event) { tcFlightPort* flightPort = GetFlightPort(); if (flightPort == 0) return; --- 324,333 ---- /** ! * Launch clicked entity if in launch spot */ ! void tcFlightPortGui::OnLButtonDClick(wxMouseEvent& event) { + tcContainerGui::OnLButtonDClick(event); + tcFlightPort* flightPort = GetFlightPort(); if (flightPort == 0) return; *************** *** 348,352 **** } ! for (size_t n=readyOffset; n<nSlots; n++) { tcContainerSlot& slot = slots[n]; --- 349,370 ---- } ! } ! ! /** ! * Open a platform gui for the clicked entity ! */ ! void tcFlightPortGui::OnRButtonDown(wxMouseEvent& event) ! { ! tcFlightPort* flightPort = GetFlightPort(); ! if (flightPort == 0) return; ! ! wxPoint point = event.GetPosition(); ! ! float x = (float)point.x; ! float y = (float)point.y; ! ! size_t nSlots = slots.size(); ! ! for (size_t n=launchOffset; n<nSlots; n++) { tcContainerSlot& slot = slots[n]; Index: tc3DWindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DWindow.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** tc3DWindow.cpp 12 Dec 2005 02:37:01 -0000 1.28 --- tc3DWindow.cpp 18 Dec 2005 18:48:17 -0000 1.29 *************** *** 61,64 **** --- 61,65 ---- EVT_MOVE(tc3DWindow::OnMove) EVT_LEFT_DOWN(tc3DWindow::OnLButtonDown) + EVT_LEFT_DCLICK(tc3DWindow::OnLButtonDClick) EVT_LEFT_UP(tc3DWindow::OnLButtonUp) EVT_RIGHT_DOWN(tc3DWindow::OnRButtonDown) *************** *** 155,158 **** --- 156,164 ---- } + void tc3DWindow::OnLButtonDClick(wxMouseEvent& event) + { + SkipMouseEvent(event); + } + void tc3DWindow::OnLButtonUp(wxMouseEvent& event) { Index: tcContainerGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcContainerGui.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcContainerGui.cpp 14 Jul 2005 23:42:22 -0000 1.3 --- tcContainerGui.cpp 18 Dec 2005 18:48:17 -0000 1.4 *************** *** 251,254 **** --- 251,266 ---- float y = (float)point.y; + + isLButtonDown = true; + if ((point.y <= 10) || (point.y >= mnHeight)) + { + windowDragOn = true; + // position in parent's frame of mouse pointer + windowDragPoint = wxPoint(mrectWindow.GetLeft() + point.x, mrectWindow.GetBottom() + point.y); + + CaptureMouse(); + return; + } + dragIsArmed = false; dragSlotIdx = 999; *************** *** 270,275 **** --- 282,298 ---- } + void tcContainerGui::OnLButtonDClick(wxMouseEvent& event) + { + dragIsArmed = false; + dragSlotIdx = 999; + } + void tcContainerGui::OnLButtonUp(wxMouseEvent& event) { + isLButtonDown = false; + windowDragOn = false; + ReleaseMouse(); + + dragIsArmed = false; *************** *** 321,324 **** --- 344,349 ---- wxPoint point = event.GetPosition(); + UpdateWindowDrag(point); + // update mouseover status of all slots float x = (float)point.x; *************** *** 357,360 **** --- 382,402 ---- } + void tcContainerGui::UpdateWindowDrag(const wxPoint& pos) + { + if (!windowDragOn) return; + + + // position in parent's frame of mouse pointer + wxPoint current = wxPoint(mrectWindow.GetLeft() + pos.x, mrectWindow.GetBottom() + pos.y); + if (current != windowDragPoint) + { + wxPoint delta = current - windowDragPoint; + int xmove = mrectWindow.GetLeft() + delta.x; + int ymove = mrectWindow.GetTop() + delta.y; + tc3DWindow::MoveWindow(xmove, ymove); + windowDragPoint = current; + } + } + void tcContainerGui::SetParentItem(tcContainerItem* item) { *************** *** 370,374 **** drawCount(0), dragIsArmed(false), ! parentItem(0) { SetBaseRenderBin(parent->GetBaseRenderBin() + 10); --- 412,418 ---- drawCount(0), dragIsArmed(false), ! parentItem(0), ! isLButtonDown(false), ! windowDragOn(false) { SetBaseRenderBin(parent->GetBaseRenderBin() + 10); Index: tc3DModel.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DModel.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** tc3DModel.cpp 27 Nov 2005 22:21:29 -0000 1.32 --- tc3DModel.cpp 18 Dec 2005 18:48:17 -0000 1.33 *************** *** 416,422 **** /** * Retrieves launcher info for launcher <idx> ! * Zero is used as default if idx out of range */ ! void tc3DModel::GetLauncherInfo(unsigned int idx, osg::Vec3& pos, float& az) { if (idx >= launcherInfo.size()) --- 416,422 ---- /** * Retrieves launcher info for launcher <idx> ! * Zeros are used as default if idx out of range (xml file missing launcher info) */ ! void tc3DModel::GetLauncherInfo(unsigned int idx, osg::Vec3& pos, float& az, float& el) const { if (idx >= launcherInfo.size()) *************** *** 424,427 **** --- 424,428 ---- pos.set(0, 0, 0); az = 0; + el = 0; return; } *************** *** 429,432 **** --- 430,434 ---- pos = launcherInfo[idx].position; az = launcherInfo[idx].pointingAzimuth; + el = launcherInfo[idx].pointingElevation; } *************** *** 713,724 **** double z = 0; double az = 0; ! elt->Attribute("X", &x); elt->Attribute("Y", &y); elt->Attribute("Z", &z); elt->Attribute("Az", &az); info.position.set(x, y, z); info.pointingAzimuth = az; launcherInfo.push_back(info); --- 715,728 ---- double z = 0; double az = 0; ! double el = 0; elt->Attribute("X", &x); elt->Attribute("Y", &y); elt->Attribute("Z", &z); elt->Attribute("Az", &az); + elt->Attribute("El", &el); info.position.set(x, y, z); info.pointingAzimuth = az; + info.pointingElevation = el; launcherInfo.push_back(info); |
|
From: Dewitt C. <ddc...@us...> - 2005-12-18 18:48:28
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17709/include/graphics Modified Files: tc3DModel.h tc3DWindow.h tcContainerGui.h tcFlightportGui.h tcMapView.h Log Message: mission editor mode changes Index: tc3DModel.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DModel.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** tc3DModel.h 27 Nov 2005 22:21:28 -0000 1.19 --- tc3DModel.h 18 Dec 2005 18:48:15 -0000 1.20 *************** *** 116,120 **** tcGameObject* GetGameObj() const {return gameObj;} ! void GetLauncherInfo(unsigned int idx, osg::Vec3& pos, float& az); void GetLocationParams(LocationParams& p); osg::Node* GetModelNode(); ///< model node in model frame, no transforms --- 116,120 ---- tcGameObject* GetGameObj() const {return gameObj;} ! void GetLauncherInfo(unsigned int idx, osg::Vec3& pos, float& az, float& el) const; void GetLocationParams(LocationParams& p); osg::Node* GetModelNode(); ///< model node in model frame, no transforms *************** *** 150,153 **** --- 150,154 ---- osg::Vec3 position; ///< start pos for launched item in body coords, default (0,0,0) float pointingAzimuth; ///< start rel az of launched item rel to nose, default 0 + float pointingElevation; ///< relative elevation, default 0 }; tcSmoker smokeTrails; Index: tcFlightportGui.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcFlightportGui.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcFlightportGui.h 22 Jun 2005 01:21:26 -0000 1.2 --- tcFlightportGui.h 18 Dec 2005 18:48:16 -0000 1.3 *************** *** 70,73 **** --- 70,74 ---- //virtual void OnLeaveWindow(wxMouseEvent& event); //virtual void OnMouseMove(wxMouseEvent& event); + virtual void OnLButtonDClick(wxMouseEvent& event); virtual void OnRButtonDown(wxMouseEvent& event); Index: tc3DWindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DWindow.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** tc3DWindow.h 12 Dec 2005 02:37:01 -0000 1.20 --- tc3DWindow.h 18 Dec 2005 18:48:16 -0000 1.21 *************** *** 269,272 **** --- 269,273 ---- virtual void OnKillFocus(wxFocusEvent& event); virtual void OnLButtonDown(wxMouseEvent& event); + virtual void OnLButtonDClick(wxMouseEvent& event); virtual void OnLButtonUp(wxMouseEvent& event); virtual void OnLeaveWindow(wxMouseEvent& event); Index: tcMapView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMapView.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** tcMapView.h 18 Dec 2005 04:10:32 -0000 1.23 --- tcMapView.h 18 Dec 2005 18:48:16 -0000 1.24 *************** *** 291,295 **** void ScrollMap(float afDirection_deg); void ClearMapCmd() {meMapCmd = MC_NONE;} ! void Draw(); void DrawGrid(); --- 291,295 ---- void ScrollMap(float afDirection_deg); void ClearMapCmd() {meMapCmd = MC_NONE;} ! void ClearHook(); void Draw(); void DrawGrid(); *************** *** 315,318 **** --- 315,319 ---- void OnLeaveWindow(wxMouseEvent& event); void OnLButtonDown(wxMouseEvent& event); + void OnLButtonDClick(wxMouseEvent& event); void OnLButtonUp(wxMouseEvent& event); void OnLButtonDownMapCmd(wxPoint point); Index: tcContainerGui.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcContainerGui.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcContainerGui.h 11 Jun 2005 21:01:43 -0000 1.1 --- tcContainerGui.h 18 Dec 2005 18:48:16 -0000 1.2 *************** *** 77,80 **** --- 77,81 ---- //virtual void OnEnterWindow(wxMouseEvent& event); virtual void OnLButtonDown(wxMouseEvent& event); + virtual void OnLButtonDClick(wxMouseEvent& event); virtual void OnLButtonUp(wxMouseEvent& event); virtual void OnLeaveWindow(wxMouseEvent& event); *************** *** 100,107 **** bool dragIsArmed; ///< true to start drag when mouse is moved size_t dragSlotIdx; ///< slot idx to drag if armed ! bool FinishDestroy(); virtual void HandleDrop(size_t slotIdx, tcContainerItem* item); ! private: bool destroy; ///< workaround to delay destruction of window to safe time --- 101,113 ---- bool dragIsArmed; ///< true to start drag when mouse is moved size_t dragSlotIdx; ///< slot idx to drag if armed ! // params for window drag (move this function to base class?) ! bool isLButtonDown; ! bool windowDragOn; ! wxPoint windowDragPoint; ! bool FinishDestroy(); virtual void HandleDrop(size_t slotIdx, tcContainerItem* item); ! void UpdateWindowDrag(const wxPoint& pos); ! private: bool destroy; ///< workaround to delay destruction of window to safe time |
|
From: Dewitt C. <ddc...@us...> - 2005-12-18 18:48:28
|
Update of /cvsroot/gcblue/gcb_wx/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17709/scripts Modified Files: Menu.py MissionEditCommands.py Log Message: mission editor mode changes Index: MissionEditCommands.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/MissionEditCommands.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MissionEditCommands.py 18 Dec 2005 04:10:33 -0000 1.1 --- MissionEditCommands.py 18 Dec 2005 18:48:16 -0000 1.2 *************** *** 13,16 **** --- 13,20 ---- UI.RenamePlatform(name) + # Saves game to "Saved/<datetime string>.py" + def SaveGame(SM): + SM.SaveGame('Saved') + # Switch user alliance to next alliance # Assumes alliances range from 1 to 8 Index: Menu.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/Menu.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Menu.py 18 Dec 2005 04:10:33 -0000 1.20 --- Menu.py 18 Dec 2005 18:48:16 -0000 1.21 *************** *** 333,336 **** --- 333,338 ---- UnitMenu.Clear() + UnitMenu.AddItem('Save game', 'SaveGame') + UnitMenu.AddItem('Toggle alliance','ToggleAlliance') |
|
From: Dewitt C. <ddc...@us...> - 2005-12-18 18:48:26
|
Update of /cvsroot/gcblue/gcb_wx/include/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17709/include/scriptinterface Modified Files: tcScenarioInterface.h Log Message: mission editor mode changes Index: tcScenarioInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcScenarioInterface.h,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** tcScenarioInterface.h 18 Dec 2005 04:10:32 -0000 1.24 --- tcScenarioInterface.h 18 Dec 2005 18:48:16 -0000 1.25 *************** *** 126,129 **** --- 126,130 ---- void GetStartTheater(double& lon_deg, double& lat_deg) const; int GetUserAlliance() const; + void SaveGame(const std::string& fileName); void SetAllianceGoal(int alliance, tcGoal& goal); void SetDateTime(int year, int month, int day, int hour, int min, int sec); |