[Gcblue-commits] gcb_wx/src/graphics ObjectUpdater.cpp,1.21,1.22 tc3DTerrain.cpp,1.19,1.20 tc3DViewe
Status: Alpha
Brought to you by:
ddcforge
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1255/src/graphics Modified Files: ObjectUpdater.cpp tc3DTerrain.cpp tc3DViewer.cpp tc3DWindow.cpp tcButton.cpp tcConsoleBox.cpp tcCreditView.cpp tcGameView.cpp tcHookInfo.cpp tcLauncherPopup.cpp tcMapView.cpp tcMessageCenter.cpp tcNetworkView.cpp tcPopupControl.cpp tcRadioButton.cpp tcScenarioSelectView.cpp tcStartView.cpp tcXmlWindow.cpp Log Message: GCB 0.8.0 release Index: tcStartView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcStartView.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcStartView.cpp 5 May 2005 02:14:52 -0000 1.10 --- tcStartView.cpp 10 Sep 2005 21:47:38 -0000 1.11 *************** *** 96,103 **** ! wxString s = wxString::Format("%s Test Build", __DATE__); DrawTextR(s.c_str(), 85.0, 180.0, ! GetDefaultFont(), color, 24.0, LEFT_BASE_LINE); --- 96,103 ---- ! /*wxString s = wxString::Format("%s Test Build", __DATE__); DrawTextR(s.c_str(), 85.0, 180.0, ! GetDefaultFont(), color, 24.0, LEFT_BASE_LINE);*/ Index: tcNetworkView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcNetworkView.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcNetworkView.cpp 26 Jul 2005 00:37:04 -0000 1.10 --- tcNetworkView.cpp 10 Sep 2005 21:47:38 -0000 1.11 *************** *** 44,47 **** --- 44,48 ---- EVT_COMMAND(ID_JOINGAME, wxEVT_COMMAND_BUTTON_CLICKED , tcNetworkView::JoinGame) EVT_COMMAND(ID_CHATPROTOCOL, wxEVT_COMMAND_BUTTON_CLICKED , tcNetworkView::SetChatProtocol) + EVT_COMMAND(ID_LOGINMODE, wxEVT_COMMAND_BUTTON_CLICKED , tcNetworkView::SetLoginMode) EVT_COMMAND(1, wxEVT_COMMAND_TEXT_UPDATED, tcNetworkView::SetIPText) EVT_COMMAND(2, wxEVT_COMMAND_TEXT_UPDATED, tcNetworkView::SendChatText) *************** *** 200,203 **** --- 201,227 ---- } + void tcNetworkView::SetLoginMode(wxCommandEvent& event) + { + int mode = event.m_extraLong; + + SetLoginMode(mode); + } + + void tcNetworkView::SetLoginMode(int mode) + { + if (mode == ALLOW_ALL) + { + tcMultiplayerInterface::Get()->SetAcceptAllClients(true); + } + else if (mode == ALLOW_REGISTERED) + { + tcMultiplayerInterface::Get()->SetAcceptAllClients(false); + } + else + { + wxASSERT(false); // unrecognized mode + } + } + void tcNetworkView::SetNetworkMode(wxCommandEvent& event) { *************** *** 341,345 **** if (!tcOptions::Get()->OptionStringExists("HostAddress")) { ! tcOptions::Get()->SetOptionString("HostAddress", "192.168.0.100"); } ipEdit->SetBuffer(tcOptions::Get()->GetOptionString("HostAddress")); --- 365,369 ---- if (!tcOptions::Get()->OptionStringExists("HostAddress")) { ! tcOptions::Get()->SetOptionString("HostAddress", "192.168.1.2"); } ipEdit->SetBuffer(tcOptions::Get()->GetOptionString("HostAddress")); *************** *** 378,381 **** --- 402,415 ---- chatEntry->SetClearOnReturn(true); chatEntry->SetBuffer(""); + + // set client policy to match tcMultiplayerInterface + if (tcMultiplayerInterface::Get()->GetAcceptAllClients()) + { + SetRadioButtonState(ID_LOGINMODE, 0); + } + else + { + SetRadioButtonState(ID_LOGINMODE, 1); + } } Index: tc3DTerrain.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DTerrain.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** tc3DTerrain.cpp 20 Jul 2005 16:24:54 -0000 1.19 --- tc3DTerrain.cpp 10 Sep 2005 21:47:38 -0000 1.20 *************** *** 57,104 **** waterSurface = new osg::Geometry; ! osg::Vec3Array* vertices = new osg::Vec3Array(8); ! (*vertices)[0] = osg::Vec3(1e5, 1e5, 0); ! (*vertices)[1] = osg::Vec3(-1e5, 1e5, 0); ! (*vertices)[2] = osg::Vec3(-1e5, -1e5, 0); ! (*vertices)[3] = osg::Vec3(1e5, -1e5, 0); ! (*vertices)[4] = osg::Vec3(1e5, -1e5, 0); ! (*vertices)[5] = osg::Vec3(-1e5, -1e5, 0); ! (*vertices)[6] = osg::Vec3(-1e5, 1e5, 0); ! (*vertices)[7] = osg::Vec3(1e5, 1e5, 0); ! waterSurface->setVertexArray(vertices); ! ! osg::Vec2Array* texcoords = new osg::Vec2Array(8); ! const float k_tex = 500.0f; // larger repeats texture more ! (*texcoords)[0].set(0.0f, k_tex); ! (*texcoords)[1].set(0.0f, 0.0f); ! (*texcoords)[2].set(k_tex, 0.0f); ! (*texcoords)[3].set(k_tex, k_tex); ! (*texcoords)[4].set(0.0f, k_tex); ! (*texcoords)[5].set(0.0f, 0.0f); ! (*texcoords)[6].set(k_tex, 0.0f); ! (*texcoords)[7].set(k_tex, k_tex); ! waterSurface->setTexCoordArray(0, texcoords); ! ! osg::Vec3Array* normals = new osg::Vec3Array(2); ! (*normals)[0].set(0.0f, 0.0f, 1.0f); ! (*normals)[1].set(0.0f, 0.0f, -1.0f); ! waterSurface->setNormalArray(normals); ! waterSurface->setNormalBinding(osg::Geometry::BIND_PER_PRIMITIVE); ! osg::Vec4Array* colors = new osg::Vec4Array; ! colors->push_back(osg::Vec4(1.0f,1.0f,1.0f,1.0f)); ! waterSurface->setColorArray(colors); ! waterSurface->setColorBinding(osg::Geometry::BIND_OFF); // BIND_OVERALL ! waterSurface->addPrimitiveSet(new osg::DrawArrays(GL_QUADS,0,8)); - waterSurface->setUseDisplayList(true); --- 57,163 ---- waterSurface = new osg::Geometry; ! /* Use 9 smaller tiles in center with 8 larger tiles surrounding. ! ** This avoids ATI false lighting issue with big textured quad. */ ! const float hw_small = 5000.0f; ! const float hw_large = 3 * hw_small; ! const float hw_large2 = 3 * hw_large; ! std::vector<WaterTileInfo> tiles; ! for (float xc=-2*hw_small; xc<=2*hw_small; xc+=2*hw_small) ! { ! for(float yc=-2*hw_small; yc<=2*hw_small; yc+=2*hw_small) ! { ! WaterTileInfo tile; ! tile.half_width = hw_small; ! tile.xc = xc; ! tile.yc = yc; ! tiles.push_back(tile); ! } ! } + for (float xc=-2*hw_large; xc<=2*hw_large; xc+=2*hw_large) + { + for(float yc=-2*hw_large; yc<=2*hw_large; yc+=2*hw_large) + { + if ((xc != 0) || (yc != 0)) + { + WaterTileInfo tile; + tile.half_width = hw_large; + tile.xc = xc; + tile.yc = yc; ! tiles.push_back(tile); ! } ! } ! } + for (float xc=-2*hw_large2; xc<=2*hw_large2; xc+=2*hw_large2) + { + for(float yc=-2*hw_large2; yc<=2*hw_large2; yc+=2*hw_large2) + { + if ((xc != 0) || (yc != 0)) + { + WaterTileInfo tile; + tile.half_width = hw_large2; + tile.xc = xc; + tile.yc = yc; ! tiles.push_back(tile); ! } ! } ! } ! ! osg::Vec3Array* vertices = new osg::Vec3Array; ! osg::Vec2Array* texcoords = new osg::Vec2Array; ! osg::Vec3Array* normals = new osg::Vec3Array; ! ! ! ! for (size_t k=0; k<tiles.size(); k++) ! { ! WaterTileInfo& tile = tiles[k]; ! ! float half_width = tile.half_width; ! float xc = tile.xc; ! float yc = tile.yc; ! float k_tex = 0.002f * half_width; // larger repeats texture more + vertices->push_back(osg::Vec3(half_width + xc, half_width + yc, 0)); + vertices->push_back(osg::Vec3(-half_width + xc, half_width + yc, 0)); + vertices->push_back(osg::Vec3(-half_width + xc, -half_width + yc, 0)); + vertices->push_back(osg::Vec3(half_width + xc, -half_width + yc, 0)); + vertices->push_back(osg::Vec3(half_width + xc, -half_width + yc, 0)); + vertices->push_back(osg::Vec3(-half_width + xc, -half_width + yc, 0)); + vertices->push_back(osg::Vec3(-half_width + xc, half_width + yc, 0)); + vertices->push_back(osg::Vec3(half_width + xc, half_width + yc, 0)); + + + texcoords->push_back(osg::Vec2(0.0f, k_tex)); + texcoords->push_back(osg::Vec2(0.0f, 0.0f)); + texcoords->push_back(osg::Vec2(k_tex, 0.0f)); + texcoords->push_back(osg::Vec2(k_tex, k_tex)); + texcoords->push_back(osg::Vec2(0.0f, k_tex)); + texcoords->push_back(osg::Vec2(0.0f, 0.0f)); + texcoords->push_back(osg::Vec2(k_tex, 0.0f)); + texcoords->push_back(osg::Vec2(k_tex, k_tex)); + + + normals->push_back(osg::Vec3(0.0f, 1.0f, 0.0f)); + normals->push_back(osg::Vec3(0.0f, 0.0f, -1.0f)); + + } + + waterSurface->setVertexArray(vertices); + waterSurface->setTexCoordArray(0, texcoords); + waterSurface->setNormalArray(normals); + waterSurface->setNormalBinding(osg::Geometry::BIND_PER_PRIMITIVE); // BIND_PER_PRIMITIVE BIND_PER_VERTEX + + waterSurface->addPrimitiveSet(new osg::DrawArrays(GL_QUADS,0,vertices->size())); + + waterSurface->setUseDisplayList(true); *************** *** 107,114 **** //stateSet->setMode(GL_DEPTH_WRITEMASK, osg::StateAttribute::ON); stateSet->setMode(GL_LIGHTING, osg::StateAttribute::ON); ! stateSet->setMode(GL_BLEND, osg::StateAttribute::ON); stateSet->setMode(GL_FOG, osg::StateAttribute::ON); //stateSet->setRenderBinDetails(baseRenderBin + rectRenderBin, "RenderBin"); waterTexture = new osg::Texture2D; waterTexture->setImage(osgDB::readImageFile("water2b.bmp")); --- 166,179 ---- //stateSet->setMode(GL_DEPTH_WRITEMASK, osg::StateAttribute::ON); stateSet->setMode(GL_LIGHTING, osg::StateAttribute::ON); ! stateSet->setMode(GL_BLEND, osg::StateAttribute::OFF); stateSet->setMode(GL_FOG, osg::StateAttribute::ON); //stateSet->setRenderBinDetails(baseRenderBin + rectRenderBin, "RenderBin"); + + osg::Vec4Array* colors = new osg::Vec4Array; + colors->push_back(osg::Vec4(1.0f,1.0f,1.0f,1.0f)); + waterSurface->setColorArray(colors); + waterSurface->setColorBinding(osg::Geometry::BIND_OVERALL); // BIND_OVERALL BIND_OFF + waterTexture = new osg::Texture2D; waterTexture->setImage(osgDB::readImageFile("water2b.bmp")); Index: tcLauncherPopup.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcLauncherPopup.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcLauncherPopup.cpp 10 Jul 2005 20:32:03 -0000 1.8 --- tcLauncherPopup.cpp 10 Sep 2005 21:47:38 -0000 1.9 *************** *** 108,111 **** --- 108,112 ---- } + unsigned currentCount = tcTime::Get()->Get30HzCount(); unsigned age = currentCount - birthCount; *************** *** 180,184 **** activePassiveButton->SetCaption("Active"); } ! DrawChildren(); --- 181,185 ---- activePassiveButton->SetCaption("Active"); } ! DrawChildren(); *************** *** 221,224 **** --- 222,226 ---- if (!launcher) return; + launchButton = new tcButton(this, wxPoint(mnWidth - 40, 20), wxSize(widgetHeight, widgetHeight)); *************** *** 249,252 **** --- 251,255 ---- runToEnableAdjust->SetSendRedraw(true); runToEnable = launcher->runToEnable_m; + runToEnable_prev = runToEnable; y += widgetHeight + 5; *************** *** 300,307 **** activePassiveButton->SetFontSize(12.0); activePassiveButton->SetSendRedraw(true); - activePassiveButton->SetOn(launcher->usePassive); activePassiveButton->SetFillColors(osg::Vec4(0.0, 0.0, 0.0, 1.0), osg::Vec4(1.0, 1.0, 1.0, 1.0), osg::Vec4(0.4, 1.0, 0.4, 1.0)); } --- 303,310 ---- activePassiveButton->SetFontSize(12.0); activePassiveButton->SetSendRedraw(true); activePassiveButton->SetFillColors(osg::Vec4(0.0, 0.0, 0.0, 1.0), osg::Vec4(1.0, 1.0, 1.0, 1.0), osg::Vec4(0.4, 1.0, 0.4, 1.0)); + isPassive = true; } *************** *** 315,319 **** if (launcher == 0) return; ! launcher->runToEnable_m = runToEnable; launcher->runDepth_m = depth; --- 318,332 ---- if (launcher == 0) return; ! // use launcher value if local value hasn't changed to pick up changes due to ! // datum changes ! if (runToEnable != runToEnable_prev) ! { ! launcher->runToEnable_m = runToEnable; ! } ! else ! { ! runToEnable = launcher->runToEnable_m; ! } ! runToEnable_prev = runToEnable; launcher->runDepth_m = depth; *************** *** 323,327 **** launcher->usePassive = isPassive; ! activePassiveButton->SetOn(isPassive); } --- 336,340 ---- launcher->usePassive = isPassive; ! activePassiveButton->SetOn(!isPassive); } *************** *** 475,478 **** --- 488,493 ---- isPassive = true; } + + activePassiveButton->SetOn(!launcher->usePassive); } } Index: tcRadioButton.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcRadioButton.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcRadioButton.cpp 17 Apr 2005 22:35:31 -0000 1.9 --- tcRadioButton.cpp 10 Sep 2005 21:47:38 -0000 1.10 *************** *** 138,141 **** --- 138,162 ---- /** + * Sets button with command matching buttonCommand on and all others off + */ + void tcRadioButton::ActivateButton(long buttonCommand) + { + for(size_t n=0;n<buttons.size();n++) + { + if (buttons[n]->GetCommand() == buttonCommand) + { + buttons[n]->SetOn(true); + } + else + { + buttons[n]->SetOn(false); + } + + } + + } + + + /** * version to initialize from XML file */ Index: tcHookInfo.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcHookInfo.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcHookInfo.cpp 26 Jul 2005 00:37:04 -0000 1.14 --- tcHookInfo.cpp 10 Sep 2005 21:47:38 -0000 1.15 *************** *** 143,146 **** --- 143,151 ---- if (k < nContributors-1) s += ","; } + if (s.size() > 35) + { + s = s.substr(0, 35); + } + DrawTextR(s.c_str(), ftextx, ftexty, defaultFont.get(), color, fontSize, LEFT_BASE_LINE); ftexty += 15; Index: tcScenarioSelectView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcScenarioSelectView.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcScenarioSelectView.cpp 29 Jul 2005 02:35:53 -0000 1.12 --- tcScenarioSelectView.cpp 10 Sep 2005 21:47:38 -0000 1.13 *************** *** 36,39 **** --- 36,40 ---- #include "wxcommands.h" #include "tcSimPythonInterface.h" + #include "tcScenarioInterface.h" #include "common/tinyxml.h" #include "network/tcMultiplayerInterface.h" *************** *** 215,221 **** totalPath += filePath; if (!wxString(caption.c_str()).Contains("Random")) { ! mpSimState->mpPythonInterface->LoadScenario(totalPath.c_str(), filePath.c_str()); } else --- 216,230 ---- totalPath += filePath; + + tcSimPythonInterface* pythonInterface = tcSimPythonInterface::Get(); + // clear briefing in case scenario fails to set it + pythonInterface->GetScenarioInterface()->ClearSimpleBriefing(); + pythonInterface->LoadScenario(totalPath.c_str(), filePath.c_str()); + + + /* random loading broken for now if (!wxString(caption.c_str()).Contains("Random")) { ! } else *************** *** 224,227 **** --- 233,237 ---- mpSimState->RandInit(); } + */ if (mpSimState->msScenarioInfo.mbLoaded) *************** *** 306,309 **** --- 316,343 ---- /** + * Recursive method to check if child matches loaded scenario + * This is used to expand the correct parent directories to show the initial scenario loaded + * at the start of the game. + */ + bool tcScenarioSelectView::IsChildScenarioLoaded(const std::vector<scenarioInfo>& info) const + { + for (size_t n=0; n < info.size(); ++n) + { + const scenarioInfo& item = info[n]; + bool hasChildren = item.children.size(); + if (hasChildren) + { + if (IsChildScenarioLoaded(item.children)) return true; + } + else + { + if (item.caption == loadedScenarioCaption) return true; + } + } + + return false; + } + + /** * Recursive method to update drawing info of scenarioInfo vector */ *************** *** 328,331 **** --- 362,371 ---- item.drawBox.x -= xIndent; item.drawBox.width += xIndent; + + if (!item.showChildren && (IsChildScenarioLoaded(item.children))) + { + item.showChildren = true; + } + if (item.showChildren) { *************** *** 343,346 **** --- 383,387 ---- item.drawState = scenarioInfo::ON; if (item.drawState != oldState) tcSound::Get()->PlayEffect("Beep2"); + } else if (r.Inside(mousePosition)) Index: tcXmlWindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcXmlWindow.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcXmlWindow.cpp 1 Jun 2005 00:13:31 -0000 1.6 --- tcXmlWindow.cpp 10 Sep 2005 21:47:38 -0000 1.7 *************** *** 140,143 **** --- 140,184 ---- } + /** + * This allows a window to change the caption of a button based on game state + * Using this will override the caption specified in the xml file + */ + void tcXmlWindow::SetButtonCaption(long command, const std::string& caption) + { + for (unsigned int n=0; n<children.size(); n++) + { + if (tcButton* button = dynamic_cast<tcButton*>(children[n])) + { + if (button->GetCommand() == command) + { + button->SetCaption(caption); + return; + } + } + + } + } + + /** + * Finds first radio button with command matching radioCommand and sets + * button on with command matching buttonCommand. + */ + void tcXmlWindow::SetRadioButtonState(long radioCommand, long buttonCommand) + { + for (unsigned int n=0; n<children.size(); n++) + { + if (tcRadioButton* radio = dynamic_cast<tcRadioButton*>(children[n])) + { + if (radio->GetCommand() == radioCommand) + { + radio->ActivateButton(buttonCommand); + return; + } + } + + } + } + + tcXmlWindow::tcXmlWindow(wxWindow *parent, const wxPoint& pos, const wxSize& size, Index: tcMessageCenter.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMessageCenter.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcMessageCenter.cpp 26 Jul 2005 00:37:04 -0000 1.8 --- tcMessageCenter.cpp 10 Sep 2005 21:47:38 -0000 1.9 *************** *** 26,33 **** #include "tcPopupMessage.h" #include "tcSoundConsole.h" #include <stdio.h> #include <iostream> ! #include "tcTime.h" #ifdef _DEBUG --- 26,36 ---- #include "tcPopupMessage.h" #include "tcSoundConsole.h" + #include "tcButton.h" + #include "tcTime.h" + #include "common/wxcommands.h" #include <stdio.h> #include <iostream> ! #ifdef _DEBUG *************** *** 35,38 **** --- 38,69 ---- #endif + + /** + * Set indicated channel active if it exists, otherwise do nothing + */ + void tcMessageCenter::ActivateChannel(const std::string& channelName) + { + if (channelName == activeChannelName) return; // already active + + tcMessageChannel* activeChannel = GetChannel(activeChannelName); + + std::map<std::string, tcMessageChannel*>::iterator iter; + for (iter = channelMap.begin(); iter != channelMap.end(); ++iter) + { + tcMessageChannel* channel = iter->second; + if (channel->GetName() == channelName) + { + channel->SetActive(true); + if (activeChannel) + { + activeChannel->SetActive(false); + } + activeChannelName = channelName; + return; + } + } + + } + /** * *************** *** 93,96 **** --- 124,131 ---- channel->Draw(this); } + + DrawChildren(); + + DrawBorder(); FinishDraw(); *************** *** 246,249 **** --- 281,294 ---- LoadBackgroundImage("background.jpg"); + + const int closeButtonSize = 16; + closeButton = new tcButton(this, wxPoint(mnWidth - closeButtonSize - 1, 1), + wxSize(closeButtonSize, closeButtonSize)); + closeButton->SetActive(true); + closeButton->SetBackgroundAlpha(1.0); + closeButton->SetCaption(""); + closeButton->SetCommand(ID_STARTVIEW); + closeButton->LoadImages("close.png", "close.png", "close.png", "close.png"); + closeButton->SetSendRedraw(true); } Index: tcCreditView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcCreditView.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tcCreditView.cpp 26 Jul 2005 00:37:04 -0000 1.16 --- tcCreditView.cpp 10 Sep 2005 21:47:38 -0000 1.17 *************** *** 85,90 **** AddCredit(s, 25.0f, 1); s = "Havoc"; ! AddCredit(s, 125.0f, 1); --- 85,99 ---- AddCredit(s, 25.0f, 1); + s = "Guido Militello"; + AddCredit(s, 25.0f, 1); + s = "Havoc"; ! AddCredit(s, 75.0f, 1); ! ! s = "--- \"Music\" ---"; ! AddCredit(s, 25.0f, 1); ! ! s = "Dewitt Colclough"; ! AddCredit(s, 150.0f, 1); Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapView.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** tcMapView.cpp 20 Jul 2005 16:24:54 -0000 1.32 --- tcMapView.cpp 10 Sep 2005 21:47:38 -0000 1.33 *************** *** 1954,1962 **** long tcTacticalMapView::Hook(wxPoint pscreen) { - long nMinID; long currentHook; - hookedId.clear(); - if (GetHookCount() == 1) { --- 1954,1959 ---- *************** *** 1968,1972 **** } ! nMinID = GetClosest(pscreen); if (nMinID != currentHook) { --- 1965,1969 ---- } ! long nMinID = GetClosest(pscreen); if (nMinID != currentHook) { *************** *** 1977,1980 **** --- 1974,1978 ---- } + hookedId.clear(); if (nMinID != -1) { *************** *** 2317,2321 **** ! /***********************************************************************************/ void tcTacticalMapView::OnLButtonDown(wxMouseEvent& event) { --- 2315,2321 ---- ! /** ! * ! */ void tcTacticalMapView::OnLButtonDown(wxMouseEvent& event) { Index: tcPopupControl.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcPopupControl.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcPopupControl.cpp 14 Jul 2005 23:42:22 -0000 1.10 --- tcPopupControl.cpp 10 Sep 2005 21:47:38 -0000 1.11 *************** *** 84,87 **** --- 84,89 ---- //mcGameMenu.AddItem("Load scenario", GC_LOADSCEN); mcGameMenu.AddItem("Quit", GC_QUIT); + mcGameMenu.AddItem("Show briefing", GC_SHOWBRIEFING); + mcGameMenu.AddItem("Show mission status", GC_SHOWMISSIONSTATUS); //mcGameMenu.EndSubMenu(); Index: tcButton.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcButton.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcButton.cpp 1 Jun 2005 00:13:30 -0000 1.18 --- tcButton.cpp 10 Sep 2005 21:47:38 -0000 1.19 *************** *** 2,6 **** ** @file tcButton.cpp */ ! /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 2,6 ---- ** @file tcButton.cpp */ ! /* Copyright (C) 2003-2005 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 72,75 **** --- 72,76 ---- { tc3DWindow::DrawImage(image, 0, 0, mnWidth, mnHeight, LEFT_BASE_LINE); + HideUnusedObjects(); return; } *************** *** 120,125 **** * a successful LoadImages call */ ! void tcButton::LoadImages(std::string offImageName, std::string onImageName, ! std::string overOffImageName, std::string overOnImageName) { offImage = LoadTexture(offImageName.c_str()); --- 121,126 ---- * a successful LoadImages call */ ! void tcButton::LoadImages(const std::string& offImageName, const std::string& onImageName, ! const std::string& overOffImageName, const std::string& overOnImageName) { offImage = LoadTexture(offImageName.c_str()); Index: tcConsoleBox.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcConsoleBox.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcConsoleBox.cpp 29 Apr 2005 18:52:53 -0000 1.14 --- tcConsoleBox.cpp 10 Sep 2005 21:47:38 -0000 1.15 *************** *** 77,81 **** int nLen = (int)strlen(line); ! wxASSERT(nLen < 255); if (nLen < nwrapcol) --- 77,81 ---- int nLen = (int)strlen(line); ! wxASSERT(nwrapcol < 254); if (nLen < nwrapcol) *************** *** 93,97 **** { char c = line[nStart+nWrapLen]; ! if (c == ' ') { bSearching = false; --- 93,97 ---- { char c = line[nStart+nWrapLen]; ! if ((c == ' ')||(nWrapLen > nwrapcol + 3)) { bSearching = false; Index: ObjectUpdater.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/ObjectUpdater.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** ObjectUpdater.cpp 26 Jul 2005 00:37:04 -0000 1.21 --- ObjectUpdater.cpp 10 Sep 2005 21:47:38 -0000 1.22 *************** *** 233,237 **** model->SetDistanceFromCamera(distanceFromCamera); ! if (!isVisible) return; if (model->IsSmokeEnabled()) --- 233,241 ---- model->SetDistanceFromCamera(distanceFromCamera); ! if (!isVisible) ! { ! model->SetGenericMode(tc3DModel::DISABLE_MODEL); ! return; ! } if (model->IsSmokeEnabled()) Index: tc3DWindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DWindow.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** tc3DWindow.cpp 16 Jul 2005 23:12:38 -0000 1.24 --- tc3DWindow.cpp 10 Sep 2005 21:47:38 -0000 1.25 *************** *** 725,732 **** osg::Vec4 white(1.0f, 1.0f, 1.0f, 1.0f); ! DrawLine(0, 0, 0, mnHeight, white); ! DrawLine(0, mnHeight-1, mnWidth, mnHeight-1, white); ! DrawLine(mnWidth, mnHeight, mnWidth, 0, white); ! DrawLine(mnWidth, 0, 0, 0, white); } --- 725,732 ---- 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 } Index: tcGameView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcGameView.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcGameView.cpp 26 Jul 2005 00:37:04 -0000 1.14 --- tcGameView.cpp 10 Sep 2005 21:47:38 -0000 1.15 *************** *** 137,142 **** { vector<GeoPoint> navpoints; ! ! if (tcPlatformObject *platformObj = dynamic_cast<tcPlatformObject*>(mpHookedObj)) { if (ai::Nav* nav = platformObj->GetBrain()->GetNavTask()) --- 137,143 ---- { vector<GeoPoint> navpoints; ! tcPlatformObject* platformObj = dynamic_cast<tcPlatformObject*>(mpHookedObj); ! ! if (platformObj && mpHookedObj->IsOwnAlliance()) { if (ai::Nav* nav = platformObj->GetBrain()->GetNavTask()) Index: tc3DViewer.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DViewer.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** tc3DViewer.cpp 20 Jul 2005 16:24:54 -0000 1.25 --- tc3DViewer.cpp 10 Sep 2005 21:47:38 -0000 1.26 *************** *** 514,520 **** { fog->setColor(airFog); // blue-white fog ! fog->setStart(5000.0f); fog->setEnd(60000.0f); ! fog->setDensity(0.000006f); view->setClearColor(airFog); } --- 514,521 ---- { fog->setColor(airFog); // blue-white fog ! fog->setStart(4000.0f); fog->setEnd(60000.0f); ! fog->setDensity(0.000015f); ! //fog->setFogCoordinateSource(osg::Fog::FRAGMENT_DEPTH); view->setClearColor(airFog); } *************** *** 1083,1092 **** // workaround for sky issue, deactivate sky when camera underwater ! if (cameraPosition._v[2] < -1.0) { if (skyTransform->getNumParents()) { terrainRoot->removeChild(skyTransform.get()); ! SetFogMode(FOG_WATER); } } --- 1084,1093 ---- // workaround for sky issue, deactivate sky when camera underwater ! if (cameraPosition._v[2] < -1.0+10e3) { if (skyTransform->getNumParents()) { terrainRoot->removeChild(skyTransform.get()); ! // SetFogMode(FOG_WATER); } } *************** *** 1331,1334 **** --- 1332,1336 ---- else { + static unsigned errorCount = 0; x = lastPos._v[0]; y = lastPos._v[1]; *************** *** 1336,1340 **** classification = 0; ! fprintf(stderr, "tc3DViewer::GetHookedObjectPositionAndType - graphics error\n"); } } --- 1338,1346 ---- classification = 0; ! ! if (errorCount++ < 4) ! { ! fprintf(stderr, "tc3DViewer::GetHookedObjectPositionAndType - graphics error\n"); ! } } } *************** *** 1344,1365 **** } ! void tc3DViewer::InitLight() ! { ! #if 0 // using CSP sky lights instead ! // add either a headlight or sun light to the scene. ! osg::LightSource* lightsource = new osg::LightSource; ! camera_group->setSceneDecorator(lightsource); ! { ! osg::Light* light = new osg::Light; ! lightsource->setLight(light); ! lightsource->setReferenceFrame(osg::LightSource::ABSOLUTE_RF); // headlight. ! lightsource->setLocalStateSetModes(osg::StateAttribute::ON); ! light->setPosition(osg::Vec4(0,0,1,1)); ! light->setAmbient(osg::Vec4(0.2,0.1,0.1,1.0)); ! light->setDiffuse(osg::Vec4(0.5,0.5,0.3,1.0)); ! light->setSpecular(osg::Vec4(0.3,0.0,0.1,1.0)); ! } ! #endif ! } /** --- 1350,1354 ---- } ! /** *************** *** 1446,1450 **** 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); /* --- 1435,1439 ---- 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); /* *************** *** 1595,1598 **** --- 1584,1589 ---- alphafunc->setFunction(osg::AlphaFunc::GREATER,0.0f); globalStateSet->setAttributeAndModes(alphafunc, osg::StateAttribute::ON); + + } } *************** *** 2067,2072 **** InitState(); - - InitLight(); CreateScene(); --- 2058,2061 ---- *************** *** 2077,2080 **** --- 2066,2072 ---- defaultSensorModel->LoadXml("unknown.xml"); + //osg::Light* light = sceneView->getLight(); + //osgUtil::SceneView::LightingMode lm = sceneView->getLightingMode(); + //light->setPosition(osg::Vec4(0, 0, 1, 0)); // rootnode->addChild(tcSound::Get()->GetSoundRoot()); |