gcblue-commits Mailing List for Global Conflict Blue (Page 43)
Status: Alpha
Brought to you by:
ddcforge
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(112) |
Feb
(106) |
Mar
(88) |
Apr
(111) |
May
(53) |
Jun
(60) |
Jul
(58) |
Aug
(61) |
Sep
(45) |
Oct
(31) |
Nov
(71) |
Dec
(70) |
| 2005 |
Jan
(33) |
Feb
(57) |
Mar
(98) |
Apr
(47) |
May
(53) |
Jun
(79) |
Jul
(79) |
Aug
|
Sep
(33) |
Oct
(1) |
Nov
(20) |
Dec
(64) |
| 2006 |
Jan
(20) |
Feb
(1) |
Mar
(43) |
Apr
(11) |
May
(8) |
Jun
(23) |
Jul
|
Aug
(28) |
Sep
(58) |
Oct
(25) |
Nov
(47) |
Dec
(70) |
|
From: Dewitt C. <ddc...@us...> - 2004-10-21 04:11:16
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9417/src/graphics Modified Files: tc3DTerrain.cpp tc3DViewer.cpp tc3DWindow.cpp tcButton.cpp tcChatBox.cpp tcCreditView.cpp tcDisplaySettingsView.cpp tcGraphicsEngine.cpp tcMapObject.cpp tcMapView.cpp tcNetworkView.cpp tcScenarioSelectView.cpp tcXmlWindow.cpp Log Message: Changes related to GDI+ replacement Index: tcNetworkView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcNetworkView.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcNetworkView.cpp 2 Oct 2004 22:41:33 -0000 1.2 --- tcNetworkView.cpp 21 Oct 2004 04:10:59 -0000 1.3 *************** *** 224,228 **** if (config) { ! AddXMLControls(); } else --- 224,228 ---- if (config) { ! // AddXMLControls(); } else Index: tc3DTerrain.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DTerrain.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tc3DTerrain.cpp 26 Jul 2004 01:44:40 -0000 1.14 --- tc3DTerrain.cpp 21 Oct 2004 04:10:59 -0000 1.15 *************** *** 258,262 **** terrainNode->addDrawable(pDrawable); ! terrainNode->setCullingActive(false); // disables small feature and view frustrum culling float detailThreshold = 6.0f; terrain->SetDetailThreshold(detailThreshold); --- 258,262 ---- terrainNode->addDrawable(pDrawable); ! terrainNode->setCullingActive(true); // disables small feature and view frustrum culling float detailThreshold = 6.0f; terrain->SetDetailThreshold(detailThreshold); Index: tcChatBox.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcChatBox.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcChatBox.cpp 2 Oct 2004 22:41:33 -0000 1.1 --- tcChatBox.cpp 21 Oct 2004 04:10:59 -0000 1.2 *************** *** 118,122 **** if (config) { ! AddXMLControls(); } else --- 118,122 ---- if (config) { ! // AddXMLControls(); } else Index: tcDisplaySettingsView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcDisplaySettingsView.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcDisplaySettingsView.cpp 2 Oct 2004 22:41:33 -0000 1.4 --- tcDisplaySettingsView.cpp 21 Oct 2004 04:10:59 -0000 1.5 *************** *** 235,239 **** if (config) { ! AddXMLControls(); } else --- 235,239 ---- if (config) { ! // AddXMLControls(); } else Index: tcMapObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapObject.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcMapObject.cpp 14 Sep 2004 02:01:46 -0000 1.4 --- tcMapObject.cpp 21 Oct 2004 04:10:59 -0000 1.5 *************** *** 1,6 **** ! /* ! ** tcDirector.cpp ! ** ! ** Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** ! ** @file tcMapObject.cpp ! */ ! /* Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 19,23 **** ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ ! /// @file tcDirector.cpp source file for tcDirector class --- 19,23 ---- ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ ! *************** *** 26,36 **** #ifndef WX_PRECOMP #include "wx/wx.h" - #ifdef WIN32 - #include "wx/msw/private.h" // for MS Windows specific definitions - #endif // WIN32 #endif // WX_PRECOMP #include "tcMapObject.h" - #include "gdiplus.h" #include "tcMapView.h" #include "math_constants.h" --- 26,32 ---- *************** *** 38,48 **** using MapView::tcMapView; - using Gdiplus::Pen; - using Gdiplus::SolidBrush; - using Gdiplus::Font; tcMapView* tcMapObject::mapView = NULL; ! void tcMapObject::Draw(Gdiplus::Graphics *graphics) { if (!isActive) return; --- 34,41 ---- using MapView::tcMapView; tcMapView* tcMapObject::mapView = NULL; ! void tcMapObject::Draw() { if (!isActive) return; *************** *** 51,61 **** float y = pscreen.y; - Pen* pen = mapView->GetPen(); - pen->SetColor(color); - if (markerEnabled) { ! graphics->DrawLine(pen,x-8,y-8,x+8,y+8); ! graphics->DrawLine(pen,x+8,y-8,x-8,y+8); } } --- 44,51 ---- float y = pscreen.y; if (markerEnabled) { ! mapView->DrawLineR(x-8, y-8, x+8, y+8, color); ! mapView->DrawLineR(x+8, y-8, x-8, y+8, color); } } *************** *** 105,109 **** _y = y * C_PIOVER180; } ! color = 0xFE64FF64; // green default isActive = true; markerEnabled = true; --- 95,99 ---- _y = y * C_PIOVER180; } ! color = osg::Vec4(0.392, 1.0, 0.392, 1.0); // green default isActive = true; markerEnabled = true; *************** *** 117,121 **** /********** tcMapTextObject **************/ ! void tcMapTextObject::Draw(Gdiplus::Graphics *graphics) { if (!isActive) return; --- 107,111 ---- /********** tcMapTextObject **************/ ! void tcMapTextObject::Draw() { if (!isActive) return; *************** *** 124,141 **** float y = pscreen.y; - SolidBrush *brush = mapView->GetBrush(); - Font *font = mapView->GetFont(); - Pen *pen = mapView->GetPen(); - - pen->SetColor(color); - brush->SetColor(color); ! mapView->DrawText(graphics, font, brush, caption.c_str(), ! x+5.0f, y); if (markerEnabled) // avoids parent draw overhead this way { ! graphics->DrawLine(pen,x-8,y-8,x+8,y+8); ! graphics->DrawLine(pen,x+8,y-8,x-8,y+8); } --- 114,125 ---- float y = pscreen.y; ! mapView->DrawTextR(caption.c_str(), x+5.0f, y, ! mapView->GetDefaultFont(), color, 16.0, LEFT_BASE_LINE); if (markerEnabled) // avoids parent draw overhead this way { ! mapView->DrawLineR(x-8, y-8, x+8, y+8, color); ! mapView->DrawLineR(x+8, y-8, x-8, y+8, color); } Index: tcXmlWindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcXmlWindow.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcXmlWindow.cpp 7 Oct 2004 22:01:46 -0000 1.3 --- tcXmlWindow.cpp 21 Oct 2004 04:10:59 -0000 1.4 *************** *** 134,137 **** --- 134,142 ---- } + if (config) + { + AddXMLControls(); + } + if (ref_count++ > 0) return; Index: tcCreditView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcCreditView.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcCreditView.cpp 2 Oct 2004 22:41:33 -0000 1.5 --- tcCreditView.cpp 21 Oct 2004 04:10:59 -0000 1.6 *************** *** 181,185 **** const float height = float(mnHeight); ! float fY = 0.5f*(float)nDeltaTime; float fX = 0.5f*(float)mnWidth; --- 181,185 ---- const float height = float(mnHeight); ! float fY = 0.25f*(float)nDeltaTime; float fX = 0.5f*(float)mnWidth; Index: tcScenarioSelectView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcScenarioSelectView.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcScenarioSelectView.cpp 2 Oct 2004 22:41:33 -0000 1.4 --- tcScenarioSelectView.cpp 21 Oct 2004 04:10:59 -0000 1.5 *************** *** 482,486 **** if (config) { ! AddXMLControls(); } else --- 482,486 ---- if (config) { ! // AddXMLControls(); } else Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapView.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcMapView.cpp 2 Oct 2004 22:41:33 -0000 1.1 --- tcMapView.cpp 21 Oct 2004 04:10:59 -0000 1.2 *************** *** 1,6 **** ! /* ! ** tcMapView.cpp ! ** ! ** Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** ! ** @file tcMapView.cpp ! */ [...2569 lines suppressed...] terrainView->Maximize(); } else { ! Minimize(); terrainView->Minimize(); } *************** *** 2310,2314 **** if (!terrainView) {wxMessageBox("terrainView init failed\n");} ! tcWindow::MoveToTop(); // so that color elevation map is underneath mnCounter = 0; ClearMapObjects(); --- 2430,2434 ---- if (!terrainView) {wxMessageBox("terrainView init failed\n");} ! MoveToTop(); // so that color elevation map is underneath mnCounter = 0; ClearMapObjects(); Index: tcButton.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcButton.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcButton.cpp 7 Oct 2004 22:01:46 -0000 1.12 --- tcButton.cpp 21 Oct 2004 04:10:59 -0000 1.13 *************** *** 211,215 **** caption = current->Attribute("Caption"); ! TiXmlNode* childNode = config->FirstChild("Image"); if (childNode) --- 211,217 ---- caption = current->Attribute("Caption"); ! SetName(caption.c_str()); ! ! TiXmlNode* childNode = config->FirstChild("Image"); if (childNode) Index: tcGraphicsEngine.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcGraphicsEngine.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcGraphicsEngine.cpp 14 Sep 2004 02:01:46 -0000 1.18 --- tcGraphicsEngine.cpp 21 Oct 2004 04:10:59 -0000 1.19 *************** *** 323,326 **** --- 323,327 ---- glDisable(GL_ALPHA_TEST); glDisable(GL_DEPTH_TEST); + glDisable(GL_DEPTH_WRITEMASK); glDisable(GL_DITHER); glDisable(GL_FOG); *************** *** 366,369 **** --- 367,371 ---- glClearColor(0.00f, 0.00f, 0.00f, 0.0f); // Black Background glDisable(GL_DEPTH_TEST); + glDisable(GL_DEPTH_WRITEMASK); glDisable(GL_ALPHA_TEST); glDisable(GL_DITHER); Index: tc3DWindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DWindow.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tc3DWindow.cpp 7 Oct 2004 22:01:45 -0000 1.5 --- tc3DWindow.cpp 21 Oct 2004 04:10:59 -0000 1.6 *************** *** 198,201 **** --- 198,203 ---- transform->setMatrix(osg::Matrix::translate(pos.x, pos.y + yOffset, 0)); + + UpdateBackgroundQuadVertices(); } *************** *** 248,251 **** --- 250,254 ---- (*vertices)[3] = osg::Vec3(mnWidth, mnHeight, 0); backgroundQuad->setVertexArray(vertices); + backgroundQuad->dirtyDisplayList(); } *************** *** 267,274 **** --- 270,279 ---- backgroundQuad->setTexCoordArray(0,texcoords); + /* osg::Vec3Array* normals = new osg::Vec3Array(1); (*normals)[0].set(1.0f, 0.0f, 0.0f); backgroundQuad->setNormalArray(normals); backgroundQuad->setNormalBinding(osg::Geometry::BIND_OVERALL); + */ backgroundQuad->addPrimitiveSet(new osg::DrawArrays(GL_QUADS,0,4)); *************** *** 276,286 **** osg::StateSet* stateSet = backgroundQuad->getOrCreateStateSet(); stateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF); stateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF); stateSet->setRenderBinDetails(baseRenderBin + backgroundRenderBin, "RenderBin"); osg::Depth* depth = new osg::Depth(osg::Depth::ALWAYS, 1, 1, false); depth->setWriteMask(0); stateSet->setAttribute(depth); ! } --- 281,293 ---- osg::StateSet* stateSet = backgroundQuad->getOrCreateStateSet(); stateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF); + stateSet->setMode(GL_DEPTH_WRITEMASK, osg::StateAttribute::OFF); stateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF); stateSet->setRenderBinDetails(baseRenderBin + backgroundRenderBin, "RenderBin"); + /* osg::Depth* depth = new osg::Depth(osg::Depth::ALWAYS, 1, 1, false); depth->setWriteMask(0); stateSet->setAttribute(depth); ! */ } *************** *** 344,348 **** } ! mbActive=abActive; } --- 351,355 ---- } ! mbActive = abActive; } *************** *** 791,796 **** } ! /** --- 798,826 ---- } + /** + * Optimize this later to check for case where geometry is already child + */ + void tc3DWindow::DrawGeometry(osg::Geometry* geometry, float x, float y) + { + osg::MatrixTransform* transform = GetTransformObject(); + transform->setMatrix(osg::Matrix::translate(x, y, 0)); + ! transform->removeChild(0, transform->getNumChildren()); // shouldn't leak with ref ptrs ! ! ! osg::Geode* geode = new osg::Geode; ! geode->addDrawable(geometry); ! ! transform->addChild(geode); ! } ! ! /// workaround method for inverted coordinates ! void tc3DWindow::DrawGeometryR(osg::Geometry* geometry, float x, float y) ! { ! const float h = float(mnHeight); ! ! DrawGeometry(geometry, x, h - y); ! } /** *************** *** 837,841 **** } ! /** --- 867,874 ---- } ! osgText::Font* tc3DWindow::GetDefaultFont() ! { ! return defaultFont.get(); ! } /** *************** *** 913,931 **** osg::Image* tc3DWindow::LoadImage(const char* fileName) { ! /* ! Gdiplus::Image* image; ! std::string path = IMAGE_PATH; ! path += fileName; ! MultiByteToWideChar(CP_ACP, 0, path.c_str(), -1, mzwchar, 255); ! image = new Image(mzwchar,false); ! if (image==NULL) ! { ! std::cerr << "tc3DWindow::LoadImage - " << path << " failed." << std::endl; ! } ! return image; ! */ ! return 0; } --- 946,958 ---- osg::Image* tc3DWindow::LoadImage(const char* fileName) { ! wxString fileWithPath = PrependImagePath(fileName); ! osg::Image* image = osgDB::readImageFile(fileWithPath.c_str()); ! if (!image) ! { ! fprintf(stderr, "Failed to load image: %s\n", fileName); ! } ! return image; } *************** *** 936,947 **** osg::Texture2D* tc3DWindow::LoadTexture(const char* fileName) { ! wxString fileWithPath = PrependImagePath(fileName); ! osg::Image* image = osgDB::readImageFile(fileWithPath.c_str()); ! ! if (!image) ! { ! fprintf(stderr, "Failed to load image: %s\n", fileName); ! return 0; ! } osg::Texture2D* tex = new osg::Texture2D; --- 963,967 ---- osg::Texture2D* tc3DWindow::LoadTexture(const char* fileName) { ! osg::Image* image = LoadImage(fileName); osg::Texture2D* tex = new osg::Texture2D; *************** *** 1036,1039 **** --- 1056,1060 ---- osg::StateSet* stateSet = quad->getOrCreateStateSet(); stateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF); + stateSet->setMode(GL_DEPTH_WRITEMASK, osg::StateAttribute::OFF); stateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF); stateSet->setRenderBinDetails(baseRenderBin + imageRenderBin, "RenderBin"); *************** *** 1092,1098 **** --- 1113,1121 ---- osg::StateSet* stateSet = line->getOrCreateStateSet(); stateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF); + stateSet->setMode(GL_DEPTH_WRITEMASK, osg::StateAttribute::OFF); stateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF); stateSet->setRenderBinDetails(baseRenderBin + lineRenderBin, "RenderBin"); + /* osg::LineWidth* lw = new osg::LineWidth; *************** *** 1169,1172 **** --- 1192,1196 ---- osg::StateSet* stateSet = rect->getOrCreateStateSet(); stateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF); + stateSet->setMode(GL_DEPTH_WRITEMASK, osg::StateAttribute::OFF); stateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF); stateSet->setRenderBinDetails(baseRenderBin + rectRenderBin, "RenderBin"); *************** *** 1217,1220 **** --- 1241,1245 ---- stateSet->setRenderBinDetails(baseRenderBin + textRenderBin, "RenderBin"); stateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF); + stateSet->setMode(GL_DEPTH_WRITEMASK, osg::StateAttribute::OFF); stateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF); *************** *** 1235,1240 **** --- 1260,1314 ---- /** + * + */ + osg::MatrixTransform* tc3DWindow::GetTransformObject() + { + size_t nPool = transformPool.size(); + + if (transformIdx < nPool) + { + osg::MatrixTransform* transform = transformPool[transformIdx++].get(); + wxASSERT(transform); + if (transform->getNumParents() == 0) + { + groupRoot->addChild(transform); + } + return transform; + } + else if (transformIdx == nPool) + { + osg::ref_ptr<osg::MatrixTransform> transform = new osg::MatrixTransform; + + transform->setReferenceFrame(osg::MatrixTransform::RELATIVE_TO_PARENTS); + transform->setDataVariance(osg::Object::DYNAMIC); + + wxASSERT(groupRoot.valid()); + groupRoot->addChild(transform.get()); + + transformPool.push_back(transform); + + return transformPool[transformIdx++].get(); + } + else + { + wxASSERT(0); + fprintf(stderr, "tc3DWindow::GetTransformObject - Corrupt transformIdx\n"); + return 0; + } + } + + + /** + * Newer name for HideUnusedObjects, use this for new code + */ + void tc3DWindow::FinishDraw() + { + HideUnusedObjects(); + } + + /** * removes unused (as of last Draw() call) objects from root scenegraph node * This should be called once at the end of Draw() + * Deprecated, use FinishDraw() */ void tc3DWindow::HideUnusedObjects() *************** *** 1269,1272 **** --- 1343,1353 ---- rectIdx = 0; + // transform pool + for (unsigned idx = transformIdx; idx < transformPool.size(); idx++) + { + groupRoot->removeChild(transformPool[idx].get()); + } + transformIdx = 0; + } *************** *** 1287,1290 **** --- 1368,1374 ---- rectPool.clear(); rectIdx = 0; + + transformPool.clear(); + transformIdx = 0; } *************** *** 1347,1350 **** --- 1431,1442 ---- { baseRenderBin = n; + + backgroundQuad->getOrCreateStateSet()-> + setRenderBinDetails(baseRenderBin + backgroundRenderBin, "RenderBin"); + } + + void tc3DWindow::SetName(const char* s) + { + transform->setName(s); } *************** *** 1372,1376 **** iconSize(32), normalPosition(pos, size), ! baseRenderBin(0), backgroundRenderBin(-1), imageRenderBin(0), --- 1464,1468 ---- iconSize(32), normalPosition(pos, size), ! baseRenderBin(10), backgroundRenderBin(-1), imageRenderBin(0), *************** *** 1400,1407 **** root = new osg::Geode; root->setName(name.c_str()); - //root->setCullingActive(false); - osg::StateSet* stateSet = root->getOrCreateStateSet(); stateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF); //osg::Depth* depth = new osg::Depth(osg::Depth::ALWAYS, 0, 0, false); --- 1492,1507 ---- root = new osg::Geode; root->setName(name.c_str()); osg::StateSet* stateSet = root->getOrCreateStateSet(); stateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF); + stateSet->setMode(GL_DEPTH_WRITEMASK, osg::StateAttribute::OFF); + stateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF); + root->setCullingActive(false); + + groupRoot = new osg::Group; + osg::StateSet* groupStateSet = groupRoot->getOrCreateStateSet(); + groupStateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF); + groupStateSet->setMode(GL_DEPTH_WRITEMASK, osg::StateAttribute::OFF); + groupStateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF); + //osg::Depth* depth = new osg::Depth(osg::Depth::ALWAYS, 0, 0, false); *************** *** 1410,1413 **** --- 1510,1514 ---- switchNode = new osg::Switch; switchNode->addChild(root.get()); + switchNode->addChild(groupRoot.get()); switchNode->setAllChildrenOff(); *************** *** 1431,1434 **** --- 1532,1537 ---- transform->addChild(switchNode.get()); + SetName(name.c_str()); + wxASSERT(viewer); *************** *** 1488,1494 **** #ifdef _DEBUG fprintf(stdout, "Destroying 3D window %s, %d text obj, %d image quad obj" ! ", line obj %d, rect obj %d\n", wxWindow::GetName().c_str(), textPool.size(), imageQuadPool.size(), ! linePool.size(), rectPool.size()); #endif } --- 1591,1597 ---- #ifdef _DEBUG fprintf(stdout, "Destroying 3D window %s, %d text obj, %d image quad obj" ! ", line obj %d, rect obj %d, transform %d\n", wxWindow::GetName().c_str(), textPool.size(), imageQuadPool.size(), ! linePool.size(), rectPool.size(), transformPool.size()); #endif } Index: tc3DViewer.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DViewer.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tc3DViewer.cpp 7 Oct 2004 22:01:45 -0000 1.2 --- tc3DViewer.cpp 21 Oct 2004 04:10:59 -0000 1.3 *************** *** 85,88 **** --- 85,208 ---- END_EVENT_TABLE() + namespace osgUtil + { + + class PrintCullVistor : public osgUtil::CullVisitor + { + public: + /* + virtual void apply(Node& node) + { + CullVisitor::apply((Node&)node); + PrintStatus(node); + } + + virtual void apply(osg::Geode& node) + { + CullVisitor::apply((Geode&)node); + PrintStatus(node); + } + */ + CullVisitor::value_type distance(const osg::Vec3& coord,const osg::Matrix& matrix) + { + + //std::cout << "distance("<<coord<<", "<<matrix<<")"<<std::endl; + + return -((CullVisitor::value_type)coord[0]*(CullVisitor::value_type)matrix(0,2)+(CullVisitor::value_type)coord[1]*(CullVisitor::value_type)matrix(1,2)+(CullVisitor::value_type)coord[2]*(CullVisitor::value_type)matrix(2,2)+matrix(3,2)); + } + + void apply(Geode& node) + { + if (isCulled(node)) return; + + // push the node's state. + StateSet* node_state = node.getStateSet(); + if (node_state) pushStateSet(node_state); + + // traverse any call callbacks and traverse any children. + handle_cull_callbacks_and_traverse(node); + + RefMatrix& matrix = getModelViewMatrix(); + for(unsigned int i=0;i<node.getNumDrawables();++i) + { + Drawable* drawable = node.getDrawable(i); + const BoundingBox &bb =drawable->getBound(); + + if( drawable->getCullCallback() ) + { + if( drawable->getCullCallback()->cull( this, drawable, _state.valid()?_state.get():NULL ) == true ) + continue; + } + + //else + { + if (node.isCullingActive() && isCulled(bb)) continue; + } + + + if (_computeNearFar && bb.valid()) + { + if (!updateCalculatedNearFar(matrix,*drawable,false)) continue; + } + + // push the geoset's state on the geostate stack. + StateSet* stateset = drawable->getStateSet(); + if (stateset) pushStateSet(stateset); + + if (bb.valid()) addDrawableAndDepth(drawable,&matrix, distance(bb.center(),matrix)); + else addDrawableAndDepth(drawable,&matrix,0.0f); + + if (stateset) popStateSet(); + + } + + // pop the node's state off the geostate stack. + if (node_state) popStateSet(); + + PrintStatus(node); + + } + + + /* + virtual void apply(osg::ClipNode& node) + { + fprintf(stdout, "cull visitor: %s, %s\n", node.className(), node.getName().c_str()); + CullVisitor::apply((ClipNode&)node); + } + */ + /* + virtual void apply(osg::Group& node) + { + CullVisitor::apply((Group&)node); + PrintStatus(node); + } + virtual void apply(osg::Transform& node) + { + CullVisitor::apply((Transform&)node); + PrintStatus(node); + } + virtual void apply(osg::Projection& node) + { + CullVisitor::apply((Projection&)node); + PrintStatus(node); + } + virtual void apply(osg::Switch& node) + { + CullVisitor::apply((Switch&)node); + PrintStatus(node); + } + */ + void PrintStatus(osg::Node& node) + { + RenderBin* rb = getCurrentRenderBin(); + int binNum = rb->getBinNum(); + fprintf(stdout, "cull : %s, %s, bin %d (%d)\n", node.className(), node.getName().c_str(), + binNum, isCulled(node)); + } + + }; + } + void tc3DViewer::OnChar(wxKeyEvent& event) *************** *** 277,281 **** void tc3DViewer::SetActive(bool b) { ! if (isActive==b) return; isActive = b; --- 397,401 ---- void tc3DViewer::SetActive(bool b) { ! if (isActive == b) return; isActive = b; *************** *** 923,934 **** /** - * @return pointer to MatrixTransform used to display 2D objects like HUD text - */ - osg::MatrixTransform* tc3DViewer::GetDrawMatrixTransform() - { - return hudObjects.get(); - } - - /** * @return object position in world coordinates. */ --- 1043,1046 ---- *************** *** 1002,1005 **** --- 1114,1122 ---- guiView->setUpdateVisitor(guiUpdateVisitor.get()); + //cullVisitor = new osgUtil::PrintCullVistor(); + cullVisitor = new osgUtil::CullVisitor(); + guiView->setCullVisitor(cullVisitor.get()); + + guiObjects = new osg::MatrixTransform; guiObjects->setMatrix(osg::Matrix::identity()); *************** *** 1070,1073 **** --- 1187,1191 ---- updateVisitor->setFrameStamp(frameStamp.get()); sceneView->setUpdateVisitor(updateVisitor.get()); + } /** *************** *** 1473,1476 **** --- 1591,1605 ---- // doesn't work with OSG 0.9.5, should work with 0.9.6 and beyond osg::setNotifyLevel(osg::NOTICE); + /* + ALWAYS=0, + FATAL=1, + WARN=2, + NOTICE=3, + INFO=4, + DEBUG_INFO=5, + DEBUG_FP=6 + */ + #else + osg::setNotifyLevel(osg::DEBUG_FP); #endif |
|
From: Dewitt C. <ddc...@us...> - 2004-10-21 04:11:16
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9417/src/sim Modified Files: Game.cpp tcDirectorEvent.cpp Log Message: Changes related to GDI+ replacement Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** Game.cpp 7 Oct 2004 22:01:46 -0000 1.99 --- Game.cpp 21 Oct 2004 04:11:00 -0000 1.100 *************** *** 157,160 **** --- 157,163 ---- mnBottomMargin = 200; + enableGraphicsEngine = true; + enableTacticalMap = true; + std::cout << "Game constructor success" << std::endl; } *************** *** 358,361 **** --- 361,365 ---- scenarioSelectView->SetActive(false); + viewer->SetTerrainActive(true); viewer->SetClearMode(2); // depth and color buffer clearing *************** *** 433,437 **** margin += 1; r.x = margin; ! r.y = 0; r.width = mnWidth-margin; r.height = mnHeight-mnBottomMargin-1; --- 437,441 ---- margin += 1; r.x = margin; ! r.y = 2; r.width = mnWidth-margin; r.height = mnHeight-mnBottomMargin-1; *************** *** 624,630 **** wxASSERT(glCanvas); ! smallViewerPosition = wxPoint(mnWidth - 380, 0); smallViewerSize = wxSize(380, 200); - startViewerSize = wxSize(mnWidth/2, mnHeight/2); --- 628,633 ---- wxASSERT(glCanvas); ! smallViewerPosition = wxPoint(mnWidth - 380, 2); smallViewerSize = wxSize(380, 200); startViewerSize = wxSize(mnWidth/2, mnHeight/2); *************** *** 720,723 **** --- 723,729 ---- briefingConsoleLeft = new tcSoundConsole(glCanvas, wxPoint(0,0), wxSize(mnBriefingWidth, leftConsoleHeight), "xml/briefing_left.xml") ; + briefingConsoleLeft->SetBaseRenderBin(10); + + if (!briefingConsoleLeft) { *************** *** 739,742 **** --- 745,750 ---- briefingConsoleBottom = new tcSoundConsole(glCanvas, wxPoint(0, mnHeight-mnBottomMargin), wxSize(mnWidth, mnBottomMargin), "xml/briefing_bottom.xml"); + briefingConsoleBottom->SetBaseRenderBin(10); + if (!briefingConsoleBottom) { *************** *** 830,833 **** --- 838,843 ---- tacticalMap = new tcTacticalMapView(glCanvas, wxPoint(mrectMap.left,mrectMap.top), wxSize(mrectMap.right-mrectMap.left, mrectMap.bottom-mrectMap.top)); + tacticalMap->SetBaseRenderBin(10); + tacticalMapSize = TM_LARGE; *************** *** 846,849 **** --- 856,860 ---- tacticalMap->SetBlend(true); tacticalMap->RefreshTerrainView(); + } *************** *** 857,860 **** --- 868,872 ---- wxSize(mrectWorldMap.right - mrectWorldMap.left - 1, mrectWorldMap.bottom - mrectWorldMap.top - 1)); + worldMap->SetBaseRenderBin(20); if (!worldMap) *************** *** 1457,1460 **** --- 1469,1473 ---- bool drawEdgeWindows = (size3D != MODE3D_FULL) || (!mb3DActive); bool drawTacticalMap = (size3D == MODE3D_SMALL) || (!mb3DActive); + if (meScreenMode == TACTICAL) { *************** *** 1523,1539 **** 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(); } --- 1536,1560 ---- 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(); } *************** *** 1764,1768 **** if ((directorTime > 0.1f) && doRender) { ! mpGraphicsEngine->RenderAll(); viewer->Frame(); --- 1785,1789 ---- if ((directorTime > 0.1f) && doRender) { ! if (enableGraphicsEngine) mpGraphicsEngine->RenderAll(); viewer->Frame(); *************** *** 2051,2054 **** --- 2072,2081 ---- if (chatBox->mbActive) chatBox->MoveToTop(); return; + case 'g': + enableGraphicsEngine = !enableGraphicsEngine; + return; + case 'm': + enableTacticalMap = !enableTacticalMap; + return; case 'w': // toggle world map size if (worldMap) Index: tcDirectorEvent.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcDirectorEvent.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcDirectorEvent.cpp 7 Oct 2004 22:01:47 -0000 1.10 --- tcDirectorEvent.cpp 21 Oct 2004 04:11:00 -0000 1.11 *************** *** 131,137 **** alpha = 1.0; } ! int nAlpha = (int)(255 * alpha); ! UINT32 currentColor = mapObject->GetColor(); ! mapObject->SetColor((currentColor & 0x00FFFFFF) + (nAlpha << 24)); } } --- 131,138 ---- alpha = 1.0; } ! ! osg::Vec4 currentColor = mapObject->GetColor(); ! currentColor._v[3] = alpha; ! mapObject->SetColor(currentColor); } } |
|
From: Dewitt C. <ddc...@us...> - 2004-10-21 04:11:16
|
Update of /cvsroot/gcblue/gcb_wx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9417 Modified Files: GCblue.vcproj Log Message: Changes related to GDI+ replacement Index: GCblue.vcproj =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/GCblue.vcproj,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** GCblue.vcproj 7 Oct 2004 22:01:38 -0000 1.69 --- GCblue.vcproj 21 Oct 2004 04:10:58 -0000 1.70 *************** *** 145,151 **** Name="src" Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"> - <File - RelativePath="src\stdwx.cpp"> - </File> <Filter Name="common" --- 145,148 ---- *************** *** 173,176 **** --- 170,176 ---- </File> <File + RelativePath="src\stdwx.cpp"> + </File> + <File RelativePath="src\common\tcConsole.cpp"> </File> |
|
From: Dewitt C. <ddc...@us...> - 2004-10-16 14:57:17
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25900/include/graphics Modified Files: tcMapView.h Log Message: Changes related to GDI+ replacement Index: tcMapView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMapView.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcMapView.h 2 Oct 2004 22:41:32 -0000 1.1 --- tcMapView.h 16 Oct 2004 14:57:08 -0000 1.2 *************** *** 1,6 **** ! /* ! ** tcMapView.h ! ** ! ** Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** ! ** @file tcMapView.h ! */ ! /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 277,281 **** void ClearMapCmd() {meMapCmd = MC_NONE;} ! int Draw(void); void DrawGrid(Gdiplus::Graphics *apGraphics); void DrawScaleBar(Gdiplus::Graphics *apGraphics); --- 277,281 ---- void ClearMapCmd() {meMapCmd = MC_NONE;} ! int Draw(); void DrawGrid(Gdiplus::Graphics *apGraphics); void DrawScaleBar(Gdiplus::Graphics *apGraphics); *************** *** 306,311 **** void ActivateCmd(teMapCmdType aeCmd) {mbMapCmdActive=true; meMapCmd=aeCmd;} void DeactivateCmd() {mbMapCmdActive=false; meMapCmd=MC_NONE;} ! void ClearMapObjects(void); ! void Init(void); void SetDateTime(std::string s) {dateTime = s;} void SetHookID(long id); --- 306,311 ---- void ActivateCmd(teMapCmdType aeCmd) {mbMapCmdActive=true; meMapCmd=aeCmd;} void DeactivateCmd() {mbMapCmdActive=false; meMapCmd=MC_NONE;} ! void ClearMapObjects(); ! void Init(); void SetDateTime(std::string s) {dateTime = s;} void SetHookID(long id); |
|
From: Dewitt C. <ddc...@us...> - 2004-10-07 22:03:11
|
Update of /cvsroot/gcblue/gcb_wx/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12758/xml Added Files: briefing_bottom.xml briefing_left.xml info_console.xml options_nosound.txt Log Message: Changes related to GDI+ replacement --- NEW FILE: options_nosound.txt --- <Options> <HostAddress>192.168.0.102</HostAddress> <DisplaySettings></DisplaySettings> <DisableSound>Yes</DisableSound> </Options> --- NEW FILE: briefing_bottom.xml --- <Window> <TextBox TopMargin="30" BottomMargin="50"/> </Window> --- NEW FILE: info_console.xml --- <Window> <TextBox TopMargin="2" BottomMargin="2" Wrap="70" DrawBorder="0"/> </Window> --- NEW FILE: briefing_left.xml --- <Window> <TextBox TopMargin="30" BottomMargin="50" Wrap="60"/> </Window> |
|
From: Dewitt C. <ddc...@us...> - 2004-10-07 22:02:29
|
Update of /cvsroot/gcblue/gcb_wx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12439 Modified Files: GCblue.vcproj Log Message: Changes related to GDI+ replacement Index: GCblue.vcproj =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/GCblue.vcproj,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** GCblue.vcproj 2 Oct 2004 22:41:31 -0000 1.68 --- GCblue.vcproj 7 Oct 2004 22:01:38 -0000 1.69 *************** *** 261,267 **** </File> <File - RelativePath="src\graphics\tcButtonConsole.cpp"> - </File> - <File RelativePath=".\src\graphics\tcChatBox.cpp"> </File> --- 261,264 ---- *************** *** 1116,1122 **** </File> <File - RelativePath="include\graphics\tcButtonConsole.h"> - </File> - <File RelativePath=".\include\graphics\tcChatBox.h"> </File> --- 1113,1116 ---- |
|
From: Dewitt C. <ddc...@us...> - 2004-10-07 22:02:03
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12439/src/graphics Modified Files: tc3DViewer.cpp tc3DWindow.cpp tcButton.cpp tcConsoleBox.cpp tcEditBox.cpp tcHookInfo.cpp tcOOBView.cpp tcParticleEffect.cpp tcRadioButton.cpp tcXmlWindow.cpp Log Message: Changes related to GDI+ replacement Index: tcXmlWindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcXmlWindow.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcXmlWindow.cpp 2 Oct 2004 22:41:33 -0000 1.2 --- tcXmlWindow.cpp 7 Oct 2004 22:01:46 -0000 1.3 *************** *** 125,128 **** --- 125,130 ---- config = NULL; std::cerr << "Error loading XML file " << configFile.c_str() << std::endl; + wxString s = wxString::Format("Missing xml file %s", configFile.c_str()); + wxMessageBox(s, "Error", wxICON_ERROR); } } Index: tcConsoleBox.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcConsoleBox.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcConsoleBox.cpp 2 Oct 2004 22:41:33 -0000 1.7 --- tcConsoleBox.cpp 7 Oct 2004 22:01:46 -0000 1.8 *************** *** 30,33 **** --- 30,40 ---- + void tcConsoleBox::OnSize(wxSizeEvent& event) + { + wxSize s = event.GetSize(); + nyzero = s.GetHeight() - 20; + + tc3DWindow::OnSize(event); + } /** *************** *** 98,101 **** --- 105,119 ---- /** + * Clears the text buffer + */ + void tcConsoleBox::Clear() + { + textArray.Clear(); + cursorLine = 0; + cursorCol = 0; + mbRedraw = true; + } + + /** * */ *************** *** 108,112 **** ! DrawRectangleR(0, 0, mnWidth, mnHeight, osg::Vec4(1, 1, 1, 1)); size_t nLines = textArray.GetCount(); // number of lines in textArray buffer --- 126,130 ---- ! // DrawRectangleR(0, 0, mnWidth, mnHeight, osg::Vec4(1, 1, 1, 1)); size_t nLines = textArray.GetCount(); // number of lines in textArray buffer *************** *** 134,138 **** } ! //DrawBorder(); mbForceRedraw = false; --- 152,159 ---- } ! if (drawBorder) ! { ! DrawBorder(); ! } mbForceRedraw = false; *************** *** 146,152 **** if (!config) { ! std::cerr << "Error - bad xml config file for Console Box" << std::endl; ! fontSize = 9.0f; fontColor.set(0.392f, 1.0f, 0.392f, 1.0f); return; } --- 167,174 ---- if (!config) { ! std::cout << "Using default xml config for ConsoleBox" << std::endl; ! fontSize = 10.0f; fontColor.set(0.392f, 1.0f, 0.392f, 1.0f); + nyzero = mnHeight - 20; return; } *************** *** 161,168 **** // read window dimensions from XML int x; ! int y; int width; int height; int wrap = 50; current->Attribute("X", &x); --- 183,191 ---- // read window dimensions from XML int x; ! int y; int width; int height; int wrap = 50; + int borderState; current->Attribute("X", &x); *************** *** 171,185 **** current->Attribute("Height", &height); current->Attribute("Wrap", &wrap); SetSize(x, y, width, height); // set all size params - nyzero = height - 20; if (wrap < 10) wrap = 50; SetWrap(wrap); double xmlFontSize; current->Attribute("FontSize", &xmlFontSize); fontSize = xmlFontSize; ! fontColor.set(0.392f, 1, 0.392f, 1); } --- 194,213 ---- current->Attribute("Height", &height); current->Attribute("Wrap", &wrap); + current->Attribute("DrawBorder", &borderState); + + if (width == 0) width = mnWidth; + if (height == 0) height = mnHeight; SetSize(x, y, width, height); // set all size params if (wrap < 10) wrap = 50; SetWrap(wrap); + drawBorder = borderState != 0; + double xmlFontSize; current->Attribute("FontSize", &xmlFontSize); fontSize = xmlFontSize; ! if (fontSize == 0) fontSize = 10.0f; fontColor.set(0.392f, 1, 0.392f, 1); } *************** *** 262,266 **** */ tcConsoleBox::tcConsoleBox(tc3DWindow *parent, TiXmlNode *config) ! : tc3DWindow(parent, wxPoint(0,0), wxSize(10,10), "XMLConsoleBox"), cursorLine(0), cursorCol(0), --- 290,294 ---- */ tcConsoleBox::tcConsoleBox(tc3DWindow *parent, TiXmlNode *config) ! : tc3DWindow(parent, parent->GetPosition(), parent->GetSize(), "XMLConsoleBox", parent), cursorLine(0), cursorCol(0), *************** *** 271,280 **** nlinespace(15), isMouseOver(false), ! isFocused(false) { ! nyzero = mnHeight - 20; ! ! ! InitFromXml(config); } --- 299,306 ---- nlinespace(15), isMouseOver(false), ! isFocused(false), ! drawBorder(true) { ! InitFromXml(config); } Index: tcOOBView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcOOBView.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcOOBView.cpp 2 Oct 2004 22:41:33 -0000 1.1 --- tcOOBView.cpp 7 Oct 2004 22:01:46 -0000 1.2 *************** *** 25,31 **** #ifndef WX_PRECOMP #include "wx/wx.h" - #ifdef WIN32 - #include "wx/msw/private.h" // for MS Windows specific definitions - #endif #endif --- 25,28 ---- *************** *** 35,39 **** #include "tcSound.h" - using namespace Gdiplus; using namespace MapView; --- 32,35 ---- *************** *** 64,80 **** void tcOOBView::Update() { - Graphics *pGraphics; UpdateData(); UpdateFormation(); UpdateRect(); - if (!GetGraphics(pGraphics)) - { - WTL("Failed to get Graphics in tcOOBView::Update()\n"); - return; - } - PlaceIcons(pGraphics); - ReleaseGraphics(pGraphics); } --- 60,70 ---- void tcOOBView::Update() { UpdateData(); UpdateFormation(); UpdateRect(); + + PlaceIcons(); } *************** *** 143,146 **** --- 133,137 ---- void tcOOBView::UpdateFormation() { + #if 0 wxASSERT(mpSimState); *************** *** 184,187 **** --- 175,179 ---- } msFormationChangeInfo.mbApply = false; // always clear formation change + #endif } *************** *** 207,210 **** --- 199,203 ---- float& y, float stopy) { + #if 0 float x = mfXOffset; *************** *** 257,279 **** } } } ! int tcOOBView::Draw() { ! Graphics* graphics; ! float stopy = (float)mnHeight - mfRowSpacing; static int nFrameCount = 0; //if ((nFrameCount++ % 4)!=0) {return 1;} // draw every fourth call ! ! if (!GetGraphics(graphics)) ! { ! WTL("Failed to get Graphics in tcOOBView::Draw()\n"); ! return false; ! } if (IsBackgroundLoaded()) { ! DrawBackground(graphics); } else --- 250,267 ---- } } + #endif } ! void tcOOBView::Draw() { ! #if 0 float stopy = (float)mnHeight - mfRowSpacing; static int nFrameCount = 0; //if ((nFrameCount++ % 4)!=0) {return 1;} // draw every fourth call ! if (IsBackgroundLoaded()) { ! DrawBackground(); } else *************** *** 315,326 **** ReleaseGraphics(graphics); ! DrawBorder(); return 1; } ! void tcOOBView::DrawCategory(Gdiplus::Graphics* graphics, ! std::vector<tsOOBInfo>& objInfo, float stopy) { ! mpBrush->SetColor(Color(254,100,255,100)); --- 303,318 ---- ReleaseGraphics(graphics); ! return 1; + #endif + DrawBorder(); + + HideUnusedObjects(); + } ! void tcOOBView::DrawCategory(std::vector<tsOOBInfo>& objInfo, float stopy) { ! #if 0 mpBrush->SetColor(Color(254,100,255,100)); *************** *** 355,358 **** --- 347,351 ---- } } + #endif } *************** *** 363,369 **** float tcOOBView::GetCategoryY(std::vector<tsOOBInfo>& objInfo) { if (objInfo.size()) { ! return objInfo[0].rectf.Y; } else --- 356,363 ---- float tcOOBView::GetCategoryY(std::vector<tsOOBInfo>& objInfo) { + if (objInfo.size()) { ! return objInfo[0].rectf.bottom; } else *************** *** 371,374 **** --- 365,369 ---- return 0; } + } *************** *** 376,389 **** * updates location of icon rectangles within each OOBInfo item */ ! void tcOOBView::PlaceIcons(Graphics *apGraphics) { ! PlaceIconsCategory(apGraphics, surfaceObj); ! PlaceIconsCategory(apGraphics, airObj); ! PlaceIconsCategory(apGraphics, flightopsObj); } ! void tcOOBView::PlaceIconsCategory(Gdiplus::Graphics* graphics, ! std::vector<tsOOBInfo>& objInfo) { SizeF stringsize; --- 371,384 ---- * updates location of icon rectangles within each OOBInfo item */ ! void tcOOBView::PlaceIcons() { ! PlaceIconsCategory(surfaceObj); ! PlaceIconsCategory(airObj); ! PlaceIconsCategory(flightopsObj); } ! void tcOOBView::PlaceIconsCategory(std::vector<tsOOBInfo>& objInfo) { + #if 0 SizeF stringsize; *************** *** 407,410 **** --- 402,406 ---- info.raction.Inflate(-2.0f,-2.0f); } + #endif } *************** *** 415,419 **** if (tsOOBInfo* info = ! ButtonContainingPoint(PointF((float)point.x,(float)point.y))) { long new_key = info->mnID; --- 411,415 ---- if (tsOOBInfo* info = ! ButtonContainingPoint(wxRealPoint((float)point.x,(float)point.y))) { long new_key = info->mnID; *************** *** 441,445 **** if (tsOOBInfo* info = ! ButtonContainingPoint(PointF((float)point.x,(float)point.y))) { if (info->mnID != mnSelectedKey) --- 437,441 ---- if (tsOOBInfo* info = ! ButtonContainingPoint(wxRealPoint((float)point.x,(float)point.y))) { if (info->mnID != mnSelectedKey) *************** *** 454,458 **** } ! tsOOBInfo* tcOOBView::ButtonContainingPoint(PointF pointf) { tsOOBInfo* info = 0; --- 450,454 ---- } ! tsOOBInfo* tcOOBView::ButtonContainingPoint(wxRealPoint pointf) { tsOOBInfo* info = 0; *************** *** 474,480 **** } ! tsOOBInfo* tcOOBView::ButtonContainingPointCategory(Gdiplus::PointF pointf, std::vector<tsOOBInfo>& objInfo) { for (size_t n = 0; n < objInfo.size(); n++) { --- 470,477 ---- } ! tsOOBInfo* tcOOBView::ButtonContainingPointCategory(wxRealPoint pointf, std::vector<tsOOBInfo>& objInfo) { + #if 0 for (size_t n = 0; n < objInfo.size(); n++) { *************** *** 485,490 **** } } ! return 0; } --- 482,488 ---- } } ! #endif return 0; + } *************** *** 493,497 **** const wxPoint& pos, const wxSize& size, const wxString& name) : ! tcWindow(parent, pos, size, name) , mpMapView(0), mnAlliance(0), --- 491,495 ---- const wxPoint& pos, const wxSize& size, const wxString& name) : ! tc3DWindow(parent, pos, size, name) , mpMapView(0), mnAlliance(0), *************** *** 504,508 **** { mpSimState = tcSimState::Get(); ! mpPen = new Pen(Color(0xFEFFFFFF),2); if (mpPen == NULL) {WTL("tcOOBView - mpPen creation failed\n");} --- 502,506 ---- { mpSimState = tcSimState::Get(); ! /* mpPen = new Pen(Color(0xFEFFFFFF),2); if (mpPen == NULL) {WTL("tcOOBView - mpPen creation failed\n");} *************** *** 514,517 **** --- 512,516 ---- mpBrush = new SolidBrush(Color(0xFEFFFFFF)); // color is ARGB if (mpBrush == NULL) {WTL("tcOOBView - mpBrush creation failed\n");} + */ } *************** *** 519,524 **** --- 518,525 ---- tcOOBView::~tcOOBView() { + /* if (mpPen != NULL) {delete mpPen;} if (mpFont != NULL) {delete mpFont;} if (mpBrush != NULL) {delete mpBrush;} + */ } \ No newline at end of file Index: tcRadioButton.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcRadioButton.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcRadioButton.cpp 2 Oct 2004 22:41:33 -0000 1.6 --- tcRadioButton.cpp 7 Oct 2004 22:01:46 -0000 1.7 *************** *** 138,142 **** */ tcRadioButton::tcRadioButton(tc3DWindow *parent, TiXmlNode *config) ! : tc3DWindow(parent, wxPoint(0,0), wxSize(10,10), "XMLButton"), caption("NULL"), command(-1), --- 138,142 ---- */ tcRadioButton::tcRadioButton(tc3DWindow *parent, TiXmlNode *config) ! : tc3DWindow(parent, wxPoint(0,0), wxSize(10,10), "XMLButton", parent), caption("NULL"), command(-1), Index: tcHookInfo.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcHookInfo.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcHookInfo.cpp 2 Oct 2004 22:41:33 -0000 1.1 --- tcHookInfo.cpp 7 Oct 2004 22:01:46 -0000 1.2 *************** *** 1,4 **** ! /* ! ** Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** ! ** @file tcHookInfo.cpp ! */ ! /* Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 35,39 **** #include "simmath.h" ! using namespace Gdiplus; void tcHookInfo::OnLButtonDown(wxMouseEvent& event) --- 37,41 ---- #include "simmath.h" ! void tcHookInfo::OnLButtonDown(wxMouseEvent& event) *************** *** 46,51 **** */ // This method needs to be broken up ! void tcHookInfo::DrawTrack(Gdiplus::Graphics *apGraphics, tnPoolIndex anID) { tcSensorMapTrack *pSMTrack; std::string s; --- 48,54 ---- */ // This method needs to be broken up ! void tcHookInfo::DrawTrack(tnPoolIndex anID) { + #if 0 tcSensorMapTrack *pSMTrack; std::string s; *************** *** 133,137 **** //*********** draw engagement info ************** DrawTrackEngaged(apGraphics, pSMTrack, ftextx, ftexty); ! } --- 136,140 ---- //*********** draw engagement info ************** DrawTrackEngaged(apGraphics, pSMTrack, ftextx, ftexty); ! #endif } *************** *** 144,150 **** * drawing methods can draw underneath. */ ! void tcHookInfo::DrawTrackEngaged(Gdiplus::Graphics *graphics, const Sensor::tcSensorMapTrack *smtrack, float& x, float& y) { char zBuff[128]; SizeF textSize; --- 147,154 ---- * drawing methods can draw underneath. */ ! void tcHookInfo::DrawTrackEngaged( const Sensor::tcSensorMapTrack *smtrack, float& x, float& y) { + #if 0 char zBuff[128]; SizeF textSize; *************** *** 221,229 **** y += textSize.Height + 2.0f; } ! } ! void tcHookInfo::DrawOwn(Gdiplus::Graphics *apGraphics, tcGameObject *pHookedObj) { std::string s; char zBuff[128]; --- 225,234 ---- y += textSize.Height + 2.0f; } ! #endif } ! void tcHookInfo::DrawOwn(tcGameObject *pHookedObj) { + #if 0 std::string s; char zBuff[128]; *************** *** 309,317 **** ftexty+=15; } ! } ! int tcHookInfo::Draw(void) { static int nFrameCount = 0; tcGameObject *pHookedObj; --- 314,323 ---- ftexty+=15; } ! #endif } ! void tcHookInfo::Draw() { + #if 0 static int nFrameCount = 0; tcGameObject *pHookedObj; *************** *** 347,355 **** ReleaseGraphics(pGraphics); ! DrawBorder(); //SetOpaque(); ! return 1; } --- 353,363 ---- ReleaseGraphics(pGraphics); ! //SetOpaque(); ! #endif ! DrawBorder(); + HideUnusedObjects(); } *************** *** 495,499 **** const wxPoint& pos, const wxSize& size, const wxString& name) : ! tcWindow(parent, pos, size, name) { mnHookID = NULL_INDEX; --- 503,507 ---- const wxPoint& pos, const wxSize& size, const wxString& name) : ! tc3DWindow(parent, pos, size, name) { mnHookID = NULL_INDEX; *************** *** 503,506 **** --- 511,515 ---- drawEngagedMode = 1; + /* mpPen = new Pen(Color(0xFEFFFFFF),2); if (mpPen == NULL) {throw "tcHookInfo - mpPen creation failed\n";} *************** *** 515,518 **** --- 524,528 ---- mpBrush = new SolidBrush(Color(0xFEFFFFFF)); // color is ARGB if (mpBrush == NULL) {throw "tcHookInfo - mpBrush creation failed\n";} + */ } *************** *** 520,526 **** --- 530,538 ---- tcHookInfo::~tcHookInfo() { + /* if (mpPen != NULL) {delete mpPen;} if (mpFont != NULL) {delete mpFont;} if (mpFontLarge != NULL) {delete mpFontLarge;} if (mpBrush != NULL) {delete mpBrush;} + */ } Index: tcButton.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcButton.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcButton.cpp 2 Oct 2004 22:41:33 -0000 1.11 --- tcButton.cpp 7 Oct 2004 22:01:46 -0000 1.12 *************** *** 177,181 **** */ tcButton::tcButton(tc3DWindow *parent, TiXmlNode *config) ! : tc3DWindow(parent, wxPoint(0,0), wxSize(10,10), "XMLButton") { caption = "NULL"; --- 177,181 ---- */ tcButton::tcButton(tc3DWindow *parent, TiXmlNode *config) ! : tc3DWindow(parent, wxPoint(0,0), wxSize(10,10), "XMLButton", parent) { caption = "NULL"; *************** *** 236,240 **** tcButton::tcButton(tc3DWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& name) ! : tc3DWindow(parent, pos, size, name) { --- 236,240 ---- tcButton::tcButton(tc3DWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& name) ! : tc3DWindow(parent, pos, size, name, parent) { Index: tcParticleEffect.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcParticleEffect.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcParticleEffect.cpp 1 Sep 2004 02:55:36 -0000 1.2 --- tcParticleEffect.cpp 7 Oct 2004 22:01:46 -0000 1.3 *************** *** 130,135 **** if (root) { ! std::cerr << "Warning - tcParticleEffect already added to scene graph, " ! "detaching first\n"; DetachFromSceneGraph(); } --- 130,135 ---- if (root) { ! fprintf(stderr, "Warning - tcParticleEffect already added to scene graph, " ! "detaching first\n"); DetachFromSceneGraph(); } *************** *** 239,244 **** if (!root) { ! std::cerr << "Warning - tcParticleEffect already removed from scene graph," ! "skipping\n"; return; } --- 239,244 ---- if (!root) { ! fprintf(stderr, "Warning - tcParticleEffect already removed from scene graph," ! "skipping\n"); return; } Index: tc3DWindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DWindow.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tc3DWindow.cpp 2 Oct 2004 22:41:33 -0000 1.4 --- tc3DWindow.cpp 7 Oct 2004 22:01:45 -0000 1.5 *************** *** 277,281 **** stateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF); stateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF); ! stateSet->setRenderBinDetails(baseRenderBin - 10, "RenderBin"); osg::Depth* depth = new osg::Depth(osg::Depth::ALWAYS, 1, 1, false); --- 277,281 ---- stateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF); stateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF); ! stateSet->setRenderBinDetails(baseRenderBin + backgroundRenderBin, "RenderBin"); osg::Depth* depth = new osg::Depth(osg::Depth::ALWAYS, 1, 1, false); *************** *** 1217,1220 **** --- 1217,1221 ---- stateSet->setRenderBinDetails(baseRenderBin + textRenderBin, "RenderBin"); stateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF); + stateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF); wxASSERT(root.valid()); *************** *** 1239,1244 **** void tc3DWindow::HideUnusedObjects() { - LogStatus(); - // text pool for (unsigned idx = textIdx; idx < textPool.size(); idx++) --- 1240,1243 ---- *************** *** 1368,1372 **** */ tc3DWindow::tc3DWindow(wxWindow *parent, const wxPoint& pos, const wxSize& size, ! const wxString& name) : wxWindow(parent, -1, pos, size, wxTRANSPARENT_WINDOW | wxNO_FULL_REPAINT_ON_RESIZE, name), //| wxNO_FULL_REPAINT_ON_RESIZE |wxCLIP_CHILDREN mnHeight(size.GetHeight()), mnWidth(size.GetWidth()), --- 1367,1371 ---- */ tc3DWindow::tc3DWindow(wxWindow *parent, const wxPoint& pos, const wxSize& size, ! const wxString& name, tc3DWindow* graphicsHost) : wxWindow(parent, -1, pos, size, wxTRANSPARENT_WINDOW | wxNO_FULL_REPAINT_ON_RESIZE, name), //| wxNO_FULL_REPAINT_ON_RESIZE |wxCLIP_CHILDREN mnHeight(size.GetHeight()), mnWidth(size.GetWidth()), *************** *** 1376,1380 **** backgroundRenderBin(-1), imageRenderBin(0), ! lineRenderBin(1), rectRenderBin(1), textRenderBin(2) --- 1375,1379 ---- backgroundRenderBin(-1), imageRenderBin(0), ! lineRenderBin(1), // using 1 causes dropouts at some 3D viewer window sizes!? rectRenderBin(1), textRenderBin(2) *************** *** 1394,1398 **** { wxSize parentSize = parent->GetSize(); ! yOffset = parentSize.GetHeight() - mnHeight; } --- 1393,1397 ---- { wxSize parentSize = parent->GetSize(); ! yOffset = parentSize.GetHeight() - mnHeight - 2*pos.y; } *************** *** 1415,1421 **** /* kind of a hack here to handle both top-level window case ** and child of window case */ ! if (tc3DWindow* parentWindow = dynamic_cast<tc3DWindow*>(parent)) { ! transform = parentWindow->CreateDrawTransform(); transform->setMatrix(osg::Matrix::translate(pos.x, pos.y + yOffset, 0)); transform->setReferenceFrame(osg::MatrixTransform::RELATIVE_TO_PARENTS); --- 1414,1420 ---- /* kind of a hack here to handle both top-level window case ** and child of window case */ ! if (graphicsHost) { ! transform = graphicsHost->CreateDrawTransform(); transform->setMatrix(osg::Matrix::translate(pos.x, pos.y + yOffset, 0)); transform->setReferenceFrame(osg::MatrixTransform::RELATIVE_TO_PARENTS); *************** *** 1451,1457 **** resizeable2DSurface = false; yMirror = 0; ! if (tc3DWindow* parent3D = dynamic_cast<tc3DWindow*>(parent)) { ! parent3D->AddChild(this); // adds this to parent's list of children to draw } --- 1450,1456 ---- resizeable2DSurface = false; yMirror = 0; ! if (graphicsHost) { ! graphicsHost->AddChild(this); // adds this to parent's list of children to draw } Index: tcEditBox.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcEditBox.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcEditBox.cpp 2 Oct 2004 22:41:33 -0000 1.7 --- tcEditBox.cpp 7 Oct 2004 22:01:46 -0000 1.8 *************** *** 205,209 **** tcEditBox::tcEditBox(tc3DWindow *parent, TiXmlNode *config) ! : tc3DWindow(parent, wxPoint(0,0), wxSize(10,10), "XMLEditBox"), isMouseOver(false), isFocused(false), --- 205,209 ---- tcEditBox::tcEditBox(tc3DWindow *parent, TiXmlNode *config) ! : tc3DWindow(parent, wxPoint(0,0), wxSize(10,10), "XMLEditBox", parent), isMouseOver(false), isFocused(false), Index: tc3DViewer.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DViewer.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tc3DViewer.cpp 2 Oct 2004 22:41:33 -0000 1.1 --- tc3DViewer.cpp 7 Oct 2004 22:01:45 -0000 1.2 *************** *** 227,232 **** wxSize parentSize = parent->GetSize(); int parentHeight = parentSize.GetHeight(); int correctedY = parentHeight - (pos.y + size.GetHeight()); ! sceneView->setViewport(pos.x,correctedY,size.GetWidth(),size.GetHeight()); mnWidth = size.GetWidth(); --- 227,234 ---- wxSize parentSize = parent->GetSize(); int parentHeight = parentSize.GetHeight(); + + int correctedY = parentHeight - (pos.y + size.GetHeight()); ! sceneView->setViewport(pos.x,correctedY, size.GetWidth(),size.GetHeight()); mnWidth = size.GetWidth(); *************** *** 557,561 **** osg::MatrixTransform* transform = new osg::MatrixTransform(); ! orthoProjection->addChild(transform); return transform; --- 559,564 ---- osg::MatrixTransform* transform = new osg::MatrixTransform(); ! //orthoProjection->addChild(transform); ! guiObjects->addChild(transform); return transform; *************** *** 705,708 **** --- 708,712 ---- { wxASSERT(sceneView.valid()); + wxASSERT(guiView.valid()); if (isFrozen && isActive) *************** *** 711,714 **** --- 715,723 ---- isFrozen = false; } + + guiView->update(); + guiView->cull(); + guiView->draw(); + if (isActive && sceneView.valid()) { *************** *** 716,719 **** --- 725,729 ---- sceneView->cull(); sceneView->draw(); + glFinish(); Swap(); *************** *** 721,724 **** --- 731,735 ---- else { + glFinish(); Swap(); } *************** *** 949,952 **** --- 960,1013 ---- } + /** + * + */ + void tc3DViewer::InitGuiView() + { + guiView = new osgUtil::SceneView(); + + wxASSERT(guiView->getDisplaySettings()==NULL); + displaySettings = new osg::DisplaySettings; + displaySettings->setDepthBuffer(false); + + guiView->setDisplaySettings(displaySettings.get()); + guiView->setDefaults(); + guiView->getState()->setContextID(1); + + wxWindow* parent = wxWindow::GetParent(); + wxSize parentSize = parent->GetSize(); + + guiView->setProjectionMatrixAsOrtho2D(0, parentSize.GetWidth(), + 0, parentSize.GetHeight()); + + + guiView->setViewport(0, 0, parentSize.GetWidth(), parentSize.GetHeight()); + guiView->setComputeNearFarMode(osgUtil::CullVisitor::DO_NOT_COMPUTE_NEAR_FAR); + guiView->setLightingMode(osgUtil::SceneView::NO_SCENEVIEW_LIGHT); + guiView->setClearColor(osg::Vec4(0, 0, 0.4f, 1.0f)); + + + guiView->setCullingMode(osg::CullStack::NO_CULLING); + + // set up the clear mask. + osgUtil::RenderStage *stage = guiView->getRenderStage(); + stage->setClearMask(0); + + guiFrameStamp = new osg::FrameStamp; + guiFrameStamp->setReferenceTime(gameTime); + guiView->setFrameStamp(guiFrameStamp.get()); + + guiUpdateVisitor = new osgUtil::UpdateVisitor(); + guiUpdateVisitor->setFrameStamp(guiFrameStamp.get()); + guiView->setUpdateVisitor(guiUpdateVisitor.get()); + + guiObjects = new osg::MatrixTransform; + guiObjects->setMatrix(osg::Matrix::identity()); + guiObjects->setReferenceFrame(osg::MatrixTransform::RELATIVE_TO_ABSOLUTE); + + guiView->setSceneData(guiObjects.get()); + + } + void tc3DViewer::InitSceneView(wxPoint pos, wxSize size) { *************** *** 956,966 **** wxASSERT(sceneView->getDisplaySettings()==NULL); displaySettings = new osg::DisplaySettings; // displaySettings->setRGB(true); //displaySettings->setDoubleBuffer(true); - displaySettings->setDepthBuffer(true); //displaySettings->setMinimumNumAlphaBits(4); sceneView->setDisplaySettings(displaySettings.get()); sceneView->setDefaults(); wxWindow *parent = wxWindow::GetParent(); --- 1017,1029 ---- wxASSERT(sceneView->getDisplaySettings()==NULL); displaySettings = new osg::DisplaySettings; + displaySettings->setDepthBuffer(true); + // displaySettings->setRGB(true); //displaySettings->setDoubleBuffer(true); //displaySettings->setMinimumNumAlphaBits(4); sceneView->setDisplaySettings(displaySettings.get()); sceneView->setDefaults(); + sceneView->getState()->setContextID(0); wxWindow *parent = wxWindow::GetParent(); *************** *** 974,978 **** sceneView->setComputeNearFarMode(osgUtil::CullVisitor::DO_NOT_COMPUTE_NEAR_FAR); sceneView->setLightingMode(osgUtil::SceneView::NO_SCENEVIEW_LIGHT); ! sceneView->setBackgroundColor(osg::Vec4(0, 0, 0, 1.0f)); //sceneView->setComputeNearFarMode(osgUtil::CullVisitor::COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES); --- 1037,1041 ---- sceneView->setComputeNearFarMode(osgUtil::CullVisitor::DO_NOT_COMPUTE_NEAR_FAR); sceneView->setLightingMode(osgUtil::SceneView::NO_SCENEVIEW_LIGHT); ! sceneView->setClearColor(osg::Vec4(0, 0, 0, 1.0f)); //sceneView->setComputeNearFarMode(osgUtil::CullVisitor::COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES); *************** *** 1110,1113 **** --- 1173,1177 ---- else { + if (!rootnode->removeChild(skyTransform.get()) || !foggedObjects->removeChild(terrainNode.get()) || *************** *** 1401,1404 **** --- 1465,1469 ---- InitSceneView(pos, size); + InitGuiView(); osgDB::Registry::instance()->setDataFilePathList("3d"); |
|
From: Dewitt C. <ddc...@us...> - 2004-10-07 22:02:01
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12439/src/sim Modified Files: Game.cpp tcDirector.cpp tcDirectorEvent.cpp Log Message: Changes related to GDI+ replacement Index: tcDirector.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcDirector.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcDirector.cpp 14 Sep 2004 02:01:47 -0000 1.8 --- tcDirector.cpp 7 Oct 2004 22:01:47 -0000 1.9 *************** *** 1,6 **** ! /* ! ** tcDirector.cpp ! ** ! ** Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** ! ** @file tcDirector.cpp ! */ ! /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 26,34 **** #ifndef WX_PRECOMP #include "wx/wx.h" - #include "wx/msw/private.h" // for MS Windows specific definitions #endif #include "tcDirector.h" #include "tcDirectorEvent.h" #include "tcSound.h" #include "wxcommands.h" --- 26,34 ---- #ifndef WX_PRECOMP #include "wx/wx.h" #endif #include "tcDirector.h" #include "tcDirectorEvent.h" + #include "tcConsoleBox.h" #include "tcSound.h" #include "wxcommands.h" *************** *** 115,119 **** } ! tcDirector::tcDirector(tc3DViewer *view3D, tcConsole *console , wxWindow *win) : viewer(view3D) --- 115,119 ---- } ! tcDirector::tcDirector(tc3DViewer *view3D, tcConsoleBox *console , wxWindow *win) : viewer(view3D) Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.98 retrieving revision 1.99 diff -C2 -d -r1.98 -r1.99 *** Game.cpp 2 Oct 2004 22:41:33 -0000 1.98 --- Game.cpp 7 Oct 2004 22:01:46 -0000 1.99 *************** *** 307,311 **** // clear briefing console text ! briefingConsoleLeft->ClearBuffer(); briefingConsoleLeft->SetDelayedTextEffect(true); --- 307,311 ---- // clear briefing console text ! briefingConsoleLeft->Clear(); briefingConsoleLeft->SetDelayedTextEffect(true); *************** *** 431,438 **** { int margin = (meScreenMode == TACTICALBRIEF) ? mnBriefingWidth : mnLeftMargin; r.x = margin; r.y = 0; r.width = mnWidth-margin; ! r.height = mnHeight-mnBottomMargin; } else if (size3D == MODE3D_FULL) --- 431,439 ---- { int margin = (meScreenMode == TACTICALBRIEF) ? mnBriefingWidth : mnLeftMargin; + margin += 1; r.x = margin; r.y = 0; r.width = mnWidth-margin; ! r.height = mnHeight-mnBottomMargin-1; } else if (size3D == MODE3D_FULL) *************** *** 512,519 **** /*** Init edit control ***/ ! editControl = new tcEditControl(viewer, wxPoint(200,200), wxSize(100,50)); editControl->SetActive(false); ! chatBox = new tcChatBox(viewer, wxPoint(200, 200), wxSize(300, 180), "ChatBox"); chatBox->SetActive(false); chatBox->MoveToTop(); --- 513,520 ---- /*** Init edit control ***/ ! editControl = new tcEditControl(glCanvas, wxPoint(200,200), wxSize(100,50)); editControl->SetActive(false); ! chatBox = new tcChatBox(glCanvas, wxPoint(200, 200), wxSize(300, 180), "ChatBox"); chatBox->SetActive(false); chatBox->MoveToTop(); *************** *** 626,633 **** smallViewerSize = wxSize(380, 200); ! startViewerSize = wxSize(mnWidth, mnHeight); startViewerPosition = wxPoint(mnWidth - startViewerSize.x, mnHeight - startViewerSize.y); ! viewer = new tc3DViewer(glCanvas, startViewerPosition, startViewerSize); --- 627,635 ---- smallViewerSize = wxSize(380, 200); ! ! startViewerSize = wxSize(mnWidth/2, mnHeight/2); startViewerPosition = wxPoint(mnWidth - startViewerSize.x, mnHeight - startViewerSize.y); ! viewer = new tc3DViewer(glCanvas, startViewerPosition, startViewerSize); *************** *** 669,674 **** void tcGame::InitializeStartView() { ! wxSize viewerSize = viewer->GetSize(); ! startView = new tcStartView(viewer, wxPoint(0,0), viewerSize, "StartView"); startView->AttachOptions(tcOptions::Get()); --- 671,675 ---- void tcGame::InitializeStartView() { ! startView = new tcStartView(glCanvas, wxPoint(0,0), frameSize, "StartView"); startView->AttachOptions(tcOptions::Get()); *************** *** 690,696 **** { ! wxASSERT(viewer); ! optionsView = new tcOptionsView(viewer, wxPoint(0,0), frameSize, "OptionsView"); optionsView->Init(); --- 691,697 ---- { ! wxASSERT(glCanvas); ! optionsView = new tcOptionsView(glCanvas, wxPoint(0,0), frameSize, "OptionsView"); optionsView->Init(); *************** *** 705,711 **** void tcGame::InitializeNetworkView() { ! wxASSERT(viewer); ! networkView = new tcNetworkView(viewer, wxPoint(0,0), frameSize, "NetworkView"); } --- 706,712 ---- void tcGame::InitializeNetworkView() { ! wxASSERT(glCanvas); ! networkView = new tcNetworkView(glCanvas, wxPoint(0,0), frameSize, "NetworkView"); } *************** *** 717,722 **** { int leftConsoleHeight = mnHeight-mnBottomMargin; ! briefingConsoleLeft = new tcButtonConsole(glCanvas, wxPoint(0,0), ! wxSize(mnBriefingWidth,leftConsoleHeight)); if (!briefingConsoleLeft) { --- 718,723 ---- { int leftConsoleHeight = mnHeight-mnBottomMargin; ! briefingConsoleLeft = new tcSoundConsole(glCanvas, wxPoint(0,0), ! wxSize(mnBriefingWidth, leftConsoleHeight), "xml/briefing_left.xml") ; if (!briefingConsoleLeft) { *************** *** 726,730 **** briefingConsoleLeft->SetEffect(SEFFECT_MUTEDBEEP); ! briefingConsoleLeft->InitGdi(10.0f,0xFF64FF64); briefingConsoleLeft->SetLineSpacing(10); briefingConsoleLeft->SetWrap(48); --- 727,731 ---- briefingConsoleLeft->SetEffect(SEFFECT_MUTEDBEEP); ! //briefingConsoleLeft->InitGdi(10.0f,0xFF64FF64); briefingConsoleLeft->SetLineSpacing(10); briefingConsoleLeft->SetWrap(48); *************** *** 734,741 **** briefingConsoleLeft->Print(" "); // need this to get it to display // add buttons ! briefingConsoleLeft->AddButton(wxRect(10,leftConsoleHeight-20,50,14), ID_SKIPBRIEFING, "EXIT"); ! briefingConsoleBottom = new tcSoundConsole(glCanvas, wxPoint(0,mnHeight-mnBottomMargin), ! wxSize(mnWidth,mnBottomMargin)); if (!briefingConsoleBottom) { --- 735,742 ---- briefingConsoleLeft->Print(" "); // need this to get it to display // add buttons ! //briefingConsoleLeft->AddButton(wxRect(10,leftConsoleHeight-20,50,14), ID_SKIPBRIEFING, "EXIT"); ! briefingConsoleBottom = new tcSoundConsole(glCanvas, wxPoint(0, mnHeight-mnBottomMargin), ! wxSize(mnWidth, mnBottomMargin), "xml/briefing_bottom.xml"); if (!briefingConsoleBottom) { *************** *** 745,749 **** briefingConsoleBottom->SetEffect(-1); ! briefingConsoleBottom->InitGdi(10.0f,0xFF64FF64); briefingConsoleBottom->SetLineSpacing(10); briefingConsoleBottom->SetWrap(100); --- 746,750 ---- briefingConsoleBottom->SetEffect(-1); ! //briefingConsoleBottom->InitGdi(10.0f,0xFF64FF64); briefingConsoleBottom->SetLineSpacing(10); briefingConsoleBottom->SetWrap(100); *************** *** 759,764 **** void tcGame::InitializeCreditView() { ! wxSize viewerSize = viewer->GetSize(); ! creditView = new tcCreditView(viewer, wxPoint(0,0), viewerSize, "CreditView"); --- 760,764 ---- void tcGame::InitializeCreditView() { ! creditView = new tcCreditView(glCanvas, wxPoint(0,0), frameSize, "CreditView"); *************** *** 784,788 **** tcDirector::AttachMapViews(tacticalMap, worldMap); ! director = new tcDirector(viewer, briefingConsoleLeft, this); director->SetStartTime(0); director->InitTest(); // load test event sequence --- 784,788 ---- tcDirector::AttachMapViews(tacticalMap, worldMap); ! director = new tcDirector(viewer, briefingConsoleLeft->GetConsoleBox(), this); director->SetStartTime(0); director->InitTest(); // load test event sequence *************** *** 795,806 **** void tcGame::InitializeDisplaySettingsView() { ! wxASSERT(viewer); ! ! // displaySettingsView = ! // new tcDisplaySettingsView(viewer, wxPoint(0,0), frameSize, "DisplaySettings"); ! wxSize viewerSize = viewer->GetSize(); displaySettingsView = ! new tcDisplaySettingsView(viewer, wxPoint(0,0), viewerSize, "DisplaySettings"); displaySettingsView->SetActive(false); --- 795,802 ---- void tcGame::InitializeDisplaySettingsView() { ! wxASSERT(glCanvas); displaySettingsView = ! new tcDisplaySettingsView(glCanvas, wxPoint(0,0), frameSize, "DisplaySettings"); displaySettingsView->SetActive(false); *************** *** 813,820 **** void tcGame::InitializeScenarioSelectView() { ! wxASSERT(viewer); scenarioSelectView = ! new tcScenarioSelectView(viewer, wxPoint(0,0), frameSize, "ScenarioSelect"); if (scenarioSelectView->Init() == false) --- 809,816 ---- void tcGame::InitializeScenarioSelectView() { ! wxASSERT(glCanvas); scenarioSelectView = ! new tcScenarioSelectView(glCanvas, wxPoint(0,0), frameSize, "ScenarioSelect"); if (scenarioSelectView->Init() == false) *************** *** 886,890 **** mrectLowerLeft.bottom = mnHeight; ! infoConsole = new tcSoundConsole(glCanvas, wxPoint(mrectLowerLeft.left,mrectLowerLeft.top), wxSize(200,200)); messageConsole = infoConsole; --- 882,889 ---- mrectLowerLeft.bottom = mnHeight; ! infoConsole = new tcSoundConsole(glCanvas, ! wxPoint(mrectLowerLeft.left, mrectLowerLeft.top), wxSize(200,200), ! "xml/info_console.xml", "InfoConsole"); ! infoConsole->LoadBackgroundImage("start_background.jpg"); messageConsole = infoConsole; *************** *** 896,900 **** infoConsole->SetEffect(-1); //SEFFECT_MUTEDBEEP); // no sound ! infoConsole->InitGdi(10.0f,0xFF64FF64); infoConsole->SetLineSpacing(10); infoConsole->SetWrap(28); --- 895,899 ---- infoConsole->SetEffect(-1); //SEFFECT_MUTEDBEEP); // no sound ! // infoConsole->InitGdi(10.0f,0xFF64FF64); infoConsole->SetLineSpacing(10); infoConsole->SetWrap(28); *************** *** 1782,1786 **** if (size3D == MODE3D_SMALL) { ! viewerText = ""; } else --- 1781,1785 ---- if (size3D == MODE3D_SMALL) { ! viewerText = " "; // "" causes dropout of line objects in consoles } else *************** *** 2075,2078 **** --- 2074,2080 ---- tacticalMap->ToggleShowTrackTags(); return; + case 'T': + viewer->SetTerrainActive(!viewer->GetTerrainActive()); + return; case 'p': if (!mbScenarioEdit) mbPaused = !mbPaused; Index: tcDirectorEvent.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcDirectorEvent.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcDirectorEvent.cpp 14 Sep 2004 02:01:47 -0000 1.9 --- tcDirectorEvent.cpp 7 Oct 2004 22:01:47 -0000 1.10 *************** *** 1,6 **** ! /* ! ** tcDirectorEvent.cpp ! ** ! ** Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** ! ** @file tcDirectorEvent.cpp ! */ ! /* Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 26,30 **** #ifndef WX_PRECOMP #include "wx/wx.h" - #include "wx/msw/private.h" // for MS Windows specific definitions #endif --- 26,29 ---- *************** *** 33,37 **** #include "tcMapView.h" #include "tcSound.h" ! #include "tcConsole.h" #include "tc3DViewer.h" #include "math_constants.h" --- 32,36 ---- #include "tcMapView.h" #include "tcSound.h" ! #include "tcConsoleBox.h" #include "tc3DViewer.h" #include "math_constants.h" *************** *** 243,247 **** /***************** tcConsoleTextEvent *******************/ ! tcConsole * tcConsoleTextEvent::console = NULL; void tcConsoleTextEvent::Update(double t) --- 242,246 ---- /***************** tcConsoleTextEvent *******************/ ! tcConsoleBox * tcConsoleTextEvent::console = NULL; void tcConsoleTextEvent::Update(double t) |
|
From: Dewitt C. <ddc...@us...> - 2004-10-07 22:01:59
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12439/src/common Modified Files: tcOptionsView.cpp tcSoundConsole.cpp Log Message: Changes related to GDI+ replacement Index: tcSoundConsole.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/tcSoundConsole.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcSoundConsole.cpp 8 Aug 2004 00:31:33 -0000 1.7 --- tcSoundConsole.cpp 7 Oct 2004 22:01:45 -0000 1.8 *************** *** 23,33 **** #ifndef WX_PRECOMP #include "wx/wx.h" - #ifdef WIN32 - #include "wx/msw/private.h" // for MS Windows specific definitions - #endif #endif #include "tcSoundConsole.h" #include "tcSound.h" #ifdef _DEBUG --- 23,32 ---- #ifndef WX_PRECOMP #include "wx/wx.h" #endif #include "tcSoundConsole.h" + #include "tcConsoleBox.h" #include "tcSound.h" + #include "common/tinyxml.h" #ifdef _DEBUG *************** *** 35,66 **** #endif ! int tcSoundConsole::Draw() { ! if (Redraw()) { tcSound::Get()->PlayEffect(mnSoundEffect); } ! return tcConsole::Draw(); } ! /********************************************************************/ ! int tcSoundConsole::Print(const char* line) { tcSound::Get()->PlayEffect(mnSoundEffect); ! return tcConsole::Print(line); } ! /********************************************************************/ tcSoundConsole::tcSoundConsole(wxWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& name) : ! tcConsole(parent, pos, size, name) { mnSoundEffect = SEFFECT_CONSOLE; } ! /********************************************************************/ ! tcSoundConsole::~tcSoundConsole() { } --- 34,129 ---- #endif ! void tcSoundConsole::Draw() { ! if (textBox->Redraw()) { tcSound::Get()->PlayEffect(mnSoundEffect); } ! DrawChildren(); ! ! DrawBorder(); ! ! HideUnusedObjects(); } ! tcConsoleBox* tcSoundConsole::GetConsoleBox() ! { ! wxASSERT(textBox); ! ! return textBox; ! } ! ! void tcSoundConsole::Print(const char* line) { tcSound::Get()->PlayEffect(mnSoundEffect); ! textBox->Print(line); } ! void tcSoundConsole::SetDelayedTextEffect(bool effectOn) ! { ! wxASSERT(textBox); ! ! textBox->SetDelayedTextEffect(effectOn); ! } ! ! void tcSoundConsole::SetLineSpacing(int anSpacing) ! { ! wxASSERT(textBox); ! ! textBox->SetLineSpacing(anSpacing); ! } ! ! void tcSoundConsole::SetWrap(int n) ! { ! wxASSERT(textBox); ! ! textBox->SetWrap(n); ! ! } ! ! tcSoundConsole::tcSoundConsole(wxWindow *parent, const wxPoint& pos, const wxSize& size, + const wxString& configFile, const wxString& name) : ! tcXmlWindow(parent, pos, size, configFile, name) { mnSoundEffect = SEFFECT_CONSOLE; + + if (!config) + { + fprintf(stderr, "tcSoundConsole::tcSoundConsole - Missing xml config\n"); + return; + } + + TiXmlNode* root = config->FirstChild("Window"); + if (!root) + { + fprintf(stderr, "tcSoundConsole::tcSoundConsole - Missing top level <Window> tag\n"); + return; + } + + TiXmlNode* current = root->FirstChild("TextBox"); + + int topMargin = 0; + int bottomMargin = 0; + if (current) + { + TiXmlElement* elt = current->ToElement(); + elt->Attribute("TopMargin", &topMargin); + elt->Attribute("BottomMargin", &bottomMargin); + } + + textBox = new tcConsoleBox(this, current); + textBox->SetActive(true); + textBox->SetSize(0, topMargin, + size.GetWidth(), size.GetHeight() - (topMargin + bottomMargin)); + } ! ! tcSoundConsole::~tcSoundConsole() ! { } Index: tcOptionsView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/tcOptionsView.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcOptionsView.cpp 2 Oct 2004 22:41:33 -0000 1.10 --- tcOptionsView.cpp 7 Oct 2004 22:01:45 -0000 1.11 *************** *** 91,95 **** maButtonPosition[i][j].mnTextX = xpos; maButtonPosition[i][j].mnTextY = ypos-mnButtonHeight+2; ! xpos += (int)(rstring.GetWidth()) + 1; maButtonPosition[i][j].mnButtonX = xpos; maButtonPosition[i][j].mnButtonY = ypos-mnButtonHeight-mnButtonHeight/6; --- 91,95 ---- maButtonPosition[i][j].mnTextX = xpos; maButtonPosition[i][j].mnTextY = ypos-mnButtonHeight+2; ! xpos += (int)(rstring.GetWidth()) + 5; maButtonPosition[i][j].mnButtonX = xpos; maButtonPosition[i][j].mnButtonY = ypos-mnButtonHeight-mnButtonHeight/6; |
|
From: Dewitt C. <ddc...@us...> - 2004-10-07 22:01:55
|
Update of /cvsroot/gcblue/gcb_wx/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12439/docs Modified Files: CHANGES.txt Log Message: Changes related to GDI+ replacement Index: CHANGES.txt =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/docs/CHANGES.txt,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** CHANGES.txt 2 Oct 2004 22:41:32 -0000 1.37 --- CHANGES.txt 7 Oct 2004 22:01:38 -0000 1.38 *************** *** 4,11 **** 0.6.1 --------------------------------------------------------------------- ! *** 2004-10-02 Dewitt Colclough *** - Created 3D window class derived from wxWindow to encapsulate 3D window functions. - Ported the remainder of the start screen windows. *** 2004-09-21 Dewitt Colclough *** --- 4,12 ---- 0.6.1 --------------------------------------------------------------------- ! *** 2004-10-07 Dewitt Colclough *** - Created 3D window class derived from wxWindow to encapsulate 3D window functions. - Ported the remainder of the start screen windows. + - Fixed some of the bugs with 3D window system *** 2004-09-21 Dewitt Colclough *** |
|
From: Dewitt C. <ddc...@us...> - 2004-10-07 22:01:24
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12334/include/graphics Modified Files: tc3DViewer.h tc3DWindow.h tcConsoleBox.h tcHookInfo.h tcOOBView.h tcXmlWindow.h Log Message: Changes related to GDI+ replacement Index: tcXmlWindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcXmlWindow.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcXmlWindow.h 2 Oct 2004 22:41:32 -0000 1.2 --- tcXmlWindow.h 7 Oct 2004 22:01:12 -0000 1.3 *************** *** 49,61 **** protected: TiXmlDocument* config; ///< XML auto-configuration file for window - /* - static Gdiplus::SolidBrush* mpBrush; - static Gdiplus::Font* font20; - static Gdiplus::Font* font16; - static Gdiplus::Font* font12; - static Gdiplus::Font* font10; - static Gdiplus::Font* font8; - static Gdiplus::Pen* mpPen; - */ void AddXMLControls(); ///< adds XML controls to window that can be added automatically --- 49,52 ---- Index: tcOOBView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcOOBView.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcOOBView.h 2 Oct 2004 22:41:32 -0000 1.1 --- tcOOBView.h 7 Oct 2004 22:01:12 -0000 1.2 *************** *** 1,7 **** ! /* ! ** tcOOBView.h ** order of battle view window ! ** ! ** Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,7 ---- ! /** ! ** @file tcOOBView.h ** order of battle view window ! */ ! /* Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 29,37 **** #include "wx/wx.h" ! #ifdef WIN32 ! #include "wx/msw/private.h" // for MS Windows specific definitions ! #endif ! #include "tcWindow.h" ! #include <string> #include "tcPool.h" #include "tcDatabase.h" --- 29,34 ---- #include "wx/wx.h" ! ! #include "tc3DWindow.h" #include "tcPool.h" #include "tcDatabase.h" *************** *** 58,65 **** float mfDamage_fract; ///< damage over toughness std::string mzAction; ! Gdiplus::RectF rectf; ///< draw location (without offset for current scroll) ! Gdiplus::RectF remcon; ///< location for EMCON icon ! Gdiplus::RectF rdamage; ///< location for damage indicator ! Gdiplus::RectF raction; ///< loc for action string tsOOBInfo& operator= (const tsOOBInfo& rhs); --- 55,62 ---- float mfDamage_fract; ///< damage over toughness std::string mzAction; ! tcRect rectf; ///< draw location (without offset for current scroll) ! tcRect remcon; ///< location for EMCON icon ! tcRect rdamage; ///< location for damage indicator ! tcRect raction; ///< loc for action string tsOOBInfo& operator= (const tsOOBInfo& rhs); *************** *** 75,79 **** * All of the code in this section is out of date and needs refactoring */ ! class tcOOBView : public tcWindow { public: --- 72,76 ---- * All of the code in this section is out of date and needs refactoring */ ! class tcOOBView : public tc3DWindow { public: *************** *** 96,100 **** void AttachMapView(tcTacticalMapView *apMapView) {mpMapView = apMapView;} void Update(); ! int Draw(); void OnLButtonDown(wxMouseEvent& event); void OnLButtonUp(wxMouseEvent& event); --- 93,97 ---- void AttachMapView(tcTacticalMapView *apMapView) {mpMapView = apMapView;} void Update(); ! void Draw(); void OnLButtonDown(wxMouseEvent& event); void OnLButtonUp(wxMouseEvent& event); *************** *** 112,128 **** float mfXIndent; ///< indent for formations tnPoolIndex objKeys[MAX_OOB_OBJECTS]; Gdiplus::SolidBrush* mpBrush; Gdiplus::Pen* mpPen; Gdiplus::Font* mpFont; ! tsOOBInfo* ButtonContainingPoint(Gdiplus::PointF pointf); ! tsOOBInfo* ButtonContainingPointCategory(Gdiplus::PointF pointf, std::vector<tsOOBInfo>& objInfo); ! void DrawCategory(Gdiplus::Graphics* graphics, ! std::vector<tsOOBInfo>& objInfo, float stopy); float GetCategoryY(std::vector<tsOOBInfo>& objInfo); ! void PlaceIcons(Gdiplus::Graphics *apGraphics); ! void PlaceIconsCategory(Gdiplus::Graphics* graphics, std::vector<tsOOBInfo>& objInfo); void UpdateData(); void UpdateFormation(); --- 109,127 ---- float mfXIndent; ///< indent for formations tnPoolIndex objKeys[MAX_OOB_OBJECTS]; + + /* Gdiplus::SolidBrush* mpBrush; Gdiplus::Pen* mpPen; Gdiplus::Font* mpFont; + */ ! tsOOBInfo* ButtonContainingPoint(wxRealPoint pointf); ! tsOOBInfo* ButtonContainingPointCategory(wxRealPoint pointf, std::vector<tsOOBInfo>& objInfo); ! void DrawCategory(std::vector<tsOOBInfo>& objInfo, float stopy); float GetCategoryY(std::vector<tsOOBInfo>& objInfo); ! void PlaceIcons(); ! void PlaceIconsCategory(std::vector<tsOOBInfo>& objInfo); void UpdateData(); void UpdateFormation(); Index: tcConsoleBox.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcConsoleBox.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcConsoleBox.h 2 Oct 2004 22:41:32 -0000 1.5 --- tcConsoleBox.h 7 Oct 2004 22:01:12 -0000 1.6 *************** *** 62,69 **** --- 62,71 ---- int Print(const char* line); + void Clear(); virtual void Draw(); void ForceRedraw() {mbForceRedraw = true;} bool IsCurrentLineEmpty(); + virtual void OnSize(wxSizeEvent& event); bool Redraw() const {return mbRedraw != 0;} ///< @return true if console will be updated void SetDelayedTextEffect(bool effectOn) {useDelayedTextEffect = effectOn;} *************** *** 80,83 **** --- 82,86 ---- bool isMouseOver; bool isFocused; + bool drawBorder; float fontSize; osg::Vec4 fontColor; Index: tcHookInfo.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcHookInfo.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcHookInfo.h 2 Oct 2004 22:41:32 -0000 1.1 --- tcHookInfo.h 7 Oct 2004 22:01:12 -0000 1.2 *************** *** 1,6 **** ! /* ! ** tcHookInfo.h ! ** ! ** Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** ! ** @file tcHookInfo.h ! */ ! /* Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 30,35 **** #include "wx/wx.h" //#include "wx/msw/private.h" //for MS Windows specific definitions ! #include "tcwindow.h" ! #include <string> // forward declare to cut dependencies --- 30,35 ---- #include "wx/wx.h" //#include "wx/msw/private.h" //for MS Windows specific definitions ! #include "tc3DWindow.h" ! //#include <string> // forward declare to cut dependencies *************** *** 54,63 **** #endif ! class tcHookInfo : public tcWindow { public: ! int Draw(void); ! void DrawOwn(Gdiplus::Graphics *apGraphics, tcGameObject *pHookedObj); ! void DrawTrack(Gdiplus::Graphics *apGraphics, tnPoolIndex anID); void AttachSimState(tcSimState *apSS) {mpSS=apSS;} void AttachOptions(tcOptions *apOptions) {mpOptions = apOptions;} --- 54,63 ---- #endif ! class tcHookInfo : public tc3DWindow { public: ! void Draw(); ! void DrawOwn(tcGameObject *pHookedObj); ! void DrawTrack(tnPoolIndex anID); void AttachSimState(tcSimState *apSS) {mpSS=apSS;} void AttachOptions(tcOptions *apOptions) {mpOptions = apOptions;} *************** *** 66,69 **** --- 66,70 ---- void SetHookID(tnPoolIndex anID) {mnHookID=anID;} void OnLButtonDown(wxMouseEvent& event); + tcHookInfo(wxWindow *parent, const wxPoint& pos, const wxSize& size, *************** *** 78,89 **** tnPoolIndex mnHookID; ! Gdiplus::Pen *mpPen; // GDI+ objects ! Gdiplus::SolidBrush *mpBrush; ! Gdiplus::Font *mpFont, *mpFontLarge; ! void DrawTrackEngaged(Gdiplus::Graphics *graphics, const Sensor::tcSensorMapTrack *smtrack, float& x, float& y); ! void GetFunctionalName(std::string& s, tcDatabaseObject *apDBObject, tcGameObject *apGameObject); ! void GetObjectInfo(std::string& s, tcDatabaseObject *apDBObject, tcGameObject *apGameObject); }; --- 79,92 ---- tnPoolIndex mnHookID; ! //Gdiplus::Pen *mpPen; // GDI+ objects ! //Gdiplus::SolidBrush *mpBrush; ! //Gdiplus::Font *mpFont, *mpFontLarge; ! void DrawTrackEngaged( const Sensor::tcSensorMapTrack *smtrack, float& x, float& y); ! void GetFunctionalName(std::string& s, ! tcDatabaseObject *apDBObject, tcGameObject *apGameObject); ! void GetObjectInfo(std::string& s, ! tcDatabaseObject *apDBObject, tcGameObject *apGameObject); }; Index: tc3DWindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DWindow.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tc3DWindow.h 2 Oct 2004 22:41:32 -0000 1.4 --- tc3DWindow.h 7 Oct 2004 22:01:12 -0000 1.5 *************** *** 48,52 **** class Switch; class Texture2D; ! class Vec4; } --- 48,52 ---- class Switch; class Texture2D; ! // class Vec4; // causes C1001, line 2701 compiler error !? } *************** *** 181,185 **** tc3DWindow(wxWindow* parent, const wxPoint& pos, const wxSize& size, ! const wxString& name = "tc3DWindow"); virtual ~tc3DWindow(); protected: --- 181,185 ---- tc3DWindow(wxWindow* parent, const wxPoint& pos, const wxSize& size, ! const wxString& name = "tc3DWindow", tc3DWindow* graphicsHost = 0); virtual ~tc3DWindow(); protected: Index: tc3DViewer.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DViewer.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tc3DViewer.h 2 Oct 2004 22:41:32 -0000 1.1 --- tc3DViewer.h 7 Oct 2004 22:01:12 -0000 1.2 *************** *** 29,33 **** #include "wx/wx.h" ! #include "wx/msw/private.h" // for MS Windows specific definitions #include <osg/FrameStamp> #include <osg/NodeVisitor> --- 29,33 ---- #include "wx/wx.h" ! //#include "wx/msw/private.h" // for MS Windows specific definitions #include <osg/FrameStamp> #include <osg/NodeVisitor> *************** *** 51,63 **** { public: - // Producer::ref_ptr<tcRenderSurface> render_surface; - //Producer::ref_ptr<Producer::Camera> camera; - //Producer::ref_ptr<Producer::CameraConfig> camera_config; - //osg::ref_ptr<osgProducer::OsgCameraGroup> camera_group; osg::ref_ptr<osgUtil::SceneView> sceneView; osg::ref_ptr<osg::DisplaySettings> displaySettings; osg::ref_ptr<osg::NodeVisitor> updateVisitor; osg::ref_ptr<osg::FrameStamp> frameStamp; osg::ref_ptr<osgText::Text> viewerText; ///< text for debug/basic viewer info display osg::ref_ptr<osg::MatrixTransform> hudObjects; ///< add HUD objects to this transform osg::ref_ptr<osg::Projection> orthoProjection; ///< ortho projection for HUD objects --- 51,64 ---- { public: osg::ref_ptr<osgUtil::SceneView> sceneView; + osg::ref_ptr<osgUtil::SceneView> guiView; + osg::ref_ptr<osg::DisplaySettings> displaySettings; osg::ref_ptr<osg::NodeVisitor> updateVisitor; + osg::ref_ptr<osg::NodeVisitor> guiUpdateVisitor; osg::ref_ptr<osg::FrameStamp> frameStamp; + osg::ref_ptr<osg::FrameStamp> guiFrameStamp; osg::ref_ptr<osgText::Text> viewerText; ///< text for debug/basic viewer info display + osg::ref_ptr<osg::MatrixTransform> guiObjects; osg::ref_ptr<osg::MatrixTransform> hudObjects; ///< add HUD objects to this transform osg::ref_ptr<osg::Projection> orthoProjection; ///< ortho projection for HUD objects *************** *** 119,122 **** --- 120,124 ---- double GetGameTime() const {return gameTime;} osg::Vec3 GetObjectPosition(tcGameObject *obj); + bool GetTerrainActive() const {return isTerrainActive;} bool IsActive() {return isActive;} void LoadModel(tcGameObject *obj); *************** *** 204,207 **** --- 206,210 ---- void InitLight(); + void InitGuiView(); void InitSceneView(wxPoint pos, wxSize size); void InitState(); |
|
From: Dewitt C. <ddc...@us...> - 2004-10-07 22:01:23
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12334/include/sim Modified Files: Game.h tcDirector.h tcDirectorEvent.h Log Message: Changes related to GDI+ replacement Index: tcDirector.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcDirector.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcDirector.h 17 Aug 2004 02:22:56 -0000 1.8 --- tcDirector.h 7 Oct 2004 22:01:12 -0000 1.9 *************** *** 29,37 **** #include "wx/wx.h" ! #include "wx/msw/private.h" // for MS Windows specific definitions #include <vector> class tcDirectorEvent; ! class tcConsole; class tc3DViewer; --- 29,37 ---- #include "wx/wx.h" ! #include <vector> class tcDirectorEvent; ! class tcConsoleBox; class tc3DViewer; *************** *** 70,74 **** static void AttachMapViews(tcTacticalMapView* tmv, tcWorldMapView* wmv); ! tcDirector(tc3DViewer *view3D, tcConsole *console, wxWindow *win); ~tcDirector(); private: --- 70,74 ---- static void AttachMapViews(tcTacticalMapView* tmv, tcWorldMapView* wmv); ! tcDirector(tc3DViewer *view3D, tcConsoleBox *console, wxWindow *win); ~tcDirector(); private: Index: Game.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/Game.h,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** Game.h 14 Sep 2004 02:01:45 -0000 1.46 --- Game.h 7 Oct 2004 22:01:12 -0000 1.47 *************** *** 1,20 **** ! /** ! * 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 ! */ #if !defined _GAME_H_ --- 1,22 ---- ! /** ! ** @file Game.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 ! */ #if !defined _GAME_H_ *************** *** 28,32 **** #include "tcMapView.h" #include "tcSoundConsole.h" - #include "tcButtonConsole.h" #include "commandlist.h" #include "tcDatabase.h" --- 30,33 ---- *************** *** 147,151 **** wxGLCanvas* glCanvas; tcSoundConsole* infoConsole; ///< console object for info messages ! tcButtonConsole* briefingConsoleLeft; ///< console object for briefing text tcSoundConsole* briefingConsoleBottom; ///< to fill space at bottom for now tcTacticalMapView* tacticalMap; ///< tactical map object --- 148,152 ---- wxGLCanvas* glCanvas; tcSoundConsole* infoConsole; ///< console object for info messages ! tcSoundConsole* briefingConsoleLeft; ///< console object for briefing text tcSoundConsole* briefingConsoleBottom; ///< to fill space at bottom for now tcTacticalMapView* tacticalMap; ///< tactical map object Index: tcDirectorEvent.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcDirectorEvent.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcDirectorEvent.h 14 Sep 2004 02:01:45 -0000 1.10 --- tcDirectorEvent.h 7 Oct 2004 22:01:12 -0000 1.11 *************** *** 29,36 **** #include "wx/wx.h" ! #include "wx/msw/private.h" // for MS Windows specific definitions #include <string> #include <osg/ref_ptr> ! //#include <osgText/Text> // for tc3DTextEvent class tcMapObject; --- 29,36 ---- #include "wx/wx.h" ! #include <string> #include <osg/ref_ptr> ! class tcMapObject; *************** *** 42,46 **** } ! class tcConsole; class tc3DViewer; --- 42,46 ---- } ! class tcConsoleBox; class tc3DViewer; *************** *** 175,182 **** { public: ! static tcConsole * console; ///< all event go to the same console, mult consoles not supported with this std::string text; ! static void AttachConsole(tcConsole *c) {console = c;} virtual void Update(double t); --- 175,182 ---- { public: ! static tcConsoleBox * console; ///< all event go to the same console, mult consoles not supported with this std::string text; ! static void AttachConsole(tcConsoleBox *c) {console = c;} virtual void Update(double t); |
|
From: Dewitt C. <ddc...@us...> - 2004-10-07 22:01:21
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12334/include/common Modified Files: tcSoundConsole.h Log Message: Changes related to GDI+ replacement Index: tcSoundConsole.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/tcSoundConsole.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcSoundConsole.h 8 Aug 2004 00:31:32 -0000 1.8 --- tcSoundConsole.h 7 Oct 2004 22:01:11 -0000 1.9 *************** *** 1,6 **** ! /* ! ** tcSoundConsole.h ! ** ! ** Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** ! ** @file tcSoundConsole.h ! */ ! /* Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 29,50 **** #include "wx/wx.h" ! #ifdef WIN32 ! #include "wx/msw/private.h" // for MS Windows specific definitions ! #endif // WIN32 ! #include "tcConsole.h" ! class tcSoundConsole : public tcConsole { public: ! virtual int Draw(); ! int Print(const char* line); void SetEffect(int anEffect) {mnSoundEffect=anEffect;} ! tcSoundConsole(wxWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& name = "SoundConsole"); virtual ~tcSoundConsole(); private: ! int mnSoundEffect; // sound effect to use when printing }; --- 29,56 ---- #include "wx/wx.h" ! #include "tcXmlWindow.h" + class tcConsoleBox; ! class tcSoundConsole : public tcXmlWindow { public: ! virtual void Draw(); ! tcConsoleBox* GetConsoleBox(); ! void Print(const char* line); ! ! void SetDelayedTextEffect(bool effectOn); void SetEffect(int anEffect) {mnSoundEffect=anEffect;} ! void SetLineSpacing(int anSpacing); ! void SetWrap(int n); ! ! tcSoundConsole(wxWindow* parent, const wxPoint& pos, const wxSize& size, + const wxString& configFile, const wxString& name = "SoundConsole"); virtual ~tcSoundConsole(); private: ! tcConsoleBox* textBox; ! int mnSoundEffect; ///< sound effect to use when printing text }; |
|
From: Dewitt C. <ddc...@us...> - 2004-10-02 22:42:40
|
Update of /cvsroot/gcblue/gcb_wx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13659 Modified Files: GCblue.vcproj Log Message: Changes related to GDI+ replacement Index: GCblue.vcproj =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/GCblue.vcproj,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** GCblue.vcproj 14 Sep 2004 02:01:44 -0000 1.67 --- GCblue.vcproj 2 Oct 2004 22:41:31 -0000 1.68 *************** *** 252,255 **** --- 252,258 ---- </File> <File + RelativePath=".\src\graphics\tc3DViewer.cpp"> + </File> + <File RelativePath=".\src\graphics\tc3DWindow.cpp"> </File> *************** *** 261,264 **** --- 264,270 ---- </File> <File + RelativePath=".\src\graphics\tcChatBox.cpp"> + </File> + <File RelativePath="src\graphics\tcConsoleBox.cpp"> </File> *************** *** 279,291 **** --- 285,321 ---- </File> <File + RelativePath=".\src\graphics\tcGameView.cpp"> + </File> + <File RelativePath="src\graphics\tcGraphicsEngine.cpp"> </File> <File + RelativePath=".\src\graphics\tcHookInfo.cpp"> + <FileConfiguration + Name="Debug|Win32"> + <Tool + Name="VCCLCompilerTool" + ObjectFile="$(IntDir)/$(InputName)1.obj"/> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32"> + <Tool + Name="VCCLCompilerTool" + ObjectFile="$(IntDir)/$(InputName)1.obj"/> + </FileConfiguration> + </File> + <File RelativePath="src\graphics\tcMapObject.cpp"> </File> <File + RelativePath=".\src\graphics\tcMapView.cpp"> + </File> + <File RelativePath=".\src\graphics\tcNetworkView.cpp"> </File> <File + RelativePath=".\src\graphics\tcOOBView.cpp"> + </File> + <File RelativePath=".\src\graphics\tcPanel.cpp"> </File> *************** *** 309,312 **** --- 339,345 ---- </File> <File + RelativePath=".\src\graphics\tcTerrainView.cpp"> + </File> + <File RelativePath=".\src\graphics\tcWindow.cpp"> </File> *************** *** 359,365 **** </File> <File - RelativePath="src\sim\tc3DViewer.cpp"> - </File> - <File RelativePath="src\sim\tcAero.cpp"> </File> --- 392,395 ---- *************** *** 383,389 **** </File> <File - RelativePath=".\src\sim\tcChatBox.cpp"> - </File> - <File RelativePath=".\src\sim\tcCommandObject.cpp"> </File> --- 413,416 ---- *************** *** 422,428 **** </File> <File - RelativePath="src\sim\tcGameView.cpp"> - </File> - <File RelativePath="src\sim\tcGoal.cpp"> </File> --- 449,452 ---- *************** *** 437,443 **** </File> <File - RelativePath="src\sim\tcHookInfo.cpp"> - </File> - <File RelativePath=".\src\sim\tcLauncher.cpp"> </File> --- 461,464 ---- *************** *** 452,458 **** </File> <File - RelativePath="src\sim\tcMapView.cpp"> - </File> - <File RelativePath="src\sim\tcMenu.cpp"> </File> --- 473,476 ---- *************** *** 464,470 **** </File> <File - RelativePath="src\sim\tcOOBView.cpp"> - </File> - <File RelativePath="src\sim\tcPlatformObject.cpp"> </File> --- 482,485 ---- *************** *** 485,491 **** </File> <File - RelativePath="src\sim\tcTerrainView.cpp"> - </File> - <File RelativePath="src\sim\tcTime.cpp"> </File> --- 500,503 ---- *************** *** 1095,1098 **** --- 1107,1113 ---- </File> <File + RelativePath=".\include\graphics\tc3DViewer.h"> + </File> + <File RelativePath=".\include\graphics\tc3DWindow.h"> </File> *************** *** 1104,1107 **** --- 1119,1125 ---- </File> <File + RelativePath=".\include\graphics\tcChatBox.h"> + </File> + <File RelativePath="include\graphics\tcConsoleBox.h"> </File> *************** *** 1122,1134 **** --- 1140,1164 ---- </File> <File + RelativePath=".\include\graphics\tcGameView.h"> + </File> + <File RelativePath="include\graphics\tcGraphicsEngine.h"> </File> <File + RelativePath=".\include\graphics\tcHookInfo.h"> + </File> + <File RelativePath="include\graphics\tcMapObject.h"> </File> <File + RelativePath=".\include\graphics\tcMapView.h"> + </File> + <File RelativePath=".\include\graphics\tcNetworkView.h"> </File> <File + RelativePath=".\include\graphics\tcOOBView.h"> + </File> + <File RelativePath=".\include\graphics\tcPanel.h"> </File> *************** *** 1155,1158 **** --- 1185,1191 ---- </File> <File + RelativePath=".\include\graphics\tcTerrainView.h"> + </File> + <File RelativePath=".\include\graphics\tcWindow.h"> </File> *************** *** 1205,1211 **** </File> <File - RelativePath="include\sim\tc3DViewer.h"> - </File> - <File RelativePath="include\sim\tcAero.h"> </File> --- 1238,1241 ---- *************** *** 1229,1235 **** </File> <File - RelativePath=".\include\sim\tcChatBox.h"> - </File> - <File RelativePath=".\include\sim\tcCommandObject.h"> </File> --- 1259,1262 ---- *************** *** 1268,1274 **** </File> <File - RelativePath="include\sim\tcGameView.h"> - </File> - <File RelativePath="include\sim\tcGoal.h"> </File> --- 1295,1298 ---- *************** *** 1283,1289 **** </File> <File - RelativePath="include\sim\tcHookInfo.h"> - </File> - <File RelativePath=".\include\sim\tcLauncher.h"> </File> --- 1307,1310 ---- *************** *** 1298,1304 **** </File> <File - RelativePath="include\sim\tcMapView.h"> - </File> - <File RelativePath="include\sim\tcMenu.h"> </File> --- 1319,1322 ---- *************** *** 1310,1316 **** </File> <File - RelativePath="include\sim\tcOOBView.h"> - </File> - <File RelativePath="include\sim\tcPlatformObject.h"> </File> --- 1328,1331 ---- *************** *** 1334,1340 **** </File> <File - RelativePath="include\sim\tcTerrainView.h"> - </File> - <File RelativePath="include\sim\tcTime.h"> </File> --- 1349,1352 ---- |
|
From: Dewitt C. <ddc...@us...> - 2004-10-02 22:42:16
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13659/include/sim Removed Files: tc3DViewer.h tcChatBox.h tcGameView.h tcHookInfo.h tcMapView.h tcOOBView.h tcTerrainView.h Log Message: Changes related to GDI+ replacement --- tcGameView.h DELETED --- --- tcOOBView.h DELETED --- --- tcHookInfo.h DELETED --- --- tcTerrainView.h DELETED --- --- tcMapView.h DELETED --- --- tc3DViewer.h DELETED --- --- tcChatBox.h DELETED --- |
|
From: Dewitt C. <ddc...@us...> - 2004-10-02 22:42:16
|
Update of /cvsroot/gcblue/gcb_wx/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13659/xml Modified Files: network_view.xml options.xml Log Message: Changes related to GDI+ replacement Index: options.xml =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/xml/options.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** options.xml 17 Jun 2004 21:00:50 -0000 1.3 --- options.xml 2 Oct 2004 22:41:34 -0000 1.4 *************** *** 1,4 **** <Options> <HostAddress>192.168.0.102</HostAddress> ! <DisplaySettings>default</DisplaySettings> </Options> --- 1,4 ---- <Options> <HostAddress>192.168.0.102</HostAddress> ! <DisplaySettings>1024 768 32 75</DisplaySettings> </Options> Index: network_view.xml =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/xml/network_view.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** network_view.xml 5 Sep 2004 01:02:04 -0000 1.5 --- network_view.xml 2 Oct 2004 22:41:34 -0000 1.6 *************** *** 16,20 **** <Button X="340" Y="305" Width="65" Height="15" Caption="Test Text" Command="170"/> <StatusBox X="250" Y="130" Width="200" Height="100"/> ! <ChatBox X="30" Y="350" Width="400" Height="200" FontSize="9.0"/> <ChatEntry X="30" Y="556" Width="400" Height="16" BarX="0.0" BarY="1.0" BarWidth="400.0" BarHeight="14.0" Caption=""/> --- 16,20 ---- <Button X="340" Y="305" Width="65" Height="15" Caption="Test Text" Command="170"/> <StatusBox X="250" Y="130" Width="200" Height="100"/> ! <ChatBox X="30" Y="350" Width="400" Height="200" FontSize="11.0"/> <ChatEntry X="30" Y="556" Width="400" Height="16" BarX="0.0" BarY="1.0" BarWidth="400.0" BarHeight="14.0" Caption=""/> |
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13659/src/sim Modified Files: Game.cpp Removed Files: tc3DViewer.cpp tcChatBox.cpp tcGameView.cpp tcHookInfo.cpp tcMapView.cpp tcOOBView.cpp tcTerrainView.cpp Log Message: Changes related to GDI+ replacement --- tcChatBox.cpp DELETED --- --- tcOOBView.cpp DELETED --- --- tcGameView.cpp DELETED --- --- tcMapView.cpp DELETED --- --- tcTerrainView.cpp DELETED --- Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.97 retrieving revision 1.98 diff -C2 -d -r1.97 -r1.98 *** Game.cpp 16 Sep 2004 02:24:50 -0000 1.97 --- Game.cpp 2 Oct 2004 22:41:33 -0000 1.98 *************** *** 499,516 **** /* start view has to be initialized first so that we can share its 2D surface with the other windows */ ! InitializeStartView(); ! //InitializeOptionsView(); InitializeCreditView(); ! //InitializeNetworkView(); ! //InitializeScenarioSelectView(); ! //InitializeDisplaySettingsView(); tcMultiplayerInterface::Get()->SetEvtHandler(this); /*** Init edit control ***/ ! editControl = new tcEditControl(glCanvas, wxPoint(200,200),wxSize(100,50)); editControl->SetActive(false); ! chatBox = new tcChatBox(glCanvas, NULL, wxPoint(200, 200), wxSize(300, 180)); chatBox->SetActive(false); chatBox->MoveToTop(); --- 499,519 ---- /* start view has to be initialized first so that we can share its 2D surface with the other windows */ ! ! InitializeDisplaySettingsView(); ! InitializeOptionsView(); InitializeCreditView(); ! InitializeStartView(); ! ! InitializeNetworkView(); ! InitializeScenarioSelectView(); ! tcMultiplayerInterface::Get()->SetEvtHandler(this); /*** Init edit control ***/ ! editControl = new tcEditControl(viewer, wxPoint(200,200), wxSize(100,50)); editControl->SetActive(false); ! chatBox = new tcChatBox(viewer, wxPoint(200, 200), wxSize(300, 180), "ChatBox"); chatBox->SetActive(false); chatBox->MoveToTop(); *************** *** 686,703 **** void tcGame::InitializeOptionsView() { - #if 0 - wxASSERT(startView); ! optionsView = new tcOptionsView(glCanvas, startView, wxPoint(0,0), frameSize); ! optionsView->AttachOptions(tcOptions::Get()); ! if (optionsView->Init() == false) ! { ! throw exception(); ! } optionsView->SetActive(false); - #endif } --- 689,700 ---- void tcGame::InitializeOptionsView() { ! wxASSERT(viewer); ! optionsView = new tcOptionsView(viewer, wxPoint(0,0), frameSize, "OptionsView"); ! optionsView->Init(); optionsView->SetActive(false); } *************** *** 708,712 **** void tcGame::InitializeNetworkView() { ! //networkView = new tcNetworkView(glCanvas, startView, wxPoint(0,0), frameSize); } --- 705,711 ---- void tcGame::InitializeNetworkView() { ! wxASSERT(viewer); ! ! networkView = new tcNetworkView(viewer, wxPoint(0,0), frameSize, "NetworkView"); } *************** *** 796,803 **** void tcGame::InitializeDisplaySettingsView() { ! // wxASSERT(startView); ! // displaySettingsView = ! // new tcDisplaySettingsView(glCanvas, startView, wxPoint(0,0), frameSize); } --- 795,808 ---- void tcGame::InitializeDisplaySettingsView() { ! wxASSERT(viewer); ! // displaySettingsView = ! // new tcDisplaySettingsView(viewer, wxPoint(0,0), frameSize, "DisplaySettings"); ! wxSize viewerSize = viewer->GetSize(); ! ! displaySettingsView = ! new tcDisplaySettingsView(viewer, wxPoint(0,0), viewerSize, "DisplaySettings"); ! ! displaySettingsView->SetActive(false); } *************** *** 808,816 **** void tcGame::InitializeScenarioSelectView() { ! #if 0 ! wxASSERT(startView); scenarioSelectView = ! new tcScenarioSelectView(glCanvas, startView, wxPoint(0,0), frameSize); if (scenarioSelectView->Init() == false) --- 813,820 ---- void tcGame::InitializeScenarioSelectView() { ! wxASSERT(viewer); scenarioSelectView = ! new tcScenarioSelectView(viewer, wxPoint(0,0), frameSize, "ScenarioSelect"); if (scenarioSelectView->Init() == false) *************** *** 820,824 **** scenarioSelectView->SetActive(false); - #endif } --- 824,827 ---- *************** *** 1317,1325 **** if (meScreenMode != lastMode) { - //optionsView->SetActive(false); startView->SetActive(false); creditView->SetActive(false); ! //scenarioSelectView->SetActive(false); ! //networkView->SetActive(false); chatBox->SetActive(false); } --- 1320,1329 ---- if (meScreenMode != lastMode) { startView->SetActive(false); + optionsView->SetActive(false); creditView->SetActive(false); ! displaySettingsView->SetActive(false); ! scenarioSelectView->SetActive(false); ! networkView->SetActive(false); chatBox->SetActive(false); } --- tcHookInfo.cpp DELETED --- --- tc3DViewer.cpp DELETED --- |
|
From: Dewitt C. <ddc...@us...> - 2004-10-02 22:42:15
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13659/src/common Modified Files: tcOptions.cpp tcOptionsView.cpp Log Message: Changes related to GDI+ replacement Index: tcOptionsView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/tcOptionsView.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcOptionsView.cpp 5 Sep 2004 01:02:01 -0000 1.9 --- tcOptionsView.cpp 2 Oct 2004 22:41:33 -0000 1.10 *************** *** 1,6 **** ! /* ! ** tcOptionsView.cpp ! ** ! ** Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** ! ** @file tcOptionsView.cpp ! */ ! /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 26,139 **** #include "tcString.h" #include "wxcommands.h" - using namespace Gdiplus; /*******************************************************************************/ ! bool tcOptionsView::Init() { ! char zBuff[96]; ! strcpy(zBuff,IMAGE_PATH); ! strcat(zBuff,"options_bk.jpg"); ! MultiByteToWideChar(CP_ACP, 0, zBuff, -1, mzwchar, 255); ! mpiBackground = new Image(mzwchar,false); ! strcpy(zBuff,IMAGE_PATH); ! strcat(zBuff,"options_bon.bmp"); ! MultiByteToWideChar(CP_ACP, 0, zBuff, -1, mzwchar, 255); ! mpiButtonOn = new Image(mzwchar,false); ! strcpy(zBuff,IMAGE_PATH); ! strcat(zBuff,"options_boff.bmp"); ! MultiByteToWideChar(CP_ACP, 0, zBuff, -1, mzwchar, 255); ! mpiButtonOff = new Image(mzwchar,false); ! if (mpiBackground == NULL) { ! WTL("tcOptions - background bitmap (options_bk.jpg) load error"); ! return false; ! } ! if (mpiButtonOn == NULL) { ! WTL("tcOptions - background bitmap (options_bon.bmp) load error"); ! return false; ! } ! if (mpiButtonOff == NULL) { ! WTL("tcOptions - background bitmap (options_boff.bmp) load error"); ! return false; ! } ! FontFamily ff(L"Arial"); ! mpFont = new Font(&ff,12,FontStyleBold,UnitPixel); ! if (mpFont == NULL) { ! WTL("tcOptionsView - mpFont creation failed\n"); ! return false; ! } ! mpBrush = new SolidBrush(Color(0xFEFFFFFF)); // color is ARGB ! if (mpBrush == NULL) { ! WTL("tcOptionsView - mpBrush creation failed\n"); ! return false; } ! mpPen = new Pen(Color(255,200,200,200),2); ! if (mpPen == NULL) { ! WTL("tcTOptionsView - mpPen creation failed\n"); ! return false; } - - - // Get dimensions and limit to window dimensions - // mpiButtonOn dimensions are used for all buttons - mnBackgroundWidth = mpiBackground->GetWidth(); - if (mnBackgroundWidth > mnWidth) {mnBackgroundWidth = mnWidth;} - mnBackgroundHeight = mpiBackground->GetHeight(); - if (mnBackgroundHeight > mnHeight) {mnBackgroundHeight = mnHeight;} - mnButtonWidth = mpiButtonOn->GetWidth(); - if (mnButtonWidth > mnWidth) {mnButtonWidth = mnWidth;} //limit dimensions to window - mnButtonHeight = mpiButtonOn->GetHeight(); - if (mnButtonHeight > mnHeight) {mnButtonHeight = mnHeight;} - return true; } ! /*******************************************************************************/ ! int tcOptionsView::Draw() { static nTestCount = 0; - static WCHAR szwchar[256]; // wide char array buffer for string conversion - Graphics *pGraphics; - Erase(); - if (!GetGraphics(pGraphics)) { - return false; - } - if (mpiBackground == NULL) {return false;} - if (mpOptions == NULL) {return false;} - - pGraphics->DrawImage(mpiBackground,0,0,mnWidth,mnHeight); ! mpBrush->SetColor(Color(0xFEFFFFFF)); ! ! ! /*** Draw test text **/ tcString sText; ! ! int xpos,ypos; ypos = mnYStart; ! RectF rstring; ! for(int i=0;i<mpOptions->mnNumOptions;i++) { xpos = mnXStart; int nBoxWidth = maButtonPosition[i][mpOptions->maOptionInfo[i].mnStateCount-1].mnButtonX - maButtonPosition[i][0].mnTextX + 2*mnButtonWidth; ! mpBrush->SetColor(Color(0x60FFFFFF)); ! pGraphics->FillRectangle(mpBrush, ! maButtonPosition[i][0].mnTextX - mnButtonHeight/2, ypos - 3*mnButtonHeight/2, ! nBoxWidth, 2*mnButtonHeight); ! mpBrush->SetColor(Color(255,255,220,220)); ! for(int j=0;j<mpOptions->maOptionInfo[i].mnStateCount;j++) { sText = mpOptions->maOptionInfo[i].mzCaption[j]; ! MultiByteToWideChar(CP_ACP, 0, sText.GetBuffer(), -1, szwchar, 255); ! pGraphics->MeasureString(szwchar,-1,mpFont,PointF(0,0),&rstring); maButtonPosition[i][j].mnTextX = xpos; maButtonPosition[i][j].mnTextY = ypos-mnButtonHeight+2; ! xpos += (int)(rstring.Width) + 1; maButtonPosition[i][j].mnButtonX = xpos; maButtonPosition[i][j].mnButtonY = ypos-mnButtonHeight-mnButtonHeight/6; --- 26,95 ---- #include "tcString.h" #include "wxcommands.h" + #include "tcOptions.h" + #include "tcSound.h" + + #include <osg/Texture2D> + #include <osg/Vec4> /*******************************************************************************/ ! void tcOptionsView::Init() { ! wxString s; ! LoadBackgroundImage("options_bk.jpg"); ! mpiButtonOn = LoadTexture("options_bon.bmp"); ! mpiButtonOff = LoadTexture("options_boff.bmp"); ! ! wxASSERT(mpiButtonOn.valid()); ! wxASSERT(mpiButtonOn->getImage()); ! if (mpiButtonOn.valid() && mpiButtonOn->getImage()) ! { ! mnButtonWidth = mpiButtonOn->getImage()->s(); ! mnButtonHeight = mpiButtonOn->getImage()->t(); } ! else ! { ! fprintf(stderr, "tcOptionsView::Init - error loading button images\n"); } } ! /** ! * ! */ ! void tcOptionsView::Draw() { static nTestCount = 0; ! wxASSERT(mpOptions); tcString sText; ! int xpos, ypos; ypos = mnYStart; ! wxSize rstring; ! ! for(int i=0; i<mpOptions->mnNumOptions; i++) ! { xpos = mnXStart; int nBoxWidth = maButtonPosition[i][mpOptions->maOptionInfo[i].mnStateCount-1].mnButtonX - maButtonPosition[i][0].mnTextX + 2*mnButtonWidth; ! ! DrawRectangle(maButtonPosition[i][0].mnTextX - mnButtonHeight/2, ! ypos - 3*mnButtonHeight/2, ! nBoxWidth, 2*mnButtonHeight, osg::Vec4(1, 1, 1, 0.5), FILL_OFF); ! for(int j=0; j<mpOptions->maOptionInfo[i].mnStateCount; j++) ! { sText = mpOptions->maOptionInfo[i].mzCaption[j]; ! ! MeasureText(defaultFont.get(), fontSize, sText.c_str(), rstring); maButtonPosition[i][j].mnTextX = xpos; maButtonPosition[i][j].mnTextY = ypos-mnButtonHeight+2; ! xpos += (int)(rstring.GetWidth()) + 1; maButtonPosition[i][j].mnButtonX = xpos; maButtonPosition[i][j].mnButtonY = ypos-mnButtonHeight-mnButtonHeight/6; *************** *** 142,186 **** } ! pGraphics->DrawRectangle(mpPen, ! maButtonPosition[i][0].mnTextX - mnButtonHeight/2, ypos - 3*mnButtonHeight/2, ! nBoxWidth, 2*mnButtonHeight); ypos += 3*mnButtonHeight; } ! for(i=0;i<mpOptions->mnNumOptions;i++) { ! for(int j=0;j<mpOptions->maOptionInfo[i].mnStateCount;j++) { sText = mpOptions->maOptionInfo[i].mzCaption[j]; ! MultiByteToWideChar(CP_ACP, 0, sText.GetBuffer(), -1, szwchar, 255); ! pGraphics->DrawString(szwchar, -1, mpFont, ! PointF((float)maButtonPosition[i][j].mnTextX, (float)maButtonPosition[i][j].mnTextY), ! mpBrush); ! if (mpOptions->maOptionInfo[i].mnValue == j) { ! DrawButton(pGraphics,maButtonPosition[i][j].mnButtonX, ! maButtonPosition[i][j].mnButtonY,1); } ! else { ! DrawButton(pGraphics,maButtonPosition[i][j].mnButtonX, ! maButtonPosition[i][j].mnButtonY,0); } } } ! DrawChildren(pGraphics); - ReleaseGraphics(pGraphics); DrawBorder(); ! return true; } - /*******************************************************************************/ - void tcOptionsView::DrawButton(Graphics *apGraphics, int x, int y, int abOn) { - Image *pButton; ! if (apGraphics == NULL) {return;} ! pButton = (abOn == 1) ? mpiButtonOn : mpiButtonOff; ! if (pButton == NULL) {return;} ! apGraphics->DrawImage(pButton,x,y); } /******************************************************************************/ --- 98,151 ---- } ! DrawRectangle(maButtonPosition[i][0].mnTextX - mnButtonHeight/2, ! ypos - 3*mnButtonHeight/2, ! nBoxWidth, 2*mnButtonHeight, osg::Vec4(1, 1, 1, 0.5), FILL_OFF); ypos += 3*mnButtonHeight; } ! for(i=0; i<mpOptions->mnNumOptions; i++) ! { ! for(int j=0; j<mpOptions->maOptionInfo[i].mnStateCount; j++) ! { sText = mpOptions->maOptionInfo[i].mzCaption[j]; ! ! float x = (float)maButtonPosition[i][j].mnTextX; ! float y = (float)maButtonPosition[i][j].mnTextY; ! DrawText(sText.c_str(), x, y, defaultFont.get(), ! osg::Vec4(0.86f, 0.86f, 1.0f, 1.0f), fontSize, LEFT_BASE_LINE); ! if (mpOptions->maOptionInfo[i].mnValue == j) ! { ! DrawButton(maButtonPosition[i][j].mnButtonX, ! maButtonPosition[i][j].mnButtonY, 1); } ! else ! { ! DrawButton(maButtonPosition[i][j].mnButtonX, ! maButtonPosition[i][j].mnButtonY, 0); } } } ! DrawChildren(); DrawBorder(); ! ! HideUnusedObjects(); } ! /** ! * ! */ ! void tcOptionsView::DrawButton(int x, int y, int abOn) ! { ! osg::Texture2D* pButton; ! ! pButton = (abOn == 1) ? mpiButtonOn.get() : mpiButtonOff.get(); ! ! DrawImage(pButton, x, y, float(mnButtonWidth), float(mnButtonHeight), ! ALIGN_BOTTOM_LEFT); } /******************************************************************************/ *************** *** 198,209 **** // TranslatePoint(point); // adjust for flipped up/down bButtonClicked = ButtonContainingPoint(event.GetPosition(), nOption, nValue); ! if (bButtonClicked) { if ((nOption >= mpOptions->mnNumOptions)|| ! (nValue >= mpOptions->maOptionInfo[nOption].mnStateCount)) { WTL("tcOptionsView::OnLButtonDown error"); return; } mpOptions->maOptionInfo[nOption].mnValue = nValue; ! if (mpOptions->maOptionInfo[nOption].mpAssociated != NULL) { *mpOptions->maOptionInfo[nOption].mpAssociated = nValue; } --- 163,177 ---- // TranslatePoint(point); // adjust for flipped up/down bButtonClicked = ButtonContainingPoint(event.GetPosition(), nOption, nValue); ! if (bButtonClicked) ! { if ((nOption >= mpOptions->mnNumOptions)|| ! (nValue >= mpOptions->maOptionInfo[nOption].mnStateCount)) ! { WTL("tcOptionsView::OnLButtonDown error"); return; } mpOptions->maOptionInfo[nOption].mnValue = nValue; ! if (mpOptions->maOptionInfo[nOption].mpAssociated != NULL) ! { *mpOptions->maOptionInfo[nOption].mpAssociated = nValue; } *************** *** 229,238 **** int nx, ny; ! for(i=0;i<mpOptions->mnNumOptions;i++) { ! for(j=0;j<mpOptions->maOptionInfo[i].mnStateCount;j++) { nx = maButtonPosition[i][j].mnButtonX; ny = maButtonPosition[i][j].mnButtonY; ! wxRect cr(nx,ny,mnButtonWidth,mnButtonHeight); ! if (cr.Inside(point)) { rnOption = i; rnValue = j; --- 197,211 ---- int nx, ny; ! point.y = mnHeight - point.y; ! ! for(i=0; i<mpOptions->mnNumOptions; i++) ! { ! for(j=0; j<mpOptions->maOptionInfo[i].mnStateCount; j++) ! { nx = maButtonPosition[i][j].mnButtonX; ny = maButtonPosition[i][j].mnButtonY; ! wxRect cr(nx, ny, mnButtonWidth, mnButtonHeight); ! if (cr.Inside(point)) ! { rnOption = i; rnValue = j; *************** *** 248,257 **** ////////////////////////////////////////////////////////////////////// ! tcOptionsView::tcOptionsView(wxWindow *parent, tcWindow *surfaceHost, ! const wxPoint& pos, const wxSize& size, const wxString& name) : ! tcXmlWindow(parent, pos, size, "xml/options_view.xml", name, surfaceHost) { - wxASSERT(surfaceHost); if (config) --- 221,230 ---- ////////////////////////////////////////////////////////////////////// ! tcOptionsView::tcOptionsView(wxWindow *parent, const wxPoint& pos, ! const wxSize& size, const wxString& name) : ! tcXmlWindow(parent, pos, size, "xml/options_view.xml", name), ! fontSize(16.0f) { if (config) *************** *** 265,279 **** } ! mpiBackground = NULL; ! mpiButtonOn = NULL; ! mpiButtonOff = NULL; ! mpOptions = NULL; ! mpFont = NULL; ! mpBrush = NULL; mnXStart = 100; mnYStart = 150; ! for(int i=0;i<N_OPTIONS;i++) { ! for(int k=0;k<N_OPTION_VALUES;k++) { maButtonPosition[i][k].mnButtonX = -100; --- 238,250 ---- } ! ! mpOptions = tcOptions::Get(); ! mnXStart = 100; mnYStart = 150; ! ! for(int i=0; i<tcOptions::N_OPTIONS; i++) { ! for(int k=0; k<tcOptions::N_OPTION_VALUES; k++) { maButtonPosition[i][k].mnButtonX = -100; *************** *** 287,295 **** tcOptionsView::~tcOptionsView() { - if (mpiBackground != NULL) {delete mpiBackground;} - if (mpiButtonOn != NULL) {delete mpiButtonOn;} - if (mpiButtonOff != NULL) {delete mpiButtonOff;} - if (mpFont != NULL) {delete mpFont;} - if (mpBrush != NULL) {delete mpBrush;} - if (mpPen != NULL) {delete mpPen;} } --- 258,260 ---- Index: tcOptions.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/tcOptions.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcOptions.cpp 19 Jun 2004 22:00:27 -0000 1.10 --- tcOptions.cpp 2 Oct 2004 22:41:33 -0000 1.11 *************** *** 1,6 **** /** ** @file tcOptions.cpp ! ** ! ** Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- /** ** @file tcOptions.cpp ! */ ! /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. |
|
From: Dewitt C. <ddc...@us...> - 2004-10-02 22:42:13
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13659/include/common Modified Files: simmath.h tcOptions.h tcOptionsView.h Log Message: Changes related to GDI+ replacement Index: tcOptions.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/tcOptions.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcOptions.h 9 May 2004 20:40:20 -0000 1.7 --- tcOptions.h 2 Oct 2004 22:41:32 -0000 1.8 *************** *** 27,48 **** #include <string> - #define N_OPTIONS 32 // max number of options - #define N_OPTION_VALUES 4 // max number of states for each option class TiXmlDocument; class TiXmlNode; ! struct tsOptionInfo ! { ! int mnValue; ! enum teType ! { ! OT_BOOLEAN, ! OT_RADIOBUTTON ! } meType; ! int mnStateCount; ! wxString mzCaption[N_OPTION_VALUES]; ! int *mpAssociated; ///< variable to change to match mnValue ! }; /** --- 27,35 ---- #include <string> class TiXmlDocument; class TiXmlNode; ! /** *************** *** 57,60 **** --- 44,65 ---- { public: + + enum + { + N_OPTIONS = 32, // max number of options + N_OPTION_VALUES = 4 // max number of states for each option + }; + struct tsOptionInfo + { + int mnValue; + enum teType + { + OT_BOOLEAN, + OT_RADIOBUTTON + } meType; + int mnStateCount; + wxString mzCaption[tcOptions::N_OPTION_VALUES]; + int *mpAssociated; ///< variable to change to match mnValue + }; int mnCommandMode; int mnViewMode; ///< "Omniscient view" "Omniscient, no sensor tags" "Legal view" Index: simmath.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/simmath.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** simmath.h 16 Aug 2004 01:43:29 -0000 1.20 --- simmath.h 2 Oct 2004 22:41:32 -0000 1.21 *************** *** 59,66 **** public: float left,right,top,bottom; ! virtual float Width() {return right-left;} ! virtual float Height() {return top-bottom;} ! virtual float XCenter() {return 0.5f*(right+left);} ! virtual float YCenter() {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;} --- 59,66 ---- public: float left,right,top,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;} Index: tcOptionsView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/tcOptionsView.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcOptionsView.h 5 Sep 2004 01:02:00 -0000 1.9 --- tcOptionsView.h 2 Oct 2004 22:41:32 -0000 1.10 *************** *** 1,4 **** ! /* ! ** Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** ! ** @file tcOptionsView.h ! */ ! /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 27,37 **** #include "wx/wx.h" ! #ifdef WIN32 ! #include "wx/msw/private.h" // for MS Windows specific definitions ! #endif #include "tcOptions.h" #include "tcXmlWindow.h" - #include "tcSound.h" // View and GUI for user options data --- 29,44 ---- #include "wx/wx.h" ! #include <osg/ref_ptr> ! #include "tcOptions.h" #include "tcXmlWindow.h" + namespace osg + { + class Texture2D; + } + + class tcOptions; + class tcSound; // View and GUI for user options data *************** *** 48,59 **** public: ! void AttachOptions(tcOptions *apOptions) {mpOptions=apOptions;} ! bool Init(void); ! int Draw(void); ! void DrawButton(Gdiplus::Graphics *apGraphics, int x, int y, int abOn); void OnLButtonDown(wxMouseEvent& event); bool ButtonContainingPoint(wxPoint point, int& rnOption, int& rnValue); ! tcOptionsView(wxWindow *parent, tcWindow *surfaceHost, const wxPoint& pos, const wxSize& size, const wxString& name = "OptionsView"); --- 55,65 ---- public: ! void Init(); ! void Draw(); ! void DrawButton(int x, int y, int abOn); void OnLButtonDown(wxMouseEvent& event); bool ButtonContainingPoint(wxPoint point, int& rnOption, int& rnValue); ! tcOptionsView(wxWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& name = "OptionsView"); *************** *** 61,74 **** private: tcOptions *mpOptions; ! Gdiplus::Image *mpiBackground; ! Gdiplus::Image *mpiButtonOn; ! Gdiplus::Image *mpiButtonOff; ! Gdiplus::SolidBrush *mpBrush; ! Gdiplus::Font *mpFont; ! Gdiplus::Pen *mpPen; ! int mnBackgroundWidth,mnBackgroundHeight; ! int mnButtonWidth,mnButtonHeight; ! tsButtonInfo maButtonPosition[N_OPTIONS][N_OPTION_VALUES]; ! int mnXStart,mnYStart; }; --- 67,80 ---- private: tcOptions *mpOptions; ! ! osg::ref_ptr<osg::Texture2D> mpiButtonOn; ! osg::ref_ptr<osg::Texture2D> mpiButtonOff; ! ! float fontSize; ///< font size of options choice text ! int mnButtonWidth; ! int mnButtonHeight; ! tsButtonInfo maButtonPosition[tcOptions::N_OPTIONS][tcOptions::N_OPTION_VALUES]; ! int mnXStart; ! int mnYStart; }; |
|
From: Dewitt C. <ddc...@us...> - 2004-10-02 22:42:12
|
Update of /cvsroot/gcblue/gcb_wx/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13659/docs Modified Files: CHANGES.txt Log Message: Changes related to GDI+ replacement Index: CHANGES.txt =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/docs/CHANGES.txt,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** CHANGES.txt 14 Sep 2004 02:01:44 -0000 1.36 --- CHANGES.txt 2 Oct 2004 22:41:32 -0000 1.37 *************** *** 1,9 **** CHANGES ! 0.6 --------------------------------------------------------------------- *** 2004-09-13 Dewitt Colclough *** - Initial 3D window commit *** 2004-09-06 Dewitt Colclough *** - Added object 3D display to start screens --- 1,21 ---- CHANGES ! ! 0.6.1 --------------------------------------------------------------------- + *** 2004-10-02 Dewitt Colclough *** + - Created 3D window class derived from wxWindow to encapsulate 3D window + functions. + - Ported the remainder of the start screen windows. + + *** 2004-09-21 Dewitt Colclough *** + - Ported start screens to use new 3D window, replacing GDI+ + *** 2004-09-13 Dewitt Colclough *** - Initial 3D window commit + + 0.6 + --------------------------------------------------------------------- *** 2004-09-06 Dewitt Colclough *** - Added object 3D display to start screens |
|
From: Dewitt C. <ddc...@us...> - 2004-09-16 02:25:02
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11156/include/graphics Modified Files: tc3DWindow.h tcCreditView.h tcStartView.h Log Message: Index: tcStartView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcStartView.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcStartView.h 5 Sep 2004 01:02:00 -0000 1.1 --- tcStartView.h 16 Sep 2004 02:24:49 -0000 1.2 *************** *** 1,4 **** ! /* ! ** Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** ! ** @file tcStartView.h ! */ ! /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 26,42 **** #include "wx/wx.h" ! #ifdef WIN32 ! #include "wx/msw/private.h" // for MS Windows specific definitions ! #endif ! #include "tcwindow.h" ! #include "aerror.h" #include "tcString.h" class tcOptions; ! class tcStartView : public tcWindow { public: ! // placement info for GUI buttons, text, etc. struct tsButtonInfo { --- 28,49 ---- #include "wx/wx.h" ! ! #include "tc3DWindow.h" ! #include "AError.h" #include "tcString.h" + namespace osg + { + class Texture2D; + } + class tcOptions; ! class tcStartView : public tc3DWindow { public: ! /** ! * placement info for GUI buttons, text, etc. ! */ struct tsButtonInfo { *************** *** 48,54 **** int mnButtonWidth; int mnButtonHeight; ! Gdiplus::Image *mpiButtonOn; ! Gdiplus::Image *mpiButtonOver; ! Gdiplus::Image *mpiButtonOff; int mnState; }; --- 55,61 ---- int mnButtonWidth; int mnButtonHeight; ! osg::ref_ptr<osg::Texture2D> mpiButtonOn; ! osg::ref_ptr<osg::Texture2D> mpiButtonOver; ! osg::ref_ptr<osg::Texture2D> mpiButtonOff; int mnState; }; *************** *** 59,74 **** void AttachOptions(tcOptions *apOptions) {mpOptions=apOptions;} ! bool Init(void); ! int Draw(void); ! void DrawButton(Gdiplus::Graphics *apGraphics, int anButton); ! void DrawButtonLine(Gdiplus::Graphics *apGraphics, int anButton); int GetActiveButton(void) {return mnActiveButton;} void OnLButtonDown(wxMouseEvent& event); void OnMouseMove(wxMouseEvent& event); ! void PlaceButtons(void); bool ButtonContainingPoint(wxPoint point, int& rnButton); tcStartView(wxWindow *parent, ! const wxPoint& pos, const wxSize& size, ! const wxString& name = "StartView"); virtual ~tcStartView(); --- 66,81 ---- void AttachOptions(tcOptions *apOptions) {mpOptions=apOptions;} ! bool Init(); ! int Draw(); ! void DrawButton(int anButton); ! void DrawButtonLine(int anButton); int GetActiveButton(void) {return mnActiveButton;} void OnLButtonDown(wxMouseEvent& event); void OnMouseMove(wxMouseEvent& event); ! void PlaceButtons(); bool ButtonContainingPoint(wxPoint point, int& rnButton); + tcStartView(wxWindow *parent, ! const wxPoint& pos, const wxSize& size, const wxString& name = "tc3DWindow"); virtual ~tcStartView(); *************** *** 76,85 **** enum {N_START_BUTTONS = 6}; tcOptions *mpOptions; - Gdiplus::SolidBrush *mpBrush; - Gdiplus::Font *mpFont; - Gdiplus::Pen *mpPen; tsButtonInfo maButton[N_START_BUTTONS]; ! int mnXStart,mnYStart; }; #endif \ No newline at end of file --- 83,91 ---- enum {N_START_BUTTONS = 6}; tcOptions *mpOptions; tsButtonInfo maButton[N_START_BUTTONS]; ! int mnXStart; ! int mnYStart; ! const int buttonSize; }; #endif \ No newline at end of file Index: tc3DWindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DWindow.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tc3DWindow.h 14 Sep 2004 23:17:16 -0000 1.2 --- tc3DWindow.h 16 Sep 2004 02:24:49 -0000 1.3 *************** *** 34,37 **** --- 34,38 ---- #include <osg/ref_ptr> + #include <osgText/Text> #include "common/simmath.h" *************** *** 59,62 **** --- 60,66 ---- #define IMAGE_PATH "images\\" + using osgText::Text::LEFT_BASE_LINE; + using osgText::Text::CENTER_CENTER; + /** * Window class for drawing to a 3D OSG scenegraph. *************** *** 67,70 **** --- 71,75 ---- { public: + enum {CENTER = 0, ALIGN_BOTTOM_LEFT = 1}; bool mbActive; tcRect mrectDisplay; *************** *** 77,81 **** void DrawBorder(); ! void DrawImage(osg::Texture2D* texture, float x, float y, float width, float height); void DrawLine(float x1, float y1, float x2, float y2, const osg::Vec4& color); --- 82,87 ---- void DrawBorder(); ! void DrawImage(osg::Texture2D* texture, float x, float y, float width, float height, ! int alignMode = CENTER); void DrawLine(float x1, float y1, float x2, float y2, const osg::Vec4& color); *************** *** 104,107 **** --- 110,114 ---- void LoadBackgroundImage(char* fileName); osg::Image* LoadImage(const char* fileName); + osg::Texture2D* LoadTexture(const char* fileName); virtual void Maximize(); virtual void Minimize(); *************** *** 157,160 **** --- 164,168 ---- static tc3DViewer* viewer; + void HideUnusedObjects(); wxString PrependImagePath(const char* fileName); virtual void OnChar(wxKeyEvent& event); *************** *** 194,200 **** - osgText::Text::AlignmentType LEFT_BASE_LINE; - osgText::Text::AlignmentType CENTER_CENTER; - void CreateBackgroundQuad(); void UpdateBackgroundQuadVertices(); --- 202,205 ---- *************** *** 205,209 **** osgText::Text* GetTextObject(); - void HideUnusedObjects(); void InitGraphicsObjects(); --- 210,213 ---- Index: tcCreditView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcCreditView.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcCreditView.h 5 Sep 2004 01:02:00 -0000 1.1 --- tcCreditView.h 16 Sep 2004 02:24:49 -0000 1.2 *************** *** 26,35 **** #include "wx/wx.h" ! #ifdef WIN32 ! #include "wx/msw/private.h" //for MS Windows specific definitions ! #endif ! #include "tcwindow.h" #include "tcSound.h" ! #include "aerror.h" #include "tcString.h" --- 26,33 ---- #include "wx/wx.h" ! ! #include "tc3DWindow.h" #include "tcSound.h" ! #include "AError.h" #include "tcString.h" *************** *** 37,41 **** * View window to display scrolling credits */ ! class tcCreditView : public tcWindow { struct tsCreditInfo --- 35,39 ---- * View window to display scrolling credits */ ! class tcCreditView : public tc3DWindow { struct tsCreditInfo *************** *** 51,68 **** void OnLButtonDown(wxMouseEvent& event); void Rewind(); ! tcCreditView(wxWindow *parent, const wxPoint& pos, const wxSize& size, ! const wxString& name = "CreditView", ! tcWindow *sharedSurface = NULL); ! virtual ~tcCreditView(void); private: enum {MAX_CREDITS = 96}; ! Gdiplus::SolidBrush *mpBrush; ! Gdiplus::Font *mpFont; ! Gdiplus::Font *mpFontLarge; ! Gdiplus::Font *mpFontSmall; ! Gdiplus::Pen *mpPen; ! UINT32 mnStartTime; // 30 Hz counter to mark start of sequence ! int mnXStart,mnYStart; tcString crawlstring; tsCreditInfo maCredit[MAX_CREDITS]; --- 49,66 ---- void OnLButtonDown(wxMouseEvent& event); void Rewind(); ! ! tcCreditView(wxWindow* parent, const wxPoint& pos, const wxSize& size, ! const wxString& name = "CreditView"); ! virtual ~tcCreditView(); private: enum {MAX_CREDITS = 96}; ! //Gdiplus::SolidBrush *mpBrush; ! //Gdiplus::Font *mpFont; ! //Gdiplus::Font *mpFontLarge; ! //Gdiplus::Font *mpFontSmall; ! //Gdiplus::Pen *mpPen; ! unsigned int mnStartTime; // 30 Hz counter to mark start of sequence ! int mnXStart, mnYStart; tcString crawlstring; tsCreditInfo maCredit[MAX_CREDITS]; |
|
From: Dewitt C. <ddc...@us...> - 2004-09-16 02:25:02
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11156/src/sim Modified Files: Game.cpp Log Message: Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.96 retrieving revision 1.97 diff -C2 -d -r1.96 -r1.97 *** Game.cpp 14 Sep 2004 23:17:16 -0000 1.96 --- Game.cpp 16 Sep 2004 02:24:50 -0000 1.97 *************** *** 500,508 **** share its 2D surface with the other windows */ InitializeStartView(); ! InitializeOptionsView(); InitializeCreditView(); ! InitializeNetworkView(); ! InitializeScenarioSelectView(); ! InitializeDisplaySettingsView(); tcMultiplayerInterface::Get()->SetEvtHandler(this); --- 500,508 ---- share its 2D surface with the other windows */ InitializeStartView(); ! //InitializeOptionsView(); InitializeCreditView(); ! //InitializeNetworkView(); ! //InitializeScenarioSelectView(); ! //InitializeDisplaySettingsView(); tcMultiplayerInterface::Get()->SetEvtHandler(this); *************** *** 623,627 **** smallViewerSize = wxSize(380, 200); ! startViewerSize = wxSize(mnWidth/2, mnWidth/4); startViewerPosition = wxPoint(mnWidth - startViewerSize.x, mnHeight - startViewerSize.y); --- 623,627 ---- smallViewerSize = wxSize(380, 200); ! startViewerSize = wxSize(mnWidth, mnHeight); startViewerPosition = wxPoint(mnWidth - startViewerSize.x, mnHeight - startViewerSize.y); *************** *** 666,672 **** void tcGame::InitializeStartView() { ! wxASSERT(glCanvas); ! ! startView = new tcStartView(glCanvas, wxPoint(0,0), frameSize); startView->AttachOptions(tcOptions::Get()); --- 666,671 ---- void tcGame::InitializeStartView() { ! wxSize viewerSize = viewer->GetSize(); ! startView = new tcStartView(viewer, wxPoint(0,0), viewerSize, "StartView"); startView->AttachOptions(tcOptions::Get()); *************** *** 687,690 **** --- 686,690 ---- void tcGame::InitializeOptionsView() { + #if 0 wxASSERT(startView); *************** *** 699,702 **** --- 699,703 ---- optionsView->SetActive(false); + #endif } *************** *** 707,711 **** void tcGame::InitializeNetworkView() { ! networkView = new tcNetworkView(glCanvas, startView, wxPoint(0,0), frameSize); } --- 708,712 ---- void tcGame::InitializeNetworkView() { ! //networkView = new tcNetworkView(glCanvas, startView, wxPoint(0,0), frameSize); } *************** *** 759,765 **** void tcGame::InitializeCreditView() { ! wxASSERT(startView); ! creditView = new tcCreditView(glCanvas, wxPoint(0,0), frameSize, ! "CreditView", startView); creditView->LoadBackgroundImage("start_background.jpg"); --- 760,766 ---- void tcGame::InitializeCreditView() { ! wxSize viewerSize = viewer->GetSize(); ! creditView = new tcCreditView(viewer, wxPoint(0,0), viewerSize, ! "CreditView"); creditView->LoadBackgroundImage("start_background.jpg"); *************** *** 795,802 **** void tcGame::InitializeDisplaySettingsView() { ! wxASSERT(startView); ! displaySettingsView = ! new tcDisplaySettingsView(glCanvas, startView, wxPoint(0,0), frameSize); } --- 796,803 ---- void tcGame::InitializeDisplaySettingsView() { ! // wxASSERT(startView); ! // displaySettingsView = ! // new tcDisplaySettingsView(glCanvas, startView, wxPoint(0,0), frameSize); } *************** *** 807,810 **** --- 808,812 ---- void tcGame::InitializeScenarioSelectView() { + #if 0 wxASSERT(startView); *************** *** 818,821 **** --- 820,824 ---- scenarioSelectView->SetActive(false); + #endif } *************** *** 1314,1322 **** if (meScreenMode != lastMode) { ! optionsView->SetActive(false); startView->SetActive(false); creditView->SetActive(false); ! scenarioSelectView->SetActive(false); ! networkView->SetActive(false); chatBox->SetActive(false); } --- 1317,1325 ---- if (meScreenMode != lastMode) { ! //optionsView->SetActive(false); startView->SetActive(false); creditView->SetActive(false); ! //scenarioSelectView->SetActive(false); ! //networkView->SetActive(false); chatBox->SetActive(false); } *************** *** 1408,1412 **** viewer->Update(gameDateZulu); ! mpGraphicsEngine->RenderAll(); viewer->Frame(); --- 1411,1415 ---- viewer->Update(gameDateZulu); ! //mpGraphicsEngine->RenderAll(); viewer->Frame(); |
|
From: Dewitt C. <ddc...@us...> - 2004-09-16 02:25:01
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11156/src/graphics Modified Files: tc3DWindow.cpp tcCreditView.cpp tcStartView.cpp Log Message: Index: tcStartView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcStartView.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcStartView.cpp 5 Sep 2004 01:02:02 -0000 1.1 --- tcStartView.cpp 16 Sep 2004 02:24:50 -0000 1.2 *************** *** 1,6 **** ! /* ! ** tcStartView.cpp ! ** ! ** Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** ! ** @file tcStartView.cpp ! */ ! /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 25,44 **** #ifndef WX_PRECOMP #include "wx/wx.h" - #ifdef WIN32 - #include "wx/msw/private.h" // for MS Windows specific definitions - #endif #endif #include "tcStartView.h" #include "tcSound.h" #include "tcOptions.h" ! #include "aerror.h" #include "wxcommands.h" - using namespace Gdiplus; bool tcStartView::Init() { ! char zBuff[96]; for(int i=0; i < N_START_BUTTONS; i++) --- 25,44 ---- #ifndef WX_PRECOMP #include "wx/wx.h" #endif #include "tcStartView.h" + + #include <osg/Texture2D> + #include <osg/Vec4> + #include "tcSound.h" #include "tcOptions.h" ! #include "AError.h" #include "wxcommands.h" bool tcStartView::Init() { ! wxString s; for(int i=0; i < N_START_BUTTONS; i++) *************** *** 46,67 **** tsButtonInfo *pButton = &maButton[i]; ! sprintf(zBuff,"%sstart%d%s",IMAGE_PATH,i,"_off.jpg"); ! MultiByteToWideChar(CP_ACP, 0, zBuff, -1, mzwchar, 255); ! pButton->mpiButtonOff = new Image(mzwchar,false); ! pButton->mnButtonWidth = pButton->mpiButtonOff->GetWidth(); ! pButton->mnButtonHeight = pButton->mpiButtonOff->GetHeight(); ! sprintf(zBuff,"%sstart%d%s",IMAGE_PATH,i,"_on.jpg"); ! MultiByteToWideChar(CP_ACP, 0, zBuff, -1, mzwchar, 255); ! pButton->mpiButtonOver = new Image(mzwchar,false); ! sprintf(zBuff,"%sstart%d%s",IMAGE_PATH,i,"_on.jpg"); ! MultiByteToWideChar(CP_ACP, 0, zBuff, -1, mzwchar, 255); ! pButton->mpiButtonOn = new Image(mzwchar,false); ! if ((pButton->mpiButtonOff == NULL)||(pButton->mpiButtonOver == NULL)|| ! (pButton->mpiButtonOn == NULL)) ! { ! WTL("tcStartView - button image load error, possible missing file"); ! } } --- 46,60 ---- tsButtonInfo *pButton = &maButton[i]; ! s = wxString::Format("start%d%s", i, "_off.jpg"); ! ! pButton->mpiButtonOff = LoadTexture(s.c_str()); ! pButton->mnButtonWidth = buttonSize; ! pButton->mnButtonHeight = buttonSize; ! s = wxString::Format("start%d%s", i, "_on.jpg"); ! pButton->mpiButtonOver = LoadTexture(s.c_str()); ! s = wxString::Format("start%d%s", i, "_on.jpg"); ! pButton->mpiButtonOn = LoadTexture(s.c_str()); } *************** *** 74,97 **** PlaceButtons(); - FontFamily ff(L"Arial"); - mpFont = new Font(&ff,10,FontStyleRegular,UnitPixel); - if (mpFont == NULL) - { - WTL("tcStartView - mpFont creation failed\n"); - return false; - } - mpBrush = new SolidBrush(Color(0xFEFFFFFF)); // color is ARGB - if (mpBrush == NULL) - { - WTL("tcStartView - mpBrush creation failed\n"); - return false; - } - mpPen = new Pen(Color(255,200,200,200),2); - if (mpPen == NULL) - { - WTL("tcStartView - mpPen creation failed\n"); - return false; - } - return true; } --- 67,70 ---- *************** *** 99,175 **** int tcStartView::Draw() { ! static WCHAR szwchar[256]; ! static nTestCount = 0; ! ! Graphics *pGraphics; ! ! Erase(); ! if (!GetGraphics(pGraphics)) ! { ! return false; ! } ! ! DrawBackground(pGraphics); ! /*** Draw buttons ***/ ! mpBrush->SetColor(Color(0xFEFFFFFF)); // font color ! for(int i=0;i<N_START_BUTTONS;i++) { ! DrawButtonLine(pGraphics, i); } ! for(int i=0;i<N_START_BUTTONS;i++) { ! DrawButton(pGraphics, i); } ! ReleaseGraphics(pGraphics); DrawBorder(); return true; } ! void tcStartView::DrawButton(Graphics *apGraphics, int anButton) { ! Image *pButtonImage; ! static WCHAR szwchar[256]; // wide char array buffer for string conversion ! int x,y,nState; - if (apGraphics == NULL) {return;} if ((anButton < 0)||(anButton >= N_START_BUTTONS)) {return;} tsButtonInfo *pButton = &maButton[anButton]; nState = pButton->mnState; ! if (nState == 0) {pButtonImage = pButton->mpiButtonOff;} ! else {pButtonImage = (nState == 1) ? pButton->mpiButtonOver : pButton->mpiButtonOn;} if (pButtonImage != NULL) { x = pButton->mnButtonX; ! y = pButton->mnButtonY; ! // not using size fields causes errors (stretching) with non power of 2 bitmap size ! apGraphics->DrawImage(pButtonImage,x,y,pButton->mnButtonWidth,pButton->mnButtonHeight); } if (nState != 0) { ! RectF textbox; ! textbox.X = (float)pButton->mnTextX; ! textbox.Y = (float)pButton->mnTextY; ! textbox.Width = pButton->mnButtonWidth * 2.5f; ! textbox.Height = 30; ! DrawTextInRectWrap(apGraphics, mpFont, mpBrush, pButton->mzCaption.GetBuffer(),textbox); ! mpPen->SetColor(0xFFFBFADE); ! } ! else ! { ! mpPen->SetColor(0xFF858476); } ! apGraphics->DrawRectangle(mpPen,pButton->mnButtonX,pButton->mnButtonY, ! pButton->mnButtonWidth,pButton->mnButtonHeight); } ! void tcStartView::DrawButtonLine(Graphics *apGraphics, int anButton) { int nState; - if (apGraphics == NULL) {return;} if ((anButton < 0)||(anButton >= N_START_BUTTONS)) {return;} --- 72,142 ---- int tcStartView::Draw() { ! //static nTestCount = 0; ! /*** Draw buttons ***/ ! ! for(int i=0; i<N_START_BUTTONS; i++) { ! DrawButtonLine(i); } ! ! for(int i=0; i<N_START_BUTTONS; i++) { ! DrawButton(i); } ! DrawBorder(); + + HideUnusedObjects(); return true; } ! void tcStartView::DrawButton(int anButton) { ! osg::Texture2D* pButtonImage; ! int x, y, nState; if ((anButton < 0)||(anButton >= N_START_BUTTONS)) {return;} + osg::Vec4 captionColor(1, 1, 1, 1); + tsButtonInfo *pButton = &maButton[anButton]; nState = pButton->mnState; ! if (nState == 0) {pButtonImage = pButton->mpiButtonOff.get();} ! else {pButtonImage = (nState == 1) ? pButton->mpiButtonOver.get() : ! pButton->mpiButtonOn.get();} if (pButtonImage != NULL) { x = pButton->mnButtonX; ! y = mnHeight - pButton->mnButtonY - pButton->mnButtonHeight; ! ! DrawImage(pButtonImage, x, y, pButton->mnButtonWidth, pButton->mnButtonHeight, ! ALIGN_BOTTOM_LEFT); } if (nState != 0) { ! float textx = (float)pButton->mnTextX; ! float texty = float(mnHeight) - float(pButton->mnTextY); ! //textbox.Width = pButton->mnButtonWidth * 2.5f; ! //textbox.Height = 30; ! //DrawTextInRectWrap(apGraphics, mpFont, mpBrush, pButton->mzCaption.GetBuffer(),textbox); ! //mpPen->SetColor(0xFFFBFADE); ! DrawText(pButton->mzCaption.GetBuffer(), textx, texty, defaultFont.get(), ! captionColor, 10.0f, LEFT_BASE_LINE); } ! // mpPen->SetColor(0xFF858476); ! ! ! osg::Vec4 outlineColor(0.45, 0.55, 0.55, 1.0f); ! DrawRect(pButton->mnButtonX, mnHeight-pButton->mnButtonY-pButton->mnButtonHeight, ! pButton->mnButtonWidth, pButton->mnButtonHeight, outlineColor); } ! void tcStartView::DrawButtonLine(int anButton) { int nState; if ((anButton < 0)||(anButton >= N_START_BUTTONS)) {return;} *************** *** 177,195 **** nState = pButton->mnState; if (nState != 0) { ! mpPen->SetColor(0xFFFBFADE); } else { ! mpPen->SetColor(0xFF858476); } int nLineY = pButton->mnButtonY + pButton->mnButtonHeight/2; int nLineX1 = pButton->mnButtonX; int nLineX2 = pButton->mnButtonX + pButton->mnButtonWidth; const int nMargin = 50; ! apGraphics->DrawLine(mpPen,nMargin,nLineY,nLineX1,nLineY); ! apGraphics->DrawLine(mpPen,nLineX2,nLineY,mnWidth-nMargin,nLineY); } --- 144,166 ---- nState = pButton->mnState; + osg::Vec4 color; + if (nState != 0) { ! color = osg::Vec4(0.7f, 0.92f, 0.92f, 1.0f); } else { ! color = osg::Vec4(0.45f, 0.55f, 0.55f, 1.0f); } int nLineY = pButton->mnButtonY + pButton->mnButtonHeight/2; + nLineY = mnHeight - nLineY; int nLineX1 = pButton->mnButtonX; int nLineX2 = pButton->mnButtonX + pButton->mnButtonWidth; const int nMargin = 50; ! ! DrawLine(nLineX1-50, nLineY, nLineX1, nLineY, color); ! DrawLine(nLineX2, nLineY, nLineX2+50, nLineY, color); } *************** *** 313,317 **** pButton->mnTextX = xpos; ! pButton->mnTextY = ypos+pButton->mnButtonHeight+2; pButton->mnButtonX = xpos; pButton->mnButtonY = ypos; --- 284,288 ---- pButton->mnTextX = xpos; ! pButton->mnTextY = ypos+pButton->mnButtonHeight+8; pButton->mnButtonX = xpos; pButton->mnButtonY = ypos; *************** *** 330,334 **** pPlayButton->mnButtonY = pScenarioButton->mnButtonY; pPlayButton->mnTextX = pPlayButton->mnButtonX; ! pPlayButton->mnTextY = pPlayButton->mnButtonY+pPlayButton->mnButtonHeight+2; // place Multiplay button to right of Options button --- 301,305 ---- pPlayButton->mnButtonY = pScenarioButton->mnButtonY; pPlayButton->mnTextX = pPlayButton->mnButtonX; ! pPlayButton->mnTextY = pPlayButton->mnButtonY+pPlayButton->mnButtonHeight+8; // place Multiplay button to right of Options button *************** *** 341,345 **** pMultiButton->mnButtonY = pOptionButton->mnButtonY; pMultiButton->mnTextX = pMultiButton->mnButtonX; ! pMultiButton->mnTextY = pMultiButton->mnButtonY+pMultiButton->mnButtonHeight+2; } --- 312,316 ---- pMultiButton->mnButtonY = pOptionButton->mnButtonY; pMultiButton->mnTextX = pMultiButton->mnButtonX; ! pMultiButton->mnTextY = pMultiButton->mnButtonY+pMultiButton->mnButtonHeight+8; } *************** *** 372,376 **** const wxPoint& pos, const wxSize& size, ! const wxString& name) : tcWindow(parent, pos, size, name) { wxSize parentSize = parent->GetSize(); --- 343,349 ---- const wxPoint& pos, const wxSize& size, ! const wxString& name) : ! tc3DWindow(parent, pos, size, name) , ! buttonSize(96) { wxSize parentSize = parent->GetSize(); *************** *** 393,398 **** mpOptions = NULL; ! mpFont = NULL; ! mpBrush = NULL; for (int i=0; i < N_START_BUTTONS; i++) --- 366,370 ---- mpOptions = NULL; ! for (int i=0; i < N_START_BUTTONS; i++) *************** *** 415,449 **** tcStartView::~tcStartView() { - if (mpFont != NULL) - { - delete mpFont; - } - - if (mpBrush != NULL) - { - delete mpBrush; - } - if (mpPen != NULL) - { - delete mpPen; - } - - for(int i=0; i < N_START_BUTTONS; i++) - { - if (maButton[i].mpiButtonOff != NULL) - { - delete maButton[i].mpiButtonOff; - } - - if (maButton[i].mpiButtonOver != NULL) - { - delete maButton[i].mpiButtonOver; - } - - if (maButton[i].mpiButtonOn != NULL) - { - delete maButton[i].mpiButtonOn; - } - } } \ No newline at end of file --- 387,390 ---- Index: tcCreditView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcCreditView.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcCreditView.cpp 14 Sep 2004 02:01:46 -0000 1.3 --- tcCreditView.cpp 16 Sep 2004 02:24:50 -0000 1.4 *************** *** 1,6 **** ! /* ** @file tcCreditView.cpp ! ** ! ** Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** ** @file tcCreditView.cpp ! */ ! /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 24,32 **** #ifndef WX_PRECOMP #include "wx/wx.h" - #ifdef WIN32 - #include "wx/msw/private.h" - #endif #endif #include "tcCreditView.h" #include "aerror.h" --- 24,33 ---- #ifndef WX_PRECOMP #include "wx/wx.h" #endif + + #include <osgText/Text> + #include <osgText/Font> + #include "tcCreditView.h" #include "aerror.h" *************** *** 35,39 **** #include "tcTime.h" ! using namespace Gdiplus; void tcCreditView::AddCredit(tcString& s, float afTrailSpace, int effect) --- 36,40 ---- #include "tcTime.h" ! void tcCreditView::AddCredit(tcString& s, float afTrailSpace, int effect) *************** *** 168,199 **** - FontFamily ff(L"Arial"); - mpFont = new Font(&ff,16,FontStyleRegular,UnitPixel); - if (mpFont == NULL) { - WTL("tcCreditView - mpFont creation failed\n"); - return false; - } - mpFontLarge = new Font(&ff,20,FontStyleBold,UnitPixel); - if (mpFontLarge == NULL) { - WTL("tcCreditView - mpFontLarge creation failed\n"); - return false; - } - mpFontSmall = new Font(&ff,12,FontStyleRegular,UnitPixel); - if (mpFontSmall == NULL) { - WTL("tcCreditView - mpFontSmall creation failed\n"); - return false; - } - - mpBrush = new SolidBrush(Color(0xFEFFFFFF)); // color is ARGB - if (mpBrush == NULL) { - WTL("tcCreditView - mpBrush creation failed\n"); - return false; - } - mpPen = new Pen(Color(255,200,200,200),2); - if (mpPen == NULL) { - WTL("tcCreditView - mpPen creation failed\n"); - return false; - } - Rewind(); return true; --- 169,172 ---- *************** *** 203,236 **** int tcCreditView::Draw() { ! static WCHAR szwchar[256]; ! UINT32 nDeltaTime = tcTime::Get()->Get30HzCount() - mnStartTime; ! ! Graphics *pGraphics; ! ! Erase(); ! if (!GetGraphics(pGraphics)) ! { ! return false; ! } ! ! DrawBackground(pGraphics); ! ! // Get the text rendering hint. ! TextRenderingHint oldhint = pGraphics->GetTextRenderingHint(); ! ! // Set the text rendering hint to TextRenderingHintAntiAlias. ! pGraphics->SetTextRenderingHint(TextRenderingHintAntiAlias); ! ! float fY = (float)mnHeight - 0.5f*(float)nDeltaTime; float fX = 0.5f*(float)mnWidth; ! const UINT32 nColorFade = 0x8E328032; ! const UINT32 nColorBright = 0xFE64FF64; ! mpBrush->SetColor(Color(nColorBright)); // font color //DrawTextCentered(pGraphics, mpFont, mpBrush, crawlstring.GetBuffer(), fX,fY); static int nFlashId = -1; static bool bFlash = false; ! static UINT32 snFocusTime; static tcString szFocus; --- 176,196 ---- int tcCreditView::Draw() { ! //static WCHAR szwchar[256]; ! unsigned int nDeltaTime = tcTime::Get()->Get30HzCount() - mnStartTime; ! const float height = float(mnHeight); ! float fY = 0.5f*(float)nDeltaTime; float fX = 0.5f*(float)mnWidth; ! //const UINT32 nColorFade = 0x8E328032; ! //const UINT32 nColorBright = 0xFE64FF64; ! const osg::Vec4 nColorFade(0.2f, 0.5f, 0.2f, 0.5f); ! const osg::Vec4 nColorBright(0.4f, 1.0f, 0.4f, 1.0f); ! ! //mpBrush->SetColor(Color(nColorBright)); // font color //DrawTextCentered(pGraphics, mpFont, mpBrush, crawlstring.GetBuffer(), fX,fY); static int nFlashId = -1; static bool bFlash = false; ! static unsigned int snFocusTime; static tcString szFocus; *************** *** 247,257 **** if (nFlashId >= 0) {szFocus = maCredit[nFlashId].mzCaption;} snFocusTime = tcTime::Get()->Get30HzCount(); ! mpBrush->SetColor(Color(255,255,255,255)); ! pGraphics->FillRectangle(mpBrush,0,0,mnWidth,mnHeight); //tcSound::Get()->PlayEffect(SEFFECT_EXPLOSION2); } if (nFlashId >= 0) { ! UINT32 nDeltaFocusTime = (tcTime::Get()->Get30HzCount() - snFocusTime); } for (int n=0;n<(int)mnCredits;n++) --- 207,217 ---- if (nFlashId >= 0) {szFocus = maCredit[nFlashId].mzCaption;} snFocusTime = tcTime::Get()->Get30HzCount(); ! //mpBrush->SetColor(Color(255,255,255,255)); ! //pGraphics->FillRectangle(mpBrush,0,0,mnWidth,mnHeight); //tcSound::Get()->PlayEffect(SEFFECT_EXPLOSION2); } if (nFlashId >= 0) { ! unsigned int nDeltaFocusTime = (tcTime::Get()->Get30HzCount() - snFocusTime); } for (int n=0;n<(int)mnCredits;n++) *************** *** 259,280 **** tcString s = maCredit[n].mzCaption; const float fEffectZone = 60.0f; ! float dyeffect = fY - ((float)mnHeight - fEffectZone); ! if ((dyeffect >= 0)&&(dyeffect <= fEffectZone)) { ! mpBrush->SetColor(Color(nColorFade)); // font color ! DrawTextCentered(pGraphics, mpFont, mpBrush, s.GetBuffer(), ! fX - 40.0f*dyeffect,fY); ! DrawTextCentered(pGraphics, mpFont, mpBrush, s.GetBuffer(), ! fX + 40.0f*dyeffect,fY); ! DrawTextCentered(pGraphics, mpFont, mpBrush, s.GetBuffer(), ! fX - 30.0f*dyeffect,fY); ! DrawTextCentered(pGraphics, mpFont, mpBrush, s.GetBuffer(), ! fX + 30.0f*dyeffect,fY); ! DrawTextCentered(pGraphics, mpFont, mpBrush, s.GetBuffer(), ! fX - 20.0f*dyeffect,fY); ! DrawTextCentered(pGraphics, mpFont, mpBrush, s.GetBuffer(), ! fX + 20.0f*dyeffect,fY); ! mpBrush->SetColor(Color(nColorBright)); // font color } ! else if (fY <= (float)mnHeight) { if ((n > nFlashId)&&(maCredit[n].mnEffect == 1)) --- 219,234 ---- tcString s = maCredit[n].mzCaption; const float fEffectZone = 60.0f; ! float dyeffect = fEffectZone - fY; ! if ((dyeffect >= 0)&&(dyeffect <= fEffectZone)) ! { ! for (float dx = 20.0f; dx <= 40.0f; dx += 10.0f) ! { ! DrawText(s.GetBuffer(), fX + dx*dyeffect, fY, defaultFont.get(), ! nColorFade, 12.0f, CENTER_CENTER); ! DrawText(s.GetBuffer(), fX - dx*dyeffect, fY, defaultFont.get(), ! nColorFade, 12.0f, CENTER_CENTER); ! } } ! else if ((fY >= 0) && (fY <= height)) { if ((n > nFlashId)&&(maCredit[n].mnEffect == 1)) *************** *** 287,319 **** bFlash = false; } ! Font *pFont = mpFont; if (maCredit[n].mnEffect == 1) { ! pFont = mpFontLarge; } else if (maCredit[n].mnEffect == 2) { ! pFont = mpFontSmall; } ! mpBrush->SetColor(Color(nColorFade)); // font color ! DrawTextCentered(pGraphics, pFont, mpBrush, s.GetBuffer(), ! fX + 1.0f,fY + 1.0f); ! mpBrush->SetColor(Color(nColorBright)); // font color ! DrawTextCentered(pGraphics, pFont, mpBrush, s.GetBuffer(), fX,fY); } ! fY += maCredit[n].mfTrailSpace; } ! pGraphics->SetTextRenderingHint(oldhint); ! ReleaseGraphics(pGraphics); DrawBorder(); // rewind after credits are done crawling ! if (fY < -100.0f) { Rewind(); } return true; } --- 241,279 ---- bFlash = false; } ! ! float fontSize = 12.0; if (maCredit[n].mnEffect == 1) { ! fontSize = 18.0f; //pFont = mpFontLarge; } else if (maCredit[n].mnEffect == 2) { ! fontSize = 12.0f; //pFont = mpFontSmall; } ! DrawText(s.GetBuffer(), fX + 1.0f, fY + 1.0f, defaultFont.get(), ! nColorFade, fontSize, CENTER_CENTER); ! DrawText(s.GetBuffer(), fX, fY, defaultFont.get(), ! nColorBright, fontSize, CENTER_CENTER); } ! fY -= maCredit[n].mfTrailSpace; } ! static unsigned int frameCount = 0; ! wxString infoString = wxString::Format("%d Y:%f\n", frameCount, fY); ! frameCount++; ! DrawText(infoString.c_str(), 10, 10, defaultFont.get(), ! nColorBright, 16.0f, LEFT_BASE_LINE); ! DrawBorder(); // rewind after credits are done crawling ! if (fY > height + 100.0f) { Rewind(); } + + HideUnusedObjects(); return true; } *************** *** 343,353 **** tcCreditView::tcCreditView(wxWindow *parent, const wxPoint& pos, const wxSize& size, ! const wxString& name, tcWindow *sharedSurface) ! : tcWindow(parent, pos, size, name, sharedSurface) { - mpFont = NULL; - mpFontLarge = NULL; - mpFontSmall = NULL; - mpBrush = NULL; mnCredits = 0; mbDrawRewind = false; --- 303,309 ---- tcCreditView::tcCreditView(wxWindow *parent, const wxPoint& pos, const wxSize& size, ! const wxString& name) ! : tc3DWindow(parent, pos, size, name) { mnCredits = 0; mbDrawRewind = false; *************** *** 356,364 **** tcCreditView::~tcCreditView() { ! if (mpFont != NULL) {delete mpFont;} ! if (mpFontLarge != NULL) {delete mpFontLarge;} ! if (mpFontSmall != NULL) {delete mpFontSmall;} ! if (mpBrush != NULL) {delete mpBrush;} ! if (mpPen != NULL) {delete mpPen;} } --- 312,316 ---- tcCreditView::~tcCreditView() { ! } Index: tc3DWindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DWindow.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tc3DWindow.cpp 14 Sep 2004 23:17:16 -0000 1.2 --- tc3DWindow.cpp 16 Sep 2004 02:24:50 -0000 1.3 *************** *** 27,30 **** --- 27,31 ---- #include <osg/ClipNode> + #include <osg/Depth> #include <osg/DrawPixels> #include <osg/Geode> *************** *** 244,248 **** stateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF); stateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF); ! stateSet->setRenderBinDetails(1, "RenderBin"); --- 245,253 ---- stateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF); stateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF); ! stateSet->setRenderBinDetails(-10, "RenderBin"); ! ! osg::Depth* depth = new osg::Depth(osg::Depth::ALWAYS, 1, 1, false); ! depth->setWriteMask(0); ! stateSet->setAttribute(depth); *************** *** 289,296 **** --- 294,312 ---- } wxWindow::Enable(true); + + if (!root->getNumParents()) + { + clipNode->addChild(root.get()); + } + } else { wxWindow::Enable(false); + + if (root->getNumParents()) + { + clipNode->removeChild(root.get()); + } } mbActive=abActive; *************** *** 572,575 **** --- 588,593 ---- stateset->setTextureAttributeAndModes(0, backgroundTexture.get(), osg::StateAttribute::ON); + + SetBackgroundDraw(true); } *************** *** 596,599 **** --- 614,638 ---- } + + osg::Texture2D* tc3DWindow::LoadTexture(const char* fileName) + { + wxString fileWithPath = PrependImagePath(fileName); + osg::Image* image = osgDB::readImageFile(fileWithPath.c_str()); + + if (!image) + { + fprintf(stderr, "Failed to load image: %s\n", fileName); + return 0; + } + + osg::Texture2D* tex = new osg::Texture2D; + tex->setDataVariance(osg::Object::STATIC); + tex->setImage(image); + + return tex; + } + + + void tc3DWindow::SetBackground(UINT32 anColor) { *************** *** 651,657 **** * @param x center x coord * @param y center y coord */ void tc3DWindow::DrawImage(osg::Texture2D* texture, float x, float y, ! float width, float height) { wxASSERT(texture); --- 690,697 ---- * @param x center x coord * @param y center y coord + * @param alignMode CENTER (default) or ALIGN_BOTTOM_LEFT */ void tc3DWindow::DrawImage(osg::Texture2D* texture, float x, float y, ! float width, float height, int alignMode) { wxASSERT(texture); *************** *** 664,673 **** if (osg::Vec3Array* vertices = dynamic_cast<osg::Vec3Array*>(quad->getVertexArray())) { ! const float half_width = 0.5f * width; ! const float half_height = 0.5f * height; ! float left = x - half_width; ! float right = x + half_width; ! float top = y + half_height; ! float bottom = y - half_height; (*vertices)[0] = osg::Vec3(left, top, 0); --- 704,724 ---- if (osg::Vec3Array* vertices = dynamic_cast<osg::Vec3Array*>(quad->getVertexArray())) { ! float left, right, top, bottom; ! if (alignMode == CENTER) ! { ! const float half_width = 0.5f * width; ! const float half_height = 0.5f * height; ! left = x - half_width; ! right = x + half_width; ! top = y + half_height; ! bottom = y - half_height; ! } ! else ! { ! left = x; ! right = x + width; ! top = y + height; ! bottom = y; ! } (*vertices)[0] = osg::Vec3(left, top, 0); *************** *** 849,853 **** if (textIdx < nPool) { ! return textPool[textIdx++].get(); } else if (textIdx == nPool) --- 900,910 ---- if (textIdx < nPool) { ! osgText::Text* text = textPool[textIdx++].get(); ! wxASSERT(text); ! if (text->getNumParents() == 0) ! { ! root->addDrawable(text); ! } ! return text; } else if (textIdx == nPool) *************** *** 862,865 **** --- 919,923 ---- text->setText("UNINTIALIZED"); + text->setUseDisplayList(false); osg::StateSet* stateSet = text->getOrCreateStateSet(); stateSet->setRenderBinDetails(10, "RenderBin"); *************** *** 890,894 **** for (unsigned idx = textIdx; idx < textPool.size(); ++idx) { ! textPool[idx]->setPosition(osg::Vec3(10000.0f, 10000.0f, -10000.0f)); } textIdx = 0; --- 948,953 ---- for (unsigned idx = textIdx; idx < textPool.size(); ++idx) { ! root->removeDrawable(textPool[idx].get()); ! //textPool[idx]->setPosition(osg::Vec3(10000.0f, 10000.0f, -10000.0f)); } textIdx = 0; *************** *** 1014,1017 **** --- 1073,1081 ---- root = new osg::Geode; + osg::StateSet* stateSet = root->getOrCreateStateSet(); + + osg::Depth* depth = new osg::Depth(osg::Depth::ALWAYS, 0, 0, false); + stateSet->setAttributeAndModes(depth, osg::StateAttribute::ON); + clipNode = new osg::ClipNode; clipNode->createClipBox( *************** *** 1063,1072 **** CreateBackgroundQuad(); ! LoadBackgroundImage("console_b.jpg"); ! SetBackgroundDraw(true); ! ! ! LEFT_BASE_LINE = osgText::Text::LEFT_BASE_LINE; ! CENTER_CENTER = osgText::Text::CENTER_CENTER; } --- 1127,1132 ---- CreateBackgroundQuad(); ! //LoadBackgroundImage("console_b.jpg"); ! //SetBackgroundDraw(true); } |
|
From: Dewitt C. <ddc...@us...> - 2004-09-14 23:17:26
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23080/src/sim Modified Files: Game.cpp Log Message: Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.95 retrieving revision 1.96 diff -C2 -d -r1.95 -r1.96 *** Game.cpp 14 Sep 2004 02:01:47 -0000 1.95 --- Game.cpp 14 Sep 2004 23:17:16 -0000 1.96 *************** *** 491,497 **** --- 491,499 ---- tc3DWindow::Set3DViewer(viewer); + /* test3DWindow = new tc3DWindow(viewer, wxPoint(0, 0), wxSize(150, 80), "Test3DWindow"); test3DWindow->SetActive(true); + */ /* start view has to be initialized first so that we can *************** *** 1353,1357 **** viewer->SetActive(true); ! test3DWindow->Draw(); viewer->SetCameraAz(viewer->GetCameraAz() + 0.02f); --- 1355,1359 ---- viewer->SetActive(true); ! //test3DWindow->Draw(); viewer->SetCameraAz(viewer->GetCameraAz() + 0.02f); |
|
From: Dewitt C. <ddc...@us...> - 2004-09-14 23:17:25
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23080/src/graphics Modified Files: tc3DWindow.cpp Log Message: Index: tc3DWindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DWindow.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tc3DWindow.cpp 14 Sep 2004 02:01:46 -0000 1.1 --- tc3DWindow.cpp 14 Sep 2004 23:17:16 -0000 1.2 *************** *** 394,397 **** --- 394,399 ---- osg::Vec4(1.0, 1.0, 1.0, 1.0), 12.0f, CENTER_CENTER); + DrawRect(x2 + 5, y2 + 5, 10, 30, osg::Vec4(1.0f, 0.2f, 0.2f, 1.0f)); + DrawBorder(); *************** *** 420,423 **** --- 422,435 ---- } + void tc3DWindow::DrawRect(float x1, float y1, float width, float height, + const osg::Vec4& color) + { + osg::Vec4 white(1.0f, 1.0f, 1.0f, 1.0f); + + DrawLine(x1, y1, x1, y1 + height, color); + DrawLine(x1, y1 + height, x1 + width, y1 + height, color); + DrawLine(x1 + width, y1 + height, x1 + width, y1, color); + DrawLine(x1 + width, y1, x1, y1, color); + } void tc3DWindow::DrawText(const char* s, float x, float y, osgText::Font* font, |