gcblue-commits Mailing List for Global Conflict Blue (Page 7)
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-09-28 02:01:56
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32752/src/graphics Modified Files: tcFlightPortGui.cpp tcPlatformGui.cpp Log Message: Initial airbase automation work Index: tcPlatformGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcPlatformGui.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcPlatformGui.cpp 6 Sep 2006 01:28:20 -0000 1.12 --- tcPlatformGui.cpp 28 Sep 2006 02:01:53 -0000 1.13 *************** *** 110,114 **** tcPlatformObject* platform = GetPlatform(); ! tcStores* mag = GetLoadoutStores(); if (mag != 0) { --- 110,117 ---- tcPlatformObject* platform = GetPlatform(); ! ! if (platform != 0) platform->EquipForTargetType(loadoutType); ! ! /*tcStores* mag = GetLoadoutStores(); if (mag != 0) { *************** *** 118,122 **** { fprintf(stderr, "tcPlatformGui::OnLoadoutCommand -- No compatible magazine found\n"); ! } } --- 121,125 ---- { fprintf(stderr, "tcPlatformGui::OnLoadoutCommand -- No compatible magazine found\n"); ! }*/ } *************** *** 750,753 **** --- 753,759 ---- const osg::Vec4 on_avail(1.0, 1.0, 1.0, 0.8); + const osg::Vec4 off_equipped(0.2, 0.5, 0.2, 0.8); + const osg::Vec4 over_equipped(0.4, 1.0, 0.4, 0.8); + const osg::Vec4 on_equipped(1.0, 1.0, 1.0, 0.8); *************** *** 763,767 **** button->SetInteractive(available); ! if (available) { button->SetFillColors(off_avail, over_avail, on_avail); --- 769,779 ---- button->SetInteractive(available); ! bool equipped = platform->IsEquippedForTargetType(tgt_flags[n]); ! ! if (equipped) ! { ! button->SetFillColors(off_equipped, over_equipped, on_equipped); ! } ! else if (available) { button->SetFillColors(off_avail, over_avail, on_avail); Index: tcFlightPortGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcFlightPortGui.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcFlightPortGui.cpp 5 Sep 2006 01:04:25 -0000 1.9 --- tcFlightPortGui.cpp 28 Sep 2006 02:01:53 -0000 1.10 *************** *** 62,65 **** --- 62,70 ---- } + long tcEntityContainerItem::GetPlatformId() const + { + return platformId; + } + void tcEntityContainerItem::SetDescription(const std::string& s) { *************** *** 72,78 **** } ! void tcEntityContainerItem::SetEntity(long id, long host) { ! platformId = id; hostId = host; } --- 77,83 ---- } ! void tcEntityContainerItem::SetEntity(long platformId_, long host) { ! platformId = platformId_; hostId = host; } *************** *** 114,118 **** item->SetQuantity(0); ! if (airState->current_location == TRANSIT) { item->SetDrawState(tcContainerItem::BLINK); --- 119,123 ---- item->SetQuantity(0); ! if (airState->inTransit) { item->SetDrawState(tcContainerItem::BLINK); *************** *** 237,241 **** { tcContainerSlot& slot = slots[slotIdx]; ! if (!slot.IsEmpty()) return; // slot must be empty for flightport move tcEntityContainerItem* entityItem = dynamic_cast<tcEntityContainerItem*>(item); --- 242,246 ---- { tcContainerSlot& slot = slots[slotIdx]; ! //if (!slot.IsEmpty()) return; // slot must be empty for flightport move, move will queue until slot is empty tcEntityContainerItem* entityItem = dynamic_cast<tcEntityContainerItem*>(item); *************** *** 349,352 **** --- 354,371 ---- } + // search all slots and schedule launch (will be queued if necessary) + for (size_t n=0; n<nSlots; n++) + { + if (slots[n].loc.ContainsPoint(x, y)) + { + tcEntityContainerItem* entityItem = dynamic_cast<tcEntityContainerItem*>(slots[n].GetItem()); + if (entityItem != 0) + { + flightPort->LaunchID(entityItem->GetPlatformId()); + } + return; + } + } + } *************** *** 504,511 **** int loc; unsigned spotPos; ! if (airState->current_location == TRANSIT) { ! loc = airState->goal_location; ! spotPos = (unsigned)airState->goal_spot; } else --- 523,530 ---- int loc; unsigned spotPos; ! if (airState->inTransit) { ! loc = airState->current_location; ! spotPos = (unsigned)airState->current_spot; } else |
From: Dewitt C. <ddc...@us...> - 2006-09-28 02:01:56
|
Update of /cvsroot/gcblue/gcb_wx/include/scriptinterface In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32752/include/scriptinterface Modified Files: tcFlightPortInterface.h Log Message: Initial airbase automation work Index: tcFlightPortInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcFlightPortInterface.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcFlightPortInterface.h 17 Aug 2006 01:27:10 -0000 1.10 --- tcFlightPortInterface.h 28 Sep 2006 02:01:52 -0000 1.11 *************** *** 105,108 **** --- 105,110 ---- void SetDestination(int n, int dest_code); + void AddCAPMission(); + tcFlightPortInterface(); virtual ~tcFlightPortInterface(); |
From: Dewitt C. <ddc...@us...> - 2006-09-28 02:01:56
|
Update of /cvsroot/gcblue/gcb_wx/scripts In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32752/scripts Modified Files: Menu.py UnitCommands.py Log Message: Initial airbase automation work Index: UnitCommands.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/UnitCommands.py,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** UnitCommands.py 5 Sep 2006 01:04:24 -0000 1.29 --- UnitCommands.py 28 Sep 2006 02:01:52 -0000 1.30 *************** *** 427,431 **** ! --- 427,435 ---- ! def AddCAPMission(UI): ! if (not UI.HasFlightPort()): ! return ! FP = UI.GetFlightPortInfo() ! FP.AddCAPMission() Index: Menu.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/Menu.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Menu.py 16 Sep 2006 14:01:24 -0000 1.26 --- Menu.py 28 Sep 2006 02:01:52 -0000 1.27 *************** *** 155,158 **** --- 155,162 ---- if (UnitInfo.HasFlightPort()): UnitMenu.AddItem('Flight deck [f]', 'ShowFlightPanel') + UnitMenu.AddItem('Add mission', '') + UnitMenu.BeginSubMenu() + UnitMenu.AddItem('CAP test', 'AddCAPMission') + UnitMenu.EndSubMenu() if (UnitInfo.IsPlayerControlled()): |
From: Dewitt C. <ddc...@us...> - 2006-09-28 02:01:56
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32752/src/scriptinterface Modified Files: tcFlightPortInterface.cpp Log Message: Initial airbase automation work Index: tcFlightPortInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcFlightPortInterface.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcFlightPortInterface.cpp 17 Aug 2006 01:28:04 -0000 1.11 --- tcFlightPortInterface.cpp 28 Sep 2006 02:01:53 -0000 1.12 *************** *** 35,38 **** --- 35,40 ---- #include "simmath.h" #include "tcSoundConsole.h" + #include "ai/tcMissionManager.h" + #include "ai/tcCAPMission.h" #ifdef _DEBUG *************** *** 70,73 **** --- 72,76 ---- .def("LaunchID", &tcFlightPortInterface::LaunchID) .def("SetDestination", &tcFlightPortInterface::SetDestination) + .def("AddCAPMission", &tcFlightPortInterface::AddCAPMission) .def("GetLocalObj",&tcFlightPortInterface::GetLocalObj) ; *************** *** 79,82 **** --- 82,99 ---- tcSoundConsole* tcFlightPortInterface::mpConsole = 0; + + void tcFlightPortInterface::AddCAPMission() + { + if (flightport == 0) return; + + tcMissionManager* missionManager = flightport->GetMissionManager(); + + tcCAPMission* cap = new tcCAPMission(); + cap->SetStation(0, 0); + + missionManager->AddMission(cap); + + } + // Interface function declaration double tcFlightPortInterface::GetTime() |
From: Dewitt C. <ddc...@us...> - 2006-09-28 02:01:56
|
Update of /cvsroot/gcblue/gcb_wx/docs In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32752/docs Modified Files: CHANGES.txt Log Message: Initial airbase automation work Index: CHANGES.txt =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/docs/CHANGES.txt,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** CHANGES.txt 16 Sep 2006 14:01:23 -0000 1.58 --- CHANGES.txt 28 Sep 2006 02:01:52 -0000 1.59 *************** *** 1,5 **** CHANGES ! 0.8.3 --------------------------------------------------------------------- --- 1,14 ---- CHANGES ! *** 2006-09-27 *** ! - More airbase automation work ! ! *** 2006-09-24 *** ! - Upgraded to OSG 1.2. Tried Demeter 4.0 but had to go back. It's not backwards compatible. ! - Added border to 3D view, alt-f to toggle frame counter ! - Fix for passive torpedo bug ! ! ! 0.8.3 r1 --------------------------------------------------------------------- |
From: Dewitt C. <ddc...@us...> - 2006-09-28 02:01:55
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32752/include/graphics Modified Files: tcFlightportGui.h Log Message: Initial airbase automation work Index: tcFlightportGui.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcFlightportGui.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcFlightportGui.h 22 Mar 2006 01:23:28 -0000 1.4 --- tcFlightportGui.h 28 Sep 2006 02:01:52 -0000 1.5 *************** *** 41,47 **** const std::string& GetDescription() const; tcGameObject* GetEntity() const; void SetDescription(const std::string& s); void SetDescription(const char* s); ! void SetEntity(long id, long host); tcEntityContainerItem(); --- 41,48 ---- const std::string& GetDescription() const; tcGameObject* GetEntity() const; + long GetPlatformId() const; void SetDescription(const std::string& s); void SetDescription(const char* s); ! void SetEntity(long platformId_, long host); tcEntityContainerItem(); |
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv11768/include/graphics Modified Files: tc3DTerrain.h tc3DViewer.h tc3DWindow.h tcDisplayModes.h tcMapView.h Added Files: tcGraphicsInfo.h Removed Files: tcGraphicsEngine.h Log Message: Upgraded to OSG 1.2. Tried Demeter 4.0 but had to go back. It's not backwards compatible. Added border to 3D view, alt-f to toggle frame counter Fix for passive torpedo bug Index: tc3DTerrain.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DTerrain.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tc3DTerrain.h 22 Mar 2006 01:23:28 -0000 1.15 --- tc3DTerrain.h 24 Sep 2006 19:50:19 -0000 1.16 *************** *** 28,31 **** --- 28,34 ---- + #include <Demeter/Terrain.h> + #include <Demeter/Loader.h> + #include <Demeter/DemeterDrawable.h> #include <osg/Geode> *************** *** 34,40 **** #include <osgUtil/Optimizer> - #include <Demeter/Terrain.h> - #include <Demeter/Loader.h> - #include <Demeter/DemeterDrawable.h> class tcMapData; --- 37,40 ---- Index: tcMapView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMapView.h,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** tcMapView.h 16 Sep 2006 14:01:23 -0000 1.31 --- tcMapView.h 24 Sep 2006 19:50:19 -0000 1.32 *************** *** 295,298 **** --- 295,299 ---- void DrawSelectionBox(); void DrawTerrainText(); + void DrawTime(); void DrawMapCmd(tcMapObj *pMO, teMapCmdType type); void DrawMapCmdRange(); *************** *** 331,334 **** --- 332,337 ---- void SetDateTime(const std::string& s) {dateTime = s;} void SetHookID(long id); + bool GetShowFrameCounter() const; + void SetShowFrameCounter(bool state); void SetGroupHook(std::vector<long>& hookedUnits); void SetTextLeftMargin(float x); *************** *** 367,370 **** --- 370,375 ---- wxPoint buttonDownPoint; ///< start point for click-drag operations float leftMargin; ///< screen position to use for info text and symbols + bool showFrameCounter; ///< true to show FPS display + void Build2525(); *************** *** 391,394 **** --- 396,400 ---- osg::Geometry* DrawNTDSMissile(teAffiliation affil); osg::Geometry* DrawNTDSSubsurface(teAffiliation affil); + osg::Geometry* DrawNTDSCarrier(teAffiliation affil); osg::Geometry* DrawNTDSTorpedo(teAffiliation affil); osg::Geometry* DrawNTDSUnknown(teAffiliation affil); *************** *** 415,419 **** void ChangeTheater(float lon_deg, float lat_deg); ! int CreateSurfaces(tcGraphicsEngine* apGraphicsEngine); void Draw(); void DrawGrid(); --- 421,425 ---- void ChangeTheater(float lon_deg, float lat_deg); ! int CreateSurfaces(tcGraphicsInfo* apGraphicsEngine); void Draw(); void DrawGrid(); Index: tc3DViewer.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DViewer.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tc3DViewer.h 21 Apr 2006 23:28:31 -0000 1.15 --- tc3DViewer.h 24 Sep 2006 19:50:19 -0000 1.16 *************** *** 75,82 **** --- 75,84 ---- osg::ref_ptr<osgText::Text> viewerText; ///< text for debug/basic viewer info display + osg::ref_ptr<osg::Geometry> border; ///< border graphics osg::ref_ptr<osg::MatrixTransform> guiObjects; osg::ref_ptr<osg::MatrixTransform> hudObjects; ///< add HUD objects to this transform osg::ref_ptr<osg::Projection> orthoProjection; ///< ortho projection for HUD objects osg::ref_ptr<osg::Geode> textGeode; + osg::ref_ptr<osg::Geode> borderGeode; osg::ref_ptr<osg::Transform> skyTransform; osg::ref_ptr<osg::Group> foggedObjects; ///< fog applied to this group *************** *** 100,103 **** --- 102,106 ---- virtual void OnKeyDown(wxKeyEvent& event); virtual void OnLButtonDown(wxMouseEvent& event); + virtual void OnLButtonDClick(wxMouseEvent& event); virtual void OnLButtonUp(wxMouseEvent& event); virtual void OnLeaveWindow(wxMouseEvent& event); *************** *** 143,146 **** --- 146,150 ---- void SetActive(bool b); + void SetBorderActive(bool state); void SetCameraMode(bool lookAt, bool moveWith); void SetClearMode(int modeCode); *************** *** 184,187 **** --- 188,192 ---- bool isFrozen; ///< set true if window has been frozen bool isActive; + bool isBorderActive; bool isTerrainActive; bool impostorModeActive; ///< true if 3D is in imposter mode *************** *** 247,250 **** --- 252,256 ---- void InitText(); void SetOrigin(double lon, double lat); ///< sets origin of 3D world coordinates + void UpdateBorder(); void UpdateCamera(); void UpdateCameraDatabaseView(); --- tcGraphicsEngine.h DELETED --- Index: tcDisplayModes.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcDisplayModes.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcDisplayModes.h 22 Mar 2006 01:23:28 -0000 1.3 --- tcDisplayModes.h 24 Sep 2006 19:50:19 -0000 1.4 *************** *** 41,44 **** --- 41,45 ---- unsigned int bits; unsigned int frequency; + std::string deviceDescription; }; Index: tc3DWindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DWindow.h,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** tc3DWindow.h 17 Aug 2006 01:27:10 -0000 1.27 --- tc3DWindow.h 24 Sep 2006 19:50:19 -0000 1.28 *************** *** 55,59 **** ! class tcGraphicsEngine; class tc3DViewer; --- 55,59 ---- ! class tcGraphicsInfo; class tc3DViewer; --- NEW FILE: tcGraphicsInfo.h --- /* ** tcGraphicsInfo.h: interface for the tcGraphicsInfo class. ** ** Copyright (C) 2003 Dewitt Colclough (de...@gc...) ** 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 */ #ifndef _tcGraphicsInfo_H_ #define _tcGraphicsInfo_H_ #if _MSC_VER > 1000 #pragma once #endif #ifndef WX_PRECOMP #include "wx/wx.h" #ifdef WIN32 #include "wx/msw/private.h" // for MS Windows specific definitions #endif // WIN32 #endif // WX_PRECOMP #include <GL/gl.h> // Header file for the OpenGL32 library #include <GL/glu.h> // Header file for the GLu32 library // had to remove (change name) GLAux.lib from SDK directory to avoid __ftol error // GLAux.lib from VC98 directory works #include <GL/glaux.h> // Header file for the GLaux library #include <string> #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 /** * Singleton class for 2D graphics using OpenGL. This is a holdover * from old code and eventually should be replaced with OSG * functionality. */ class tcGraphicsInfo { public: static tcGraphicsInfo * Get(); ///< method to access singleton instance std::string GetDriverInfo(); bool Is3DCapable(); bool Is3DAlphaCapable(); void LogGLInfo(); void LogPixelFormats(); private: bool mbInitialized; int mnWindowWidth; int mnWindowHeight; char mzTexturePath[255]; void CheckGLError(const char* location = 0); tcGraphicsInfo(); tcGraphicsInfo(const tcGraphicsInfo& src); ~tcGraphicsInfo(); }; #endif |
From: Dewitt C. <ddc...@us...> - 2006-09-24 19:50:25
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv11768/src/sim Modified Files: Game.cpp tcTorpedoObject.cpp Log Message: Upgraded to OSG 1.2. Tried Demeter 4.0 but had to go back. It's not backwards compatible. Added border to 3D view, alt-f to toggle frame counter Fix for passive torpedo bug Index: tcTorpedoObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcTorpedoObject.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** tcTorpedoObject.cpp 18 Jun 2006 00:45:04 -0000 1.19 --- tcTorpedoObject.cpp 24 Sep 2006 19:50:20 -0000 1.20 *************** *** 201,205 **** seeker->SetActiveSonar(); } ! //seeker->SetActive(false); // override default for passive to always be active wxString s = wxString::Format("Torp %d-%d", obj->mnID, rand() % 1000); --- 201,207 ---- seeker->SetActiveSonar(); } ! ! seeker->mnMode = SSMODE_SEEKERSEARCH; ! seeker->SetActive(false); // override default for passive to always be active wxString s = wxString::Format("Torp %d-%d", obj->mnID, rand() % 1000); Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.159 retrieving revision 1.160 diff -C2 -d -r1.159 -r1.160 *** Game.cpp 16 Sep 2006 14:01:24 -0000 1.159 --- Game.cpp 24 Sep 2006 19:50:20 -0000 1.160 *************** *** 104,107 **** --- 104,108 ---- EVT_COMMAND(ID_NEWHOOK, wxEVT_COMMAND_BUTTON_CLICKED, tcGame::NewHook) EVT_COMMAND(ID_GROUPHOOK, wxEVT_COMMAND_BUTTON_CLICKED, tcGame::NewGroupHook) + EVT_COMMAND(ID_DCLICKHOOK, wxEVT_COMMAND_BUTTON_CLICKED, tcGame::DoubleClickHook) EVT_COMMAND(ID_SECONDARYHOOK, wxEVT_COMMAND_BUTTON_CLICKED, tcGame::SecondaryHook) EVT_COMMAND(ID_SETBRIEFING, wxEVT_COMMAND_BUTTON_CLICKED, tcGame::SetBriefingMode) *************** *** 219,222 **** --- 220,235 ---- } + /** + * m_extraLong has bitfield describing keys pressed during double clidk: + * 1 - shift pressed, 2 - ctrl pressed, 4 - alt pressed + */ + void tcGame::DoubleClickHook(wxCommandEvent& event) + { + unsigned int flags = (unsigned int)(event.GetExtraLong()); + + pythonInterface->ProcessDoubleClickHook(flags); + } + + void tcGame::EndGame(wxCommandEvent& event) { *************** *** 566,570 **** /* ** Init graphics engine * **/ ! mpGraphicsEngine = tcGraphicsEngine::Get(); tc3DWindow::Set3DViewer(viewer); --- 579,583 ---- /* ** Init graphics engine * **/ ! mpGraphicsEngine = tcGraphicsInfo::Get(); tc3DWindow::Set3DViewer(viewer); *************** *** 1622,1626 **** viewer->SetCameraSpinRate(0.01f); ! if (meScreenMode != DATABASEVIEW) --- 1635,1639 ---- viewer->SetCameraSpinRate(0.01f); ! viewer->SetBorderActive(false); if (meScreenMode != DATABASEVIEW) *************** *** 1742,1745 **** --- 1755,1759 ---- oobView->SetActive(drawEdgeWindows); viewer->SetActive(mb3DActive); + viewer->SetBorderActive(true); gameWindow->SetActive(true); *************** *** 1787,1790 **** --- 1801,1805 ---- worldMap->SetActive(drawTacticalMap); viewer->SetActive(mb3DActive); + viewer->SetBorderActive(true); gameWindow->SetActive(true); *************** *** 1846,1849 **** --- 1861,1865 ---- Update3DSize(); viewer->SetCameraSpinRate(0.01f); + viewer->SetBorderActive(false); /// reselect display class to update camera range databaseViewer->SelectDisplayClass(databaseViewer->GetDisplayClass()); *************** *** 2445,2449 **** --- 2461,2474 ---- } + switch (nChar) + { + case 'f': + tacticalMap->SetShowFrameCounter(!tacticalMap->GetShowFrameCounter()); + break; + } + + return; } + if (controlDown) { *************** *** 2461,2468 **** { case 'a': accelerateTime = 2*(accelerateTime + 1) - 1; if (accelerateTime > 31) { ! accelerateTime = 0; // return to normal time after 8x } return; --- 2486,2494 ---- { case 'a': + case '+': accelerateTime = 2*(accelerateTime + 1) - 1; if (accelerateTime > 31) { ! accelerateTime = 31; } return; *************** *** 2488,2495 **** return; case 'A': accelerateTime = (accelerateTime + 1)/2 - 1; if (accelerateTime < 0) { ! accelerateTime = 0; // return to normal time after 8x } return; --- 2514,2522 ---- return; case 'A': + case '-': accelerateTime = (accelerateTime + 1)/2 - 1; if (accelerateTime < 0) { ! accelerateTime = 0; } return; |
From: Dewitt C. <ddc...@us...> - 2006-09-24 19:50:25
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv11768/src/graphics Modified Files: tc3DTerrain.cpp tc3DViewer.cpp tc3DWindow.cpp tcDatabaseInfoPanel.cpp tcDisplayModes.cpp tcDisplaySettingsView.cpp tcMapView.cpp tcTerrainTextureFactory.cpp Added Files: tcGraphicsInfo.cpp Removed Files: tcGraphicsEngine.cpp Log Message: Upgraded to OSG 1.2. Tried Demeter 4.0 but had to go back. It's not backwards compatible. Added border to 3D view, alt-f to toggle frame counter Fix for passive torpedo bug Index: tcDatabaseInfoPanel.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcDatabaseInfoPanel.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcDatabaseInfoPanel.cpp 20 Aug 2006 22:24:02 -0000 1.2 --- tcDatabaseInfoPanel.cpp 24 Sep 2006 19:50:20 -0000 1.3 *************** *** 248,251 **** --- 248,257 ---- s.Printf("ERROR: Launcher not found (%s)", launcherClass.c_str()); } + + if (s.size() > 70) + { + s = s.SubString(0, 69) + "..."; + } + PrintText(20.0, y, "%s", s.c_str()); } Index: tc3DTerrain.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DTerrain.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** tc3DTerrain.cpp 23 Mar 2006 01:11:02 -0000 1.21 --- tc3DTerrain.cpp 24 Sep 2006 19:50:20 -0000 1.22 *************** *** 250,254 **** void tc3DTerrain::UpdateElevations() { - wxASSERT(mapData); --- 250,253 ---- *************** *** 389,393 **** texFactory(0) { - terrainShaderOn = tcOptions::Get()->terrainShaderOn; --- 388,391 ---- Index: tcTerrainTextureFactory.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcTerrainTextureFactory.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcTerrainTextureFactory.cpp 23 Mar 2006 01:11:02 -0000 1.13 --- tcTerrainTextureFactory.cpp 24 Sep 2006 19:50:20 -0000 1.14 *************** *** 34,37 **** --- 34,38 ---- #endif // WX_PRECOM + //#include <GL/glew.h> // to avoid gl.h included before glew.h error #include "tcTerrainTextureFactory.h" #include <osg/Image> Index: tc3DViewer.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DViewer.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** tc3DViewer.cpp 5 Sep 2006 01:04:25 -0000 1.37 --- tc3DViewer.cpp 24 Sep 2006 19:50:20 -0000 1.38 *************** *** 27,30 **** --- 27,31 ---- #endif + //#include <GL/glew.h> // to avoid gl.h included before glew.h error #include "wx/glcanvas.h" *************** *** 68,71 **** --- 69,73 ---- #include "tcDatabase.h" #include "tcTime.h" + #include "wxcommands.h" *************** *** 85,88 **** --- 87,91 ---- EVT_MOVE(tc3DViewer::OnMove) EVT_LEFT_DOWN(tc3DViewer::OnLButtonDown) + EVT_LEFT_DCLICK(tc3DViewer::OnLButtonDClick) EVT_LEFT_UP(tc3DViewer::OnLButtonUp) EVT_RIGHT_DOWN(tc3DViewer::OnRButtonDown) *************** *** 289,292 **** --- 292,304 ---- } + void tc3DViewer::OnLButtonDClick(wxMouseEvent& event) + { + wxCommandEvent cmd(wxEVT_COMMAND_BUTTON_CLICKED, ID_SET3D); + cmd.SetEventObject(this); + cmd.SetExtraLong(0); // 0 to deactivate 3D view + + AddPendingEvent(cmd); + } + void tc3DViewer::OnLButtonUp(wxMouseEvent& event) { *************** *** 383,386 **** --- 395,400 ---- viewerText->setPosition(osg::Vec3(20.0f,(float)mnHeight * 0.9f,0.0f)); + UpdateBorder(); + databaseView->setViewport(pos.x, correctedY, size.GetWidth(), size.GetHeight()); } *************** *** 603,606 **** --- 617,647 ---- } + void tc3DViewer::SetBorderActive(bool state) + { + if (isBorderActive == state) return; // ignore if state not changed + + if ((!borderGeode.valid()) || (!border.valid())) return; + + + size_t nParents = border->getNumParents(); + + if (state) + { + if (nParents == 0) + { + borderGeode->addDrawable(border.get()); + } + } + else + { + if (nParents > 0) + { + borderGeode->removeDrawable(border.get()); + } + } + + isBorderActive = state; + } + /** * @param az camera az in radians for lookat modes *************** *** 821,824 **** --- 862,866 ---- } + void tc3DViewer::CreateScene() { *************** *** 890,893 **** --- 932,936 ---- InitText(); + UpdateBorder(); skyTransform->addChild(sky.get()); *************** *** 1065,1068 **** --- 1108,1159 ---- } + + + void tc3DViewer::UpdateBorder() + { + if (!borderGeode.valid()) + { + borderGeode = new osg::Geode; + hudObjects->addChild(borderGeode.get()); + } + wxASSERT(borderGeode.valid()); + + if (!border.valid()) + { + border = new osg::Geometry; + osg::Vec4Array* colors = new osg::Vec4Array; + colors->push_back(osg::Vec4(1.0f, 1.0f, 1.0f, 0.7f)); // sets border color + border->setColorArray(colors); + border->setColorBinding(osg::Geometry::BIND_OVERALL); + border->setUseDisplayList(true); + + // set state + osg::StateSet* stateSet = border->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::ON); + // osg::LineWidth *lw = new osg::LineWidth(1.5); + // stateSet->setAttribute(lw, osg::StateAttribute::ON); + + borderGeode->addDrawable(border.get()); + isBorderActive = true; + } + + // create vertex array + osg::Vec3Array* vertices = new osg::Vec3Array; + border->setVertexArray(vertices); + + float w = float(mnWidth-1); + float h = float(mnHeight-1); + + vertices->push_back(osg::Vec3(0, 0, 0)); + vertices->push_back(osg::Vec3(0, h, 0)); + vertices->push_back(osg::Vec3(w, h, 0)); + vertices->push_back(osg::Vec3(w, 0, 0)); + border->addPrimitiveSet(new osg::DrawArrays(GL_LINE_LOOP,0,4)); + } + + /** * Version for 3D database object view *************** *** 1195,1198 **** --- 1286,1290 ---- } + void tc3DViewer::UpdateCameraSpin() { *************** *** 1445,1453 **** displaySettings->setMinimumNumStencilBits(8); displaySettings->setDoubleBuffer(true); } databaseView->setDisplaySettings(displaySettings.get()); databaseView->setDefaults(); ! databaseView->setState(sceneView->getState()); --- 1537,1547 ---- displaySettings->setMinimumNumStencilBits(8); displaySettings->setDoubleBuffer(true); + displaySettings->setMinimumNumAlphaBits(8); } databaseView->setDisplaySettings(displaySettings.get()); databaseView->setDefaults(); ! ! databaseView->getState()->setContextID(2); // (sceneView->getState()); *************** *** 1489,1492 **** --- 1583,1587 ---- guiDisplaySettings->setMinimumNumStencilBits(8); guiDisplaySettings->setDoubleBuffer(true); + guiDisplaySettings->setMinimumNumAlphaBits(8); *************** *** 1494,1498 **** --- 1589,1597 ---- guiView->setDisplaySettings(guiDisplaySettings); guiView->setDefaults(); + //guiView->setState(sceneView->getState()); + + guiView->getState()->setContextID(1); + //guiView->getState()->setContextID(0); *************** *** 1546,1549 **** --- 1645,1651 ---- displaySettings->setDepthBuffer(true); displaySettings->setMinimumNumStencilBits(8); + displaySettings->setDoubleBuffer(true); + displaySettings->setMinimumNumAlphaBits(8); + // displaySettings->setRGB(true); *************** *** 1624,1637 **** displaySettings->setDepthBuffer(true); displaySettings->setMinimumNumStencilBits(8); } - // displaySettings->setRGB(true); - //displaySettings->setDoubleBuffer(true); - //displaySettings->setMinimumNumAlphaBits(4); sceneViewFar->setDisplaySettings(displaySettings.get()); sceneViewFar->setDefaults(); //sceneViewFar->setState(sceneView->getState()); ! //sceneViewFar->getState()->setContextID(0); wxWindow *parent = wxWindow::GetParent(); --- 1726,1739 ---- displaySettings->setDepthBuffer(true); displaySettings->setMinimumNumStencilBits(8); + displaySettings->setDoubleBuffer(true); + displaySettings->setMinimumNumAlphaBits(8); } sceneViewFar->setDisplaySettings(displaySettings.get()); sceneViewFar->setDefaults(); + //sceneViewFar->setState(sceneView->getState()); ! sceneViewFar->getState()->setContextID(0); wxWindow *parent = wxWindow::GetParent(); *************** *** 2124,2128 **** cameraWalkOffset(0, 0, 0), cameraSpinRate(0), ! lastSpinCount(0) { glCanvas = parent; --- 2226,2231 ---- cameraWalkOffset(0, 0, 0), cameraSpinRate(0), ! lastSpinCount(0), ! isBorderActive(false) { glCanvas = parent; Index: tcDisplaySettingsView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcDisplaySettingsView.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcDisplaySettingsView.cpp 23 Mar 2006 01:11:02 -0000 1.9 --- tcDisplaySettingsView.cpp 24 Sep 2006 19:50:20 -0000 1.10 *************** *** 32,35 **** --- 32,36 ---- #include "wxcommands.h" #include "tc3DWindow.h" + #include "tcGraphicsInfo.h" #ifdef _DEBUG *************** *** 81,84 **** --- 82,91 ---- osg::Vec4(1, 1, 1, 1), 16.0f, LEFT_BASE_LINE); + std::string driverInfo = tcGraphicsInfo::Get()->GetDriverInfo(); + driverInfo = std::string("Driver info: ") + driverInfo; + DrawTextR(driverInfo.c_str(), + 25.0f, 110.0f, defaultFont.get(), + osg::Vec4(1, 1, 1, 1), 16.0f, LEFT_BASE_LINE); + unsigned nModes = tcDisplayModes::Get()->GetModeCount(); Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapView.cpp,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** tcMapView.cpp 16 Sep 2006 14:01:24 -0000 1.48 --- tcMapView.cpp 24 Sep 2006 19:50:20 -0000 1.49 *************** *** 45,48 **** --- 45,49 ---- #include <osg/Geometry> #include <osg/Vec4> + #include <osg/LineWidth> #include <math.h> *************** *** 355,377 **** mrectViewBounds.Set(0,0,0,0); - - /* - mpPen = new Pen(Color(0xFEFFFFFF),2); - if (mpPen == NULL) {WTL("tcMapView - mpPen creation failed\n");} - - mpPenThin = new Pen(Color(0xFEFFFFFF),1); - if (mpPenThin == NULL) {WTL("tcMapView - mpPenThin creation failed\n");} - - FontFamily ff(L"Arial"); - mpFont = new Font(&ff,16,FontStyleBold,UnitPixel); - - if (mpFont == NULL) {WTL("tcMapView - mpFont creation failed\n");} - mpFontSmall = new Font(&ff,9,FontStyleBold,UnitPixel); - - if (mpFontSmall == NULL) {WTL("tcMapView - mpFontSmall creation failed\n");} - mpBrush = new SolidBrush(Color(0xFEFFFFFF)); // color is ARGB - if (mpBrush == NULL) {WTL("tcMapView - mpBrush creation failed\n");} - */ - specialGraphics.clear(); } --- 356,359 ---- *************** *** 761,794 **** /*** Draw date and time text ***/ ! tcString sText; ! ! // draw top info string based on mnGameMode, this function should go elsewhere? strange to have in map ! osg::Vec4 color(0.1, 0.1, 0.2, 1); ! ! if (mnGameMode == GAMEMODE_NORMAL) ! { ! if (mfFrameRate != 0) ! { ! sText.Format("%s [%3.1f FPS]",dateTime.c_str(),mfFrameRate); ! } ! else ! { ! sText.Format("%s [ -- FPS]",dateTime.c_str()); ! } ! } ! else if (mnGameMode == GAMEMODE_PAUSED) ! { ! sText.Format("%s ",dateTime.c_str()); ! color.set(1, 0.5, 0.5, 1); ! } ! else ! { ! sText.Format("%s (PAUSED -- EDIT)",dateTime.c_str()); ! //mpBrush->SetColor(Color(254,105,15,25)); ! color.set(0.1, 0.06, 0.42, 1); ! } ! ! DrawTextR(sText.GetBuffer(), leftMargin + 50.0, 50.0, ! defaultFont.get(), color, 16.0, LEFT_BASE_LINE); #if 0 --- 743,748 ---- /*** Draw date and time text ***/ ! DrawTime(); ! #if 0 *************** *** 853,856 **** --- 807,852 ---- } + void tcTacticalMapView::DrawTime() + { + tcString sText; + + // draw top info string based on mnGameMode, this function should go elsewhere? strange to have in map + osg::Vec4 color(1.0, 1.0, 1.0, 1); + + if (mnGameMode == GAMEMODE_NORMAL) + { + if (showFrameCounter) + { + if (mfFrameRate != 0) + { + sText.Format("%s [%3.1f FPS]", dateTime.c_str(), mfFrameRate); + } + else + { + sText.Format("%s [ -- FPS]", dateTime.c_str()); + } + } + else + { + sText.Format("%s", dateTime.c_str()); + } + } + else if (mnGameMode == GAMEMODE_PAUSED) + { + sText.Format("%s ",dateTime.c_str()); + color.set(1, 0.5, 0.5, 1); + } + else + { + sText.Format("%s (PAUSED -- EDIT)",dateTime.c_str()); + //mpBrush->SetColor(Color(254,105,15,25)); + color.set(0.1, 0.06, 0.42, 1); + } + + DrawTextR(sText.GetBuffer(), leftMargin + 50.0, 50.0, + defaultFont.get(), color, 16.0, LEFT_BASE_LINE); + } + + osg::Image* tcTacticalMapView::LoadSymbolImage(const char *azSymbolName) { *************** *** 954,957 **** --- 950,957 ---- stateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF); stateSet->setMode(GL_BLEND, osg::StateAttribute::ON); + + // osg::LineWidth *lw = new osg::LineWidth(1.5); + // stateSet->setAttribute(lw, osg::StateAttribute::ON); + stateSet->setRenderBinDetails(baseRenderBin + rectRenderBin, "RenderBin"); *************** *** 1005,1008 **** --- 1005,1009 ---- symbol->addPrimitiveSet(new osg::DrawArrays(GL_LINE_STRIP, primitiveBaseIdx, nPoints)); } + /** * Creates osg::Geometry object for requested NTDS symbol *************** *** 1024,1027 **** --- 1025,1082 ---- symbol->setVertexArray(vertices); + switch (affil) + { + case FRIENDLY: + case NEUTRAL: + { + AddArcPrimitive(symbol, vertices, 0, 0, 2*w, 2*w, -180, 180, 32); + break; + } + case UNKNOWN: + { + float wu = 0.9 * w; + + vertices->push_back(osg::Vec3(-wu, wu, 0)); + vertices->push_back(osg::Vec3(-wu, -wu, 0)); + vertices->push_back(osg::Vec3(wu, -wu, 0)); + vertices->push_back(osg::Vec3(wu, wu, 0)); + symbol->addPrimitiveSet(new osg::DrawArrays(GL_LINE_LOOP,0,4)); + break; + } + case HOSTILE: + { + vertices->push_back(osg::Vec3(0, w, 0)); + vertices->push_back(osg::Vec3(-w, 0, 0)); + vertices->push_back(osg::Vec3(0, -w, 0)); + vertices->push_back(osg::Vec3(w, 0, 0)); + symbol->addPrimitiveSet(new osg::DrawArrays(GL_LINE_LOOP,0,4)); + break; + } + } + + return symbol; + } + + + + /** + * Creates osg::Geometry object for requested NTDS symbol + */ + osg::Geometry* tcTacticalMapView::DrawNTDSCarrier(teAffiliation affil) + { + float w = 8.0f; + + osg::Geometry* symbol = CreateSymbolGeometry(); + + // set color + osg::Vec4Array* colors = new osg::Vec4Array; + colors->push_back(GetAffiliationColor(affil)); + symbol->setColorArray(colors); + symbol->setColorBinding(osg::Geometry::BIND_OVERALL); + + // create vertex array + osg::Vec3Array* vertices = new osg::Vec3Array; + symbol->setVertexArray(vertices); + switch (affil) *************** *** 1031,1034 **** --- 1086,1097 ---- { AddArcPrimitive(symbol, vertices, 0, 0, 2*w, 2*w, -180, 180, 32); + + size_t v_idx = vertices->size(); + vertices->push_back(osg::Vec3(-2, 1-w, 0)); + vertices->push_back(osg::Vec3(-2, w-1, 0)); + vertices->push_back(osg::Vec3(2, 1-w, 0)); + vertices->push_back(osg::Vec3(2, w-1, 0)); + symbol->addPrimitiveSet(new osg::DrawArrays(GL_LINES, v_idx, 4)); + break; } *************** *** 1042,1045 **** --- 1105,1117 ---- vertices->push_back(osg::Vec3(wu, wu, 0)); symbol->addPrimitiveSet(new osg::DrawArrays(GL_LINE_LOOP,0,4)); + + size_t v_idx = vertices->size(); + vertices->push_back(osg::Vec3(-2, 1-wu, 0)); + vertices->push_back(osg::Vec3(-2, wu-1, 0)); + vertices->push_back(osg::Vec3(2, 1-wu, 0)); + vertices->push_back(osg::Vec3(2, wu-1, 0)); + symbol->addPrimitiveSet(new osg::DrawArrays(GL_LINES, v_idx, 4)); + + break; } *************** *** 1051,1054 **** --- 1123,1134 ---- vertices->push_back(osg::Vec3(w, 0, 0)); symbol->addPrimitiveSet(new osg::DrawArrays(GL_LINE_LOOP,0,4)); + + size_t v_idx = vertices->size(); + vertices->push_back(osg::Vec3(-2, 3-w, 0)); + vertices->push_back(osg::Vec3(-2, w-3, 0)); + vertices->push_back(osg::Vec3(2, 3-w, 0)); + vertices->push_back(osg::Vec3(2, w-3, 0)); + symbol->addPrimitiveSet(new osg::DrawArrays(GL_LINES, v_idx, 4)); + break; } *************** *** 1058,1061 **** --- 1138,1142 ---- } + /** * "Mark" symbol is for known objects such as shells and sonobuoys that do *************** *** 1186,1196 **** return symbol; - - #if 0 - apGraphics->DrawLine(mpPen,x-symbsize/2,y+symbsize/2,x-symbsize/2,y-symbsize/2); - apGraphics->DrawLine(mpPen,x+symbsize/2,y+symbsize/2,x+symbsize/2,y-symbsize/2); - apGraphics->DrawLine(mpPen,x-symbsize/2,y-symbsize/2,x+symbsize/2,y-symbsize/2); - apGraphics->DrawLine(mpPen,x-symbsize/2,y+symbsize/2,x+symbsize/2,y+symbsize/2); - #endif } --- 1267,1270 ---- *************** *** 1526,1530 **** // carrier symbol ! osg::Geometry* pCarrier = DrawNTDSSurface((teAffiliation)nAffiliation); --- 1600,1604 ---- // carrier symbol ! osg::Geometry* pCarrier = DrawNTDSCarrier((teAffiliation)nAffiliation); *************** *** 1770,1773 **** --- 1844,1852 ---- + bool tcTacticalMapView::GetShowFrameCounter() const + { + return showFrameCounter; + } + /** * @returns symbol image pointer based on symbology mode *************** *** 2415,2418 **** --- 2494,2502 ---- } + void tcTacticalMapView::SetShowFrameCounter(bool state) + { + showFrameCounter = state; + } + /** * *************** *** 2544,2550 **** } void tcTacticalMapView::OnLButtonDClick(wxMouseEvent& event) { ! ClearHook(); } --- 2628,2659 ---- } + /** + * Send double click hook event (for customized command) if dclick on hooked obj + * Otherwise clear the current hook + */ void tcTacticalMapView::OnLButtonDClick(wxMouseEvent& event) { ! if (hookedId.size() != 1) return; ! ! wxPoint pos = event.GetPosition(); ! ! long closestId = GetClosest(pos); ! ! if (closestId == hookedId[0]) ! { ! long flags = 0; ! if (event.ShiftDown()) flags += 1; ! if (event.ControlDown()) flags += 2; ! if (event.AltDown()) flags += 4; ! ! wxCommandEvent command(wxEVT_COMMAND_BUTTON_CLICKED, ID_DCLICKHOOK) ; ! command.SetEventObject(this); ! command.m_extraLong = flags; ! AddPendingEvent(command); ! } ! else ! { ! ClearHook(); ! } } *************** *** 2836,2840 **** } ! void tcTacticalMapView::UpdateScreenNavPoints(void) { maNavPointScreen.clear(); --- 2945,2949 ---- } ! void tcTacticalMapView::UpdateScreenNavPoints() { maNavPointScreen.clear(); *************** *** 2877,2882 **** scrollDirection(0.0), mfHookLat(0), ! mfHookLon(0) ! { terrainView = new tcTerrainView(parent, pos, size, true); --- 2986,2991 ---- scrollDirection(0.0), mfHookLat(0), ! mfHookLon(0), ! showFrameCounter(false) { terrainView = new tcTerrainView(parent, pos, size, true); *************** *** 2910,2913 **** --- 3019,3027 ---- ClearMapObjects(); + + #ifdef _DEBUG + showFrameCounter = true; + #endif + } *************** *** 2924,2928 **** /* void ClearMapObjects(void); ! int CreateSurfaces(tcGraphicsEngine* apGraphicsEngine); int Draw(void); void DrawGrid(Graphics *apGraphics); --- 3038,3042 ---- /* void ClearMapObjects(void); ! int CreateSurfaces(tcGraphicsInfo* apGraphicsEngine); int Draw(void); void DrawGrid(Graphics *apGraphics); *************** *** 2944,2948 **** } /***********************************************************************************/ ! int tcWorldMapView::CreateSurfaces(tcGraphicsEngine* apGraphicsEngine) { #if 0 --- 3058,3062 ---- } /***********************************************************************************/ ! int tcWorldMapView::CreateSurfaces(tcGraphicsInfo* apGraphicsEngine) { #if 0 --- tcGraphicsEngine.cpp DELETED --- Index: tc3DWindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DWindow.cpp,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** tc3DWindow.cpp 5 Sep 2006 01:04:25 -0000 1.39 --- tc3DWindow.cpp 24 Sep 2006 19:50:20 -0000 1.40 *************** *** 45,49 **** #include "tc3DWindow.h" ! #include "tcGraphicsEngine.h" #include "AError.h" #include <stdio.h> --- 45,49 ---- #include "tc3DWindow.h" ! #include "tcGraphicsInfo.h" #include "AError.h" #include <stdio.h> Index: tcDisplayModes.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcDisplayModes.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcDisplayModes.cpp 23 Mar 2006 01:11:02 -0000 1.4 --- tcDisplayModes.cpp 24 Sep 2006 19:50:20 -0000 1.5 *************** *** 183,188 **** { tcDisplayModes::Info& info = modeInfo[n]; ! fprintf(stdout, "Display mode %d: W: %d, H: %d, Bits: %d Freq: %d\n", ! n, info.width, info.height, info.bits, info.frequency); } } --- 183,188 ---- { tcDisplayModes::Info& info = modeInfo[n]; ! fprintf(stdout, "Display mode %d: W: %d, H: %d, Bits: %d Freq: %d (%s)\n", ! n, info.width, info.height, info.bits, info.frequency, info.deviceDescription.c_str()); } } *************** *** 216,220 **** info.width = winModeInfo.dmPelsWidth; info.frequency = winModeInfo.dmDisplayFrequency; ! bool matchesLast = ((info.bits == lastBits)&& (info.width == lastWidth)&& --- 216,225 ---- info.width = winModeInfo.dmPelsWidth; info.frequency = winModeInfo.dmDisplayFrequency; ! ! unsigned int driverVersion = winModeInfo.dmDriverVersion; ! wxString description = wxString::Format("%s %d.%d", winModeInfo.dmDeviceName, ! (driverVersion & 0xFF), ((driverVersion >> 8) & 0xFF)); ! info.deviceDescription = description.c_str(); ! bool matchesLast = ((info.bits == lastBits)&& (info.width == lastWidth)&& --- NEW FILE: tcGraphicsInfo.cpp --- // tcGraphicsInfo.cpp: implementation of the tcGraphicsInfo class. /* ** Copyright (C) 2003 Dewitt Colclough (de...@gc...) ** 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 */ #include "stdwx.h" // precompiled header file #ifndef WX_PRECOMP #include "wx/wx.h" #ifdef WIN32 #include "wx/msw/private.h" // for MS Windows specific definitions #endif // WIN32 #endif // WX_PRECOMP #include "tcGraphicsInfo.h" #include <GL/gl.h> // Header file for the OpenGL32 library #include <GL/glu.h> // Header file for the GLu32 library #include <GL/glaux.h> // Header file for the GLaux library #include "AError.h" #include <math.h> #include "tcString.h" #include "tcFile.h" #include <iostream> #include "wx/dcscreen.h" #include "tcDisplayModes.h" #include <osg/MatrixTransform> #if _MSC_VER > 1000 #pragma warning( disable: 4312) //'type cast' : conversion from 'WXHDC' to 'HDC' of greater size #endif #ifndef GL_EXT_bgra #pragma message( "Warning, BGRA extension not supported" ) // TODO also check dynamically for BGRA ext in code #endif #ifdef _DEBUG #define new DEBUG_NEW #endif using std::cout; tcGraphicsInfo* tcGraphicsInfo::Get() { static tcGraphicsInfo instance; return &instance; } /** * @return string with driver name and version */ std::string tcGraphicsInfo::GetDriverInfo() { std::string s; s = (char*)glGetString(GL_VENDOR); s += " "; s += (char*)glGetString(GL_RENDERER); s += " "; s += (char*)glGetString(GL_VERSION); return s; } /** * writes OpenGL driver info to stdout. Call after OpenGL * is initialized to avoid crash. */ void tcGraphicsInfo::LogGLInfo() { fprintf(stdout, "------- Driver info -------\n"); fprintf(stdout, "%s\n", glGetString(GL_VENDOR)); fprintf(stdout, "%s\n", glGetString(GL_RENDERER)); fprintf(stdout, "%s\n", glGetString(GL_VERSION)); fprintf(stdout, "%s\n\n", glGetString(GL_EXTENSIONS)); } /** * Enumerates graphics modes and logs information to stdout. * Writes best (according to old algorithm) format to stdout. * TODO rework to support Linux, need linux or wxWindows version * of HDC type. */ void tcGraphicsInfo::LogPixelFormats() { wxScreenDC wxdc; HDC hdc = (HDC)wxdc.GetHDC(); // get number of formats int nFormats = DescribePixelFormat(hdc, 1, sizeof(PIXELFORMATDESCRIPTOR), NULL); int best_format = 0; int best_bits = 0; int best_alpha = 0; int best_z = 0; for(int n=1;n<=nFormats;n++) { PIXELFORMATDESCRIPTOR pfd; memset(&pfd,0,sizeof(pfd)); pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR); pfd.nVersion = 1; DescribePixelFormat(hdc, n, sizeof(PIXELFORMATDESCRIPTOR), &pfd); DWORD flags = pfd.dwFlags; bool generic_accel =((flags & PFD_GENERIC_FORMAT) && (flags & PFD_GENERIC_ACCELERATED)); bool software =((flags & PFD_GENERIC_FORMAT) && !(flags & PFD_GENERIC_ACCELERATED)); bool hw_accel =(!(flags & PFD_GENERIC_FORMAT) && !(flags & PFD_GENERIC_ACCELERATED)); bool supportsGL = (flags & PFD_SUPPORT_OPENGL) != 0; bool usesRGBA = (pfd.iPixelType & PFD_TYPE_RGBA) != 0; bool usesPalette = (pfd.iPixelType & PFD_TYPE_COLORINDEX) != 0; bool drawToWindow = (flags & PFD_DRAW_TO_WINDOW) != 0; bool doubleBuffer = (flags & PFD_DOUBLEBUFFER) != 0; if (hw_accel && supportsGL && !usesPalette && drawToWindow && doubleBuffer && (pfd.cAlphaBits > 0)) { if (pfd.cColorBits > best_bits) { best_bits = pfd.cColorBits; best_alpha = pfd.cAlphaBits; best_z = pfd.cDepthBits; best_format = n; } else if (pfd.cColorBits == best_bits) { if (pfd.cAlphaBits > best_alpha) { best_bits = pfd.cColorBits; best_alpha = pfd.cAlphaBits; best_z = pfd.cDepthBits; best_format = n; } else if (pfd.cAlphaBits == best_alpha) { if (pfd.cDepthBits > best_z) { best_bits = pfd.cColorBits; best_alpha = pfd.cAlphaBits; best_z = pfd.cDepthBits; best_format = n; } } } } fprintf(stdout," [%d] color: %d, alpha: %d, stencil: %d, z: %d hw_accel:%d gen_accel:%d soft:%d GL:%d RGBA:%d Pal:%d DB:%d \n", n, pfd.cColorBits, pfd.cAlphaBits, pfd.cStencilBits, pfd.cDepthBits, hw_accel, generic_accel, software, supportsGL, usesRGBA, usesPalette, doubleBuffer); } //fprintf(stdout,"Best: [%d] color: %d, alpha: %d, z: %d \n\n", // best_format, best_bits, best_alpha, best_z); } void tcGraphicsInfo::CheckGLError(const char* location) { GLenum eErrCode; const GLubyte *zErrString; if ((eErrCode = glGetError()) != GL_NO_ERROR) { zErrString = gluErrorString(eErrCode); fprintf(stderr, "OpenGL Error: %s (%s)\n",(char*)zErrString, location); } } /** * @return false if using software generic driver (no hardware accel) */ bool tcGraphicsInfo::Is3DCapable() { wxScreenDC wxdc; HDC hdc = (HDC)wxdc.GetHDC(); // get number of formats int nFormats = DescribePixelFormat(hdc, 1, sizeof(PIXELFORMATDESCRIPTOR), NULL); for(int n=1;n<=nFormats;n++) { PIXELFORMATDESCRIPTOR pfd; memset(&pfd,0,sizeof(pfd)); pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR); pfd.nVersion = 1; DescribePixelFormat(hdc, n, sizeof(PIXELFORMATDESCRIPTOR), &pfd); DWORD flags = pfd.dwFlags; 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; } return false; } /** * @return false if 3D hardware accel doesn't support alpha blending */ bool tcGraphicsInfo::Is3DAlphaCapable() { wxScreenDC wxdc; HDC hdc = (HDC)wxdc.GetHDC(); // get number of formats int nFormats = DescribePixelFormat(hdc, 1, sizeof(PIXELFORMATDESCRIPTOR), NULL); for(int n=1;n<=nFormats;n++) { PIXELFORMATDESCRIPTOR pfd; memset(&pfd,0,sizeof(pfd)); pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR); pfd.nVersion = 1; DescribePixelFormat(hdc, n, sizeof(PIXELFORMATDESCRIPTOR), &pfd); DWORD flags = pfd.dwFlags; 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 && (nAlpha > 0)) return true; } return false; } tcGraphicsInfo::tcGraphicsInfo() { mbInitialized = true; LogGLInfo(); LogPixelFormats(); // display mode is not set using this sytem so ignore fflush (stdout); if (!Is3DCapable()) { std::string text = "GCB requires OpenGL-compatible 3D hardware acceleration." " ("; text += GetDriverInfo(); text += ")\n"; throw(text); } if (!Is3DAlphaCapable()) { std::string text = "Failed to find suitable 3D driver." "This may result in slow performance. ("; text += GetDriverInfo(); text += ")\n"; wxMessageBox(text.c_str(),"Warning",wxICON_WARNING); } tcDisplayModes::Get()->LogModeInfo(); } /** * Never used. */ tcGraphicsInfo::tcGraphicsInfo(const tcGraphicsInfo& src) { wxASSERT(false); } tcGraphicsInfo::~tcGraphicsInfo() { } |
From: Dewitt C. <ddc...@us...> - 2006-09-24 19:50:25
|
Update of /cvsroot/gcblue/gcb_wx/scripts In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv11768/scripts Modified Files: HotKey.py Log Message: Upgraded to OSG 1.2. Tried Demeter 4.0 but had to go back. It's not backwards compatible. Added border to 3D view, alt-f to toggle frame counter Fix for passive torpedo bug Index: HotKey.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/HotKey.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** HotKey.py 5 Sep 2006 01:04:24 -0000 1.9 --- HotKey.py 24 Sep 2006 19:50:20 -0000 1.10 *************** *** 64,65 **** --- 64,82 ---- # This needs to be reworked #def ProcessHotKeyOther(key): + + # flags : bitfield 1 - shift pressed, 2 - ctrl pressed, 4 - alt pressed + # e.g. flags == 6 indicates ctrl and alt were pressed during dclick + def ProcessDoubleClickHook(UnitInfo, flags): + # for units with aircraft show the flight panel unless shift is pressed + # otherwise show the platform panel + if (UnitInfo.HasFlightPort()): + if ((flags & 1) != 1): + UnitInfo.SendCommand('ShowFlightPanel') + else: + UnitInfo.SendCommand('ShowPlatformPanel') + else: + UnitInfo.SendCommand('ShowPlatformPanel') + + + + |
From: Dewitt C. <ddc...@us...> - 2006-09-24 19:50:25
|
Update of /cvsroot/gcblue/gcb_wx/xml In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv11768/xml Modified Files: options.xml Log Message: Upgraded to OSG 1.2. Tried Demeter 4.0 but had to go back. It's not backwards compatible. Added border to 3D view, alt-f to toggle frame counter Fix for passive torpedo bug Index: options.xml =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/xml/options.xml,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** options.xml 16 Sep 2006 14:01:25 -0000 1.28 --- options.xml 24 Sep 2006 19:50:21 -0000 1.29 *************** *** 1,6 **** <Options> <HostAddress>192.168.0.100</HostAddress> ! <LastScenarioPath>SinglePlayer.JumpingFishII.py</LastScenarioPath> ! <LastScenarioName>JumpingFishII</LastScenarioName> <noCopyDatabase /> <noWriteXmlDatabase /> --- 1,6 ---- <Options> <HostAddress>192.168.0.100</HostAddress> ! <LastScenarioPath>Tutorial.SubmarineOperations.py</LastScenarioPath> ! <LastScenarioName>SubmarineOperations</LastScenarioName> <noCopyDatabase /> <noWriteXmlDatabase /> |
From: Dewitt C. <ddc...@us...> - 2006-09-24 19:50:25
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv11768/include/sim Modified Files: Game.h Log Message: Upgraded to OSG 1.2. Tried Demeter 4.0 but had to go back. It's not backwards compatible. Added border to 3D view, alt-f to toggle frame counter Fix for passive torpedo bug Index: Game.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/Game.h,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** Game.h 17 Aug 2006 01:27:11 -0000 1.70 --- Game.h 24 Sep 2006 19:50:19 -0000 1.71 *************** *** 42,46 **** #include "tcOptionsView.h" #include "tcObjectControl.h" ! #include "tcGraphicsEngine.h" #include "tcTime.h" #include "tcStartView.h" --- 42,46 ---- #include "tcOptionsView.h" #include "tcObjectControl.h" ! #include "tcGraphicsInfo.h" #include "tcTime.h" #include "tcStartView.h" *************** *** 133,137 **** DateZulu gameDateZulu; ///< object combining date and time wxDateTime startTime; ! tcGraphicsEngine* mpGraphicsEngine; // Graphics engine object tc3DViewer *viewer; --- 133,137 ---- DateZulu gameDateZulu; ///< object combining date and time wxDateTime startTime; ! tcGraphicsInfo* mpGraphicsEngine; // Graphics engine object tc3DViewer *viewer; *************** *** 255,258 **** --- 255,259 ---- void NewHook(wxCommandEvent& event); ///< event for single unit hooked (deprecated) void NewHook(long hookID); + void DoubleClickHook(wxCommandEvent& event); void OnChar(wxKeyEvent& event); void OnEraseBackground(wxEraseEvent& event); |
From: Dewitt C. <ddc...@us...> - 2006-09-24 19:50:25
|
Update of /cvsroot/gcblue/gcb_wx/include/scriptinterface In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv11768/include/scriptinterface Modified Files: tcSimPythonInterface.h Log Message: Upgraded to OSG 1.2. Tried Demeter 4.0 but had to go back. It's not backwards compatible. Added border to 3D view, alt-f to toggle frame counter Fix for passive torpedo bug Index: tcSimPythonInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcSimPythonInterface.h,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** tcSimPythonInterface.h 22 Mar 2006 01:23:29 -0000 1.32 --- tcSimPythonInterface.h 24 Sep 2006 19:50:19 -0000 1.33 *************** *** 141,144 **** --- 141,145 ---- void ProcessCallbackString(const std::string& command, const std::vector<long>& id); void ProcessHotKey(unsigned int key, unsigned int flags); + void ProcessDoubleClickHook(unsigned int flags); void ProcessSecondaryHook(long id); void PushMode(); |
From: Dewitt C. <ddc...@us...> - 2006-09-24 19:50:25
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv11768/src/scriptinterface Modified Files: tcSimPythonInterface.cpp Log Message: Upgraded to OSG 1.2. Tried Demeter 4.0 but had to go back. It's not backwards compatible. Added border to 3D view, alt-f to toggle frame counter Fix for passive torpedo bug Index: tcSimPythonInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcSimPythonInterface.cpp,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** tcSimPythonInterface.cpp 23 Mar 2006 01:11:02 -0000 1.43 --- tcSimPythonInterface.cpp 24 Sep 2006 19:50:20 -0000 1.44 *************** *** 959,962 **** --- 959,979 ---- /** + * @param flags : bitfield describing keys pressed during double click: + * 1 - shift pressed, 2 - ctrl pressed, 4 - alt pressed + */ + void tcSimPythonInterface::ProcessDoubleClickHook(unsigned int flags) + { + char zBuff[128]; + if (mpHookedObj == 0) return; + if (!mpSimState->mpUserInfo->IsOwnAlliance(mpHookedObj->GetAlliance())) return; + + sprintf(zBuff, "Menu.ProcessDoubleClickHook(HookedUnitInfo, %d)\n", flags); + + + CallPython(zBuff, "Exception occurred in ProcessHotKey\n"); + } + + + /** * Calls the ProcessHotKey script in Menu.py with an argument based * on whether or not a unit is hooked and, if so, the type of unit *************** *** 976,980 **** CallPython(zBuff, "Exception occurred in ProcessHotKey\n"); - } --- 993,996 ---- |
From: Dewitt C. <ddc...@us...> - 2006-09-24 19:50:25
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv11768/include/common Modified Files: wxcommands.h Log Message: Upgraded to OSG 1.2. Tried Demeter 4.0 but had to go back. It's not backwards compatible. Added border to 3D view, alt-f to toggle frame counter Fix for passive torpedo bug Index: wxcommands.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/wxcommands.h,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** wxcommands.h 17 Aug 2006 01:27:09 -0000 1.24 --- wxcommands.h 24 Sep 2006 19:50:19 -0000 1.25 *************** *** 43,46 **** --- 43,47 ---- ID_NEWHOOK = 80, ///< new platform has been hooked by user ID_GROUPHOOK = 82, ///< new group of platforms has been hooked by user + ID_DCLICKHOOK = 85, ///< hooked object has been double clicked by user ID_SETBRIEFING = 90, ///< enable/disable briefing mode ID_SETPAUSE = 100, ///< enable/disable game pause |
From: Dewitt C. <ddc...@us...> - 2006-09-16 14:01:30
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv23922/src/sim Modified Files: Game.cpp Log Message: Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.158 retrieving revision 1.159 diff -C2 -d -r1.158 -r1.159 *** Game.cpp 17 Aug 2006 01:28:05 -0000 1.158 --- Game.cpp 16 Sep 2006 14:01:24 -0000 1.159 *************** *** 782,786 **** startView->AttachOptions(tcOptions::Get()); ! startView->LoadBackgroundImage("start_background_dev.jpg"); if (startView->Init() == false) --- 782,786 ---- startView->AttachOptions(tcOptions::Get()); ! startView->LoadBackgroundImage("start_background.jpg"); // start_background_dev.jpg if (startView->Init() == false) |
From: Dewitt C. <ddc...@us...> - 2006-09-16 14:01:29
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv23922/include/graphics Modified Files: tcMapView.h Log Message: Index: tcMapView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMapView.h,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** tcMapView.h 17 Aug 2006 01:27:10 -0000 1.30 --- tcMapView.h 16 Sep 2006 14:01:23 -0000 1.31 *************** *** 401,404 **** --- 401,405 ---- void UpdateScreenNavPoints(); + void UpdateViewForHooked(); }; |
From: Dewitt C. <ddc...@us...> - 2006-09-16 14:01:27
|
Update of /cvsroot/gcblue/gcb_wx/xml In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv23922/xml Modified Files: options.xml Log Message: Index: options.xml =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/xml/options.xml,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** options.xml 5 Sep 2006 01:04:25 -0000 1.27 --- options.xml 16 Sep 2006 14:01:25 -0000 1.28 *************** *** 1,6 **** <Options> <HostAddress>192.168.0.100</HostAddress> ! <LastScenarioPath>SinglePlayer.IranStrike.py</LastScenarioPath> ! <LastScenarioName>IranStrike</LastScenarioName> <noCopyDatabase /> <noWriteXmlDatabase /> --- 1,6 ---- <Options> <HostAddress>192.168.0.100</HostAddress> ! <LastScenarioPath>SinglePlayer.JumpingFishII.py</LastScenarioPath> ! <LastScenarioName>JumpingFishII</LastScenarioName> <noCopyDatabase /> <noWriteXmlDatabase /> |
From: Dewitt C. <ddc...@us...> - 2006-09-16 14:01:27
|
Update of /cvsroot/gcblue/gcb_wx/docs In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv23922/docs Modified Files: CHANGES.txt Log Message: Index: CHANGES.txt =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/docs/CHANGES.txt,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** CHANGES.txt 13 Sep 2006 23:49:35 -0000 1.57 --- CHANGES.txt 16 Sep 2006 14:01:23 -0000 1.58 *************** *** 4,11 **** --------------------------------------------------------------------- - Fixed flicker that occurred sometimes when opening popup menu ! ! ! *** 2006-09-05 *** - Added feature to gray loadout automation buttons for loadouts that are not available --- 4,12 ---- --------------------------------------------------------------------- + *** 2006-09-05 through 2006-09-15 *** - Fixed flicker that occurred sometimes when opening popup menu ! - Expanded map scrolling to all directions ! - Hooking an object in the unit summary window (upper left) will now center the map ! on it if it is not in the current view - Added feature to gray loadout automation buttons for loadouts that are not available |
From: Dewitt C. <ddc...@us...> - 2006-09-16 14:01:27
|
Update of /cvsroot/gcblue/gcb_wx In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv23922 Modified Files: ReleaseInstallScript_083dev.nsi Log Message: Index: ReleaseInstallScript_083dev.nsi =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/ReleaseInstallScript_083dev.nsi,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ReleaseInstallScript_083dev.nsi 17 Aug 2006 01:31:32 -0000 1.2 --- ReleaseInstallScript_083dev.nsi 16 Sep 2006 14:01:23 -0000 1.3 *************** *** 202,205 **** --- 202,211 ---- File "log\stderr.txt" + ; ----- manual directory ----- + SetOutPath $INSTDIR\manual + + File "manual\GCB_Manual_081.pdf" + + ; ----- maps directory ----- SetOutPath $INSTDIR\maps *************** *** 220,226 **** ; File "scenarios\*.py" ! SetOutPath $INSTDIR\scenarios\MultiPlayer ! File "scenarios\MultiPlayer\*.py" SetOutPath $INSTDIR\scenarios\SinglePlayer --- 226,232 ---- ; File "scenarios\*.py" ! ; SetOutPath $INSTDIR\scenarios\MultiPlayer ! ; File "scenarios\MultiPlayer\*.py" SetOutPath $INSTDIR\scenarios\SinglePlayer *************** *** 232,238 **** File "scenarios\Saved\*.py" ! SetOutPath $INSTDIR\scenarios\Test ! File "scenarios\Test\*.py" SetOutPath $INSTDIR\scenarios\Tutorial --- 238,244 ---- File "scenarios\Saved\*.py" ! ; SetOutPath $INSTDIR\scenarios\Test ! ; File "scenarios\Test\*.py" SetOutPath $INSTDIR\scenarios\Tutorial *************** *** 297,301 **** CreateShortCut "$SMPROGRAMS\GCB\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 CreateShortCut "$SMPROGRAMS\GCB\Play GCB.lnk" "$INSTDIR\bin\GCblue.exe" "" "$INSTDIR\bin\GCblue.exe" 0 ! SectionEnd --- 303,308 ---- CreateShortCut "$SMPROGRAMS\GCB\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 CreateShortCut "$SMPROGRAMS\GCB\Play GCB.lnk" "$INSTDIR\bin\GCblue.exe" "" "$INSTDIR\bin\GCblue.exe" 0 ! CreateShortCut "$SMPROGRAMS\GCB\Game manual.lnk" "$INSTDIR\manual\GCB_Manual_081.pdf" "" "$INSTDIR\manual\GCB_Manual_081.pdf" 0 ! SectionEnd |
From: Dewitt C. <ddc...@us...> - 2006-09-16 14:01:27
|
Update of /cvsroot/gcblue/gcb_wx/database In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv23922/database Modified Files: database.db Log Message: Index: database.db =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/database/database.db,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 Binary files /tmp/cvsrHkFIa and /tmp/cvs5qaFkb differ |
From: Dewitt C. <ddc...@us...> - 2006-09-16 14:01:27
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv23922/src/scriptinterface Modified Files: tcPlatformInterface.cpp tcPlatformInterfaceExtensionB.cpp Log Message: Index: tcPlatformInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterface.cpp,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** tcPlatformInterface.cpp 5 Sep 2006 01:04:25 -0000 1.64 --- tcPlatformInterface.cpp 16 Sep 2006 14:01:24 -0000 1.65 *************** *** 101,105 **** } - /** * @return fraction of fuel remaining --- 101,104 ---- *************** *** 254,257 **** --- 253,290 ---- + bool tcPlatformInterface::IsSurface() const + { + return (mpPlatformObj->mnModelType == MTYPE_SURFACE); + } + + /// returns true if platform is an air platform + bool tcPlatformInterface::IsAir() const + { + UINT32 nModelType = mpPlatformObj->mnModelType; + return (nModelType == MTYPE_FIXEDWING)||(nModelType == MTYPE_FIXEDWINGX) + ||(nModelType == MTYPE_AIR)||(nModelType == MTYPE_HELO); + } + + /// returns true if platform is a helo + bool tcPlatformInterface::IsHelo() const + { + return (mpPlatformObj->mnModelType == MTYPE_HELO); + } + + bool tcPlatformInterface::IsFixed() const + { + return (mpPlatformObj->mnModelType == MTYPE_FIXED) || + (mpPlatformObj->mnModelType == MTYPE_AIRFIELD); + } + + /// returns true if platform is a submarine + bool tcPlatformInterface::IsSub() const + { + return (mpPlatformObj->mnModelType == MTYPE_SUBMARINE); + } + + + + tcGameObject* tcPlatformInterface::GetTargetObj() { Index: tcPlatformInterfaceExtensionB.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterfaceExtensionB.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** tcPlatformInterfaceExtensionB.cpp 17 Aug 2006 01:28:04 -0000 1.32 --- tcPlatformInterfaceExtensionB.cpp 16 Sep 2006 14:01:24 -0000 1.33 *************** *** 76,81 **** .def("GetName", &tcPlatformInterface::GetPlatformName) .def("GetClass", &tcPlatformInterface::GetPlatformClass) ! .def("IsSurface",&tcPlatformInterface::IsSurface) .def("IsAir", &tcPlatformInterface::IsAir) .def("IsHelo", &tcPlatformInterface::IsHelo) .def("IsSub", &tcPlatformInterface::IsSub) --- 76,82 ---- .def("GetName", &tcPlatformInterface::GetPlatformName) .def("GetClass", &tcPlatformInterface::GetPlatformClass) ! .def("IsSurface", &tcPlatformInterface::IsSurface) .def("IsAir", &tcPlatformInterface::IsAir) + .def("IsFixed", &tcPlatformInterface::IsFixed) .def("IsHelo", &tcPlatformInterface::IsHelo) .def("IsSub", &tcPlatformInterface::IsSub) |
From: Dewitt C. <ddc...@us...> - 2006-09-16 14:01:26
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv23922/src/graphics Modified Files: tcMapView.cpp Log Message: Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapView.cpp,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** tcMapView.cpp 5 Sep 2006 01:04:25 -0000 1.47 --- tcMapView.cpp 16 Sep 2006 14:01:24 -0000 1.48 *************** *** 39,42 **** --- 39,43 ---- #include "tcMapOverlay.h" #include "tcDragStatus.h" + #include "tcSimState.h" #include "tcTime.h" *************** *** 2681,2725 **** mpointMouse = point; - scrollActive = false; - scrollDirection = 0.0f; - - // changed to scroll at window edge - /* - - const int nScrollBorder = 10; - - // +200 is a hack to workaround the semi-transparent overlay window - 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(); } ! */ ! } --- 2682,2690 ---- mpointMouse = point; if (scrollActive) { ! UpdateEdgeScroll(point); } ! } *************** *** 2773,2776 **** --- 2738,2743 ---- { hookedId = hookedUnits; + + UpdateViewForHooked(); } *************** *** 2785,2788 **** --- 2752,2756 ---- { hookedId.push_back(id); + UpdateViewForHooked(); } } *************** *** 2833,2842 **** scrollActive = false; scrollDirection = 0.0f; } if (scrollActive) { ! lastScrollTime = tcTime::Get()->Get30HzCount(); } } --- 2801,2826 ---- scrollActive = false; scrollDirection = 0.0f; + + if (HasCapture()) + { + ReleaseMouse(); + } } if (scrollActive) { ! float dx = float(mpointMouse.x - mnWidth/2); ! float dy = -float(mpointMouse.y - mnHeight/2); ! ! scrollDirection = C_180OVERPI * atan2f(dx, dy); ! ! if (!HasCapture()) ! { ! lastScrollTime = tcTime::Get()->Get30HzCount(); ! CaptureMouse(); ! } ! } + } *************** *** 2864,2867 **** --- 2848,2870 ---- } + /** + * Check if first hooked object is within the view. If not then + * center view on object. + */ + void tcTacticalMapView::UpdateViewForHooked() + { + if (hookedId.size() == 0) return; + + tcGameObject* obj = tcSimState::Get()->GetObject(hookedId[0]); + if (obj == 0) return; + + tcPoint pos(obj->mcKin.mfLon_rad, obj->mcKin.mfLat_rad); + if (!PointInView(pos)) + { + tcPoint screen = GeoToScreen(pos); + SetViewCenterZoom(wxPoint(screen.x, screen.y), 1.0); + } + } + tcTacticalMapView::tcTacticalMapView(wxWindow *parent, |
From: Dewitt C. <ddc...@us...> - 2006-09-16 14:01:26
|
Update of /cvsroot/gcblue/gcb_wx/scripts In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv23922/scripts Modified Files: AI.py Menu.py Log Message: Index: AI.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/AI.py,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** AI.py 5 Sep 2006 01:04:24 -0000 1.28 --- AI.py 16 Sep 2006 14:01:24 -0000 1.29 *************** *** 1015,1019 **** UI.Launch(launcher, launch_qty) UI.SetActionText('Datum launch') ! elif launch_mode == 1: # handoff to active seeker target_accepted = UI.HandoffTargetToLauncher(launcher) if (target_accepted): --- 1015,1019 ---- UI.Launch(launcher, launch_qty) UI.SetActionText('Datum launch') ! elif (launch_mode == 1) or (launch_mode == 2): # handoff to active seeker target_accepted = UI.HandoffTargetToLauncher(launcher) if (target_accepted): Index: Menu.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/Menu.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Menu.py 5 Sep 2006 01:04:24 -0000 1.25 --- Menu.py 16 Sep 2006 14:01:24 -0000 1.26 *************** *** 76,89 **** ! UnitMenu.AddItemUI('Change heading [h]','SetHeading','Heading') ! # Speed submenu ! UnitMenu.AddItem('Set speed','') ! UnitMenu.BeginSubMenu() ! UnitMenu.AddItem('30% [1]','Speed30') ! UnitMenu.AddItem('50% [2]','Speed50') ! UnitMenu.AddItem('80% [3]','Speed80') ! UnitMenu.AddItem('100% [4]','Speed100') ! UnitMenu.AddItem('Max [5]','SpeedAB') ! UnitMenu.EndSubMenu() # Target submenu --- 76,90 ---- ! if (not UnitInfo.IsFixed()): ! UnitMenu.AddItemUI('Change heading [h]','SetHeading','Heading') ! # Speed submenu ! UnitMenu.AddItem('Set speed','') ! UnitMenu.BeginSubMenu() ! UnitMenu.AddItem('30% [1]','Speed30') ! UnitMenu.AddItem('50% [2]','Speed50') ! UnitMenu.AddItem('80% [3]','Speed80') ! UnitMenu.AddItem('100% [4]','Speed100') ! UnitMenu.AddItem('Max [5]','SpeedAB') ! UnitMenu.EndSubMenu() # Target submenu *************** *** 99,109 **** # Orders test UnitMenu.AddItem('Tasks','') ! UnitMenu.BeginSubMenu() ! UnitMenu.AddItemUI('ZigZag patrol','AddPatrolOrder','Null') ! UnitMenu.AddItemUI('Patrol station','AddPatrolStation', 'Datum') ! UnitMenu.AddItemUI('Add waypoint [w]', 'AddWaypointOrder', 'Datum') UnitMenu.AddItemUI('EngageAll [e]', 'AddEngageAllOrder','Null') ! UnitMenu.AddItemUI('Missile alert', 'AddMissileWarnTask','Null') ! UnitMenu.AddItemUI('Clear waypoints','ClearWaypoints','Null') UnitMenu.AddItemUI('Clear all tasks','ClearTasks','Null') UnitMenu.EndSubMenu() --- 100,113 ---- # Orders test UnitMenu.AddItem('Tasks','') ! UnitMenu.BeginSubMenu() ! UnitMenu.AddItemUI('EngageAll [e]', 'AddEngageAllOrder','Null') ! if (not UnitInfo.IsFixed()): ! UnitMenu.AddItemUI('ZigZag patrol','AddPatrolOrder','Null') ! UnitMenu.AddItemUI('Patrol station','AddPatrolStation', 'Datum') ! UnitMenu.AddItemUI('Add waypoint [w]', 'AddWaypointOrder', 'Datum') ! ! UnitMenu.AddItemUI('Missile alert', 'AddMissileWarnTask','Null') ! UnitMenu.AddItemUI('Clear waypoints','ClearWaypoints','Null') UnitMenu.AddItemUI('Clear all tasks','ClearTasks','Null') UnitMenu.EndSubMenu() |
From: Dewitt C. <ddc...@us...> - 2006-09-16 14:01:26
|
Update of /cvsroot/gcblue/gcb_wx/include/scriptinterface In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv23922/include/scriptinterface Modified Files: tcPlatformInterface.h Log Message: Index: tcPlatformInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcPlatformInterface.h,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** tcPlatformInterface.h 5 Sep 2006 01:04:24 -0000 1.54 --- tcPlatformInterface.h 16 Sep 2006 14:01:24 -0000 1.55 *************** *** 164,186 **** /// get database class name of platform std::string GetPlatformClass(); /// returns true if platform is a surface platform ! bool IsSurface() {return (mpPlatformObj->mnModelType == MTYPE_SURFACE);} /// returns true if platform is an air platform ! bool IsAir() ! { ! UINT32 nModelType = mpPlatformObj->mnModelType; ! return (nModelType == MTYPE_FIXEDWING)||(nModelType == MTYPE_FIXEDWINGX) ! ||(nModelType == MTYPE_AIR)||(nModelType == MTYPE_HELO); ! } /// returns true if platform is a helo ! bool IsHelo() ! { ! return (mpPlatformObj->mnModelType == MTYPE_HELO); ! } /// returns true if platform is a submarine ! bool IsSub() ! { ! return (mpPlatformObj->mnModelType == MTYPE_SUBMARINE); ! } /// returns a sub interface object, @see scriptinterface::tcSubInterface tcSubInterface GetSubInterface(); --- 164,180 ---- /// get database class name of platform std::string GetPlatformClass(); + /// returns true if platform is a surface platform ! bool IsSurface() const; /// returns true if platform is an air platform ! bool IsAir() const; /// returns true if platform is a helo ! bool IsHelo() const; ! ! bool IsFixed() const; ! /// returns true if platform is a submarine ! bool IsSub() const; ! /// returns a sub interface object, @see scriptinterface::tcSubInterface tcSubInterface GetSubInterface(); |