[Gcblue-commits] gcb_wx/src/graphics tc3DViewer.cpp,1.28,1.29 tc3DWindow.cpp,1.31,1.32 tcButton.cpp,
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2006-01-05 03:47:31
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30927/src/graphics Modified Files: tc3DViewer.cpp tc3DWindow.cpp tcButton.cpp tcContainerGui.cpp tcContainerItem.cpp tcFlightPortGui.cpp tcLauncherPopup.cpp tcMapView.cpp tcPlatformGui.cpp tcStoresGui.cpp tcTextEntryBox.cpp Log Message: db fixes, GUI tweaks, random sensor detections Index: tcFlightPortGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcFlightPortGui.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcFlightPortGui.cpp 26 Dec 2005 22:14:03 -0000 1.5 --- tcFlightPortGui.cpp 5 Jan 2006 03:47:22 -0000 1.6 *************** *** 566,570 **** { ReadGuiParameters(); ! InitializeGui(); --- 566,570 ---- { ReadGuiParameters(); ! InitializeGui(); Index: tcLauncherPopup.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcLauncherPopup.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcLauncherPopup.cpp 12 Dec 2005 02:37:01 -0000 1.10 --- tcLauncherPopup.cpp 5 Jan 2006 03:47:22 -0000 1.11 *************** *** 510,513 **** --- 510,515 ---- { SetBaseRenderBin(parent->GetBaseRenderBin() + 10); + tc3DWindow::MoveToTop(); + birthCount = tcTime::Get()->Get30HzCount(); Index: tcPlatformGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcPlatformGui.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcPlatformGui.cpp 26 Dec 2005 22:14:03 -0000 1.6 --- tcPlatformGui.cpp 5 Jan 2006 03:47:22 -0000 1.7 *************** *** 654,658 **** { ReadGuiParameters(); ! InitializeGui(); --- 654,658 ---- { ReadGuiParameters(); ! InitializeGui(); Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapView.cpp,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** tcMapView.cpp 2 Jan 2006 15:40:53 -0000 1.42 --- tcMapView.cpp 5 Jan 2006 03:47:22 -0000 1.43 *************** *** 469,473 **** osg::Vec4 color(0.784, 0.784, 0.784, 1.0); ! DrawTextR(sText.GetBuffer(), leftMargin + 50.0, mnHeight-25.0, defaultFont.get(), color, 16.0, CENTER_CENTER); --- 469,473 ---- osg::Vec4 color(0.784, 0.784, 0.784, 1.0); ! DrawTextR(sText.GetBuffer(), leftMargin + 50.0, mnHeight - 225.0, defaultFont.get(), color, 16.0, CENTER_CENTER); *************** *** 477,483 **** color.set(1, 1, 1, 1); ! DrawLineR(nBarX1, mnHeight-15, nBarX2, mnHeight-15, color); // draw horizontal piece ! DrawLineR(nBarX1, mnHeight-15-5, nBarX1, mnHeight-15+5, color); // draw left vertical piece ! DrawLineR(nBarX2, mnHeight-15-5, nBarX2, mnHeight-15+5, color); // draw right vert piece } --- 477,483 ---- color.set(1, 1, 1, 1); ! DrawLineR(nBarX1, mnHeight-215, nBarX2, mnHeight-215, color); // draw horizontal piece ! DrawLineR(nBarX1, mnHeight-215-5, nBarX1, mnHeight-215+5, color); // draw left vertical piece ! DrawLineR(nBarX2, mnHeight-215-5, nBarX2, mnHeight-215+5, color); // draw right vert piece } *************** *** 510,514 **** osg::Vec4 color(1, 1, 1, 1); ! DrawTextR(sText.GetBuffer(), leftMargin + 50.0, mnHeight - 50.0, defaultFont.get(), color, 16.0, LEFT_BASE_LINE); } --- 510,514 ---- osg::Vec4 color(1, 1, 1, 1); ! DrawTextR(sText.GetBuffer(), leftMargin + 50.0, mnHeight - 250.0, defaultFont.get(), color, 16.0, LEFT_BASE_LINE); } *************** *** 650,654 **** unsigned timeCount = tcTime::Get()->Get30HzCount(); ! if (scrollActive && (timeCount - lastScrollTime > 1)) { ScrollMap(scrollDirection); --- 650,654 ---- unsigned timeCount = tcTime::Get()->Get30HzCount(); ! if (scrollActive && (timeCount - lastScrollTime >= 1)) { ScrollMap(scrollDirection); *************** *** 2282,2287 **** void tcTacticalMapView::OnLeaveWindow(wxMouseEvent& event) { ! scrollActive = false; ! isLButtonDown = false; } --- 2282,2288 ---- void tcTacticalMapView::OnLeaveWindow(wxMouseEvent& event) { ! wxPoint point = event.GetPosition(); ! ! UpdateEdgeScroll(point); } *************** *** 2394,2397 **** --- 2395,2405 ---- } + + void tcTacticalMapView::CancelScroll() + { + scrollActive = false; + scrollDirection = 0.0f; + } + /** * Check if button is down near a nav waypoint-- if so, start edit *************** *** 2518,2525 **** { wxPoint point = event.GetPosition(); - const int nScrollBorder = 10; - mpointMouse = point; // +200 is a hack to workaround the semi-transparent overlay window if (mpointMouse.x <= nScrollBorder + 200) --- 2526,2539 ---- { wxPoint point = event.GetPosition(); mpointMouse = point; + scrollActive = false; + scrollDirection = 0.0f; + + // changed to scroll at window edge + /* + + const int nScrollBorder = 10; + // +200 is a hack to workaround the semi-transparent overlay window if (mpointMouse.x <= nScrollBorder + 200) *************** *** 2553,2556 **** --- 2567,2571 ---- lastScrollTime = tcTime::Get()->Get30HzCount(); } + */ } *************** *** 2577,2580 **** --- 2592,2597 ---- overlay->SetActive(abActive); tcMapView::SetActive(abActive); + + if (!abActive) CancelScroll(); } *************** *** 2617,2620 **** --- 2634,2677 ---- } + /** + * Check if cursor is near edge of window, if so activate scroll + */ + void tcTacticalMapView::UpdateEdgeScroll(const wxPoint& pos) + { + const int nScrollBorder = 10; + + mpointMouse = pos; + + if (mpointMouse.x <= nScrollBorder) + { + scrollActive = true; + scrollDirection = 270.0f; + } + else if (mpointMouse.x >= mnWidth - nScrollBorder) + { + scrollActive = true; + scrollDirection = 90.0f; + } + else if (mpointMouse.y <= nScrollBorder) + { + scrollActive = true; + scrollDirection = 0.0f; + } + else if (mpointMouse.y >= mnHeight - nScrollBorder) + { + scrollActive = true; + scrollDirection = 180.0f; + } + else + { + scrollActive = false; + scrollDirection = 0.0f; + } + + if (scrollActive) + { + lastScrollTime = tcTime::Get()->Get30HzCount(); + } + } void tcTacticalMapView::UpdateNavPoints(vector<GeoPoint> *mpPoints) *************** *** 2964,2967 **** --- 3021,3026 ---- wxPoint point = event.GetPosition(); mpointMouse = point; // TranslatePoint(point); + + event.Skip(); } Index: tcContainerItem.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcContainerItem.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcContainerItem.cpp 11 Jun 2005 21:01:44 -0000 1.1 --- tcContainerItem.cpp 5 Jan 2006 03:47:22 -0000 1.2 *************** *** 123,126 **** --- 123,130 ---- tcContainerItem::~tcContainerItem() { + if (gui) + { + gui->SetParentItem(0); + } } Index: tcContainerGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcContainerGui.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcContainerGui.cpp 2 Jan 2006 15:40:53 -0000 1.7 --- tcContainerGui.cpp 5 Jan 2006 03:47:22 -0000 1.8 *************** *** 520,523 **** --- 520,528 ---- tcContainerGui::~tcContainerGui() { + if (parentItem) + { + parentItem->SetGui(0); + } + for (size_t n=0; n<slots.size(); n++) { Index: tcStoresGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcStoresGui.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcStoresGui.cpp 26 Dec 2005 22:14:03 -0000 1.5 --- tcStoresGui.cpp 5 Jan 2006 03:47:22 -0000 1.6 *************** *** 349,353 **** { ReadGuiParameters(); ! InitializeGui(); --- 349,353 ---- { ReadGuiParameters(); ! InitializeGui(); Index: tcButton.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcButton.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** tcButton.cpp 10 Sep 2005 21:47:38 -0000 1.19 --- tcButton.cpp 5 Jan 2006 03:47:22 -0000 1.20 *************** *** 212,225 **** offColor(0, 0, 0, 1), overColor(0.4, 1, 0.4, 1), ! onColor(1, 1, 1, 1) { - caption = "NULL"; - command = -1; - isButtonOn = false; - isMouseOver = false; - soundEffect = "MutedBeep"; - fontSize = 12.0f; - sendRedraw = false; - backgroundAlpha = 1.0f; ref_count++; --- 212,225 ---- offColor(0, 0, 0, 1), overColor(0.4, 1, 0.4, 1), ! onColor(1, 1, 1, 1), ! caption("NULL"), ! command(-1), ! isButtonOn(false), ! isMouseOver(false), ! soundEffect(""), ! fontSize(12.0f), ! sendRedraw(false), ! backgroundAlpha(1.0f) { ref_count++; *************** *** 310,314 **** overOnImageName = onImageName; } ! LoadImages(offImageName, onImageName, overOffImageName, overOnImageName); --- 310,318 ---- overOnImageName = onImageName; } ! ! if (const char* s = imageElement->Attribute("SoundEffect")) ! { ! soundEffect = s; ! } LoadImages(offImageName, onImageName, overOffImageName, overOnImageName); Index: tc3DWindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DWindow.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** tc3DWindow.cpp 2 Jan 2006 15:40:53 -0000 1.31 --- tc3DWindow.cpp 5 Jan 2006 03:47:22 -0000 1.32 *************** *** 168,171 **** --- 168,172 ---- void tc3DWindow::OnLeaveWindow(wxMouseEvent& event) { + event.Skip(); } *************** *** 218,221 **** --- 219,223 ---- void tc3DWindow::UpdatePositionAndSize(const wxPoint& pos, const wxSize& size) { + bool sizeChanged = (size.GetWidth() != mnWidth) || (size.GetHeight() != mnHeight); mnWidth = size.GetWidth(); mnHeight = size.GetHeight(); *************** *** 234,241 **** mrectWindow.height = size.GetHeight(); - transform->setMatrix(osg::Matrix::translate(pos.x, pos.y + yOffset, 0)); ! UpdateBackgroundQuadVertices(); } --- 236,245 ---- mrectWindow.height = size.GetHeight(); transform->setMatrix(osg::Matrix::translate(pos.x, pos.y + yOffset, 0)); ! if (sizeChanged) ! { ! UpdateBackgroundShape(); ! } } *************** *** 320,332 **** } /** ! * Called after window size change to update quad boundaries */ ! void tc3DWindow::UpdateBackgroundQuadVertices() { ! //UpdateBackgroundShape(); ! //return; ! ! wxASSERT(backgroundQuad.valid()); osg::Vec3Array* vertices = new osg::Vec3Array(4); --- 324,338 ---- } + + /** ! * Called at window creation or after window size change to update quad boundaries */ ! void tc3DWindow::UpdateBackgroundQuad() { ! if (!backgroundQuad.valid()) ! { ! backgroundQuad = new osg::Geometry; ! } osg::Vec3Array* vertices = new osg::Vec3Array(4); *************** *** 337,355 **** backgroundQuad->setVertexArray(vertices); - backgroundQuad->dirtyDisplayList(); - } - - - - void tc3DWindow::CreateBackgroundQuad() - { - //CreateBackgroundShape(); - //return; - - wxASSERT(!backgroundQuad.valid()); - - backgroundQuad = new osg::Geometry; - - UpdateBackgroundQuadVertices(); osg::Vec2Array* texcoords = new osg::Vec2Array(4); --- 343,346 ---- *************** *** 393,446 **** /** * Version to create rounded background quads */ ! void tc3DWindow::CreateBackgroundShape() { //wxASSERT(!backgroundQuad.valid()); ! backgroundQuad = new osg::Geometry; ! osg::Vec3Array* vertices = new osg::Vec3Array; osg::Vec2Array* texcoords = new osg::Vec2Array; - float xc = 0.5; // normalized coords (0-1) - float yc = 0.5; - float rx = 0.5; - float ry = 0.5; - float xp = xc; - float yp = yc + ry; float width = float(mnWidth); float height = float(mnHeight); ! int nAngles = 32; ! float dangle = C_TWOPI / float(nAngles); ! float angle = dangle; for (int k=0; k<nAngles; k++) { ! float x = xc + rx * sinf(angle); ! float y = yc + ry * cosf(angle); ! vertices->push_back(osg::Vec3(width*xc, height*yc, 0)); ! texcoords->push_back(osg::Vec2(xc, yc)); ! vertices->push_back(osg::Vec3(width*x, height*y, 0)); ! texcoords->push_back(osg::Vec2(x, y)); ! vertices->push_back(osg::Vec3(width*xp, height*yp, 0)); ! texcoords->push_back(osg::Vec2(xp, yp)); xp = x; yp = y; ! angle += dangle; } ! backgroundQuad->setVertexArray(vertices); ! backgroundQuad->dirtyDisplayList(); ! backgroundQuad->setTexCoordArray(0,texcoords); osg::Vec4Array* colors = new osg::Vec4Array; --- 384,611 ---- /** * Version to create rounded background quads + * Create background polygon and border graphics based on cornerRadius value. + * cornerRadius = 0 is square corners (no rounding) */ ! void tc3DWindow::UpdateBackgroundShape() { //wxASSERT(!backgroundQuad.valid()); + + if (cornerRadius == 0) + { + UpdateBackgroundQuad(); + return; + } ! if (!backgroundQuad.valid()) ! { ! backgroundQuad = new osg::Geometry; ! } ! if (!border.valid()) ! { ! border = new osg::Geometry; ! } osg::Vec3Array* vertices = new osg::Vec3Array; osg::Vec2Array* texcoords = new osg::Vec2Array; + osg::Vec3Array* borderVertices = new osg::Vec3Array; float width = float(mnWidth); float height = float(mnHeight); + float inv_width = 1.0f / width; + float inv_height = 1.0f / height; + float xc = 0.5 * width; + float yc = 0.5 * height; ! ! int nAngles = 4; // number of points for rounded corner ! float dangle = C_PIOVER2 / float(nAngles); ! ! float x, y, xp, yp; ! float xcorner, ycorner; // center point for corner arc ! float angle; ! ! ! // add top section ! ! x = width - cornerRadius; ! y = height; ! vertices->push_back(osg::Vec3(x, y, 0)); ! borderVertices->push_back(osg::Vec3(x, y, 0)); ! texcoords->push_back(osg::Vec2(inv_width * x, inv_height * y)); ! ! x = cornerRadius; ! y = height; ! vertices->push_back(osg::Vec3(x, y, 0)); ! borderVertices->push_back(osg::Vec3(x, y, 0)); ! texcoords->push_back(osg::Vec2(inv_width * x, inv_height * y)); ! ! vertices->push_back(osg::Vec3(xc, yc, 0)); ! //texcoords->push_back(osg::Vec2(inv_width * xc, inv_height * yc)); ! texcoords->push_back(osg::Vec2(0.5f, 0.5f)); ! ! ! ! ! ! ! // add top left corner ! xp = x; ! yp = y; ! xcorner = cornerRadius; ! ycorner = height - cornerRadius; ! ! angle = -dangle; for (int k=0; k<nAngles; k++) { ! x = xcorner + cornerRadius * sinf(angle); ! y = ycorner + cornerRadius * cosf(angle); ! vertices->push_back(osg::Vec3(xp, yp, 0)); ! borderVertices->push_back(osg::Vec3(xp, yp, 0)); ! texcoords->push_back(osg::Vec2(inv_width * xp, inv_height * yp)); ! ! vertices->push_back(osg::Vec3(x, y, 0)); ! borderVertices->push_back(osg::Vec3(x, y, 0)); ! texcoords->push_back(osg::Vec2(inv_width * x, inv_height * y)); ! vertices->push_back(osg::Vec3(xc, yc, 0)); ! texcoords->push_back(osg::Vec2(inv_width * xc, inv_height * yc)); ! xp = x; ! yp = y; ! angle -= dangle; ! } ! ! ! // add left section ! vertices->push_back(osg::Vec3(x, y, 0)); ! borderVertices->push_back(osg::Vec3(x, y, 0)); ! texcoords->push_back(osg::Vec2(inv_width * x, inv_height * y)); ! ! x = 0; ! y = cornerRadius; ! vertices->push_back(osg::Vec3(x, y, 0)); ! borderVertices->push_back(osg::Vec3(x, y, 0)); ! texcoords->push_back(osg::Vec2(inv_width * x, inv_height * y)); ! ! vertices->push_back(osg::Vec3(xc, yc, 0)); ! texcoords->push_back(osg::Vec2(inv_width * xc, inv_height * yc)); ! ! // add lower left corner ! xp = x; ! yp = y; ! xcorner = cornerRadius; ! ycorner = cornerRadius; + angle = -(C_PIOVER2 + dangle); + for (int k=0; k<nAngles; k++) + { + x = xcorner + cornerRadius * sinf(angle); + y = ycorner + cornerRadius * cosf(angle); + vertices->push_back(osg::Vec3(xp, yp, 0)); + borderVertices->push_back(osg::Vec3(xp, yp, 0)); + texcoords->push_back(osg::Vec2(inv_width * xp, inv_height * yp)); + + vertices->push_back(osg::Vec3(x, y, 0)); + borderVertices->push_back(osg::Vec3(x, y, 0)); + texcoords->push_back(osg::Vec2(inv_width * x, inv_height * y)); + vertices->push_back(osg::Vec3(xc, yc, 0)); + texcoords->push_back(osg::Vec2(inv_width * xc, inv_height * yc)); + xp = x; yp = y; ! angle -= dangle; } + // add bottom section + vertices->push_back(osg::Vec3(x, y, 0)); + borderVertices->push_back(osg::Vec3(x, y, 0)); + texcoords->push_back(osg::Vec2(inv_width * x, inv_height * y)); ! x = width - cornerRadius; ! y = 0; ! vertices->push_back(osg::Vec3(x, y, 0)); ! borderVertices->push_back(osg::Vec3(x, y, 0)); ! texcoords->push_back(osg::Vec2(inv_width * x, inv_height * y)); ! vertices->push_back(osg::Vec3(xc, yc, 0)); ! texcoords->push_back(osg::Vec2(inv_width * xc, inv_height * yc)); ! ! // add bottom right corner ! xp = x; ! yp = y; ! xcorner = width - cornerRadius; ! ycorner = cornerRadius; ! ! angle = C_PI - dangle; ! for (int k=0; k<nAngles; k++) ! { ! x = xcorner + cornerRadius * sinf(angle); ! y = ycorner + cornerRadius * cosf(angle); ! ! vertices->push_back(osg::Vec3(xp, yp, 0)); ! borderVertices->push_back(osg::Vec3(xp, yp, 0)); ! texcoords->push_back(osg::Vec2(inv_width * xp, inv_height * yp)); ! ! vertices->push_back(osg::Vec3(x, y, 0)); ! borderVertices->push_back(osg::Vec3(x, y, 0)); ! texcoords->push_back(osg::Vec2(inv_width * x, inv_height * y)); ! ! vertices->push_back(osg::Vec3(xc, yc, 0)); ! texcoords->push_back(osg::Vec2(inv_width * xc, inv_height * yc)); ! ! xp = x; ! yp = y; ! angle -= dangle; ! } ! ! // add right section ! vertices->push_back(osg::Vec3(x, y, 0)); ! borderVertices->push_back(osg::Vec3(x, y, 0)); ! texcoords->push_back(osg::Vec2(inv_width * x, inv_height * y)); ! ! x = width; ! y = height - cornerRadius; ! vertices->push_back(osg::Vec3(x, y, 0)); ! borderVertices->push_back(osg::Vec3(x, y, 0)); ! texcoords->push_back(osg::Vec2(inv_width * x, inv_height * y)); ! ! vertices->push_back(osg::Vec3(xc, yc, 0)); ! texcoords->push_back(osg::Vec2(inv_width * xc, inv_height * yc)); ! ! // add top right corner ! xp = x; ! yp = y; ! xcorner = width - cornerRadius; ! ycorner = height - cornerRadius; ! ! angle = C_PIOVER2 - dangle; ! for (int k=0; k<nAngles; k++) ! { ! x = xcorner + cornerRadius * sinf(angle); ! y = ycorner + cornerRadius * cosf(angle); ! ! vertices->push_back(osg::Vec3(xp, yp, 0)); ! borderVertices->push_back(osg::Vec3(xp, yp, 0)); ! texcoords->push_back(osg::Vec2(inv_width * xp, inv_height * yp)); ! ! vertices->push_back(osg::Vec3(x, y, 0)); ! borderVertices->push_back(osg::Vec3(x, y, 0)); ! texcoords->push_back(osg::Vec2(inv_width * x, inv_height * y)); ! ! vertices->push_back(osg::Vec3(xc, yc, 0)); ! texcoords->push_back(osg::Vec2(inv_width * xc, inv_height * yc)); ! ! xp = x; ! yp = y; ! angle -= dangle; ! } ! ! ! backgroundQuad->setVertexArray(vertices); ! backgroundQuad->setTexCoordArray(0, texcoords); osg::Vec4Array* colors = new osg::Vec4Array; *************** *** 449,453 **** backgroundQuad->setColorBinding(osg::Geometry::BIND_OVERALL); ! backgroundQuad->addPrimitiveSet(new osg::DrawArrays(GL_TRIANGLES,0,3*nAngles)); /* --- 614,627 ---- backgroundQuad->setColorBinding(osg::Geometry::BIND_OVERALL); ! backgroundQuad->addPrimitiveSet(new osg::DrawArrays(GL_TRIANGLES,0,vertices->size())); ! ! border->setVertexArray(borderVertices); ! osg::Vec4Array* borderColors = new osg::Vec4Array; ! borderColors->push_back(osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f)); ! border->setColorArray(borderColors); ! border->setColorBinding(osg::Geometry::BIND_OVERALL); ! ! border->addPrimitiveSet(new osg::DrawArrays(GL_LINES, 0, borderVertices->size())); ! /* *************** *** 467,495 **** } - /** - * Call after window size change - */ - void tc3DWindow::UpdateBackgroundShape() - { - wxASSERT(backgroundQuad.valid()); - - osg::Vec2Array* texcoords = dynamic_cast<osg::Vec2Array*>(backgroundQuad->getTexCoordArray(0)); - wxASSERT(texcoords != 0); - - osg::Vec3Array* vertices = new osg::Vec3Array(); - - float width = float(mnWidth); - float height = float(mnHeight); - - for (size_t k=0; k<texcoords->size(); k++) - { - osg::Vec2& t = texcoords->at(k); - vertices->push_back(osg::Vec3(width*t.x(), height*t.y(), 0)); - } - - backgroundQuad->setVertexArray(vertices); - backgroundQuad->dirtyDisplayList(); - - } --- 641,644 ---- *************** *** 801,810 **** void tc3DWindow::DrawBorder() { ! osg::Vec4 white(1.0f, 1.0f, 1.0f, 1.0f); ! DrawLine(0, 0, 0, mnHeight, white); // left ! DrawLine(0, mnHeight-1, mnWidth, mnHeight-1, white); // top ! DrawLine(mnWidth-1, 0, mnWidth-1, mnHeight, white); // right ! DrawLine(0, 0, mnWidth, 0, white); // bottom } --- 950,967 ---- void tc3DWindow::DrawBorder() { ! if (cornerRadius == 0) ! { ! osg::Vec4 white(1.0f, 1.0f, 1.0f, 0.7f); ! DrawLine(0, 0, 0, mnHeight, white); // left ! DrawLine(0, mnHeight-1, mnWidth, mnHeight-1, white); // top ! DrawLine(mnWidth-1, 0, mnWidth-1, mnHeight, white); // right ! DrawLine(0, 0, mnWidth, 0, white); // bottom ! } ! else ! { ! wxASSERT(border.valid()); ! DrawGeometry(border.get(), 0, 0); ! } } *************** *** 1280,1283 **** --- 1437,1445 ---- } + float tc3DWindow::GetCornerRadius() const + { + return cornerRadius; + } + osgText::Font* tc3DWindow::GetDefaultFont() { *************** *** 1440,1443 **** --- 1602,1615 ---- } + void tc3DWindow::SetCornerRadius(float r) + { + if (cornerRadius != r) + { + cornerRadius = r; + UpdateBackgroundShape(); + } + } + + void tc3DWindow::SetOpaque() { *************** *** 1992,1996 **** // setRenderBinDetails(baseRenderBin + backgroundRenderBin, "RenderBin"); ! UpdateBackgroundQuadVertices(); osg::StateSet* textStateSet = textRoot->getOrCreateStateSet(); --- 2164,2169 ---- // setRenderBinDetails(baseRenderBin + backgroundRenderBin, "RenderBin"); ! //UpdateBackgroundQuadVertices(); ! UpdateBackgroundShape(); osg::StateSet* textStateSet = textRoot->getOrCreateStateSet(); *************** *** 2054,2058 **** hostParent(graphicsHost), blendingOn(true), ! isMouseCaptured(false) { --- 2227,2232 ---- hostParent(graphicsHost), blendingOn(true), ! isMouseCaptured(false), ! cornerRadius(0) { *************** *** 2094,2097 **** --- 2268,2272 ---- groupStateSet->setRenderBinDetails(baseRenderBin + geometryRenderBin, "RenderBin"); + textRoot = new osg::Geode; osg::StateSet* textStateSet = textRoot->getOrCreateStateSet(); *************** *** 2126,2129 **** --- 2301,2305 ---- //stateSet->setAttributeAndModes(depth, osg::StateAttribute::ON); + switchNode = new osg::Switch; switchNode->addChild(root.get()); *************** *** 2157,2161 **** - /* need to update to create default icon position as a ** function of initial window position --- 2333,2336 ---- *************** *** 2202,2206 **** referenceText->setUseDisplayList(false); ! CreateBackgroundQuad(); //LoadBackgroundImage("console_b.jpg"); --- 2377,2381 ---- referenceText->setUseDisplayList(false); ! UpdateBackgroundShape(); //LoadBackgroundImage("console_b.jpg"); Index: tcTextEntryBox.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcTextEntryBox.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcTextEntryBox.cpp 12 Dec 2005 02:37:01 -0000 1.1 --- tcTextEntryBox.cpp 5 Jan 2006 03:47:22 -0000 1.2 *************** *** 134,137 **** --- 134,138 ---- SetBaseRenderBin(parent->GetBaseRenderBin() + 10); + tc3DWindow::MoveToTop(); // add chat text edit box Index: tc3DViewer.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DViewer.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** tc3DViewer.cpp 12 Dec 2005 02:37:01 -0000 1.28 --- tc3DViewer.cpp 5 Jan 2006 03:47:22 -0000 1.29 *************** *** 260,263 **** --- 260,265 ---- { isMouseDown = false; + + event.Skip(); // pass up to app level } *************** *** 291,294 **** --- 293,298 ---- void tc3DViewer::OnMouseMove(wxMouseEvent& event) { + event.Skip(); // pass up to app level + wxPoint point = event.GetPosition(); if (isMouseDown) |