[Gcblue-commits] gcb_wx/src/sim Game.cpp,1.67,1.68 gcb.cpp,1.13,1.14 tcNetworkView.cpp,1.5,1.6
Status: Alpha
Brought to you by:
ddcforge
|
From: <ddc...@us...> - 2004-03-06 21:07:38
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9771/src/sim Modified Files: Game.cpp gcb.cpp tcNetworkView.cpp Log Message: Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** Game.cpp 2 Mar 2004 02:52:15 -0000 1.67 --- Game.cpp 6 Mar 2004 20:52:29 -0000 1.68 *************** *** 339,344 **** try { ! StartMusic(); ! std::cout << "Music start success" << std::endl; Initialize3DViewer(); --- 339,344 ---- try { ! InitializeSound(); ! std::cout << "InitializeSound() completed" << std::endl; Initialize3DViewer(); *************** *** 400,403 **** --- 400,408 ---- meScreenMode = START; + if (mcOptions.mbPlayMusic) + { + tcSound::Get()->PlayMusic("loop1"); + } + wxWindow::Show(TRUE); } *************** *** 434,440 **** /** ! * Initialize sound and start the music track. */ ! void tcGame::StartMusic() { if (mcOptions.disableSound) return; --- 439,445 ---- /** ! * Initialize sound */ ! void tcGame::InitializeSound() { if (mcOptions.disableSound) return; *************** *** 450,458 **** return; } - - if (mcOptions.mbPlayMusic) - { - tcSound::Get()->PlayMusic("loop1"); - } } --- 455,458 ---- Index: gcb.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/gcb.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** gcb.cpp 27 Feb 2004 00:07:59 -0000 1.13 --- gcb.cpp 6 Mar 2004 20:52:29 -0000 1.14 *************** *** 267,292 **** void GcbApp::InitializeGameFrame() { ! gameFrame = new tcGame(wxPoint(0,0), wxGetDisplaySize()); // full screen ! if (gameFrame == NULL) ! { ! wxMessageBox("Failed to create the game frame."); ! WTL("Failed to create the game frame."); ! throw exception(); ! } ! else ! { ! try ! { ! gameFrame->Init(); ! } ! catch(...) ! { ! wxMessageBox("The game frame failed to initialize."); ! WTL("The game frame failed to initialize."); - throw exception(); - } - } } \ No newline at end of file --- 267,291 ---- void GcbApp::InitializeGameFrame() { ! /* ! if (gameFrame == NULL) ! { ! wxMessageBox("Failed to create the game frame."); ! WTL("Failed to create the game frame."); ! throw exception(); ! } ! */ ! try ! { ! gameFrame = new tcGame(wxPoint(0,0), wxGetDisplaySize()); // full screen ! gameFrame->Init(); ! } ! catch(...) ! { ! wxMessageBox("The game frame failed to initialize."); ! WTL("The game frame failed to initialize."); ! throw exception(); ! } } \ No newline at end of file Index: tcNetworkView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcNetworkView.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcNetworkView.cpp 2 Mar 2004 02:52:15 -0000 1.5 --- tcNetworkView.cpp 6 Mar 2004 20:52:29 -0000 1.6 *************** *** 41,45 **** EVT_COMMAND(ID_MULTIPLAYERMODE, wxEVT_COMMAND_BUTTON_CLICKED , tcNetworkView::SetNetworkMode) EVT_COMMAND(ID_CONNECT, wxEVT_COMMAND_BUTTON_CLICKED , tcNetworkView::OnConnect) ! EVT_COMMAND(ID_CHATTEXT, wxEVT_COMMAND_BUTTON_CLICKED , tcNetworkView::SendChatText) EVT_COMMAND(1, wxEVT_COMMAND_TEXT_UPDATED, tcNetworkView::SetIPText) EVT_COMMAND(2, wxEVT_COMMAND_TEXT_UPDATED, tcNetworkView::SendChatText) --- 41,46 ---- EVT_COMMAND(ID_MULTIPLAYERMODE, wxEVT_COMMAND_BUTTON_CLICKED , tcNetworkView::SetNetworkMode) EVT_COMMAND(ID_CONNECT, wxEVT_COMMAND_BUTTON_CLICKED , tcNetworkView::OnConnect) ! EVT_COMMAND(ID_SENDTEST, wxEVT_COMMAND_BUTTON_CLICKED , tcNetworkView::SendTest) ! EVT_COMMAND(ID_CHATPROTOCOL, wxEVT_COMMAND_BUTTON_CLICKED , tcNetworkView::SetChatProtocol) EVT_COMMAND(1, wxEVT_COMMAND_TEXT_UPDATED, tcNetworkView::SetIPText) EVT_COMMAND(2, wxEVT_COMMAND_TEXT_UPDATED, tcNetworkView::SendChatText) *************** *** 130,133 **** --- 131,148 ---- } + // if server, print chat text locally since no echo comes back + if (tcMultiplayerInterface::Get().IsServer()) + { + chatBox->Print(chatText.c_str()); + } + + } + + void tcNetworkView::SetChatProtocol(wxCommandEvent& event) + { + int protocol = event.m_extraLong; + + + tcMultiplayerInterface::Get().SetChatProtocol(protocol == 0); } *************** *** 159,162 **** --- 174,198 ---- } + void tcNetworkView::SendTest(wxCommandEvent& event) + { + std::string testText = "Test text for UDP"; + + unsigned nConnections = tcMultiplayerInterface::Get().GetNumConnections(); + + for (unsigned n=0;n<nConnections;n++) + { + int connId = tcMultiplayerInterface::Get().GetConnectionId(n); + tcMultiplayerInterface::Get().SendTestUDP(connId, testText); + } + + // if server, print chat text locally since no echo comes back + if (tcMultiplayerInterface::Get().IsServer()) + { + std::string localText = std::string("Sent UDP test: ") + + testText; + chatBox->Print(localText.c_str()); + } + } + /** * @param surfaceHost tcWindow to share surface of |