From: <spo...@us...> - 2007-05-10 17:55:50
|
Revision: 453 http://svn.sourceforge.net/opengate/?rev=453&view=rev Author: spom_spom Date: 2007-05-10 10:55:52 -0700 (Thu, 10 May 2007) Log Message: ----------- Added Paths: ----------- branches/ogsector/src/opengateclient.cpp branches/ogsector/src/opengateserver.cpp Added: branches/ogsector/src/opengateclient.cpp =================================================================== --- branches/ogsector/src/opengateclient.cpp (rev 0) +++ branches/ogsector/src/opengateclient.cpp 2007-05-10 17:55:52 UTC (rev 453) @@ -0,0 +1,80 @@ + +#ifdef WIN32 +#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 +#define WIN32_LEAN_AND_MEAN +#include "windows.h" +#endif +#endif + +#include "LogManager.h" +#include "networkProtocol.h" +#include "networkClient.h" +#include "GameStateManager.h" +#include "DockedState.h" +#include "UnDockedState.h" + +int main( int argc, char * argv[ ] ) { + + OpenGate::LogManager *log = new OpenGate::LogManager(); + log->setLogFile( "OpenGate.log" ); + log->setChatLogFile( "OpenGateChat.log" ); + + std::string username = "testuser"; + std::string hostname = "localhost"; + std::string password = ""; + bool dialog = true; + + if ( argc > 1 ){ + username = argv[ 1 ]; + } + if ( argc > 2 ){ + username = argv[ 1 ]; + hostname = argv[ 2 ]; + } + if ( argc > 3 ){ + std::string dialogStr( argv[ 3 ] ); + if ( dialogStr.find( "--ogreconfig=0", 0 ) != std::string::npos ) dialog = false; + } + + log->info( std::string( "User: " + username + " looking for host: " + hostname ) ); + + asio::io_service io_service; + OpenGate::NetworkClient nw( io_service, hostname ); + + if ( nw.online() ){ + // //** waiting for userid; + asio::thread t( boost::bind( & asio::io_service::run, & io_service ) ); + + while( nw.online() && nw.userID() == 0 ){ + myMSleep( 100 ); + } + + log->info( std::string( "Userid: " + toStr(nw.userID() ) ) ); + log->info( std::string( "Login user: " + username + " to: " + nw.hostname() ) ); + nw.login( username ); + } else { + nw.setUserName( username ); + log->info( "Offline mode." ); + } + + try { + OpenGate::GameStateManager gameStateMgr( nw, dialog ); + OpenGate::DockedState::create( &gameStateMgr, "DockedState" ); + // OpenGate::UnDockedState::create( &gameStateMgr, "UnDockedState" ); + + gameStateMgr.start( gameStateMgr.findByName( "DockedState" ) ); + + } catch( Ogre::Exception& e ) { + +#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 + MessageBox( NULL, e.getFullDescription().c_str(), + "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL); +#else + log->fatal( std::string("An exception has occured: ") + e.getFullDescription().c_str() ); +#endif + } + nw.close(); + + delete log; + return EXIT_SUCCESS; +} Added: branches/ogsector/src/opengateserver.cpp =================================================================== --- branches/ogsector/src/opengateserver.cpp (rev 0) +++ branches/ogsector/src/opengateserver.cpp 2007-05-10 17:55:52 UTC (rev 453) @@ -0,0 +1,58 @@ +/*************************************************************************** + * Copyright (C) 2006 by Christoph Brill * + * eg...@us... * + * 2007 spom_spom@.sourceforge.net * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <iostream> + +#include "common.h" +#include "networkServer.h" +#include "LogManager.h" + +using namespace OpenGate; + +int main( int argc, char *argv[] ) { + LogManager *log = new LogManager( ); + log->setLogFile( "OGserver.log" ); + log->setChatLogFile( "OGserverChat.log" ); + + std::cout << "Starting up" << std::endl; + std::cout << "-----------" << std::endl; + + try { + asio::io_service io_service; + tcp::endpoint endpoint( tcp::v4(), OG_PORT ); + Server server( io_service, endpoint ); + + io_service.run(); + } + catch ( asio::error & e ) { + log->fatal( e.what() ); + } + catch ( std::exception & e ) { + log->fatal( std::string("Exception: ") + e.what() ); + } + + return EXIT_SUCCESS; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2007-05-17 08:35:54
|
Revision: 467 http://svn.sourceforge.net/opengate/?rev=467&view=rev Author: egore Date: 2007-05-17 01:35:54 -0700 (Thu, 17 May 2007) Log Message: ----------- [QA] Add an appropriate GPLv2 header to all files [QA] Add some doxygen comments to common.[cpp|h] Modified Paths: -------------- branches/ogsector/src/GameState.cpp branches/ogsector/src/GameState.h branches/ogsector/src/InputManager.cpp branches/ogsector/src/InputManager.h branches/ogsector/src/LogManager.cpp branches/ogsector/src/LogManager.h branches/ogsector/src/Sector.cpp branches/ogsector/src/Sector.h branches/ogsector/src/SectorObjects.cpp branches/ogsector/src/SectorObjects.h branches/ogsector/src/UnDockedState.cpp branches/ogsector/src/UnDockedState.h branches/ogsector/src/VesselManager.cpp branches/ogsector/src/VesselManager.h branches/ogsector/src/common.cpp branches/ogsector/src/common.h branches/ogsector/src/networkClient.cpp branches/ogsector/src/networkClient.h branches/ogsector/src/networkProtocol.h branches/ogsector/src/networkServer.cpp branches/ogsector/src/networkServer.h branches/ogsector/src/networkServerUser.cpp branches/ogsector/src/networkServerUser.h branches/ogsector/src/openALSoundManager.cpp branches/ogsector/src/openALSoundManager.h branches/ogsector/src/opengateclient.cpp branches/ogsector/src/opengateserver.cpp branches/ogsector/src/testopenalmanager.cpp Modified: branches/ogsector/src/GameState.cpp =================================================================== --- branches/ogsector/src/GameState.cpp 2007-05-16 21:54:28 UTC (rev 466) +++ branches/ogsector/src/GameState.cpp 2007-05-17 08:35:54 UTC (rev 467) @@ -1 +1,21 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + #include "GameState.h" Modified: branches/ogsector/src/GameState.h =================================================================== --- branches/ogsector/src/GameState.h 2007-05-16 21:54:28 UTC (rev 466) +++ branches/ogsector/src/GameState.h 2007-05-17 08:35:54 UTC (rev 467) @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + #ifndef GAMESTATELISTENER__H #define GAMESTATELISTENER__H Modified: branches/ogsector/src/InputManager.cpp =================================================================== --- branches/ogsector/src/InputManager.cpp 2007-05-16 21:54:28 UTC (rev 466) +++ branches/ogsector/src/InputManager.cpp 2007-05-17 08:35:54 UTC (rev 467) @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + #include "InputManager.h" #include "LogManager.h" #include "OgreStringConverter.h" Modified: branches/ogsector/src/InputManager.h =================================================================== --- branches/ogsector/src/InputManager.h 2007-05-16 21:54:28 UTC (rev 466) +++ branches/ogsector/src/InputManager.h 2007-05-17 08:35:54 UTC (rev 467) @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + #ifndef INPUTMANAGER_H // INPUTMANAGER_H #define INPUTMANAGER_H Modified: branches/ogsector/src/LogManager.cpp =================================================================== --- branches/ogsector/src/LogManager.cpp 2007-05-16 21:54:28 UTC (rev 466) +++ branches/ogsector/src/LogManager.cpp 2007-05-17 08:35:54 UTC (rev 467) @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + #include "LogManager.h" #include "ogconsole.h" Modified: branches/ogsector/src/LogManager.h =================================================================== --- branches/ogsector/src/LogManager.h 2007-05-16 21:54:28 UTC (rev 466) +++ branches/ogsector/src/LogManager.h 2007-05-17 08:35:54 UTC (rev 467) @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + #ifndef LOGMANAGER__H #define LOGMANAGER__H Modified: branches/ogsector/src/Sector.cpp =================================================================== --- branches/ogsector/src/Sector.cpp 2007-05-16 21:54:28 UTC (rev 466) +++ branches/ogsector/src/Sector.cpp 2007-05-17 08:35:54 UTC (rev 467) @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + #include "Sector.h" namespace OpenGate{ Modified: branches/ogsector/src/Sector.h =================================================================== --- branches/ogsector/src/Sector.h 2007-05-16 21:54:28 UTC (rev 466) +++ branches/ogsector/src/Sector.h 2007-05-17 08:35:54 UTC (rev 467) @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + #ifndef SECTOR__H #define SECTOR__H Modified: branches/ogsector/src/SectorObjects.cpp =================================================================== --- branches/ogsector/src/SectorObjects.cpp 2007-05-16 21:54:28 UTC (rev 466) +++ branches/ogsector/src/SectorObjects.cpp 2007-05-17 08:35:54 UTC (rev 467) @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + #include "Sector.h" #include "SectorObjects.h" #include "common.h" Modified: branches/ogsector/src/SectorObjects.h =================================================================== --- branches/ogsector/src/SectorObjects.h 2007-05-16 21:54:28 UTC (rev 466) +++ branches/ogsector/src/SectorObjects.h 2007-05-17 08:35:54 UTC (rev 467) @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + #ifndef PLAYERSHIP__H #define PLAYERSHIP__H Modified: branches/ogsector/src/UnDockedState.cpp =================================================================== --- branches/ogsector/src/UnDockedState.cpp 2007-05-16 21:54:28 UTC (rev 466) +++ branches/ogsector/src/UnDockedState.cpp 2007-05-17 08:35:54 UTC (rev 467) @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + #include "UnDockedState.h" #include "Sector.h" #include "networkProtocol.h" Modified: branches/ogsector/src/UnDockedState.h =================================================================== --- branches/ogsector/src/UnDockedState.h 2007-05-16 21:54:28 UTC (rev 466) +++ branches/ogsector/src/UnDockedState.h 2007-05-17 08:35:54 UTC (rev 467) @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + #ifndef UNDOCKEDSTATE__H #define UNDOCKEDSTATE__H Modified: branches/ogsector/src/VesselManager.cpp =================================================================== --- branches/ogsector/src/VesselManager.cpp 2007-05-16 21:54:28 UTC (rev 466) +++ branches/ogsector/src/VesselManager.cpp 2007-05-17 08:35:54 UTC (rev 467) @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + #include <OgreResourceManager.h> #include "VesselManager.h" #include "tinyxml/tinyxml.h" Modified: branches/ogsector/src/VesselManager.h =================================================================== --- branches/ogsector/src/VesselManager.h 2007-05-16 21:54:28 UTC (rev 466) +++ branches/ogsector/src/VesselManager.h 2007-05-17 08:35:54 UTC (rev 467) @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + #ifndef VESSELMANAGER__H #define VESSELMANAGER__H Modified: branches/ogsector/src/common.cpp =================================================================== --- branches/ogsector/src/common.cpp 2007-05-16 21:54:28 UTC (rev 466) +++ branches/ogsector/src/common.cpp 2007-05-17 08:35:54 UTC (rev 467) @@ -1,29 +1,28 @@ /*************************************************************************** - * common.cpp - * - * Copyright: 2007 spo...@so... - ****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ + * Copyright (C) 2006-2007 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ #include "common.h" long createGlobalID( int userId, int childId ) { return childId * MAXUSERID + userId; } -void myMSleep( int s ){ +void myMSleep( int s ) { #ifdef WIN32 Sleep( s ); #else Modified: branches/ogsector/src/common.h =================================================================== --- branches/ogsector/src/common.h 2007-05-16 21:54:28 UTC (rev 466) +++ branches/ogsector/src/common.h 2007-05-17 08:35:54 UTC (rev 467) @@ -1,26 +1,36 @@ /*************************************************************************** - * common.h + * Copyright (C) 2006-2007 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +/*! + * \file * - * Copyright: 2007 spo...@so... - ****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * \brief This file contains several functions that can be used in common. * - * This program 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. + * For example you can find methods here that are used to enable opengate to be + * cross platform. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * \author Carsten <spo...@us...> */ -#ifndef COMMON__H -#define COMMON__H COMMON__H +#ifndef _OPENGATE_COMMON__H +#define _OPENGATE_COMMON__H #ifdef HAVE_CONFIG_H #include <config.h> @@ -40,28 +50,75 @@ #define MAXUSERID 1000000 long createGlobalID( int userId, int childId ); +/*! + * \brief This method compares two values and returns the smaller one + * \param a One of the values to compare + * \param b The other value to compare + */ template < class T > T max( const T & a, const T & b ) { if ( a < b ) return b; else return a; } + +/*! + * \brief This method compares two values and returns the bigger one + * \param a One of the values to compare + * \param b The other value to compare + */ template < class T > T min( const T & a, const T & b ) { if ( a > b ) return b; else return a; } -template< typename T > inline std::string toStr( const T & value ){ +/*! + * \brief This method converts any given value to a string using streams + * \param value The value to convert to a string + */ +template< typename T > inline std::string toStr( const T & value ) { std::ostringstream streamOut; streamOut << value; return streamOut.str(); } -inline int toInt( const std::string & str ){ return atoi( str.c_str() ); } -inline float toFloat( const std::string & str ){ return strtof( str.c_str(), NULL ); } -inline double toDouble( const std::string & str ){ return strtod( str.c_str(), NULL ); } +/*! + * \brief This method converts a string to int + * \param str The string you want to convert + */ +inline int toInt( const std::string & str ) { + return atoi( str.c_str() ); +} -template< typename Real > Real round( Real val, int digits ){ - Real fak = std::pow((Real)10.0, (Real)digits); +/*! + * \brief This method converts a string to float + * \param str The string you want to convert + */ +inline float toFloat( const std::string & str ) { + return strtof( str.c_str(), NULL ); +} + +/*! + * \brief This method converts a string to double + * \param str The string you want to double + */ +inline double toDouble( const std::string & str ) { + return strtod( str.c_str(), NULL ); +} + +/*! + * \brief Round a Real by a given amount of digits + * \param val The Real you want to round + * \param digits The amount amount of digits the new Real should have + */ +template< typename Real > Real round( Real val, int digits ) { + Real fak = std::pow((Real)10.0, (Real)digits); return rint( val * fak) / fak; } +/*! + * \brief This method is used as a cross plattform sleep method. + * + * You pass an amount of seconds to this function that you want the program or + * a single thread to sleep. + * \param s The amount of seconds to sleep + */ void myMSleep( int s ); // template< typename Vec > std::ostream & operator << ( std::ostream & str, const Vec & vec ){ // str << vec[ 0 ] << " " << vec[ 1 ] << " " << vec[ 2 ]; // } -#endif // COMMON__H +#endif // _OPENGATE_COMMON__H Modified: branches/ogsector/src/networkClient.cpp =================================================================== --- branches/ogsector/src/networkClient.cpp 2007-05-16 21:54:28 UTC (rev 466) +++ branches/ogsector/src/networkClient.cpp 2007-05-17 08:35:54 UTC (rev 467) @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + #include "common.h" #include "networkProtocol.h" #include "networkClient.h" Modified: branches/ogsector/src/networkClient.h =================================================================== --- branches/ogsector/src/networkClient.h 2007-05-16 21:54:28 UTC (rev 466) +++ branches/ogsector/src/networkClient.h 2007-05-17 08:35:54 UTC (rev 467) @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + #ifndef NETWORKCLIENT__H #define NETWORKCLIENT__H Modified: branches/ogsector/src/networkProtocol.h =================================================================== --- branches/ogsector/src/networkProtocol.h 2007-05-16 21:54:28 UTC (rev 466) +++ branches/ogsector/src/networkProtocol.h 2007-05-17 08:35:54 UTC (rev 467) @@ -1,24 +1,22 @@ /*************************************************************************** - * networkProtocoll.h - * - * Copyright 2007 Spom Spom - * Email <spo...@so...> - ****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ + * Copyright (C) 2006-2007 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ #ifndef NETWORK_PROTOCOL__H #define NETWORK_PROTOCOL__H Modified: branches/ogsector/src/networkServer.cpp =================================================================== --- branches/ogsector/src/networkServer.cpp 2007-05-16 21:54:28 UTC (rev 466) +++ branches/ogsector/src/networkServer.cpp 2007-05-17 08:35:54 UTC (rev 467) @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + #include "networkServerUser.h" #include "networkServer.h" #include <iostream> Modified: branches/ogsector/src/networkServer.h =================================================================== --- branches/ogsector/src/networkServer.h 2007-05-16 21:54:28 UTC (rev 466) +++ branches/ogsector/src/networkServer.h 2007-05-17 08:35:54 UTC (rev 467) @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + #ifndef NETWORKSERVER__H #define NETWORKSERVER__H Modified: branches/ogsector/src/networkServerUser.cpp =================================================================== --- branches/ogsector/src/networkServerUser.cpp 2007-05-16 21:54:28 UTC (rev 466) +++ branches/ogsector/src/networkServerUser.cpp 2007-05-17 08:35:54 UTC (rev 467) @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + #include "networkServer.h" #include "networkServerUser.h" #include "common.h" Modified: branches/ogsector/src/networkServerUser.h =================================================================== --- branches/ogsector/src/networkServerUser.h 2007-05-16 21:54:28 UTC (rev 466) +++ branches/ogsector/src/networkServerUser.h 2007-05-17 08:35:54 UTC (rev 467) @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + #ifndef NETWORKSERVERUSER__H #define NETWORKSERVERUSER__H Modified: branches/ogsector/src/openALSoundManager.cpp =================================================================== --- branches/ogsector/src/openALSoundManager.cpp 2007-05-16 21:54:28 UTC (rev 466) +++ branches/ogsector/src/openALSoundManager.cpp 2007-05-17 08:35:54 UTC (rev 467) @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + #include "openALSoundManager.h" #include <iostream> Modified: branches/ogsector/src/openALSoundManager.h =================================================================== --- branches/ogsector/src/openALSoundManager.h 2007-05-16 21:54:28 UTC (rev 466) +++ branches/ogsector/src/openALSoundManager.h 2007-05-17 08:35:54 UTC (rev 467) @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + #ifndef OPENALSOUNDMANAGER__H #define OPENALSOUNDMANAGER__H OPENALSOUNDMANAGER__H Modified: branches/ogsector/src/opengateclient.cpp =================================================================== --- branches/ogsector/src/opengateclient.cpp 2007-05-16 21:54:28 UTC (rev 466) +++ branches/ogsector/src/opengateclient.cpp 2007-05-17 08:35:54 UTC (rev 467) @@ -1,3 +1,22 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ #ifdef WIN32 #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 Modified: branches/ogsector/src/opengateserver.cpp =================================================================== --- branches/ogsector/src/opengateserver.cpp 2007-05-16 21:54:28 UTC (rev 466) +++ branches/ogsector/src/opengateserver.cpp 2007-05-17 08:35:54 UTC (rev 467) @@ -1,7 +1,6 @@ /*************************************************************************** - * Copyright (C) 2006 by Christoph Brill * - * eg...@us... * - * 2007 spom_spom@.sourceforge.net * + * Copyright (C) 2006-2007 by OpenGate development team * + * spo...@us... * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -19,7 +18,6 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ - #ifdef HAVE_CONFIG_H #include <config.h> #endif Modified: branches/ogsector/src/testopenalmanager.cpp =================================================================== --- branches/ogsector/src/testopenalmanager.cpp 2007-05-16 21:54:28 UTC (rev 466) +++ branches/ogsector/src/testopenalmanager.cpp 2007-05-17 08:35:54 UTC (rev 467) @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + #include "openALSoundManager.h" #include <iostream> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2007-05-17 08:50:23
|
Revision: 468 http://svn.sourceforge.net/opengate/?rev=468&view=rev Author: egore Date: 2007-05-17 01:50:14 -0700 (Thu, 17 May 2007) Log Message: ----------- Add simple documentation about the gamestate classes Modified Paths: -------------- branches/ogsector/src/DockedState.cpp branches/ogsector/src/DockedState.h branches/ogsector/src/GameState.h branches/ogsector/src/UnDockedState.h Modified: branches/ogsector/src/DockedState.cpp =================================================================== --- branches/ogsector/src/DockedState.cpp 2007-05-17 08:35:54 UTC (rev 467) +++ branches/ogsector/src/DockedState.cpp 2007-05-17 08:50:14 UTC (rev 468) @@ -44,7 +44,7 @@ namespace OpenGate{ -DockedState::DockedState(){ +DockedState::DockedState(){ sceneMgr_ = NULL; shipConfigDialog_ = NULL; } Modified: branches/ogsector/src/DockedState.h =================================================================== --- branches/ogsector/src/DockedState.h 2007-05-17 08:35:54 UTC (rev 467) +++ branches/ogsector/src/DockedState.h 2007-05-17 08:50:14 UTC (rev 468) @@ -18,8 +18,8 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifndef DOCKEDSTATELISTENER__H -#define DOCKEDSTATELISTENER__H +#ifndef _OPENGATE_DOCKEDSTATELISTENER__H +#define _OPENGATE_DOCKEDSTATELISTENER__H #include <OgreCamera.h> @@ -29,11 +29,20 @@ namespace OpenGate{ + +/*! + * \brief This class defines the gamestate the gamestate when the user is docked + * + * When a user is currently docked at a station, this gamestate is active. The + * user is not able to move his ship or to fire weapons. But he is able to trade + * things, chat with others, equip his ship, etc. + * \author Carsten <spo...@us...> + */ class DockedState : public GameState { public: DECLARE_GAMESTATE_CLASS( DockedState ); - + virtual void createContent( ); virtual void destroyContent( ); @@ -71,8 +80,8 @@ Ogre::SceneManager * sceneMgr_; ShipConfigDialog * shipConfigDialog_; -}; +}; } // namespace OpenGate -#endif // DOCKEDSTATELISTENER__H +#endif // _OPENGATE_DOCKEDSTATELISTENER__H Modified: branches/ogsector/src/GameState.h =================================================================== --- branches/ogsector/src/GameState.h 2007-05-17 08:35:54 UTC (rev 467) +++ branches/ogsector/src/GameState.h 2007-05-17 08:50:14 UTC (rev 468) @@ -31,7 +31,7 @@ #include "OgreCEGUIRenderer.h" #include "OgreCEGUIResourceProvider.h" //regular mem handler -#include <OgreMemoryMacros.h> +#include <OgreMemoryMacros.h> #include <OgreFrameListener.h> @@ -55,34 +55,44 @@ class GameStateListener { public: - /** Constructor */ + /*! Constructor */ GameStateListener( ){ }; - - /** Virtual Deconstructor */ + + /*! Virtual Deconstructor */ virtual ~GameStateListener( ){ }; - - /** Store a game state to manage. */ + + /*! Store a game state to manage. */ virtual void manageGameState( const std::string & stateName, GameState * state ) = 0; - + /*! Find a game state by name. @Remarks returns 0 on failure. */ virtual GameState * findByName( const std::string & stateName) = 0; - - /** Request a change to state. */ + + /*! Request a change to state. */ virtual void changeGameState( GameState * state ) = 0; - - /** Push state onto the stack. */ + + /*! Push state onto the stack. */ virtual bool pushGameState( GameState * state ) = 0; - - /** Pop a game state off the stack. */ + + /*! Pop a game state off the stack. */ virtual void popGameState() = 0; - - /** Cause a shutdown. */ + + /*! Cause a shutdown. */ virtual void shutdown() = 0; - - /** Start gamestate. */ + + /*! Start gamestate. */ virtual void start( GameState * state ) = 0; }; +/*! + * \brief This abstract class defines a gamestate + * + * A gamestate is, as the name might suggest, the state of the game. The game + * needs to know what a user is currently doing. I.e. it has to act different + * if the user flying through space or if the user is docked. In one "state" the + * mouse controlls the ship. In the other state the mouse can be used in the + * menu. The gamestate describes this. + * \author Carsten <spo...@us...> + */ class GameState : public Ogre::FrameListener, public OIS::KeyListener, public OIS::MouseListener, @@ -146,31 +156,31 @@ } protected: - /** Constructor: This should be a private member of an inherited class. */ + /*! Constructor: This should be a private member of an inherited class. */ GameState() {}; - /** Destructor: This should be a private member of an inherited class. */ + /*! Destructor: This should be a private member of an inherited class. */ virtual ~GameState( ) {}; - /** Find a state by its name. */ + /*! Find a state by its name. */ GameState * findByName( const std::string & stateName ) { return parent_->findByName( stateName ); } - /** Request a change to game state. */ + /*! Request a change to game state. */ void changeGameState( GameState *state ) { parent_->changeGameState( state ); } - /** Push game state onto the stack. */ + /*! Push game state onto the stack. */ bool pushGameState( GameState * state ) { return parent_->pushGameState( state ); } - /** Pop a game state off the stack. */ + /*! Pop a game state off the stack. */ void popGameState( void ) { parent_->popGameState(); } - /** Cause a shutdown. */ + /*! Cause a shutdown. */ void shutdown( void ) { parent_->shutdown(); } - - /** Stores the GameStateManager which is managing this state. */ + + /*! Stores the GameStateManager which is managing this state. */ GameStateListener * parent_; - /** Keeps a method of device interaction. */ + /*! Keeps a method of device interaction. */ DeviceInfo * devices_; LogManager * log_; }; Modified: branches/ogsector/src/UnDockedState.h =================================================================== --- branches/ogsector/src/UnDockedState.h 2007-05-17 08:35:54 UTC (rev 467) +++ branches/ogsector/src/UnDockedState.h 2007-05-17 08:50:14 UTC (rev 468) @@ -32,18 +32,20 @@ class Sector; +/*! + * \brief This class defines the gamestate the gamestate when the user is flying + * + * This gamestate is the opposite of the DockedState. The user is flying through + * space, he can shot his weapons, move his ship, etc. but not modify his ship. + * \author Carsten <spo...@us...> + */ class UnDockedState : public GameState{ - -// class UnDockedState: public Ogre::FrameListener, -// public OIS::KeyListener, -// public OIS::MouseListener, -// public OIS::JoyStickListener { public: DECLARE_GAMESTATE_CLASS( UnDockedState ); void createContent( ); - + void destroyContent( ); void enter(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2007-05-17 09:04:04
|
Revision: 469 http://svn.sourceforge.net/opengate/?rev=469&view=rev Author: egore Date: 2007-05-17 02:04:06 -0700 (Thu, 17 May 2007) Log Message: ----------- Simple documentation of the logging facilities in Opengate Modified Paths: -------------- branches/ogsector/src/LogManager.cpp branches/ogsector/src/LogManager.h Modified: branches/ogsector/src/LogManager.cpp =================================================================== --- branches/ogsector/src/LogManager.cpp 2007-05-17 08:50:14 UTC (rev 468) +++ branches/ogsector/src/LogManager.cpp 2007-05-17 09:04:06 UTC (rev 469) @@ -39,7 +39,7 @@ void LogManager::setLogFile( const std::string & logFileName ){ logFile_.open( logFileName.c_str(), std::fstream::trunc ); - haveLogFile_ = true; + haveLogFile_ = true; } void LogManager::setChatLogFile( const std::string & chatLogFileName ){ @@ -60,7 +60,7 @@ std::string LogManager::timeStamp() { std::time_t now = std::time( 0 ); struct tm * time = localtime( &now ); - + return std::string("[" + toStr( time->tm_year + 1900 ) + "." + toStr( time->tm_mon + 1 ) + "." Modified: branches/ogsector/src/LogManager.h =================================================================== --- branches/ogsector/src/LogManager.h 2007-05-17 08:50:14 UTC (rev 468) +++ branches/ogsector/src/LogManager.h 2007-05-17 09:04:06 UTC (rev 469) @@ -34,20 +34,40 @@ enum LogType{ None, Info, Chat, Debug, Fatal}; +/*! + * \brief This class handles all the logging in Opengate + * + * Opengate has several possibilities of logging. The three main logging methods + * are persistent logging, session logging and console logging. Persisten + * logging is done in a file. All messages are logged into a file. These file + * will always get the messages appended. This way no message is overwritten and + * therefore is persistent. It can be used for chatlogs for example. + * The session logging is done similar to the persistent logging. It is also + * written to a file but this file will be empty each time Opengate starts. The + * console logging is not put into any file. + * The logmanager knows if he has a storage for the persistent logging (see + * setChatLogFile() ) and also if he has a file for session logging (see + * setLogFile() ). You can also add an OGConsole for the so called console + * logging (see setConsole()). + * \author Carsten <spo...@us... > + */ class LogManager : public Ogre::Singleton< LogManager > { public: LogManager( ); - + ~LogManager( ); + /*! Open a session log file with the given filename \param logFileName The name of the file */ void setLogFile( const std::string & logFileName ); + /*! Open the persistent log file for the chatlog with the given filename \param logFileName The name of the file */ void setChatLogFile( const std::string & chatLogFileName ); + /*! Use the given OGConsole console to write the logs to it \param console The given OGConsole */ void setConsole( OGConsole * console ); std::string timeStamp(); - + void info( const std::string & msg ); void chat( const std::string & name, const std::string & msg ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2007-05-17 09:23:56
|
Revision: 470 http://svn.sourceforge.net/opengate/?rev=470&view=rev Author: egore Date: 2007-05-17 02:23:30 -0700 (Thu, 17 May 2007) Log Message: ----------- Some fine piece of cake ... erm ... documentation Modified Paths: -------------- branches/ogsector/src/LogManager.cpp branches/ogsector/src/LogManager.h Modified: branches/ogsector/src/LogManager.cpp =================================================================== --- branches/ogsector/src/LogManager.cpp 2007-05-17 09:04:06 UTC (rev 469) +++ branches/ogsector/src/LogManager.cpp 2007-05-17 09:23:30 UTC (rev 470) @@ -79,24 +79,23 @@ } void LogManager::info( const std::string & msg ){ - std::string logMsg( "INFO: " + msg ); + std::string logMsg( "INFO: " + msg ); writeToConsole_( logMsg ); write_( logMsg ); } void LogManager::debug( const std::string & msg ){ - std::string logMsg( "DEBUG: " + msg ); + std::string logMsg( "DEBUG: " + msg ); write_( logMsg ); } void LogManager::warn( const std::string & msg ){ - std::string logMsg( "WARNING: " + msg ); + std::string logMsg( "WARNING: " + msg ); write_( logMsg ); } void LogManager::fatal( const std::string & msg ){ - std::string logMsg( "FATAL: " + msg ); - + std::string logMsg( "FATAL: " + msg ); writeToConsole_( logMsg ); write_( logMsg ); } @@ -114,9 +113,9 @@ if ( haveLogFile_ ) logFile_ << timeStamp() << ": " << msg << std::endl; } -LogManager & LogManager::getSingleton( ){ - assert( ms_Singleton ); - return ( *ms_Singleton ); +LogManager & LogManager::getSingleton( ){ + assert( ms_Singleton ); + return ( *ms_Singleton ); } LogManager * LogManager::getSingletonPtr( ){ Modified: branches/ogsector/src/LogManager.h =================================================================== --- branches/ogsector/src/LogManager.h 2007-05-17 09:04:06 UTC (rev 469) +++ branches/ogsector/src/LogManager.h 2007-05-17 09:23:30 UTC (rev 470) @@ -49,6 +49,17 @@ * setChatLogFile() ) and also if he has a file for session logging (see * setLogFile() ). You can also add an OGConsole for the so called console * logging (see setConsole()). + * + * Opengate also supports different levels of importance for the logging. These + * levels are handled like this: + * <table> + * <tr><td>Level</td><td>Persistent log</td><td>Session log (and stdout)</td><td>Console log</td><td>Description</td></tr> + * <tr><td>info</td><td> </td><td>X</td><td>X</td><td>General interesting information (i.e. "player connected")</td></tr> + * <tr><td>chat</td><td>X</td><td>X</td><td>X</td><td>Chat from and to other users</td></tr> + * <tr><td>debug</td><td> </td><td>X</td><td> </td><td>Messages that indicate internal things that might be interesting for developers</td></tr> + * <tr><td>warning</td><td> </td><td>X</td><td> </td><td>Messages interesting for developers</td></tr> + * <tr><td>fatal</td><td> </td><td>X</td><td>X</td><td>Messages when really bad things happen</td></tr> + * </table> * \author Carsten <spo...@us... > */ class LogManager : public Ogre::Singleton< LogManager > { @@ -66,22 +77,31 @@ /*! Use the given OGConsole console to write the logs to it \param console The given OGConsole */ void setConsole( OGConsole * console ); + /*! Create a timestamp \return A timestamp in the format [YYYY.MM.DD-HH.MM.SS] */ std::string timeStamp(); + /*! Protocol a message with info-level importance */ void info( const std::string & msg ); + /*! Protocol a chat-message */ void chat( const std::string & name, const std::string & msg ); + /*! Protocol a message with debug-level importance */ void debug( const std::string & msg ); + /*! Protocol a message with warn-level importance */ void warn( const std::string & msg ); + /*! Protocol a message with fatal-level importance */ void fatal( const std::string & msg ); + /*! TODO: Do we really need that? All messages should go into a logfile. */ void cout( const std::string & msg ); + /*! This method returns the single instance of the LogManager */ static LogManager & getSingleton( void ); + /*! This method return a pointer to the single instance of the LogManager */ static LogManager * getSingletonPtr( void ); // LogManager & operator - ( LogType type ); @@ -90,15 +110,25 @@ // LogManager & operator << ( const Flush & flush ); protected: + + /*! This method writes the given message to stdout and (if available) to a logfile */ void write_( const std::string & msg ); + + /*! This method writes the given message to the console */ void writeToConsole_( const std::string & msg ); + /*! Handle to the session log file */ std::ofstream logFile_; + /*! Handle to the persistent log file */ std::ofstream chatLogFile_; + /*! Handle to the console log */ OGConsole *console_; + /*! True, if we have a session log file */ bool haveLogFile_; + /*! True, if we have a persistent log file */ bool haveChatLogFile_; + /*! True, if we have a console log */ bool haveConsole_; // LogType logType_; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2007-05-17 12:04:36
|
Revision: 471 http://svn.sourceforge.net/opengate/?rev=471&view=rev Author: egore Date: 2007-05-17 05:04:38 -0700 (Thu, 17 May 2007) Log Message: ----------- Try to add a server shutdown ... but it segfaults :-/ Modified Paths: -------------- branches/ogsector/src/Sector.h branches/ogsector/src/networkProtocol.h branches/ogsector/src/networkServer.cpp branches/ogsector/src/opengateclient.cpp branches/ogsector/src/opengateserver.cpp Modified: branches/ogsector/src/Sector.h =================================================================== --- branches/ogsector/src/Sector.h 2007-05-17 09:23:30 UTC (rev 470) +++ branches/ogsector/src/Sector.h 2007-05-17 12:04:38 UTC (rev 471) @@ -79,7 +79,7 @@ void selectPrevTarget( SectorObject * obj = NULL ); SectorObject * nextTarget( ); - + SectorObject * prevTarget( ); void sendAllVesselInfos( ); Modified: branches/ogsector/src/networkProtocol.h =================================================================== --- branches/ogsector/src/networkProtocol.h 2007-05-17 09:23:30 UTC (rev 470) +++ branches/ogsector/src/networkProtocol.h 2007-05-17 12:04:38 UTC (rev 471) @@ -18,8 +18,8 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifndef NETWORK_PROTOCOL__H -#define NETWORK_PROTOCOL__H +#ifndef _OPENGATE_NETWORK_PROTOCOL__H +#define _OPENGATE_NETWORK_PROTOCOL__H #include <Ogre.h> @@ -65,12 +65,20 @@ count += sizeof( T ); } +/*! + * \brief This is the class that every MessageBody (which is transfered over the + * network) should inherit from + * \author Carsten <spo...@us...> + */ class MessageBodyBase{ public: + + /*! Constructor */ MessageBodyBase( ) : type_( 0 ), senderID_( 0 ) { type_ = (Uint8)PROTO_BASE; } + /*! Constructor with data */ MessageBodyBase( const char * data ) : type_( 0 ), senderID_( 0 ) { type_ = (Uint8)PROTO_BASE; int count = 0; @@ -78,6 +86,7 @@ readFromData( senderID_, data, count ); } + /*! Destructor */ virtual ~MessageBodyBase(){ } virtual char * data() { @@ -114,6 +123,11 @@ std::string outData_; }; + +/*! + * \brief This class encapsulates the User ID to send it over the network + * \author Carsten <spo...@us...> + */ class MessageBodyUserID : public MessageBodyBase{ public: MessageBodyUserID( Uint32 userID ) : MessageBodyBase(), userID_( userID ){ @@ -140,6 +154,10 @@ Uint32 userID_; }; +/*! + * \brief This class encapsulates the disconnect event + * \author Carsten <spo...@us...> + */ class MessageBodyDisconnect : public MessageBodyUserID{ public: MessageBodyDisconnect( Uint32 userID ) : MessageBodyUserID( userID ){ @@ -152,6 +170,10 @@ protected: }; +/*! + * \brief This class encapsulates the username + * \author Carsten <spo...@us...> + */ class MessageBodyUserName : public MessageBodyBase{ public: MessageBodyUserName( const std::string & username, Uint32 senderID = 0 ) : MessageBodyBase(), username_( username ){ @@ -183,6 +205,10 @@ std::string username_; }; +/*! + * \brief This class encapsulates the event when a connection was refused + * \author Carsten <spo...@us...> + */ class MessageBodyConnectionRefused : public MessageBodyBase{ public: MessageBodyConnectionRefused( Uint8 reason ) : MessageBodyBase(), reason_( reason ){ @@ -207,6 +233,10 @@ Uint8 reason_; }; +/*! + * \brief This class encapsulates the chat events + * \author Carsten <spo...@us...> + */ class MessageBodyChat : public MessageBodyBase { public: MessageBodyChat( const std::string & message ) : MessageBodyBase(), message_( message ) { @@ -241,6 +271,10 @@ std::string message_; }; +/*! + * \brief This abstract class encapsulates the event happening on/with a vessel + * \author Carsten <spo...@us...> + */ class MessageBodyShipBase : public MessageBodyBase { public: MessageBodyShipBase( Uint8 childID ) @@ -547,5 +581,5 @@ } // namespace OpenGate -#endif //NETWORK_PROTOCOL__H +#endif // _OPENGATE_NETWORK_PROTOCOL__H Modified: branches/ogsector/src/networkServer.cpp =================================================================== --- branches/ogsector/src/networkServer.cpp 2007-05-17 09:23:30 UTC (rev 470) +++ branches/ogsector/src/networkServer.cpp 2007-05-17 12:04:38 UTC (rev 471) @@ -37,14 +37,16 @@ acceptor_.set_option( asio::ip::tcp::acceptor::reuse_address( true ) ); acceptor_.bind( endpoint ); acceptor_.listen(); - + UserSession * newUser = new UserSession( this, userIDCounter_ ); acceptor_.async_accept( newUser->socket(), boost::bind( & Server::handleAccept, this, newUser, asio::placeholders::error ) ); } - + Server::~Server(){ + // TODO: necessary? delete(newUser); + segfaults: acceptor_.close(); } void Server::handleAccept( UserSession * user, const asio::error & error ){ Modified: branches/ogsector/src/opengateclient.cpp =================================================================== --- branches/ogsector/src/opengateclient.cpp 2007-05-17 09:23:30 UTC (rev 470) +++ branches/ogsector/src/opengateclient.cpp 2007-05-17 12:04:38 UTC (rev 471) @@ -37,6 +37,8 @@ OpenGate::LogManager *log = new OpenGate::LogManager(); log->setLogFile( "OpenGate.log" ); log->setChatLogFile( "OpenGateChat.log" ); + log->info("Starting up"); + log->info(PACKAGE_STRING); std::string username = "testuser"; std::string hostname = "localhost"; Modified: branches/ogsector/src/opengateserver.cpp =================================================================== --- branches/ogsector/src/opengateserver.cpp 2007-05-17 09:23:30 UTC (rev 470) +++ branches/ogsector/src/opengateserver.cpp 2007-05-17 12:04:38 UTC (rev 471) @@ -23,6 +23,7 @@ #endif #include <iostream> +#include <signal.h> #include "common.h" #include "networkServer.h" @@ -30,27 +31,61 @@ using namespace OpenGate; +LogManager *logMgr = 0; +asio::io_service *io_servicePtr = 0; +Server *serverPtr = 0; + +void server_shutdown() { + /* TODO: sefaults + if (serverPtr) { + delete(serverPtr); + } + if (io_servicePtr) { + io_servicePtr->interrupt(); + }*/ +} + +void signal_term(int singal) { + logMgr->info("SIG_TERM received... exiting!"); + server_shutdown(); + exit(0); +} + +void signal_interrupt(int singal) { + logMgr->info("SIG_INT received... exiting!"); + server_shutdown(); + exit(0); +} + int main( int argc, char *argv[] ) { - LogManager *log = new LogManager( ); - log->setLogFile( "OGserver.log" ); - log->setChatLogFile( "OGserverChat.log" ); + logMgr = new LogManager( ); + logMgr->setLogFile( "OGserver.log" ); + logMgr->setChatLogFile( "OGserverChat.log" ); + logMgr->info("Starting up"); + logMgr->info(PACKAGE_STRING); - std::cout << "Starting up" << std::endl; - std::cout << "-----------" << std::endl; + signal(SIGTERM, signal_term); + signal(SIGINT, signal_interrupt); try { asio::io_service io_service; + io_servicePtr = &io_service; tcp::endpoint endpoint( tcp::v4(), OG_PORT ); Server server( io_service, endpoint ); - + serverPtr = &server; + io_service.run(); } catch ( asio::error & e ) { - log->fatal( e.what() ); + logMgr->fatal( e.what() ); + server_shutdown(); + return EXIT_FAILURE; } catch ( std::exception & e ) { - log->fatal( std::string("Exception: ") + e.what() ); - } + logMgr->fatal( std::string("Exception: ") + e.what() ); + server_shutdown(); + return EXIT_FAILURE; + } return EXIT_SUCCESS; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2007-05-17 12:32:29
|
Revision: 472 http://svn.sourceforge.net/opengate/?rev=472&view=rev Author: egore Date: 2007-05-17 05:32:30 -0700 (Thu, 17 May 2007) Log Message: ----------- [QA] document the vessel manager a bit [QA] add few todo's Modified Paths: -------------- branches/ogsector/src/VesselManager.cpp branches/ogsector/src/VesselManager.h Modified: branches/ogsector/src/VesselManager.cpp =================================================================== --- branches/ogsector/src/VesselManager.cpp 2007-05-17 12:04:38 UTC (rev 471) +++ branches/ogsector/src/VesselManager.cpp 2007-05-17 12:32:30 UTC (rev 472) @@ -45,19 +45,19 @@ TiXmlDocument doc( shipResourceFile ); bool loadOkay = doc.LoadFile(); - + std::map < int, std::string > ships; - + if ( loadOkay ) { log_->info( std::string( "open resource file for ships: ") + shipResourceFile ); TiXmlHandle docHandle( &doc ); TiXmlElement* pElem; TiXmlHandle hRoot( 0 ); - + //** block: Ships; pElem = docHandle.FirstChildElement().Element(); hRoot = TiXmlHandle( pElem ); - + if ( pElem ) { for ( pElem = hRoot.FirstChild( "Resource" ).Element(); pElem != 0; pElem = pElem->NextSiblingElement() ) { log_->info( std::string( "Found ressource: " ) + pElem->Attribute("location") ); @@ -69,7 +69,7 @@ } else { // log_->info( shipResourceFile + " cannot open shipResourceFile." ); } - + for ( std::map < int, std::string >::iterator it = ships.begin(); it != ships.end(); it ++ ){ loadAndCreateVessel( it->first, it->second ); } @@ -82,7 +82,7 @@ bool loadOkay = doc.LoadFile(); if ( loadOkay ) { - + TiXmlHandle docHandle( &doc ); TiXmlElement* pElem; TiXmlNode* pNode; @@ -91,12 +91,12 @@ //** block: Ship; pElem = docHandle.FirstChildElement().Element(); hRoot = TiXmlHandle( pElem ); - + if ( !pElem ) { log_->fatal( fileName + " cannot read first node." ); return NULL; } - + if ( strcmp( "ship", pElem->Value() ) == 0 ){ Vessel *vessel = new Vessel(); @@ -121,7 +121,7 @@ pElem = hRoot.ChildElement( "techlevel", 0 ).Element(); if ( pElem ) vessel->setTechLevel( toInt( pElem->FirstChild()->Value() ) ); - + pElem = hRoot.ChildElement( "size", 0 ).Element(); if ( pElem ) vessel->setBaseSize( toInt( pElem->FirstChild()->Value() ) ); pElem = hRoot.ChildElement( "baseyaw", 0 ).Element(); @@ -151,7 +151,7 @@ pElem = hRoot.ChildElement( "cargocapacity", 0 ).Element(); if ( pElem ) vessel->setCargoSize( toInt( pElem->FirstChild()->Value() ) ); - + pElem = hRoot.ChildElement( "capacitorsize", 0 ).Element(); if ( pElem ) vessel->setCapacitorSize( toInt( pElem->FirstChild()->Value() ) ); pElem = hRoot.ChildElement( "powerplantsize", 0 ).Element(); @@ -202,11 +202,9 @@ return NULL; } - - -VesselManager & VesselManager::getSingleton( ){ - assert( ms_Singleton ); - return ( *ms_Singleton ); +VesselManager & VesselManager::getSingleton( ){ + assert( ms_Singleton ); + return ( *ms_Singleton ); } VesselManager * VesselManager::getSingletonPtr( ){ Modified: branches/ogsector/src/VesselManager.h =================================================================== --- branches/ogsector/src/VesselManager.h 2007-05-17 12:04:38 UTC (rev 471) +++ branches/ogsector/src/VesselManager.h 2007-05-17 12:32:30 UTC (rev 472) @@ -29,8 +29,28 @@ namespace OpenGate{ +/*! + * \brief This class defines a vessel. + * + * A vessel in opengate is that thing, that the user needs to fly around in + * space. Others might call it "starship", "spaceshit" or something like that. + * A vessel has several properties. It has a weight, a yaw-. a roll- and a + * pitch-latency. It also has a drag factor and many properties more. Each + * vessel must have these options. The data of a vessel is loaded from an XML + * document. This is more or less a logical storage for the vessel, not more and + * not less. + * \todo Check how to load the XML data into a vessel. My first approach was that + * a vessel was passed the name of the XML document and it load everything + * from that file. The better approach would be to create something like + * an XMLManager, that is able to load a vessel by it's name. + * \todo See how to attach objects (capacitory, power plants, weapons) to the + * vessel. + * \author Carsten <spo...@us...> + */ class Vessel{ -public: +public: + + /*! Constructor creating a dummy vessel */ Vessel(): factionName_( "unknown" ), name_( "unknown" ), className_( "unknown" ){ vesselID_ = 0; @@ -61,6 +81,7 @@ } + /*! Desctructor */ ~Vessel(){} inline void setFactionName( const std::string & name ) { factionName_ = name; } @@ -151,11 +172,9 @@ pMesh_ = Ogre::MeshManager::getSingleton().load( fileName, "General" ); // pMesh_ = Ogre::MeshManager::getSingleton().load( meshName, "../../trunk/data/ships/octavius/apteryx/" ); } - Ogre::MeshPtr & meshPtr( ){ return pMesh_; } - -protected: +protected: std::string factionName_; std::string name_; std::string className_; @@ -189,19 +208,43 @@ Ogre::MeshPtr pMesh_; }; +/*! + * \brief This singleton class is able to load a vessel by it's name + * + * The vessel manager is a class to handle access to all vessels. This way a + * single entity can handle all vessels and hand them out to whoever requests + * access to them. They are loaded once from an XML file and stored internally. + * The can be requested by their name or by their unique ID. + * + * \todo Check if it would make sense to extend an XMLManager that is able to + * load every supported type of object in opengate. I guess functionality + * between a loader for vessels and for power plants would be really + * similar. + * \author Carsten <spo...@us...> + */ class VesselManager : public Ogre::Singleton< VesselManager >{ public: + + /*! Get the single instance of the VesselManager */ static VesselManager & getSingleton( ); + + /*! Get the pointer to single instance of the VesselManager */ static VesselManager * getSingletonPtr( ); + /*! Constructor */ VesselManager(); + /*! Destructor that free's all loaded vessels */ ~VesselManager(); - void loadVessels( const std::set < std::string > & resourcePaths, const std::string & resourceName ); - + /*! This method loads a vessel and stores it in the interal storage + * \param resourcePaths An array of all available resource paths + * \param resourceName The name of the file to load the vessel from */ + void loadVessel( const std::set < std::string > & resourcePaths, const std::string & resourceName ); + Vessel * loadAndCreateVessel( int vesselID, const std::string & filename ); + /*! This returns a vessel by it's given unique ID \remarks The vessel needs to be loaded before \param vesselID The unique ID of a vessel */ Vessel * vessel( int vesselID ){ if ( vesselID_.count( vesselID ) ){ return vesselID_[ vesselID ]; @@ -211,6 +254,7 @@ } } + /*! This returns a vessel by it's given name \remarks The vessel needs to be loaded before \param vesselID The name of a vessel */ Vessel * vessel( const std::string & vesselName ){ if ( vessels_.count( vesselName ) ){ return vessels_[ vesselName ]; @@ -220,6 +264,7 @@ } } + /*! This returns all vessels for one faction \param factionName The name of the faction */ std::set < Vessel * > factionVessels( const std::string & factionName ){ std::set < Vessel * > vessels; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2007-05-17 12:48:56
|
Revision: 473 http://svn.sourceforge.net/opengate/?rev=473&view=rev Author: egore Date: 2007-05-17 05:48:54 -0700 (Thu, 17 May 2007) Log Message: ----------- [QA] Minor documentation of the config dialog Modified Paths: -------------- branches/ogsector/src/ShipConfigDialog.cpp branches/ogsector/src/ShipConfigDialog.h Modified: branches/ogsector/src/ShipConfigDialog.cpp =================================================================== --- branches/ogsector/src/ShipConfigDialog.cpp 2007-05-17 12:32:30 UTC (rev 472) +++ branches/ogsector/src/ShipConfigDialog.cpp 2007-05-17 12:48:54 UTC (rev 473) @@ -29,10 +29,10 @@ namespace OpenGate{ ShipConfigDialog::ShipConfigDialog( DeviceInfo * devices, Ogre::SceneManager * sceneMgr ) - : rootWindow_( CEGUI::WindowManager::getSingleton().loadWindowLayout( "dialogs/ShipConfigDialog.layout" ) ), + : rootWindow_( CEGUI::WindowManager::getSingleton().loadWindowLayout( "dialogs/ShipConfigDialog.layout" ) ), devices_( devices ), sceneMgr_( sceneMgr ) { - rttTex_ = NULL; + rttTex_ = 0; LogManager::getSingleton().info( "ShipConfigDialog::ShipConfigDialog" ); @@ -50,7 +50,7 @@ v->setBackgroundColour( Ogre::ColourValue( 0.0, 0.0, 0.0) ); v->setOverlaysEnabled( false ); - rttTex_->addListener( this ); + rttTex_->addListener( this ); // // rttCam->setAspectRatio( (Ogre::Real)devices_->renderWindow->getViewport( 0 )->getActualWidth() / // // (Ogre::Real)devices_->renderWindow->getViewport( 0 )->getActualHeight() ); @@ -155,7 +155,7 @@ CEGUI::WindowManager::getSingleton().destroyWindow( rootWindow_ ); } - + void ShipConfigDialog::show( ){ visible_ = true; rootWindow_->show(); Modified: branches/ogsector/src/ShipConfigDialog.h =================================================================== --- branches/ogsector/src/ShipConfigDialog.h 2007-05-17 12:32:30 UTC (rev 472) +++ branches/ogsector/src/ShipConfigDialog.h 2007-05-17 12:48:54 UTC (rev 473) @@ -33,31 +33,48 @@ class Vessel; +/*! + * \brief This is the user interface to manage your vessel + * + * \author Carsten <spo...@us...> + */ class ShipConfigDialog : public Ogre::RenderTargetListener { -public: +public: ShipConfigDialog( DeviceInfo * devices, Ogre::SceneManager * sceneMgr ); ~ShipConfigDialog(); - + CEGUI::String name() const { return rootWindow_->getName(); } + + /*! This method is used to show the vessel configuration dialog. */ void show( ); + /*! This method is used to hide the vessel configuration dialog. */ void hide( ); + /*! This is used to change the visibility of the vessel configuration dialog \param visibility True to set the dialog visible */ void setVisible( bool visibility ){ if ( visibility ) show(); else hide(); } + /*! Check if the dialog is visible \return True, if the dialog is visible */ bool isVisible( ) const { return visible_; } + /*! Update the dialog by rotating the ship. \param timeElapsed The amount of time passed since the last update */ void update( Ogre::Real timeElapsed ); virtual void setupEventHandlers(); protected: + + /*! This changes the ship rendered to the texture rttTex_. It is called by handleNextShipButton() or handlePrevShipButton(). */ void updateShipView(); + /*! CEGUI event handler: Handles the event when the user pushes the "Next" button */ bool handleNextShipButton( const CEGUI::EventArgs & e ); + /*! CEGUI event handler: Handles the event when the user pushes the "Previous" button */ bool handlePrevShipButton( const CEGUI::EventArgs & e ); + /*! CEGUI event handler: Handles the event when the user pushes the "Select" button */ bool handleSelectShipButton( const CEGUI::EventArgs & e ); + /*! CEGUI event handler: Handles the event when the user pushes the "Close dialog" button */ bool handleCloseButton( const CEGUI::EventArgs & e ); DeviceInfo * devices_; @@ -70,10 +87,14 @@ CEGUI::PushButton * shipConfigWindowViewButton_; CEGUI::OgreCEGUITexture * ceguiTex_; Ogre::SceneNode * rttNode_; + /*! This is needed to show a rotating ship in the menu. Ogre renders the image to this texture and CEGUI shows it. */ Ogre::RenderTexture * rttTex_; + /*! Handle to the current vessel that is shown */ Ogre::Entity * displayedEntity_; + /*! This stores all the vessels available to view in the vessel configuration dialog */ std::set < Vessel * > vessels_; + /*! This is the iterator running over the available ships. It's of interest when someone clicks handleNextShipButton() or handlePrevShipButton() to show the next ship. */ std::set < Vessel * >::iterator itVessel_; }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2007-05-17 18:41:51
|
Revision: 475 http://svn.sourceforge.net/opengate/?rev=475&view=rev Author: egore Date: 2007-05-17 11:41:36 -0700 (Thu, 17 May 2007) Log Message: ----------- [Bugfix] restore deleted "s" in VesselManager [QA] add some doxygen to openALSoundManager Modified Paths: -------------- branches/ogsector/src/Sector.cpp branches/ogsector/src/VesselManager.h branches/ogsector/src/openALSoundManager.cpp branches/ogsector/src/openALSoundManager.h Modified: branches/ogsector/src/Sector.cpp =================================================================== --- branches/ogsector/src/Sector.cpp 2007-05-17 14:37:08 UTC (rev 474) +++ branches/ogsector/src/Sector.cpp 2007-05-17 18:41:36 UTC (rev 475) @@ -104,11 +104,11 @@ //*** end starfield test 2; - planetNode_ = sceneMgr_->getRootSceneNode()->createChildSceneNode( "PlanetNode" ); - Ogre::ManualObject * planet = sceneMgr_->createManualObject( "Planet" ); + planetNode_ = sceneMgr_->getRootSceneNode()->createChildSceneNode( "PlanetNode" ); + Ogre::ManualObject * planet = sceneMgr_->createManualObject( "Planet" ); // planet->setUseIdentityProjection( true ); // planet->setUseIdentityView( true ); - + planet->begin( "OpenGate/RedPlanet", Ogre::RenderOperation::OT_TRIANGLE_LIST); planet->position( Ogre::Vector3( -1.0, -1.0, 200.0 ) ); planet->textureCoord( 0, 0 ); @@ -119,13 +119,13 @@ planet->position( Ogre::Vector3( -1.0, 1.0, 200.0 ) ); planet->textureCoord( 0, 1 ); planet->quad( 0, 1, 2, 3 ); - planet->end(); + planet->end(); Ogre::AxisAlignedBox aabInf; aabInf.setInfinite(); planet->setBoundingBox( aabInf ); planetNode_->attachObject( planet ); planetNode_->scale( 20000, 20000, 1 ); planetNode_->setPosition( Ogre::Vector3( 20000.0, 10000.0, 50000 ) ); - + new OgreOpcode::CollisionManager( sceneMgr_ ); OgreOpcode::CollisionManager::getSingletonPtr()->addCollClass( "SectorObject" ); OgreOpcode::CollisionManager::getSingletonPtr()->addCollClass( "Bullet" ); Modified: branches/ogsector/src/VesselManager.h =================================================================== --- branches/ogsector/src/VesselManager.h 2007-05-17 14:37:08 UTC (rev 474) +++ branches/ogsector/src/VesselManager.h 2007-05-17 18:41:36 UTC (rev 475) @@ -237,10 +237,10 @@ /*! Destructor that free's all loaded vessels */ ~VesselManager(); - /*! This method loads a vessel and stores it in the interal storage + /*! This method loads vessels and stores them in an interal storage * \param resourcePaths An array of all available resource paths - * \param resourceName The name of the file to load the vessel from */ - void loadVessel( const std::set < std::string > & resourcePaths, const std::string & resourceName ); + * \param resourceName The name of the file to load the vessels from */ + void loadVessels( const std::set < std::string > & resourcePaths, const std::string & resourceName ); Vessel * loadAndCreateVessel( int vesselID, const std::string & filename ); Modified: branches/ogsector/src/openALSoundManager.cpp =================================================================== --- branches/ogsector/src/openALSoundManager.cpp 2007-05-17 14:37:08 UTC (rev 474) +++ branches/ogsector/src/openALSoundManager.cpp 2007-05-17 18:41:36 UTC (rev 475) @@ -23,17 +23,17 @@ OpenALSoundManager::OpenALSoundManager( int maxBuffers, int maxSources ) : maxBuffers_( maxBuffers ), maxSources_( maxSources ){ - + //** Audio sources; audioSourcesInUseCount_ = 0; audioSources_ = new unsigned int[ maxSources_ ]; audioSourceInUse_ = new bool[ maxSources_ ]; - + //** Audio buffers; audioBuffersInUseCount_ = 0; audioBuffers_ = new unsigned int[ maxBuffers_ ]; audioBufferInUse_ = new bool[ maxBuffers_ ]; - + init(); } @@ -150,13 +150,13 @@ } //** Successfully loaded the file into an audio buffer; - audioBufferInUse_[ bufferID ] = true; + audioBufferInUse_[ bufferID ] = true; //** save the file descriptor; audioBufferFileName_[ filename ] = bufferID; //** bump the 'in use' counter; - audioBuffersInUseCount_++; + audioBuffersInUseCount_++; return bufferID; } Modified: branches/ogsector/src/openALSoundManager.h =================================================================== --- branches/ogsector/src/openALSoundManager.h 2007-05-17 14:37:08 UTC (rev 474) +++ branches/ogsector/src/openALSoundManager.h 2007-05-17 18:41:36 UTC (rev 475) @@ -18,14 +18,22 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifndef OPENALSOUNDMANAGER__H -#define OPENALSOUNDMANAGER__H OPENALSOUNDMANAGER__H +#ifndef _OPENGATE_OPENALSOUNDMANAGER__H +#define _OPENGATE_OPENALSOUNDMANAGER__H #include <string> #include <map> #include <AL/alut.h> +namespace OpenGate { + +/*! + * \brief The soundmanager based on OpenAL + * + * The soundmanager is used to play sounds. + * \author Carsten <spo...@us...> + */ class OpenALSoundManager{ public: @@ -34,7 +42,7 @@ ~OpenALSoundManager(); bool init(); - + std::string listAvailableDevices(); bool checkOpenALError( const std::string & str ); @@ -48,7 +56,7 @@ int loadAudioInToSystem( const std::string & filename ); bool loadAndAssignWAV( const std::string & filename, int buffNumber ); - + bool createSource( unsigned int * sourceId ); bool bindAudioToSource( unsigned int bufferId, unsigned int sourceId, bool loop = false); @@ -60,7 +68,7 @@ bool setSourcePosition( unsigned int sourceId, const double x, const double y, const double z ); bool setListenerPosition( const ALfloat x, const ALfloat y, const ALfloat z ); - + bool setListenerVelocity( const ALfloat x, const ALfloat y, const ALfloat z ); bool setListenerOrientation( const ALfloat x, const ALfloat y, const ALfloat z, @@ -71,7 +79,7 @@ int maxBuffers_; int maxSources_; int bufferUsed_; - + float listenerPosition_[ 3 ]; float listenerVelocity_[ 3 ]; float listenerOrientation_[ 6 ]; @@ -80,13 +88,15 @@ unsigned int audioSourcesInUseCount_; unsigned int * audioSources_; bool * audioSourceInUse_; - + // Audio buffers unsigned int audioBuffersInUseCount_; unsigned int * audioBuffers_; bool * audioBufferInUse_; - + std::map < std::string, unsigned int > audioBufferFileName_; }; -#endif // OPENALSOUNDMANAGER__H +} // namespace Opengate + +#endif // _OPENGATE_OPENALSOUNDMANAGER__H This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2007-05-17 19:01:53
|
Revision: 476 http://svn.sourceforge.net/opengate/?rev=476&view=rev Author: egore Date: 2007-05-17 12:01:55 -0700 (Thu, 17 May 2007) Log Message: ----------- [QA] few more doxygen comments Modified Paths: -------------- branches/ogsector/src/GameState.h branches/ogsector/src/GameStateManager.h branches/ogsector/src/InputManager.cpp branches/ogsector/src/InputManager.h branches/ogsector/src/networkServer.h Modified: branches/ogsector/src/GameState.h =================================================================== --- branches/ogsector/src/GameState.h 2007-05-17 18:41:36 UTC (rev 475) +++ branches/ogsector/src/GameState.h 2007-05-17 19:01:55 UTC (rev 476) @@ -18,9 +18,10 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifndef GAMESTATELISTENER__H -#define GAMESTATELISTENER__H +#ifndef _OPENGATE_GAMESTATELISTENER__H +#define _OPENGATE_GAMESTATELISTENER__H +// Necessary hack for CEGUI #include <OgreNoMemoryMacros.h> #include <CEGUI/CEGUIImageset.h> #include <CEGUI/CEGUISystem.h> @@ -44,6 +45,12 @@ class NetworkClient; class GameState; +/*! + * \brief This is a storage to handle current status of several things + * + * \todo Describe what it is used for, I don't really get it. + * \author Carsten <spo...@us...> + */ typedef struct { Ogre::Root * ogreRoot; Ogre::RenderWindow * renderWindow; @@ -53,8 +60,14 @@ NetworkClient * network; } DeviceInfo; +/*! + * \brief This abstract class defines the listener attached to a gamestate + * + * \author Carsten <spo...@us...> + */ class GameStateListener { public: + /*! Constructor */ GameStateListener( ){ }; @@ -64,7 +77,7 @@ /*! Store a game state to manage. */ virtual void manageGameState( const std::string & stateName, GameState * state ) = 0; - /*! Find a game state by name. @Remarks returns 0 on failure. */ + /*! Find a game state by name. \Remarks returns 0 on failure. */ virtual GameState * findByName( const std::string & stateName) = 0; /*! Request a change to state. */ @@ -196,4 +209,4 @@ } // namespace OpenGate{ -#endif // GAMESTATELISTENER__H +#endif // _OPENGATE_GAMESTATELISTENER__H Modified: branches/ogsector/src/GameStateManager.h =================================================================== --- branches/ogsector/src/GameStateManager.h 2007-05-17 18:41:36 UTC (rev 475) +++ branches/ogsector/src/GameStateManager.h 2007-05-17 19:01:55 UTC (rev 476) @@ -32,57 +32,55 @@ class InputManager; class VesselManager; -//! \class GameStateManager -/*! The GameStateManager manages changes in the game states - in the game. It holds a stack of all open game states - and maps all events. */ +/*! + * \brief The class defines the gamestate manager. + * The GameStateManager manages changes in the game states in the game. It holds + * a list of all open game states and maps all events. + * \author Carsten <spo...@us...> + */ class GameStateManager : public GameStateListener { public: - - /** Holds information about the states in order to - manage them properly and provide access. */ + + /*! \brief Holds information about the states in order to manage them properly and provide access. */ typedef struct { std::string name; GameState * state; } StateInfo; + /*! Constructor */ GameStateManager( NetworkClient & nw, bool dialog ); - /** Cleans up the states before the instance dies. */ + /*! Destructor that cleans up the states before the instance dies. */ ~GameStateManager(); - /** Store a game state to manage. */ + /*! Store a game state to manage. */ void manageGameState( const std::string & stateName, GameState * state ); - /*! Start game state. This is used to start the game state manager functioning with a particular state. - This function also does the main game loop and takes care of the Windows message pump.*/ + /*! Start game state. This is used to start the game state manager functioning with a particular state. This function also does the main game loop and takes care of the Windows message pump.*/ void start( GameState * state ); - /*! Find a game state by name. @Remarks returns 0 on failure. */ + /*! Find a game state by name. \Remarks returns 0 on failure. */ virtual GameState * findByName( const std::string & stateName); - /*! Change to a game state. This replaces the current game state with a new game state. - The current game state ends before the new begins. */ + /*! Change to a game state. This replaces the current game state with a new game state. The current game state ends before the new begins. */ void changeGameState( GameState * state ); - - /*! Push a game state onto the stack. This pauses the current game state - and begins a new game state. If the current game state refuses to - be paused, this will return false. */ + + /*! Push a game state onto the stack. This pauses the current game state and begins a new game state. If the current game state refuses to be paused, this will return false. */ bool pushGameState( GameState * state ); - - /*! Pop a game state off the stack. This destroys the current game state - and returns control to the previous game state. */ + + /*! Pop a game state off the stack. This destroys the current game state and returns control to the previous game state. */ void popGameState( ); - - /** This is a special case function to cause a shutdown. */ + + /*! This is a special case function to cause a shutdown. */ void shutdown( ); protected: - /** This initializes a state to receive the events. */ + + /*! This initializes a state to receive the events. */ void init_( GameState * state ); - /** This removes event handling from a previous state. */ + /*! This removes event handling from a previous state. */ void cleanup_( GameState * state ); bool initialiseDevices_( bool dialog ); @@ -99,11 +97,11 @@ std::vector< StateInfo > states_; DeviceInfo devices_; - /** If this is set to true, the game state manager prepares to exit. */ + /*! If this is set to true, the game state manager prepares to exit. */ bool shutdownRequest_; }; -} // namespace OpenGate +} // namespace OpenGate #endif // GAMESTATEMANAGER__H Modified: branches/ogsector/src/InputManager.cpp =================================================================== --- branches/ogsector/src/InputManager.cpp 2007-05-17 18:41:36 UTC (rev 475) +++ branches/ogsector/src/InputManager.cpp 2007-05-17 19:01:55 UTC (rev 476) @@ -289,9 +289,9 @@ return true; } -InputManager & InputManager::getSingleton( ){ - assert( ms_Singleton ); - return ( *ms_Singleton ); +InputManager & InputManager::getSingleton( ){ + assert( ms_Singleton ); + return ( *ms_Singleton ); } InputManager * InputManager::getSingletonPtr( ){ Modified: branches/ogsector/src/InputManager.h =================================================================== --- branches/ogsector/src/InputManager.h 2007-05-17 18:41:36 UTC (rev 475) +++ branches/ogsector/src/InputManager.h 2007-05-17 19:01:55 UTC (rev 476) @@ -18,8 +18,8 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifndef INPUTMANAGER_H // INPUTMANAGER_H -#define INPUTMANAGER_H +#ifndef _OPENGATE_INPUTMANAGER__H +#define _OPENGATE_INPUTMANAGER__H #ifdef WIN32 #define OIS_WIN32_PLATFORM @@ -44,22 +44,32 @@ namespace OpenGate{ +/*! + * \brief This class handles all the user input via keyboard, mouse, joystick. + * + * \author Carsten <spo...@us...> + */ class InputManager : public Ogre::Singleton< InputManager >, - public OIS::KeyListener, - public OIS::MouseListener, + public OIS::KeyListener, + public OIS::MouseListener, public OIS::JoyStickListener { public: - InputManager( ); + /*! Constructor */ + InputManager( ); + + /*! Destructor */ virtual ~InputManager(); - void init( unsigned long hWnd ); - + /*! Initialize the OIS based input system */ + void init( unsigned long hWnd ); + + /*! This tells the mouse how large a window is so that it stays inside \todo This has to be called after the window was resized */ void setWindowExtents( int width, int height ) ; - /*! Need to capture / update each device every frame. */ + /*! We need to capture/update each device every frame. */ void capture(); - + void addKeyListener( OIS::KeyListener *keyListener, const std::string& instanceName ); void addMouseListener( OIS::MouseListener *mouseListener, const std::string& instanceName ); void addJoystickListener( OIS::JoyStickListener *joystickListener, const std::string& instanceName ); @@ -77,15 +87,16 @@ void removeAllMouseListeners( void ); void removeAllJoystickListeners( void ); - // KeyListener + /*! KeyListener: key pressed event */ bool keyPressed(const OIS::KeyEvent & e); + /*! KeyListener: key released event */ bool keyReleased(const OIS::KeyEvent & e); // MouseListener bool mouseMoved(const OIS::MouseEvent & e); bool mousePressed(const OIS::MouseEvent & e, OIS::MouseButtonID); bool mouseReleased(const OIS::MouseEvent & e, OIS::MouseButtonID); - + // JoyStickListener bool axisMoved(const OIS::JoyStickEvent & e, int index ); bool buttonPressed(const OIS::JoyStickEvent & e, int index ); @@ -119,6 +130,6 @@ }; -} // namespace OpenGate{ +} // namespace OpenGate -#endif // INPUTMANAGER_H +#endif // _OPENGATE_INPUTMANAGER__H Modified: branches/ogsector/src/networkServer.h =================================================================== --- branches/ogsector/src/networkServer.h 2007-05-17 18:41:36 UTC (rev 475) +++ branches/ogsector/src/networkServer.h 2007-05-17 19:01:55 UTC (rev 476) @@ -18,8 +18,8 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifndef NETWORKSERVER__H -#define NETWORKSERVER__H +#ifndef _OPENGATE_NETWORKSERVER__H +#define _OPENGATE_NETWORKSERVER__H #include <set> #include <map> @@ -96,6 +96,6 @@ LogManager * log_; }; -} // namespace OpenGate +} // namespace OpenGate -#endif //NETWORKSERVER__H +#endif //_OPENGATE_NETWORKSERVER__H This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2007-05-19 11:20:28
|
Revision: 478 http://svn.sourceforge.net/opengate/?rev=478&view=rev Author: egore Date: 2007-05-19 04:20:29 -0700 (Sat, 19 May 2007) Log Message: ----------- Fix namespace bug I introduced yesterday Modified Paths: -------------- branches/ogsector/src/openALSoundManager.cpp branches/ogsector/src/testopenalmanager.cpp Modified: branches/ogsector/src/openALSoundManager.cpp =================================================================== --- branches/ogsector/src/openALSoundManager.cpp 2007-05-18 02:23:45 UTC (rev 477) +++ branches/ogsector/src/openALSoundManager.cpp 2007-05-19 11:20:29 UTC (rev 478) @@ -21,6 +21,8 @@ #include "openALSoundManager.h" #include <iostream> +namespace OpenGate{ + OpenALSoundManager::OpenALSoundManager( int maxBuffers, int maxSources ) : maxBuffers_( maxBuffers ), maxSources_( maxSources ){ @@ -294,3 +296,4 @@ if ( checkOpenALError( "setListenerOrientation::alListenerfv:AL_ORIENTATION" ) ) return false; } +} // namespace OpenGate Modified: branches/ogsector/src/testopenalmanager.cpp =================================================================== --- branches/ogsector/src/testopenalmanager.cpp 2007-05-18 02:23:45 UTC (rev 477) +++ branches/ogsector/src/testopenalmanager.cpp 2007-05-19 11:20:29 UTC (rev 478) @@ -25,7 +25,7 @@ std::cout << "Simple Sound Manager test application !" << std::endl; - OpenALSoundManager * soundMgr = new OpenALSoundManager( ); + OpenGate::OpenALSoundManager * soundMgr = new OpenGate::OpenALSoundManager( ); std::cout << soundMgr->listAvailableDevices() << std::endl; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2007-05-20 16:19:34
|
Revision: 489 http://svn.sourceforge.net/opengate/?rev=489&view=rev Author: egore Date: 2007-05-20 09:19:27 -0700 (Sun, 20 May 2007) Log Message: ----------- Add a few equipment parts that can be plugged into a vessel Add a generic stucture that all objects (after loading them from XML files) end in Modified Paths: -------------- branches/ogsector/src/VesselManager.h Added Paths: ----------- branches/ogsector/src/Entity.cpp branches/ogsector/src/Entity.h Added: branches/ogsector/src/Entity.cpp =================================================================== --- branches/ogsector/src/Entity.cpp (rev 0) +++ branches/ogsector/src/Entity.cpp 2007-05-20 16:19:27 UTC (rev 489) @@ -0,0 +1,22 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * eg...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "Entity.h" + Property changes on: branches/ogsector/src/Entity.cpp ___________________________________________________________________ Name: svn:mime-type + text/x-c++src Name: svn:eol-style + native Added: branches/ogsector/src/Entity.h =================================================================== --- branches/ogsector/src/Entity.h (rev 0) +++ branches/ogsector/src/Entity.h 2007-05-20 16:19:27 UTC (rev 489) @@ -0,0 +1,232 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * eg...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef _OPENGATE_ENTITY_H +#define _OPENGATE_ENTITY_H + +namespace OpenGate{ + +class Commodity; + +/*! + * \brief This class definies the basic structure of all entity templates. + * + * Opengate is able to load information about so called entities from XML files. + * These information are loaded into so called templates. These aren't "real" + * entities, but it's like a blueprint to construct an entity from. Every entity + * in Opengate is a child of this base entity template. + * \author Christoph Brill <eg...@us...> + */ +class EntityTemplate{ +public: + + inline void setFactionName( const std::string & name ) { factionName_ = name; } + inline std::string factionName( ) const { return factionName_; } + + inline void setName( const std::string & name ) { name_ = name; } + inline std::string name( ) const { return name_; } + + inline void setClassName( const std::string & name ) { className_ = name; } + inline std::string className( ) const { return className_; } + + inline void setTechLevel( int level ){ techLevel_ = level; } + inline int techLevel( ) const { return techLevel_; } + + inline void setMass( long mass ){ mass_ = mass; } + inline long mass( ) const { return mass_; } + +protected: + + EntityTemplate(): factionName_( "unknown" ), name_( "unknown" ), className_( "unknown" ) { + techLevel_ = 0; + mass_ = 0; + } + + std::string factionName_; + + std::string name_; + + std::string className_; + + int techLevel_; + /*! The mass of this entity. */ + long mass_; + +}; + +/** + * \brief This abstract class defines the basics for Eqiupment that is plugged + * into a vessel. + * + * So if you plug in an engine (which is a child class of this) you plug in an + * equipment part. It has power consumption, a size, etc. This class only + * defines whatever is common for all equipments parts (i.e. size). + * + * \author Christoph Brill <eg...@us...> + */ +class EquipmentTemplate : public EntityTemplate{ +public: + + inline void setSize( short size ){ size_ = size; } + inline short size( ) const { return size_; } + +protected: + EquipmentTemplate(): EntityTemplate() { + size_ = 0; + } + + std::string _description; + // TODO: Company* _manufacturer; + // TODO: std::vector<char*> _productioncenter; + + /*! The amount of slots necessary to plug in such a device. */ + short size_; + + std::vector<Commodity> _requierd_component[]; + +}; + +/*! + * \brief This class stores the basical information of a capactitor + * + * This class, like all other equipment classes, is filled by loading the + * information from an XML file. It defines the details for a capacitor, which + * is a component that is plugged into the ship. + * \author Christoph Brill <eg...@us...> + */ +class Capacitor : public EquipmentTemplate{ +public: + + Capacitor(): EquipmentTemplate() { + efficiency_ = 0; + capacity_ = 0; + } + + inline void setEfficiency( long efficiency ) { efficiency_ = efficiency; } + inline long efficiency( ) { return efficiency_; } + + inline void setCapacity( long capacity ) { capacity_ = capacity; } + inline long capacity( ) { return capacity_; } + +private: + /*! Stores the efficiency of a capacitor */ + long efficiency_; + /*! Stores the capacity of a capacitor */ + long capacity_; +}; + +/*! + * \brief This class stores the basical information of an ECM (Evasion and Counter Measures) + * + * This class, like all other equipment classes, is filled by loading the + * information from an XML file. It defines the details for a ECM, which + * is a component that is plugged into the ship. + * \author Christoph Brill <eg...@us...> + */ +class ECM : public EquipmentTemplate{ +public: + + ECM(): EquipmentTemplate() { + sensorLevel_ = 0; + powerConsumption_ = 0; + } + + inline void setSensorLevel( short sensorLevel ) { sensorLevel_ = sensorLevel; } + inline short sensorLevel( ) { return sensorLevel_; } + + inline void setPowerConsumption( long powerConsumption ) { powerConsumption_ = powerConsumption; } + inline long powerConsumption( ) { return powerConsumption_; } + +private: + /*! Stores the sensorlevel of this ECM */ + short sensorLevel_; + /*! Stores the power consumption of this ECM */ + long powerConsumption_; +}; + +/*! + * \brief This class stores the basical information of an engine + * + * This class, like all other equipment classes, is filled by loading the + * information from an XML file. It defines the details for an engine, which + * is a component that is plugged into the ship. + * \author Christoph Brill <eg...@us...> + */ +class Engine : public EquipmentTemplate { +public: + + Engine(): EquipmentTemplate() { + efficiency_ = 0.0; + maxThrust_ = 0; + } + + inline void setEfficiency( double efficiency ) { efficiency_ = efficiency; } + inline double efficiency( ) { return efficiency_; } + + inline void setMaxThrust( long maxThrust ) { maxThrust_ = maxThrust; } + inline long maxThrust( ) { return maxThrust_; } + +private: + /*! Stores the efficiency of this engine */ + double efficiency_; + /*! Stores the maximum thrust of this engine */ + long maxThrust_; +}; + +/*! + * \brief This class defines a commodity (goods, ore, etc. to build stuff from) + * + * This class is handled like equipment. But since it's not plugable into a + * ship it's a seperate class. This stores some information about a commodity, + * like its mass, its melting point, etc. + * \author Christoph Brill <eg...@us...> + */ +class Commodity : public EntityTemplate{ +public: + + Commodity(): EntityTemplate(), id_( "unknown" ) { + meltingPoint_ = 0; + graviticSig_ = 0.0; + } + + inline void setProductionCenters( const std::vector<std::string> & productionCenter ) { productionCenter_ = productionCenter; } + inline std::vector<std::string> productionCenters( ) const { return productionCenter_; } + + inline void setId( const std::string & id ) { id_ = id; } + inline std::string id( ) const { return id_; } + + inline void setMeltingPoint( int meltingPoint ){ meltingPoint_ = meltingPoint; } + inline int meltingPoint( ) const { return meltingPoint_; } + + inline void setGraviticSig( double graviticSig ){ graviticSig_ = graviticSig; } + inline double graviticSig( ) const { return graviticSig_; } + +protected: + std::vector<std::string> productionCenter_; + std::string id_; + + int meltingPoint_; + double graviticSig_; +}; + +} // namespace OpenGate + +#endif //_OPENGATE_ENTITY_H + Property changes on: branches/ogsector/src/Entity.h ___________________________________________________________________ Name: svn:mime-type + text/x-c++hdr Name: svn:eol-style + native Modified: branches/ogsector/src/VesselManager.h =================================================================== --- branches/ogsector/src/VesselManager.h 2007-05-20 14:56:59 UTC (rev 488) +++ branches/ogsector/src/VesselManager.h 2007-05-20 16:19:27 UTC (rev 489) @@ -28,6 +28,7 @@ #include <map> #include "LogManager.h" +#include "Entity.h" namespace OpenGate{ @@ -49,17 +50,15 @@ * vessel. * \author Carsten <spo...@us...> */ -class Vessel{ +class Vessel : public EntityTemplate{ public: /*! Constructor creating a dummy vessel */ - Vessel(): factionName_( "unknown" ), name_( "unknown" ), className_( "unknown" ){ + Vessel(): EntityTemplate(){ vesselID_ = 0; - techLevel_ = 0; vesselSize_ = 10.0; - vesselMass_ = 1.0; vesselArmor_ = 1.0; vesselYaw_ = 0; @@ -86,30 +85,15 @@ /*! Desctructor */ ~Vessel(){} - inline void setFactionName( const std::string & name ) { factionName_ = name; } - inline std::string factionName( ) const { return factionName_; } - - inline void setName( const std::string & name ) { name_ = name; } - inline std::string name( ) const { return name_; } - - inline void setClassName( const std::string & name ) { className_ = name; } - inline std::string className( ) const { return className_; } - inline void setVesselID( int id ){ vesselID_ = id; } inline int vesselID( ) const { return vesselID_; } - inline void setTechLevel( int level ){ techLevel_ = level; } - inline int techLevel( ) const { return techLevel_; } - inline void setBaseSize( float vesselSize ){ vesselSize_ = vesselSize; } inline float baseSize( ) const { return vesselSize_; } inline void setBaseYaw( float vesselYaw ){ vesselYaw_ = vesselYaw; } inline float baseYaw( ) const { return vesselYaw_; } - inline void setMass( float vesselMass ){ vesselMass_ = vesselMass; } - inline float mass( ) const { return vesselMass_; } - inline void setArmor( float vesselArmor ){ vesselArmor_ = vesselArmor; } inline float armor( ) const { return vesselArmor_; } @@ -177,14 +161,9 @@ Ogre::MeshPtr & meshPtr( ){ return pMesh_; } protected: - std::string factionName_; - std::string name_; - std::string className_; - int techLevel_; int vesselID_; float vesselSize_; - float vesselMass_; float vesselArmor_; float vesselYaw_; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2007-05-20 16:40:26
|
Revision: 490 http://svn.sourceforge.net/opengate/?rev=490&view=rev Author: egore Date: 2007-05-20 09:40:27 -0700 (Sun, 20 May 2007) Log Message: ----------- Forgot to add Entity.{cpp|h} to the build system Modified Paths: -------------- branches/ogsector/src/Entity.h branches/ogsector/src/Makefile.am Modified: branches/ogsector/src/Entity.h =================================================================== --- branches/ogsector/src/Entity.h 2007-05-20 16:19:27 UTC (rev 489) +++ branches/ogsector/src/Entity.h 2007-05-20 16:40:27 UTC (rev 490) @@ -21,6 +21,9 @@ #ifndef _OPENGATE_ENTITY_H #define _OPENGATE_ENTITY_H +#include <string> +#include <vector> + namespace OpenGate{ class Commodity; Modified: branches/ogsector/src/Makefile.am =================================================================== --- branches/ogsector/src/Makefile.am 2007-05-20 16:19:27 UTC (rev 489) +++ branches/ogsector/src/Makefile.am 2007-05-20 16:40:27 UTC (rev 490) @@ -16,12 +16,17 @@ tinyxml/tinyxmlparser.cpp \ Console.h \ Console.cpp \ + Entity.h \ + Entity.cpp \ + EntityManager.h \ + EntityManager.cpp \ LogManager.h \ LogManager.cpp \ InputManager.h \ InputManager.cpp \ VesselManager.h \ VesselManager.cpp \ + VesselTemplate.h \ GameStateManager.h \ GameStateManager.cpp \ GameState.h \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2007-05-20 19:13:42
|
Revision: 492 http://svn.sourceforge.net/opengate/?rev=492&view=rev Author: egore Date: 2007-05-20 12:13:41 -0700 (Sun, 20 May 2007) Log Message: ----------- Add an entity manager that is able to load "everything" (at a later point of development) Subclass EntityManager into the VesselManager Add an equipment manager that is currently able to load capacitors Modified Paths: -------------- branches/ogsector/src/Entity.h branches/ogsector/src/GameStateManager.cpp branches/ogsector/src/GameStateManager.h branches/ogsector/src/Makefile.in branches/ogsector/src/Sector.cpp branches/ogsector/src/VesselManager.cpp branches/ogsector/src/VesselManager.h Added Paths: ----------- branches/ogsector/src/EntityManager.cpp branches/ogsector/src/EntityManager.h branches/ogsector/src/VesselTemplate.h Modified: branches/ogsector/src/Entity.h =================================================================== --- branches/ogsector/src/Entity.h 2007-05-20 16:51:58 UTC (rev 491) +++ branches/ogsector/src/Entity.h 2007-05-20 19:13:41 UTC (rev 492) @@ -49,6 +49,9 @@ inline void setClassName( const std::string & name ) { className_ = name; } inline std::string className( ) const { return className_; } + inline void setID( int id ){ id_ = id; } + inline int id( ) const { return id_; } + inline void setTechLevel( int level ){ techLevel_ = level; } inline int techLevel( ) const { return techLevel_; } @@ -58,6 +61,7 @@ protected: EntityTemplate(): factionName_( "unknown" ), name_( "unknown" ), className_( "unknown" ) { + id_ = 0; techLevel_ = 0; mass_ = 0; } @@ -68,6 +72,8 @@ std::string className_; + int id_; + int techLevel_; /*! The mass of this entity. */ long mass_; Added: branches/ogsector/src/EntityManager.cpp =================================================================== --- branches/ogsector/src/EntityManager.cpp (rev 0) +++ branches/ogsector/src/EntityManager.cpp 2007-05-20 19:13:41 UTC (rev 492) @@ -0,0 +1,158 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * eg...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "EntityManager.h" +#include "tinyxml/tinyxml.h" + +namespace OpenGate { + +EntityManager::~EntityManager(){ + for ( std::map< int, EntityTemplate * >::iterator it = templatesByID_.begin(); it != templatesByID_.end(); it ++ ){ + delete it->second; + } + templatesByID_.end(); +} + +void EntityManager::load( const std::set < std::string > & resourcePaths, const std::string & resourceName ){ + + for ( std::set < std::string >::iterator it = resourcePaths.begin(); it != resourcePaths.end(); it ++ ){ + std::string resourceFile( (*it) + "/" + resourceName ); + + TiXmlDocument doc( resourceFile ); + bool loadOkay = doc.LoadFile(); + + std::map < int, std::string > entities; + + if ( loadOkay ) { + log_->info( std::string( "open resource file: ") + resourceFile ); + TiXmlHandle docHandle( &doc ); + TiXmlElement* pElem; + TiXmlHandle hRoot( 0 ); + + pElem = docHandle.FirstChildElement().Element(); + hRoot = TiXmlHandle( pElem ); + + if ( pElem ) { + for ( pElem = hRoot.FirstChild( "Resource" ).Element(); pElem != 0; pElem = pElem->NextSiblingElement() ) { + log_->info( std::string( "Found ressource: " ) + pElem->Attribute("location") ); + entities[ toInt( pElem->Attribute("id") ) ] = pElem->Attribute("location"); + } + } else { + log_->fatal( resourceFile + " cannot read first node." ); + } + } else { + // log_->info( resourceFile + " cannot open resourceFile." ); + } + + for ( std::map < int, std::string >::iterator it = entities.begin(); it != entities.end(); it ++ ){ + loadAndCreate( it->first, it->second ); + } + } +} + +EntityTemplate * EquipmentManager::loadAndCreate( int id, const std::string & fileName ){ + + TiXmlDocument doc( fileName ); + bool loadOkay = doc.LoadFile(); + + if ( !loadOkay ) { + log_->fatal( std::string( "Failed to load file: " + fileName ) ); + return NULL; + } + + TiXmlHandle docHandle( &doc ); + TiXmlElement* pElem; + TiXmlNode* pNode; + TiXmlHandle hRoot( 0 ); + + //** block: equipment; + pElem = docHandle.FirstChildElement().Element(); + hRoot = TiXmlHandle( pElem ); + + if ( !pElem ) { + log_->fatal( fileName + " cannot read first node." ); + return NULL; + } + + if ( strcmp( "equipment", pElem->Value() ) != 0 ){ + log_->fatal( fileName + " is no equipment description" ); + return NULL; + } + + // FIXME: we can only load capacitors by now + Capacitor *entity = new Capacitor(); + + // Naming + pElem = hRoot.ChildElement( "faction", 0 ).Element(); + if ( pElem ) { + entity->setFactionName( pElem->FirstChild()->Value() ); + } else { + log_->fatal( fileName + " has no mandatory factionname (mandatory)." ); + return NULL; + } + pElem = hRoot.ChildElement( "name", 0 ).Element(); + if ( pElem ) { + entity->setName( pElem->FirstChild()->Value() ); + } else { + log_->fatal( fileName + " has no name (mandatory)." ); + return NULL; + } + + // Generic Data + pElem = hRoot.ChildElement( "class", 0 ).Element(); + if ( pElem ) entity->setClassName( pElem->FirstChild()->Value() ); + pElem = hRoot.ChildElement( "techlevel", 0 ).Element(); + if ( pElem ) entity->setTechLevel( toInt( pElem->FirstChild()->Value() ) ); + pElem = hRoot.ChildElement( "size", 0 ).Element(); + if ( pElem ) entity->setSize( toInt( pElem->FirstChild()->Value() ) ); + pElem = hRoot.ChildElement( "mass", 0 ).Element(); + if ( pElem ) entity->setMass( toInt( pElem->FirstChild()->Value() ) ); + + // Specific Data + pElem = hRoot.ChildElement( "efficiency", 0 ).Element(); + if ( pElem ) entity->setEfficiency( toInt( pElem->FirstChild()->Value() ) ); + pElem = hRoot.ChildElement( "capacity", 0 ).Element(); + if ( pElem ) entity->setCapacity( toInt( pElem->FirstChild()->Value() ) ); + + if ( templatesByName_.count( entity->name() ) == 0 ){ + entity->setID( id ); + templatesByName_[ entity->name() ] = entity; + templatesByID_[ id ] = entity; + + factions_.insert( entity->factionName() ); + log_->info( std::string( "Loaded: " ) + entity->factionName() + "/" + entity->name() ); + } else { + log_->warn( std::string( "Equipment with name: " ) + entity->factionName() + "/" + entity->name() + + " allready loaded" ); + } + return entity; +} + +template<> EquipmentManager * Ogre::Singleton< EquipmentManager >::ms_Singleton = 0; + +EquipmentManager::EquipmentManager(): EntityManager(){ +} + +EquipmentManager::~EquipmentManager() { +} + +} + + Property changes on: branches/ogsector/src/EntityManager.cpp ___________________________________________________________________ Name: svn:mime-type + text/x-c++src Name: svn:eol-style + native Added: branches/ogsector/src/EntityManager.h =================================================================== --- branches/ogsector/src/EntityManager.h (rev 0) +++ branches/ogsector/src/EntityManager.h 2007-05-20 19:13:41 UTC (rev 492) @@ -0,0 +1,98 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * eg...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef _OPENGATE_ENTITYMANAGER_H +#define _OPENGATE_ENTITYMANAGER_H + +#include "LogManager.h" +#include "Entity.h" + +namespace OpenGate { + +/*! + * \brief This class is the generic class that all extend that like to load + * something from an XML file. + * \author Christoph Brill <eg...@us...> + */ +class EntityManager{ +public: + /*! \brief This method loads equipment and stores it in an interal storage. + * + * The file we load from does not contain the definitions itself, but the + * places where we find the definition files. The loading from the definition + * files is done by loadAndCreate(). + * \param resourcePaths An array of all available resource paths + * \param resourceName The name of the file to load the equipment from */ + void load( const std::set < std::string > & resourcePaths, const std::string & resourceName ); + + inline std::set < std::string > factionNames( ) const { return factions_; } + +protected: + + /*! \brief This loads enities from there definition files, called from load() + * \param id The id of the entity in the places-file + * \param filename The filename we load from the places-file. It's the + * filename of the defintion file. + */ + virtual EntityTemplate * loadAndCreate( int id, const std::string & filename ) = 0; + + EntityManager() { + log_ = LogManager::getSingletonPtr(); + } + + virtual ~EntityManager(); + + LogManager *log_; + + std::map < std::string, EntityTemplate * > templatesByName_; + + std::map < int, EntityTemplate * > templatesByID_; + + std::set < std::string > factions_; +}; + +/*! + * \brief This class is able to load equipment (reactors, engines, guns, etc.) + * from XML files. + * \author Christoph Brill <eg...@us...> + */ +class EquipmentManager : public Ogre::Singleton< EquipmentManager >, public EntityManager{ +public: + + /*! Get the single instance of the EquipmentManager */ + static EquipmentManager & getSingleton( ); + + /*! Get the pointer to single instance of the EquipmentManager */ + static EquipmentManager * getSingletonPtr( ); + + /*! Constructor */ + EquipmentManager(); + + /*! Destructor that free's all loaded vessels */ + virtual ~EquipmentManager(); + + virtual EntityTemplate * loadAndCreate( int id, const std::string & filename ); + +}; + +} // namespace OpenGate + +#endif //_OPENGATE_ENTITYMANAGER_H + Property changes on: branches/ogsector/src/EntityManager.h ___________________________________________________________________ Name: svn:mime-type + text/x-c++hdr Name: svn:eol-style + native Modified: branches/ogsector/src/GameStateManager.cpp =================================================================== --- branches/ogsector/src/GameStateManager.cpp 2007-05-20 16:51:58 UTC (rev 491) +++ branches/ogsector/src/GameStateManager.cpp 2007-05-20 19:13:41 UTC (rev 492) @@ -29,6 +29,7 @@ #include "InputManager.h" #include "VesselManager.h" #include "UnDockedState.h" +#include "EntityManager.h" #include <OgreFrameListener.h> namespace OpenGate { @@ -292,8 +293,11 @@ devices_.console->addCommand( "/ai", &GameStateManager::CMD_spawnAi, "[name] Spawn ai subject. /ai help show all available ships." ); vesselManager_ = new VesselManager( ); - vesselManager_->loadVessels( resourcePaths_, "ships.xml" ); + vesselManager_->load( resourcePaths_, "ships.xml" ); + equipmentManager_ = new EquipmentManager( ); + equipmentManager_->load( resourcePaths_, "equipment.xml" ); + devices_.gameStateRoot = this; return true; Modified: branches/ogsector/src/GameStateManager.h =================================================================== --- branches/ogsector/src/GameStateManager.h 2007-05-20 16:51:58 UTC (rev 491) +++ branches/ogsector/src/GameStateManager.h 2007-05-20 19:13:41 UTC (rev 492) @@ -31,6 +31,7 @@ class LogManager; class InputManager; class VesselManager; +class EquipmentManager; /*! * \brief The class defines the gamestate manager. @@ -99,6 +100,7 @@ LogManager * log_; VesselManager * vesselManager_; + EquipmentManager * equipmentManager_; std::set < std::string > resourcePaths_; std::vector< GameState * > stateStack_; Modified: branches/ogsector/src/Makefile.in =================================================================== --- branches/ogsector/src/Makefile.in 2007-05-20 16:51:58 UTC (rev 491) +++ branches/ogsector/src/Makefile.in 2007-05-20 19:13:41 UTC (rev 492) @@ -51,7 +51,8 @@ am_opengateclient_OBJECTS = opengateclient.$(OBJEXT) common.$(OBJEXT) \ networkClient.$(OBJEXT) tinyxml.$(OBJEXT) \ tinyxmlerror.$(OBJEXT) tinyxmlparser.$(OBJEXT) \ - Console.$(OBJEXT) LogManager.$(OBJEXT) InputManager.$(OBJEXT) \ + Console.$(OBJEXT) Entity.$(OBJEXT) EntityManager.$(OBJEXT) \ + LogManager.$(OBJEXT) InputManager.$(OBJEXT) \ VesselManager.$(OBJEXT) GameStateManager.$(OBJEXT) \ GameState.$(OBJEXT) DockedState.$(OBJEXT) \ ShipConfigDialog.$(OBJEXT) UnDockedState.$(OBJEXT) \ @@ -191,12 +192,17 @@ tinyxml/tinyxmlparser.cpp \ Console.h \ Console.cpp \ + Entity.h \ + Entity.cpp \ + EntityManager.h \ + EntityManager.cpp \ LogManager.h \ LogManager.cpp \ InputManager.h \ InputManager.cpp \ VesselManager.h \ VesselManager.cpp \ + VesselTemplate.h \ GameStateManager.h \ GameStateManager.cpp \ GameState.h \ @@ -306,6 +312,8 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Console.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DockedState.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Entity.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/EntityManager.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GameState.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GameStateManager.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/InputManager.Po@am__quote@ Modified: branches/ogsector/src/Sector.cpp =================================================================== --- branches/ogsector/src/Sector.cpp 2007-05-20 16:51:58 UTC (rev 491) +++ branches/ogsector/src/Sector.cpp 2007-05-20 19:13:41 UTC (rev 492) @@ -616,7 +616,7 @@ if ( obj ) { log_->info( std::string( "Send register " ) + obj->name() ); MessageBodyShipRegister msg( obj->userID(), obj->childID(), obj->name(), obj->mainNode()->getPosition(), - obj->vesselBluePrint()->vesselID() ); + obj->vesselBluePrint()->id() ); network_->send( msg ); } Modified: branches/ogsector/src/VesselManager.cpp =================================================================== --- branches/ogsector/src/VesselManager.cpp 2007-05-20 16:51:58 UTC (rev 491) +++ branches/ogsector/src/VesselManager.cpp 2007-05-20 19:13:41 UTC (rev 492) @@ -27,179 +27,132 @@ template<> VesselManager * Ogre::Singleton< VesselManager >::ms_Singleton = 0; -VesselManager::VesselManager(){ - log_ = LogManager::getSingletonPtr(); +VesselManager::VesselManager(): EntityManager(){ } VesselManager::~VesselManager(){ - for ( std::map< int, Vessel * >::iterator it = vesselID_.begin(); it != vesselID_.end(); it ++ ){ - delete it->second; - } - vesselID_.end(); } -void VesselManager::loadVessels( const std::set < std::string > & resourcePaths, const std::string & resourceName ){ +EntityTemplate * VesselManager::loadAndCreate( int vesselID, const std::string & fileName ){ - for ( std::set < std::string >::iterator it = resourcePaths.begin(); it != resourcePaths.end(); it ++ ){ - std::string shipResourceFile( (*it) + "/" + resourceName ); - - TiXmlDocument doc( shipResourceFile ); - bool loadOkay = doc.LoadFile(); - - std::map < int, std::string > ships; - - if ( loadOkay ) { - log_->info( std::string( "open resource file for ships: ") + shipResourceFile ); - TiXmlHandle docHandle( &doc ); - TiXmlElement* pElem; - TiXmlHandle hRoot( 0 ); - - //** block: Ships; - pElem = docHandle.FirstChildElement().Element(); - hRoot = TiXmlHandle( pElem ); - - if ( pElem ) { - for ( pElem = hRoot.FirstChild( "Resource" ).Element(); pElem != 0; pElem = pElem->NextSiblingElement() ) { - log_->info( std::string( "Found ressource: " ) + pElem->Attribute("location") ); - ships[ toInt( pElem->Attribute("id") ) ] = pElem->Attribute("location"); - } - } else { - log_->fatal( shipResourceFile + " cannot read first node." ); - } - } else { - // log_->info( shipResourceFile + " cannot open shipResourceFile." ); - } - - for ( std::map < int, std::string >::iterator it = ships.begin(); it != ships.end(); it ++ ){ - loadAndCreateVessel( it->first, it->second ); - } - } -} - -Vessel * VesselManager::loadAndCreateVessel( int vesselID, const std::string & fileName ){ - TiXmlDocument doc( fileName ); bool loadOkay = doc.LoadFile(); - if ( loadOkay ) { + if ( !loadOkay ) { + log_->fatal( std::string( "Failed to load file: " + fileName ) ); + return NULL; + } - TiXmlHandle docHandle( &doc ); - TiXmlElement* pElem; - TiXmlNode* pNode; - TiXmlHandle hRoot( 0 ); + TiXmlHandle docHandle( &doc ); + TiXmlElement* pElem; + TiXmlNode* pNode; + TiXmlHandle hRoot( 0 ); - //** block: Ship; - pElem = docHandle.FirstChildElement().Element(); - hRoot = TiXmlHandle( pElem ); + //** block: Ship; + pElem = docHandle.FirstChildElement().Element(); + hRoot = TiXmlHandle( pElem ); - if ( !pElem ) { - log_->fatal( fileName + " cannot read first node." ); - return NULL; - } + if ( !pElem ) { + log_->fatal( fileName + " cannot read first node." ); + return NULL; + } - if ( strcmp( "ship", pElem->Value() ) == 0 ){ + if ( strcmp( "ship", pElem->Value() ) != 0 ){ + log_->fatal( fileName + " is no ship description" ); + return NULL; + } - Vessel *vessel = new Vessel(); + Vessel *vessel = new Vessel(); - pElem = hRoot.ChildElement( "faction", 0 ).Element(); - if ( pElem ) { - vessel->setFactionName( pElem->FirstChild()->Value() ); + pElem = hRoot.ChildElement( "faction", 0 ).Element(); + if ( pElem ) { + vessel->setFactionName( pElem->FirstChild()->Value() ); } else { - log_->fatal( fileName + " has no mandatory factionname (mandatory)." ); - return NULL; + log_->fatal( fileName + " has no mandatory factionname (mandatory)." ); + return NULL; } - pElem = hRoot.ChildElement( "name", 0 ).Element(); - if ( pElem ) { - vessel->setName( pElem->FirstChild()->Value() ); - } else { - log_->fatal( fileName + " has no name (mandatory)." ); - return NULL; - } + pElem = hRoot.ChildElement( "name", 0 ).Element(); + if ( pElem ) { + vessel->setName( pElem->FirstChild()->Value() ); + } else { + log_->fatal( fileName + " has no name (mandatory)." ); + return NULL; + } - pElem = hRoot.ChildElement( "class", 0 ).Element(); - if ( pElem ) vessel->setClassName( pElem->FirstChild()->Value() ); + pElem = hRoot.ChildElement( "class", 0 ).Element(); + if ( pElem ) vessel->setClassName( pElem->FirstChild()->Value() ); - pElem = hRoot.ChildElement( "techlevel", 0 ).Element(); - if ( pElem ) vessel->setTechLevel( toInt( pElem->FirstChild()->Value() ) ); + pElem = hRoot.ChildElement( "techlevel", 0 ).Element(); + if ( pElem ) vessel->setTechLevel( toInt( pElem->FirstChild()->Value() ) ); - pElem = hRoot.ChildElement( "size", 0 ).Element(); - if ( pElem ) vessel->setBaseSize( toInt( pElem->FirstChild()->Value() ) ); - pElem = hRoot.ChildElement( "baseyaw", 0 ).Element(); - if ( pElem ) vessel->setBaseYaw( toFloat( pElem->FirstChild()->Value() ) ); - pElem = hRoot.ChildElement( "mass", 0 ).Element(); - if ( pElem ) vessel->setMass( toInt( pElem->FirstChild()->Value() ) ); - pElem = hRoot.ChildElement( "armor", 0 ).Element(); - if ( pElem ) vessel->setArmor( toInt( pElem->FirstChild()->Value() ) ); + pElem = hRoot.ChildElement( "size", 0 ).Element(); + if ( pElem ) vessel->setBaseSize( toInt( pElem->FirstChild()->Value() ) ); + pElem = hRoot.ChildElement( "baseyaw", 0 ).Element(); + if ( pElem ) vessel->setBaseYaw( toFloat( pElem->FirstChild()->Value() ) ); + pElem = hRoot.ChildElement( "mass", 0 ).Element(); + if ( pElem ) vessel->setMass( toInt( pElem->FirstChild()->Value() ) ); + pElem = hRoot.ChildElement( "armor", 0 ).Element(); + if ( pElem ) vessel->setArmor( toInt( pElem->FirstChild()->Value() ) ); - pElem = hRoot.ChildElement( "yaw", 0 ).Element(); - if ( pElem ) vessel->setYaw( toFloat( pElem->FirstChild()->Value() ) ); - pElem = hRoot.ChildElement( "pitch", 0 ).Element(); - if ( pElem ) vessel->setPitch( toFloat( pElem->FirstChild()->Value() ) ); - pElem = hRoot.ChildElement( "roll", 0 ).Element(); - if ( pElem ) vessel->setRoll( toFloat( pElem->FirstChild()->Value() ) ); - pElem = hRoot.ChildElement( "dragfactor", 0 ).Element(); - if ( pElem ) vessel->setDragFactor( toFloat( pElem->FirstChild()->Value() ) ); + pElem = hRoot.ChildElement( "yaw", 0 ).Element(); + if ( pElem ) vessel->setYaw( toFloat( pElem->FirstChild()->Value() ) ); + pElem = hRoot.ChildElement( "pitch", 0 ).Element(); + if ( pElem ) vessel->setPitch( toFloat( pElem->FirstChild()->Value() ) ); + pElem = hRoot.ChildElement( "roll", 0 ).Element(); + if ( pElem ) vessel->setRoll( toFloat( pElem->FirstChild()->Value() ) ); + pElem = hRoot.ChildElement( "dragfactor", 0 ).Element(); + if ( pElem ) vessel->setDragFactor( toFloat( pElem->FirstChild()->Value() ) ); - pElem = hRoot.ChildElement( "guns", 0 ).Element(); - if ( pElem ) vessel->setAmountGunHardPoints( toInt( pElem->FirstChild()->Value() ) ); - pElem = hRoot.ChildElement( "engines", 0 ).Element(); - if ( pElem ) vessel->setAmountEngines( toInt( pElem->FirstChild()->Value() ) ); - pElem = hRoot.ChildElement( "modx", 0 ).Element(); - if ( pElem ) vessel->setAmountModX( toInt( pElem->FirstChild()->Value() ) ); - pElem = hRoot.ChildElement( "missiles", 0 ).Element(); - if ( pElem ) vessel->setAmountMissiles( toInt( pElem->FirstChild()->Value() ) ); + pElem = hRoot.ChildElement( "guns", 0 ).Element(); + if ( pElem ) vessel->setAmountGunHardPoints( toInt( pElem->FirstChild()->Value() ) ); + pElem = hRoot.ChildElement( "engines", 0 ).Element(); + if ( pElem ) vessel->setAmountEngines( toInt( pElem->FirstChild()->Value() ) ); + pElem = hRoot.ChildElement( "modx", 0 ).Element(); + if ( pElem ) vessel->setAmountModX( toInt( pElem->FirstChild()->Value() ) ); + pElem = hRoot.ChildElement( "missiles", 0 ).Element(); + if ( pElem ) vessel->setAmountMissiles( toInt( pElem->FirstChild()->Value() ) ); - pElem = hRoot.ChildElement( "cargocapacity", 0 ).Element(); - if ( pElem ) vessel->setCargoSize( toInt( pElem->FirstChild()->Value() ) ); + pElem = hRoot.ChildElement( "cargocapacity", 0 ).Element(); + if ( pElem ) vessel->setCargoSize( toInt( pElem->FirstChild()->Value() ) ); - pElem = hRoot.ChildElement( "capacitorsize", 0 ).Element(); - if ( pElem ) vessel->setCapacitorSize( toInt( pElem->FirstChild()->Value() ) ); - pElem = hRoot.ChildElement( "powerplantsize", 0 ).Element(); - if ( pElem ) vessel->setPowerPlantSize( toInt( pElem->FirstChild()->Value() ) ); - pElem = hRoot.ChildElement( "enginesize", 0 ).Element(); - if ( pElem ) vessel->setEngineSize( toInt( pElem->FirstChild()->Value() ) ); - pElem = hRoot.ChildElement( "radarsize", 0 ).Element(); - if ( pElem ) vessel->setRadarSize( toInt( pElem->FirstChild()->Value() ) ); - pElem = hRoot.ChildElement( "shieldsize", 0 ).Element(); - if ( pElem ) vessel->setShieldSize( toInt( pElem->FirstChild()->Value() ) ); - pElem = hRoot.ChildElement( "ecmsize", 0 ).Element(); - if ( pElem ) vessel->setEcmSize( toInt( pElem->FirstChild()->Value() ) ); + pElem = hRoot.ChildElement( "capacitorsize", 0 ).Element(); + if ( pElem ) vessel->setCapacitorSize( toInt( pElem->FirstChild()->Value() ) ); + pElem = hRoot.ChildElement( "powerplantsize", 0 ).Element(); + if ( pElem ) vessel->setPowerPlantSize( toInt( pElem->FirstChild()->Value() ) ); + pElem = hRoot.ChildElement( "enginesize", 0 ).Element(); + if ( pElem ) vessel->setEngineSize( toInt( pElem->FirstChild()->Value() ) ); + pElem = hRoot.ChildElement( "radarsize", 0 ).Element(); + if ( pElem ) vessel->setRadarSize( toInt( pElem->FirstChild()->Value() ) ); + pElem = hRoot.ChildElement( "shieldsize", 0 ).Element(); + if ( pElem ) vessel->setShieldSize( toInt( pElem->FirstChild()->Value() ) ); + pElem = hRoot.ChildElement( "ecmsize", 0 ).Element(); + if ( pElem ) vessel->setEcmSize( toInt( pElem->FirstChild()->Value() ) ); - pElem = hRoot.ChildElement( "mesh", 0 ).Element(); - if ( pElem ) { - std::string meshName( pElem->FirstChild()->Value() ); - if ( meshName.find( "/", 0 ) != std::string::npos ){ - vessel->setMesh( meshName, false ); - } else { - vessel->setMesh( meshName, true ); - } - } else { - log_->fatal( fileName + " has no mesh entry" ); - return NULL; - } - - if ( vessels_.count( vessel->name() ) == 0 ){ - vessel->setVesselID( vesselID ); - vessels_[ vessel->name() ] = vessel; - vesselID_[ vesselID ] = vessel; - - factions_.insert( vessel->factionName() ); - log_->info( std::string( "Loaded: " ) + vessel->factionName() + "/" + vessel->name() ); - } else { - log_->warn( std::string( "Ship with name: " ) + vessel->factionName() + "/" + vessel->name() + - " allready loaded" ); - } - - return vessel; + pElem = hRoot.ChildElement( "mesh", 0 ).Element(); + if ( pElem ) { + std::string meshName( pElem->FirstChild()->Value() ); + if ( meshName.find( "/", 0 ) != std::string::npos ){ + vessel->setMesh( meshName, false ); } else { - log_->fatal( fileName + " is no ship description" ); - return NULL; + vessel->setMesh( meshName, true ); } } else { - log_->fatal( std::string( "Failed to load file: " + fileName ) ); + log_->fatal( fileName + " has no mesh entry" ); return NULL; } - return NULL; + + if ( templatesByName_.count( vessel->name() ) == 0 ){ + vessel->setID( vesselID ); + templatesByName_[ vessel->name() ] = vessel; + templatesByID_[ vesselID ] = vessel; + + factions_.insert( vessel->factionName() ); + log_->info( std::string( "Loaded: " ) + vessel->factionName() + "/" + vessel->name() ); + } else { + log_->warn( std::string( "Ship with name: " ) + vessel->factionName() + "/" + vessel->name() + + " allready loaded" ); + } + return vessel; } VesselManager & VesselManager::getSingleton( ){ Modified: branches/ogsector/src/VesselManager.h =================================================================== --- branches/ogsector/src/VesselManager.h 2007-05-20 16:51:58 UTC (rev 491) +++ branches/ogsector/src/VesselManager.h 2007-05-20 19:13:41 UTC (rev 492) @@ -22,174 +22,15 @@ #define VESSELMANAGER__H #include <OgreSingleton.h> -#include <OgreMesh.h> -#include <OgreMeshManager.h> -#include <iostream> -#include <map> #include "LogManager.h" #include "Entity.h" +#include "VesselTemplate.h" +#include "EntityManager.h" namespace OpenGate{ /*! - * \brief This class defines a vessel. - * - * A vessel in opengate is that thing, that the user needs to fly around in - * space. Others might call it "starship", "spaceshit" or something like that. - * A vessel has several properties. It has a weight, a yaw-. a roll- and a - * pitch-latency. It also has a drag factor and many properties more. Each - * vessel must have these options. The data of a vessel is loaded from an XML - * document. This is more or less a logical storage for the vessel, not more and - * not less. - * \todo Check how to load the XML data into a vessel. My first approach was that - * a vessel was passed the name of the XML document and it load everything - * from that file. The better approach would be to create something like - * an XMLManager, that is able to load a vessel by it's name. - * \todo See how to attach objects (capacitory, power plants, weapons) to the - * vessel. - * \author Carsten <spo...@us...> - */ -class Vessel : public EntityTemplate{ -public: - - /*! Constructor creating a dummy vessel */ - Vessel(): EntityTemplate(){ - - vesselID_ = 0; - - vesselSize_ = 10.0; - vesselArmor_ = 1.0; - vesselYaw_ = 0; - - yaw_ = 1.0; - pitch_ = 1.0; - roll_ = 1.0; - dragFactor_ = 1.0; - - amountGunHardPoints_ = 0; - amountEngines_ = 0; - amountModX_ = 0; - amountMissiles_ = 0; - - shieldSize_ = 0; - radarSize_ = 0; - engineSize_ = 0; - capacitorSize_ = 0; - powerPlantSize_ = 0; - cargoSize_ = 0; - ecmSize_ = 0; - - } - - /*! Desctructor */ - ~Vessel(){} - - inline void setVesselID( int id ){ vesselID_ = id; } - inline int vesselID( ) const { return vesselID_; } - - inline void setBaseSize( float vesselSize ){ vesselSize_ = vesselSize; } - inline float baseSize( ) const { return vesselSize_; } - - inline void setBaseYaw( float vesselYaw ){ vesselYaw_ = vesselYaw; } - inline float baseYaw( ) const { return vesselYaw_; } - - inline void setArmor( float vesselArmor ){ vesselArmor_ = vesselArmor; } - inline float armor( ) const { return vesselArmor_; } - - inline void setYaw( float yaw ){ - yaw_ = yaw; if ( yaw_ < 1.0 ) yaw_ = 1000.0 * ( 180.0 * yaw_ ) / 3.141592 ; - } - inline float yaw( ) const { return yaw_; } - - inline void setPitch( float pitch ){ - pitch_ = pitch; if ( pitch_ < 1.0 ) pitch_ = 1000.0 * ( 180.0 * pitch_ ) / 3.141592 ; - } - inline float pitch( ) const { return pitch_; } - - inline void setRoll( float roll ){ - roll_ = roll; if ( roll_ < 1.0 ) roll_ = 1000.0 * ( 180.0 * roll_ ) / 3.141592 ; - } - inline float roll( ) const { return roll_; } - - inline void setDragFactor( float drag ){ dragFactor_ = drag; } - inline float dragFactor( ) const { return dragFactor_; } - - inline void setAmountGunHardPoints( int amount ){ amountGunHardPoints_ = amount; } - inline int amountGunHardPoints( ) const { return amountGunHardPoints_; } - - inline void setAmountEngines( int amount ){ amountEngines_ = amount; } - inline int amountEngines( ) const { return amountEngines_; } - - inline void setAmountModX( int amount ){ amountModX_ = amount; } - inline int amountModX( ) const { return amountModX_; } - - inline void setAmountMissiles( int amount ){ amountMissiles_ = amount; } - inline int amountMissiles( ) const { return amountMissiles_; } - - inline void setShieldSize( int size ){ shieldSize_ = size; } - inline int shieldSize( ) const { return shieldSize_; } - - inline void setRadarSize( int size ){ radarSize_ = size; } - inline int radarSize( ) const { return radarSize_; } - - inline void setEngineSize( int size ){ engineSize_ = size; } - inline int engineSize( ) const { return engineSize_; } - - inline void setCapacitorSize( int size ){ capacitorSize_ = size; } - inline int capacitorSize( ) const { return capacitorSize_; } - - inline void setPowerPlantSize( int size ){ powerPlantSize_ = size; } - inline int powerPlantSize( ) const { return powerPlantSize_; } - - inline void setCargoSize( int size ){ cargoSize_ = size; } - inline int cargoSize( ) const { return cargoSize_; } - - inline void setEcmSize( int size ){ ecmSize_ = size; } - inline int ecmSize( ) const { return ecmSize_; } - - void setMesh( const std::string & meshName, bool genPath = true ){ - std::string fileName; - if ( genPath ){ - fileName = std::string("ships") + PATHSEPARATOR + factionName_ + PATHSEPARATOR + name_ + PATHSEPARATOR + meshName; - } else { - fileName = meshName; - } - pMesh_ = Ogre::MeshManager::getSingleton().load( fileName, "General" ); - // pMesh_ = Ogre::MeshManager::getSingleton().load( meshName, "../../trunk/data/ships/octavius/apteryx/" ); - } - Ogre::MeshPtr & meshPtr( ){ return pMesh_; } - -protected: - int vesselID_; - - float vesselSize_; - float vesselArmor_; - float vesselYaw_; - - float yaw_; - float pitch_; - float roll_; - float dragFactor_; - - int amountEngines_; - int amountGunHardPoints_; - int amountModX_; - int amountMissiles_; - - int cargoSize_; - - int capacitorSize_; - int powerPlantSize_; - int shieldSize_; - int radarSize_; - int engineSize_; - int ecmSize_; - - Ogre::MeshPtr pMesh_; -}; - -/*! * \brief This singleton class is able to load a vessel by it's name * * The vessel manager is a class to handle access to all vessels. This way a @@ -203,7 +44,7 @@ * similar. * \author Carsten <spo...@us...> */ -class VesselManager : public Ogre::Singleton< VesselManager >{ +class VesselManager : public Ogre::Singleton< VesselManager >, public EntityManager{ public: /*! Get the single instance of the VesselManager */ @@ -216,29 +57,24 @@ VesselManager(); /*! Destructor that free's all loaded vessels */ - ~VesselManager(); + virtual ~VesselManager(); - /*! This method loads vessels and stores them in an interal storage - * \param resourcePaths An array of all available resource paths - * \param resourceName The name of the file to load the vessels from */ - void loadVessels( const std::set < std::string > & resourcePaths, const std::string & resourceName ); + virtual EntityTemplate * loadAndCreate( int id, const std::string & filename ); - Vessel * loadAndCreateVessel( int vesselID, const std::string & filename ); - /*! This returns a vessel by it's given unique ID \remarks The vessel needs to be loaded before \param vesselID The unique ID of a vessel */ Vessel * vessel( int vesselID ){ - if ( vesselID_.count( vesselID ) ){ - return vesselID_[ vesselID ]; + if ( templatesByID_.count( vesselID ) ){ + return static_cast<Vessel *>(templatesByID_[ vesselID ]); } else { log_->fatal( std::string( "Requested vessel information for ID: " ) + toStr( vesselID ) + ( "unknown" ) ); return NULL; } } - /*! This returns a vessel by it's given name \remarks The vessel needs to be loaded before \param vesselID The name of a vessel */ + /*! This returns a vessel by it's given name \remarks The vessel needs to be loaded before \param vesselName The name of a vessel */ Vessel * vessel( const std::string & vesselName ){ - if ( vessels_.count( vesselName ) ){ - return vessels_[ vesselName ]; + if ( templatesByName_.count( vesselName ) ){ + return static_cast<Vessel *>(templatesByName_[ vesselName ]); } else { log_->fatal( std::string( "Unknown vessel with name :" ) + vesselName ); return NULL; @@ -249,21 +85,14 @@ std::set < Vessel * > factionVessels( const std::string & factionName ){ std::set < Vessel * > vessels; - for ( std::map < std::string, Vessel * >::iterator it = vessels_.begin(); it != vessels_.end(); it ++ ){ - if ( it->second->factionName() == factionName || factionName == "All" ){ - vessels.insert( it->second ); + for ( std::map < std::string, EntityTemplate * >::iterator it = templatesByName_.begin(); it != templatesByName_.end(); it ++ ){ + if ( static_cast<Vessel *>(it->second)->factionName() == factionName || factionName == "All" ){ + vessels.insert( static_cast<Vessel *>(it->second) ); } } return vessels; } - inline std::set < std::string > factionNames( ) const { return factions_; } - -protected: - LogManager *log_; - std::map < std::string, Vessel * > vessels_; - std::map < int, Vessel * > vesselID_; - std::set < std::string > factions_; }; } //namespace OpenGate{ Added: branches/ogsector/src/VesselTemplate.h =================================================================== --- branches/ogsector/src/VesselTemplate.h (rev 0) +++ branches/ogsector/src/VesselTemplate.h 2007-05-20 19:13:41 UTC (rev 492) @@ -0,0 +1,184 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef _OPENGATE_VESSEL__H +#define _OPENGATE_VESSEL__H + +#include "OgreMesh.h" +#include "OgreMeshManager.h" + +#include "Entity.h" + +namespace OpenGate{ + +/*! + * \brief This class defines a vessel. + * + * A vessel in opengate is that thing, that the user needs to fly around in + * space. Others might call it "starship", "spaceshit" or something like that. + * A vessel has several properties. It has a weight, a yaw-. a roll- and a + * pitch-latency. It also has a drag factor and many properties more. Each + * vessel must have these options. The data of a vessel is loaded from an XML + * document. This is more or less a logical storage for the vessel, not more and + * not less. + * \todo Check how to load the XML data into a vessel. My first approach was that + * a vessel was passed the name of the XML document and it load everything + * from that file. The better approach would be to create something like + * an XMLManager, that is able to load a vessel by it's name. + * \todo See how to attach objects (capacitory, power plants, weapons) to the + * vessel. + * \author Carsten <spo...@us...> + */ +class Vessel : public EntityTemplate{ +public: + + /*! Constructor creating a dummy vessel */ + Vessel(): EntityTemplate(){ + + vesselSize_ = 10.0; + vesselArmor_ = 1.0; + vesselYaw_ = 0; + + yaw_ = 1.0; + pitch_ = 1.0; + roll_ = 1.0; + dragFactor_ = 1.0; + + amountGunHardPoints_ = 0; + amountEngines_ = 0; + amountModX_ = 0; + amountMissiles_ = 0; + + shieldSize_ = 0; + radarSize_ = 0; + engineSize_ = 0; + capacitorSize_ = 0; + powerPlantSize_ = 0; + cargoSize_ = 0; + ecmSize_ = 0; + + } + + /*! Desctructor */ + ~Vessel(){} + + inline void setBaseSize( float vesselSize ){ vesselSize_ = vesselSize; } + inline float baseSize( ) const { return vesselSize_; } + + inline void setBaseYaw( float vesselYaw ){ vesselYaw_ = vesselYaw; } + inline float baseYaw( ) const { return vesselYaw_; } + + inline void setArmor( float vesselArmor ){ vesselArmor_ = vesselArmor; } + inline float armor( ) const { return vesselArmor_; } + + inline void setYaw( float yaw ){ + yaw_ = yaw; if ( yaw_ < 1.0 ) yaw_ = 1000.0 * ( 180.0 * yaw_ ) / 3.141592 ; + } + inline float yaw( ) const { return yaw_; } + + inline void setPitch( float pitch ){ + pitch_ = pitch; if ( pitch_ < 1.0 ) pitch_ = 1000.0 * ( 180.0 * pitch_ ) / 3.141592 ; + } + inline float pitch( ) const { return pitch_; } + + inline void setRoll( float roll ){ + roll_ = roll; if ( roll_ < 1.0 ) roll_ = 1000.0 * ( 180.0 * roll_ ) / 3.141592 ; + } + inline float roll( ) const { return roll_; } + + inline void setDragFactor( float drag ){ dragFactor_ = drag; } + inline float dragFactor( ) const { return dragFactor_; } + + inline void setAmountGunHardPoints( int amount ){ amountGunHardPoints_ = amount; } + inline int amountGunHardPoints( ) const { return amountGunHardPoints_; } + + inline void setAmountEngines( int amount ){ amountEngines_ = amount; } + inline int amountEngines( ) const { return amountEngines_; } + + inline void setAmountModX( int amount ){ amountModX_ = amount; } + inline int amountModX( ) const { return amountModX_; } + + inline void setAmountMissiles( int amount ){ amountMissiles_ = amount; } + inline int amountMissiles( ) const { return amountMissiles_; } + + inline void setShieldSize( int size ){ shieldSize_ = size; } + inline int shieldSize( ) const { return shieldSize_; } + + inline void setRadarSize( int size ){ radarSize_ = size; } + inline int radarSize( ) const { return radarSize_; } + + inline void setEngineSize( int size ){ engineSize_ = size; } + inline int engineSize( ) const { return engineSize_; } + + inline void setCapacitorSize( int size ){ capacitorSize_ = size; } + inline int capacitorSize( ) const { return capacitorSize_; } + + inline void setPowerPlantSize( int size ){ powerPlantSize_ = size; } + inline int powerPlantSize( ) const { return powerPlantSize_; } + + inline void setCargoSize( int size ){ cargoSize_ = size; } + inline int cargoSize( ) const { return cargoSize_; } + + inline void setEcmSize( int size ){ ecmSize_ = size; } + inline int ecmSize( ) const { return ecmSize_; } + + void setMesh( const std::string & meshName, bool genPath = true ){ + std::string fileName; + if ( genPath ){ + fileName = std::string("ships") + PATHSEPARATOR + factionName_ + PATHSEPARATOR + name_ + PATHSEPARATOR + meshName; + } else { + fileName = meshName; + } + pMesh_ = Ogre::MeshManager::getSingleton().load( fileName, "General" ); + // pMesh_ = Ogre::MeshManager::getSingleton().load( meshName, "../../trunk/data/ships/octavius/apteryx/" ); + } + Ogre::MeshPtr & meshPtr( ){ return pMesh_; } + +protected: + + float vesselSize_; + float vesselArmor_; + float vesselYaw_; + + float yaw_; + float pitch_; + float roll_; + float dragFactor_; + + int amountEngines_; + int amountGunHardPoints_; + int amountModX_; + int amountMissiles_; + + int cargoSize_; + + int capacitorSize_; + int powerPlantSize_; + int shieldSize_; + int radarSize_; + int engineSize_; + int ecmSize_; + + Ogre::MeshPtr pMesh_; +}; + +} + +#endif //_OPENGATE_VESSEL__H Property changes on: branches/ogsector/src/VesselTemplate.h ___________________________________________________________________ Name: svn:mime-type + text/x-c++hdr Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2007-05-22 12:57:42
|
Revision: 507 http://svn.sourceforge.net/opengate/?rev=507&view=rev Author: egore Date: 2007-05-22 05:57:43 -0700 (Tue, 22 May 2007) Log Message: ----------- Minor minor fixes Modified Paths: -------------- branches/ogsector/src/LogManager.cpp branches/ogsector/src/LogManager.h Modified: branches/ogsector/src/LogManager.cpp =================================================================== --- branches/ogsector/src/LogManager.cpp 2007-05-21 03:03:35 UTC (rev 506) +++ branches/ogsector/src/LogManager.cpp 2007-05-22 12:57:43 UTC (rev 507) @@ -43,7 +43,7 @@ } void LogManager::setChatLogFile( const std::string & chatLogFileName ){ - chatLogFile_.open( chatLogFileName.c_str(), std::fstream::app ); + chatLogFile_.open( chatLogFileName.c_str(), std::fstream::app ); chatLogFile_ << "\n" << timeStamp() << "Starting new session" << std::endl; haveChatLogFile_ = true; } @@ -63,7 +63,7 @@ return std::string("[" + toStr( time->tm_year + 1900 ) + "." - + toStr( time->tm_mon + 1 ) + "." + + toStr( time->tm_mon + 1 ) + "." + toStr( time->tm_mday ) + "-" + toStr( time->tm_hour ) + ":" + toStr( time->tm_min ) + ":" @@ -71,7 +71,7 @@ } void LogManager::chat( const std::string & name, const std::string & msg ){ - std::string logMsg( name + ": " + msg ); + std::string logMsg( name + ": " + msg ); if ( haveChatLogFile_ ) chatLogFile_ << timeStamp() << " " << logMsg << std::endl; writeToConsole_( logMsg ); @@ -91,7 +91,7 @@ } void LogManager::warn( const std::string & msg ){ - std::string logMsg( "WARN: " + msg ); + std::string logMsg( "WARN: " + msg ); writeToConsole_( logMsg ); write_( logMsg ); } @@ -155,5 +155,3 @@ } //namespace OpenGate - - Modified: branches/ogsector/src/LogManager.h =================================================================== --- branches/ogsector/src/LogManager.h 2007-05-21 03:03:35 UTC (rev 506) +++ branches/ogsector/src/LogManager.h 2007-05-22 12:57:43 UTC (rev 507) @@ -18,8 +18,8 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifndef LOGMANAGER__H -#define LOGMANAGER__H +#ifndef _OPENGATE_LOGMANAGER__H +#define _OPENGATE_LOGMANAGER__H #include <iostream> #include <fstream> @@ -136,6 +136,4 @@ } //namespace OpenGate - - -#endif // #ifndef __LOGCPP_H +#endif // _OPENGATE_LOGMANAGER__H This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2007-05-26 20:09:43
|
Revision: 509 http://svn.sourceforge.net/opengate/?rev=509&view=rev Author: spom_spom Date: 2007-05-26 13:09:35 -0700 (Sat, 26 May 2007) Log Message: ----------- Fixed some small issues. Some obscurities within the multiplayer mode during de/registering between the gamestates occur and will be fixed tommorow Modified Paths: -------------- branches/ogsector/src/GameState.h branches/ogsector/src/GameStateManager.cpp branches/ogsector/src/GameStateManager.h branches/ogsector/src/Makefile.am branches/ogsector/src/Makefile.in branches/ogsector/src/Sector.cpp branches/ogsector/src/Sector.h branches/ogsector/src/SectorObjects.cpp branches/ogsector/src/SectorObjects.h branches/ogsector/src/ShipConfigDialog.cpp branches/ogsector/src/UnDockedState.cpp branches/ogsector/src/UnDockedState.h Modified: branches/ogsector/src/GameState.h =================================================================== --- branches/ogsector/src/GameState.h 2007-05-23 21:24:50 UTC (rev 508) +++ branches/ogsector/src/GameState.h 2007-05-26 20:09:35 UTC (rev 509) @@ -45,6 +45,7 @@ class LogManager; class GameState; class GameStateManager; +class Avatar; class Console; /*! @@ -62,6 +63,7 @@ NetworkClient * network; Console * console; GameStateManager * gameStateRoot; + Avatar * avatar; } DeviceInfo; /*! Modified: branches/ogsector/src/GameStateManager.cpp =================================================================== --- branches/ogsector/src/GameStateManager.cpp 2007-05-23 21:24:50 UTC (rev 508) +++ branches/ogsector/src/GameStateManager.cpp 2007-05-26 20:09:35 UTC (rev 509) @@ -25,6 +25,7 @@ #include <OgreWindowEventUtilities.h> #include "LogManager.h" #include "Console.h" +#include "Avatar.h" #include "Sector.h" #include "InputManager.h" #include "VesselManager.h" @@ -147,10 +148,16 @@ if ( state ){ shutdownRequest_ = false; changeGameState( state ); + + //hack-mack + enterDockedStateHack_ = false; } while ( !shutdownRequest_ ){ devices_.inputManager->capture(); + + if ( enterDockedStateHack_ ) start( findByName( "DockedState" ) ); + captureNetwork(); Ogre::WindowEventUtilities::messagePump(); @@ -328,6 +335,8 @@ devices_.gameStateRoot = this; + devices_.avatar = new Avatar( devices_.network->userName(), devices_.network->userID() ); + return true; } @@ -408,25 +417,34 @@ } void GameStateManager::CMD_spawnAi( const std::vector < std::string > & argv ){ - if ( stateStack_.back()->name() == "UnDockedState" ){ - std::string aiName = "squid"; - if ( argv.size() > 1 ){ - aiName = argv[ 1 ]; - } - if ( VesselManager::getSingleton().vessel( aiName ) && aiName != "help" ){ - dynamic_cast< UnDockedState * >( stateStack_.back() )->spawnAI( aiName ); + std::string aiName = "squid"; + if ( argv.size() > 1 ){ + aiName = argv[ 1 ]; + } + + bool showHelp = false; + if ( aiName != "help" ){ + if ( stateStack_.back()->name() == "UnDockedState" ){ + if ( VesselManager::getSingleton().vessel( aiName ) ){ + dynamic_cast< UnDockedState * >( stateStack_.back() )->spawnAI( aiName ); + } else { + showHelp = true; + } } else { - - std::set< Vessel * > vessel( VesselManager::getSingleton().factionVessels( "All" ) ); - std::string vesselNames("Vessels available: "); - for ( std::set< Vessel * >::iterator it = vessel.begin(); it!= vessel.end(); it ++ ){ - vesselNames += (*it)->name() + " "; - } - LogManager::getSingleton().info( vesselNames ); + LogManager::getSingleton().info("You cannot spawn ai subjects at a station."); } } else { - LogManager::getSingleton().info("You cannot spawn ai subjects at a station."); + showHelp = true; } + + if ( showHelp ){ + std::set< Vessel * > vessel( VesselManager::getSingleton().factionVessels( "All" ) ); + std::string vesselNames("Vessels available: "); + for ( std::set< Vessel * >::iterator it = vessel.begin(); it!= vessel.end(); it ++ ){ + vesselNames += (*it)->name() + " "; + } + LogManager::getSingleton().info( vesselNames ); + } } } // namespace OpenGate Modified: branches/ogsector/src/GameStateManager.h =================================================================== --- branches/ogsector/src/GameStateManager.h 2007-05-23 21:24:50 UTC (rev 508) +++ branches/ogsector/src/GameStateManager.h 2007-05-26 20:09:35 UTC (rev 509) @@ -28,6 +28,7 @@ namespace OpenGate { +class Avatar; class LogManager; class InputManager; class VesselManager; @@ -94,6 +95,8 @@ /*! This is a special case function to cause a shutdown. */ void shutdown( ); + bool enterDockedStateHack_; + protected: /*! This initializes a state to receive the events. */ Modified: branches/ogsector/src/Makefile.am =================================================================== --- branches/ogsector/src/Makefile.am 2007-05-23 21:24:50 UTC (rev 508) +++ branches/ogsector/src/Makefile.am 2007-05-26 20:09:35 UTC (rev 509) @@ -14,6 +14,8 @@ tinyxml/tinyxml.cpp \ tinyxml/tinyxmlerror.cpp \ tinyxml/tinyxmlparser.cpp \ + Avatar.h \ + Avatar.cpp \ Console.h \ Console.cpp \ ConfigDialog.h \ Modified: branches/ogsector/src/Makefile.in =================================================================== --- branches/ogsector/src/Makefile.in 2007-05-23 21:24:50 UTC (rev 508) +++ branches/ogsector/src/Makefile.in 2007-05-26 20:09:35 UTC (rev 509) @@ -51,8 +51,8 @@ am_opengateclient_OBJECTS = opengateclient.$(OBJEXT) common.$(OBJEXT) \ networkClient.$(OBJEXT) tinyxml.$(OBJEXT) \ tinyxmlerror.$(OBJEXT) tinyxmlparser.$(OBJEXT) \ - Console.$(OBJEXT) ConfigDialog.$(OBJEXT) Entity.$(OBJEXT) \ - EntityManager.$(OBJEXT) LogManager.$(OBJEXT) \ + Avatar.$(OBJEXT) Console.$(OBJEXT) ConfigDialog.$(OBJEXT) \ + Entity.$(OBJEXT) EntityManager.$(OBJEXT) LogManager.$(OBJEXT) \ InputManager.$(OBJEXT) VesselManager.$(OBJEXT) \ GameStateManager.$(OBJEXT) GameState.$(OBJEXT) \ DockedState.$(OBJEXT) ShipConfigDialog.$(OBJEXT) \ @@ -191,6 +191,8 @@ tinyxml/tinyxml.cpp \ tinyxml/tinyxmlerror.cpp \ tinyxml/tinyxmlparser.cpp \ + Avatar.h \ + Avatar.cpp \ Console.h \ Console.cpp \ ConfigDialog.h \ @@ -313,6 +315,7 @@ distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Avatar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ConfigDialog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Console.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DockedState.Po@am__quote@ Modified: branches/ogsector/src/Sector.cpp =================================================================== --- branches/ogsector/src/Sector.cpp 2007-05-23 21:24:50 UTC (rev 508) +++ branches/ogsector/src/Sector.cpp 2007-05-26 20:09:35 UTC (rev 509) @@ -19,6 +19,7 @@ ***************************************************************************/ #include "Sector.h" +#include "Avatar.h" namespace OpenGate{ @@ -45,15 +46,16 @@ // }; Sector::Sector( Ogre::SceneManager * sceneMgr, NetworkClient * network ) - : sceneMgr_( sceneMgr ), network_( network ) { + : sceneMgr_( sceneMgr ), network_( network ) { log_ = LogManager::getSingletonPtr(); + bool radar_ = true; sectorname_ = "Testsector"; planetNode_ = NULL; starsNode_ = NULL; avatar_ = NULL; - avatarRespawnTime_ = 0.0; + avatarDeathSequenceTime_ = 0.0; sceneMgr_->setAmbientLight( Ogre::ColourValue(0.9, 0.9, 0.9) ); //** Create a light; @@ -140,6 +142,7 @@ collideInSectorContext_ = OgreOpcode::CollisionManager::getSingletonPtr()->getDefaultContext(); + // Ogre::MeshPtr pMesh = Ogre::MeshManager::getSingleton().load( "astro/Sphere.mesh", // Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, // Ogre::HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY, @@ -197,13 +200,36 @@ } itTarget_ = sectorObjects_.begin(); + } Sector::~Sector( ){ - delete OgreOpcode::CollisionManager::getSingletonPtr(); + for ( std::map< long, SectorObjectMoveable * >::iterator it = movableObjects_.begin(); it != movableObjects_.end();){ +// log_->info( "Destructing: " + it->second->name() ); + destructMoveableObject( (it++)->second ); +// log_->info( "done: " ); + } + for ( std::set< SectorObject * >::iterator it = sectorObjects_.begin(); it != sectorObjects_.end(); ){ +// log_->info( "Destructing: " + (*it)->name() ); + + if ( (*it)->isOnRadar() && radar_ ){ + Ogre::Overlay * radar = Ogre::OverlayManager::getSingleton().getByName( "Radar" ); + Ogre::OverlayContainer * radarMap = radar->getChild( "Radar/Map" ); + radarMap->removeChild( (*it)->dotA()->getName() ); + radarMap->removeChild( (*it)->dotB()->getName() ); + } + + delete *it; sectorObjects_.erase( (*it++) ); + +// log_->info( "done: " ); } + + sceneMgr_->destroyManualObject( "Planet" ); + sceneMgr_->getRootSceneNode()->removeAndDestroyChild( "PlanetNode" ); + + delete OgreOpcode::CollisionManager::getSingletonPtr(); } void Sector::update( Ogre::Real elapsedTime ){ @@ -250,92 +276,90 @@ } if ( starsNode_ ) starsNode_->setPosition( avatar_->mainNode()->getPosition() ); - Ogre::Overlay * radar = Ogre::OverlayManager::getSingleton().getByName( "Radar" ); - Ogre::OverlayContainer * radarMap = radar->getChild( "Radar/Map" ); - - int dotAWidth = 4; - int dotAHeight = 2; - float radarRange = 5000; - float radarWidth = radarMap->getWidth() * Ogre::OverlayManager::getSingleton().getViewportWidth(); - float radarHeight = radarMap->getHeight() * Ogre::OverlayManager::getSingleton().getViewportHeight(); - float xScale = radarRange / ( radarWidth / 2.0 ); - float yScale = radarRange / ( radarHeight / 2.0 ); - - for ( std::set< SectorObject * >::iterator it = sectorObjects_.begin(); it != sectorObjects_.end(); it++){ + if ( radar_ ){ + Ogre::Overlay * radar = Ogre::OverlayManager::getSingleton().getByName( "Radar" ); + Ogre::OverlayContainer * radarMap = radar->getChild( "Radar/Map" ); - Ogre::Vector3 relativPosition( (*it)->mainNode()->getPosition( ) - avatar_->mainNode()->getPosition( ) ); + int dotAWidth = 4; + int dotAHeight = 2; + float radarRange = 5000; + float radarWidth = radarMap->getWidth() * Ogre::OverlayManager::getSingleton().getViewportWidth(); + float radarHeight = radarMap->getHeight() * Ogre::OverlayManager::getSingleton().getViewportHeight(); + float xScale = radarRange / ( radarWidth / 2.0 ); + float yScale = radarRange / ( radarHeight / 2.0 ); - if ( relativPosition.length() < radarRange ){ - Ogre::OverlayElement * dotA, * dotB; + for ( std::set< SectorObject * >::iterator it = sectorObjects_.begin(); it != sectorObjects_.end(); it++){ - if ( !(*it)->isOnRadar() ) { - dotA = Ogre::OverlayManager::getSingleton().createOverlayElement( "Panel", "Radar/Map/DotA" + (*it)->name() ); - dotA->setMaterialName( "BaseWhite" ); - dotA->setMetricsMode( Ogre::GMM_PIXELS ); - dotA->setWidth( dotAWidth ); - dotA->setHeight( dotAHeight ); - radarMap->addChild( dotA ); + Ogre::Vector3 relativPosition( (*it)->mainNode()->getPosition( ) - avatar_->mainNode()->getPosition( ) ); + Ogre::OverlayElement * dotA = (*it)->dotA(); + Ogre::OverlayElement * dotB = (*it)->dotB(); + + if ( relativPosition.length() < radarRange ){ - dotB = Ogre::OverlayManager::getSingleton().createOverlayElement( "Panel", "Radar/Map/DotB" + (*it)->name() ); - dotB->setMaterialName( "BaseWhite" ); - dotB->setMetricsMode( Ogre::GMM_PIXELS ); - dotB->setWidth( 1 ); - dotB->setHeight( 1 ); - dotB->setColour( Ogre::ColourValue( 1.0f, 0.0f, 0.0f ) ); - radarMap->addChild( dotB ); + Ogre::Quaternion q; + q.FromAngleAxis( -avatar_->mainNode()->getOrientation( ).getYaw(), Ogre::Vector3::UNIT_Y); + relativPosition = q * relativPosition; - (*it)->onRadar( true ); - } else { - dotA = radarMap->getChild( "Radar/Map/DotA" + (*it)->name() ); - dotB = radarMap->getChild( "Radar/Map/DotB" + (*it)->name() ); + Ogre::Plane viewPlane( avatar_->mainNode()->getOrientation().yAxis().normalisedCopy(), + avatar_->mainNode()->getPosition() ); + + float distToPlane = viewPlane.getDistance( (*it)->mainNode()->getPosition( ) ) / yScale; + + dotB->setHeight( fabs( distToPlane ) ); + + dotA->setPosition( radarWidth / 2.0 + relativPosition[ 0 ] / xScale - dotAWidth / 2, + - distToPlane - dotAHeight / 2 + radarHeight / 2.0 + relativPosition[ 2 ] / yScale ); + + if ( distToPlane < 0 ) distToPlane = 0; + + dotB->setPosition( radarWidth / 2.0 + relativPosition[ 0 ] / xScale, + - distToPlane + radarHeight / 2.0 + relativPosition[ 2 ] / yScale ); + + if ( (*it)->isOnRadar() == false ){ + radarMap->addChild( dotA ); + radarMap->addChild( dotB ); + (*it)->onRadar( true ); + } + } else { // if not in radarrange + if ( (*it)->isOnRadar() == true ){ + radarMap->removeChild( dotA->getName() ); + radarMap->removeChild( dotB->getName() ); + (*it)->onRadar( false ); + } } - - Ogre::Quaternion q; - q.FromAngleAxis( -avatar_->mainNode()->getOrientation( ).getYaw(), Ogre::Vector3::UNIT_Y); - relativPosition = q * relativPosition; - - Ogre::Plane viewPlane( avatar_->mainNode()->getOrientation().yAxis().normalisedCopy(), - avatar_->mainNode()->getPosition() ); - - float distToPlane = viewPlane.getDistance( (*it)->mainNode()->getPosition( ) ) / yScale; - - dotB->setHeight( fabs( distToPlane ) ); - - dotA->setPosition( radarWidth / 2.0 + relativPosition[ 0 ] / xScale - dotAWidth / 2, - - distToPlane - dotAHeight / 2 + radarHeight / 2.0 + relativPosition[ 2 ] / yScale ); - - if ( distToPlane < 0 ) distToPlane = 0; - - dotB->setPosition( radarWidth / 2.0 + relativPosition[ 0 ] / xScale, - - distToPlane + radarHeight / 2.0 + relativPosition[ 2 ] / yScale ); - - } - } // if in radarrange - } + } // for each object + } // if radar + } // if avatar for ( std::map< long, SectorObjectMoveable * >::iterator it = movableObjects_.begin(); it != movableObjects_.end();){ + if ( !it->second->update( elapsedTime ) ) { //** object died; - if ( it->second == avatar_ ) { - if ( avatarRespawnTime_ == 0.0 ){ - sendVesselDeRegister( avatar_ ); - avatarRespawnTime_ = 5.0; + if ( avatarDeathSequenceTime_ == 0.0 ){ + avatarDeathSequenceTime_ = 1.0; } else { - avatarRespawnTime_ -= elapsedTime; - if ( avatarRespawnTime_ < 0 ){ - spawnAvatar(); + avatarDeathSequenceTime_ -= elapsedTime; + if ( avatarDeathSequenceTime_ < 0 ){ + avatarDeathSequenceTime_ = 0.0; + listener_->avatarDeathSequence( false ); } } it++; } else { //** died object is not avatar; - log_->info( "Destructing: " + it->second->name() ); - destructMoveableObject( (it++)->second ); - log_->info( "done: " ); +// log_->info( "Destructing: " + it->second->name() ); +// destructMoveableObject( (it++)->second ); +// log_->info( "done: " ); } } else ++it; } } +void Sector::avatarDied( ){ + if ( avatar_ ){ + listener_->avatarDeathSequence( true ); + } +} + SectorObjectMoveable * Sector::createMoveableObject( const Ogre::String & name, int userID, int childID, Vessel & vessel ){ SectorObjectMoveable * obj = new SectorObjectMoveable( name, this, userID, childID, vessel ); @@ -349,13 +373,11 @@ selectNextTarget( obj ); sectorObjects_.erase( obj ); - if ( obj->isOnRadar() ){ + if ( obj->isOnRadar() && radar_ ){ Ogre::Overlay * radar = Ogre::OverlayManager::getSingleton().getByName( "Radar" ); Ogre::OverlayContainer * radarMap = radar->getChild( "Radar/Map" ); - radarMap->removeChild( "Radar/Map/DotA" + obj->name() ); - radarMap->removeChild( "Radar/Map/DotB" + obj->name() ); - Ogre::OverlayManager::getSingleton().destroyOverlayElement( "Radar/Map/DotA" + obj->name() ); - Ogre::OverlayManager::getSingleton().destroyOverlayElement( "Radar/Map/DotB" + obj->name() ); + radarMap->removeChild( obj->dotA()->getName() ); + radarMap->removeChild( obj->dotB()->getName() ); } for ( std::map< long, SectorObjectMoveableAi * >::iterator it = localAiObjects_.begin(); @@ -437,18 +459,24 @@ sendVesselMovement( obj ); } -void Sector::createAvatar( const Ogre::String & playername ){ - log_->info( std::string( "Create avatar: " ) + playername ); - avatar_ = new SectorObjectAvatar( playername, this, network_->userID(), - *VesselManager::getSingleton().vessel( "apteryx" ) ); - log_->info( std::string( "Avatar_ " ) + playername ); - movableObjects_[ avatar_->globalID() ] = avatar_; - log_->info( std::string( "Created " ) + playername ); +void Sector::createAvatarObject( Avatar & avatar ){ + log_->info( std::string( "Create avatar: " ) + avatar.name() ); + avatar_ = new SectorObjectAvatar( avatar.name(), this, avatar.userID(), avatar.vessel() ); + movableObjects_[ avatar_->userID() ] = avatar_; + + avatar_->reset(); + avatar_->mainNode()->setPosition( 0.0, 0.0, 500.0 ); + avatar_->mainNode()->setOrientation( Ogre::Quaternion( 1.0, 0.0, 0.0, 0.0 ) ); + avatar_->setVelocity( Ogre::Vector3( 0.0, 0.0, -20.0 ) ); + + avatar_->setVisible( false ); + sendVesselRegister( avatar_ ); } -void Sector::destructAvatar( ){ +void Sector::destructAvatarObject( ){ for ( std::map< long, SectorObjectMoveableAi * >::iterator it = localAiObjects_.begin(); it != localAiObjects_.end(); it ++ ){ + if ( it->second->target() == avatar_ ){ log_->warn( std::string( "ai object target: " ) + it->second->name() + " loose target." ); it->second->setTarget( NULL ); @@ -456,33 +484,11 @@ } sendVesselDeRegister( avatar_ ); - movableObjects_.erase( avatar_->globalID() ); + movableObjects_.erase( avatar_->userID() ); if ( avatar_ ) delete avatar_; avatar_ = NULL; } -void Sector::avatarDied( ){ - if ( avatar_ ){ - avatar_->setVisible( true ); - listener_->avatarDeathSequence( true ); - } -} - -void Sector::spawnAvatar( ){ - if ( avatar_ ){ - log_->info( std::string( "Spawn avatar: " ) + avatar_->name() ); - avatarRespawnTime_ = 0.0; - avatar_->reset(); - avatar_->mainNode()->setPosition( 0.0, 0.0, 500.0 ); - avatar_->mainNode()->setOrientation( Ogre::Quaternion( 1.0, 0.0, 0.0, 0.0 ) ); - avatar_->setVelocity( Ogre::Vector3( 0.0, 0.0, -20.0 ) ); - - avatar_->setVisible( false ); - sendVesselRegister( avatar_ ); - listener_->avatarDeathSequence( false ); - } -} - void Sector::selectNextTarget( SectorObject * obj ){ if ( obj != NULL ){ if ( listener_->target() == obj ) listener_->setTarget( nextTarget() ); @@ -626,7 +632,7 @@ if ( !movableObjects_.count( createGlobalID( msg.senderID(), msg.childID() ) ) ){ if ( msg.childID() == 0 ){ - log_->info( "Create player object " + msg.name()+ " " + toStr( msg.senderID() ) + " " + toStr( msg.vesselID() ) ); + log_->info( "Create player object " + msg.name()+ " " + toStr( msg.senderID() ) + " VesselID: " + toStr( msg.vesselID() ) ); SectorObjectMoveable * obj = createMoveableObject( msg.name(), msg.senderID(), msg.childID(), *VesselManager::getSingleton().vessel( msg.vesselID() ) ); obj->mainNode()->setPosition( msg.position() ); @@ -671,7 +677,7 @@ } else { log_->warn( std::string( "Deregistering request for unknown object: " ) + - toStr( msg.senderID() ) + ": " + toStr( msg.childID() ) ); + toStr( msg.senderID() ) + ": " + toStr( (int)msg.childID() ) ); } } Modified: branches/ogsector/src/Sector.h =================================================================== --- branches/ogsector/src/Sector.h 2007-05-23 21:24:50 UTC (rev 508) +++ branches/ogsector/src/Sector.h 2007-05-26 20:09:35 UTC (rev 509) @@ -30,8 +30,9 @@ namespace OpenGate{ +class Avatar; + class Sector { - public: Sector( Ogre::SceneManager * sceneMgr, NetworkClient * network ); @@ -51,7 +52,7 @@ LogManager * log() { return log_; } void createStaticObject( const Ogre::String & meshname, const Ogre::String & objectname, - const Ogre::Vector3 & pos, Ogre::Real targetSize, Ogre::Degree yaw ); + const Ogre::Vector3 & pos, Ogre::Real targetSize, Ogre::Degree yaw ); SectorObjectMoveable * createMoveableObject( const Ogre::String & name, int userId, int childId, Vessel & vessel ); @@ -59,16 +60,14 @@ void destructMoveableObject( SectorObjectMoveable * obj ); - void createAvatar( const Ogre::String & playername ); + void createAvatarObject( Avatar & avatar ); - SectorObjectAvatar * avatar() { return avatar_; } + SectorObjectAvatar * avatarObject() { return avatar_; } - void destructAvatar( ); + void destructAvatarObject( ); void avatarDied( ); - void spawnAvatar( ); - void spawnAiObject( const std::string & vesselName ); OgreOpcode::CollisionContext * collisionContext() { return collideInSectorContext_; } @@ -121,8 +120,9 @@ std::map< long, SectorObjectMoveable * > movableObjects_; std::map< long, SectorObjectMoveableAi * > localAiObjects_; - float avatarRespawnTime_; + float avatarDeathSequenceTime_; + bool radar_ ; }; } // namespace OpenGate Modified: branches/ogsector/src/SectorObjects.cpp =================================================================== --- branches/ogsector/src/SectorObjects.cpp 2007-05-23 21:24:50 UTC (rev 508) +++ branches/ogsector/src/SectorObjects.cpp 2007-05-26 20:09:35 UTC (rev 509) @@ -21,6 +21,7 @@ #include "Sector.h" #include "SectorObjects.h" #include "common.h" +#include <string> namespace OpenGate{ @@ -29,9 +30,15 @@ globalID_ = createGlobalID( userID, childID ); sceneMgr_ = sector_->sceneManager(); - mainNode_ = static_cast< Ogre::SceneNode * >( sceneMgr_->getRootSceneNode()->createChild() ); + try{ + mainNode_ = sceneMgr_->getRootSceneNode()->createChildSceneNode( name + "_MainNode" ); + } catch( Ogre::Exception& e ) { + std::cout << e.getFullDescription().c_str() << std::endl; + } + lifeTime_ = 0.0; selectable_ = false; + } BaseObject::~BaseObject(){ @@ -39,7 +46,7 @@ } Projectile::Projectile( BaseObject * parent, long shotCounter, Ogre::Real speed ) - : BaseObject( parent->name(), parent->sector() ), parent_( parent ) { + : BaseObject( parent->name() + "_" + toStr( shotCounter ), parent->sector() ), parent_( parent ) { selectable_ = false; Ogre::String bulletName( name_ + "_" + toStr( shotCounter ) ); @@ -180,9 +187,28 @@ mainNodeEntity_ = mainNode_->createChildSceneNode( name_ + "_transform" ); baseSize_ = 0.0; selectable_ = true; + + int dotAWidth = 4; + int dotAHeight = 2; + dotA_ = Ogre::OverlayManager::getSingleton().createOverlayElement( "Panel", "Radar/Map/DotA_" + name_ ); + dotA_->setMaterialName( "BaseWhite" ); + dotA_->setMetricsMode( Ogre::GMM_PIXELS ); + dotA_->setWidth( dotAWidth ); + dotA_->setHeight( dotAHeight ); + dotA_->setColour( Ogre::ColourValue( 1.0f, 0.0f, 0.0f ) ); + + dotB_ = Ogre::OverlayManager::getSingleton().createOverlayElement( "Panel", "Radar/Map/DotB_" + name_ ); + dotB_->setMaterialName( "BaseWhite" ); + dotB_->setMetricsMode( Ogre::GMM_PIXELS ); + dotB_->setWidth( 1 ); + dotB_->setHeight( 1 ); + dotB_->setColour( Ogre::ColourValue( 1.0f, 0.0f, 0.0f ) ); } SectorObject::~SectorObject(){ + Ogre::OverlayManager::getSingleton().destroyOverlayElement( "Radar/Map/DotA_" + name_ ); + Ogre::OverlayManager::getSingleton().destroyOverlayElement( "Radar/Map/DotB_" + name_ ); + sector_->collisionContext()->destroyObject( collObj_ ); OgreOpcode::CollisionManager::getSingletonPtr()->destroyShape( collObj_->getShape() ); @@ -597,6 +623,7 @@ } explosion_->getEmitter( 0 )->setEnabled( true ); explodeSequenceTime_ = explosion_->getEmitter( 0 )->getDuration() + explosion_->getEmitter( 0 )->getMaxTimeToLive(); + if ( thrusterBbs_ ) thrusterBbs_->setVisible( false ); percentageThrust_ = 0; @@ -609,7 +636,7 @@ if ( explodeSequenceTime_ > 0 || projectiles_.size() > 0 ) { return true; } else { - explosion_->getEmitter( 0 )->setEnabled( false ); + if ( explosion_ ) explosion_->getEmitter( 0 )->setEnabled( false ); return false; } @@ -680,7 +707,6 @@ targetArrow_ = NULL; flightArrow_ = NULL; - LogManager::getSingleton().info( std::string( "SectorObjectAvatar" ) ); forceMovement_ = false; targetArrow_ = mainNode_->createChildSceneNode( name_ + "_TargetArrow" ); @@ -753,10 +779,7 @@ } bool SectorObjectAvatar::deathSequence( Ogre::Real elapsedTime ){ - if ( !deathSequence_ ) { - sector_->avatarDied( ); - } - + if ( !deathSequence_ ){ sector_->avatarDied( ); } return SectorObjectMoveable::deathSequence( elapsedTime ); } Modified: branches/ogsector/src/SectorObjects.h =================================================================== --- branches/ogsector/src/SectorObjects.h 2007-05-23 21:24:50 UTC (rev 508) +++ branches/ogsector/src/SectorObjects.h 2007-05-26 20:09:35 UTC (rev 509) @@ -150,11 +150,17 @@ virtual Ogre::Vector3 velDirection() const { return Ogre::Vector3(0.0, 0.0, 0.0 ); } + Ogre::OverlayElement * dotA() { return dotA_; } + Ogre::OverlayElement * dotB() { return dotB_; } + protected: Ogre::SceneNode * mainNodeEntity_; // Main character node Ogre::Entity * entity_; + Ogre::OverlayElement * dotA_; + Ogre::OverlayElement * dotB_; + bool isOnRadar_; double baseSize_; }; Modified: branches/ogsector/src/ShipConfigDialog.cpp =================================================================== --- branches/ogsector/src/ShipConfigDialog.cpp 2007-05-23 21:24:50 UTC (rev 508) +++ branches/ogsector/src/ShipConfigDialog.cpp 2007-05-26 20:09:35 UTC (rev 509) @@ -27,6 +27,7 @@ #include "ShipConfigDialog.h" #include "LogManager.h" +#include "Avatar.h" #include "VesselManager.h" namespace OpenGate{ @@ -191,6 +192,7 @@ } bool ShipConfigDialog::handleSelectShipButton( const CEGUI::EventArgs & e ){ + devices_->avatar->setVessel( *(*itVessel_) ); hide(); return true; } Modified: branches/ogsector/src/UnDockedState.cpp =================================================================== --- branches/ogsector/src/UnDockedState.cpp 2007-05-23 21:24:50 UTC (rev 508) +++ branches/ogsector/src/UnDockedState.cpp 2007-05-26 20:09:35 UTC (rev 509) @@ -19,6 +19,7 @@ ***************************************************************************/ #include "UnDockedState.h" +#include "Avatar.h" #include "Sector.h" #include "networkProtocol.h" #include "networkClient.h" @@ -64,8 +65,6 @@ windowsHalfWidth_ = (int)(windowsWidth_ * 0.5); windowsHalfHeight_ = (int)(windowsHeight_ * 0.5); - sector_ = new Sector( sceneMgr_, network_ ); - sector_->setListener( this ); setupEventHandlers(); targetCurser_ = CEGUI::WindowManager::getSingleton().getWindow( "HUDTargetCurser" ); @@ -133,6 +132,10 @@ flightCurser_ = CEGUI::WindowManager::getSingleton().getWindow( "HUDFlightCurser" ); flightCurserHalfWidth_ = 10; flightCurserHalfHeight_ = 10; + + sector_ = new Sector( sceneMgr_, network_ ); + sector_->setListener( this ); + } void UnDockedState::destroyContent( ){ @@ -143,6 +146,8 @@ void UnDockedState::enter(){ log_->info("Entering undockstate"); + + devices_->guiRenderer->setTargetSceneManager( sceneMgr_ ); if ( overlayRootWindow_ ){ devices_->guiSystem->setGUISheet( overlayRootWindow_ ); @@ -181,10 +186,8 @@ Ogre::OverlayManager::getSingleton().getByName( "Radar" )->show(); - deathSequence_ = false; sceneDetailIndex_ = 0; - target_ = NULL; - cameraMode_ = 1; + target_ = sector_->nextTarget(); chatMode_ = false; duelistPilot_ = false; duelistTarget_ = false; @@ -214,7 +217,7 @@ // hudTargetPointer-> // spaceDustParticleSystem_ = mainCamera_->getSceneManager()->createParticleSystem( "SpaceDust", "Space/Dust" ); -// Ogre::SceneNode * spaceDustNode = sector_->avatar()->mainNode()->createChildSceneNode( "DustParticles", mainCamera_->getRealPosition() ); +// Ogre::SceneNode * spaceDustNode = sector_->avatarObject()->mainNode()->createChildSceneNode( "DustParticles", mainCamera_->getRealPosition() ); // spaceDustNode_->attachObject( spaceDustParticleSystem_ ); // mainCamera_->getParentSceneNode() @@ -232,10 +235,9 @@ // aniso_ = 1; // filtering_ = TFO_BILINEAR; + enterDockedState_ = false; + sector_->createAvatarObject( *devices_->avatar ); - sector_->createAvatar( network_->userName() ); - sector_->spawnAvatar(); - if ( devices_->console ){ CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"ConsoleList__auto_vscrollbar__")->hide(); } @@ -244,13 +246,16 @@ CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"Config/BackButton" )->subscribeEvent( CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&UnDockedState::handleConfigBackButton, this ) ) ; + + toggleNextCamera_( 1 ); } void UnDockedState::exit(){ + log_->info("Exiting undockstate"); + sector_->destructAvatarObject( ); + CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"Config/BackButton" )->removeEvent( CEGUI::PushButton::EventClicked ) ; - - log_->info("Exiting dockstate"); if ( overlayRootWindow_ ) overlayRootWindow_->hide(); if ( devices_->console ) devices_->console->stop(); @@ -264,8 +269,6 @@ devices_->inputManager->removeKeyListener( "SectorClientKeyListener" ); devices_->inputManager->removeMouseListener( "SectorClientMouseListener" ); devices_->inputManager->removeJoystickListener( "SectorClientJoystickListener" ); - - sector_->destructAvatar( ); } bool UnDockedState::switchConfigDialog( ){ @@ -294,21 +297,19 @@ } bool UnDockedState::frameStarted( const Ogre::FrameEvent & evt ) { + //** this crahes at shutdown + //** if ( enterDockedState_ ) parent_->start( parent_->findByName( "DockedState" ) ); + if ( enterDockedState_ ) devices_->gameStateRoot->enterDockedStateHack_ = true; + if ( window_->isClosed() ) return false; timeSinceLastSectorUpdate_ += evt.timeSinceLastFrame; timeSinceLastNetworkUpdate_ += evt.timeSinceLastFrame; - if ( deathSequence_ ){ - } else { - //** capture my input - } - // max 1000 sector-updates/second if ( timeSinceLastSectorUpdate_ > 0.001 ){ sector_->update( timeSinceLastSectorUpdate_ ); timeSinceLastSectorUpdate_ = 0.0; - updateHUD_(); } //** send movement data, max 10 net-updates/second @@ -317,8 +318,11 @@ timeSinceLastNetworkUpdate_ = 0.0; } + + //** update my camera; updateCamera_(); + updateHUD_(); // renderSpaceDust(); return true; @@ -351,48 +355,49 @@ chatMode_ = true; } - if ( sector_->avatar() != NULL ){ + if ( sector_->avatarObject() != NULL ){ //** Avatar yaw LEFT; - if ( e.key == OIS::KC_A || e.key == OIS::KC_NUMPAD4 ) { sector_->avatar()->setScaledYaw( 1.0 ); } + if ( e.key == OIS::KC_A || e.key == OIS::KC_NUMPAD4 ) { sector_->avatarObject()->setScaledYaw( 1.0 ); } //** Avatar yaw RIGHT; - if ( e.key == OIS::KC_D || e.key == OIS::KC_NUMPAD6 ) { sector_->avatar()->setScaledYaw( -1.0 ); } + if ( e.key == OIS::KC_D || e.key == OIS::KC_NUMPAD6 ) { sector_->avatarObject()->setScaledYaw( -1.0 ); } //** Avatar pitch DOWN; - if ( e.key == OIS::KC_W || e.key == OIS::KC_NUMPAD8 ) { sector_->avatar()->setScaledPitch( -1.0 ); } + if ( e.key == OIS::KC_W || e.key == OIS::KC_NUMPAD8 ) { sector_->avatarObject()->setScaledPitch( -1.0 ); } //** Avatar pitch UP; - if ( e.key == OIS::KC_S || e.key == OIS::KC_NUMPAD2 ) { sector_->avatar()->setScaledPitch( 1.0 ); } + if ( e.key == OIS::KC_S || e.key == OIS::KC_NUMPAD2 ) { sector_->avatarObject()->setScaledPitch( 1.0 ); } //** Avatar roll (181 == NUM/); - if ( e.key == OIS::KC_NUMPAD0 || e.key == 181 ) { sector_->avatar()->setScaledRoll( 1.0 ); } + if ( e.key == OIS::KC_NUMPAD0 || e.key == 181 ) { sector_->avatarObject()->setScaledRoll( 1.0 ); } //** Avatar roll (55 == NUM*); - if ( e.key == OIS::KC_NUMPADCOMMA || e.key == 55 ) { sector_->avatar()->setScaledRoll( -1.0 ); } + if ( e.key == OIS::KC_NUMPADCOMMA || e.key == 55 ) { sector_->avatarObject()->setScaledRoll( -1.0 ); } //** Avatar increase thrust by 10%; - if ( e.key == OIS::KC_NUMPAD7 ) { sector_->avatar()->incrementThrust(); } + if ( e.key == OIS::KC_NUMPAD7 ) { sector_->avatarObject()->incrementThrust(); } //** Avatar increase thrust by 10%; - if ( e.key == OIS::KC_NUMPAD1 ) { sector_->avatar()->decrementThrust(); } + if ( e.key == OIS::KC_NUMPAD1 ) { sector_->avatarObject()->decrementThrust(); } //** Avatar press break; - if ( e.key == OIS::KC_NUMPAD3 ) { sector_->avatar()->setBreakPressed( true ); } + if ( e.key == OIS::KC_NUMPAD3 ) { sector_->avatarObject()->setBreakPressed( true ); } //** Avatar press afterburner; - if ( e.key == OIS::KC_NUMPAD9 ) { sector_->avatar()->setAfterburnerPressed( true ); } + if ( e.key == OIS::KC_NUMPAD9 ) { sector_->avatarObject()->setAfterburnerPressed( true ); } //** Avatar centering; if ( e.key == OIS::KC_NUMPAD5 ) { - sector_->avatar()->setScaledYaw( 0.0 ); - sector_->avatar()->setScaledPitch( 0.0 ); - sector_->avatar()->setScaledRoll( 0.0 ); + sector_->avatarObject()->setScaledYaw( 0.0 ); + sector_->avatarObject()->setScaledPitch( 0.0 ); + sector_->avatarObject()->setScaledRoll( 0.0 ); } //** selfdestruct and eject; - if ( e.key == OIS::KC_F4 ) { parent_->start( parent_->findByName( "DockedState" ) ); } + if ( e.key == OIS::KC_F4 ) { devices_->gameStateRoot->enterDockedStateHack_ = true; } +// if ( e.key == OIS::KC_F4 || enterDockedState_ ) { parent_->start( parent_->findByName( "DockedState" ) ); }// enterDockedState_ = true; } if ( e.key == OIS::KC_F5 ) { duelistPilot_ = !duelistPilot_; } if ( e.key == OIS::KC_F6 ) { duelistTarget_ = !duelistTarget_; } - if ( e.key == OIS::KC_F8 ) { sector_->avatar()->deathSequence( 0 ); } + if ( e.key == OIS::KC_F8 ) { sector_->avatarObject()->deathSequence( 0 ); } } // if avatar; //** next Target; @@ -452,12 +457,12 @@ bool UnDockedState::keyReleased( const OIS::KeyEvent & e ){ if (!configMode_){ - if ( sector_->avatar() != NULL ){ + if ( sector_->avatarObject() != NULL ){ // Avatar release break - if ( e.key == OIS::KC_NUMPAD3 ) { sector_->avatar()->setBreakPressed( false ); } + if ( e.key == OIS::KC_NUMPAD3 ) { sector_->avatarObject()->setBreakPressed( false ); } // Avatar release afterburner - if ( e.key == OIS::KC_NUMPAD9 ) { sector_->avatar()->setAfterburnerPressed( false ); } + if ( e.key == OIS::KC_NUMPAD9 ) { sector_->avatarObject()->setAfterburnerPressed( false ); } } } return true; @@ -492,7 +497,7 @@ - if ( sector_->avatar() != NULL ){ + if ( sector_->avatarObject() != NULL ){ // std::cout << "X" << e.state.X.abs << " " << e.state.X.rel << " " << mousePointer_->getLeft( ) << std::endl; // std::cout << "Y" << e.state.Y.abs << " " << e.state.Y.rel << " " << mousePointer_->getTop( ) << std::endl; // std::cout << "Z" << e.state.Z.abs << " " << e.state.Z.rel<< std::endl; @@ -537,8 +542,8 @@ // String(" yaw: ") + StringConverter::toString( yaw ) + // String(" pitch ") + StringConverter::toString( pitch ) ) << std::endl; - sector_->avatar()->setScaledYaw( -yaw ); - sector_->avatar()->setScaledPitch( -pitch ); + sector_->avatarObject()->setScaledYaw( -yaw ); + sector_->avatarObject()->setScaledPitch( -pitch ); } // if avatar; if ( e.state.Z.rel < -10 ){ // mouse wheel up @@ -554,10 +559,10 @@ bool UnDockedState::mousePressed( const OIS::MouseEvent &e , OIS::MouseButtonID id ){ if ( !configMode_ ){ - if ( sector_->avatar() != NULL ){ + if ( sector_->avatarObject() != NULL ){ // std::cout << "Mouse Button: " << id << std::endl; if ( id == 0){ - sector_->avatar()->setFirePressed( true ); + sector_->avatarObject()->setFirePressed( true ); } } } else { @@ -568,10 +573,10 @@ bool UnDockedState::mouseReleased( const OIS::MouseEvent &e , OIS::MouseButtonID id ){ if ( !configMode_ ){ - if ( sector_->avatar() != NULL ){ + if ( sector_->avatarObject() != NULL ){ // std::cout << "Mouse Button: " << id << std::endl; if ( id == 0){ - sector_->avatar()->setFirePressed( false); + sector_->avatarObject()->setFirePressed( false); } } } else{ @@ -582,7 +587,7 @@ bool UnDockedState::axisMoved( const OIS::JoyStickEvent & e, int axis ){ if ( !configMode_ ){ - if ( sector_->avatar() != NULL ){ + if ( sector_->avatarObject() != NULL ){ //** axis definition for my MS Sidewinder FF2 int joyStickAxisX = 0; int joyStickAxisY = 1; @@ -622,10 +627,10 @@ // " roll: " + StringConverter::toString(roll) + // " thrust: " + StringConverter::toString(thrust) ); - sector_->avatar()->setScaledYaw( -yaw ); - sector_->avatar()->setScaledPitch( pitch ); - sector_->avatar()->setScaledRoll( -roll ); - sector_->avatar()->setThrustPercent( thrust * 100. ); + sector_->avatarObject()->setScaledYaw( -yaw ); + sector_->avatarObject()->setScaledPitch( pitch ); + sector_->avatarObject()->setScaledRoll( -roll ); + sector_->avatarObject()->setThrustPercent( thrust * 100. ); } // if avatar } return true; @@ -634,9 +639,9 @@ bool UnDockedState::buttonPressed( const OIS::JoyStickEvent & e , int button){ if ( !configMode_ ){ // window_->setDebugText( "Joy: " + toStr( button ) ); - if ( sector_->avatar() != NULL ){ + if ( sector_->avatarObject() != NULL ){ if ( button == 0){ - sector_->avatar()->setFirePressed( true ); + sector_->avatarObject()->setFirePressed( true ); } } // if avatar_ } @@ -646,54 +651,58 @@ bool UnDockedState::buttonReleased( const OIS::JoyStickEvent & e , int button){ if ( !configMode_ ){ // window_->setDebugText( "Joy: " + toStr( button ) ); - if ( sector_->avatar() != NULL ){ + if ( sector_->avatarObject() != NULL ){ if ( button == 0){ - sector_->avatar()->setFirePressed( false ); + sector_->avatarObject()->setFirePressed( false ); } } // if avatar_ } return true; } -void UnDockedState::toggleNextCamera_(){ +void UnDockedState::toggleNextCamera_( int mode ){ int maxCameraModes = 4; //** circle through cameraModes; - cameraMode_ = (cameraMode_ + 1)%maxCameraModes; + if ( mode == -1 ){ + cameraMode_ = (cameraMode_ + 1)%maxCameraModes; + } else { + cameraMode_ = mode; + } switch ( cameraMode_ ){ case 0: //** free camera at orign mainCamera_->setPosition( Ogre::Vector3( 0, 0, 500 ) ); - if ( sector_->avatar() != NULL ){ - mainCamera_->setAutoTracking( false, sector_->avatar()->mainNode() ); - sector_->avatar()->setVisible( true ); + if ( sector_->avatarObject() != NULL ){ + mainCamera_->setAutoTracking( false, sector_->avatarObject()->mainNode() ); + sector_->avatarObject()->setVisible( true ); } break; case 1: //** first person avatar camera - if ( sector_->avatar() != NULL ){ - sector_->avatar()->setVisible( false ); + if ( sector_->avatarObject() != NULL ){ + sector_->avatarObject()->setVisible( false ); break; } case 2: //** avatar chase camera; - if ( sector_->avatar() != NULL ){ - sector_->avatar()->setVisible( true ); + if ( sector_->avatarObject() != NULL ){ + sector_->avatarObject()->setVisible( true ); break; } case 3: //** free avatar tracking-camera at orign mainCamera_->setPosition( Ogre::Vector3( 0, 0, 500 ) ); mainCamera_->lookAt( Ogre::Vector3( 0, 0, -300 ) ); - if ( sector_->avatar() != NULL ){ - mainCamera_->setAutoTracking( true, sector_->avatar()->mainNode() ); - sector_->avatar()->setVisible( true ); + if ( sector_->avatarObject() != NULL ){ + mainCamera_->setAutoTracking( true, sector_->avatarObject()->mainNode() ); + sector_->avatarObject()->setVisible( true ); } break; } } void UnDockedState::updateCamera_(){ - if ( sector_->avatar() != NULL ){ - Ogre::Vector3 avatarPos( sector_->avatar()->mainNode()->getPosition() ); + if ( sector_->avatarObject() != NULL ){ + Ogre::Vector3 avatarPos( sector_->avatarObject()->mainNode()->getPosition() ); Ogre::Vector3 targetPos( 0.0, 0.0, 0.0 ); if ( target_ != NULL ){ @@ -702,7 +711,7 @@ Ogre::Vector3 dist( targetPos - avatarPos ); Ogre::Vector3 distNorm( dist.normalisedCopy() ); - Ogre::Quaternion avatarOrient( sector_->avatar()->mainNode()->getOrientation() ); + Ogre::Quaternion avatarOrient( sector_->avatarObject()->mainNode()->getOrientation() ); secondCamera_->setOrientation( avatarOrient ); @@ -717,17 +726,17 @@ switch ( cameraMode_ ){ case 0: //** free camera at orign - mainCamera_->lookAt( sector_->avatar()->mainNode()->getPosition( ) ); + mainCamera_->lookAt( sector_->avatarObject()->mainNode()->getPosition( ) ); break; case 1: //** first person avatar camera mainCamera_->setPosition( avatarPos ); mainCamera_->setOrientation( avatarOrient ); - sector_->avatar()->setVisible( false ); + sector_->avatarObject()->setVisible( false ); break; case 2: //** avatar chase camera mainCamera_->setPosition( avatarPos + avatarOrient.zAxis() * 100 ); mainCamera_->setOrientation( avatarOrient ); - mainCamera_->yaw( Ogre::Degree(-90) ); + // mainCamera_->yaw( Ogre::Degree(-90) ); break; case 3: //** free avatar tracking-camera at orign break; @@ -767,24 +776,24 @@ Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/MainPanel/StatsTextArea" ) ->setCaption( "fps: " + toStr( stats.lastFPS ) + " ping: " + toStr( network_->pingTime() ) + " ms" ); - if ( sector_->avatar() != NULL ){ - if ( sector_->avatar()->flightArrow() ) { - if ( fabs( sector_->avatar()->velocity() ) > 1e-1 ){ - sector_->avatar()->flightArrow()->setVisible( true ); - sector_->avatar()->flightArrow()->setOrientation( sector_->avatar()->mainNode()->getOrientation() ); - sector_->avatar()->flightArrow()->setDirection( sector_->avatar()->flightDirection().normalisedCopy(), + if ( sector_->avatarObject() != NULL ){ + if ( sector_->avatarObject()->flightArrow() ) { + if ( fabs( sector_->avatarObject()->velocity() ) > 1e-1 ){ + sector_->avatarObject()->flightArrow()->setVisible( true ); + sector_->avatarObject()->flightArrow()->setOrientation( sector_->avatarObject()->mainNode()->getOrientation() ); + sector_->avatarObject()->flightArrow()->setDirection( sector_->avatarObject()->flightDirection().normalisedCopy(), Ogre::Node::TS_WORLD ); } else { - sector_->avatar()->flightArrow()->setVisible( false ); + sector_->avatarObject()->flightArrow()->setVisible( false ); } } if ( target_ != NULL ) { - Ogre::Vector3 distToTarget = target_->mainNode()->getPosition() - sector_->avatar()->mainNode()->getPosition(); - if ( sector_->avatar()->targetArrow() ) { - sector_->avatar()->targetArrow()->setVisible( true ); - sector_->avatar()->targetArrow()->setOrientation( sector_->avatar()->mainNode()->getOrientation() ); - sector_->avatar()->targetArrow()->setDirection( distToTarget.normalisedCopy(), Ogre::Node::TS_WORLD ); + Ogre::Vector3 distToTarget = target_->mainNode()->getPosition() - sector_->avatarObject()->mainNode()->getPosition(); + if ( sector_->avatarObject()->targetArrow() ) { + sector_->avatarObject()->targetArrow()->setVisible( true ); + sector_->avatarObject()->targetArrow()->setOrientation( sector_->avatarObject()->mainNode()->getOrientation() ); + sector_->avatarObject()->targetArrow()->setDirection( distToTarget.normalisedCopy(), Ogre::Node::TS_WORLD ); } //** Start update targeting pointer and duelist pointers; @@ -805,13 +814,13 @@ targetCurser_->hide(); } - Ogre::Real ammoTimeToTarget( distToTarget.length() / sector_->avatar()->ammoSpeed() ); + Ogre::Real ammoTimeToTarget( distToTarget.length() / sector_->avatarObject()->ammoSpeed() ); if ( duelistPilot_ ){ - Ogre::Vector3 duelistPilotPos( sector_->avatar()->mainNode()->getPosition() + - - sector_->avatar()->mainNode()->getOrientation().zAxis().normalisedCopy() - * sector_->avatar()->ammoSpeed() * ammoTimeToTarget + - sector_->avatar()->velDirection() * ammoTimeToTarget ); + Ogre::Vector3 duelistPilotPos( sector_->avatarObject()->mainNode()->getPosition() + + - sector_->avatarObject()->mainNode()->getOrientation().zAxis().normalisedCopy() + * sector_->avatarObject()->ammoSpeed() * ammoTimeToTarget + + sector_->avatarObject()->velDirection() * ammoTimeToTarget ); targetVisible = projectionPos_( mainCamera_, duelistPilotPos, targetScreenPos ); if ( targetVisible ){ @@ -858,7 +867,7 @@ dynamic_cast< SectorObjectMoveable *>( target_ )->velocity(), 6 ) ); targetShieldText_->setText( "S" + Ogre::StringConverter::toString( dynamic_cast< SectorObjectMoveable *>( target_ )->shieldPercent(), 4 ) ); - targetArmorText_->setText( "A" + Ogre::StringConverter::toString( + targetArmorText_->setText( "A" + Ogre::StringConverter::toString( dynamic_cast< SectorObjectMoveable *>( target_ )->armorPercent(), 4 ) ); } else{ @@ -867,37 +876,31 @@ targetArmorText_->setText( "" ); } } else { - if ( sector_->avatar()->targetArrow() ) sector_->avatar()->targetArrow()->setVisible( false ); + if ( sector_->avatarObject()->targetArrow() ) sector_->avatarObject()->targetArrow()->setVisible( false ); } - Ogre::Real height = sector_->avatar()->velocity() * velocityProgressHeight_ / sector_->avatar()->velocityMax(); + Ogre::Real height = sector_->avatarObject()->velocity() * velocityProgressHeight_ / sector_->avatarObject()->velocityMax(); velocityProgress_->setYPosition( CEGUI::UDim( 0.5, velocityProgressHeight_/2.0 - height ) ); velocityProgress_->setHeight( CEGUI::UDim( 0.0, height ) ); velocityProgressImg_->setYPosition( CEGUI::UDim( 0, -velocityProgressHeight_ + height ) ); - height = sector_->avatar()->capacity() * capacitorProgressHeight_ / sector_->avatar()->capacityMax(); + height = sector_->avatarObject()->capacity() * capacitorProgressHeight_ / sector_->avatarObject()->capacityMax(); capacitorProgress_->setYPosition( CEGUI::UDim( 0.5, capacitorProgressHeight_/2.0 - height ) ); capacitorProgress_->setHeight( CEGUI::UDim( 0.0, height ) ); capacitorProgressImg_->setYPosition( CEGUI::UDim( 0, -capacitorProgressHeight_ + height ) ); - height = sector_->avatar()->thrust() * thrustProgressHeight_ / sector_->avatar()->thrustMax(); + height = sector_->avatarObject()->thrust() * thrustProgressHeight_ / sector_->avatarObject()->thrustMax(); thrustProgress_->setYPosition( CEGUI::UDim( 0.5, thrustProgressHeight_/2.0 - height ) ); thrustProgress_->setHeight( CEGUI::UDim( 0.0, height ) ); thrustProgressImg_->setYPosition( CEGUI::UDim( 0, -thrustProgressHeight_ + height ) ); - velocityText_->setText( "V" + Ogre::StringConverter::toString( round( sector_->avatar()->velocity(), 2 ), 4 ) ); + velocityText_->setText( "V" + Ogre::StringConverter::toString( round( sector_->avatarObject()->velocity(), 2 ), 4 ) ); // conText_ = CEGUI::WindowManager::getSingleton().getWindow( "HUDConText" ); - shieldText_->setText( "S" + Ogre::StringConverter::toString( sector_->avatar()->shieldPercent(), 4 ) ); - armorText_->setText( "A" + Ogre::StringConverter::toString( sector_->avatar()->armorPercent(), 4 ) ); + shieldText_->setText( "S" + Ogre::StringConverter::toString( sector_->avatarObject()->shieldPercent(), 4 ) ); + armorText_->setText( "A" + Ogre::StringConverter::toString( sector_->avatarObject()->armorPercent(), 4 ) ); - - - - - - // OverlayElement* guiAvg = OverlayManager::getSingleton().getOverlayElement("Core/AverageFps"); // OverlayElement* guiCurr = OverlayManager::getSingleton().getOverlayElement("Core/CurrFps"); // OverlayElement* guiBest = OverlayManager::getSingleton().getOverlayElement("Core/BestFps"); @@ -922,8 +925,6 @@ void UnDockedState::updateRadar_( ){ - - // Overlay* pHUD = OverlayManager::getSingleton().getByName("HUD"); // OverlayContainer* pMinMapElement = pHUD->getChild("MiniMap"); // Overlay* pMiniMapDots = OverlayManager::getSingleton().getByName("MiniMapDots"); @@ -941,23 +942,22 @@ } void UnDockedState::avatarDeathSequence( bool on ){ - if ( sector_->avatar() != NULL ){ + if ( sector_->avatarObject() != NULL ){ if ( on ){ - deathSequence_ = true; cameraMode_ = 0; - mainCamera_->setOrientation( sector_->avatar()->mainNode()->getOrientation() ); - mainCamera_->setPosition( sector_->avatar()->mainNode()->getOrientation().zAxis() * 100.0 ); + mainCamera_->setOrientation( sector_->avatarObject()->mainNode()->getOrientation() ); + mainCamera_->setPosition( sector_->avatarObject()->mainNode()->getOrientation().zAxis() * 50.0 ); + Ogre::OverlayManager::getSingleton().getByName( "Radar" )->hide(); + overlayRootWindow_->hide(); hudOverlay_->hide(); } else { - deathSequence_ = false; - cameraMode_ = 1; - hudOverlay_->show(); + enterDockedState_ = true; } } // if avatar } bool UnDockedState::renderSpaceDust(){ -// if ( sector_->avatar() != NULL ){ +// if ( sector_->avatarObject() != NULL ){ // const Ogre::Real maxDist = 250.0; // const Ogre::Real mirrorDist = maxDist*0.99; // const Ogre::Real dimFactor = 0.8*0.005*0.005; Modified: branches/ogsector/src/UnDockedState.h =================================================================== --- branches/ogsector/src/UnDockedState.h 2007-05-23 21:24:50 UTC (rev 508) +++ branches/ogsector/src/UnDockedState.h 2007-05-26 20:09:35 UTC (rev 509) @@ -92,7 +92,7 @@ inline bool handleMinimiseConsole( const CEGUI::EventArgs & e ){ minimiseConsole(); return true; } inline bool handleConfigBackButton( const CEGUI::EventArgs & e ){ return switchConfigDialog( ); } - void toggleNextCamera_( ); + void toggleNextCamera_( int mode = -1 ); void updateCamera_( ); void updateHUD_( ); void updateRadar_( ); @@ -174,7 +174,8 @@ Ogre::ParticleSystem * spaceDustParticleSystem_; - bool deathSequence_; + bool enterDockedState_; + double timeSinceLastSectorUpdate_; double timeSinceLastNetworkUpdate_; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2007-05-26 20:14:56
|
Revision: 510 http://svn.sourceforge.net/opengate/?rev=510&view=rev Author: spom_spom Date: 2007-05-26 13:14:58 -0700 (Sat, 26 May 2007) Log Message: ----------- forgot files Added Paths: ----------- branches/ogsector/src/Avatar.cpp branches/ogsector/src/Avatar.h Added: branches/ogsector/src/Avatar.cpp =================================================================== --- branches/ogsector/src/Avatar.cpp (rev 0) +++ branches/ogsector/src/Avatar.cpp 2007-05-26 20:14:58 UTC (rev 510) @@ -0,0 +1,34 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "Avatar.h" +#include "VesselManager.h" + +namespace OpenGate{ + +Avatar::Avatar( const std::string & name, int ID ): name_( name ), id_( ID ) { + vessel_ = VesselManager::getSingleton().vessel( "apteryx" ); +} + +Avatar::~Avatar( ){ +} + +} // namespace OpenGate{ + Added: branches/ogsector/src/Avatar.h =================================================================== --- branches/ogsector/src/Avatar.h (rev 0) +++ branches/ogsector/src/Avatar.h 2007-05-26 20:14:58 UTC (rev 510) @@ -0,0 +1,57 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef _OPENGATE_AVATAR__H +#define _OPENGATE_AVATAR__H + +#include <string> + +namespace OpenGate{ + +class Vessel; + +//! +/*! */ +class Avatar{ +public: + Avatar( const std::string & name, int id ); + + ~Avatar( ); + + std::string name() const { return name_; } + + int userID() const { return id_; } + + void setVessel( Vessel & vessel ){ vessel_ = &vessel; } + + Vessel & vessel() { return *vessel_; } + + +protected: + std::string name_; + int id_; + + Vessel * vessel_; +}; + +} // namespace OpenGate{ + + +#endif // _OPENGATE_AVATAR__H This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2007-05-27 14:33:38
|
Revision: 512 http://svn.sourceforge.net/opengate/?rev=512&view=rev Author: spom_spom Date: 2007-05-27 07:33:40 -0700 (Sun, 27 May 2007) Log Message: ----------- Fixed some network glitches Modified Paths: -------------- branches/ogsector/src/DockedState.cpp branches/ogsector/src/DockedState.h branches/ogsector/src/GameStateManager.cpp branches/ogsector/src/Sector.cpp branches/ogsector/src/Sector.h branches/ogsector/src/SectorObjects.cpp branches/ogsector/src/SectorObjects.h branches/ogsector/src/UnDockedState.cpp branches/ogsector/src/common.cpp branches/ogsector/src/common.h branches/ogsector/src/networkServer.cpp Modified: branches/ogsector/src/DockedState.cpp =================================================================== --- branches/ogsector/src/DockedState.cpp 2007-05-26 20:22:37 UTC (rev 511) +++ branches/ogsector/src/DockedState.cpp 2007-05-27 14:33:40 UTC (rev 512) @@ -52,7 +52,6 @@ } void DockedState::createContent(){ - sceneMgr_ = devices_->ogreRoot->createSceneManager( Ogre::ST_GENERIC, "DockedSceneManagerInstance" ); Ogre::Camera * camera = sceneMgr_->createCamera( "StationCamera" ); @@ -103,6 +102,7 @@ } void DockedState::enter( ) { + launchUndockedState_ = false; log_->info("Entering dockstate"); devices_->guiRenderer->setTargetSceneManager( sceneMgr_ ); devices_->guiSystem->setGUISheet( overlayRootWindow_ ); @@ -142,6 +142,8 @@ } bool DockedState::frameEnded( const Ogre::FrameEvent & evt ){ + // if ( launchUndockedState_ ) parent_->start( parent_->findByName( "UnDockedState" ) ); + return true; } @@ -157,6 +159,11 @@ } } + if ( e.key == OIS::KC_F4 ){ + parent_->start( parent_->findByName( "UnDockedState" ) ); + return true; + } + if ( e.key == OIS::KC_RETURN) { CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"ConsoleEdit")->activate(); } Modified: branches/ogsector/src/DockedState.h =================================================================== --- branches/ogsector/src/DockedState.h 2007-05-26 20:22:37 UTC (rev 511) +++ branches/ogsector/src/DockedState.h 2007-05-27 14:33:40 UTC (rev 512) @@ -97,6 +97,7 @@ ShipConfigDialog * shipConfigDialog_; bool consoleMax_; + bool launchUndockedState_; }; } // namespace OpenGate Modified: branches/ogsector/src/GameStateManager.cpp =================================================================== --- branches/ogsector/src/GameStateManager.cpp 2007-05-26 20:22:37 UTC (rev 511) +++ branches/ogsector/src/GameStateManager.cpp 2007-05-27 14:33:40 UTC (rev 512) @@ -135,7 +135,6 @@ } } - void GameStateManager::manageGameState( const std::string & stateName, GameState * state ){ StateInfo newStateInfo; newStateInfo.name = stateName; Modified: branches/ogsector/src/Sector.cpp =================================================================== --- branches/ogsector/src/Sector.cpp 2007-05-26 20:22:37 UTC (rev 511) +++ branches/ogsector/src/Sector.cpp 2007-05-27 14:33:40 UTC (rev 512) @@ -49,7 +49,7 @@ : sceneMgr_( sceneMgr ), network_( network ) { log_ = LogManager::getSingletonPtr(); - bool radar_ = true; + radar_ = true; sectorname_ = "Testsector"; planetNode_ = NULL; starsNode_ = NULL; @@ -222,7 +222,7 @@ delete *it; sectorObjects_.erase( (*it++) ); - + // log_->info( "done: " ); } @@ -295,7 +295,7 @@ Ogre::OverlayElement * dotB = (*it)->dotB(); if ( relativPosition.length() < radarRange ){ - + Ogre::Quaternion q; q.FromAngleAxis( -avatar_->mainNode()->getOrientation( ).getYaw(), Ogre::Vector3::UNIT_Y); relativPosition = q * relativPosition; @@ -346,9 +346,9 @@ } it++; } else { //** died object is not avatar; -// log_->info( "Destructing: " + it->second->name() ); -// destructMoveableObject( (it++)->second ); -// log_->info( "done: " ); + log_->info( "Destructing: " + it->second->name() ); + destructMoveableObject( (it++)->second ); + log_->info( "done: " ); } } else ++it; } @@ -393,7 +393,6 @@ movableObjects_.erase( obj->globalID() ); delete obj; obj = NULL; - break; case SECTOROBJECTMOVABLE_AI_RTTI: { if ( dynamic_cast< SectorObjectMoveableAi *>( obj )->target() == avatar_ ) sendVesselDeRegister( obj ); @@ -620,7 +619,7 @@ void Sector::sendVesselRegister( SectorObjectMoveable * obj ){ if ( obj ) { - log_->info( std::string( "Send register " ) + obj->name() ); + log_->info( std::string( "Send register " ) + obj->name() + " id:" + toStr( obj->vesselBluePrint()->id() ) ); MessageBodyShipRegister msg( obj->userID(), obj->childID(), obj->name(), obj->mainNode()->getPosition(), obj->vesselBluePrint()->id() ); network_->send( msg ); Modified: branches/ogsector/src/Sector.h =================================================================== --- branches/ogsector/src/Sector.h 2007-05-26 20:22:37 UTC (rev 511) +++ branches/ogsector/src/Sector.h 2007-05-27 14:33:40 UTC (rev 512) @@ -77,6 +77,8 @@ void selectNextTarget( SectorObject * obj = NULL ); void selectPrevTarget( SectorObject * obj = NULL ); + inline SectorObject * firstTarget( ){ return *itTarget_; } + SectorObject * nextTarget( ); SectorObject * prevTarget( ); Modified: branches/ogsector/src/SectorObjects.cpp =================================================================== --- branches/ogsector/src/SectorObjects.cpp 2007-05-26 20:22:37 UTC (rev 511) +++ branches/ogsector/src/SectorObjects.cpp 2007-05-27 14:33:40 UTC (rev 512) @@ -246,9 +246,12 @@ setShape( vesselBluePrint_->meshPtr()->getName() ); + LogManager::getSingleton().info( "Create " + name + " with " + vesselBluePrint_->name() ); + baseYaw( Ogre::Degree( vesselBluePrint_->baseYaw() ) ); setBaseSize( vesselBluePrint_->baseSize() ); + if ( vesselBluePrint_->factionName() == "squadrok" ){ thrusterParticles_ = NULL; @@ -518,7 +521,9 @@ roll_ = 0; pitch_ = 0; - armor_ = vesselBluePrint_->armor(); + armorMax_ = vesselBluePrint_->armor(); + armor_ = armorMax_; + //** omnus shieldMax_ = 5700.0; shield_ = shieldMax_; Modified: branches/ogsector/src/SectorObjects.h =================================================================== --- branches/ogsector/src/SectorObjects.h 2007-05-26 20:22:37 UTC (rev 511) +++ branches/ogsector/src/SectorObjects.h 2007-05-27 14:33:40 UTC (rev 512) @@ -224,6 +224,7 @@ firePressed_ = fireStatus; } inline bool firePressed( ) const { return firePressed_; } + inline Ogre::Real ammoSpeed() const { return ammoSpeed_; } inline void setAfterburnerPressed( bool afterburnerStatus ){ if ( afterburnerStatus != afterburnerPressed_ ) statusChanged_ = true; @@ -251,38 +252,33 @@ } inline Ogre::Real thrustMax( ) const { return maxThrust_; } - inline void setArmorPercent( Ogre::Real armor ) { armor_ = min( (double)vesselBluePrint_->armor(), - vesselBluePrint_->armor() * armor/100.0 ); } - inline Ogre::Real armorPercent() const { return round( 100.0 * armor_ / vesselBluePrint_->armor(), 1 ); } - - inline void setShieldPercent( Ogre::Real shield ) { shield_ = min( (double)shieldMax_, shieldMax_ * shield / 100.0 ); } - inline Ogre::Real shieldPercent() const { - if ( shieldMax_ > 0 ) return round( 100.0 * shield_ / shieldMax_, 1 ); else return 0.0; - } - Ogre::Vector3 flightDirection() const { Ogre::Vector3 flightDir( vel_ ); flightDir.normalise(); return flightDir; } - Ogre::Real ammoSpeed() const { return ammoSpeed_; } - - Ogre::Vector3 velDirection() const { return vel_; } - Ogre::Real velocity() const { return vel_.length(); } - Ogre::Real velocityMax() const { return sqrt( thrustMax() / vesselBluePrint_->dragFactor() ); } - void setVelocity( const Ogre::Vector3 & vel ) { vel_ = vel; } Ogre::Real capacity() const { return capacity_; } - Ogre::Real capacityMax() const { return capacityMax_; } - Ogre::Real acceleration() const { return acc_.length(); } + inline void setShieldPercent( Ogre::Real shield ) { shield_ = min( (double)shieldMax_, shieldMax_ * shield / 100.0 ); } + inline Ogre::Real shield() const { return shield_; } + inline Ogre::Real shieldMax() const { return shieldMax_; } + inline Ogre::Real shieldPercent() const { + if ( shieldMax_ > 0 ) return round( 100.0 * shield_ / shieldMax_, 1 ); else return 0.0; } + inline void setArmorPercent( Ogre::Real armor ) { armor_ = min( armorMax_, armorMax_ * armor / 100.0f ); } + inline Ogre::Real armor() const { return armor_; } + inline Ogre::Real armorMax() const { return armorMax_; } + inline Ogre::Real armorPercent() const { + if ( armorMax_ > 0 ) return round( 100.0 * armor_ / armorMax_, 1 ); else return 0.0; } + Ogre::Real acceleration() const { return acc_.length(); } + void fire( Ogre::Real elapsedTime ); virtual bool deathSequence( Ogre::Real elapsedTime ); @@ -308,6 +304,7 @@ Ogre::Real acceleration_; Ogre::Real ethernalDensity_; + Ogre::Real armorMax_; Ogre::Real armor_; Ogre::Real shieldMax_; Ogre::Real shield_; Modified: branches/ogsector/src/UnDockedState.cpp =================================================================== --- branches/ogsector/src/UnDockedState.cpp 2007-05-26 20:22:37 UTC (rev 511) +++ branches/ogsector/src/UnDockedState.cpp 2007-05-27 14:33:40 UTC (rev 512) @@ -133,21 +133,18 @@ flightCurserHalfWidth_ = 10; flightCurserHalfHeight_ = 10; - sector_ = new Sector( sceneMgr_, network_ ); - sector_->setListener( this ); - } void UnDockedState::destroyContent( ){ - delete sector_; sceneMgr_->destroyAllCameras(); if ( overlayRootWindow_ ) CEGUI::WindowManager::getSingleton().destroyWindow( overlayRootWindow_ ); } void UnDockedState::enter(){ log_->info("Entering undockstate"); + sector_ = new Sector( sceneMgr_, network_ ); + sector_->setListener( this ); - devices_->guiRenderer->setTargetSceneManager( sceneMgr_ ); if ( overlayRootWindow_ ){ devices_->guiSystem->setGUISheet( overlayRootWindow_ ); @@ -187,7 +184,7 @@ Ogre::OverlayManager::getSingleton().getByName( "Radar" )->show(); sceneDetailIndex_ = 0; - target_ = sector_->nextTarget(); + target_ = sector_->firstTarget(); chatMode_ = false; duelistPilot_ = false; duelistTarget_ = false; @@ -248,10 +245,36 @@ CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&UnDockedState::handleConfigBackButton, this ) ) ; toggleNextCamera_( 1 ); + + //** start update SceneManager, if not set this leeds to strange behaviour by switching states + //** opengateclient: OgreRenderQueueSortingGrouping.cpp:355: void Ogre::QueuedRenderableCollection::addRenderable(Ogre::Pass*, Ogre::Renderable*): Assertion `retPair.second && "Error inserting new pass entry into PassGroupRenderableMap"' failed. + + if ( devices_->ogreRoot && (Ogre::Pass::getDirtyHashList().size()!=0 || Ogre::Pass::getPassGraveyard().size()!=0)) { + Ogre::SceneManagerEnumerator::SceneManagerIterator scenesIter = devices_->ogreRoot->getSceneManagerIterator(); + + while ( scenesIter.hasMoreElements() ) { + Ogre::SceneManager * pScene = scenesIter.getNext(); + if ( pScene ){ + Ogre::RenderQueue * pQueue = pScene->getRenderQueue(); + if ( pQueue ) { + Ogre::RenderQueue::QueueGroupIterator groupIter = pQueue->_getQueueGroupIterator(); + while ( groupIter.hasMoreElements() ) { + Ogre::RenderQueueGroup * pGroup = groupIter.getNext(); + if ( pGroup ) pGroup->clear( false ); + }//end_while(groupIter.hasMoreElements()) + }//end_if(pScene) + }//end_if(pScene) + }//end_while(scenesIter.hasMoreElements()) + + // Now trigger the pending pass updates + Ogre::Pass::processPendingPassUpdates(); + }//end_if(m_Root.. + //** end update SceneManager } void UnDockedState::exit(){ log_->info("Exiting undockstate"); + // std::cout << "start: " << dumpSceneNodes( sceneMgr_->getRootSceneNode() ) << std::endl; sector_->destructAvatarObject( ); CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"Config/BackButton" )->removeEvent( @@ -269,6 +292,9 @@ devices_->inputManager->removeKeyListener( "SectorClientKeyListener" ); devices_->inputManager->removeMouseListener( "SectorClientMouseListener" ); devices_->inputManager->removeJoystickListener( "SectorClientJoystickListener" ); + + delete sector_; + // std::cout << "End: " << dumpSceneNodes( sceneMgr_->getRootSceneNode() ) << std::endl; } bool UnDockedState::switchConfigDialog( ){ @@ -318,8 +344,6 @@ timeSinceLastNetworkUpdate_ = 0.0; } - - //** update my camera; updateCamera_(); updateHUD_(); @@ -894,7 +918,18 @@ thrustProgress_->setHeight( CEGUI::UDim( 0.0, height ) ); thrustProgressImg_->setYPosition( CEGUI::UDim( 0, -thrustProgressHeight_ + height ) ); + height = sector_->avatarObject()->shield() * shieldProgressHeight_ / sector_->avatarObject()->shieldMax(); + shieldProgress_->setYPosition( CEGUI::UDim( 0.5, - height + height/2.0 ) ); + shieldProgress_->setHeight( CEGUI::UDim( 0.0, height ) ); + shieldProgressLeftImg_->setYPosition( CEGUI::UDim( 0.5, -shieldProgressHeight_/2.0 ) ); + shieldProgressRightImg_->setYPosition( CEGUI::UDim( 0.5, -shieldProgressHeight_/2.0 ) ); + height = sector_->avatarObject()->armor() * armorProgressHeight_ / sector_->avatarObject()->armorMax(); + armorProgress_->setYPosition( CEGUI::UDim( 0.5, - height + height/2.0 ) ); + armorProgress_->setHeight( CEGUI::UDim( 0.0, height ) ); + armorProgressLeftImg_->setYPosition( CEGUI::UDim( 0.5, -armorProgressHeight_/2.0 ) ); + armorProgressRightImg_->setYPosition( CEGUI::UDim( 0.5, -armorProgressHeight_/2.0 ) ); + velocityText_->setText( "V" + Ogre::StringConverter::toString( round( sector_->avatarObject()->velocity(), 2 ), 4 ) ); // conText_ = CEGUI::WindowManager::getSingleton().getWindow( "HUDConText" ); shieldText_->setText( "S" + Ogre::StringConverter::toString( sector_->avatarObject()->shieldPercent(), 4 ) ); Modified: branches/ogsector/src/common.cpp =================================================================== --- branches/ogsector/src/common.cpp 2007-05-26 20:22:37 UTC (rev 511) +++ branches/ogsector/src/common.cpp 2007-05-27 14:33:40 UTC (rev 512) @@ -19,6 +19,8 @@ ***************************************************************************/ #include "common.h" +#include <OgreSceneNode.h> +#include <OgreMovableObject.h> long createGlobalID( int userId, int childId ) { return childId * MAXUSERID + userId; } @@ -37,3 +39,32 @@ while ( is >> tmp ) subStrings.push_back( tmp ); return subStrings; } + +void dumpSceneNodes( std::stringstream & ss, Ogre::Node * n, int level ) { + for ( int i = 0; i < level; i++ ) { + ss << " "; + } + ss << "SceneNode: " << n->getName() << std::endl; + + Ogre::SceneNode::ObjectIterator object_it = ((Ogre::SceneNode *)n)->getAttachedObjectIterator(); + Ogre::Node::ChildNodeIterator node_it = n->getChildIterator(); + + Ogre::MovableObject *m; + while ( object_it.hasMoreElements() ){ + for ( int i = 0; i < level + 2; i++ ) { + ss << " "; + } + m = object_it.getNext(); + ss << m->getMovableType() << ": " << m->getName() << std::endl; + } + while ( node_it.hasMoreElements() ) { + dumpSceneNodes( ss, node_it.getNext(), level + 2 ); + } +} + +std::string dumpSceneNodes( Ogre::Node * n ) { + std::stringstream ss; + ss << std::endl << "Node Hierarchy:" << std::endl; + dumpSceneNodes( ss, n, 0 ); + return ss.str(); +} Modified: branches/ogsector/src/common.h =================================================================== --- branches/ogsector/src/common.h 2007-05-26 20:22:37 UTC (rev 511) +++ branches/ogsector/src/common.h 2007-05-27 14:33:40 UTC (rev 512) @@ -42,6 +42,10 @@ #include <string> #include <cmath> +namespace Ogre{ +class Node; +} + #ifdef WIN32 #define PATHSEPARATOR "\\" #include <windows.h> @@ -131,4 +135,10 @@ */ void myMSleep( int s ); +/*! For debugging purposes dump scene node tree to a string */ +void dumpSceneNodes( std::stringstream & ss, Ogre::Node * n, int level ); + +/*! For debugging purposes dump scene node tree to a string */ +std::string dumpSceneNodes( Ogre::Node * n ); + #endif // _OPENGATE_COMMON__H Modified: branches/ogsector/src/networkServer.cpp =================================================================== --- branches/ogsector/src/networkServer.cpp 2007-05-26 20:22:37 UTC (rev 511) +++ branches/ogsector/src/networkServer.cpp 2007-05-27 14:33:40 UTC (rev 512) @@ -222,7 +222,8 @@ void Server::receiveShipDeRegister( UserSession * user, const MessageBodyShipDeRegister & msg ){ if ( userObjects_.count( createGlobalID( user->userID(), msg.childID() ) ) ){ - deRegisterUserObject( userObjects_[ createGlobalID( user->userID(), msg.childID() ) ] ); + destroyUserObject( userObjects_[ createGlobalID( user->userID(), msg.childID() ) ] ); + // deRegisterUserObject( userObjects_[ createGlobalID( user->userID(), msg.childID() ) ] ); } else { log_->warn( std::string( "Deregistering request for unknown object: " ) + toStr( user->userName() ) + ": " + toStr( msg.childID() ) + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2007-06-12 19:49:23
|
Revision: 553 http://svn.sourceforge.net/opengate/?rev=553&view=rev Author: spom_spom Date: 2007-06-12 12:49:24 -0700 (Tue, 12 Jun 2007) Log Message: ----------- Clear the code a bit to remove annoying warnings Modified Paths: -------------- branches/ogsector/src/Avatar.cpp branches/ogsector/src/BaseDialog.cpp branches/ogsector/src/ConfigDialog.cpp branches/ogsector/src/Console.cpp branches/ogsector/src/EntityManager.cpp branches/ogsector/src/EntityManager.h branches/ogsector/src/Makefile.am branches/ogsector/src/Makefile.in branches/ogsector/src/MarketDialog.cpp branches/ogsector/src/Sector.cpp branches/ogsector/src/Sector.h branches/ogsector/src/SectorObjects.cpp branches/ogsector/src/SectorObjects.h branches/ogsector/src/ShipConfigDialog.cpp branches/ogsector/src/networkServer.cpp branches/ogsector/src/openALSoundManager.cpp Added Paths: ----------- branches/ogsector/src/OpcodeWrapper.cpp branches/ogsector/src/OpcodeWrapper.h Modified: branches/ogsector/src/Avatar.cpp =================================================================== --- branches/ogsector/src/Avatar.cpp 2007-06-12 17:12:12 UTC (rev 552) +++ branches/ogsector/src/Avatar.cpp 2007-06-12 19:49:24 UTC (rev 553) @@ -104,6 +104,9 @@ case CAPACITOR: if ( vessel_->setCapacitor( dynamic_cast< Capacitor * >(item) ) ){ delCargoToFloor( items ); return true; } break; + default: + return false; + break; } return false; } @@ -123,6 +126,7 @@ break; case CAPACITOR: vessel_->setCapacitor( NULL ); break; + default: break; } std::vector < Entity * > items; items.push_back( item ); Modified: branches/ogsector/src/BaseDialog.cpp =================================================================== --- branches/ogsector/src/BaseDialog.cpp 2007-06-12 17:12:12 UTC (rev 552) +++ branches/ogsector/src/BaseDialog.cpp 2007-06-12 19:49:24 UTC (rev 553) @@ -30,7 +30,7 @@ void renameClonedWindows( const CEGUI::Window * parent, const CEGUI::String & namePrefix) { // std::cout << parent->getName() << ": " << parent->getChildCount() << std::endl; - for ( int i = 0; i < parent->getChildCount(); i ++ ){ + for ( unsigned int i = 0; i < parent->getChildCount(); i ++ ){ // std::cout << i << "accessing: "<< parent->getName() << std::endl; CEGUI::Window * child = parent->getChildAtIdx( i ); child->rename( namePrefix + child->getName() ); Modified: branches/ogsector/src/ConfigDialog.cpp =================================================================== --- branches/ogsector/src/ConfigDialog.cpp 2007-06-12 17:12:12 UTC (rev 552) +++ branches/ogsector/src/ConfigDialog.cpp 2007-06-12 19:49:24 UTC (rev 553) @@ -42,6 +42,7 @@ bool ConfigDialog::handleQuitButton( const CEGUI::EventArgs & e ){ devices_->gameStateRoot->shutdown(); + return true; } } // namespace OpenGate Modified: branches/ogsector/src/Console.cpp =================================================================== --- branches/ogsector/src/Console.cpp 2007-06-12 17:12:12 UTC (rev 552) +++ branches/ogsector/src/Console.cpp 2007-06-12 19:49:24 UTC (rev 553) @@ -152,7 +152,7 @@ for ( int i = 0; i < ceil( t.size()/consoleLineLength_ )+1; i ++ ){ int count = consoleLineLength_; - if ( i*consoleLineLength_ + count > t.size() ){ count = -1; } + if ( i * consoleLineLength_ + count > (int)t.size() ){ count = -1; } CEGUI::String text( t, i*consoleLineLength_, count ); CEGUI::ListboxTextItem * item = new CEGUI::ListboxTextItem( text ); Modified: branches/ogsector/src/EntityManager.cpp =================================================================== --- branches/ogsector/src/EntityManager.cpp 2007-06-12 17:12:12 UTC (rev 552) +++ branches/ogsector/src/EntityManager.cpp 2007-06-12 19:49:24 UTC (rev 553) @@ -40,7 +40,7 @@ Ogre::FileSystemArchive * pArch = new Ogre::FileSystemArchive( (*resourcePaths.begin()) + "/" + resourceName, "FileSystem" ); Ogre::StringVectorPtr files = pArch->find( "*.xml", true, false); - for ( int i = 0; i < (*files).size(); i ++ ){ + for ( unsigned int i = 0; i < (*files).size(); i ++ ){ log_->info( std::string( "Found ressource: " ) + (*files)[ i ] ); loadAndCreate( (*resourcePaths.begin()) + "/" + resourceName + "/" + (*files)[ i ] ); } Modified: branches/ogsector/src/EntityManager.h =================================================================== --- branches/ogsector/src/EntityManager.h 2007-06-12 17:12:12 UTC (rev 552) +++ branches/ogsector/src/EntityManager.h 2007-06-12 19:49:24 UTC (rev 553) @@ -131,7 +131,7 @@ virtual Entity * loadAndCreate( const std::string & filename ); std::vector < Entity * > allByCategory( const std::string & category ){ - EntityType rtti; + EntityType rtti = NONE; if ( category != "All" ) rtti = categoryType( category ); std::vector < Entity * > items; for ( std::map < std::string, Entity * >::iterator it = templatesByName_.begin(); it != templatesByName_.end(); it ++ ){ Modified: branches/ogsector/src/Makefile.am =================================================================== --- branches/ogsector/src/Makefile.am 2007-06-12 17:12:12 UTC (rev 552) +++ branches/ogsector/src/Makefile.am 2007-06-12 19:49:24 UTC (rev 553) @@ -40,6 +40,8 @@ LogManager.cpp \ MarketDialog.h \ MarketDialog.cpp \ + OpcodeWrapper.h \ + OpcodeWrapper.cpp \ Sector.h \ Sector.cpp \ SectorObjects.h \ Modified: branches/ogsector/src/Makefile.in =================================================================== --- branches/ogsector/src/Makefile.in 2007-06-12 17:12:12 UTC (rev 552) +++ branches/ogsector/src/Makefile.in 2007-06-12 19:49:24 UTC (rev 553) @@ -56,10 +56,10 @@ DockedState.$(OBJEXT) Entity.$(OBJEXT) EntityManager.$(OBJEXT) \ GameState.$(OBJEXT) GameStateManager.$(OBJEXT) \ InputManager.$(OBJEXT) LogManager.$(OBJEXT) \ - MarketDialog.$(OBJEXT) Sector.$(OBJEXT) \ - SectorObjects.$(OBJEXT) ShipConfigDialog.$(OBJEXT) \ - UnDockedState.$(OBJEXT) Vessel.$(OBJEXT) \ - VesselManager.$(OBJEXT) + MarketDialog.$(OBJEXT) OpcodeWrapper.$(OBJEXT) \ + Sector.$(OBJEXT) SectorObjects.$(OBJEXT) \ + ShipConfigDialog.$(OBJEXT) UnDockedState.$(OBJEXT) \ + Vessel.$(OBJEXT) VesselManager.$(OBJEXT) opengateclient_OBJECTS = $(am_opengateclient_OBJECTS) opengateclient_LDADD = $(LDADD) am_opengateserver_OBJECTS = opengateserver.$(OBJEXT) common.$(OBJEXT) \ @@ -219,6 +219,8 @@ LogManager.cpp \ MarketDialog.h \ MarketDialog.cpp \ + OpcodeWrapper.h \ + OpcodeWrapper.cpp \ Sector.h \ Sector.cpp \ SectorObjects.h \ @@ -337,6 +339,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/InputManager.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LogManager.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MarketDialog.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OpcodeWrapper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Sector.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SectorObjects.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ShipConfigDialog.Po@am__quote@ Modified: branches/ogsector/src/MarketDialog.cpp =================================================================== --- branches/ogsector/src/MarketDialog.cpp 2007-06-12 17:12:12 UTC (rev 552) +++ branches/ogsector/src/MarketDialog.cpp 2007-06-12 19:49:24 UTC (rev 553) @@ -135,13 +135,13 @@ CEGUI::PushButton::EventClicked, MarketDialog::handleMarketItemChangeAmount ); - for ( int i = 0; i < marketItems_.size(); i ++ ){ + for ( unsigned int i = 0; i < marketItems_.size(); i ++ ){ BIND_CEGUI_EVENT( marketItems_[ i ], CEGUI::Window::EventMouseEnters, MarketDialog::handleMarketItemMouseEnters ); BIND_CEGUI_EVENT( marketItems_[ i ], CEGUI::Window::EventMouseLeaves, MarketDialog::handleMarketItemMouseLeaves ); BIND_CEGUI_EVENT( marketItems_[ i ], CEGUI::Window::EventMouseClick, MarketDialog::handleMarketItemClicked ); } - for ( int i = 0; i < inventItems_.size(); i ++ ){ + for ( unsigned int i = 0; i < inventItems_.size(); i ++ ){ BIND_CEGUI_EVENT( inventItems_[ i ], CEGUI::Window::EventMouseEnters, MarketDialog::handleMarketItemMouseEnters ); BIND_CEGUI_EVENT( inventItems_[ i ], CEGUI::Window::EventMouseLeaves, MarketDialog::handleMarketItemMouseLeaves ); BIND_CEGUI_EVENT( inventItems_[ i ], CEGUI::Window::EventMouseClick, MarketDialog::handleInventItemClicked ); @@ -207,8 +207,8 @@ for ( int i = 0; i < marketItemWindowRow_; i ++ ){ for ( int j = 0; j < marketItemWindowCol_; j ++ ){ - int widgetCount = i * marketItemWindowCol_ + j; - int itemCount = ( i + marketOffsetRow_ ) * marketItemWindowCol_ + j; + unsigned int widgetCount = i * marketItemWindowCol_ + j; + unsigned int itemCount = ( i + marketOffsetRow_ ) * marketItemWindowCol_ + j; if ( itemCount >= items.size() ) { fillShortItemWindow( marketItems_[ widgetCount ] ); @@ -423,7 +423,7 @@ int lineLength = 130; for ( int i = 0; i < ceil( t.size()/lineLength )+1; i ++ ){ int count = lineLength; - if ( i * lineLength + count > t.size() ){ count = -1; } + if ( i * lineLength + count > (int)t.size() ){ count = -1; } CEGUI::String text( t, i * lineLength, count ); outText += text; if ( count != -1 ) outText += '\n'; @@ -447,6 +447,7 @@ CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"ItemDescription/Mass/Label")->hide(); CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"ItemDescription/Text")->hide(); } + return true; } bool MarketDialog::handleMarketItemClicked( const CEGUI::EventArgs & e ){ @@ -572,10 +573,11 @@ str3a = "Recharge:" ; str3b = toStr( dynamic_cast< Shield *>(item)->regenerationRate() / 1000) + "K"; break; case CAPACITOR: - str1a = "Efficiency:" ; str1b = toStr( dynamic_cast< Capacitor *>(item)->efficiency() ); - str2a = "Max. Power:" ; str2b = toStr( dynamic_cast< Capacitor *>(item)->capacity() ); + "K"; + str1a = "Efficiency:" ; str1b = toStr( dynamic_cast< Capacitor *>( item )->efficiency() ); + str2a = "Max. Power:" ; str2b = toStr( dynamic_cast< Capacitor *>( item )->capacity() ) + "K"; break; - + default: + break; } CEGUI::WindowManager::getSingleton().getWindow( "MarketItemDetailedView/EquipmentSpecs1a" )->setProperty( "Text", str1a ); @@ -685,6 +687,7 @@ bool MarketDialog::handeMainWindowShown( const CEGUI::EventArgs & e ){ updateMarketView(); updateInventView(); + return true; } Added: branches/ogsector/src/OpcodeWrapper.cpp =================================================================== --- branches/ogsector/src/OpcodeWrapper.cpp (rev 0) +++ branches/ogsector/src/OpcodeWrapper.cpp 2007-06-12 19:49:24 UTC (rev 553) @@ -0,0 +1,134 @@ + +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "OpcodeWrapper.h" +#include "SectorObjects.h" + +#include <OgreOpcode.h> + +namespace OpenGate{ + +template<> OpcodeCollisionDetection * Ogre::Singleton< OpcodeCollisionDetection >::ms_Singleton = 0; + +OpcodeCollisionDetection::OpcodeCollisionDetection( Ogre::SceneManager * sceneMgr ){ + + new OgreOpcode::CollisionManager( sceneMgr ); + + OgreOpcode::CollisionManager::getSingletonPtr()->addCollClass( "SectorObject" ); + OgreOpcode::CollisionManager::getSingletonPtr()->addCollClass( "Bullet" ); + + OgreOpcode::CollisionManager::getSingletonPtr()->addCollType( "Bullet", "Bullet", OgreOpcode::COLLTYPE_IGNORE ); + OgreOpcode::CollisionManager::getSingletonPtr()->addCollType( "SectorObject", "Bullet", OgreOpcode::COLLTYPE_EXACT ); + OgreOpcode::CollisionManager::getSingletonPtr()->addCollType( "SectorObject", "SectorObject", OgreOpcode::COLLTYPE_CONTACT ); + // OgreOpcode::CollisionManager::getSingletonPtr()->addCollType( "SectorObject", "SectorObject", OgreOpcode::COLLTYPE_QUICK ); + + collideInSectorContext_ = OgreOpcode::CollisionManager::getSingletonPtr()->getDefaultContext(); + +} + +OpcodeCollisionDetection::~OpcodeCollisionDetection(){ + delete OgreOpcode::CollisionManager::getSingletonPtr(); +} + +bool OpcodeCollisionDetection::update( Ogre::Real elapsedTime ){ + collideInSectorContext_->collide( 0.0 ); + collideInSectorContext_->collide( elapsedTime ); + + OgreOpcode::CollisionReporter report( collideInSectorContext_->getCollisionReport() ); + + int nCollids = report.getNumCollisions(); + if ( nCollids > 0 ){ + // std::cout << "Collisions: " << nCollids << std::endl; + + OgreOpcode::CollisionPair **collisionReport; + report.getAllCollisions( collisionReport ); + + for ( int i = 0; i < nCollids; i ++ ){ + OgreOpcode::CollisionObject* col1 = collisionReport[ i ]->this_object; + OgreOpcode::CollisionObject* col2 = collisionReport[ i ]->other_object; + + static_cast< BaseObject * >( col1->getClientData() )->collide( static_cast< BaseObject * >( col2->getClientData() ) ); + static_cast< BaseObject * >( col2->getClientData() )->collide( static_cast< BaseObject * >( col1->getClientData() ) ); + } + // std::cout << "CollisionContext attached objects: " + Ogre::StringConverter::toString(collideInSectorContext_->getAttachedObjectCount()) << std::endl; +// std::cout << "CollisionContext owned objects: " + Ogre::StringConverter::toString(collideInSectorContext_->getOwnedObjectCount()) << std::endl; +// std::cout << "CollisionManager shapes: " + Ogre::StringConverter::toString(OgreOpcode::CollisionManager::getSingletonPtr()->getShapeCount())<< std::endl; + + } + + return true; +} + +OgreOpcode::CollisionObject * OpcodeCollisionDetection::createObject( SectorObject * obj ){ + + OgreOpcode::EntityCollisionShape * collShape = OgreOpcode::CollisionManager::getSingletonPtr() + ->createEntityCollisionShape( obj->name() + "/CollShape" ); + collShape->load( obj->shape() ); + + OgreOpcode::CollisionObject * collObj = collideInSectorContext_->createObject( obj->name() + "/CollObj" ); + collObj->setCollClass( OgreOpcode::CollisionManager::getSingletonPtr()->queryCollClass( "SectorObject" ) ); + collObj->setShape( collShape ); + + collideInSectorContext_->addObject( collObj ); + collObj->setClientData( obj ); + return collObj; +} + +void OpcodeCollisionDetection::destroyObject( OgreOpcode::CollisionObject * obj ){ + collideInSectorContext_->destroyObject( obj ); + OgreOpcode::CollisionManager::getSingletonPtr()->destroyShape( obj->getShape() ); +} + +bool OpcodeCollisionDetection::checkCollideRay( Projectile * ammo, const Ogre::Ray & ray, double rayLength){ + OgreOpcode::CollisionPair ** rayPickReport; + int nColl = collideInSectorContext_->rayCheck( ray, rayLength, OgreOpcode::COLLTYPE_EXACT, + OgreOpcode::COLLTYPE_ALWAYS_EXACT, rayPickReport ); + + if ( nColl > 0 ){ + OgreOpcode::CollisionObject* col1 = rayPickReport[ 0 ]->this_object; + OgreOpcode::CollisionObject* col2 = rayPickReport[ 0 ]->other_object; + + if ( ammo->name() != static_cast< BaseObject * >( col1->getClientData() )->name() ){ + + ammo->mainNode()->setPosition( rayPickReport[ 0 ]->contact ); + + ammo->collide( static_cast< BaseObject * >( col2->getClientData() ) ); + static_cast< BaseObject * >( col1->getClientData() )->collide( ammo ); + return true; + } + } + return false; +} + +OpcodeCollisionDetection & OpcodeCollisionDetection::getSingleton( ){ + assert( ms_Singleton ); + return ( *ms_Singleton ); +} + +OpcodeCollisionDetection * OpcodeCollisionDetection::getSingletonPtr( ){ + if ( ms_Singleton == NULL ){ + std::cerr << "OpcodeCollisionDetection not initialized." << std::endl; + } + return ms_Singleton; +} + + +} // namespace OpenGate{ Added: branches/ogsector/src/OpcodeWrapper.h =================================================================== --- branches/ogsector/src/OpcodeWrapper.h (rev 0) +++ branches/ogsector/src/OpcodeWrapper.h 2007-06-12 19:49:24 UTC (rev 553) @@ -0,0 +1,67 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef _OPENGATE_OPCODEWRAPPER__H +#define _OPENGATE_OPCODEWRAPPER__H + +#include <OgreSceneManager.h> + +#include <OgreSingleton.h> +#include <OgreRay.h> + +namespace OgreOpcode{ + class CollisionContext; + class CollisionObject; +} + +namespace OpenGate{ + +class SectorObject; +class Projectile; + + +class OpcodeCollisionDetection : public Ogre::Singleton< OpcodeCollisionDetection >{ +public: + OpcodeCollisionDetection( Ogre::SceneManager * sceneMgr ); + + ~OpcodeCollisionDetection(); + + bool update( Ogre::Real elapsedTime ); + + OgreOpcode::CollisionObject * createObject( SectorObject * obj ); + + void destroyObject( OgreOpcode::CollisionObject * obj ); + + bool checkCollideRay( Projectile * ammo, const Ogre::Ray & bulletRay, double rayLength); + + OgreOpcode::CollisionContext * collideInSectorContext(){ return collideInSectorContext_; } + + static OpcodeCollisionDetection & getSingleton( ); + static OpcodeCollisionDetection * getSingletonPtr( ); + +protected: + OgreOpcode::CollisionContext * collideInSectorContext_; + +}; + + +} // opengate{ + +#endif // _OPENGATE_OPCODEWRAPPER__H Modified: branches/ogsector/src/Sector.cpp =================================================================== --- branches/ogsector/src/Sector.cpp 2007-06-12 17:12:12 UTC (rev 552) +++ branches/ogsector/src/Sector.cpp 2007-06-12 19:49:24 UTC (rev 553) @@ -20,6 +20,7 @@ #include "Sector.h" #include "Avatar.h" +#include "OpcodeWrapper.h" namespace OpenGate{ @@ -67,6 +68,8 @@ // l->setPosition( 50, 0, 300 ); + collsionDetection_ = new OpcodeCollisionDetection( sceneMgr_ ); + //** Create a skybox; sceneMgr_->setSkyBox( true, "OpenGate/SimpleSkyBox1" ); @@ -130,19 +133,6 @@ planetNode_->setPosition( Ogre::Vector3( 20000.0, 10000.0, 50000 ) ); } - new OgreOpcode::CollisionManager( sceneMgr_ ); - OgreOpcode::CollisionManager::getSingletonPtr()->addCollClass( "SectorObject" ); - OgreOpcode::CollisionManager::getSingletonPtr()->addCollClass( "Bullet" ); - - OgreOpcode::CollisionManager::getSingletonPtr()->addCollType( "Bullet", "Bullet", OgreOpcode::COLLTYPE_IGNORE ); - OgreOpcode::CollisionManager::getSingletonPtr()->addCollType( "SectorObject", "Bullet", OgreOpcode::COLLTYPE_EXACT ); - OgreOpcode::CollisionManager::getSingletonPtr()->addCollType( "SectorObject", "SectorObject", OgreOpcode::COLLTYPE_CONTACT ); - // OgreOpcode::CollisionManager::getSingletonPtr()->addCollType( "SectorObject", "SectorObject", OgreOpcode::COLLTYPE_QUICK ); - - collideInSectorContext_ = OgreOpcode::CollisionManager::getSingletonPtr()->getDefaultContext(); - - - // Ogre::MeshPtr pMesh = Ogre::MeshManager::getSingleton().load( "astro/Sphere.mesh", // Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, // Ogre::HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY, @@ -235,37 +225,12 @@ sceneMgr_->destroyManualObject( "Planet" ); sceneMgr_->getRootSceneNode()->removeAndDestroyChild( "PlanetNode" ); - delete OgreOpcode::CollisionManager::getSingletonPtr(); + delete collsionDetection_; } void Sector::update( Ogre::Real elapsedTime ){ - - collideInSectorContext_->collide( 0.0 ); - collideInSectorContext_->collide( elapsedTime ); - - OgreOpcode::CollisionReporter report( collideInSectorContext_->getCollisionReport() ); - - int nCollids = report.getNumCollisions(); - if ( nCollids > 0 ){ - // std::cout << "Collisions: " << nCollids << std::endl; - - OgreOpcode::CollisionPair **collisionReport; - report.getAllCollisions( collisionReport ); - - for ( int i = 0; i < nCollids; i ++ ){ - OgreOpcode::CollisionObject* col1 = collisionReport[ i ]->this_object; - OgreOpcode::CollisionObject* col2 = collisionReport[ i ]->other_object; - - static_cast< BaseObject * >( col1->getClientData() )->collide( static_cast< BaseObject * >( col2->getClientData() ) ); - static_cast< BaseObject * >( col2->getClientData() )->collide( static_cast< BaseObject * >( col1->getClientData() ) ); - } - -// std::cout << "CollisionContext attached objects: " + Ogre::StringConverter::toString(collideInSectorContext_->getAttachedObjectCount()) << std::endl; -// std::cout << "CollisionContext owned objects: " + Ogre::StringConverter::toString(collideInSectorContext_->getOwnedObjectCount()) << std::endl; -// std::cout << "CollisionManager shapes: " + Ogre::StringConverter::toString(OgreOpcode::CollisionManager::getSingletonPtr()->getShapeCount())<< std::endl; - - } - + collsionDetection_->update( elapsedTime ); + if ( avatar_ ) { if ( planetNode_ ){ Ogre::Vector3 src = planetNode_->getWorldOrientation() * Ogre::Vector3::UNIT_Z; Modified: branches/ogsector/src/Sector.h =================================================================== --- branches/ogsector/src/Sector.h 2007-06-12 17:12:12 UTC (rev 552) +++ branches/ogsector/src/Sector.h 2007-06-12 19:49:24 UTC (rev 553) @@ -18,11 +18,10 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifndef SECTOR__H -#define SECTOR__H +#ifndef _OPENGATE_SECTOR__H +#define _OPENGATE_SECTOR__H #include <Ogre.h> -#include <OgreOpcode.h> #include "UnDockedState.h" #include "SectorObjects.h" @@ -70,8 +69,6 @@ void spawnAiObject( const std::string & vesselName ); - OgreOpcode::CollisionContext * collisionContext() { return collideInSectorContext_; } - void createCircle( ); void selectNextTarget( SectorObject * obj = NULL ); @@ -114,8 +111,6 @@ Ogre::SceneNode * planetNode_; Ogre::SceneNode * starsNode_; - OgreOpcode::CollisionContext * collideInSectorContext_; - std::set< SectorObject * > sectorObjects_; std::set< SectorObject * >::iterator itTarget_; @@ -125,9 +120,12 @@ float avatarDeathSequenceTime_; bool radar_ ; + + OpcodeCollisionDetection * collsionDetection_; + }; } // namespace OpenGate -#endif // SECTOR__H +#endif // _OPENGATE_SECTOR__H Modified: branches/ogsector/src/SectorObjects.cpp =================================================================== --- branches/ogsector/src/SectorObjects.cpp 2007-06-12 17:12:12 UTC (rev 552) +++ branches/ogsector/src/SectorObjects.cpp 2007-06-12 19:49:24 UTC (rev 553) @@ -21,6 +21,9 @@ #include "Sector.h" #include "SectorObjects.h" #include "common.h" +#include "OpcodeWrapper.h" +//#include <OgreOpcode.h> + #include <string> namespace OpenGate{ @@ -145,36 +148,39 @@ } bool Projectile::update( Ogre::Real elapsedTime ){ - if ( elapsedTime < 0.001 ){ - return true; - } - + if ( elapsedTime < 0.001 ) return true; + lifeTime_ += elapsedTime; if ( lifeTime_ >= maxLiveTime_ ) return false; if ( vel_.length() > 0.1 ){ - OgreOpcode::CollisionPair ** rayPickReport; Ogre::Ray bulletRay( mainNode_->getPosition(), vel_.normalisedCopy() ); - int nColl = sector_->collisionContext()->rayCheck( bulletRay, (vel_ * elapsedTime).length(), - OgreOpcode::COLLTYPE_EXACT, - OgreOpcode::COLLTYPE_ALWAYS_EXACT, rayPickReport ); + if ( !OpcodeCollisionDetection::getSingleton().checkCollideRay( this, bulletRay, (vel_ * elapsedTime).length() ) ){ + mainNode_->translate( vel_ * elapsedTime ); + } - if ( nColl > 0 ){ - OgreOpcode::CollisionObject* col1 = rayPickReport[ 0 ]->this_object; - OgreOpcode::CollisionObject* col2 = rayPickReport[ 0 ]->other_object; +// OgreOpcode::CollisionPair ** rayPickReport; +// int nColl = OgreOpcode::CollisionManager::getSingletonPtr() +// ->getDefaultContext()->rayCheck( bulletRay, (vel_ * elapsedTime).length(), +// OgreOpcode::COLLTYPE_EXACT, +// OgreOpcode::COLLTYPE_ALWAYS_EXACT, rayPickReport ); - if ( this->name() != static_cast< BaseObject * >( col1->getClientData() )->name() ){ +// if ( nColl > 0 ){ +// OgreOpcode::CollisionObject* col1 = rayPickReport[ 0 ]->this_object; +// OgreOpcode::CollisionObject* col2 = rayPickReport[ 0 ]->other_object; - mainNode_->setPosition( rayPickReport[ 0 ]->contact ); +// if ( this->name() != static_cast< BaseObject * >( col1->getClientData() )->name() ){ - this->collide( static_cast< BaseObject * >( col2->getClientData() ) ); - static_cast< BaseObject * >( col1->getClientData() )->collide( this ); - return true; - } - } - mainNode_->translate( vel_ * elapsedTime ); +// mainNode_->setPosition( rayPickReport[ 0 ]->contact ); + +// this->collide( static_cast< BaseObject * >( col2->getClientData() ) ); +// static_cast< BaseObject * >( col1->getClientData() )->collide( this ); +// return true; +// } +// } + } return true; } @@ -209,8 +215,7 @@ Ogre::OverlayManager::getSingleton().destroyOverlayElement( "Radar/Map/DotA_" + name_ ); Ogre::OverlayManager::getSingleton().destroyOverlayElement( "Radar/Map/DotB_" + name_ ); - sector_->collisionContext()->destroyObject( collObj_ ); - OgreOpcode::CollisionManager::getSingletonPtr()->destroyShape( collObj_->getShape() ); + OpcodeCollisionDetection::getSingleton().destroyObject( collObj_ ); mainNodeEntity_->detachObject( entity_ ); sceneMgr_->destroyEntity( entity_ ); @@ -220,16 +225,7 @@ void SectorObject::setShape( const Ogre::String & meshname ){ entity_ = sceneMgr_->createEntity( name_ + "_shape", meshname ); mainNodeEntity_->attachObject( entity_ ); - - OgreOpcode::EntityCollisionShape * collShape = OgreOpcode::CollisionManager::getSingletonPtr()->createEntityCollisionShape( name_ + "CollShape" ); - collShape->load( this->shape() ); - - collObj_ = sector_->collisionContext()->createObject( name_ + "CollObj" ); - collObj_->setCollClass( OgreOpcode::CollisionManager::getSingletonPtr()->queryCollClass( "SectorObject" ) ); - collObj_->setShape( collShape ); - - sector_->collisionContext()->addObject( collObj_ ); - collObj_->setClientData( this ); + collObj_ = OpcodeCollisionDetection::getSingleton().createObject( this ); } void SectorObject::setBaseSize( Ogre::Real targetSize ){ @@ -534,7 +530,7 @@ capacity_ += powerLine * vessel_->capacitor()->efficiency() * elapsedTime; capacity_ = min( (long)capacity_, vessel_->capacitor()->capacity() ); } - + return true; } void SectorObjectMoveable::inititializeVesselStats_(){ Modified: branches/ogsector/src/SectorObjects.h =================================================================== --- branches/ogsector/src/SectorObjects.h 2007-06-12 17:12:12 UTC (rev 552) +++ branches/ogsector/src/SectorObjects.h 2007-06-12 19:49:24 UTC (rev 553) @@ -23,12 +23,14 @@ #include <Ogre.h> -#include <OgreOpcode.h> - #include "common.h" #include "networkProtocol.h" #include "VesselManager.h" +namespace OgreOpcode{ + class CollisionObject; +} + namespace OpenGate{ #define PROJECTILE_RTTI 100001 @@ -38,6 +40,7 @@ #define AVATAR_RTTI 100005 class Sector; +class OpcodeCollisionDetection; class BaseObject : public Ogre::UserDefinedObject{ public: Modified: branches/ogsector/src/ShipConfigDialog.cpp =================================================================== --- branches/ogsector/src/ShipConfigDialog.cpp 2007-06-12 17:12:12 UTC (rev 552) +++ branches/ogsector/src/ShipConfigDialog.cpp 2007-06-12 19:49:24 UTC (rev 553) @@ -104,7 +104,7 @@ BIND_CEGUI_EVENT( wmgr.getWindow( (CEGUI::utf8*)"ShipConfigDialog/SelectShip"), CEGUI::PushButton::EventClicked, ShipConfigDialog::handleSelectShipButton ); - for ( int i = 0; i < equipmentButtons_.size(); i ++ ){ + for ( unsigned int i = 0; i < equipmentButtons_.size(); i ++ ){ BIND_CEGUI_EVENT( wmgr.getWindow( equipmentButtons_[ i ]->getName() + "ShipConfigEquipmentItem/Load"), CEGUI::PushButton::EventClicked, ShipConfigDialog::handleLoadItem ); BIND_CEGUI_EVENT( wmgr.getWindow( equipmentButtons_[ i ]->getName() + "ShipConfigEquipmentItem/UnLoad"), @@ -258,6 +258,7 @@ case ECM: ecms.push_back( &(*it) ); break; case RADAR: radars.push_back( &(*it) ); break; case CAPACITOR: capacitors.push_back( &(*it) ); break; + default: break; } } @@ -413,7 +414,7 @@ CEGUI::WindowManager::getSingleton().getWindow( itemWindow->getName()+"ShipConfigEquipmentItem/UnLoad" )->show(); } } - updatePowerGrid( ); + return updatePowerGrid( ); } bool ShipConfigDialog::handleUnLoadItem( const CEGUI::EventArgs & e ){ @@ -427,7 +428,7 @@ CEGUI::WindowManager::getSingleton().getWindow( itemWindow->getName()+"ShipConfigEquipmentItem/UnLoad" )->hide(); } } - updatePowerGrid( ); + return updatePowerGrid( ); } bool ShipConfigDialog::updatePowerGrid( ){ @@ -507,6 +508,7 @@ CEGUI::WindowManager::getSingleton().getWindow( "ShipConfiguration/PowerGrid/Values/Remain" ) ->setProperty("Text", toStr( (int)powerLine ) + "K" ); + return true; } Modified: branches/ogsector/src/networkServer.cpp =================================================================== --- branches/ogsector/src/networkServer.cpp 2007-06-12 17:12:12 UTC (rev 552) +++ branches/ogsector/src/networkServer.cpp 2007-06-12 19:49:24 UTC (rev 553) @@ -48,7 +48,7 @@ Server::~Server(){ // TODO: necessary? delete(newUser); shutdown( ); - segfaults: acceptor_.close(); + // segfaults: acceptor_.close(); } void Server::shutdown( ){ Modified: branches/ogsector/src/openALSoundManager.cpp =================================================================== --- branches/ogsector/src/openALSoundManager.cpp 2007-06-12 17:12:12 UTC (rev 552) +++ branches/ogsector/src/openALSoundManager.cpp 2007-06-12 19:49:24 UTC (rev 553) @@ -95,6 +95,7 @@ ALenum error = 0; if ( ( error = alGetError() ) == AL_NO_ERROR ) return false; displayOpenALError( str, error ); + return true; } void OpenALSoundManager::displayOpenALError( const std::string & str, ALenum error ){ @@ -274,18 +275,21 @@ pos[ 0 ] = x; pos[ 1 ] = y; pos[ 2 ] = z; alSourcefv( audioSources_[ sourceId ], AL_POSITION, pos ); if ( checkOpenALError( "setSourcePosition::alSourcefv:AL_POSITION" ) ) return false; + return true; } bool OpenALSoundManager::setListenerPosition( const ALfloat x, const ALfloat y, const ALfloat z ){ listenerPosition_[ 0 ] = x; listenerPosition_[ 1 ] = y; listenerPosition_[ 2 ] = z; alListenerfv( AL_POSITION, listenerPosition_ ); if ( checkOpenALError( "setListenerPosition::alListenerfv:AL_POSITION" ) ) return false; + return true; } bool OpenALSoundManager::setListenerVelocity( const ALfloat x, const ALfloat y, const ALfloat z ){ listenerVelocity_[ 0 ] = x; listenerVelocity_[ 1 ] = y; listenerVelocity_[ 2 ] = z; alListenerfv( AL_VELOCITY, listenerVelocity_ ); if ( checkOpenALError( "setListenerVelocity::alListenerfv:AL_VELOCITY" ) ) return false; + return true; } bool OpenALSoundManager::setListenerOrientation( const ALfloat x, const ALfloat y, const ALfloat z, @@ -294,6 +298,7 @@ listenerOrientation_[ 3 ] = x1; listenerOrientation_[ 4 ] = y1; listenerOrientation_[ 5 ] = z1; alListenerfv( AL_ORIENTATION, listenerOrientation_ ); if ( checkOpenALError( "setListenerOrientation::alListenerfv:AL_ORIENTATION" ) ) return false; + return true; } } // namespace OpenGate This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2007-06-17 11:18:04
|
Revision: 562 http://svn.sourceforge.net/opengate/?rev=562&view=rev Author: egore Date: 2007-06-17 04:18:04 -0700 (Sun, 17 Jun 2007) Log Message: ----------- Try to add a login against metaserver and fail with C++ (enough crap written for today) Added Paths: ----------- branches/ogsector/src/metaserver.cpp branches/ogsector/src/metaserver.h Added: branches/ogsector/src/metaserver.cpp =================================================================== --- branches/ogsector/src/metaserver.cpp (rev 0) +++ branches/ogsector/src/metaserver.cpp 2007-06-17 11:18:04 UTC (rev 562) @@ -0,0 +1,121 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * eg...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "metaserver.h" + +namespace OpenGate{ + +MetaConnection::MetaConnection( asio::io_service & io_service, const std::string & hostName ) + : io_service_( io_service ), socket_( io_service ), resolver_( io_service ), + hostname_( hostName ) { + + log_ = LogManager::getSingletonPtr(); + + try { + asio::ip::tcp::resolver::query query(hostName.c_str(), "http"); + asio::ip::tcp::resolver::iterator endpoint_iterator = resolver_.resolve(query); + asio::ip::tcp::resolver::iterator end; + + // Try each endpoint until we successfully establish a connection. + asio::error error = asio::error::host_not_found; + while (error && endpoint_iterator != end) + { + socket_.close(); + socket_.connect(*endpoint_iterator++, asio::assign_error(error)); + } + if (error) + throw error; + + } catch ( asio::error & e) { + log_->fatal( e.what() ); + } catch (...) { + log_->fatal( "Unkown exception occured while resolving the metaserver" ); + } + +} + +#define SCRIPT_PATH "/script/schnittstelle/" + +void MetaConnection::login( const std::string & userName, const std::string & passwd ) { + try { + + // Form the request. We specify the "Connection: close" header so that the + // server will close the socket after transmitting the response. This will + // allow us to treat all data up until the EOF as the content. + asio::streambuf request; + std::ostream request_stream(&request); + request_stream << "GET " SCRIPT_PATH << "?action=login&username=" <<userName <<"&password=" << passwd << " HTTP/1.0\r\n"; + request_stream << "Host: " << hostname_ << "\r\n"; + request_stream << "Accept: */*\r\n"; + request_stream << "Connection: close\r\n\r\n"; + + // Send the request. + asio::write(socket, request); + + // Read the response status line. + asio::streambuf response; + asio::read_until(socket, response, boost::regex("\r\n")); + + // Check that response is OK. + std::istream response_stream(&response); + std::string http_version; + response_stream >> http_version; + unsigned int status_code; + response_stream >> status_code; + std::string status_message; + std::getline(response_stream, status_message); + if (!response_stream || http_version.substr(0, 5) != "HTTP/"){ + log_->fatal( "Invalid response from metaserver " ); + return; + } + if (status_code != 200){ + log_->fatal( std::string("Response returned with status code ") /* + status_code FIXME: I suck at CPP streams */ ); + return; + } + + // Read the response headers, which are terminated by a blank line. + asio::read_until(socket, response, boost::regex("\r\n\r\n")); + + // Process the response headers. + std::string header; + while (std::getline(response_stream, header) && header != "\r") + std::cout << header << "\n"; + std::cout << "\n"; + + // Write whatever content we already have to output. + if (response.size() > 0) + std::cout << &response; + + // Read until EOF, writing data to output as we go. + asio::error error = asio::error::eof; + while (asio::read(socket, response, + asio::transfer_at_least(1), + asio::assign_error(error))) + std::cout << &response; + if (error != asio::error::eof) + throw error; + } catch ( asio::error & e) { + log_->fatal( e.what() ); + } catch (...) { + log_->fatal( "Unkown exception occured while resolving the metaserver" ); + } +} + +} // namespace OpenGate Property changes on: branches/ogsector/src/metaserver.cpp ___________________________________________________________________ Name: svn:mime-type + text/x-c++src Name: svn:eol-style + native Added: branches/ogsector/src/metaserver.h =================================================================== --- branches/ogsector/src/metaserver.h (rev 0) +++ branches/ogsector/src/metaserver.h 2007-06-17 11:18:04 UTC (rev 562) @@ -0,0 +1,51 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by OpenGate development team * + * eg...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef _OPENGATE_METASERVER__H +#define _OPENGATE_METASERVER__H + +#include <asio.hpp> +#include <boost/bind.hpp> + +#include "LogManager.h" + +namespace OpenGate{ + +class MetaConnection { +public: + MetaConnection( asio::io_service & io_service, const std::string & hostName ); + + ~MetaConnection(); + + void login( const std::string & userName, const std::string & passwd ); +private: + + asio::io_service & io_service_; + asio::ip::tcp::socket socket_; + asio::ip::tcp::resolver resolver_; + std::string hostname_; + + LogManager *log_; + +}; + +} + +#endif //_OPENGATE_METASERVER__H Property changes on: branches/ogsector/src/metaserver.h ___________________________________________________________________ Name: svn:mime-type + text/x-c++hdr Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2007-06-18 17:58:58
|
Revision: 572 http://svn.sourceforge.net/opengate/?rev=572&view=rev Author: spom_spom Date: 2007-06-18 10:58:58 -0700 (Mon, 18 Jun 2007) Log Message: ----------- some small fixes Modified Paths: -------------- branches/ogsector/src/GameStateManager.cpp branches/ogsector/src/Sector.cpp branches/ogsector/src/Sector.h branches/ogsector/src/ShipConfigDialog.cpp branches/ogsector/src/UnDockedState.cpp branches/ogsector/src/networkProtocol.h branches/ogsector/src/networkServerUser.cpp Modified: branches/ogsector/src/GameStateManager.cpp =================================================================== --- branches/ogsector/src/GameStateManager.cpp 2007-06-18 17:51:58 UTC (rev 571) +++ branches/ogsector/src/GameStateManager.cpp 2007-06-18 17:58:58 UTC (rev 572) @@ -201,6 +201,8 @@ if ( sector ) sector->receiveVesselRegister( &msgs[ i ][ 0 ] ); break; case PROTO_SHIP_DEREGISTER: if ( sector ) sector->receiveVesselDeRegister( &msgs[ i ][ 0 ] ); break; + case PROTO_SHIP_DIED: + if ( sector ) sector->receiveVesselDied( &msgs[ i ][ 0 ] ); break; case PROTO_SHIP_STATUS: if ( sector ) sector->receiveVesselStatus( &msgs[ i ][ 0 ] ); break; case PROTO_SHIP_MOVEMENT:{ Modified: branches/ogsector/src/Sector.cpp =================================================================== --- branches/ogsector/src/Sector.cpp 2007-06-18 17:51:58 UTC (rev 571) +++ branches/ogsector/src/Sector.cpp 2007-06-18 17:58:58 UTC (rev 572) @@ -327,6 +327,7 @@ void Sector::avatarDied( ){ if ( avatar_ ){ + sendVesselDied( avatar_ ); listener_->avatarDeathSequence( true ); } } @@ -654,6 +655,24 @@ } } +void Sector::sendVesselDied( SectorObjectMoveableLocal * obj ){ + MessageBodyShipDied msg( 0, obj->childID() ); + network_->send( msg ); +} + +void Sector::receiveVesselDied( const MessageBodyShipDied & msg ){ + if ( movableObjects_.count( createGlobalID( msg.senderID(), msg.childID() ) ) ){ + log_->info( std::string( "Receive vessel died " ) + + movableObjects_[ createGlobalID( msg.senderID(), msg.childID() ) ]->name() ); + + SectorObjectMoveable *obj = movableObjects_[ createGlobalID( msg.senderID(), msg.childID() ) ]; + obj->deathSequence( 0.0 ); + } else { + log_->warn( std::string( "Died vessel request for unknown object: " ) + + toStr( msg.senderID() ) + ": " + toStr( (int)msg.childID() ) ); + } +} + void Sector::receiveVesselMovement( const std::vector < MessageBodyShipMovement * > & movements ){ std::map < long, const MessageBodyShipMovement * > singleMsg; Modified: branches/ogsector/src/Sector.h =================================================================== --- branches/ogsector/src/Sector.h 2007-06-18 17:51:58 UTC (rev 571) +++ branches/ogsector/src/Sector.h 2007-06-18 17:58:58 UTC (rev 572) @@ -80,6 +80,9 @@ void sendAllVesselInfos( ); void sendAllVesselMovements( ); + void sendVesselDied( SectorObjectMoveableLocal * obj ); + void receiveVesselDied( const MessageBodyShipDied & msg ); + void sendVesselRegister( SectorObjectMoveableLocal * obj ); void receiveVesselRegister( const MessageBodyShipRegister & msg ); Modified: branches/ogsector/src/ShipConfigDialog.cpp =================================================================== --- branches/ogsector/src/ShipConfigDialog.cpp 2007-06-18 17:51:58 UTC (rev 571) +++ branches/ogsector/src/ShipConfigDialog.cpp 2007-06-18 17:58:58 UTC (rev 572) @@ -214,7 +214,8 @@ bool ShipConfigDialog::handleSelectShipButton( const CEGUI::EventArgs & e ){ devices_->avatar->setVessel( *(*itVessel_) ); - hide(); + LogManager::getSingleton().info( std::string( "Select vessel: " ) + devices_->avatar->vessel()->name() + " id:" + toStr( devices_->avatar->vessel()->id() ) ); + updateEquipmentView(); return true; } Modified: branches/ogsector/src/UnDockedState.cpp =================================================================== --- branches/ogsector/src/UnDockedState.cpp 2007-06-18 17:51:58 UTC (rev 571) +++ branches/ogsector/src/UnDockedState.cpp 2007-06-18 17:58:58 UTC (rev 572) @@ -893,10 +893,10 @@ targetVelocity_->setText( "V" + Ogre::StringConverter::toString( round( dynamic_cast< SectorObjectMoveable *>( target_ )->speed(), 2 ), 4 ) ); - targetShieldText_->setText( "S" + Ogre::StringConverter::toString( - dynamic_cast< SectorObjectMoveable *>( target_ )->shieldRate() * 100.0f, 4 ) ); - targetArmorText_->setText( "A" + Ogre::StringConverter::toString( - dynamic_cast< SectorObjectMoveable *>( target_ )->armorRate() * 100.0f, 4 ) ); + targetShieldText_->setText( "S" + Ogre::StringConverter::toString( round( + dynamic_cast< SectorObjectMoveable *>( target_ )->shieldRate() * 100.0f, 1), 4 ) ); + targetArmorText_->setText( "A" + Ogre::StringConverter::toString( round( + dynamic_cast< SectorObjectMoveable *>( target_ )->armorRate() * 100.0f, 1), 4 ) ); } else{ targetVelocity_->setText( "" ); Modified: branches/ogsector/src/networkProtocol.h =================================================================== --- branches/ogsector/src/networkProtocol.h 2007-06-18 17:51:58 UTC (rev 571) +++ branches/ogsector/src/networkProtocol.h 2007-06-18 17:58:58 UTC (rev 572) @@ -47,6 +47,7 @@ #define PROTO_SHIP_MOVEMENT 14 #define PROTO_SHIP_AMMOHIT 15 #define PROTO_SHIP_PROJECTILEFIRED 16 +#define PROTO_SHIP_DIED 17 #define PROTO_TEST 255 #define CONNECTION_REFUSED_USER_ALREADY_EXIST 1 @@ -387,6 +388,29 @@ protected: }; +class MessageBodyShipDied : public MessageBodyShipBase { +public: + MessageBodyShipDied( const Uint32 senderID, const Uint8 childID ): MessageBodyShipBase( childID ){ + senderID_ = senderID; + type_ = (Uint8)PROTO_SHIP_DIED; + } + + MessageBodyShipDied( const char * data ) : MessageBodyShipBase( data ){ } + + virtual ~MessageBodyShipDied( ){ } + + void createOutStream() { + MessageBodyShipBase::createOutStream(); + } + + friend std::ostream & operator << ( std::ostream & str, const MessageBodyShipDied & msg ){ + str << "Type: " << (int)( msg.type() ) << " senderID: " << msg.senderID() << " childID: " << msg.childID(); + return str; + } + +protected: +}; + class MessageBodyShipMovement : public MessageBodyShipBase { public: MessageBodyShipMovement( Uint8 childID, const Ogre::Vector3 & pos, Modified: branches/ogsector/src/networkServerUser.cpp =================================================================== --- branches/ogsector/src/networkServerUser.cpp 2007-06-18 17:51:58 UTC (rev 571) +++ branches/ogsector/src/networkServerUser.cpp 2007-06-18 17:58:58 UTC (rev 572) @@ -140,6 +140,10 @@ MessageBodyShipDeRegister msg( readMsg_.body() ); server_->receiveShipDeRegister( this, msg ); } break; + case PROTO_SHIP_DIED:{ + MessageBodyShipDied msg( readMsg_.body() ); + sendToRange( msg ); + } break; case PROTO_SHIP_STATUS:{ MessageBodyShipStatus msg( readMsg_.body() ); // if ( msg.childID() > 0 ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2007-07-05 20:17:13
|
Revision: 613 http://svn.sourceforge.net/opengate/?rev=613&view=rev Author: spom_spom Date: 2007-07-05 13:17:15 -0700 (Thu, 05 Jul 2007) Log Message: ----------- Minor laser related fix Modified Paths: -------------- branches/ogsector/src/Projectile.cpp branches/ogsector/src/Sector.cpp Modified: branches/ogsector/src/Projectile.cpp =================================================================== --- branches/ogsector/src/Projectile.cpp 2007-07-05 20:16:17 UTC (rev 612) +++ branches/ogsector/src/Projectile.cpp 2007-07-05 20:17:15 UTC (rev 613) @@ -194,8 +194,13 @@ } } else { if ( beam_ ){ - shape_->scale( 1.0, 1.0, max( 1.0f, ( shape_->getScale()[2]-(vel_ * elapsedTime).length()) ) - /shape_->getScale()[2] ); + Ogre::Real beamLength = min( (vel_ * lifeTime_).length(), 300.0f ); + beamLength -= ( parent_->mainNode()->getWorldPosition() + ( vel_ * lifeTime_ ) - + mainNode_->getWorldPosition() ).length(); + + if ( beamLength > 0 ){ + shape_->scale( 1.0, 1.0, beamLength / shape_->getScale()[ 2 ] ); + } } } } Modified: branches/ogsector/src/Sector.cpp =================================================================== --- branches/ogsector/src/Sector.cpp 2007-07-05 20:16:17 UTC (rev 612) +++ branches/ogsector/src/Sector.cpp 2007-07-05 20:17:15 UTC (rev 613) @@ -148,10 +148,6 @@ populate( "testsector.xml" ); // createCircle(); - SectorObject *obj = createStaticObject( "lady_kickstart.mesh", "lady_kickstart", Ogre::Vector3( 0,0,450) ); - obj->setBaseRot( -90, -90, 0 ); - obj->setBaseSize( Ogre::Vector3( 10, 3.4, 10.9 ) ); - itTarget_ = sectorObjects_.begin(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2007-07-07 08:32:59
|
Revision: 624 http://svn.sourceforge.net/opengate/?rev=624&view=rev Author: egore Date: 2007-07-07 01:32:59 -0700 (Sat, 07 Jul 2007) Log Message: ----------- Add a working version check. It's only not working if we login before. We need to reset something in ASIO I'm missing right now. I think we need to close and reopen the socket. Modified Paths: -------------- branches/ogsector/src/Makefile.am branches/ogsector/src/Makefile.in branches/ogsector/src/metaserver.cpp branches/ogsector/src/metaserver.h branches/ogsector/src/opengateclient.cpp Modified: branches/ogsector/src/Makefile.am =================================================================== --- branches/ogsector/src/Makefile.am 2007-07-06 22:22:34 UTC (rev 623) +++ branches/ogsector/src/Makefile.am 2007-07-07 08:32:59 UTC (rev 624) @@ -74,7 +74,9 @@ networkServer.h \ networkServer.cpp \ networkServerUser.h \ - networkServerUser.cpp + networkServerUser.cpp \ + metaserver.h \ + metaserver.cpp testopenalmanager_SOURCES = \ testopenalmanager.cpp \ Modified: branches/ogsector/src/Makefile.in =================================================================== --- branches/ogsector/src/Makefile.in 2007-07-06 22:22:34 UTC (rev 623) +++ branches/ogsector/src/Makefile.in 2007-07-07 08:32:59 UTC (rev 624) @@ -66,7 +66,7 @@ am_opengateserver_OBJECTS = opengateserver.$(OBJEXT) common.$(OBJEXT) \ LogManager.$(OBJEXT) InputManager.$(OBJEXT) \ networkProtocol.$(OBJEXT) networkServer.$(OBJEXT) \ - networkServerUser.$(OBJEXT) + networkServerUser.$(OBJEXT) metaserver.$(OBJEXT) opengateserver_OBJECTS = $(am_opengateserver_OBJECTS) opengateserver_LDADD = $(LDADD) am_testopenalmanager_OBJECTS = testopenalmanager.$(OBJEXT) \ @@ -255,7 +255,9 @@ networkServer.h \ networkServer.cpp \ networkServerUser.h \ - networkServerUser.cpp + networkServerUser.cpp \ + metaserver.h \ + metaserver.cpp testopenalmanager_SOURCES = \ testopenalmanager.cpp \ Modified: branches/ogsector/src/metaserver.cpp =================================================================== --- branches/ogsector/src/metaserver.cpp 2007-07-06 22:22:34 UTC (rev 623) +++ branches/ogsector/src/metaserver.cpp 2007-07-07 08:32:59 UTC (rev 624) @@ -20,6 +20,7 @@ #include "metaserver.h" #include <boost/regex.hpp> +#include "config.h" namespace OpenGate{ @@ -57,50 +58,15 @@ int MetaConnection::login( const std::string & userName, const std::string & passwd ) { - std::cout << userName << ":" << passwd << std::endl; - try { - // Form the request. We specify the "Connection: close" header so that the - // server will close the socket after transmitting the response. This will - // allow us to treat all data up until the EOF as the content. - asio::streambuf request; - std::ostream request_stream(&request); - request_stream << "GET " << "/script/schnittstelle/?action=login&username=" << userName << "&password=" << passwd << " HTTP/1.0\r\n"; - request_stream << "Host: " << hostname_ << "\r\n"; - request_stream << "Accept: */*\r\n"; - request_stream << "Connection: close\r\n\r\n"; - // Send the request. - asio::write(socket_, request); - - // Read the response status line. asio::streambuf response; - asio::read_until(socket_, response, boost::regex("\r\n")); - - // Check that response is OK. - std::istream response_stream(&response); - std::string http_version; - response_stream >> http_version; - unsigned int status_code; - response_stream >> status_code; - std::string status_message; - std::getline(response_stream, status_message); - if ( !response_stream || http_version.substr(0, 5) != "HTTP/" ) { - std::cout << "Invalid response\n"; - return -1; + std::string parameters( "login&username=" + userName + "&password=" + passwd); + int retval = request(parameters, response); + if (retval < 0) { + return retval; } - if (status_code != 200) { - std::cout << "Response returned with status code " << status_code << "\n"; - return -2; - } - // Read the response headers, which are terminated by a blank line. - asio::read_until(socket_, response, boost::regex("\r\n\r\n")); - - // Process the response headers. (to get the crap of the response before reading the body!) - std::string header; - while (std::getline(response_stream, header) && header != "\r"); - // We got a usefull body. The body is an int, lets use it. if (response.size() > 0) { std::ostringstream stream; @@ -124,14 +90,6 @@ } } - asio::error error = asio::error::eof; - // Read until EOF, writing data to output as we go. - while (asio::read(socket_, response, - asio::transfer_at_least(1), - asio::assign_error(error))) - std::cout << &response; - if (error != asio::error::eof) - throw error; } catch ( asio::error & e) { log_->fatal( e.what() ); @@ -146,4 +104,105 @@ return 1; } +int MetaConnection::check_version( int user_id ) { + + try { + + asio::streambuf response; + std::string parameters("check_version&version=" + std::string(PACKAGE_VERSION) + "&user_id=" + toStr(user_id)); + int retval = request(parameters, response); + if (retval < 0) { + return retval; + } + + // We got a usefull body. The body is an int, lets use it. + if (response.size() > 0) { + std::ostringstream stream; + stream << &response; + int returncode = toInt( stream.str() ); + switch (returncode) { + case -101: log_->warn ( std::string ("no action given") ); return -3; + case -102: log_->warn ( std::string ("action given but unknown") ); return -3; + case -103: log_->warn ( std::string ("database is not available") ); return -3; + case -1: log_->warn ( std::string ("no user_id given") ); return -3; + case -3: log_->warn ( std::string ("user_id doesn't exist") ); return -3; + case -6: log_->warn ( std::string ("no version given") ); return -3; + case -7: log_->warn ( std::string ("version given but it isn't the newest (the same version as set in the admin interface of the project website)") ); return -3; + default: + if (returncode > 0) { + return returncode; + } else { + log_->warn ( std::string ("unkown return code for version check ") + toStr( returncode ) ); + return -4; + } + } + } + + } catch ( asio::error & e) { + log_->fatal( std::string( "check_version: ASIO: " ) + e.what() ); + return -5; + } catch ( std::exception & e) { + log_->fatal( std::string( "check_version: Exception: " ) + e.what() ); + return -5; + } catch (...) { + log_->fatal( "check_version: Unkown exception occured while resolving the server" ); + return -5; + } + return 1; +} + +int MetaConnection::request( const std::string & parameters, asio::streambuf & response ) { + // Form the request. We specify the "Connection: close" header so that the + // server will close the socket after transmitting the response. This will + // allow us to treat all data up until the EOF as the content. + asio::streambuf request; + std::ostream request_stream(&request); + request_stream << "GET " << "/script/schnittstelle/?action=" << parameters << " HTTP/1.0\r\n"; + request_stream << "Host: " << hostname_ << "\r\n"; + request_stream << "Accept: */*\r\n"; + request_stream << "Connection: close\r\n\r\n"; + + // Send the request. + asio::write(socket_, request); + + // Read the response status line. + asio::read_until(socket_, response, boost::regex("\r\n")); + + // Check that response is OK. + std::istream response_stream(&response); + std::string http_version; + response_stream >> http_version; + unsigned int status_code; + response_stream >> status_code; + std::string status_message; + std::getline(response_stream, status_message); + if ( !response_stream || http_version.substr(0, 5) != "HTTP/" ) { + std::cout << "Invalid response\n"; + return -51; + } + if (status_code != 200) { + std::cout << "Response returned with status code " << status_code << "\n"; + return -52; + } + + // Read the response headers, which are terminated by a blank line. + asio::read_until(socket_, response, boost::regex("\r\n\r\n")); + + // Process the response headers. (to get the crap of the response before reading the body!) + std::string header; + while (std::getline(response_stream, header) && header != "\r"); + + asio::error error = asio::error::eof; + // Read until EOF, writing data to output as we go. + while (asio::read(socket_, response, + asio::transfer_at_least(1), + asio::assign_error(error))) + std::cout << &response; + if (error != asio::error::eof) + throw error; + + return 1; +} + + } // namespace OpenGate Modified: branches/ogsector/src/metaserver.h =================================================================== --- branches/ogsector/src/metaserver.h 2007-07-06 22:22:34 UTC (rev 623) +++ branches/ogsector/src/metaserver.h 2007-07-07 08:32:59 UTC (rev 624) @@ -34,6 +34,7 @@ ~MetaConnection(); int login( const std::string & userName, const std::string & passwd = "" ); + int check_version( int user_id ); private: @@ -44,6 +45,8 @@ tcp::socket socket_; tcp::resolver resolver_; + int request( const std::string & parameters, asio::streambuf & response ); + }; } Modified: branches/ogsector/src/opengateclient.cpp =================================================================== --- branches/ogsector/src/opengateclient.cpp 2007-07-06 22:22:34 UTC (rev 623) +++ branches/ogsector/src/opengateclient.cpp 2007-07-07 08:32:59 UTC (rev 624) @@ -37,10 +37,11 @@ int main( int argc, char * argv[ ] ) { int option_dialog = 1; + int option_version = 0; std::string username = "testuser"; std::string hostname = "localhost"; std::string password = "dummy"; - bool withMetaServer = false; + int withMetaServer = 0; OpenGate::LogManager *log = new OpenGate::LogManager(); log->setLogFile( "OpenGate.log" ); @@ -49,20 +50,22 @@ while (1) { static struct option long_options[] = { /* These options set a flag. */ - {"config", no_argument, &option_dialog, 1}, - {"no-config", no_argument, &option_dialog, 0}, + {"config", no_argument, &option_dialog, 1}, + {"no-config", no_argument, &option_dialog, 0}, + {"checkversion", no_argument, &option_version, 1}, + {"Metaserver", no_argument, &withMetaServer, 1}, /* These options don't set a flag. We distinguish them by their indices. */ - {"help", no_argument, 0, 'h'}, - {"Metaserver", no_argument, 0, 'M'}, - {"username", required_argument, 0, 'u'}, - {"password", required_argument, 0, 'p'}, - {"server", required_argument, 0, 's'}, + {"help", no_argument, 0, 'h'}, + {"username", required_argument, 0, 'u'}, + {"password", required_argument, 0, 'p'}, + {"server", required_argument, 0, 's'}, + {"version", no_argument, 0, 'v'}, {0, 0, 0, 0} }; /* getopt_long stores the option index here. */ int option_index = 0; - int c = getopt_long (argc, argv, "cnhMu:p:s:", long_options, &option_index); + int c = getopt_long (argc, argv, "cnhMVvu:p:s:", long_options, &option_index); /* Detect the end of the options. */ if ( c == -1 ) break; @@ -70,28 +73,31 @@ switch ( c ) { case 0: // If this option set a flag, do nothing else now if ( long_options[option_index].flag != 0 ) break; - + printf ("option %s", long_options[option_index].name); if ( optarg ) printf (" with arg %s", optarg); printf ("\n"); break; case 'c': option_dialog = true; break; + case 'V': option_version = true; break; + case 'M': withMetaServer = true; break; case 'h': #ifdef PACKAGE_NAME std::cout << PACKAGE_NAME << std::endl; #endif std::cout << std::endl << "Usage instructions" << std::endl; std::cout << " -h --help Show this information" << std::endl; + std::cout << " -v --version Show version information" << std::endl; std::cout << " -M --with-metaserver Connect to metaserver" << std::endl; std::cout << " -u name --username=name Set username to 'name'" << std::endl; std::cout << " -p pass --password=pass Set password to 'pass'" << std::endl; std::cout << " -s server --server=server Set server hostname to 'server'" << std::endl; + std::cout << " -V --checkversion See if a new version of opengate was released" << std::endl; std::cout << std::endl; std::cout << " -c --config Show config dialog" << std::endl; std::cout << " -n --no-config Disable config dialog, reuse last settings" << std::endl; delete log; return EXIT_SUCCESS; - case 'M': withMetaServer = true; break; case 'u': log->debug ( std::string ("Setting username to ") + optarg); username = optarg; @@ -101,15 +107,19 @@ password = optarg; break; case 's': - log->debug ( std::string ("Setting server to ") + optarg); - hostname = optarg; - break; - case '?': - // getopt_long already printed an error message. - break; - default: - // Fail on unkown options - abort(); + log->debug ( std::string ("Setting server to ") + optarg); + hostname = optarg; + break; + case 'v': + log->info ( std::string (PACKAGE_STRING) ); + delete log; + return EXIT_SUCCESS; + case '?': + // getopt_long already printed an error message. + break; + default: + // Fail on unkown options + abort(); } } @@ -125,7 +135,14 @@ if ( withMetaServer ){ OpenGate::MetaConnection meta( io_service ); - if ( meta.login( username, password ) > 0) { + int user_id = meta.login( username, password ); + if (( user_id > 0 ) && ( option_version == 1)) { + int response = meta.check_version( user_id ); + if (response == 1) { + log->debug( "Version is ok" ); + } else { + log->warn( "Version is not ok" ); + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2007-09-20 21:58:14
|
Revision: 747 http://opengate.svn.sourceforge.net/opengate/?rev=747&view=rev Author: egore Date: 2007-09-20 14:58:16 -0700 (Thu, 20 Sep 2007) Log Message: ----------- ignore autogenerated stuff and remove it Removed Paths: ------------- branches/ogsector/src/Makefile.in Property Changed: ---------------- branches/ogsector/src/ Property changes on: branches/ogsector/src ___________________________________________________________________ Name: svn:ignore - opengateserver .deps Makefile testopenalmanager opengateclient + .anjuta .tm_project* .libs .deps .libs .*swp .nautilus-metafile.xml *.autosave *.pws *.bak *~ #*# *.gladep *.la *.lo *.log *.o *.class *.pyc aclocal.m4 autom4te.cache config.h config.h.in config.log config.status configure intltool-extract* intltool-merge* intltool-modules* intltool-update* libtool prepare.sh stamp-h* ltmain.sh mkinstalldirs opengate.depend config.guess config.sub Makefile Makefile.in Deleted: branches/ogsector/src/Makefile.in =================================================================== --- branches/ogsector/src/Makefile.in 2007-09-20 21:55:50 UTC (rev 746) +++ branches/ogsector/src/Makefile.in 2007-09-20 21:58:16 UTC (rev 747) @@ -1,1475 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -bin_PROGRAMS = opengateclient$(EXEEXT) opengateserver$(EXEEXT) \ - testopenalmanager$(EXEEXT) -subdir = src -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" -binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) -PROGRAMS = $(bin_PROGRAMS) -am_opengateclient_OBJECTS = opengateclient-opengateclient.$(OBJEXT) \ - opengateclient-common.$(OBJEXT) \ - opengateclient-networkProtocol.$(OBJEXT) \ - opengateclient-networkClient.$(OBJEXT) \ - opengateclient-tinyxml.$(OBJEXT) \ - opengateclient-tinyxmlerror.$(OBJEXT) \ - opengateclient-tinyxmlparser.$(OBJEXT) \ - opengateclient-Avatar.$(OBJEXT) \ - opengateclient-BaseDialog.$(OBJEXT) \ - opengateclient-ConfigDialog.$(OBJEXT) \ - opengateclient-Console.$(OBJEXT) \ - opengateclient-DockedState.$(OBJEXT) \ - opengateclient-Entity.$(OBJEXT) \ - opengateclient-EntityManager.$(OBJEXT) \ - opengateclient-GameState.$(OBJEXT) \ - opengateclient-GameStateManager.$(OBJEXT) \ - opengateclient-InputManager.$(OBJEXT) \ - opengateclient-InitState.$(OBJEXT) \ - opengateclient-LogManager.$(OBJEXT) \ - opengateclient-MarketDialog.$(OBJEXT) \ - opengateclient-OpcodeWrapper.$(OBJEXT) \ - opengateclient-OpenALSoundManager.$(OBJEXT) \ - opengateclient-Projectile.$(OBJEXT) \ - opengateclient-ResourceManager.$(OBJEXT) \ - opengateclient-Sector.$(OBJEXT) \ - opengateclient-SectorObjects.$(OBJEXT) \ - opengateclient-ShipConfigDialog.$(OBJEXT) \ - opengateclient-Station.$(OBJEXT) \ - opengateclient-UnDockedState.$(OBJEXT) \ - opengateclient-Vessel.$(OBJEXT) \ - opengateclient-VesselManager.$(OBJEXT) \ - opengateclient-metaserver.$(OBJEXT) -opengateclient_OBJECTS = $(am_opengateclient_OBJECTS) -opengateclient_LDADD = $(LDADD) -am_opengateserver_OBJECTS = opengateserver-opengateserver.$(OBJEXT) \ - opengateserver-common.$(OBJEXT) \ - opengateserver-LogManager.$(OBJEXT) \ - opengateserver-InputManager.$(OBJEXT) \ - opengateserver-networkProtocol.$(OBJEXT) \ - opengateserver-networkServer.$(OBJEXT) \ - opengateserver-networkServerUser.$(OBJEXT) \ - opengateserver-metaserver.$(OBJEXT) -opengateserver_OBJECTS = $(am_opengateserver_OBJECTS) -opengateserver_LDADD = $(LDADD) -am_testopenalmanager_OBJECTS = \ - testopenalmanager-testopenalmanager.$(OBJEXT) \ - testopenalmanager-common.$(OBJEXT) \ - testopenalmanager-tinyxml.$(OBJEXT) \ - testopenalmanager-tinyxmlerror.$(OBJEXT) \ - testopenalmanager-tinyxmlparser.$(OBJEXT) \ - testopenalmanager-networkProtocol.$(OBJEXT) \ - testopenalmanager-networkClient.$(OBJEXT) \ - testopenalmanager-Console.$(OBJEXT) \ - testopenalmanager-Entity.$(OBJEXT) \ - testopenalmanager-LogManager.$(OBJEXT) \ - testopenalmanager-InputManager.$(OBJEXT) \ - testopenalmanager-OpenALSoundManager.$(OBJEXT) \ - testopenalmanager-ResourceManager.$(OBJEXT) -testopenalmanager_OBJECTS = $(am_testopenalmanager_OBJECTS) -testopenalmanager_LDADD = $(LDADD) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ - $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(opengateclient_SOURCES) $(opengateserver_SOURCES) \ - $(testopenalmanager_SOURCES) -DIST_SOURCES = $(opengateclient_SOURCES) $(opengateserver_SOURCES) \ - $(testopenalmanager_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AM_LDFLAGS = @AM_LDFLAGS@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CEGUIOGRE_CFLAGS = @CEGUIOGRE_CFLAGS@ -CEGUIOGRE_LIBS = @CEGUIOGRE_LIBS@ -CEGUI_CFLAGS = @CEGUI_CFLAGS@ -CEGUI_LIBS = @CEGUI_LIBS@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -GREP = @GREP@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -OBJEXT = @OBJEXT@ -OGRE_CFLAGS = @OGRE_CFLAGS@ -OGRE_LIBS = @OGRE_LIBS@ -OGSECTOR_EXTERNALS_PATH = @OGSECTOR_EXTERNALS_PATH@ -OIS_CFLAGS = @OIS_CFLAGS@ -OIS_LIBS = @OIS_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -freealut_CFLAGS = @freealut_CFLAGS@ -freealut_LIBS = @freealut_LIBS@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -vorbis_CFLAGS = @vorbis_CFLAGS@ -vorbis_LIBS = @vorbis_LIBS@ -vorbisfile_CFLAGS = @vorbisfile_CFLAGS@ -vorbisfile_LIBS = @vorbisfile_LIBS@ -opengateclient_SOURCES = \ - opengateclient.cpp \ - common.h \ - common.cpp \ - networkProtocol.h \ - networkProtocol.cpp \ - networkClient.h \ - networkClient.cpp \ - tinyxml/tinyxml.h \ - tinyxml/tinyxml.cpp \ - tinyxml/tinyxmlerror.cpp \ - tinyxml/tinyxmlparser.cpp \ - Avatar.h \ - Avatar.cpp \ - BaseDialog.h \ - BaseDialog.cpp \ - ConfigDialog.h \ - ConfigDialog.cpp \ - Console.h \ - Console.cpp \ - DockedState.h \ - DockedState.cpp \ - Entity.h \ - Entity.cpp \ - EntityManager.h \ - EntityManager.cpp \ - GameState.h \ - GameState.cpp \ - GameStateManager.h \ - GameStateManager.cpp \ - InputManager.h \ - InputManager.cpp \ - InitState.h \ - InitState.cpp \ - LogManager.h \ - LogManager.cpp \ - MarketDialog.h \ - MarketDialog.cpp \ - OpcodeWrapper.h \ - OpcodeWrapper.cpp \ - OpenALSoundManager.h \ - OpenALSoundManager.cpp \ - Projectile.h \ - Projectile.cpp \ - ResourceManager.h \ - ResourceManager.cpp \ - Sector.h \ - Sector.cpp \ - SectorObjects.h \ - SectorObjects.cpp \ - ShipConfigDialog.h \ - ShipConfigDialog.cpp \ - Station.h \ - Station.cpp \ - UnDockedState.cpp \ - UnDockedState.h \ - Vessel.h \ - Vessel.cpp \ - VesselManager.h \ - VesselManager.cpp \ - metaserver.h \ - metaserver.cpp - -opengateclient_LDFLAGS = \ - $(OGRE_LIBS) \ - $(CEGUI_LIBS) \ - $(CEGUIOGRE_LIBS) \ - $(freealut_LIBS) \ - $(vorbisfile_LIBS) \ - $(OIS_LIBS) \ - -L$(OGSECTOR_EXTERNALS_PATH)/lib/ - -opengateclient_CXXFLAGS = \ - $(OGRE_CFLAGS) \ - $(CEGUI_CFLAGS) - -opengateserver_SOURCES = \ - opengateserver.cpp \ - common.h \ - common.cpp \ - LogManager.h \ - LogManager.cpp \ - Console.h \ - InputManager.h \ - InputManager.cpp \ - networkProtocol.h \ - networkProtocol.cpp \ - networkServer.h \ - networkServer.cpp \ - networkServerUser.h \ - networkServerUser.cpp \ - metaserver.h \ - metaserver.cpp - -opengateserver_LDFLAGS = \ - $(OGRE_LIBS) \ - $(OIS_LIBS) - -opengateserver_CXXFLAGS = \ - $(OGRE_CFLAGS) - -testopenalmanager_SOURCES = \ - testopenalmanager.cpp \ - common.h \ - common.cpp \ - tinyxml/tinyxml.h \ - tinyxml/tinyxml.cpp \ - tinyxml/tinyxmlerror.cpp \ - tinyxml/tinyxmlparser.cpp \ - networkProtocol.h \ - networkProtocol.cpp \ - networkClient.h \ - networkClient.cpp \ - Console.h \ - Console.cpp \ - Entity.h \ - Entity.cpp \ - LogManager.h \ - LogManager.cpp \ - InputManager.h \ - InputManager.cpp \ - OpenALSoundManager.h \ - OpenALSoundManager.cpp \ - ResourceManager.h \ - ResourceManager.cpp - -testopenalmanager_LDFLAGS = \ - $(OGRE_LIBS) \ - $(CEGUI_LIBS) \ - $(CEGUIOGRE_LIBS) \ - $(freealut_LIBS) \ - $(vorbisfile_LIBS) \ - $(OIS_LIBS) - -testopenalmanager_CXXFLAGS = \ - $(OGRE_CFLAGS) \ - $(CEGUI_CFLAGS) - -all: all-am - -.SUFFIXES: -.SUFFIXES: .cpp .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - if test -f $$p \ - || test -f $$p1 \ - ; then \ - f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ - else :; fi; \ - done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ - rm -f "$(DESTDIR)$(bindir)/$$f"; \ - done - -clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f $$p $$f"; \ - rm -f $$p $$f ; \ - done -opengateclient$(EXEEXT): $(opengateclient_OBJECTS) $(opengateclient_DEPENDENCIES) - @rm -f opengateclient$(EXEEXT) - $(CXXLINK) $(opengateclient_LDFLAGS) $(opengateclient_OBJECTS) $(opengateclient_LDADD) $(LIBS) -opengateserver$(EXEEXT): $(opengateserver_OBJECTS) $(opengateserver_DEPENDENCIES) - @rm -f opengateserver$(EXEEXT) - $(CXXLINK) $(opengateserver_LDFLAGS) $(opengateserver_OBJECTS) $(opengateserver_LDADD) $(LIBS) -testopenalmanager$(EXEEXT): $(testopenalmanager_OBJECTS) $(testopenalmanager_DEPENDENCIES) - @rm -f testopenalmanager$(EXEEXT) - $(CXXLINK) $(testopenalmanager_LDFLAGS) $(testopenalmanager_OBJECTS) $(testopenalmanager_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateclient-Avatar.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateclient-BaseDialog.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateclient-ConfigDialog.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateclient-Console.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateclient-DockedState.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateclient-Entity.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateclient-EntityManager.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateclient-GameState.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateclient-GameStateManager.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateclient-InitState.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateclient-InputManager.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateclient-LogManager.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateclient-MarketDialog.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateclient-OpcodeWrapper.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateclient-OpenALSoundManager.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateclient-Projectile.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateclient-ResourceManager.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateclient-Sector.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateclient-SectorObjects.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateclient-ShipConfigDialog.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateclient-Station.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateclient-UnDockedState.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateclient-Vessel.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateclient-VesselManager.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateclient-common.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateclient-metaserver.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateclient-networkClient.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateclient-networkProtocol.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateclient-opengateclient.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateclient-tinyxml.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateclient-tinyxmlerror.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateclient-tinyxmlparser.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateserver-InputManager.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateserver-LogManager.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateserver-common.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateserver-metaserver.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateserver-networkProtocol.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateserver-networkServer.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateserver-networkServerUser.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengateserver-opengateserver.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testopenalmanager-Console.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testopenalmanager-Entity.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testopenalmanager-InputManager.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testopenalmanager-LogManager.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testopenalmanager-OpenALSoundManager.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testopenalmanager-ResourceManager.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testopenalmanager-common.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testopenalmanager-networkClient.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testopenalmanager-networkProtocol.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testopenalmanager-testopenalmanager.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testopenalmanager-tinyxml.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testopenalmanager-tinyxmlerror.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testopenalmanager-tinyxmlparser.Po@am__quote@ - -.cpp.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< - -.cpp.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.cpp.lo: -@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< - -opengateclient-opengateclient.o: opengateclient.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-opengateclient.o -MD -MP -MF "$(DEPDIR)/opengateclient-opengateclient.Tpo" -c -o opengateclient-opengateclient.o `test -f 'opengateclient.cpp' || echo '$(srcdir)/'`opengateclient.cpp; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-opengateclient.Tpo" "$(DEPDIR)/opengateclient-opengateclient.Po"; else rm -f "$(DEPDIR)/opengateclient-opengateclient.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='opengateclient.cpp' object='opengateclient-opengateclient.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-opengateclient.o `test -f 'opengateclient.cpp' || echo '$(srcdir)/'`opengateclient.cpp - -opengateclient-opengateclient.obj: opengateclient.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-opengateclient.obj -MD -MP -MF "$(DEPDIR)/opengateclient-opengateclient.Tpo" -c -o opengateclient-opengateclient.obj `if test -f 'opengateclient.cpp'; then $(CYGPATH_W) 'opengateclient.cpp'; else $(CYGPATH_W) '$(srcdir)/opengateclient.cpp'; fi`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-opengateclient.Tpo" "$(DEPDIR)/opengateclient-opengateclient.Po"; else rm -f "$(DEPDIR)/opengateclient-opengateclient.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='opengateclient.cpp' object='opengateclient-opengateclient.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-opengateclient.obj `if test -f 'opengateclient.cpp'; then $(CYGPATH_W) 'opengateclient.cpp'; else $(CYGPATH_W) '$(srcdir)/opengateclient.cpp'; fi` - -opengateclient-common.o: common.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-common.o -MD -MP -MF "$(DEPDIR)/opengateclient-common.Tpo" -c -o opengateclient-common.o `test -f 'common.cpp' || echo '$(srcdir)/'`common.cpp; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-common.Tpo" "$(DEPDIR)/opengateclient-common.Po"; else rm -f "$(DEPDIR)/opengateclient-common.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='common.cpp' object='opengateclient-common.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-common.o `test -f 'common.cpp' || echo '$(srcdir)/'`common.cpp - -opengateclient-common.obj: common.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-common.obj -MD -MP -MF "$(DEPDIR)/opengateclient-common.Tpo" -c -o opengateclient-common.obj `if test -f 'common.cpp'; then $(CYGPATH_W) 'common.cpp'; else $(CYGPATH_W) '$(srcdir)/common.cpp'; fi`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-common.Tpo" "$(DEPDIR)/opengateclient-common.Po"; else rm -f "$(DEPDIR)/opengateclient-common.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='common.cpp' object='opengateclient-common.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-common.obj `if test -f 'common.cpp'; then $(CYGPATH_W) 'common.cpp'; else $(CYGPATH_W) '$(srcdir)/common.cpp'; fi` - -opengateclient-networkProtocol.o: networkProtocol.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-networkProtocol.o -MD -MP -MF "$(DEPDIR)/opengateclient-networkProtocol.Tpo" -c -o opengateclient-networkProtocol.o `test -f 'networkProtocol.cpp' || echo '$(srcdir)/'`networkProtocol.cpp; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-networkProtocol.Tpo" "$(DEPDIR)/opengateclient-networkProtocol.Po"; else rm -f "$(DEPDIR)/opengateclient-networkProtocol.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='networkProtocol.cpp' object='opengateclient-networkProtocol.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-networkProtocol.o `test -f 'networkProtocol.cpp' || echo '$(srcdir)/'`networkProtocol.cpp - -opengateclient-networkProtocol.obj: networkProtocol.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-networkProtocol.obj -MD -MP -MF "$(DEPDIR)/opengateclient-networkProtocol.Tpo" -c -o opengateclient-networkProtocol.obj `if test -f 'networkProtocol.cpp'; then $(CYGPATH_W) 'networkProtocol.cpp'; else $(CYGPATH_W) '$(srcdir)/networkProtocol.cpp'; fi`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-networkProtocol.Tpo" "$(DEPDIR)/opengateclient-networkProtocol.Po"; else rm -f "$(DEPDIR)/opengateclient-networkProtocol.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='networkProtocol.cpp' object='opengateclient-networkProtocol.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-networkProtocol.obj `if test -f 'networkProtocol.cpp'; then $(CYGPATH_W) 'networkProtocol.cpp'; else $(CYGPATH_W) '$(srcdir)/networkProtocol.cpp'; fi` - -opengateclient-networkClient.o: networkClient.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-networkClient.o -MD -MP -MF "$(DEPDIR)/opengateclient-networkClient.Tpo" -c -o opengateclient-networkClient.o `test -f 'networkClient.cpp' || echo '$(srcdir)/'`networkClient.cpp; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-networkClient.Tpo" "$(DEPDIR)/opengateclient-networkClient.Po"; else rm -f "$(DEPDIR)/opengateclient-networkClient.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='networkClient.cpp' object='opengateclient-networkClient.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-networkClient.o `test -f 'networkClient.cpp' || echo '$(srcdir)/'`networkClient.cpp - -opengateclient-networkClient.obj: networkClient.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-networkClient.obj -MD -MP -MF "$(DEPDIR)/opengateclient-networkClient.Tpo" -c -o opengateclient-networkClient.obj `if test -f 'networkClient.cpp'; then $(CYGPATH_W) 'networkClient.cpp'; else $(CYGPATH_W) '$(srcdir)/networkClient.cpp'; fi`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-networkClient.Tpo" "$(DEPDIR)/opengateclient-networkClient.Po"; else rm -f "$(DEPDIR)/opengateclient-networkClient.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='networkClient.cpp' object='opengateclient-networkClient.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-networkClient.obj `if test -f 'networkClient.cpp'; then $(CYGPATH_W) 'networkClient.cpp'; else $(CYGPATH_W) '$(srcdir)/networkClient.cpp'; fi` - -opengateclient-tinyxml.o: tinyxml/tinyxml.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-tinyxml.o -MD -MP -MF "$(DEPDIR)/opengateclient-tinyxml.Tpo" -c -o opengateclient-tinyxml.o `test -f 'tinyxml/tinyxml.cpp' || echo '$(srcdir)/'`tinyxml/tinyxml.cpp; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-tinyxml.Tpo" "$(DEPDIR)/opengateclient-tinyxml.Po"; else rm -f "$(DEPDIR)/opengateclient-tinyxml.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='tinyxml/tinyxml.cpp' object='opengateclient-tinyxml.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-tinyxml.o `test -f 'tinyxml/tinyxml.cpp' || echo '$(srcdir)/'`tinyxml/tinyxml.cpp - -opengateclient-tinyxml.obj: tinyxml/tinyxml.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-tinyxml.obj -MD -MP -MF "$(DEPDIR)/opengateclient-tinyxml.Tpo" -c -o opengateclient-tinyxml.obj `if test -f 'tinyxml/tinyxml.cpp'; then $(CYGPATH_W) 'tinyxml/tinyxml.cpp'; else $(CYGPATH_W) '$(srcdir)/tinyxml/tinyxml.cpp'; fi`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-tinyxml.Tpo" "$(DEPDIR)/opengateclient-tinyxml.Po"; else rm -f "$(DEPDIR)/opengateclient-tinyxml.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='tinyxml/tinyxml.cpp' object='opengateclient-tinyxml.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-tinyxml.obj `if test -f 'tinyxml/tinyxml.cpp'; then $(CYGPATH_W) 'tinyxml/tinyxml.cpp'; else $(CYGPATH_W) '$(srcdir)/tinyxml/tinyxml.cpp'; fi` - -opengateclient-tinyxmlerror.o: tinyxml/tinyxmlerror.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-tinyxmlerror.o -MD -MP -MF "$(DEPDIR)/opengateclient-tinyxmlerror.Tpo" -c -o opengateclient-tinyxmlerror.o `test -f 'tinyxml/tinyxmlerror.cpp' || echo '$(srcdir)/'`tinyxml/tinyxmlerror.cpp; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-tinyxmlerror.Tpo" "$(DEPDIR)/opengateclient-tinyxmlerror.Po"; else rm -f "$(DEPDIR)/opengateclient-tinyxmlerror.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='tinyxml/tinyxmlerror.cpp' object='opengateclient-tinyxmlerror.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-tinyxmlerror.o `test -f 'tinyxml/tinyxmlerror.cpp' || echo '$(srcdir)/'`tinyxml/tinyxmlerror.cpp - -opengateclient-tinyxmlerror.obj: tinyxml/tinyxmlerror.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-tinyxmlerror.obj -MD -MP -MF "$(DEPDIR)/opengateclient-tinyxmlerror.Tpo" -c -o opengateclient-tinyxmlerror.obj `if test -f 'tinyxml/tinyxmlerror.cpp'; then $(CYGPATH_W) 'tinyxml/tinyxmlerror.cpp'; else $(CYGPATH_W) '$(srcdir)/tinyxml/tinyxmlerror.cpp'; fi`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-tinyxmlerror.Tpo" "$(DEPDIR)/opengateclient-tinyxmlerror.Po"; else rm -f "$(DEPDIR)/opengateclient-tinyxmlerror.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='tinyxml/tinyxmlerror.cpp' object='opengateclient-tinyxmlerror.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-tinyxmlerror.obj `if test -f 'tinyxml/tinyxmlerror.cpp'; then $(CYGPATH_W) 'tinyxml/tinyxmlerror.cpp'; else $(CYGPATH_W) '$(srcdir)/tinyxml/tinyxmlerror.cpp'; fi` - -opengateclient-tinyxmlparser.o: tinyxml/tinyxmlparser.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-tinyxmlparser.o -MD -MP -MF "$(DEPDIR)/opengateclient-tinyxmlparser.Tpo" -c -o opengateclient-tinyxmlparser.o `test -f 'tinyxml/tinyxmlparser.cpp' || echo '$(srcdir)/'`tinyxml/tinyxmlparser.cpp; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-tinyxmlparser.Tpo" "$(DEPDIR)/opengateclient-tinyxmlparser.Po"; else rm -f "$(DEPDIR)/opengateclient-tinyxmlparser.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='tinyxml/tinyxmlparser.cpp' object='opengateclient-tinyxmlparser.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-tinyxmlparser.o `test -f 'tinyxml/tinyxmlparser.cpp' || echo '$(srcdir)/'`tinyxml/tinyxmlparser.cpp - -opengateclient-tinyxmlparser.obj: tinyxml/tinyxmlparser.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-tinyxmlparser.obj -MD -MP -MF "$(DEPDIR)/opengateclient-tinyxmlparser.Tpo" -c -o opengateclient-tinyxmlparser.obj `if test -f 'tinyxml/tinyxmlparser.cpp'; then $(CYGPATH_W) 'tinyxml/tinyxmlparser.cpp'; else $(CYGPATH_W) '$(srcdir)/tinyxml/tinyxmlparser.cpp'; fi`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-tinyxmlparser.Tpo" "$(DEPDIR)/opengateclient-tinyxmlparser.Po"; else rm -f "$(DEPDIR)/opengateclient-tinyxmlparser.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='tinyxml/tinyxmlparser.cpp' object='opengateclient-tinyxmlparser.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-tinyxmlparser.obj `if test -f 'tinyxml/tinyxmlparser.cpp'; then $(CYGPATH_W) 'tinyxml/tinyxmlparser.cpp'; else $(CYGPATH_W) '$(srcdir)/tinyxml/tinyxmlparser.cpp'; fi` - -opengateclient-Avatar.o: Avatar.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-Avatar.o -MD -MP -MF "$(DEPDIR)/opengateclient-Avatar.Tpo" -c -o opengateclient-Avatar.o `test -f 'Avatar.cpp' || echo '$(srcdir)/'`Avatar.cpp; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-Avatar.Tpo" "$(DEPDIR)/opengateclient-Avatar.Po"; else rm -f "$(DEPDIR)/opengateclient-Avatar.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Avatar.cpp' object='opengateclient-Avatar.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-Avatar.o `test -f 'Avatar.cpp' || echo '$(srcdir)/'`Avatar.cpp - -opengateclient-Avatar.obj: Avatar.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-Avatar.obj -MD -MP -MF "$(DEPDIR)/opengateclient-Avatar.Tpo" -c -o opengateclient-Avatar.obj `if test -f 'Avatar.cpp'; then $(CYGPATH_W) 'Avatar.cpp'; else $(CYGPATH_W) '$(srcdir)/Avatar.cpp'; fi`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-Avatar.Tpo" "$(DEPDIR)/opengateclient-Avatar.Po"; else rm -f "$(DEPDIR)/opengateclient-Avatar.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Avatar.cpp' object='opengateclient-Avatar.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-Avatar.obj `if test -f 'Avatar.cpp'; then $(CYGPATH_W) 'Avatar.cpp'; else $(CYGPATH_W) '$(srcdir)/Avatar.cpp'; fi` - -opengateclient-BaseDialog.o: BaseDialog.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-BaseDialog.o -MD -MP -MF "$(DEPDIR)/opengateclient-BaseDialog.Tpo" -c -o opengateclient-BaseDialog.o `test -f 'BaseDialog.cpp' || echo '$(srcdir)/'`BaseDialog.cpp; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-BaseDialog.Tpo" "$(DEPDIR)/opengateclient-BaseDialog.Po"; else rm -f "$(DEPDIR)/opengateclient-BaseDialog.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='BaseDialog.cpp' object='opengateclient-BaseDialog.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-BaseDialog.o `test -f 'BaseDialog.cpp' || echo '$(srcdir)/'`BaseDialog.cpp - -opengateclient-BaseDialog.obj: BaseDialog.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-BaseDialog.obj -MD -MP -MF "$(DEPDIR)/opengateclient-BaseDialog.Tpo" -c -o opengateclient-BaseDialog.obj `if test -f 'BaseDialog.cpp'; then $(CYGPATH_W) 'BaseDialog.cpp'; else $(CYGPATH_W) '$(srcdir)/BaseDialog.cpp'; fi`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-BaseDialog.Tpo" "$(DEPDIR)/opengateclient-BaseDialog.Po"; else rm -f "$(DEPDIR)/opengateclient-BaseDialog.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='BaseDialog.cpp' object='opengateclient-BaseDialog.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-BaseDialog.obj `if test -f 'BaseDialog.cpp'; then $(CYGPATH_W) 'BaseDialog.cpp'; else $(CYGPATH_W) '$(srcdir)/BaseDialog.cpp'; fi` - -opengateclient-ConfigDialog.o: ConfigDialog.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-ConfigDialog.o -MD -MP -MF "$(DEPDIR)/opengateclient-ConfigDialog.Tpo" -c -o opengateclient-ConfigDialog.o `test -f 'ConfigDialog.cpp' || echo '$(srcdir)/'`ConfigDialog.cpp; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-ConfigDialog.Tpo" "$(DEPDIR)/opengateclient-ConfigDialog.Po"; else rm -f "$(DEPDIR)/opengateclient-ConfigDialog.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ConfigDialog.cpp' object='opengateclient-ConfigDialog.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-ConfigDialog.o `test -f 'ConfigDialog.cpp' || echo '$(srcdir)/'`ConfigDialog.cpp - -opengateclient-ConfigDialog.obj: ConfigDialog.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-ConfigDialog.obj -MD -MP -MF "$(DEPDIR)/opengateclient-ConfigDialog.Tpo" -c -o opengateclient-ConfigDialog.obj `if test -f 'ConfigDialog.cpp'; then $(CYGPATH_W) 'ConfigDialog.cpp'; else $(CYGPATH_W) '$(srcdir)/ConfigDialog.cpp'; fi`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-ConfigDialog.Tpo" "$(DEPDIR)/opengateclient-ConfigDialog.Po"; else rm -f "$(DEPDIR)/opengateclient-ConfigDialog.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ConfigDialog.cpp' object='opengateclient-ConfigDialog.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-ConfigDialog.obj `if test -f 'ConfigDialog.cpp'; then $(CYGPATH_W) 'ConfigDialog.cpp'; else $(CYGPATH_W) '$(srcdir)/ConfigDialog.cpp'; fi` - -opengateclient-Console.o: Console.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-Console.o -MD -MP -MF "$(DEPDIR)/opengateclient-Console.Tpo" -c -o opengateclient-Console.o `test -f 'Console.cpp' || echo '$(srcdir)/'`Console.cpp; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-Console.Tpo" "$(DEPDIR)/opengateclient-Console.Po"; else rm -f "$(DEPDIR)/opengateclient-Console.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Console.cpp' object='opengateclient-Console.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-Console.o `test -f 'Console.cpp' || echo '$(srcdir)/'`Console.cpp - -opengateclient-Console.obj: Console.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-Console.obj -MD -MP -MF "$(DEPDIR)/opengateclient-Console.Tpo" -c -o opengateclient-Console.obj `if test -f 'Console.cpp'; then $(CYGPATH_W) 'Console.cpp'; else $(CYGPATH_W) '$(srcdir)/Console.cpp'; fi`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-Console.Tpo" "$(DEPDIR)/opengateclient-Console.Po"; else rm -f "$(DEPDIR)/opengateclient-Console.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Console.cpp' object='opengateclient-Console.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-Console.obj `if test -f 'Console.cpp'; then $(CYGPATH_W) 'Console.cpp'; else $(CYGPATH_W) '$(srcdir)/Console.cpp'; fi` - -opengateclient-DockedState.o: DockedState.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-DockedState.o -MD -MP -MF "$(DEPDIR)/opengateclient-DockedState.Tpo" -c -o opengateclient-DockedState.o `test -f 'DockedState.cpp' || echo '$(srcdir)/'`DockedState.cpp; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-DockedState.Tpo" "$(DEPDIR)/opengateclient-DockedState.Po"; else rm -f "$(DEPDIR)/opengateclient-DockedState.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DockedState.cpp' object='opengateclient-DockedState.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-DockedState.o `test -f 'DockedState.cpp' || echo '$(srcdir)/'`DockedState.cpp - -opengateclient-DockedState.obj: DockedState.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-DockedState.obj -MD -MP -MF "$(DEPDIR)/opengateclient-DockedState.Tpo" -c -o opengateclient-DockedState.obj `if test -f 'DockedState.cpp'; then $(CYGPATH_W) 'DockedState.cpp'; else $(CYGPATH_W) '$(srcdir)/DockedState.cpp'; fi`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-DockedState.Tpo" "$(DEPDIR)/opengateclient-DockedState.Po"; else rm -f "$(DEPDIR)/opengateclient-DockedState.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DockedState.cpp' object='opengateclient-DockedState.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-DockedState.obj `if test -f 'DockedState.cpp'; then $(CYGPATH_W) 'DockedState.cpp'; else $(CYGPATH_W) '$(srcdir)/DockedState.cpp'; fi` - -opengateclient-Entity.o: Entity.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-Entity.o -MD -MP -MF "$(DEPDIR)/opengateclient-Entity.Tpo" -c -o opengateclient-Entity.o `test -f 'Entity.cpp' || echo '$(srcdir)/'`Entity.cpp; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-Entity.Tpo" "$(DEPDIR)/opengateclient-Entity.Po"; else rm -f "$(DEPDIR)/opengateclient-Entity.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Entity.cpp' object='opengateclient-Entity.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-Entity.o `test -f 'Entity.cpp' || echo '$(srcdir)/'`Entity.cpp - -opengateclient-Entity.obj: Entity.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-Entity.obj -MD -MP -MF "$(DEPDIR)/opengateclient-Entity.Tpo" -c -o opengateclient-Entity.obj `if test -f 'Entity.cpp'; then $(CYGPATH_W) 'Entity.cpp'; else $(CYGPATH_W) '$(srcdir)/Entity.cpp'; fi`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-Entity.Tpo" "$(DEPDIR)/opengateclient-Entity.Po"; else rm -f "$(DEPDIR)/opengateclient-Entity.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Entity.cpp' object='opengateclient-Entity.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-Entity.obj `if test -f 'Entity.cpp'; then $(CYGPATH_W) 'Entity.cpp'; else $(CYGPATH_W) '$(srcdir)/Entity.cpp'; fi` - -opengateclient-EntityManager.o: EntityManager.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-EntityManager.o -MD -MP -MF "$(DEPDIR)/opengateclient-EntityManager.Tpo" -c -o opengateclient-EntityManager.o `test -f 'EntityManager.cpp' || echo '$(srcdir)/'`EntityManager.cpp; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-EntityManager.Tpo" "$(DEPDIR)/opengateclient-EntityManager.Po"; else rm -f "$(DEPDIR)/opengateclient-EntityManager.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='EntityManager.cpp' object='opengateclient-EntityManager.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-EntityManager.o `test -f 'EntityManager.cpp' || echo '$(srcdir)/'`EntityManager.cpp - -opengateclient-EntityManager.obj: EntityManager.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-EntityManager.obj -MD -MP -MF "$(DEPDIR)/opengateclient-EntityManager.Tpo" -c -o opengateclient-EntityManager.obj `if test -f 'EntityManager.cpp'; then $(CYGPATH_W) 'EntityManager.cpp'; else $(CYGPATH_W) '$(srcdir)/EntityManager.cpp'; fi`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-EntityManager.Tpo" "$(DEPDIR)/opengateclient-EntityManager.Po"; else rm -f "$(DEPDIR)/opengateclient-EntityManager.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='EntityManager.cpp' object='opengateclient-EntityManager.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-EntityManager.obj `if test -f 'EntityManager.cpp'; then $(CYGPATH_W) 'EntityManager.cpp'; else $(CYGPATH_W) '$(srcdir)/EntityManager.cpp'; fi` - -opengateclient-GameState.o: GameState.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-GameState.o -MD -MP -MF "$(DEPDIR)/opengateclient-GameState.Tpo" -c -o opengateclient-GameState.o `test -f 'GameState.cpp' || echo '$(srcdir)/'`GameState.cpp; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-GameState.Tpo" "$(DEPDIR)/opengateclient-GameState.Po"; else rm -f "$(DEPDIR)/opengateclient-GameState.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='GameState.cpp' object='opengateclient-GameState.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-GameState.o `test -f 'GameState.cpp' || echo '$(srcdir)/'`GameState.cpp - -opengateclient-GameState.obj: GameState.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-GameState.obj -MD -MP -MF "$(DEPDIR)/opengateclient-GameState.Tpo" -c -o opengateclient-GameState.obj `if test -f 'GameState.cpp'; then $(CYGPATH_W) 'GameState.cpp'; else $(CYGPATH_W) '$(srcdir)/GameState.cpp'; fi`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-GameState.Tpo" "$(DEPDIR)/opengateclient-GameState.Po"; else rm -f "$(DEPDIR)/opengateclient-GameState.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='GameState.cpp' object='opengateclient-GameState.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-GameState.obj `if test -f 'GameState.cpp'; then $(CYGPATH_W) 'GameState.cpp'; else $(CYGPATH_W) '$(srcdir)/GameState.cpp'; fi` - -opengateclient-GameStateManager.o: GameStateManager.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-GameStateManager.o -MD -MP -MF "$(DEPDIR)/opengateclient-GameStateManager.Tpo" -c -o opengateclient-GameStateManager.o `test -f 'GameStateManager.cpp' || echo '$(srcdir)/'`GameStateManager.cpp; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-GameStateManager.Tpo" "$(DEPDIR)/opengateclient-GameStateManager.Po"; else rm -f "$(DEPDIR)/opengateclient-GameStateManager.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='GameStateManager.cpp' object='opengateclient-GameStateManager.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-GameStateManager.o `test -f 'GameStateManager.cpp' || echo '$(srcdir)/'`GameStateManager.cpp - -opengateclient-GameStateManager.obj: GameStateManager.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-GameStateManager.obj -MD -MP -MF "$(DEPDIR)/opengateclient-GameStateManager.Tpo" -c -o opengateclient-GameStateManager.obj `if test -f 'GameStateManager.cpp'; then $(CYGPATH_W) 'GameStateManager.cpp'; else $(CYGPATH_W) '$(srcdir)/GameStateManager.cpp'; fi`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-GameStateManager.Tpo" "$(DEPDIR)/opengateclient-GameStateManager.Po"; else rm -f "$(DEPDIR)/opengateclient-GameStateManager.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='GameStateManager.cpp' object='opengateclient-GameStateManager.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-GameStateManager.obj `if test -f 'GameStateManager.cpp'; then $(CYGPATH_W) 'GameStateManager.cpp'; else $(CYGPATH_W) '$(srcdir)/GameStateManager.cpp'; fi` - -opengateclient-InputManager.o: InputManager.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-InputManager.o -MD -MP -MF "$(DEPDIR)/opengateclient-InputManager.Tpo" -c -o opengateclient-InputManager.o `test -f 'InputManager.cpp' || echo '$(srcdir)/'`InputManager.cpp; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-InputManager.Tpo" "$(DEPDIR)/opengateclient-InputManager.Po"; else rm -f "$(DEPDIR)/opengateclient-InputManager.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='InputManager.cpp' object='opengateclient-InputManager.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-InputManager.o `test -f 'InputManager.cpp' || echo '$(srcdir)/'`InputManager.cpp - -opengateclient-InputManager.obj: InputManager.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-InputManager.obj -MD -MP -MF "$(DEPDIR)/opengateclient-InputManager.Tpo" -c -o opengateclient-InputManager.obj `if test -f 'InputManager.cpp'; then $(CYGPATH_W) 'InputManager.cpp'; else $(CYGPATH_W) '$(srcdir)/InputManager.cpp'; fi`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-InputManager.Tpo" "$(DEPDIR)/opengateclient-InputManager.Po"; else rm -f "$(DEPDIR)/opengateclient-InputManager.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='InputManager.cpp' object='opengateclient-InputManager.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-InputManager.obj `if test -f 'InputManager.cpp'; then $(CYGPATH_W) 'InputManager.cpp'; else $(CYGPATH_W) '$(srcdir)/InputManager.cpp'; fi` - -opengateclient-InitState.o: InitState.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-InitState.o -MD -MP -MF "$(DEPDIR)/opengateclient-InitState.Tpo" -c -o opengateclient-InitState.o `test -f 'InitState.cpp' || echo '$(srcdir)/'`InitState.cpp; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-InitState.Tpo" "$(DEPDIR)/opengateclient-InitState.Po"; else rm -f "$(DEPDIR)/opengateclient-InitState.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='InitState.cpp' object='opengateclient-InitState.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -c -o opengateclient-InitState.o `test -f 'InitState.cpp' || echo '$(srcdir)/'`InitState.cpp - -opengateclient-InitState.obj: InitState.cpp -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(opengateclient_CXXFLAGS) $(CXXFLAGS) -MT opengateclient-InitState.obj -MD -MP -MF "$(DEPDIR)/opengateclient-InitState.Tpo" -c -o opengateclient-InitState.obj `if test -f 'InitState.cpp'; then $(CYGPATH_W) 'InitState.cpp'; else $(CYGPATH_W) '$(srcdir)/InitState.cpp'; fi`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/opengateclient-InitState.Tpo" "$(DEPDIR)/opengateclient-InitState.Po"; else rm -f "$(DEPDIR)/opengateclient-InitState.Tpo"; exit 1;... [truncated message content] |