gcblue-commits Mailing List for Global Conflict Blue (Page 40)
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) |
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29552/include/graphics Modified Files: tc3DModel.h tc3DTerrain.h tc3DViewer.h tc3DWindow.h tcMapView.h tcParticleEffect.h Added Files: tcAltitudeBarControl.h tcControl.h Log Message: Text message "message center" GUI screen Index: tcParticleEffect.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcParticleEffect.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcParticleEffect.h 7 Nov 2004 03:40:43 -0000 1.3 --- tcParticleEffect.h 23 Nov 2004 23:30:46 -0000 1.4 *************** *** 54,58 **** AFTERBURNER = 2, DAMAGE = 4, ! GUN = 8 }; --- 54,59 ---- AFTERBURNER = 2, DAMAGE = 4, ! GUN = 8, ! BUBBLES = 16 }; *************** *** 63,67 **** tcParticleEffect(int smokeModeCode); ! ~tcParticleEffect(); private: --- 64,68 ---- tcParticleEffect(int smokeModeCode); ! virtual ~tcParticleEffect(); private: Index: tc3DModel.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DModel.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tc3DModel.h 6 Nov 2004 15:13:40 -0000 1.9 --- tc3DModel.h 23 Nov 2004 23:30:33 -0000 1.10 *************** *** 90,94 **** float GetRadius(); float GetRadiusGeneric(); ! bool IsSmokeEnabled() const {return smokeTrail.valid();} void Load(std::string model_name); void ProcessAnimations(std::vector<animationDBInfo>& animDBInfo); --- 90,94 ---- float GetRadius(); float GetRadiusGeneric(); ! bool IsSmokeEnabled() const {return smokeTrail != 0;} void Load(std::string model_name); void ProcessAnimations(std::vector<animationDBInfo>& animDBInfo); *************** *** 110,115 **** private: ! osg::ref_ptr<tcParticleEffect> smokeTrail; osgParticle::tcParticlePlacer* smokePlacer; int smokeMode; --- 110,116 ---- private: ! tcParticleEffect* smokeTrail; osgParticle::tcParticlePlacer* smokePlacer; + osg::Vec3 smokeSource; ///< position of smoke emitter in model coordinates int smokeMode; Index: tc3DTerrain.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DTerrain.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tc3DTerrain.h 26 Jul 2004 01:44:40 -0000 1.12 --- tc3DTerrain.h 23 Nov 2004 23:30:34 -0000 1.13 *************** *** 41,44 **** --- 41,49 ---- class tcTerrainTextureFactory; + namespace osg + { + class Texture2D; + } + /** * Class to use Demeter terrain library to display 3D terrain *************** *** 74,77 **** --- 79,85 ---- osg::ref_ptr<Demeter::Terrain> terrain; ///< Demeter terrain object osg::ref_ptr<osg::Geode> terrainNode; ///< drawable terrain object to place into osg scenegraph + osg::ref_ptr<osg::Geometry> waterSurface; + osg::ref_ptr<osg::Texture2D> waterTexture; + tcTerrainTextureFactory* texFactory; *************** *** 96,99 **** --- 104,108 ---- double YToLat(float y); void CheckElevations(); + void InitWaterSurface(); void UpdateElevations(); void UpdateElevationsSlowly(); --- NEW FILE: tcControl.h --- /** ** @file tcControl.h ** Defines base class for ObjectControl GUI view */ /* Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _TCCONTROL_H_ #define _TCCONTROL_H_ #if _MSC_VER > 1000 #pragma once #endif class tcGameObject; class tc3DWindow; /** * Parent class for control */ class tcControl { public: virtual void Draw(tc3DWindow* graphics) = 0; virtual bool IsActive() const; virtual void OnLButtonDown(wxMouseEvent& event) = 0; virtual void OnLButtonUp(wxMouseEvent& event) = 0; virtual void OnMouseMove(wxMouseEvent& event) = 0; virtual void SetActive(bool state); virtual void SetGameObject(tcGameObject* gameObj); static void SetUseEnglishUnits(bool state); tcControl(); virtual ~tcControl(); protected: bool isActive; tcGameObject* obj; static bool useEnglishUnits; ///< true to use english units }; #endif Index: tc3DWindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DWindow.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tc3DWindow.h 14 Nov 2004 22:52:20 -0000 1.10 --- tc3DWindow.h 23 Nov 2004 23:30:46 -0000 1.11 *************** *** 166,171 **** virtual bool IsWindowMinimized() const; void LoadBackgroundImage(char* fileName); ! osg::Image* LoadImage(const char* fileName); ! osg::Texture2D* LoadTexture(const char* fileName); virtual void Maximize(); virtual void Minimize(); --- 166,171 ---- virtual bool IsWindowMinimized() const; void LoadBackgroundImage(char* fileName); ! static osg::Image* LoadImage(const char* fileName); ! static osg::Texture2D* LoadTexture(const char* fileName); virtual void Maximize(); virtual void Minimize(); *************** *** 243,247 **** void FinishDraw(); void HideUnusedObjects(); ! wxString PrependImagePath(const char* fileName); virtual void OnChar(wxKeyEvent& event); --- 243,247 ---- void FinishDraw(); void HideUnusedObjects(); ! static wxString PrependImagePath(const char* fileName); virtual void OnChar(wxKeyEvent& event); Index: tcMapView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMapView.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcMapView.h 7 Nov 2004 03:40:43 -0000 1.5 --- tcMapView.h 23 Nov 2004 23:30:46 -0000 1.6 *************** *** 361,364 **** --- 361,365 ---- osg::Geometry* DrawNTDSAirRW(teAffiliation affil); osg::Geometry* DrawNTDSMissile(teAffiliation affil); + osg::Geometry* DrawNTDSSubsurface(teAffiliation affil); osg::Geometry* DrawNTDSUnknown(teAffiliation affil); Index: tc3DViewer.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DViewer.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tc3DViewer.h 7 Nov 2004 03:40:43 -0000 1.5 --- tc3DViewer.h 23 Nov 2004 23:30:35 -0000 1.6 *************** *** 53,64 **** --- 53,73 ---- { public: + enum FogMode + { + FOG_OFF = 0, ///< deactivate fog + FOG_AIR = 1, ///< for above ground view + FOG_WATER = 2 ///< for underwater view + }; osg::ref_ptr<osgUtil::SceneView> sceneView; + osg::ref_ptr<osgUtil::SceneView> sceneViewFar; osg::ref_ptr<osgUtil::SceneView> guiView; osg::ref_ptr<osg::DisplaySettings> displaySettings; osg::ref_ptr<osg::NodeVisitor> updateVisitor; + osg::ref_ptr<osg::NodeVisitor> updateVisitorFar; osg::ref_ptr<osgUtil::CullVisitor> cullVisitor; osg::ref_ptr<osg::NodeVisitor> guiUpdateVisitor; osg::ref_ptr<osg::FrameStamp> frameStamp; + osg::ref_ptr<osg::FrameStamp> frameStampFar; osg::ref_ptr<osg::FrameStamp> guiFrameStamp; osg::ref_ptr<osgText::Text> viewerText; ///< text for debug/basic viewer info display *************** *** 71,74 **** --- 80,84 ---- osg::ref_ptr<osg::Group> worldObjects; ///< add unit objects to this group osg::ref_ptr<osg::Group> rootnode; + osg::ref_ptr<osg::Group> rootnodeFar; osg::ref_ptr<osgParticle::ParticleSystemUpdater> particleSystemUpdater; *************** *** 141,145 **** void SetCameraEl(float el); void SetCameraRange(float range_m); ! void SetTerrainActive(bool state); void SetText(const char *s); --- 151,155 ---- void SetCameraEl(float el); void SetCameraRange(float range_m); ! void SetFogMode(int mode); void SetTerrainActive(bool state); void SetText(const char *s); *************** *** 210,213 **** --- 220,224 ---- void InitGuiView(); void InitSceneView(wxPoint pos, wxSize size); + void InitSceneViewFar(wxPoint pos, wxSize size); void InitState(); void InitText(); --- NEW FILE: tcAltitudeBarControl.h --- /** ** @file tcAltitudeBarControl.h */ /* Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _TCALTITUDEBARCONTROL_H_ #define _TCALTITUDEBARCONTROL_H_ #if _MSC_VER > 1000 #pragma once #endif #include "tcRect.h" #include "tcControl.h" #include <osg/ref_ptr> #include <osg/Vec4> class tcGameObject; class tc3DWindow; namespace osg { class Texture2D; } /** * Altitude bar control */ class tcAltitudeBarControl : public tcControl { public: virtual void Draw(tc3DWindow* graphics); virtual void OnLButtonDown(wxMouseEvent& event); virtual void OnLButtonUp(wxMouseEvent& event); virtual void OnMouseMove(wxMouseEvent& event); tcAltitudeBarControl(float x, float y, float width, float height); virtual ~tcAltitudeBarControl(); protected: tcRect barRect; tcRect upRect; ///< region for up icon tcRect downRect; ///< region for down icon float fontSize; float fontSizeLarge; ///< for main altitude display float increaseScaleThresh; ///< increase if current is > (maxscale * increaseScaleThresh) float decreaseScaleThresh; ///< decrease if current is < (maxscale * decreaseScaleThresh) bool mouseOverBar; bool mouseOverUp; bool mouseOverDown; wxPoint mousePosition; osg::ref_ptr<osg::Texture2D> upIcon; osg::ref_ptr<osg::Texture2D> upOverIcon; osg::ref_ptr<osg::Texture2D> downIcon; osg::ref_ptr<osg::Texture2D> downOverIcon; osg::Vec4 color; osg::Vec4 colorDim; osg::Vec4 neutralColor; osg::Vec4 dangerColor; osg::Vec4 warnColor; osg::Vec4 overColor; tcRect currentRect; ///< filled rect with current altitude or depth tcRect overRect; ///< filled semi-transparent rect for mouse over position float yGoal; ///< y position of goal altitude or depth float yTerrain; ///< y position of ground or ocean bottom float yLimit; ///< y pos of max altitude or depth float currentGoal; /// current goal altitude or depth float currentValue; ///< current altitude or depth float currentScale; ///< altitude or depth of current max scale bool isDepth; ///< true if depth control (submarine) void LoadIcons(); void UpdateDrawParameters(); }; #endif |
|
From: Dewitt C. <ddc...@us...> - 2004-11-23 23:32:36
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29552/src/graphics Modified Files: cspSky.cpp tc3DModel.cpp tc3DTerrain.cpp tc3DViewer.cpp tcMapView.cpp tcMessageCenter.cpp tcMessageChannel.cpp tcParticleEffect.cpp tcTerrainTextureFactory.cpp Added Files: tcAltitudeBarControl.cpp tcControl.cpp Log Message: Text message "message center" GUI screen Index: tc3DTerrain.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DTerrain.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tc3DTerrain.cpp 1 Nov 2004 03:17:17 -0000 1.16 --- tc3DTerrain.cpp 23 Nov 2004 23:30:55 -0000 1.17 *************** *** 33,36 **** --- 33,37 ---- #include <osg/Depth> #include <osg/PolygonMode> + #include <osg/Texture2D> #include <Demeter/Loader.h> #include "simmath.h" *************** *** 49,52 **** --- 50,126 ---- } + /** + * + */ + void tc3DTerrain::InitWaterSurface() + { + waterSurface = new osg::Geometry; + + osg::Vec3Array* vertices = new osg::Vec3Array(8); + (*vertices)[0] = osg::Vec3(1e5, 1e5, 0); + (*vertices)[1] = osg::Vec3(-1e5, 1e5, 0); + (*vertices)[2] = osg::Vec3(-1e5, -1e5, 0); + (*vertices)[3] = osg::Vec3(1e5, -1e5, 0); + (*vertices)[4] = osg::Vec3(1e5, -1e5, 0); + (*vertices)[5] = osg::Vec3(-1e5, -1e5, 0); + (*vertices)[6] = osg::Vec3(-1e5, 1e5, 0); + (*vertices)[7] = osg::Vec3(1e5, 1e5, 0); + + + waterSurface->setVertexArray(vertices); + + + osg::Vec2Array* texcoords = new osg::Vec2Array(8); + const float k_tex = 500.0f; // larger repeats texture more + (*texcoords)[0].set(0.0f, k_tex); + (*texcoords)[1].set(0.0f, 0.0f); + (*texcoords)[2].set(k_tex, 0.0f); + (*texcoords)[3].set(k_tex, k_tex); + (*texcoords)[4].set(0.0f, k_tex); + (*texcoords)[5].set(0.0f, 0.0f); + (*texcoords)[6].set(k_tex, 0.0f); + (*texcoords)[7].set(k_tex, k_tex); + waterSurface->setTexCoordArray(0, texcoords); + + + osg::Vec3Array* normals = new osg::Vec3Array(2); + (*normals)[0].set(0.0f, 0.0f, 1.0f); + (*normals)[1].set(0.0f, 0.0f, -1.0f); + waterSurface->setNormalArray(normals); + waterSurface->setNormalBinding(osg::Geometry::BIND_PER_PRIMITIVE); + + + osg::Vec4Array* colors = new osg::Vec4Array; + colors->push_back(osg::Vec4(1.0f,1.0f,1.0f,1.0f)); + waterSurface->setColorArray(colors); + waterSurface->setColorBinding(osg::Geometry::BIND_OVERALL); + + + waterSurface->addPrimitiveSet(new osg::DrawArrays(GL_QUADS,0,8)); + + waterSurface->setUseDisplayList(true); + + + + osg::StateSet* stateSet = waterSurface->getOrCreateStateSet(); + stateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::ON); + //stateSet->setMode(GL_DEPTH_WRITEMASK, osg::StateAttribute::ON); + stateSet->setMode(GL_LIGHTING, osg::StateAttribute::ON); + stateSet->setMode(GL_BLEND, osg::StateAttribute::ON); + stateSet->setMode(GL_FOG, osg::StateAttribute::ON); + //stateSet->setRenderBinDetails(baseRenderBin + rectRenderBin, "RenderBin"); + + waterTexture = new osg::Texture2D; + waterTexture->setImage(osgDB::readImageFile("water2b.bmp")); + waterTexture->setWrap(osg::Texture::WRAP_S, osg::Texture::MIRROR); + waterTexture->setWrap(osg::Texture::WRAP_T, osg::Texture::MIRROR); + + stateSet->setTextureAttributeAndModes(0, waterTexture.get(), + osg::StateAttribute::ON); + + wxASSERT(terrainNode.valid()); + terrainNode->addDrawable(waterSurface.get()); + } + void tc3DTerrain::CheckElevations() { *************** *** 107,111 **** float height = mapData->GetTerrainHeight(lon_deg, lat_deg, gameTime); long idx = i*GRID_DIM + j; ! elevationArray[idx] = (height < 0) ? 0.001f*height : height; } } --- 181,186 ---- float height = mapData->GetTerrainHeight(lon_deg, lat_deg, gameTime); long idx = i*GRID_DIM + j; ! //elevationArray[idx] = (height < 0) ? 0.001f*height : height; ! elevationArray[idx] = height; } } *************** *** 261,264 **** --- 336,341 ---- float detailThreshold = 6.0f; terrain->SetDetailThreshold(detailThreshold); + + InitWaterSurface(); } Index: tc3DModel.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DModel.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tc3DModel.cpp 6 Nov 2004 15:13:41 -0000 1.15 --- tc3DModel.cpp 23 Nov 2004 23:30:55 -0000 1.16 *************** *** 322,329 **** void tc3DModel::DisableSmoke() { ! if (smokeTrail.valid()) { smokeTrail->DetachFromSceneGraph(); ! smokeTrail.release(); smokePlacer = 0; } --- 322,329 ---- void tc3DModel::DisableSmoke() { ! if (smokeTrail) { smokeTrail->DetachFromSceneGraph(); ! smokeTrail = 0; smokePlacer = 0; } *************** *** 339,342 **** --- 339,351 ---- smokeTrail->AddToSceneGraph(world.get()); smokePlacer = smokeTrail->GetParticlePlacer(); + + if (smokeMode == tcParticleEffect::BUBBLES) + { + smokeSource.set(0, -GetRadius(), 0); + } + else + { + smokeSource.set(0, 0, 0); + } } *************** *** 521,525 **** wxASSERT(smokePlacer); if (smokePlacer == 0) return; ! smokePlacer->setCenter(x, y, z); } --- 530,551 ---- wxASSERT(smokePlacer); if (smokePlacer == 0) return; ! wxASSERT(gameObj); ! ! const osg::Vec3 xaxis(-1, 0, 0); ! const osg::Vec3 yaxis(0, 1, 0); ! const osg::Vec3 zaxis(0, 0, 1); ! ! osg::Vec3 pos(x, y, z); ! ! // heading, pitch, roll ! osg::Matrixf rotation; ! ! rotation.makeRotate(gameObj->mcKin.mfHeading_rad, zaxis, ! gameObj->mcKin.mfPitch_rad, xaxis, ! gameObj->mcKin.mfRoll_rad, yaxis); ! osg::Vec3 smokeOffset = rotation * smokeSource; ! pos = pos + smokeOffset; ! ! smokePlacer->setCenter(pos.x(), pos.y(), pos.z()); } *************** *** 538,542 **** */ tc3DModel::tc3DModel(const tc3DModel* source) ! : smokePlacer(0), distanceFromCamera(1e10) { --- 564,568 ---- */ tc3DModel::tc3DModel(const tc3DModel* source) ! : smokePlacer(0), smokeTrail(0), distanceFromCamera(1e10) { *************** *** 588,591 **** --- 614,618 ---- tc3DModel::~tc3DModel() { + } Index: tc3DViewer.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DViewer.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tc3DViewer.cpp 6 Nov 2004 15:13:41 -0000 1.5 --- tc3DViewer.cpp 23 Nov 2004 23:30:55 -0000 1.6 *************** *** 353,356 **** --- 353,357 ---- int correctedY = parentHeight - (pos.y + size.GetHeight()); sceneView->setViewport(pos.x,correctedY, size.GetWidth(),size.GetHeight()); + sceneViewFar->setViewport(pos.x,correctedY, size.GetWidth(),size.GetHeight()); mnWidth = size.GetWidth(); *************** *** 428,446 **** { osgUtil::RenderStage* stage = sceneView->getRenderStage(); if (modeCode == 1) { stage->setClearMask(GL_DEPTH_BUFFER_BIT); } else if (modeCode == 2) { ! stage->setClearMask(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT); } else { stage->setClearMask(0); } } void tc3DViewer::SetGameTime(double t) { --- 429,501 ---- { osgUtil::RenderStage* stage = sceneView->getRenderStage(); + osgUtil::RenderStage* stageFar = sceneViewFar->getRenderStage(); if (modeCode == 1) { stage->setClearMask(GL_DEPTH_BUFFER_BIT); + stageFar->setClearMask(GL_DEPTH_BUFFER_BIT); } else if (modeCode == 2) { ! stage->setClearMask(GL_DEPTH_BUFFER_BIT); ! stageFar->setClearMask(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT); } else { stage->setClearMask(0); + stageFar->setClearMask(0); } } + /** + * + */ + void tc3DViewer::SetFogMode(int mode) + { + wxASSERT(foggedObjects.valid()); + wxASSERT(sceneViewFar.valid()); + + osg::StateSet* fogState = foggedObjects->getOrCreateStateSet(); + osg::Fog* fog = dynamic_cast<osg::Fog*>(fogState->getAttribute(osg::StateAttribute::FOG)); + if (!fog) + { + fog = new osg::Fog; + fogState->setAttributeAndModes(fog, osg::StateAttribute::ON); + } + + if (mode == FOG_OFF) + { + fogState->setMode(GL_FOG, osg::StateAttribute::OFF); + sceneViewFar->setClearColor(osg::Vec4(0, 0, 0, 1)); + return; + } + + osg::Vec4 airFog(0.6f, 0.7f, 0.8f, 1.0f); + osg::Vec4 waterFog(0.1f, 0.2f, 0.3f, 1.0f); + + fogState->setMode(GL_FOG, osg::StateAttribute::ON); + + fog->setMode(osg::Fog::EXP); + + if (mode == FOG_AIR) + { + fog->setColor(airFog); // blue-white fog + fog->setStart(5000.0f); + fog->setEnd(60000.0f); + fog->setDensity(0.000006f); + sceneViewFar->setClearColor(airFog); + } + else + { + fog->setColor(waterFog); // dark blue fog + fog->setStart(30.0f); + fog->setEnd(60000.0f); + fog->setDensity(0.0006f); + sceneViewFar->setClearColor(waterFog); + } + + + } + void tc3DViewer::SetGameTime(double t) { *************** *** 697,708 **** foggedObjects = new osg::Group; osg::Fog *fog = new osg::Fog(); ! fog->setColor(osg::Vec4(0.6f,0.7f,0.8f,1.0f)); // blue-white fog fog->setMode(osg::Fog::EXP); fog->setStart(5000.0f); fog->setEnd(60000.0f); ! fog->setDensity(0.000005f); ! /* fog->setMode(osg::Fog::LINEAR); --- 752,767 ---- foggedObjects = new osg::Group; + SetFogMode(FOG_AIR); + /* osg::Fog *fog = new osg::Fog(); ! fog->setColor(osg::Vec4(0.6f, 0.7f, 0.8f, 1.0f)); // blue-white fog fog->setMode(osg::Fog::EXP); fog->setStart(5000.0f); fog->setEnd(60000.0f); ! fog->setDensity(0.000006f); ! */ ! ! /* fog->setMode(osg::Fog::LINEAR); *************** *** 712,719 **** */ osg::StateSet *fogState = foggedObjects->getOrCreateStateSet(); fogState->setAttributeAndModes(fog, osg::StateAttribute::ON); foggedObjects->setStateSet(fogState); ! { worldObjects = new osg::Group; --- 771,779 ---- */ + /* osg::StateSet *fogState = foggedObjects->getOrCreateStateSet(); fogState->setAttributeAndModes(fog, osg::StateAttribute::ON); foggedObjects->setStateSet(fogState); ! */ { worldObjects = new osg::Group; *************** *** 765,770 **** rootnode->addChild(foggedObjects.get()); ! rootnode->addChild(skyTransform.get()); ! rootnode->addChild(orthoProjection.get()); isTerrainActive = true; --- 825,838 ---- rootnode->addChild(foggedObjects.get()); ! rootnodeFar->addChild(skyTransform.get()); ! ! /* For some strange reason, adding the orthoProjection to ! ** rootnodeFar causes line and rect objects in the guiView ! ** (a DIFFERENT SceneView) to drop out. ! ** Adding to rootnode causes a double image of the hud objects, ! ** but this is the lesser of evils. ! ** TODO investigate this. There may be a significant problem ! ** lurking here. */ ! rootnode->addChild(orthoProjection.get()); isTerrainActive = true; *************** *** 848,853 **** guiView->draw(); ! if (isActive && sceneView.valid()) { sceneView->update(); sceneView->cull(); --- 916,925 ---- guiView->draw(); ! if (isActive && sceneView.valid() && sceneViewFar.valid()) { + sceneViewFar->update(); + sceneViewFar->cull(); + sceneViewFar->draw(); + sceneView->update(); sceneView->cull(); *************** *** 950,957 **** cameraTarget = cameraPosition*m; } ! ! if (cameraPosition._v[2] < 1) cameraPosition._v[2] = 1; // limit min camera altitude sceneView->setViewMatrixAsLookAt(cameraPosition, cameraTarget, osg::Vec3(0,0,1)); // update skyTransform based on camera position --- 1022,1054 ---- cameraTarget = cameraPosition*m; } ! // limit min camera altitude unless subsurface obj ! if ((obj->mpDBObject->mnType & PTYPE_SUBSURFACE) != 0) ! { ! if (cameraPosition._v[2] < -480.0) cameraPosition._v[2] = -480.0; ! } ! else ! { ! if (cameraPosition._v[2] < 1) cameraPosition._v[2] = 1; ! } ! // workaround for sky issue, deactivate sky when camera underwater ! if (cameraPosition._v[2] < -1.0) ! { ! if (skyTransform->getNumParents()) ! { ! rootnodeFar->removeChild(skyTransform.get()); ! SetFogMode(FOG_WATER); ! } ! } ! else ! { ! if (isTerrainActive && (skyTransform->getNumParents() == 0)) ! { ! rootnodeFar->addChild(skyTransform.get()); ! SetFogMode(FOG_AIR); ! } ! } sceneView->setViewMatrixAsLookAt(cameraPosition, cameraTarget, osg::Vec3(0,0,1)); + sceneViewFar->setViewMatrixAsLookAt(cameraPosition, cameraTarget, osg::Vec3(0,0,1)); // update skyTransform based on camera position *************** *** 1217,1223 **** // set up the clear mask. osgUtil::RenderStage *stage = sceneView->getRenderStage(); ! stage->setClearMask(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT); stage->setClearDepth(1.0f); ! stage->setClearColor(osg::Vec4(0,0,0,1.0f)); frameStamp = new osg::FrameStamp; --- 1314,1321 ---- // set up the clear mask. osgUtil::RenderStage *stage = sceneView->getRenderStage(); ! // stage->setClearMask(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT); stage->setClearDepth(1.0f); ! //stage->setClearColor(osg::Vec4(0,0,0,1.0f)); ! stage->setClearMask(GL_DEPTH_BUFFER_BIT); frameStamp = new osg::FrameStamp; *************** *** 1228,1233 **** --- 1326,1400 ---- updateVisitor->setFrameStamp(frameStamp.get()); sceneView->setUpdateVisitor(updateVisitor.get()); + } + + + /** + * + */ + void tc3DViewer::InitSceneViewFar(wxPoint pos, wxSize size) + { + + sceneViewFar = new osgUtil::SceneView(); + + if (!displaySettings.valid()) + { + wxASSERT(sceneViewFar->getDisplaySettings()==NULL); + displaySettings = new osg::DisplaySettings; + displaySettings->setDepthBuffer(true); + } + + // displaySettings->setRGB(true); + //displaySettings->setDoubleBuffer(true); + //displaySettings->setMinimumNumAlphaBits(4); + + sceneViewFar->setDisplaySettings(displaySettings.get()); + sceneViewFar->setDefaults(); + sceneViewFar->getState()->setContextID(2); + + wxWindow *parent = wxWindow::GetParent(); + wxSize parentSize = parent->GetSize(); + int parentHeight = parentSize.GetHeight(); + int correctedY = parentHeight - (pos.y + size.GetHeight()); + + UpdateProjectionMatrix(size); + + sceneViewFar->setViewport(pos.x,correctedY,size.GetWidth(),size.GetHeight()); + sceneViewFar->setComputeNearFarMode(osgUtil::CullVisitor::DO_NOT_COMPUTE_NEAR_FAR); + sceneViewFar->setLightingMode(osgUtil::SceneView::NO_SCENEVIEW_LIGHT); + sceneViewFar->setClearColor(osg::Vec4(0, 0, 0, 1.0f)); + //sceneViewFar->setComputeNearFarMode(osgUtil::CullVisitor::COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES); + /* + NO_CULLING = 0x0, + VIEW_FRUSTUM_CULLING = 0x1, + NEAR_PLANE_CULLING = 0x2, + FAR_PLANE_CULLING = 0x4, + SMALL_FEATURE_CULLING = 0x8, + SHADOW_OCCLUSION_CULLING = 0x10, + ENABLE_ALL_CULLING + */ + sceneViewFar->setCullingMode( + osg::CullStack::NO_CULLING + // osg::CullStack::FAR_PLANE_CULLING + // osg::CullStack::NEAR_PLANE_CULLING + // osg::CullStack::VIEW_FRUSTUM_CULLING + // osg::CullStack::SMALL_FEATURE_CULLING + ); + + // set up the clear mask. + osgUtil::RenderStage *stage = sceneViewFar->getRenderStage(); + stage->setClearMask(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT); + stage->setClearDepth(1.0f); + stage->setClearColor(osg::Vec4(0,0,0,1.0f)); + + frameStampFar = new osg::FrameStamp; + frameStampFar->setReferenceTime(gameTime); + sceneViewFar->setFrameStamp(frameStampFar.get()); + + updateVisitorFar = new osgUtil::UpdateVisitor(); + updateVisitorFar->setFrameStamp(frameStampFar.get()); + sceneViewFar->setUpdateVisitor(updateVisitorFar.get()); } + /** * set global state at root node *************** *** 1324,1328 **** if (state) { ! rootnode->addChild(skyTransform.get()); foggedObjects->addChild(terrainNode.get()); foggedObjects->addChild(skyLights.get()); --- 1491,1498 ---- if (state) { ! if (skyTransform->getNumParents() == 0) ! { ! rootnodeFar->addChild(skyTransform.get()); ! } foggedObjects->addChild(terrainNode.get()); foggedObjects->addChild(skyLights.get()); *************** *** 1332,1338 **** else { ! if (!rootnode->removeChild(skyTransform.get()) || ! !foggedObjects->removeChild(terrainNode.get()) || !foggedObjects->removeChild(skyLights.get())) { --- 1502,1514 ---- else { + // skyTransform already removed if camera underwater + rootnodeFar->removeChild(skyTransform.get()); + if (unsigned int nParents = skyTransform->getNumParents()) + { + fprintf(stderr, "tc3DViewer::SetTerrainActive - " + "skyTransform still has (%d) parents after removal\n", nParents); + } ! if (!foggedObjects->removeChild(terrainNode.get()) || !foggedObjects->removeChild(skyLights.get())) { *************** *** 1570,1575 **** frameStamp->setFrameNumber(frameStamp->getFrameNumber()+1); frameStamp->setReferenceTime(gameTime); - updateVisitor->setTraversalNumber(frameStamp->getFrameNumber()); } --- 1746,1757 ---- frameStamp->setFrameNumber(frameStamp->getFrameNumber()+1); frameStamp->setReferenceTime(gameTime); updateVisitor->setTraversalNumber(frameStamp->getFrameNumber()); + + frameStampFar->setFrameNumber(frameStampFar->getFrameNumber()+1); + frameStampFar->setReferenceTime(gameTime); + updateVisitorFar->setTraversalNumber(frameStampFar->getFrameNumber()); + + + } *************** *** 1582,1587 **** wxASSERT(sceneView.valid()); float aspectRatio = (float)windowSize.GetWidth() / (float)windowSize.GetHeight(); ! sceneView->setProjectionMatrixAsPerspective(45.0, aspectRatio, zmin, zmax); } --- 1764,1777 ---- wxASSERT(sceneView.valid()); + float zmid = sqrtf(zmin*zmax); + float aspectRatio = (float)windowSize.GetWidth() / (float)windowSize.GetHeight(); ! ! sceneView->setProjectionMatrixAsPerspective(45.0, aspectRatio, zmin, zmid); ! if (sceneViewFar.valid()) ! { ! sceneViewFar->setProjectionMatrixAsPerspective(45.0, aspectRatio, zmid-20, zmax); ! } ! } *************** *** 1603,1606 **** --- 1793,1797 ---- zmin = 2.0f; zmax = 131072.0f; + zmax = 50000.0f; *************** *** 1630,1633 **** --- 1821,1825 ---- InitSceneView(pos, size); + InitSceneViewFar(pos, size); InitGuiView(); *************** *** 1652,1656 **** --- 1844,1852 ---- rootnode = new osg::Group; + rootnodeFar = new osg::Group; + rootnodeFar->addChild(rootnode.get()); + sceneView->setSceneData(rootnode.get()); + sceneViewFar->setSceneData(rootnodeFar.get()); hudObjects = new osg::MatrixTransform; --- NEW FILE: tcAltitudeBarControl.cpp --- /** ** @file tcAltitudeBarControl.cpp */ /* Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "stdwx.h" // precompiled header file #ifndef WX_PRECOMP #include "wx/wx.h" #endif #include "tcAltitudeBarControl.h" #include "tc3DWindow.h" #include "tcAirObject.h" #include "tcGameObject.h" #include "tcPlatformObject.h" #include "tcSubObject.h" #include "tcGenericDBObject.h" #include <osg/Texture2D> #include <osg/Vec4> #ifdef _DEBUG #define new DEBUG_NEW #endif /** * */ void tcAltitudeBarControl::Draw(tc3DWindow* graphics) { wxASSERT(graphics); if (!IsActive()) return; if (!obj) return; UpdateDrawParameters(); osgText::Font* font = graphics->GetDefaultFont(); // draw main altitude / depth text float x = barRect.GetRight() + 24.0; float y = barRect.YCenter(); wxString s = wxString::Format("%.0f m", currentValue); graphics->DrawText(s.c_str(), x, y, font, color, fontSizeLarge, CENTER_CENTER); // draw scale text x = barRect.XCenter(); y = isDepth ? barRect.bottom - 7 : barRect.top + 7; s = wxString::Format("%.0f", currentScale); graphics->DrawText(s.c_str(), x, y, font, color, fontSize, CENTER_CENTER); graphics->DrawRectangle(currentRect, color, tc3DWindow::FILL_ON); if (mouseOverBar) { graphics->DrawRectangle(overRect, overColor, tc3DWindow::FILL_ON); } graphics->DrawRectangle(barRect, colorDim, tc3DWindow::FILL_OFF); float x1 = barRect.GetLeft() - 2.0; float x2 = barRect.GetRight() + 2.0; graphics->DrawLine(x1, yGoal, x2, yGoal, neutralColor); // goal line graphics->DrawLine(x1, yTerrain, x2, yTerrain, dangerColor); // terrain line graphics->DrawLine(x1, yLimit, x2, yLimit, warnColor); // max alt or depth line osg::Texture2D* upTex = mouseOverUp ? upOverIcon.get() : upIcon.get(); osg::Texture2D* downTex = mouseOverDown ? downOverIcon.get() : downIcon.get(); graphics->DrawImage(upTex, upRect.XCenter(), upRect.YCenter(), upRect.Width(), upRect.Height()); graphics->DrawImage(downTex, downRect.XCenter(), downRect.YCenter(), downRect.Width(), downRect.Height()); } /** * */ void tcAltitudeBarControl::LoadIcons() { upIcon = tc3DWindow::LoadTexture("up_arrow.png"); upOverIcon = tc3DWindow::LoadTexture("up_arrow_over.png"); downIcon = tc3DWindow::LoadTexture("down_arrow.png"); downOverIcon = tc3DWindow::LoadTexture("down_arrow_over.png"); } /** * */ void tcAltitudeBarControl::OnLButtonDown(wxMouseEvent& event) { wxPoint pos = event.GetPosition(); float x = float(pos.x); float y = float(pos.y); float commandValue = 0; wxASSERT(obj); if (barRect.ContainsPoint(x, y)) { if (isDepth) { // negative val for depth commandValue = (y - barRect.top) * currentScale / barRect.Height(); } else { commandValue = (y - barRect.bottom) * currentScale / barRect.Height(); } } else if (upRect.ContainsPoint(x, y)) { commandValue = isDepth? -currentGoal + 5 : currentGoal + 10; } else if (downRect.ContainsPoint(x, y)) { commandValue = isDepth? -currentGoal - 5 : currentGoal - 10; } else { return; } if (tcAirObject *air = dynamic_cast<tcAirObject*>(obj)) { if (commandValue < 3) commandValue = 3; air->mcGS.SetAltitude(commandValue); } else if (tcSubObject* sub = dynamic_cast<tcSubObject*>(obj)) { if (commandValue > 0) commandValue = 0; sub->mcGS.SetAltitude(commandValue); } } /** * */ void tcAltitudeBarControl::OnLButtonUp(wxMouseEvent& event) { } /** * */ void tcAltitudeBarControl::OnMouseMove(wxMouseEvent& event) { wxPoint pos = event.GetPosition(); float x = float(pos.x); float y = float(pos.y); mouseOverBar = false; mouseOverUp = false; mouseOverDown = false; if (barRect.ContainsPoint(x, y)) { mouseOverBar = true; mousePosition = pos; } else if (upRect.ContainsPoint(x, y)) { mouseOverUp = true; } else if (downRect.ContainsPoint(x, y)) { mouseOverDown = true; } } /** * */ void tcAltitudeBarControl::UpdateDrawParameters() { tcPlatformObject* platform = dynamic_cast<tcPlatformObject*>(obj); if (!platform) return; isDepth = platform->mpDBObject->mfMaxDepth_m > 0; float limit, terrain; if (isDepth) { currentValue = -platform->mcKin.mfAlt_m; limit = platform->mpDBObject->mfMaxDepth_m; terrain = -platform->mcTerrain.mfHeight_m; currentGoal = -platform->mcGS.mfGoalAltitude_m; } else { currentValue = platform->mcKin.mfAlt_m; limit = platform->mpDBObject->mfMaxAltitude_m; terrain = platform->mcTerrain.mfHeight_m; currentGoal = platform->mcGS.mfGoalAltitude_m; if (terrain < 0) terrain = 0; } if (currentGoal > limit) currentGoal = limit; else if (currentGoal < 0) currentGoal = 0; // update scale while ((currentScale*increaseScaleThresh < currentGoal) && (currentScale < 40000)) { currentScale *= 2.0; } while ((currentScale*decreaseScaleThresh > currentGoal) && (currentScale > 100)) { currentScale *= 0.5; } if (limit > currentScale) limit = currentScale; if (terrain > currentScale) terrain = currentScale; float k = barRect.Height() / currentScale; if (isDepth) { currentRect.top = barRect.top; currentRect.bottom = currentRect.top - k * currentValue; if (currentRect.bottom < barRect.bottom) currentRect.bottom = barRect.bottom; yGoal = currentRect.top - k * currentGoal; yTerrain = currentRect.top - k * terrain; yLimit = currentRect.top - k * limit; } else { currentRect.bottom = barRect.bottom; currentRect.top = currentRect.bottom + k * currentValue; if (currentRect.top > barRect.top) currentRect.top = barRect.top; yGoal = currentRect.bottom + k * currentGoal; yTerrain = currentRect.bottom + k * terrain; yLimit = currentRect.bottom + k * limit; } currentRect.left = barRect.left; currentRect.right = barRect.right; if (mouseOverBar) { overRect.left = barRect.left; overRect.right = barRect.right; if (isDepth) { overRect.top = barRect.top; overRect.bottom = mousePosition.y; } else { overRect.top = mousePosition.y; overRect.bottom = barRect.bottom; } } /* tcRect overRect; ///< filled semi-transparent rect for mouse over position */ } /** * */ tcAltitudeBarControl::tcAltitudeBarControl(float x, float y, float width, float height) : barRect(x, x+width, y, y+height), fontSize(10.0), fontSizeLarge(14.0), increaseScaleThresh(0.5), decreaseScaleThresh(0.25), mouseOverBar(false), mouseOverUp(false), mouseOverDown(false), currentScale(800), color(0.4, 1, 0.4, 1), colorDim(0.2, 0.5, 0.2, 1), neutralColor(0.8, 0.8, 0.8, 1), dangerColor(0.8, 0.3, 0.3, 1), warnColor(0.8, 0.8, 0.3, 1), overColor(1, 1, 1, 0.5) { float iconSize = 12; upRect.Set(barRect.GetRight() + 20, barRect.GetRight() + 20 + iconSize, barRect.YCenter(), barRect.YCenter() + iconSize); upRect.Offset(-0.5*iconSize, -0.5*iconSize); downRect = upRect; upRect.Offset(0, 0.35*(barRect.Height()-iconSize)); downRect.Offset(0, -0.35*(barRect.Height()-iconSize)); LoadIcons(); } /** * */ tcAltitudeBarControl::~tcAltitudeBarControl() { } Index: tcMessageCenter.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMessageCenter.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcMessageCenter.cpp 14 Nov 2004 22:52:21 -0000 1.1 --- tcMessageCenter.cpp 23 Nov 2004 23:30:56 -0000 1.2 *************** *** 110,114 **** // move channelTab to next position ! channelTab.Offset(channelTab.Width() + 2.0, 0); channelMap[channelName] = channel; --- 110,114 ---- // move channelTab to next position ! channelTab.Offset(channelTab.Width() + 4.0, 0); channelMap[channelName] = channel; *************** *** 187,190 **** --- 187,196 ---- tcMessageCenter::~tcMessageCenter() { + std::map<std::string, tcMessageChannel*>::iterator iter; + for (iter = channelMap.begin(); iter != channelMap.end(); ++iter) + { + tcMessageChannel* channel = iter->second; + delete channel; + } } Index: tcMessageChannel.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMessageChannel.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcMessageChannel.cpp 14 Nov 2004 22:52:21 -0000 1.1 --- tcMessageChannel.cpp 23 Nov 2004 23:30:56 -0000 1.2 *************** *** 75,79 **** else if (isMouseOver) { ! buttonColor.set(0.05, 0.05, 0.3, 1); buttonTextColor.set(1, 1, 1, 1); } --- 75,79 ---- else if (isMouseOver) { ! buttonColor.set(0.1, 0.1, 0.5, 1); buttonTextColor.set(1, 1, 1, 1); } Index: cspSky.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/cspSky.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** cspSky.cpp 2 Nov 2004 04:23:56 -0000 1.12 --- cspSky.cpp 23 Nov 2004 23:30:55 -0000 1.13 *************** *** 1372,1375 **** --- 1372,1376 ---- for (i = 0; i < m_nlev; ++i) { double elev = toRadians(m_lev[i]); + if (elev < 0.0) elev = 0.0; // sub horizon colors aren't correct double azimuth = -sun_A - 0.5 * C_PI; *************** *** 1387,1398 **** --- 1388,1402 ---- Color c = m_SkyShader.SkyColor(elev, azimuth+jitter, dark, intensity); azimuth += da; + colors[ci][0] = c.getA(); colors[ci][1] = c.getB(); colors[ci][2] = c.getC(); colors[ci][3] = 1.0; + if (i == m_HorizonIndex) { (*m_HorizonColors)[j] = colors[ci]; horizon_average += colors[ci]; } + ++ci; m_AverageIntensity += intensity; *************** *** 1402,1405 **** --- 1406,1410 ---- m_AverageIntensity /= m_nlev*m_nseg; m_SkyDome->dirtyDisplayList(); + } #endif Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapView.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcMapView.cpp 14 Nov 2004 22:52:21 -0000 1.8 --- tcMapView.cpp 23 Nov 2004 23:30:55 -0000 1.9 *************** *** 1242,1245 **** --- 1242,1304 ---- } + + /** + * Creates osg::Geometry object for requested NTDS symbol + */ + osg::Geometry* tcTacticalMapView::DrawNTDSSubsurface(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) + { + case FRIENDLY: + case NEUTRAL: + { + AddArcPrimitive(symbol, vertices, 0, 0, 2*w, -2*w, -90, 90, 32); + break; + } + case UNKNOWN: + { + vertices->push_back(osg::Vec3(w, 0, 0)); + vertices->push_back(osg::Vec3(w, -w, 0)); + vertices->push_back(osg::Vec3(-w, -w, 0)); + vertices->push_back(osg::Vec3(-w, 0, 0)); + + symbol->addPrimitiveSet(new osg::DrawArrays(GL_LINE_STRIP,0,4)); + break; + } + case HOSTILE: + { + 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_STRIP,0,3)); + break; + } + default: + { + fprintf(stderr, "Error - tcTacticalMapView::DrawNTDSSubsurface\n"); + } + } + + + return symbol; + } + + /** * Creates osg::Geometry objects for NTDS symbol set *************** *** 1266,1269 **** --- 1325,1333 ---- osg::Geometry* pAirRW = DrawNTDSAirRW((teAffiliation)nAffiliation); + // sub + osg::Geometry* pSub = DrawNTDSSubsurface((teAffiliation)nAffiliation); + + + // unknown (small square, not strictly NTDS osg::Geometry* pUnknown = DrawNTDSUnknown((teAffiliation)nAffiliation); *************** *** 1294,1298 **** case SYMBOL_SUBSURFACE: case SYMBOL_SUBMARINE: ! pSymbol = pSurface; break; case SYMBOL_FIXED: --- 1358,1362 ---- case SYMBOL_SUBSURFACE: case SYMBOL_SUBMARINE: ! pSymbol = pSub; break; case SYMBOL_FIXED: *************** *** 1346,1349 **** --- 1410,1419 ---- osg::Geometry* pMissile = CreateTexturedSymbol(zBuff); + sprintf(zBuff,"fixed%s",zAffil); + osg::Geometry* pFixed = CreateTexturedSymbol(zBuff); + + sprintf(zBuff,"sub%s",zAffil); + osg::Geometry* pSub = CreateTexturedSymbol(zBuff); + osg::Geometry* pUnknown = CreateTexturedSymbol("unknown.png"); *************** *** 1372,1377 **** case SYMBOL_SUBSURFACE: case SYMBOL_SUBMARINE: ! pSymbol = pUnknown; break; default: pSymbol = pUnknown; --- 1442,1450 ---- case SYMBOL_SUBSURFACE: case SYMBOL_SUBMARINE: ! pSymbol = pSub; break; + case SYMBOL_FIXED: + pSymbol = pFixed; + break; default: pSymbol = pUnknown; Index: tcParticleEffect.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcParticleEffect.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcParticleEffect.cpp 7 Nov 2004 03:40:44 -0000 1.5 --- tcParticleEffect.cpp 23 Nov 2004 23:30:57 -0000 1.6 *************** *** 187,190 **** --- 187,191 ---- particlePlacer->setApplyJitter(true); + setDefaultAttributes("smoke.rgb", false, false); } *************** *** 206,209 **** --- 207,211 ---- particlePlacer->setApplyJitter(true); + setDefaultAttributes("smoke.rgb", false, false); } break; *************** *** 230,233 **** --- 232,236 ---- //op->setFluidToAir(); //program->addOperator(op); + setDefaultAttributes("smoke.rgb", false, false); } break; *************** *** 254,257 **** --- 257,283 ---- op->setFluidToAir(); program->addOperator(op); + + setDefaultAttributes("smoke.rgb", false, false); + } + break; + case BUBBLES: + { + ptemplate.setLifeTime(20); + ptemplate.setSizeRange(osgParticle::rangef(1.5f, 2.5f)); + //ptemplate.setAlphaRange(osgParticle::rangef(0.1f, 0.3f)); + ptemplate.setColorRange(osgParticle::rangev4( + osg::Vec4(1.0f, 1.0f, 1.0f, 0.02f), + osg::Vec4(1.0f, 1.0f, 1.0f, 0.01f))); + ptemplate.setRadius(1.0f); + ptemplate.setMass(0.05f); + + counter->setRateRange(5, 10); + + shooter->setInitialSpeedRange(0, 0.1); + + accelOp->setAcceleration(osg::Vec3(0, 0, 0)); + + particlePlacer->setApplyJitter(false); + setDefaultAttributes("water01.png", false, false); } break; *************** *** 260,264 **** } ! setDefaultAttributes("smoke.rgb", false, false); setDefaultParticleTemplate(ptemplate); --- 286,291 ---- } ! ! //setDefaultAttributes("water06b.png", false, false); setDefaultParticleTemplate(ptemplate); *************** *** 346,350 **** program->addOperator(accelOp.get()); } ! else { osgParticle::ModularEmitter* modularEmitter = new osgParticle::ModularEmitter; --- 373,380 ---- program->addOperator(accelOp.get()); } ! //else if (smokeModeCode == BUBBLES) ! //{ ! // } ! else { osgParticle::ModularEmitter* modularEmitter = new osgParticle::ModularEmitter; --- NEW FILE: tcControl.cpp --- /** ** @file tcControl.cpp */ /* Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "stdwx.h" // precompiled header file #ifndef WX_PRECOMP #include "wx/wx.h" #endif #include "tcControl.h" #ifdef _DEBUG #define new DEBUG_NEW #endif bool tcControl::useEnglishUnits = false; /** * */ void tcControl::SetUseEnglishUnits(bool state) { useEnglishUnits = state; } /** * */ bool tcControl::IsActive() const { return isActive; } /** * */ void tcControl::SetActive(bool state) { isActive = state; } /** * */ void tcControl::SetGameObject(tcGameObject* gameObj) { wxASSERT(gameObj); obj = gameObj; } /** * */ tcControl::tcControl() : obj(0), isActive(false) { } /** * */ tcControl::~tcControl() { } Index: tcTerrainTextureFactory.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcTerrainTextureFactory.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcTerrainTextureFactory.cpp 8 Aug 2004 00:31:34 -0000 1.11 --- tcTerrainTextureFactory.cpp 23 Nov 2004 23:30:57 -0000 1.12 *************** *** 339,343 **** { int n = 0; ! seaTexture = osgDB::readImageFile("water2b.bmp"); textureInfo[n].zmin = -1000.0f; textureInfo[n].zlow = -999.0f; --- 339,344 ---- { int n = 0; ! //seaTexture = osgDB::readImageFile("water2b.bmp"); ! seaTexture = osgDB::readImageFile("rock_texture_b.jpg"); // sea bottom now textureInfo[n].zmin = -1000.0f; textureInfo[n].zlow = -999.0f; |
|
From: Dewitt C. <ddc...@us...> - 2004-11-23 23:32:32
|
Update of /cvsroot/gcblue/gcb_wx/include/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29552/include/scriptinterface Modified Files: tcPlatformInterface.h tcSimPythonInterface.h Added Files: tcSubInterface.h Log Message: Text message "message center" GUI screen Index: tcPlatformInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcPlatformInterface.h,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** tcPlatformInterface.h 3 Nov 2004 16:36:42 -0000 1.25 --- tcPlatformInterface.h 23 Nov 2004 23:30:46 -0000 1.26 *************** *** 28,31 **** --- 28,32 ---- #include "tcPlatformObject.h" #include "tcSensorMap.h" + #include "tcSubInterface.h" #include <boost/python.hpp> *************** *** 160,163 **** --- 161,169 ---- return (mpPlatformObj->mnModelType == MTYPE_HELO); } + bool IsSub() + { + return (mpPlatformObj->mnModelType == MTYPE_SUBMARINE); + } + tcSubInterface GetSubInterface(); // script variables --- NEW FILE: tcSubInterface.h --- /* @file tcSubInterface.h ** ** Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __tcSubInterface_h__ #define __tcSubInterface_h__ #if _MSC_VER > 1000 #pragma once #endif class tcMessageInterface; class tcPlatformObject; class tcSubObject; class tcSimState; class tcSound; class tcSoundConsole; class tcCommandQueue; namespace ScriptInterface { /** * Interface class for submarine vehicle interface. */ class tcSubInterface { public: float GetMaxDepth() const; void GoToPeriscopeDepth(); bool IsAtPeriscopeDepth(); bool IsPeriscopeRaised() const; bool IsRadarMastRaised() const; bool IsValid() const; void LowerPeriscope(); void LowerRadarMast(); void RaisePeriscope(); void RaiseRadarMast(); tcSubInterface(); tcSubInterface(tcPlatformObject* obj); ~tcSubInterface(); private: static tcSound* sound; static tcSimState* simState; static tcMessageInterface* messageInterface; tcSubObject* subObj; }; } #endif Index: tcSimPythonInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcSimPythonInterface.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcSimPythonInterface.h 1 Sep 2004 02:55:36 -0000 1.15 --- tcSimPythonInterface.h 23 Nov 2004 23:30:47 -0000 1.16 *************** *** 32,35 **** --- 32,36 ---- #include "tcPythonInterface.h" #include "tcPlatformObject.h" + #include "tcSubInterface.h" #include "tcTrackInterface.h" #include "tcPlatformInterface.h" *************** *** 129,132 **** --- 130,134 ---- object PanelInterfaceType; object PanelInterface; + object SubInterfaceType; object TrackInterfaceType; object TrackInterface; |
|
From: Dewitt C. <ddc...@us...> - 2004-11-23 23:32:17
|
Update of /cvsroot/gcblue/gcb_wx/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29552/xml Modified Files: info_console.xml options.xml Log Message: Text message "message center" GUI screen Index: options.xml =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/xml/options.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** options.xml 6 Nov 2004 15:13:43 -0000 1.6 --- options.xml 23 Nov 2004 23:31:19 -0000 1.7 *************** *** 2,6 **** <HostAddress>192.168.0.102</HostAddress> <DisplaySettings>default</DisplaySettings> ! <LastScenarioPath>Random.py</LastScenarioPath> ! <LastScenarioName>Random</LastScenarioName> </Options> --- 2,6 ---- <HostAddress>192.168.0.102</HostAddress> <DisplaySettings>default</DisplaySettings> ! <LastScenarioPath>Test.SubTest.py</LastScenarioPath> ! <LastScenarioName>SubTest</LastScenarioName> </Options> Index: info_console.xml =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/xml/info_console.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** info_console.xml 7 Nov 2004 03:40:45 -0000 1.4 --- info_console.xml 23 Nov 2004 23:31:18 -0000 1.5 *************** *** 1,5 **** <Window> ! <TextBox TopMargin="2" BottomMargin="2" Wrap="31" DrawBorder="0" FontSize="12"/> </Window> \ No newline at end of file --- 1,5 ---- <Window> ! <TextBox TopMargin="2" BottomMargin="2" Wrap="34" DrawBorder="0" FontSize="12"/> </Window> \ No newline at end of file |
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29552/src/scriptinterface Modified Files: tcPlatformInterface.cpp tcPlatformInterfaceExtensionB.cpp tcScenarioInterface.cpp tcSimPythonInterface.cpp Added Files: tcSubInterface.cpp Log Message: Text message "message center" GUI screen Index: tcPlatformInterfaceExtensionB.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterfaceExtensionB.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcPlatformInterfaceExtensionB.cpp 16 Aug 2004 01:43:31 -0000 1.15 --- tcPlatformInterfaceExtensionB.cpp 23 Nov 2004 23:30:58 -0000 1.16 *************** *** 76,81 **** --- 76,83 ---- .def("IsAir", &tcPlatformInterface::IsAir) .def("IsHelo", &tcPlatformInterface::IsHelo) + .def("IsSub", &tcPlatformInterface::IsSub) .def("SetUpdate", &tcPlatformInterface::SetUpdateInterval) .def("SetActionText", &tcPlatformInterface::SetActionText) + .def("GetSubInterface", &tcPlatformInterface::GetSubInterface) // weapons and targeting Index: tcSimPythonInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcSimPythonInterface.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** tcSimPythonInterface.cpp 14 Nov 2004 22:52:21 -0000 1.20 --- tcSimPythonInterface.cpp 23 Nov 2004 23:30:58 -0000 1.21 *************** *** 605,608 **** --- 605,622 ---- PanelInterface = PanelInterfaceType(); + SubInterfaceType = class_<tcSubInterface>("SubInterfaceClass") + .def("GetMaxDepth", &tcSubInterface::GetMaxDepth) + .def("GoToPeriscopeDepth", &tcSubInterface::GoToPeriscopeDepth) + .def("IsAtPeriscopeDepth", &tcSubInterface::IsAtPeriscopeDepth) + .def("IsPeriscopeRaised", &tcSubInterface::IsPeriscopeRaised) + .def("IsRadarMastRaised", &tcSubInterface::IsRadarMastRaised) + .def("IsValid", &tcSubInterface::IsValid) + .def("LowerPeriscope", &tcSubInterface::LowerPeriscope) + .def("LowerRadarMast", &tcSubInterface::LowerRadarMast) + .def("RaisePeriscope", &tcSubInterface::RaisePeriscope) + .def("RaiseRadarMast", &tcSubInterface::RaiseRadarMast) + ; + + TrackInterfaceType = class_<tcTrackInterface>("TrackInfoClass") .def("DeclareHostile", &tcTrackInterface::DeclareHostile) --- NEW FILE: tcSubInterface.cpp --- /** ** @file tcSubInterface.cpp */ /* Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "stdwx.h" // precompiled header file #ifndef WX_PRECOMP #include "wx/wx.h" #endif #include "tcSubInterface.h" #include "tcGenericDBObject.h" #include "tcMessageInterface.h" #include "tcPlatformObject.h" #include "tcSimState.h" #include "tcSound.h" #include "tcSubObject.h" #ifdef _DEBUG #define new DEBUG_NEW #endif namespace ScriptInterface { tcMessageInterface* tcSubInterface::messageInterface = 0; tcSound* tcSubInterface::sound = 0; tcSimState* tcSubInterface::simState = 0; /** * @return maximum depth in meters */ float tcSubInterface::GetMaxDepth() const { if (!subObj) return 0; return subObj->mpDBObject->mfMaxDepth_m; } void tcSubInterface::GoToPeriscopeDepth() { if (subObj) { subObj->SetAltitude(-subObj->GetPeriscopeDepth() + 0.4f); } } bool tcSubInterface::IsAtPeriscopeDepth() { if (!subObj) return false; return subObj->IsAtPeriscopeDepth(); } bool tcSubInterface::IsPeriscopeRaised() const { if (!subObj) return false; return subObj->GetPeriscopeState(); } bool tcSubInterface::IsRadarMastRaised() const { if (!subObj) return false; return subObj->GetRadarMastState(); } /** * @return true if interface is valid sub interface */ bool tcSubInterface::IsValid() const { return (subObj != 0); } void tcSubInterface::LowerPeriscope() { if (subObj) { if (subObj->GetPeriscopeState()) { subObj->SetPeriscopeState(false); if (subObj->IsOwnAlliance()) { wxString s = wxString::Format("%s (%s): lowering scope\n", subObj->mzUnit.mz, subObj->mzClass.mz); messageInterface->ChannelMessage("Info", s.c_str()); sound->PlayEffect(SEFFECT_LOWBEEP); } } } } void tcSubInterface::LowerRadarMast() { if (subObj) { if (subObj->GetRadarMastState()) { subObj->SetRadarMastState(false); if (subObj->IsOwnAlliance()) { wxString s = wxString::Format("%s (%s): lowering radar mast\n", subObj->mzUnit.mz, subObj->mzClass.mz); messageInterface->ChannelMessage("Info", s.c_str()); sound->PlayEffect(SEFFECT_LOWBEEP); } } } } void tcSubInterface::RaisePeriscope() { if (subObj) { if (!subObj->GetPeriscopeState()) { subObj->SetPeriscopeState(true); if (subObj->IsOwnAlliance()) { wxString s = wxString::Format("%s (%s): raising scope\n", subObj->mzUnit.mz, subObj->mzClass.mz); messageInterface->ChannelMessage("Info", s.c_str()); sound->PlayEffect(SEFFECT_LOWBEEP); } } } } void tcSubInterface::RaiseRadarMast() { if (subObj) { if (!subObj->GetRadarMastState()) { subObj->SetRadarMastState(true); if (subObj->IsOwnAlliance()) { wxString s = wxString::Format("%s (%s): raising radar mast\n", subObj->mzUnit.mz, subObj->mzClass.mz); messageInterface->ChannelMessage("Info", s.c_str()); sound->PlayEffect(SEFFECT_LOWBEEP); } } } } tcSubInterface::tcSubInterface() : subObj(0) { } tcSubInterface::tcSubInterface(tcPlatformObject* obj) { subObj = dynamic_cast<tcSubObject*>(obj); if (!sound) { sound = tcSound::Get(); } if (!simState) { simState = tcSimState::Get(); } if (!messageInterface) { messageInterface = tcMessageInterface::Get(); } } tcSubInterface::~tcSubInterface() { } } Index: tcScenarioInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcScenarioInterface.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcScenarioInterface.cpp 8 Aug 2004 00:31:34 -0000 1.13 --- tcScenarioInterface.cpp 23 Nov 2004 23:30:58 -0000 1.14 *************** *** 41,44 **** --- 41,45 ---- #include "tcCarrierObject.h" #include "tcAeroAirObject.h" + #include "tcSubObject.h" #include "tcAirfieldObject.h" #include "tcGenericDBObject.h" *************** *** 230,233 **** --- 231,238 ---- airObj->SetAltitude(airObj->mcKin.mfAlt_m); } + if (tcSubObject* sub = dynamic_cast<tcSubObject*>(gameObj)) + { + sub->SetAltitude(sub->mcKin.mfAlt_m); + } // place ground objects relative to terrain height Index: tcPlatformInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterface.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** tcPlatformInterface.cpp 3 Nov 2004 16:36:44 -0000 1.28 --- tcPlatformInterface.cpp 23 Nov 2004 23:30:57 -0000 1.29 *************** *** 78,81 **** --- 78,90 ---- /** + * @return sub interface object for sub-specific controls + */ + tcSubInterface tcPlatformInterface::GetSubInterface() + { + return tcSubInterface(mpPlatformObj); + } + + + /** * @return fraction of fuel remaining */ |
|
From: Dewitt C. <ddc...@us...> - 2004-11-23 23:32:04
|
Update of /cvsroot/gcblue/gcb_wx/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29552/scripts Modified Files: Menu.py UnitCommands.py Log Message: Text message "message center" GUI screen Index: UnitCommands.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/UnitCommands.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** UnitCommands.py 14 Sep 2004 02:01:45 -0000 1.10 --- UnitCommands.py 23 Nov 2004 23:30:53 -0000 1.11 *************** *** 137,140 **** --- 137,185 ---- def AltitudeVeryLow(UI): UI.SetAlt(50) + + + def DepthSurface(UI): + if (not UI.IsSub()): + return + UI.SetAlt(0) + + def DepthPeriscope(UI): + if (not UI.IsSub()): + return + UI.SetAlt(0) + + SubInterface = UI.GetSubInterface() + SubInterface.GoToPeriscopeDepth() + + def DepthMedium(UI): + if (not UI.IsSub()): + return + UI.SetAlt(-100) + + def DepthDeep(UI): + if (not UI.IsSub()): + return + SubInterface = UI.GetSubInterface() + max_depth = SubInterface.GetMaxDepth() + UI.SetAlt(-max_depth + 50) + + def SetPeriscope(UI, state): + if (not UI.IsSub()): + return + SubInterface = UI.GetSubInterface() + if (state == 0): + SubInterface.LowerPeriscope() + else: + SubInterface.RaisePeriscope() + + def SetRadarMast(UI, state): + if (not UI.IsSub()): + return + SubInterface = UI.GetSubInterface() + if (state == 0): + SubInterface.LowerRadarMast() + else: + SubInterface.RaiseRadarMast() + def SetFractionalSpeed(UI, k, dispMessage=0): Index: Menu.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/Menu.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Menu.py 6 Nov 2004 15:13:40 -0000 1.7 --- Menu.py 23 Nov 2004 23:30:51 -0000 1.8 *************** *** 95,98 **** --- 95,102 ---- UnitMenu.AddItemUI('Land at','AddLandingOrder', 'Target') + # Submarine menu + if (UnitInfo.IsSub()): + BuildSubmarineMenu(UnitMenu, UnitInfo) + # Flight port panel if available if (UnitInfo.HasFlightPort()): *************** *** 100,103 **** --- 104,134 ---- + + def BuildSubmarineMenu(UnitMenu, UnitInfo): + UnitMenu.AddItem('Set depth','') + UnitMenu.BeginSubMenu() + UnitMenu.AddItem('Surface','DepthSurface') + UnitMenu.AddItem('Periscope','DepthPeriscope') + UnitMenu.AddItem('Medium','DepthMedium') + UnitMenu.AddItem('Deep','DepthDeep') + UnitMenu.EndSubMenu() + + SubMenu = UnitInfo.GetSubInterface() + if (SubMenu.IsAtPeriscopeDepth()): + UnitMenu.AddItem('Scope-Mast','') + UnitMenu.BeginSubMenu() + if (SubMenu.IsPeriscopeRaised()): + UnitMenu.AddItemWithParam('Lower scope', 'SetPeriscope', 0) + else: + UnitMenu.AddItemWithParam('Raise scope', 'SetPeriscope', 1) + + if (SubMenu.IsRadarMastRaised()): + UnitMenu.AddItemWithParam('Lower mast', 'SetRadarMast', 0) + else: + UnitMenu.AddItemWithParam('Raise mast', 'SetRadarMast', 1) + + UnitMenu.EndSubMenu() + + def BuildLaunchMenu(UnitMenu, UnitInfo): UnitMenu.AddItem('Engage datum with','') |
|
From: Dewitt C. <ddc...@us...> - 2004-11-23 23:31:58
|
Update of /cvsroot/gcblue/gcb_wx/3d In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29552/3d Modified Files: LICENSE.txt Log Message: Text message "message center" GUI screen Index: LICENSE.txt =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/3d/LICENSE.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LICENSE.txt 2 Jan 2004 15:03:28 -0000 1.1 --- LICENSE.txt 23 Nov 2004 23:30:28 -0000 1.2 *************** *** 1,3 **** ! 3D Model and texture files Copyright (C) 2002-2003 Marcelo Caceres unless otherwise noted. 3D Model and texture files may be distributed under the terms of the GCB Data License v1.0. --- 1,8 ---- ! 3D Model and texture files Copyright (C) 2002-2003 Marcelo Caceres unless otherwise noted. (op4...@ho...) ! ! Mig-29 (mig23.3ds) Copyright (C) 2004 Guido Militello (gui...@ho...) ! E2-C (e2c.3ds) Copyright (C) 2004 unknown and mods Copyright (C) 2004 Guido Militello (gui...@ho...) ! Charlie I SSBN (charlieI.3ds) Copyright (C) 2004 TLAM Strike (bi...@ya...) ! Los Angeles class sub (uss_la.3ds) courtesy of 3D Cafe (http://www.3dcafe.com) 3D Model and texture files may be distributed under the terms of the GCB Data License v1.0. |
|
From: Dewitt C. <ddc...@us...> - 2004-11-23 23:31:58
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29552/include/database Modified Files: tcMissileDBObject.h Log Message: Text message "message center" GUI screen Index: tcMissileDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcMissileDBObject.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcMissileDBObject.h 6 Nov 2004 15:13:39 -0000 1.12 --- tcMissileDBObject.h 23 Nov 2004 23:30:32 -0000 1.13 *************** *** 94,98 **** FC_TRACK, ///< needs a fire-control track (launching platform) to launch, semi-active or command guidance SEEKER_TRACK, ///< needs seeker track and FC track to launch ! AUTO ///< will launch and either proceed unguided or autonomously search out target }; --- 94,98 ---- FC_TRACK, ///< needs a fire-control track (launching platform) to launch, semi-active or command guidance SEEKER_TRACK, ///< needs seeker track and FC track to launch ! AUTO ///< will launch and either proceed unguided or autonomously search out target }; |
|
From: Dewitt C. <ddc...@us...> - 2004-11-23 23:31:58
|
Update of /cvsroot/gcblue/gcb_wx/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29552/docs Modified Files: CHANGES.txt Log Message: Text message "message center" GUI screen Index: CHANGES.txt =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/docs/CHANGES.txt,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** CHANGES.txt 14 Nov 2004 22:52:04 -0000 1.41 --- CHANGES.txt 23 Nov 2004 23:30:30 -0000 1.42 *************** *** 3,6 **** --- 3,7 ---- 0.6.2 --------------------------------------------------------------------- + - Basic submarine vehicle model - Added popup message display - Added message center GUI screen to view text messages for |
|
From: Dewitt C. <ddc...@us...> - 2004-11-23 23:31:57
|
Update of /cvsroot/gcblue/gcb_wx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29552 Modified Files: GCblue.vcproj Log Message: Text message "message center" GUI screen Index: GCblue.vcproj =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/GCblue.vcproj,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** GCblue.vcproj 14 Nov 2004 22:52:04 -0000 1.72 --- GCblue.vcproj 23 Nov 2004 23:30:29 -0000 1.73 *************** *** 261,264 **** --- 261,267 ---- </File> <File + RelativePath=".\src\graphics\tcAltitudeBarControl.cpp"> + </File> + <File RelativePath="src\graphics\tcButton.cpp"> </File> *************** *** 270,273 **** --- 273,279 ---- </File> <File + RelativePath=".\src\graphics\tcControl.cpp"> + </File> + <File RelativePath=".\src\graphics\tcCreditView.cpp"> </File> *************** *** 391,394 **** --- 397,403 ---- </File> <File + RelativePath=".\src\scriptinterface\tcSubInterface.cpp"> + </File> + <File RelativePath="src\scriptinterface\tcTrackInterface.cpp"> </File> *************** *** 512,515 **** --- 521,527 ---- </File> <File + RelativePath=".\src\sim\tcSubObject.cpp"> + </File> + <File RelativePath="src\sim\tcSurfaceObject.cpp"> </File> *************** *** 1137,1140 **** --- 1149,1155 ---- </File> <File + RelativePath=".\include\graphics\tcAltitudeBarControl.h"> + </File> + <File RelativePath="include\graphics\tcButton.h"> </File> *************** *** 1146,1149 **** --- 1161,1167 ---- </File> <File + RelativePath=".\include\graphics\tcControl.h"> + </File> + <File RelativePath=".\include\graphics\tcCreditView.h"> </File> *************** *** 1252,1255 **** --- 1270,1276 ---- </File> <File + RelativePath=".\include\scriptinterface\tcSubInterface.h"> + </File> + <File RelativePath="include\scriptinterface\tcTrackInterface.h"> </File> *************** *** 1382,1385 **** --- 1403,1409 ---- </File> <File + RelativePath=".\include\sim\tcSubObject.h"> + </File> + <File RelativePath="include\sim\tcSurfaceObject.h"> </File> |
|
From: Dewitt C. <ddc...@us...> - 2004-11-14 22:53:02
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22147/include/graphics Modified Files: tc3DWindow.h Added Files: tcMessageCenter.h tcMessageChannel.h tcMessageInterface.h tcPopupMessage.h Log Message: Text message "message center" GUI screen --- NEW FILE: tcMessageCenter.h --- /** ** @file tcMessageCenter.h */ /* Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _MESSAGECENTER_H_ #define _MESSAGECENTER_H_ #if _MSC_VER > 1000 #pragma once #endif #include "wx/wx.h" #include "wx/string.h" #include <osg/Vec4> #include "tc3DWindow.h" class tcMessageChannel; /** * */ class tcMessageCenter : public tc3DWindow { public: void AddMessage(const std::string& channel, const std::string& msg); void Clear(); virtual void Draw(); tcMessageCenter(wxWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& name = "MessageCenter"); virtual ~tcMessageCenter(); private: std::map<std::string, tcMessageChannel*> channelMap; std::string activeChannelName; ///< name of active channel tcRect channelTab; ///< rectangle for next new channel selection button tcRect defaultTextRect; ///< text box rectangle for channels tcMessageChannel* GetChannel(const std::string& channelName); tcMessageChannel* GetOrCreateChannel(const std::string& channelName); virtual void OnLButtonDown(wxMouseEvent& event); virtual void OnMouseMove(wxMouseEvent& event); }; #endif --- NEW FILE: tcMessageChannel.h --- /** ** @file tcMessageChannel.h */ /* Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _MESSAGECHANNEL_H_ #define _MESSAGECHANNEL_H_ #if _MSC_VER > 1000 #pragma once #endif #include "wx/wx.h" #include "wx/string.h" #include <queue> #include <osg/Vec4> #include "tcRect.h" class tc3DWindow; /** * */ class tcMessageChannel { public: std::string channelName; std::deque<std::string> messages; ///< chat text to display void AddMessage(const std::string& msg); void Draw(tc3DWindow* graphics); std::string GetName(); bool IsActive() const; bool IsPointInActivationRect(const wxPoint& p) const; void SetActivationRect(tcRect r); void SetActive(bool state); void SetMouseOver(bool state); void SetTextRect(tcRect r); tcMessageChannel(std::string name); virtual ~tcMessageChannel(); private: float fontSize; float buttonFontSize; tcRect activationRect; ///< rectangle for activation button tcRect textRect; ///< rectangle for text message display bool isActive; bool isMouseOver; void DrawActivationButton(tc3DWindow* graphics); void DrawMessageText(tc3DWindow* graphics); }; #endif Index: tc3DWindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DWindow.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tc3DWindow.h 2 Nov 2004 04:23:55 -0000 1.9 --- tc3DWindow.h 14 Nov 2004 22:52:20 -0000 1.10 *************** *** 31,34 **** --- 31,35 ---- #endif + #include <queue> #include <vector> *************** *** 80,83 **** --- 81,85 ---- void AddChild(tc3DWindow* child); + void RemoveChild(tc3DWindow* child); osg::Geometry* CreateDefaultGeometry(); *************** *** 174,177 **** --- 176,180 ---- bool GetBlend(); void SetBlend(bool blendingOn); + int GetBaseRenderBin() const; virtual void SetBaseRenderBin(int n); void SetName(const char* s); *************** *** 195,198 **** --- 198,203 ---- protected: std::vector<tc3DWindow*> children; + std::queue<tc3DWindow*> childrenToRemove; ///< for safe removal of children + tc3DWindow* const hostParent; int baseRenderBin; ///< base offset for render bin for this window *************** *** 235,238 **** --- 240,244 ---- osg::MatrixTransform* CreateDrawTransform(); + void ClearDrawObjects(); void FinishDraw(); void HideUnusedObjects(); *************** *** 240,243 **** --- 246,250 ---- virtual void OnChar(wxKeyEvent& event); + virtual void OnClose(wxCloseEvent& event); virtual void OnEnterWindow(wxMouseEvent& event); void OnEraseBackground(wxEraseEvent& event); *************** *** 299,302 **** --- 306,310 ---- void InitGraphicsObjects(); void LogStatus(); + void UpdateChildren(); DECLARE_EVENT_TABLE() --- NEW FILE: tcPopupMessage.h --- /** ** @file tcPopupMessage.h */ /* Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _POPUPMESSAGE_H_ #define _POPUPMESSAGE_H_ #if _MSC_VER > 1000 #pragma once #endif #include "wx/wx.h" #include "wx/string.h" #include <osg/Vec4> #include "tc3DWindow.h" /** * Class based on tcConsole modified to use 3D window graphics */ class tcPopupMessage : public tc3DWindow { public: std::string messageText; void Clear(); virtual void Draw(); void SetMessageText(const std::string& text); static void SetParent(tc3DWindow* par); tcPopupMessage(std::string text, const wxPoint& pos, int width); virtual ~tcPopupMessage(); protected: static tc3DWindow* parent; bool redraw; unsigned int birthCount; virtual void OnLButtonDown(wxMouseEvent& event); }; #endif --- NEW FILE: tcMessageInterface.h --- /** ** @file tcMessageInterface.h */ /* Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _MESSAGEINTERFACE_H_ #define _MESSAGEINTERFACE_H_ #if _MSC_VER > 1000 #pragma once #endif #include "wx/wx.h" #include <string> class tcMessageCenter; /** * Singleton class for writing text messages for GUI display */ class tcMessageInterface { public: void ChannelMessage(const std::string& channelName, const std::string& msg); static tcMessageInterface* Get(); ///< singleton accessor static void SetMessageCenter(tcMessageCenter* mc); private: static tcMessageCenter* messageCenter; tcMessageInterface(); ~tcMessageInterface(); }; #endif |
|
From: Dewitt C. <ddc...@us...> - 2004-11-14 22:53:02
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22147/include/sim Modified Files: Game.h tcSimState.h Log Message: Text message "message center" GUI screen Index: tcSimState.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSimState.h,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** tcSimState.h 6 Nov 2004 15:13:40 -0000 1.29 --- tcSimState.h 14 Nov 2004 22:52:20 -0000 1.30 *************** *** 203,206 **** --- 203,207 ---- void ProcessESMDetection(tcGameObject *apESMPlat,tcGameObject *apTarget, tcESMSensor *apESMSS); + void ReportDamage(tcGameObject* obj); void UpdateFireControl(tcGameObject *apGameObj, tcRadar *apRadarSS); void UpdateSeeker(tcGameObject *applat, tcRadar *apRadarSS); Index: Game.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/Game.h,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** Game.h 29 Oct 2004 02:50:43 -0000 1.49 --- Game.h 14 Nov 2004 22:52:20 -0000 1.50 *************** *** 61,64 **** --- 61,65 ---- class DateZulu; class tcDirector; + class tcMessageCenter; class tcNetworkView; class tcDisplaySettingsView; *************** *** 96,99 **** --- 97,101 ---- CREDIT, SCENARIOSELECT, + MESSAGES, NETWORK, DISPLAYSETTINGS, *************** *** 167,170 **** --- 169,173 ---- tcGoalTracker* goalTracker; ///< monitors simstate vs. victory goals tcDirector* director; ///< displays scripted graphics and controls view for dramatic mission brief + tcMessageCenter* messageCenter; ///< tasking, intel, etc. message view tcNetworkView* networkView; ///< network and multiplayer setup and test tcDisplaySettingsView* displaySettingsView; *************** *** 285,288 **** --- 288,292 ---- void InitializeDirector(); void InitializeDisplaySettingsView(); + void InitializeMessageCenter(); void InitializeNetworkView(); void InitializeOptionsView(); |
|
From: Dewitt C. <ddc...@us...> - 2004-11-14 22:53:02
|
Update of /cvsroot/gcblue/gcb_wx/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22147/docs Modified Files: CHANGES.txt Log Message: Text message "message center" GUI screen Index: CHANGES.txt =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/docs/CHANGES.txt,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** CHANGES.txt 6 Nov 2004 15:15:12 -0000 1.40 --- CHANGES.txt 14 Nov 2004 22:52:04 -0000 1.41 *************** *** 1,4 **** --- 1,9 ---- CHANGES + 0.6.2 + --------------------------------------------------------------------- + - Added popup message display + - Added message center GUI screen to view text messages for + any number of message channels, e.g. briefing text, damage reports, etc. 0.6.1 |
|
From: Dewitt C. <ddc...@us...> - 2004-11-14 22:53:00
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22147/include/common Modified Files: simmath.h Added Files: tcRect.h Log Message: Text message "message center" GUI screen --- NEW FILE: tcRect.h --- /** ** @file tcRect.h */ /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _TCRECT_H_ #define _TCRECT_H_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 class tcRect { public: float left; float right; float top; float bottom; virtual bool ContainsPoint(float x, float y) const; virtual void Expand(float dx, float dy); virtual float GetLeft() const {return left;} virtual float GetRight() const {return right;} virtual float GetTop() const {return top;} virtual float GetBottom() const {return bottom;} virtual float Width() const {return right-left;} virtual float Height() const {return top-bottom;} virtual float XCenter() const {return 0.5f*(right+left);} virtual float YCenter() const {return 0.5f*(top+bottom);} virtual void Offset(float dx, float dy); virtual void Set(float x1,float x2,float y1,float y2) {left=x1;right=x2;bottom=y1;top=y2;} tcRect& operator=(const tcRect& r); tcRect(); tcRect(float x1, float x2, float y1, float y2); tcRect(const tcRect& r); virtual ~tcRect(); }; #endif Index: simmath.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/simmath.h,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** simmath.h 6 Nov 2004 15:13:39 -0000 1.24 --- simmath.h 14 Nov 2004 22:52:19 -0000 1.25 *************** *** 1,4 **** --- 1,6 ---- /** ** @file simmath.h + ** This file (and simmath.cpp) needs to be broken up into separate + ** file for better modularity. */ /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) *************** *** 32,35 **** --- 34,38 ---- #include <string> #include "tcFile.h" + #include "tcRect.h" #include "tcString.h" #include "gctypes.h" *************** *** 55,75 **** - class tcRect - { - public: - float left,right,top,bottom; - - virtual bool ContainsPoint(float x, float y); - virtual float GetLeft() const {return left;} - virtual float GetRight() const {return right;} - virtual float GetTop() const {return top;} - virtual float GetBottom() const {return bottom;} - virtual float Width() const {return right-left;} - virtual float Height() const {return top-bottom;} - virtual float XCenter() const {return 0.5f*(right+left);} - virtual float YCenter() const {return 0.5f*(top+bottom);} - virtual void Offset(float dx, float dy) {left+=dx;right+=dx;bottom+=dy;top+=dy;} - virtual void Set(float x1,float x2,float y1,float y2) {left=x1;right=x2;bottom=y1;top=y2;} - }; /** tcRect with [-pi,pi) and [-pi/2,pi/2) range for longitude and latitude */ --- 58,61 ---- |
|
From: Dewitt C. <ddc...@us...> - 2004-11-14 22:52:44
|
Update of /cvsroot/gcblue/gcb_wx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22147 Modified Files: GCblue.vcproj Log Message: Text message "message center" GUI screen Index: GCblue.vcproj =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/GCblue.vcproj,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** GCblue.vcproj 6 Nov 2004 15:13:39 -0000 1.71 --- GCblue.vcproj 14 Nov 2004 22:52:04 -0000 1.72 *************** *** 191,194 **** --- 191,197 ---- </File> <File + RelativePath=".\src\common\tcRect.cpp"> + </File> + <File RelativePath="src\common\tcSound.cpp"> </File> *************** *** 309,312 **** --- 312,324 ---- </File> <File + RelativePath=".\src\graphics\tcMessageCenter.cpp"> + </File> + <File + RelativePath=".\src\graphics\tcMessageChannel.cpp"> + </File> + <File + RelativePath=".\src\graphics\tcMessageInterface.cpp"> + </File> + <File RelativePath=".\src\graphics\tcNetworkView.cpp"> </File> *************** *** 324,327 **** --- 336,342 ---- </File> <File + RelativePath=".\src\graphics\tcPopupMessage.cpp"> + </File> + <File RelativePath="src\graphics\tcRadioButton.cpp"> </File> *************** *** 1061,1064 **** --- 1076,1082 ---- </File> <File + RelativePath=".\include\common\tcRect.h"> + </File> + <File RelativePath="include\common\tcSound.h"> </File> *************** *** 1158,1161 **** --- 1176,1188 ---- </File> <File + RelativePath=".\include\graphics\tcMessageCenter.h"> + </File> + <File + RelativePath=".\include\graphics\tcMessageChannel.h"> + </File> + <File + RelativePath=".\include\graphics\tcMessageInterface.h"> + </File> + <File RelativePath=".\include\graphics\tcNetworkView.h"> </File> *************** *** 1176,1179 **** --- 1203,1209 ---- </File> <File + RelativePath=".\include\graphics\tcPopupMessage.h"> + </File> + <File RelativePath="include\graphics\tcRadioButton.h"> </File> |
|
From: Dewitt C. <ddc...@us...> - 2004-11-14 22:52:34
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22147/src/sim Modified Files: Game.cpp tcAirObject.cpp tcDirectorEvent.cpp tcSimState.cpp Log Message: Text message "message center" GUI screen Index: tcSimState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSimState.cpp,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** tcSimState.cpp 7 Nov 2004 03:40:45 -0000 1.57 --- tcSimState.cpp 14 Nov 2004 22:52:22 -0000 1.58 *************** *** 49,52 **** --- 49,53 ---- #include "tcCommandObject.h" #include "common/tcStream.h" + #include "tcMessageInterface.h" #ifdef _DEBUG *************** *** 341,345 **** #endif } ! /********************************************************************/ /** --- 342,347 ---- #endif } ! ! /** *************** *** 369,377 **** missile->mfDamageLevel += 1.0f; // missile destroys itself on impact if (fDamageFract > 0) { if (mpUserInfo->IsOwnAlliance(target->mnAlliance)) { ! tcSound::Get()->PlayEffect(SEFFECT_IMPLOSION); } else --- 371,380 ---- missile->mfDamageLevel += 1.0f; // missile destroys itself on impact + if (fDamageFract > 0) { if (mpUserInfo->IsOwnAlliance(target->mnAlliance)) { ! ReportDamage(target); } else *************** *** 381,389 **** } ! tcString s; ! s.Format("weapon %d hit target %d, range^2: %3.1f m, dmg: %3.1f %%, time %.1f s", missile->mnID, target->mnID, trueRange2, fDamageFract, mfSimTime); ! WTL(s.GetBuffer()); ! std::cout << s.GetBuffer(); fprintf(stdout," collision relative time: %f, dx:%f dy:%f dz:%f\n", tclosest, dx, dy, dz); --- 384,392 ---- } ! ! wxString s = wxString::Format("weapon %d hit target %d, range^2: %3.1f m, dmg: %3.1f %%, time %.1f s", missile->mnID, target->mnID, trueRange2, fDamageFract, mfSimTime); ! WTL(s.c_str()); ! std::cout << s.c_str(); fprintf(stdout," collision relative time: %f, dx:%f dy:%f dz:%f\n", tclosest, dx, dy, dz); *************** *** 458,462 **** if (mpUserInfo->IsOwnAlliance(target->mnAlliance)) { ! tcSound::Get()->PlayEffect(SEFFECT_IMPLOSION); } else --- 461,465 ---- if (mpUserInfo->IsOwnAlliance(target->mnAlliance)) { ! ReportDamage(target); } else *************** *** 790,794 **** return nListIndex; } ! /********************************************************************/ void tcSimState::RemoveDestroyedObjects() { --- 793,799 ---- return nListIndex; } ! /** ! * ! */ void tcSimState::RemoveDestroyedObjects() { *************** *** 808,813 **** } ! /********************************************************************/ void tcSimState::ProcessRadarDetection(tcGameObject *apRadarPlat,tcGameObject *apTarget, tcRadar *apRadarSS) --- 813,840 ---- } + /** + * Writes out damage report message + */ + void tcSimState::ReportDamage(tcGameObject* obj) + { + tcSound::Get()->PlayEffect(SEFFECT_IMPLOSION); ! std::string damageString = "reports light damage"; ! ! if (obj->mfDamageLevel >= 1.0) damageString = "destroyed"; ! else if (obj->mfDamageLevel >= 0.5) damageString = "reports heavy damage"; ! else if (obj->mfDamageLevel >= 0.2) damageString = "reports moderate damage"; ! ! ! wxString s = wxString::Format("%s: %s (%s) %s\n", ! dateZulu.asString().c_str(), obj->mzUnit.mz, obj->mzClass.mz, ! damageString.c_str()); ! ! tcMessageInterface::Get()->ChannelMessage("Damage", s.c_str()); ! } ! ! /** ! * ! */ void tcSimState::ProcessRadarDetection(tcGameObject *apRadarPlat,tcGameObject *apTarget, tcRadar *apRadarSS) *************** *** 1538,1541 **** --- 1565,1578 ---- } + // load high res map if necessary + tcGeoRect theater; + mpMapData->GetTheaterArea(theater); + float dlon = fabsf(theater.GetLeft() + 8.0); + float dlat = fabsf(theater.GetTop() - 55.0); + if ((dlon > 0.1) || (dlat > 0.1)) + { + mpMapData->LoadHighResB(-8.0, 55.0); + } + msScenarioInfo.mbLoaded = true; } Index: tcAirObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcAirObject.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcAirObject.cpp 7 Nov 2004 03:40:45 -0000 1.13 --- tcAirObject.cpp 14 Nov 2004 22:52:22 -0000 1.14 *************** *** 185,192 **** } ! // Has problems for large time steps, > about 1 sec void tcAirObject::UpdateClimb(float dt_s) { float dalt_min, dalt_max, fAltitudeRate_mps; float dalt_m = mcGS.mfGoalAltitude_m - mcKin.mfAlt_m; // float valt_kts = (daltitude_m/dt_s)*C_MPSTOKTS; --- 185,202 ---- } ! /** ! * Update climb related parameters. This has problems for large time ! * steps, > about 1 sec ! */ void tcAirObject::UpdateClimb(float dt_s) { float dalt_min, dalt_max, fAltitudeRate_mps; + + // restrict to max altitude + if (mcGS.mfGoalAltitude_m > mpDBObject->mfMaxAltitude_m) + { + mcGS.mfGoalAltitude_m = mpDBObject->mfMaxAltitude_m; + } + float dalt_m = mcGS.mfGoalAltitude_m - mcKin.mfAlt_m; // float valt_kts = (daltitude_m/dt_s)*C_MPSTOKTS; Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.104 retrieving revision 1.105 diff -C2 -d -r1.104 -r1.105 *** Game.cpp 6 Nov 2004 15:13:42 -0000 1.104 --- Game.cpp 14 Nov 2004 22:52:21 -0000 1.105 *************** *** 48,51 **** --- 48,53 ---- #include "tcDirector.h" #include "tcXmlWindow.h" + #include "tcMessageCenter.h" + #include "tcMessageInterface.h" #include "tcNetworkView.h" #include "tcDisplaySettingsView.h" *************** *** 53,56 **** --- 55,59 ---- #include "tcChatBox.h" #include "tc3DWindow.h" + #include "tcPopupMessage.h" #if defined(_MSC_VER) *************** *** 124,127 **** --- 127,133 ---- popupControl = NULL; director = NULL; + networkView = NULL; + messageCenter = NULL; + SetBackgroundColour(*wxBLACK); Show(FALSE); *************** *** 288,302 **** briefingConsoleLeft->SetActive(false); briefingConsoleBottom->SetActive(false); ! optionsView->SetActive(false); ! tacticalMap->SetActive(false); ! worldMap->SetActive(false); ! infoConsole->SetActive(false); hookInfo->SetActive(false); objectControl->SetActive(false); oobView->SetActive(false); ! viewer->SetActive(false); popupControl->SetActive(false); ! chatBox->SetActive(false); ! // undo initialization UninitGame(); --- 294,311 ---- briefingConsoleLeft->SetActive(false); briefingConsoleBottom->SetActive(false); ! chatBox->SetActive(false); ! displaySettingsView->SetActive(false); hookInfo->SetActive(false); + infoConsole->SetActive(false); + messageCenter->SetActive(false); + networkView->SetActive(false); objectControl->SetActive(false); oobView->SetActive(false); ! optionsView->SetActive(false); popupControl->SetActive(false); ! tacticalMap->SetActive(false); ! viewer->SetActive(false); ! worldMap->SetActive(false); ! // undo initialization UninitGame(); *************** *** 367,370 **** --- 376,382 ---- viewer->ClearDefaultTextObjects(); + // clear message center + messageCenter->Clear(); + tcString s; s.Format("Starting scenario: %s",simState->msScenarioInfo.mzName); *************** *** 516,519 **** --- 528,534 ---- InitializeNetworkView(); + + InitializeMessageCenter(); + InitializeScenarioSelectView(); *************** *** 721,726 **** /** * Initialize network view interface - * startView must be initialized before calling this */ void tcGame::InitializeNetworkView() --- 736,754 ---- /** + * Initialize MessageCenter view interface + */ + void tcGame::InitializeMessageCenter() + { + wxASSERT(glCanvas); + + messageCenter = new tcMessageCenter(glCanvas, wxPoint(0,0), frameSize, "MessageCenter"); + messageCenter->SetBaseRenderBin(30); + + tcMessageInterface::SetMessageCenter(messageCenter); + + } + + /** * Initialize network view interface */ void tcGame::InitializeNetworkView() *************** *** 1003,1006 **** --- 1031,1035 ---- wxASSERT(tacticalMap); + tcPopupMessage::SetParent(tacticalMap); #if 0 *************** *** 1360,1363 **** --- 1389,1393 ---- displaySettingsView->SetActive(false); scenarioSelectView->SetActive(false); + messageCenter->SetActive(false); networkView->SetActive(false); chatBox->SetActive(false); *************** *** 1497,1511 **** void tcGame::UpdateForScreenMode() { ! bool drawEdgeWindows = (size3D != MODE3D_FULL) || (!mb3DActive); ! bool drawTacticalMap = (size3D == MODE3D_SMALL) || (!mb3DActive); if (meScreenMode == TACTICAL) ! { if (tacticalMapSize == TM_MEDIUM) SetTacticalMapSize(TM_LARGE); ! briefingConsoleLeft->SetActive(false); ! briefingConsoleBottom->SetActive(false); ! optionsView->SetActive(false); ! networkView->SetActive(false); ! displaySettingsView->SetActive(false); tacticalMap->SetActive(drawTacticalMap); worldMap->SetActive(drawTacticalMap); --- 1527,1558 ---- void tcGame::UpdateForScreenMode() { ! static teScreenMode lastMode = NONE; ! ! if (meScreenMode != lastMode) ! { ! briefingConsoleLeft->SetActive(false); ! briefingConsoleBottom->SetActive(false); ! chatBox->SetActive(false); ! displaySettingsView->SetActive(false); ! hookInfo->SetActive(false); ! infoConsole->SetActive(false); ! optionsView->SetActive(false); ! messageCenter->SetActive(false); ! networkView->SetActive(false); ! objectControl->SetActive(false); ! oobView->SetActive(false); ! tacticalMap->SetActive(false); ! viewer->SetActive(false); ! worldMap->SetActive(false); ! } ! lastMode = meScreenMode; ! if (meScreenMode == TACTICAL) ! { ! bool drawEdgeWindows = (size3D != MODE3D_FULL) || (!mb3DActive); ! bool drawTacticalMap = (size3D == MODE3D_SMALL) || (!mb3DActive); if (tacticalMapSize == TM_MEDIUM) SetTacticalMapSize(TM_LARGE); ! tacticalMap->SetActive(drawTacticalMap); worldMap->SetActive(drawTacticalMap); *************** *** 1536,1551 **** else if (meScreenMode == TACTICALBRIEF) { if (tacticalMapSize == TM_LARGE) SetTacticalMapSize(TM_MEDIUM); briefingConsoleLeft->SetActive(drawEdgeWindows); briefingConsoleBottom->SetActive(drawEdgeWindows); ! optionsView->SetActive(false); ! networkView->SetActive(false); ! displaySettingsView->SetActive(false); tacticalMap->SetActive(drawTacticalMap); worldMap->SetActive(drawTacticalMap); - infoConsole->SetActive(false); - hookInfo->SetActive(false); - objectControl->SetActive(false); - oobView->SetActive(false); viewer->SetActive(mb3DActive); if (drawTacticalMap) --- 1583,1596 ---- else if (meScreenMode == TACTICALBRIEF) { + bool drawEdgeWindows = (size3D != MODE3D_FULL) || (!mb3DActive); + bool drawTacticalMap = (size3D == MODE3D_SMALL) || (!mb3DActive); + if (tacticalMapSize == TM_LARGE) SetTacticalMapSize(TM_MEDIUM); + briefingConsoleLeft->SetActive(drawEdgeWindows); briefingConsoleBottom->SetActive(drawEdgeWindows); ! tacticalMap->SetActive(drawTacticalMap); worldMap->SetActive(drawTacticalMap); viewer->SetActive(mb3DActive); if (drawTacticalMap) *************** *** 1566,1624 **** else if (meScreenMode == OPTIONS) { - - briefingConsoleLeft->SetActive(false); - briefingConsoleBottom->SetActive(false); - optionsView->SetActive(true); ! networkView->SetActive(false); ! displaySettingsView->SetActive(false); ! tacticalMap->SetActive(false); ! worldMap->SetActive(false); ! infoConsole->SetActive(false); ! hookInfo->SetActive(false); ! ! ! oobView->SetActive(false); ! objectControl->SetActive(false); ! viewer->SetActive(false); ! ! ! chatBox->SetActive(false); ! ! optionsView->Draw(); } else if (meScreenMode == NETWORK) { - briefingConsoleLeft->SetActive(false); - briefingConsoleBottom->SetActive(false); - optionsView->SetActive(false); networkView->SetActive(true); ! displaySettingsView->SetActive(false); ! tacticalMap->SetActive(false); ! worldMap->SetActive(false); ! infoConsole->SetActive(false); ! hookInfo->SetActive(false); ! oobView->SetActive(false); ! objectControl->SetActive(false); ! viewer->SetActive(false); ! chatBox->SetActive(false); networkView->Draw(); } else if (meScreenMode == DISPLAYSETTINGS) { - briefingConsoleLeft->SetActive(false); - briefingConsoleBottom->SetActive(false); - optionsView->SetActive(false); - networkView->SetActive(false); displaySettingsView->SetActive(true); - tacticalMap->SetActive(false); - worldMap->SetActive(false); - infoConsole->SetActive(false); - hookInfo->SetActive(false); - oobView->SetActive(false); - objectControl->SetActive(false); - viewer->SetActive(false); - chatBox->SetActive(false); displaySettingsView->Draw(); --- 1611,1633 ---- else if (meScreenMode == OPTIONS) { optionsView->SetActive(true); ! optionsView->Draw(); } + else if (meScreenMode == MESSAGES) + { + messageCenter->SetActive(true); + + messageCenter->Draw(); + } else if (meScreenMode == NETWORK) { networkView->SetActive(true); ! networkView->Draw(); } else if (meScreenMode == DISPLAYSETTINGS) { displaySettingsView->SetActive(true); displaySettingsView->Draw(); *************** *** 2115,2118 **** --- 2124,2133 ---- enableGraphicsEngine = !enableGraphicsEngine; return; + case 'h': + { + tcPopupMessage* msg = new tcPopupMessage("TEST", wxPoint(50, 50), 100); + msg->SetActive(true); + } + return; case 'm': enableTacticalMap = !enableTacticalMap; *************** *** 2175,2178 **** --- 2190,2203 ---- } return; + case WXK_F7: + if (meScreenMode == MESSAGES) + { + meScreenMode = TACTICAL; + } + else + { + meScreenMode = MESSAGES; + } + return; case WXK_F8: viewer->ToggleWireframe(); Index: tcDirectorEvent.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcDirectorEvent.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcDirectorEvent.cpp 2 Nov 2004 04:23:56 -0000 1.12 --- tcDirectorEvent.cpp 14 Nov 2004 22:52:22 -0000 1.13 *************** *** 35,38 **** --- 35,40 ---- #include "tc3DViewer.h" #include "math_constants.h" + #include "tcMessageInterface.h" + #include <osgText/Text> #include <osg/Vec3> // tc3DTextEvent *************** *** 258,261 **** --- 260,265 ---- console->Print(text.c_str()); + tcMessageInterface::Get()->ChannelMessage("Briefing", text); + triggered = true; } |
|
From: Dewitt C. <ddc...@us...> - 2004-11-14 22:52:34
|
Update of /cvsroot/gcblue/gcb_wx/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22147/xml Modified Files: briefing_left.xml Log Message: Text message "message center" GUI screen Index: briefing_left.xml =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/xml/briefing_left.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** briefing_left.xml 1 Nov 2004 03:17:19 -0000 1.3 --- briefing_left.xml 14 Nov 2004 22:52:22 -0000 1.4 *************** *** 1,4 **** <Window> <Button X="5" Y="5" Width="65" Height="15" Caption="Skip" Command="120"/> ! <TextBox TopMargin="30" BottomMargin="50" Wrap="60" FontSize="12"/> </Window> \ No newline at end of file --- 1,4 ---- <Window> <Button X="5" Y="5" Width="65" Height="15" Caption="Skip" Command="120"/> ! <TextBox TopMargin="30" BottomMargin="50" Wrap="60" FontSize="14"/> </Window> \ No newline at end of file |
|
From: Dewitt C. <ddc...@us...> - 2004-11-14 22:52:33
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22147/src/scriptinterface Modified Files: tcSimPythonInterface.cpp Log Message: Text message "message center" GUI screen Index: tcSimPythonInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcSimPythonInterface.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** tcSimPythonInterface.cpp 6 Nov 2004 15:13:42 -0000 1.19 --- tcSimPythonInterface.cpp 14 Nov 2004 22:52:21 -0000 1.20 *************** *** 324,327 **** --- 324,329 ---- wxString errText; + if (strlen(fileName) < 2) return; // work-around to support clear only + wxString fileNameWx(fileName); if (fileNameWx.Contains(".py")) |
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22147/src/graphics Modified Files: tc3DWindow.cpp tcMapView.cpp tcScenarioSelectView.cpp Added Files: tcMessageCenter.cpp tcMessageChannel.cpp tcMessageInterface.cpp tcPopupMessage.cpp Log Message: Text message "message center" GUI screen --- NEW FILE: tcMessageCenter.cpp --- /** ** @file tcMessageCenter.cpp */ /* Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "stdwx.h" #include "tcMessageCenter.h" #include "tcMessageChannel.h" #include <stdio.h> #include <iostream> #include "tcTime.h" #ifdef _DEBUG #define new DEBUG_NEW #endif /** * */ void tcMessageCenter::AddMessage(const std::string& channelName, const std::string& msg) { tcMessageChannel* channel = GetOrCreateChannel(channelName); channel->AddMessage(msg); } /** * Removes and deletes all channels */ void tcMessageCenter::Clear() { std::map<std::string, tcMessageChannel*>::iterator iter; for (iter = channelMap.begin(); iter != channelMap.end(); ++iter) { tcMessageChannel* channel = iter->second; delete channel; } channelMap.clear(); channelTab.Set(10, 80, 10, 30); } /** * */ void tcMessageCenter::Draw() { std::map<std::string, tcMessageChannel*>::iterator iter; for (iter = channelMap.begin(); iter != channelMap.end(); ++iter) { tcMessageChannel* channel = iter->second; channel->Draw(this); } FinishDraw(); } /** * */ tcMessageChannel* tcMessageCenter::GetChannel(const std::string& channelName) { std::map<std::string, tcMessageChannel*>::iterator iter; iter = channelMap.find(channelName); if (iter == channelMap.end()) { return 0; } else { return iter->second; } } /** * */ tcMessageChannel* tcMessageCenter::GetOrCreateChannel(const std::string& channelName) { tcMessageChannel* channel; if (channel = GetChannel(channelName)) { return channel; } else // create { channel = new tcMessageChannel(channelName); channel->SetActivationRect(channelTab); channel->SetTextRect(defaultTextRect); // move channelTab to next position channelTab.Offset(channelTab.Width() + 2.0, 0); channelMap[channelName] = channel; return channelMap[channelName]; } } /** * */ void tcMessageCenter::OnLButtonDown(wxMouseEvent& event) { wxPoint pos = event.GetPosition(); tcMessageChannel* clickedChannel = 0; tcMessageChannel* activeChannel = GetChannel(activeChannelName); std::map<std::string, tcMessageChannel*>::iterator iter; for (iter = channelMap.begin(); iter != channelMap.end(); ++iter) { tcMessageChannel* channel = iter->second; if (channel->IsPointInActivationRect(pos)) { clickedChannel = channel; } } if (clickedChannel == 0) return; // none of the activation buttons were clicked if (clickedChannel == activeChannel) return; clickedChannel->SetActive(true); if (activeChannel) { activeChannel->SetActive(false); } activeChannelName = clickedChannel->GetName(); } /** * */ void tcMessageCenter::OnMouseMove(wxMouseEvent& event) { wxPoint pos = event.GetPosition(); std::map<std::string, tcMessageChannel*>::iterator iter; for (iter = channelMap.begin(); iter != channelMap.end(); ++iter) { tcMessageChannel* channel = iter->second; if (channel->IsPointInActivationRect(pos)) { channel->SetMouseOver(true); } else { channel->SetMouseOver(false); } } } /** * */ tcMessageCenter::tcMessageCenter(wxWindow* parent, const wxPoint& pos, const wxSize& size, const wxString& name) : tc3DWindow(parent, pos, size, name, 0), activeChannelName("") { channelTab.Set(10, 140, 10, 30); defaultTextRect.Set(10, size.GetWidth()-100, 50, size.GetHeight()-50); LoadBackgroundImage("background.jpg"); } tcMessageCenter::~tcMessageCenter() { } --- NEW FILE: tcMessageChannel.cpp --- /** ** @file tcMessageChannel.cpp */ /* Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "stdwx.h" #include "tcMessageChannel.h" #include "tc3DWindow.h" #include <stdio.h> #include <iostream> #include "tcTime.h" #ifdef _DEBUG #define new DEBUG_NEW #endif /** * */ void tcMessageChannel::AddMessage(const std::string& msg) { messages.push_back(msg); } /** * */ void tcMessageChannel::Draw(tc3DWindow* graphics) { wxASSERT(graphics); DrawActivationButton(graphics); if (!isActive) return; DrawMessageText(graphics); } /** * */ void tcMessageChannel::DrawActivationButton(tc3DWindow* graphics) { wxASSERT(graphics); // draw title button osg::Vec4 buttonColor(0, 0, 0.2, 1); osg::Vec4 buttonTextColor(1, 1, 1, 1); osgText::Font* font = graphics->GetDefaultFont(); if (isActive) { buttonColor.set(1, 1, 1, 1); buttonTextColor.set(0, 0, 0, 1); } else if (isMouseOver) { buttonColor.set(0.05, 0.05, 0.3, 1); buttonTextColor.set(1, 1, 1, 1); } tcRect borderRect = activationRect; borderRect.Expand(1.0, 1.0); graphics->DrawRectangleR(borderRect, buttonTextColor, tc3DWindow::FILL_OFF); graphics->DrawRectangleR(activationRect, buttonColor, tc3DWindow::FILL_ON); graphics->DrawTextR(channelName.c_str(), activationRect.XCenter(), activationRect.YCenter(), font, buttonTextColor, buttonFontSize, CENTER_CENTER); } /** * */ void tcMessageChannel::DrawMessageText(tc3DWindow* graphics) { wxASSERT(graphics); osg::Vec4 color(1, 1, 1, 1); osgText::Font* font = graphics->GetDefaultFont(); std::deque<std::string>::reverse_iterator iter; float x = textRect.left + 10.0; float y = textRect.top; wxSize size; graphics->MeasureText(font, fontSize, "Tg", size); float lineSpacing = float(size.GetHeight()) + 2.0; for (iter = messages.rbegin(); iter != messages.rend(); ++iter) { y -= lineSpacing; if (y >= textRect.bottom + 10) { graphics->DrawTextR(iter->c_str(), x, y, font, color, fontSize, LEFT_BASE_LINE); } } graphics->DrawRectangleR(textRect, color, tc3DWindow::FILL_OFF); } /** * */ std::string tcMessageChannel::GetName() { return channelName; } /** * */ bool tcMessageChannel::IsActive() const { return isActive; } /** * */ bool tcMessageChannel::IsPointInActivationRect(const wxPoint& p) const { return activationRect.ContainsPoint(float(p.x), float(p.y)); } /** * */ void tcMessageChannel::SetActivationRect(tcRect r) { activationRect = r; } /** * */ void tcMessageChannel::SetActive(bool state) { isActive = state; } /** * */ void tcMessageChannel::SetMouseOver(bool state) { isMouseOver = state; } /** * */ void tcMessageChannel::SetTextRect(tcRect r) { textRect = r; } /** * */ tcMessageChannel::tcMessageChannel(std::string name) : channelName(name), isActive(false), isMouseOver(false), fontSize(16), buttonFontSize(12), activationRect(20, 80, 20, 40), textRect(50, 700, 50, 500) { } /** * */ tcMessageChannel::~tcMessageChannel() { } --- NEW FILE: tcMessageInterface.cpp --- /** ** @file tcMessageInterface.cpp */ /* Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "stdwx.h" #include "tcMessageInterface.h" #include "tcMessageCenter.h" #include <stdio.h> #include <iostream> #ifdef _DEBUG #define new DEBUG_NEW #endif tcMessageCenter* tcMessageInterface::messageCenter = 0; /** * */ void tcMessageInterface::ChannelMessage(const std::string& channelName, const std::string& msg) { wxASSERT(messageCenter); messageCenter->AddMessage(channelName, msg); } tcMessageInterface* tcMessageInterface::Get() { static tcMessageInterface instance; return &instance; } /** * Must be called before using DisplayChannelMessage */ void tcMessageInterface::SetMessageCenter(tcMessageCenter* mc) { messageCenter = mc; } /** * */ tcMessageInterface::tcMessageInterface() { } tcMessageInterface::~tcMessageInterface() { } Index: tcScenarioSelectView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcScenarioSelectView.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcScenarioSelectView.cpp 6 Nov 2004 15:13:41 -0000 1.7 --- tcScenarioSelectView.cpp 14 Nov 2004 22:52:21 -0000 1.8 *************** *** 213,216 **** --- 213,217 ---- else { + mpSimState->mpPythonInterface->LoadScenario("", ""); // to clear director mpSimState->RandInit(); } Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapView.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcMapView.cpp 6 Nov 2004 15:13:41 -0000 1.7 --- tcMapView.cpp 14 Nov 2004 22:52:21 -0000 1.8 *************** *** 720,723 **** --- 720,725 ---- DrawBorder(); + DrawChildren(); + FinishDraw(); } --- NEW FILE: tcPopupMessage.cpp --- /** ** @file tcPopupMessage.cpp */ /* Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "stdwx.h" #include "tcPopupMessage.h" #include <stdio.h> #include <iostream> #include "tcTime.h" #ifdef _DEBUG #define new DEBUG_NEW #endif tc3DWindow* tcPopupMessage::parent = 0; /** * */ void tcPopupMessage::SetParent(tc3DWindow* par) { parent = par; } /** * Clears the text buffer */ void tcPopupMessage::Clear() { messageText = ""; } /** * */ void tcPopupMessage::Draw() { unsigned currentCount = tcTime::Get()->Get30HzCount(); unsigned age = currentCount - birthCount; if (age < 20) { bool blinkOn = age % 8 < 4; if (blinkOn) { redraw = true; } else { HideUnusedObjects(); redraw = true; return; } } else if (age > 150) { ClearDrawObjects(); Destroy(); return; } if (!redraw) return; osg::Vec4 color(1, 1, 1, 1); float x = 0.5f * float(mnWidth); float y = 0.5f * float(mnHeight); DrawRectangleR(0, 0, float(mnWidth), float(mnHeight), osg::Vec4(0, 0, 0, 0.5f), FILL_ON); DrawTextR(messageText.c_str(), x, y, defaultFont.get(), color, fontSize, CENTER_CENTER); DrawBorder(); HideUnusedObjects(); redraw = false; } void tcPopupMessage::OnLButtonDown(wxMouseEvent& event) { ClearDrawObjects(); this->Destroy(); } /** * */ tcPopupMessage::tcPopupMessage(std::string text, const wxPoint& pos, int width) : tc3DWindow(parent, pos, wxSize(width, 25), "PopupMessage", parent), messageText(text), redraw(true) { SetBaseRenderBin(parent->GetBaseRenderBin() + 10); birthCount = tcTime::Get()->Get30HzCount(); } tcPopupMessage::~tcPopupMessage() { } Index: tc3DWindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DWindow.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tc3DWindow.cpp 7 Nov 2004 03:40:44 -0000 1.10 --- tc3DWindow.cpp 14 Nov 2004 22:52:21 -0000 1.11 *************** *** 72,75 **** --- 72,76 ---- EVT_SET_FOCUS(tc3DWindow::OnSetFocus) EVT_KILL_FOCUS(tc3DWindow::OnKillFocus) + EVT_CLOSE(tc3DWindow::OnClose) END_EVENT_TABLE() *************** *** 101,104 **** --- 102,110 ---- } + void tc3DWindow::OnClose(wxCloseEvent& event) + { + event.Skip(); + } + void tc3DWindow::OnEnterWindow(wxMouseEvent& event) { *************** *** 236,239 **** --- 242,287 ---- + + /** + * Removes child window from children vector by adding + * to childrenToRemove queue for safe removal at the + * start of the next DrawChildren. + */ + void tc3DWindow::RemoveChild(tc3DWindow* child) + { + wxASSERT(child); + if (child == NULL) return; + + childrenToRemove.push(child); + } + + /** + * Removes pending children for removal from children vector. + */ + void tc3DWindow::UpdateChildren() + { + /* for each child in the childrenToRemove queue + ** iterate through children vector and remove if + ** found */ + while (!childrenToRemove.empty()) + { + tc3DWindow* child = childrenToRemove.front(); + childrenToRemove.pop(); + + wxASSERT(child); + 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; + } + } + } + + } + /** * Creates new drawing projection and adds it to the root node of *************** *** 584,587 **** --- 632,637 ---- void tc3DWindow::DrawChildren() { + UpdateChildren(); + size_t nChildren = children.size(); *************** *** 1108,1112 **** } ! --- 1158,1168 ---- } ! /** ! * ! */ ! int tc3DWindow::GetBaseRenderBin() const ! { ! return baseRenderBin; ! } *************** *** 1500,1503 **** --- 1556,1573 ---- } + /** + * + */ + void tc3DWindow::ClearDrawObjects() + { + textIdx = 0; + imageQuadIdx = 0; + lineIdx = 0; + rectIdx = 0; + transformIdx = 0; + + HideUnusedObjects(); + } + /** *************** *** 1718,1722 **** fontSize(12.0), fontSizeLarge(18.0), ! fontSizeSmall(9.0) { --- 1788,1793 ---- fontSize(12.0), fontSizeLarge(18.0), ! fontSizeSmall(9.0), ! hostParent(graphicsHost) { *************** *** 1876,1879 **** --- 1947,1954 ---- linePool.size(), rectPool.size(), transformPool.size()); #endif + if (hostParent) + { + hostParent->RemoveChild(this); // watch out for destruction order problems here + } } |
|
From: Dewitt C. <ddc...@us...> - 2004-11-14 22:52:31
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22147/src/common Modified Files: simmath.cpp Added Files: tcRect.cpp Log Message: Text message "message center" GUI screen --- NEW FILE: tcRect.cpp --- /** ** @file tcRect.cpp */ /* Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "tcRect.h" /** * @return true if point (x, y) is within rectangle * left and bottom borders are inclusive */ bool tcRect::ContainsPoint(float x, float y) const { return (x >= left) && (x < right) && (y >= bottom) && (y < top); } /** * */ void tcRect::Expand(float dx, float dy) { left -= dx; right += dx; bottom -= dy; top += dy; } /** * */ void tcRect::Offset(float dx, float dy) { left += dx; right += dx; bottom += dy; top += dy; } /** * */ tcRect& tcRect::operator=(const tcRect& r) { left = r.left; right = r.right; bottom = r.bottom; top = r.top; return *this; } /** * */ tcRect::tcRect() : left(0), right(0), bottom(0), top(0) { } /** * */ tcRect::tcRect(float x1, float x2, float y1, float y2) : left(x1), right(x2), bottom(y1), top(y2) { } /** * */ tcRect::tcRect(const tcRect& r) : left(r.left), right(r.right), bottom(r.bottom), top(r.top) { } /** * */ tcRect::~tcRect() { } Index: simmath.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/simmath.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** simmath.cpp 6 Nov 2004 15:13:41 -0000 1.18 --- simmath.cpp 14 Nov 2004 22:52:20 -0000 1.19 *************** *** 1,4 **** ! /* ! ** Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** ! ** @file simmath.cpp ! */ ! /* Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 102,109 **** } ! bool tcRect::ContainsPoint(float x, float y) ! { ! return (x >= left) && (x < right) && (y >= bottom) && (y < top); ! } /******************************* tcGeoRect ********************************/ --- 104,108 ---- } ! /******************************* tcGeoRect ********************************/ |
|
From: Dewitt C. <ddc...@us...> - 2004-11-07 03:42:35
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4233/include/graphics Modified Files: tc3DViewer.h tcMapView.h tcParticleEffect.h tcParticlePlacer.h Log Message: Added optical sensor model, fixed generic model display for sensor tracks Index: tc3DViewer.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DViewer.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tc3DViewer.h 6 Nov 2004 15:13:40 -0000 1.4 --- tc3DViewer.h 7 Nov 2004 03:40:43 -0000 1.5 *************** *** 47,51 **** class wxGLCanvas; ! class tc3DViewer : public wxWindow { --- 47,53 ---- class wxGLCanvas; ! /** ! * Manages OSG 3D scenegraph and camera ! */ class tc3DViewer : public wxWindow { Index: tcParticlePlacer.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcParticlePlacer.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcParticlePlacer.h 1 Sep 2004 02:55:35 -0000 1.2 --- tcParticlePlacer.h 7 Nov 2004 03:40:43 -0000 1.3 *************** *** 49,52 **** --- 49,53 ---- protected: osg::Vec3 previousCenter; + osg::Vec3 previousCenter2; ///< center before previousCenter bool applyJitter_; ///< true to randomize placement of particle *************** *** 58,62 **** inline tcParticlePlacer::tcParticlePlacer() ! : CenteredPlacer(), previousCenter(0, 0, 0), applyJitter_(false) { } --- 59,66 ---- inline tcParticlePlacer::tcParticlePlacer() ! : CenteredPlacer(), ! previousCenter(0, 0, 0), ! previousCenter2(0, 0, 0), ! applyJitter_(false) { } *************** *** 82,90 **** osg::Vec3 cen = getCenter(); ! osg::Vec3 p(a*cen._v[0] + b*previousCenter._v[0], ! a*cen._v[1] + b*previousCenter._v[1], ! a*cen._v[2] + b*previousCenter._v[2]); P->setPosition(p); } --- 86,99 ---- osg::Vec3 cen = getCenter(); ! osg::Vec3 p(a*cen._v[0] + b*previousCenter2._v[0], ! a*cen._v[1] + b*previousCenter2._v[1], ! a*cen._v[2] + b*previousCenter2._v[2]); P->setPosition(p); + /* + osgParticle::rangef alphaRange = P->getAlphaRange(); + alphaRange.minimum = a; + P->setAlphaRange(alphaRange); + */ } *************** *** 128,131 **** --- 137,141 ---- if (absDiff < 0.01) return; + previousCenter2 = previousCenter; previousCenter = cen; CenteredPlacer::setCenter(x, y, z); Index: tcMapView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMapView.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcMapView.h 1 Nov 2004 03:17:16 -0000 1.4 --- tcMapView.h 7 Nov 2004 03:40:43 -0000 1.5 *************** *** 153,156 **** --- 153,159 ---- #define N_PENS 10 + /** + * Base class for tactical map and world map views + */ class tcMapView : public tc3DWindow { *************** *** 240,243 **** --- 243,249 ---- #define GAMEMODE_EDIT 2 + /** + * Tactical (theater) map with color elevation map + */ class tcTacticalMapView : public tcMapView { Index: tcParticleEffect.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcParticleEffect.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcParticleEffect.h 1 Sep 2004 02:55:35 -0000 1.2 --- tcParticleEffect.h 7 Nov 2004 03:40:43 -0000 1.3 *************** *** 53,57 **** MISSILE = 1, AFTERBURNER = 2, ! DAMAGE = 4 }; --- 53,58 ---- MISSILE = 1, AFTERBURNER = 2, ! DAMAGE = 4, ! GUN = 8 }; *************** *** 78,81 **** --- 79,83 ---- void ConfigureForMode(); + void InitializeGunEffect(); }; |
|
From: Dewitt C. <ddc...@us...> - 2004-11-07 03:42:28
|
Update of /cvsroot/gcblue/gcb_wx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4233 Modified Files: doxygen_config Log Message: Added optical sensor model, fixed generic model display for sensor tracks Index: doxygen_config =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/doxygen_config,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** doxygen_config 10 Jul 2004 01:51:15 -0000 1.3 --- doxygen_config 7 Nov 2004 03:40:43 -0000 1.4 *************** *** 4,9 **** # General configuration options #--------------------------------------------------------------------------- ! PROJECT_NAME = GCB_WX ! PROJECT_NUMBER = X6A OUTPUT_DIRECTORY = C:/gcb/gcb_doxydoc/ OUTPUT_LANGUAGE = English --- 4,9 ---- # General configuration options #--------------------------------------------------------------------------- ! PROJECT_NAME = "GCB 0.6.1" ! PROJECT_NUMBER = X61x OUTPUT_DIRECTORY = C:/gcb/gcb_doxydoc/ OUTPUT_LANGUAGE = English |
|
From: Dewitt C. <ddc...@us...> - 2004-11-07 03:42:19
|
Update of /cvsroot/gcblue/gcb_wx/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4233/xml Modified Files: info_console.xml options_nosound.txt Log Message: Added optical sensor model, fixed generic model display for sensor tracks Index: options_nosound.txt =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/xml/options_nosound.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** options_nosound.txt 7 Oct 2004 22:03:00 -0000 1.1 --- options_nosound.txt 7 Nov 2004 03:40:45 -0000 1.2 *************** *** 1,5 **** <Options> <HostAddress>192.168.0.102</HostAddress> ! <DisplaySettings></DisplaySettings> <DisableSound>Yes</DisableSound> </Options> --- 1,7 ---- <Options> <HostAddress>192.168.0.102</HostAddress> ! <DisplaySettings>default</DisplaySettings> ! <LastScenarioPath>Random.py</LastScenarioPath> ! <LastScenarioName>Random</LastScenarioName> <DisableSound>Yes</DisableSound> </Options> Index: info_console.xml =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/xml/info_console.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** info_console.xml 6 Nov 2004 15:13:43 -0000 1.3 --- info_console.xml 7 Nov 2004 03:40:45 -0000 1.4 *************** *** 1,5 **** <Window> ! <TextBox TopMargin="2" BottomMargin="2" Wrap="60" DrawBorder="0" FontSize="12"/> </Window> \ No newline at end of file --- 1,5 ---- <Window> ! <TextBox TopMargin="2" BottomMargin="2" Wrap="31" DrawBorder="0" FontSize="12"/> </Window> \ No newline at end of file |
|
From: Dewitt C. <ddc...@us...> - 2004-11-07 03:42:06
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4233/src/sim Modified Files: tcAeroAirObject.cpp tcAirObject.cpp tcMissileObject.cpp tcObjectControl.cpp tcRadar.cpp tcSimState.cpp Log Message: Added optical sensor model, fixed generic model display for sensor tracks Index: tcSimState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSimState.cpp,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** tcSimState.cpp 6 Nov 2004 15:13:42 -0000 1.56 --- tcSimState.cpp 7 Nov 2004 03:40:45 -0000 1.57 *************** *** 174,178 **** mcDefaultRadar.SetMountAz(afSensorAz); ! if (mcDefaultRadar.IsSemiactive()) { mcDefaultRadar.SetIlluminator(fcID, fcIdx); --- 174,178 ---- mcDefaultRadar.SetMountAz(afSensorAz); ! if (mcDefaultRadar.IsSemiactive() || mcDefaultRadar.IsCommandReceiver()) { mcDefaultRadar.SetIlluminator(fcID, fcIdx); *************** *** 1187,1195 **** } AddPlatform(child); } if (launch_count) { gameObj->toLaunch.clear(); - tcSound::Get()->PlayEffect(SEFFECT_JETLAUNCH); } } --- 1187,1209 ---- } AddPlatform(child); + + // sound effects + if (mpUserInfo->IsOwnAlliance(gameObj->mnAlliance)) + { + if (dynamic_cast<tcHeloObject*>(child)) + { + tcSound::Get()->PlayEffect(SEFFECT_HELOLAUNCH); + } + else if (dynamic_cast<tcAirObject*>(child)) + { + tcSound::Get()->PlayEffect(SEFFECT_JETLAUNCH); + } + + } + } if (launch_count) { gameObj->toLaunch.clear(); } } *************** *** 1768,1773 **** } ! /********************************************************************/ ! // returns track associated with FIRST sensor only int tcSimState::GetSeekerTrack(long anKey, tcTrack& track) { --- 1782,1788 ---- } ! /** ! * @returns track associated with FIRST sensor only ! */ int tcSimState::GetSeekerTrack(long anKey, tcTrack& track) { *************** *** 1778,1782 **** if (tcMissileObject *pMissileObj = dynamic_cast<tcMissileObject*>(pplat)) { ! tcSensorState *pSS = pMissileObj->GetSensorState(); if ((pSS==NULL)||(pSS->mnMode != SSMODE_SEEKERTRACK)) {return 0;} track = pSS->mcTrack; --- 1793,1799 ---- if (tcMissileObject *pMissileObj = dynamic_cast<tcMissileObject*>(pplat)) { ! if (pMissileObj->GetCurrentGuidanceMode() == GM_COMMAND) return 0; ! ! tcSensorState* pSS = pMissileObj->GetSensorState(); if ((pSS==NULL)||(pSS->mnMode != SSMODE_SEEKERTRACK)) {return 0;} track = pSS->mcTrack; Index: tcMissileObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMissileObject.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** tcMissileObject.cpp 6 Nov 2004 15:13:42 -0000 1.19 --- tcMissileObject.cpp 7 Nov 2004 03:40:45 -0000 1.20 *************** *** 167,171 **** mcSensorState.mnMode = SSMODE_SEEKERACQUIRE; mcSensorState.mcTrack.mnID = pLauncher->mnTargetID; ! if (mcSensorState.IsSemiactive()) { mcSensorState.SetIlluminator( --- 167,172 ---- mcSensorState.mnMode = SSMODE_SEEKERACQUIRE; mcSensorState.mcTrack.mnID = pLauncher->mnTargetID; ! mcSensorState.mfLastScan = -10; // ensure rapid update to get a valid track for guidance ! if (mcSensorState.IsSemiactive() || mcSensorState.IsCommandReceiver()) { mcSensorState.SetIlluminator( *************** *** 199,202 **** --- 200,211 ---- /** + * @return time remaining in seconds for rocket motor thrust + */ + float tcMissileObject::RuntimeRemaining() + { + return mpDBObject->mfBoostTime_s + mpDBObject->mfSustTime_s - msKState.mfFlightTime; + } + + /** * */ *************** *** 338,354 **** mfInterceptTime = tti_s; - - //interceptPitch_rad = atanf(0.001f*(msWaypoint.mfAlt_m - mcKin.mfAlt_m)/ - // mfRangeToObjective_km); useInterceptPitch = true; } break; case GM_SENSOR1: ! if (!mcSensorState.GetActive()) { mcSensorState.SetActive(true); ! mcSensorState.mnMode = SSMODE_SEEKERSEARCH; ! mfGuidanceUpdateInterval = 0.5f; ! } if (mcSensorState.mnMode == SSMODE_SEEKERTRACK) { --- 347,392 ---- mfInterceptTime = tti_s; useInterceptPitch = true; } break; + case GM_COMMAND: + { + // command uses the sensor + tcTrack predictedtrack; + float tti_s; + mcSensorState.mcTrack.GetPrediction(predictedtrack, afStatusTime); + + mcKin.GetInterceptData3D(predictedtrack, mfGoalHeading_rad, + interceptPitch_rad, tti_s, mfRangeToObjective_km); + + mfRangeToObjective_km *= C_RADTOKM; // convert to km + + if (msKState.mfAltitude_m <= 4.0) + { + if (interceptPitch_rad < 0) {interceptPitch_rad = 0;} + } + + useInterceptPitch = (pSegmentInfo->meAltitudeMode == AM_INTERCEPT); + mfInterceptTime = tti_s; + } + break; case GM_SENSOR1: ! if (mcSensorState.IsCommandReceiver()) ! { ! /* Switching from command guidance to seeker track. ! ** This does not support a transition where command link ! ** is still active while the seeker attempts to acquire */ ! mcSensorState.SetCommandState(false); // clear command mode ! mcSensorState.mnMode = SSMODE_SEEKERTRACK; ! } ! else if (!mcSensorState.GetActive()) { mcSensorState.SetActive(true); ! mcSensorState.mnMode = SSMODE_SEEKERSEARCH; ! } ! ! mfGuidanceUpdateInterval = 0.5f; ! ! if (mcSensorState.mnMode == SSMODE_SEEKERTRACK) { *************** *** 356,362 **** float tti_s; mcSensorState.mcTrack.GetPrediction(predictedtrack,afStatusTime); ! //mcKin.GetInterceptData2D(predictedtrack, mfGoalHeading_rad, tti_s); mcKin.GetInterceptData3D(predictedtrack, mfGoalHeading_rad, interceptPitch_rad, tti_s, mfRangeToObjective_km); mfRangeToObjective_km *= C_RADTOKM; // convert to km --- 394,401 ---- float tti_s; mcSensorState.mcTrack.GetPrediction(predictedtrack,afStatusTime); ! mcKin.GetInterceptData3D(predictedtrack, mfGoalHeading_rad, interceptPitch_rad, tti_s, mfRangeToObjective_km); + mfRangeToObjective_km *= C_RADTOKM; // convert to km *************** *** 420,423 **** --- 459,463 ---- if (useInterceptPitch) { + wxASSERT(!_isnan(interceptPitch_rad)); mfGoalPitch_rad = interceptPitch_rad; } Index: tcAeroAirObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcAeroAirObject.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcAeroAirObject.cpp 2 Nov 2004 04:23:56 -0000 1.7 --- tcAeroAirObject.cpp 7 Nov 2004 03:40:45 -0000 1.8 *************** *** 30,33 **** --- 30,35 ---- #include "tcAero.h" #include "math_constants.h" + #include "tc3DModel.h" + #include "tcParticleEffect.h" #ifdef _DEBUG *************** *** 103,106 **** --- 105,128 ---- } + void tcAeroAirObject::UpdateEffects() + { + if (model) + { + if (mfDamageLevel > 0.1f) + { + model->SetSmokeMode(tcParticleEffect::DAMAGE); + } + else if (throttleFraction > 1.0f) + { + model->SetSmokeMode(tcParticleEffect::AFTERBURNER); + } + else + { + model->SetSmokeMode(tcParticleEffect::OFF); + } + model->UpdateEffects(); + } + } + void tcAeroAirObject::UpdateHeading(float dt_s) { *************** *** 118,121 **** --- 140,145 ---- wxASSERT(mpDBObject); + + UpdateEffects(); UpdateFormationGuidance(); // formation heading/speed calculation Index: tcObjectControl.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcObjectControl.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** tcObjectControl.cpp 6 Nov 2004 15:13:42 -0000 1.21 --- tcObjectControl.cpp 7 Nov 2004 03:40:45 -0000 1.22 *************** *** 1250,1257 **** } bool bAccepted = ProcessSensorPanelButton(nSensor, nCol); - if (bAccepted) - { - tcSound::Get()->PlayEffect(SEFFECT_PING3); - } } else if (msHOI.mrectArc.ContainsPoint((float)point.x,(float)point.y)) --- 1250,1253 ---- *************** *** 1402,1405 **** --- 1398,1411 ---- const tcSensorState* pSensorState = pPlatformObj->GetSensor(sensorIdx); pPlatformObj->SetSensorState((unsigned)sensorIdx, !pSensorState->GetActive()); + + if (pSensorState->GetActive()) + { + tcSound::Get()->PlayEffect(SEFFECT_RADARON); + } + else + { + tcSound::Get()->PlayEffect(SEFFECT_RADAROFF); + } + return true; } Index: tcAirObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcAirObject.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcAirObject.cpp 2 Nov 2004 04:23:56 -0000 1.12 --- tcAirObject.cpp 7 Nov 2004 03:40:45 -0000 1.13 *************** *** 1,4 **** /** ! ** @file tcAirObject.cpp */ /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) --- 1,5 ---- /** ! ** @file tcAirObject.cpp ! ** Basic aircraft model */ /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) *************** *** 28,31 **** --- 29,34 ---- #include "tcAirObject.h" #include "tcGenericDBObject.h" + #include "tc3DModel.h" + #include "tcParticleEffect.h" #include "common/tcObjStream.h" *************** *** 240,243 **** --- 243,262 ---- } + void tcAirObject::UpdateEffects() + { + if (model) + { + if (mfDamageLevel > 0.1f) + { + model->SetSmokeMode(tcParticleEffect::DAMAGE); + } + else + { + model->SetSmokeMode(tcParticleEffect::OFF); + } + model->UpdateEffects(); + } + } + void tcAirObject::UpdateHeading(float dt_s) { *************** *** 302,305 **** --- 321,334 ---- } + /** + * Limits speed to 100 kts min + */ + void tcAirObject::UpdateSpeed(float dt_s) + { + tcPlatformObject::UpdateSpeed(dt_s); + + if (mcKin.mfSpeed_kts < 100) mcKin.mfSpeed_kts = 100; + } + void tcAirObject::Update(double afStatusTime) { Index: tcRadar.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcRadar.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcRadar.cpp 6 Nov 2004 15:13:42 -0000 1.15 --- tcRadar.cpp 7 Nov 2004 03:40:45 -0000 1.16 *************** *** 89,93 **** wxASSERT(mpDBObj); ! if (!mbActive) return false; float illuminatorTargetRange_km = 1e8; --- 89,93 ---- wxASSERT(mpDBObj); ! if (!mbActive && !isCommandReceiver) return false; float illuminatorTargetRange_km = 1e8; *************** *** 185,193 **** /** * @return semi-active illuminator object */ tcRadar* tcRadar::GetSemiactiveIlluminator() { ! wxASSERT(isSemiactive); wxASSERT(simState); --- 185,195 ---- /** + * Also currently used for command guidance, may want to separate these * @return semi-active illuminator object */ tcRadar* tcRadar::GetSemiactiveIlluminator() { ! // !mpDBObj to avoid probs with destuctor ! wxASSERT(isSemiactive || !mpDBObj || mpDBObj->isCommandReceiver); wxASSERT(simState); *************** *** 234,237 **** --- 236,248 ---- /** + * Sets command state of radar. + * @param state true to use command track from "illuminator" platform, false to use seeker + */ + void tcRadar::SetCommandState(bool state) + { + isCommandReceiver = state; + } + + /** * Sets illuminator info for semi-active radars and command receivers. * isCommandReceiver indicates the "radar" is a simple receiver of command *************** *** 490,494 **** mcTrack.mnFlags = (TRACK_HEADING_VALID | TRACK_SPEED_VALID | TRACK_ALT_VALID | TRACK_CLIMB_VALID); ! if (mnMode == SSMODE_SEEKERACQUIRE) { mnMode = SSMODE_SEEKERTRACK; --- 501,505 ---- mcTrack.mnFlags = (TRACK_HEADING_VALID | TRACK_SPEED_VALID | TRACK_ALT_VALID | TRACK_CLIMB_VALID); ! if ((mnMode == SSMODE_SEEKERACQUIRE) && !isCommandReceiver) { mnMode = SSMODE_SEEKERTRACK; *************** *** 548,552 **** { // release fire control track ! if (isSemiactive || isCommandReceiver) { if (tcRadar *illuminator = GetSemiactiveIlluminator()) --- 559,563 ---- { // release fire control track ! if (illuminatorID != -1) { if (tcRadar *illuminator = GetSemiactiveIlluminator()) |
|
From: Dewitt C. <ddc...@us...> - 2004-11-07 03:42:04
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4233/include/common Modified Files: tcSound.h Log Message: Added optical sensor model, fixed generic model display for sensor tracks Index: tcSound.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/tcSound.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcSound.h 8 Aug 2004 00:31:32 -0000 1.14 --- tcSound.h 7 Nov 2004 03:40:43 -0000 1.15 *************** *** 62,66 **** #define SEFFECT_FSLIDE 21 #define SEFFECT_NAVALGUN 22 ! #define N_SEFFECT 23 #define N_EFFECT_BUFFERS 16 --- 62,70 ---- #define SEFFECT_FSLIDE 21 #define SEFFECT_NAVALGUN 22 ! #define SEFFECT_HELOLAUNCH 23 ! #define SEFFECT_RADARON 24 ! #define SEFFECT_RADAROFF 25 ! ! #define N_SEFFECT 26 #define N_EFFECT_BUFFERS 16 |