From: <spo...@us...> - 2007-03-18 11:17:46
|
Revision: 326 http://svn.sourceforge.net/opengate/?rev=326&view=rev Author: spom_spom Date: 2007-03-17 10:11:31 -0700 (Sat, 17 Mar 2007) Log Message: ----------- Added Paths: ----------- branches/ogsector/screenshots/ branches/ogsector/screenshots/screenshot.png branches/ogsector/screenshots/screenshot2.png branches/ogsector/screenshots/screenshot3.png Added: branches/ogsector/screenshots/screenshot.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/screenshots/screenshot.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/screenshots/screenshot2.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/screenshots/screenshot2.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/screenshots/screenshot3.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/screenshots/screenshot3.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2007-03-19 02:16:29
|
Revision: 331 http://svn.sourceforge.net/opengate/?rev=331&view=rev Author: spom_spom Date: 2007-03-17 13:13:14 -0700 (Sat, 17 Mar 2007) Log Message: ----------- Modified Paths: -------------- branches/ogsector/externals/ois-1.0RC1/Makefile.in branches/ogsector/resources.cfg Modified: branches/ogsector/externals/ois-1.0RC1/Makefile.in =================================================================== --- branches/ogsector/externals/ois-1.0RC1/Makefile.in 2007-03-17 20:10:28 UTC (rev 330) +++ branches/ogsector/externals/ois-1.0RC1/Makefile.in 2007-03-17 20:13:14 UTC (rev 331) @@ -160,7 +160,8 @@ check-recursive installcheck-recursive DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/configure Makefile.am \ OIS.pc.in acinclude.m4 aclocal.m4 config.guess config.sub \ - configure.ac depcomp install-sh ltmain.sh missing mkinstalldirs + configure configure.ac depcomp install-sh ltmain.sh missing \ + mkinstalldirs DIST_SUBDIRS = $(SUBDIRS) all: all-recursive Modified: branches/ogsector/resources.cfg =================================================================== --- branches/ogsector/resources.cfg 2007-03-17 20:10:28 UTC (rev 330) +++ branches/ogsector/resources.cfg 2007-03-17 20:13:14 UTC (rev 331) @@ -10,5 +10,5 @@ FileSystem=./data/MediaFromOgre Zip=./data/MediaFromOgre/fonts.zip -FileSystem=../trunk/data/ -FileSystem=../trunk/data/materials +FileSystem=../../trunk/data/ +FileSystem=../../trunk/data/materials This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2007-03-19 02:20:13
|
Revision: 332 http://svn.sourceforge.net/opengate/?rev=332&view=rev Author: spom_spom Date: 2007-03-17 13:42:46 -0700 (Sat, 17 Mar 2007) Log Message: ----------- Modified Paths: -------------- branches/ogsector/externals/genExternals.sh branches/ogsector/src/SectorClientFrameListener.cpp Modified: branches/ogsector/externals/genExternals.sh =================================================================== --- branches/ogsector/externals/genExternals.sh 2007-03-17 20:13:14 UTC (rev 331) +++ branches/ogsector/externals/genExternals.sh 2007-03-17 20:42:46 UTC (rev 332) @@ -85,7 +85,8 @@ [ -f "Makefile" ] && make clean else make - ln -sf ../$OGREOPCODE/opcode132/libOpcode.so $INSTALLPATH/lib + [ -d "$INSTALLPATH/lib" ] || mkdir $INSTALLPATH/lib + ln -sf ../$OGREOPCODE/opcode132/libOpcode.so $INSTALLPATH/lib ln -sf ../$OGREOPCODE/opcode132/libOpcode.so.13 $INSTALLPATH/lib ln -sf ../$OGREOPCODE/opcode132/libOpcode.so.13.1 $INSTALLPATH/lib ln -sf ../$OGREOPCODE/src/libOgreOpcode.so.0.3 $INSTALLPATH/lib Modified: branches/ogsector/src/SectorClientFrameListener.cpp =================================================================== --- branches/ogsector/src/SectorClientFrameListener.cpp 2007-03-17 20:13:14 UTC (rev 331) +++ branches/ogsector/src/SectorClientFrameListener.cpp 2007-03-17 20:42:46 UTC (rev 332) @@ -128,7 +128,7 @@ //** capture my input inputManager_->capture(); - if ( timeSinceLastNetworkUpdate_ > 0.01 ){// max 100 net-updates/second + if ( timeSinceLastNetworkUpdate_ > 0.02 ){// max 100 net-updates/second std::vector < std::vector < Uint8 > > msgs; network_->pull( msgs ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2007-03-19 02:48:14
|
Revision: 327 http://svn.sourceforge.net/opengate/?rev=327&view=rev Author: spom_spom Date: 2007-03-17 12:44:27 -0700 (Sat, 17 Mar 2007) Log Message: ----------- Add ogsector: externals, data, sources Added Paths: ----------- branches/ogsector/Makefile.am branches/ogsector/Readme branches/ogsector/ToDo branches/ogsector/aclocal.m4 branches/ogsector/bootstrap branches/ogsector/config.h.in branches/ogsector/configure.ac branches/ogsector/data/ branches/ogsector/data/Bullet.png branches/ogsector/data/HUDCenter.png branches/ogsector/data/HUDTarget.png branches/ogsector/data/MediaFromOgre/ branches/ogsector/data/MediaFromOgre/Example.material branches/ogsector/data/MediaFromOgre/GreenSkin.jpg branches/ogsector/data/MediaFromOgre/Ogre.material branches/ogsector/data/MediaFromOgre/WeirdEye.png branches/ogsector/data/MediaFromOgre/dirt01.jpg branches/ogsector/data/MediaFromOgre/flare.png branches/ogsector/data/MediaFromOgre/flaretrail.png branches/ogsector/data/MediaFromOgre/fonts.zip branches/ogsector/data/MediaFromOgre/ogrehead.mesh branches/ogsector/data/MediaFromOgre/spacedust.particle branches/ogsector/data/MediaFromOgre/spheremap.png branches/ogsector/data/MousePointer.material branches/ogsector/data/MousePointer.overlay branches/ogsector/data/MousePointer.png branches/ogsector/data/ammo.material branches/ogsector/data/arrow.mesh branches/ogsector/data/povray/ branches/ogsector/data/povray/buildSkyBox.sh branches/ogsector/data/povray/skybox1.pov branches/ogsector/data/povray/skybox2.pov branches/ogsector/data/simpleHUD.material branches/ogsector/data/simpleHUD.overlay branches/ogsector/data/simpleSkybox.material branches/ogsector/data/simpleSkybox.zip branches/ogsector/data/sounds/ branches/ogsector/data/sounds/KAPOW2.WAV branches/ogsector/data/sounds/noo.wav branches/ogsector/data/sounds/readme branches/ogsector/data/sounds/test.wav branches/ogsector/data/sounds/test2.wav branches/ogsector/data/wings/ branches/ogsector/data/wings/arrow.wings branches/ogsector/depcomp branches/ogsector/externals/ branches/ogsector/externals/genExternals.sh branches/ogsector/externals/libgrapple branches/ogsector/externals/libgrapple-0.9.1/ branches/ogsector/externals/libgrapple-0.9.1/GRAPPLE.pc.in branches/ogsector/externals/libgrapple-0.9.1/LICENSE branches/ogsector/externals/libgrapple-0.9.1/Makefile.am branches/ogsector/externals/libgrapple-0.9.1/Makefile.in branches/ogsector/externals/libgrapple-0.9.1/README branches/ogsector/externals/libgrapple-0.9.1/README.lobby branches/ogsector/externals/libgrapple-0.9.1/UPDATES branches/ogsector/externals/libgrapple-0.9.1/autogen.sh branches/ogsector/externals/libgrapple-0.9.1/config.guess branches/ogsector/externals/libgrapple-0.9.1/config.sub branches/ogsector/externals/libgrapple-0.9.1/configure.in branches/ogsector/externals/libgrapple-0.9.1/depcomp branches/ogsector/externals/libgrapple-0.9.1/install-sh branches/ogsector/externals/libgrapple-0.9.1/m4/ branches/ogsector/externals/libgrapple-0.9.1/m4/acx_pthread.m4 branches/ogsector/externals/libgrapple-0.9.1/missing branches/ogsector/externals/libgrapple-0.9.1/src/ branches/ogsector/externals/libgrapple-0.9.1/src/Makefile.am branches/ogsector/externals/libgrapple-0.9.1/src/Makefile.in branches/ogsector/externals/libgrapple-0.9.1/src/dynstring.c branches/ogsector/externals/libgrapple-0.9.1/src/dynstring.h branches/ogsector/externals/libgrapple-0.9.1/src/grapple.h branches/ogsector/externals/libgrapple-0.9.1/src/grapple_callback.c branches/ogsector/externals/libgrapple-0.9.1/src/grapple_callback.h branches/ogsector/externals/libgrapple-0.9.1/src/grapple_callback_dispatcher.c branches/ogsector/externals/libgrapple-0.9.1/src/grapple_callback_dispatcher.h branches/ogsector/externals/libgrapple-0.9.1/src/grapple_callback_internal.h branches/ogsector/externals/libgrapple-0.9.1/src/grapple_client.c branches/ogsector/externals/libgrapple-0.9.1/src/grapple_client.h branches/ogsector/externals/libgrapple-0.9.1/src/grapple_client_internal.h branches/ogsector/externals/libgrapple-0.9.1/src/grapple_client_thread.c branches/ogsector/externals/libgrapple-0.9.1/src/grapple_client_thread.h branches/ogsector/externals/libgrapple-0.9.1/src/grapple_comms.c branches/ogsector/externals/libgrapple-0.9.1/src/grapple_comms.h branches/ogsector/externals/libgrapple-0.9.1/src/grapple_comms_api.c branches/ogsector/externals/libgrapple-0.9.1/src/grapple_comms_api.h branches/ogsector/externals/libgrapple-0.9.1/src/grapple_confirm.c branches/ogsector/externals/libgrapple-0.9.1/src/grapple_confirm.h branches/ogsector/externals/libgrapple-0.9.1/src/grapple_connection.c branches/ogsector/externals/libgrapple-0.9.1/src/grapple_connection.h branches/ogsector/externals/libgrapple-0.9.1/src/grapple_defines.h branches/ogsector/externals/libgrapple-0.9.1/src/grapple_enums.h branches/ogsector/externals/libgrapple-0.9.1/src/grapple_error.c branches/ogsector/externals/libgrapple-0.9.1/src/grapple_error.h branches/ogsector/externals/libgrapple-0.9.1/src/grapple_error_internal.h branches/ogsector/externals/libgrapple-0.9.1/src/grapple_failover.c branches/ogsector/externals/libgrapple-0.9.1/src/grapple_failover.h branches/ogsector/externals/libgrapple-0.9.1/src/grapple_group.c branches/ogsector/externals/libgrapple-0.9.1/src/grapple_group.h branches/ogsector/externals/libgrapple-0.9.1/src/grapple_internal.h branches/ogsector/externals/libgrapple-0.9.1/src/grapple_lobby.c branches/ogsector/externals/libgrapple-0.9.1/src/grapple_lobby.h branches/ogsector/externals/libgrapple-0.9.1/src/grapple_lobby_internal.h branches/ogsector/externals/libgrapple-0.9.1/src/grapple_lobbycallback.c branches/ogsector/externals/libgrapple-0.9.1/src/grapple_lobbycallback.h branches/ogsector/externals/libgrapple-0.9.1/src/grapple_lobbyclient.c branches/ogsector/externals/libgrapple-0.9.1/src/grapple_lobbyclient_thread.c branches/ogsector/externals/libgrapple-0.9.1/src/grapple_lobbyclient_thread.h branches/ogsector/externals/libgrapple-0.9.1/src/grapple_lobbyconnection.c branches/ogsector/externals/libgrapple-0.9.1/src/grapple_lobbyconnection.h branches/ogsector/externals/libgrapple-0.9.1/src/grapple_lobbygame.c branches/ogsector/externals/libgrapple-0.9.1/src/grapple_lobbygame.h branches/ogsector/externals/libgrapple-0.9.1/src/grapple_lobbymessage.c branches/ogsector/externals/libgrapple-0.9.1/src/grapple_lobbymessage.h branches/ogsector/externals/libgrapple-0.9.1/src/grapple_message.c branches/ogsector/externals/libgrapple-0.9.1/src/grapple_message.h branches/ogsector/externals/libgrapple-0.9.1/src/grapple_message_internal.h branches/ogsector/externals/libgrapple-0.9.1/src/grapple_protocols.h branches/ogsector/externals/libgrapple-0.9.1/src/grapple_queue.c branches/ogsector/externals/libgrapple-0.9.1/src/grapple_queue.h branches/ogsector/externals/libgrapple-0.9.1/src/grapple_server.c branches/ogsector/externals/libgrapple-0.9.1/src/grapple_server.h branches/ogsector/externals/libgrapple-0.9.1/src/grapple_server_internal.h branches/ogsector/externals/libgrapple-0.9.1/src/grapple_server_thread.c branches/ogsector/externals/libgrapple-0.9.1/src/grapple_server_thread.h branches/ogsector/externals/libgrapple-0.9.1/src/grapple_structs.h branches/ogsector/externals/libgrapple-0.9.1/src/grapple_types.h branches/ogsector/externals/libgrapple-0.9.1/src/prototypes.h branches/ogsector/externals/libgrapple-0.9.1/src/socket.c branches/ogsector/externals/libgrapple-0.9.1/src/socket.h branches/ogsector/externals/libgrapple-0.9.1/src/tools.c branches/ogsector/externals/libgrapple-0.9.1/src/tools.h branches/ogsector/externals/libgrapple-0.9.1/test/ branches/ogsector/externals/libgrapple-0.9.1/test/Makefile.am branches/ogsector/externals/libgrapple-0.9.1/test/Makefile.in branches/ogsector/externals/libgrapple-0.9.1/test/failovertest.c branches/ogsector/externals/libgrapple-0.9.1/test/lobbytest.c branches/ogsector/externals/libgrapple-0.9.1/test/test.c branches/ogsector/externals/libgrapple-0.9.1/test/test.h branches/ogsector/externals/libgrapple-0.9.1/test/udptest.c branches/ogsector/externals/libgrapple-0.9.1/test/unittest.c branches/ogsector/externals/ogreopcode/ branches/ogsector/externals/ogreopcode/docs/ branches/ogsector/externals/ogreopcode/docs/Nebula_license.txt branches/ogsector/externals/ogreopcode/docs/OgreOpcode_LGPL.txt branches/ogsector/externals/ogreopcode/docs/readme_linux branches/ogsector/externals/ogreopcode/scripts/ branches/ogsector/externals/ogreopcode/scripts/ogreopcode_SDK.cbp branches/ogsector/externals/ogreopcode/scripts/ogreopcode_SDK.workspace branches/ogsector/externals/ogreopcode/scripts/ogreopcode_vc8.sln branches/ogsector/externals/ogreopcode/scripts/ogreopcode_vc8.vcproj branches/ogsector/externals/ogreopcode/scripts/ogreopcode_vc8SDK.sln branches/ogsector/externals/ogreopcode/scripts/ogreopcode_vc8SDK.vcproj branches/ogsector/externals/ois branches/ogsector/externals/ois-1.0RC1/ branches/ogsector/externals/ois-1.0RC1/LinuxCB/ branches/ogsector/externals/ois-1.0RC1/LinuxCB/ActionMapOgreDemo.cbp branches/ogsector/externals/ois-1.0RC1/LinuxCB/ConsoleDemo.cbp branches/ogsector/externals/ois-1.0RC1/LinuxCB/LinuxOIS.workspace branches/ogsector/externals/ois-1.0RC1/LinuxCB/OIS.cbp branches/ogsector/externals/ois-1.0RC1/Mac/ branches/ogsector/externals/ois-1.0RC1/Mac/SDL/ branches/ogsector/externals/ois-1.0RC1/Mac/SDL/blank.keepme branches/ogsector/externals/ois-1.0RC1/Mac/XCode-1.5/ branches/ogsector/externals/ois-1.0RC1/Mac/XCode-1.5/oisStatic.xcode/ branches/ogsector/externals/ois-1.0RC1/Mac/XCode-1.5/oisStatic.xcode/project.pbxproj branches/ogsector/externals/ois-1.0RC1/Mac/XCode-2.2/ branches/ogsector/externals/ois-1.0RC1/Mac/XCode-2.2/oisStatic.xcodeproj/ branches/ogsector/externals/ois-1.0RC1/Mac/XCode-2.2/oisStatic.xcodeproj/project.pbxproj branches/ogsector/externals/ois-1.0RC1/Makefile.am branches/ogsector/externals/ois-1.0RC1/Makefile.in branches/ogsector/externals/ois-1.0RC1/OIS.pc.in branches/ogsector/externals/ois-1.0RC1/ReadMe.txt branches/ogsector/externals/ois-1.0RC1/Win32/ branches/ogsector/externals/ois-1.0RC1/Win32/CommandLine/ branches/ogsector/externals/ois-1.0RC1/Win32/CommandLine/CommandLine.cbp branches/ogsector/externals/ois-1.0RC1/Win32/CommandLine/CommandLine.rc branches/ogsector/externals/ois-1.0RC1/Win32/CommandLine/CommandLine.vcproj branches/ogsector/externals/ois-1.0RC1/Win32/CommandLine/CommandLine_vc8.vcproj branches/ogsector/externals/ois-1.0RC1/Win32/CommandLine/resource.h branches/ogsector/externals/ois-1.0RC1/Win32/DemoFFTest/ branches/ogsector/externals/ois-1.0RC1/Win32/DemoFFTest/DemoFFTest.cbp branches/ogsector/externals/ois-1.0RC1/Win32/DemoFFTest/DemoFFTest.vcproj branches/ogsector/externals/ois-1.0RC1/Win32/DemoFFTest/DemoFFTest_vc8.vcproj branches/ogsector/externals/ois-1.0RC1/Win32/DemoFFTest/FF.rc branches/ogsector/externals/ois-1.0RC1/Win32/DemoFFTest/resource.h branches/ogsector/externals/ois-1.0RC1/Win32/OIS.vcproj branches/ogsector/externals/ois-1.0RC1/Win32/OIS.workspace branches/ogsector/externals/ois-1.0RC1/Win32/OIS_vc8.vcproj branches/ogsector/externals/ois-1.0RC1/Win32/SDL/ branches/ogsector/externals/ois-1.0RC1/Win32/SDL/OIS_sdl_vc8.vcproj branches/ogsector/externals/ois-1.0RC1/Win32/SDL/SdlDemo/ branches/ogsector/externals/ois-1.0RC1/Win32/SDL/SdlDemo/SdlDemo.cpp branches/ogsector/externals/ois-1.0RC1/Win32/SDL/SdlDemo/SdlDemo.rc branches/ogsector/externals/ois-1.0RC1/Win32/SDL/SdlDemo/SdlDemo.vcproj branches/ogsector/externals/ois-1.0RC1/Win32/SDL/SdlDemo/resource.h branches/ogsector/externals/ois-1.0RC1/Win32/SDL/ois_sdl_vc8.sln branches/ogsector/externals/ois-1.0RC1/Win32/ois.cbp branches/ogsector/externals/ois-1.0RC1/Win32/ois.sln branches/ogsector/externals/ois-1.0RC1/Win32/ois_vc8.sln branches/ogsector/externals/ois-1.0RC1/acinclude.m4 branches/ogsector/externals/ois-1.0RC1/bootstrap branches/ogsector/externals/ois-1.0RC1/config.guess branches/ogsector/externals/ois-1.0RC1/config.sub branches/ogsector/externals/ois-1.0RC1/configure.ac branches/ogsector/externals/ois-1.0RC1/demos/ branches/ogsector/externals/ois-1.0RC1/demos/FFConsoleDemo.cpp branches/ogsector/externals/ois-1.0RC1/demos/Makefile.am branches/ogsector/externals/ois-1.0RC1/demos/Makefile.in branches/ogsector/externals/ois-1.0RC1/demos/OISConsole.cpp branches/ogsector/externals/ois-1.0RC1/depcomp branches/ogsector/externals/ois-1.0RC1/includes/ branches/ogsector/externals/ois-1.0RC1/includes/Doxyfile branches/ogsector/externals/ois-1.0RC1/includes/Makefile.am branches/ogsector/externals/ois-1.0RC1/includes/Makefile.in branches/ogsector/externals/ois-1.0RC1/includes/OIS.h branches/ogsector/externals/ois-1.0RC1/includes/OISConfig.h branches/ogsector/externals/ois-1.0RC1/includes/OISEffect.h branches/ogsector/externals/ois-1.0RC1/includes/OISEvents.h branches/ogsector/externals/ois-1.0RC1/includes/OISException.h branches/ogsector/externals/ois-1.0RC1/includes/OISForceFeedback.h branches/ogsector/externals/ois-1.0RC1/includes/OISInputManager.h branches/ogsector/externals/ois-1.0RC1/includes/OISInterface.h branches/ogsector/externals/ois-1.0RC1/includes/OISJoyStick.h branches/ogsector/externals/ois-1.0RC1/includes/OISKeyboard.h branches/ogsector/externals/ois-1.0RC1/includes/OISMouse.h branches/ogsector/externals/ois-1.0RC1/includes/OISObject.h branches/ogsector/externals/ois-1.0RC1/includes/OISPrereqs.h branches/ogsector/externals/ois-1.0RC1/includes/SDL/ branches/ogsector/externals/ois-1.0RC1/includes/SDL/SDLInputManager.h branches/ogsector/externals/ois-1.0RC1/includes/SDL/SDLJoyStick.h branches/ogsector/externals/ois-1.0RC1/includes/SDL/SDLKeyboard.h branches/ogsector/externals/ois-1.0RC1/includes/SDL/SDLMouse.h branches/ogsector/externals/ois-1.0RC1/includes/SDL/SDLPrereqs.h branches/ogsector/externals/ois-1.0RC1/includes/config.h.in branches/ogsector/externals/ois-1.0RC1/includes/linux/ branches/ogsector/externals/ois-1.0RC1/includes/linux/EventHelpers.h branches/ogsector/externals/ois-1.0RC1/includes/linux/LinuxForceFeedback.h branches/ogsector/externals/ois-1.0RC1/includes/linux/LinuxInputManager.h branches/ogsector/externals/ois-1.0RC1/includes/linux/LinuxJoyStick.h branches/ogsector/externals/ois-1.0RC1/includes/linux/LinuxJoyStickEvents.h branches/ogsector/externals/ois-1.0RC1/includes/linux/LinuxKeyboard.h branches/ogsector/externals/ois-1.0RC1/includes/linux/LinuxMouse.h branches/ogsector/externals/ois-1.0RC1/includes/linux/LinuxPrereqs.h branches/ogsector/externals/ois-1.0RC1/includes/mac/ branches/ogsector/externals/ois-1.0RC1/includes/mac/MacHelpers.h branches/ogsector/externals/ois-1.0RC1/includes/mac/MacInputManager.h branches/ogsector/externals/ois-1.0RC1/includes/mac/MacKeyboard.h branches/ogsector/externals/ois-1.0RC1/includes/mac/MacMouse.h branches/ogsector/externals/ois-1.0RC1/includes/mac/MacPrereqs.h branches/ogsector/externals/ois-1.0RC1/includes/win32/ branches/ogsector/externals/ois-1.0RC1/includes/win32/Win32ForceFeedback.h branches/ogsector/externals/ois-1.0RC1/includes/win32/Win32InputManager.h branches/ogsector/externals/ois-1.0RC1/includes/win32/Win32JoyStick.h branches/ogsector/externals/ois-1.0RC1/includes/win32/Win32KeyBoard.h branches/ogsector/externals/ois-1.0RC1/includes/win32/Win32Mouse.h branches/ogsector/externals/ois-1.0RC1/includes/win32/Win32Prereqs.h branches/ogsector/externals/ois-1.0RC1/install-sh branches/ogsector/externals/ois-1.0RC1/lib/ branches/ogsector/externals/ois-1.0RC1/lib/.keepme branches/ogsector/externals/ois-1.0RC1/ltmain.sh branches/ogsector/externals/ois-1.0RC1/missing branches/ogsector/externals/ois-1.0RC1/mkinstalldirs branches/ogsector/externals/ois-1.0RC1/src/ branches/ogsector/externals/ois-1.0RC1/src/Makefile.am branches/ogsector/externals/ois-1.0RC1/src/Makefile.in branches/ogsector/externals/ois-1.0RC1/src/OISEffect.cpp branches/ogsector/externals/ois-1.0RC1/src/OISForceFeedback.cpp branches/ogsector/externals/ois-1.0RC1/src/OISInputManager.cpp branches/ogsector/externals/ois-1.0RC1/src/OISJoyStick.cpp branches/ogsector/externals/ois-1.0RC1/src/OISKeyboard.cpp branches/ogsector/externals/ois-1.0RC1/src/OISObject.cpp branches/ogsector/externals/ois-1.0RC1/src/SDL/ branches/ogsector/externals/ois-1.0RC1/src/SDL/SDLInputManager.cpp branches/ogsector/externals/ois-1.0RC1/src/SDL/SDLJoyStick.cpp branches/ogsector/externals/ois-1.0RC1/src/SDL/SDLKeyboard.cpp branches/ogsector/externals/ois-1.0RC1/src/SDL/SDLMouse.cpp branches/ogsector/externals/ois-1.0RC1/src/linux/ branches/ogsector/externals/ois-1.0RC1/src/linux/EventHelpers.cpp branches/ogsector/externals/ois-1.0RC1/src/linux/LinuxForceFeedback.cpp branches/ogsector/externals/ois-1.0RC1/src/linux/LinuxInputManager.cpp branches/ogsector/externals/ois-1.0RC1/src/linux/LinuxJoyStickEvents.cpp branches/ogsector/externals/ois-1.0RC1/src/linux/LinuxKeyboard.cpp branches/ogsector/externals/ois-1.0RC1/src/linux/LinuxMouse.cpp branches/ogsector/externals/ois-1.0RC1/src/mac/ branches/ogsector/externals/ois-1.0RC1/src/mac/MacHelpers.cpp branches/ogsector/externals/ois-1.0RC1/src/mac/MacInputManager.cpp branches/ogsector/externals/ois-1.0RC1/src/mac/MacKeyboard.cpp branches/ogsector/externals/ois-1.0RC1/src/mac/MacMouse.cpp branches/ogsector/externals/ois-1.0RC1/src/win32/ branches/ogsector/externals/ois-1.0RC1/src/win32/Copy of Win32JoyStick.cpp branches/ogsector/externals/ois-1.0RC1/src/win32/Win32ForceFeedback.cpp branches/ogsector/externals/ois-1.0RC1/src/win32/Win32InputManager.cpp branches/ogsector/externals/ois-1.0RC1/src/win32/Win32JoyStick.cpp branches/ogsector/externals/ois-1.0RC1/src/win32/Win32KeyBoard.cpp branches/ogsector/externals/ois-1.0RC1/src/win32/Win32Mouse.cpp branches/ogsector/install-sh branches/ogsector/missing branches/ogsector/ogre.cfg branches/ogsector/plugins.cfg branches/ogsector/resources.cfg branches/ogsector/src/ branches/ogsector/src/InputManager.cpp branches/ogsector/src/InputManager.h branches/ogsector/src/Makefile.am branches/ogsector/src/Makefile.in branches/ogsector/src/Sector.cpp branches/ogsector/src/Sector.h branches/ogsector/src/SectorClient.cpp branches/ogsector/src/SectorClient.h branches/ogsector/src/SectorClientFrameListener.cpp branches/ogsector/src/SectorClientFrameListener.h branches/ogsector/src/SectorObjects.cpp branches/ogsector/src/SectorObjects.h branches/ogsector/src/common.h branches/ogsector/src/network.cpp branches/ogsector/src/network.h branches/ogsector/src/networkClient.cpp branches/ogsector/src/networkClient.h branches/ogsector/src/networkServer.cpp branches/ogsector/src/networkServer.h branches/ogsector/src/network_protocol.h branches/ogsector/src/ogsectorclient.cpp branches/ogsector/src/ogsectorserver.cpp branches/ogsector/src/openALSoundManager.cpp branches/ogsector/src/openALSoundManager.h branches/ogsector/src/testopenalmanager.cpp Added: branches/ogsector/Makefile.am =================================================================== --- branches/ogsector/Makefile.am (rev 0) +++ branches/ogsector/Makefile.am 2007-03-17 19:44:27 UTC (rev 327) @@ -0,0 +1,9 @@ +SUBDIRS = src + +distclean: maintainer-clean + rm -rf *~ + rm -rf autom4te.cache + rm -rf configure + rm -rf Makefile.in + rm -rf Ogre.log + rm -rf opcode.log Added: branches/ogsector/Readme =================================================================== --- branches/ogsector/Readme (rev 0) +++ branches/ogsector/Readme 2007-03-17 19:44:27 UTC (rev 327) @@ -0,0 +1,60 @@ +For installation: + +you will need: +Ogre-1.2 +>=freealut-1.0.1 + +Build externals (libgrapple, OIS, OgreOpode) + +cd ./externals +sh genExternals.sh all +cd .. + +You have to take care that your LD_LIBRARY_PATH knows the external libs +There are several ways to achive this: + +--create a personal lib path and link the libraries + + mkdir $(HOME)/lib + cd ~/lib + ln -s ../src/ogsector/externals/lib/libOIS-1.0.0.so + ln -s ../src/ogsector/externals/lib/libgrapple-1.0.so.0 + ln -s ../src/ogsector/externals/lib/libOpcode.so + ln -s ../src/ogsector/externals/lib/libOgreOpcode.so + + export LD_LIBRARY_PATH=$HOME/lib:$LD_LIBRARY_PATH: + +--or you can set the LD_LIBRARY_PATH to the external libs + + export LD_LIBRARY_PATH=$HOME/src/ogsector/externals/lib:$LD_LIBRARY_PATH + +--or you can link the libs to common know libpaths + +or ... + + +For building ogsector simple run: +./bootstrap +./configure +make -j3 + +For running the ogsectorclient you have to custumise: + +plugins.cfg +ogre.cfg +resources.cfg + +src/ogsectorserver +src/ogsectorclient [username] [hostname] + +as defaults: +username is set to 'testuser' +hostname is set to 'localhost' + + +You can test the openALsoundManager +src/testopenalmanager + +Enjoy this first technical proof of concept. + +Spom Added: branches/ogsector/ToDo =================================================================== --- branches/ogsector/ToDo (rev 0) +++ branches/ogsector/ToDo 2007-03-17 19:44:27 UTC (rev 327) @@ -0,0 +1,144 @@ +Das Fluggef\xFChl mit Joy oder Maus brauch noch finetuning aber prinzipiell kommt es schon vertraut vor. +Ein leerer und leichter Apty ist schon m\xE4chtig wendig. Mal schaun wie es mit einer 500er Titan TOW wird. + +Done: + +- Class: Sector + - enth\xE4llt alle Informationen des Sector (noMovable, movable und avatar) + - add/new/remove/update aller Objecte erfolgt \xFCber den Sector + +- Class: SectorClient (Verwaltung) + - HauptKlasse enth\xE4llt Sector und SectorCientFrameListener + +- Class: SectorObject + - movable Klasse, bekommt, prozentuale Drehbewegung und Schub und berechnet damit selbst das movement im Sector. Das Objekt hat graphische Eigenschaften damit es direkt dargestellt werden kann. + Das Objekt kann von aussen (Sektor) leicht gesteuert werden, (per Netcode, Ai oder Player). + Gibt man dem Framlistener eine camera mit Position des PlayerShip->mainNode hat man first persons view aus dem Schiff. + - jaw, pitch, roll + - Thrust, break, afterburner + - Thrusterpartikel support + +- InputManager supports key/mouse/joy + +- camera toggle + +- Testsector mit diversen Objekten + - 2 simple skyboxes without Stars (OpenGate/SimpleSkyBox1, OpenGate/SimpleSkyBox1) + +- Simplest HUD + - Position, + - Speed/MaxSpeed + - Acceleration + - Mousecurser + +- Simplest global chat + + +Questions: + - depends yaw/pitch/roll-factor on curr. speed/thrust (testing and implement) + - breaking fixed negtiv percentate thrust or fixed acc. (testing and implement) + +ToDo: + +- global/code + - cleaning / refaktoring + - integrate in currect OpenGate framework + - add licence header + - mark third persons thingies (mousecurser, skybox) +#ALT-TAB - free mousepointer from widget contents + - fullscreen switch (probably not supported by ogre) + - show Whos online +- chat + - console for input + - input/output highlight + - multiple out-lines + - log to file + - channeling + +- netcode + - communication: client->server->client + - cheatprotection + +- testsector + - show all shipmodels + - show all objects + - skybox with higher resolution + - stars + +- xml-read + - read playership data + - read nonmovable objects + - global config + +- openal +# - simplest testing + - soundmanger + +- input + - keymap + - mousemap + - joymap + - colihat -> inputmanager + - force feedback support +# - 1/r sensitivity +# - deathzone "nicyfy" + +- radar targeting +# - cam +# - toggle through + - toggle Astro/Stations/Friends/Enemies/All + - nearest Enemy/Friend + - last Enemy/Friend + +- HUD +# - targetarrow +# - target infos + - duellist + - bullseye/VCR (??) +# - flydirection arrow + - colorindex for break/AB/FF +# - shield/ammo + - selected rockets + +- moving + - flyindicator particle + +- fire! +# - partikel for ammo +# - object destroyed + - mesh for laser + +- collision detection +# - objects +# - fired partikel + +- station + - landing rings on the big ogrehead-mouth + +- ai +# - simple follow + - calculate fireing solution + - rockets + +For the talented: + - particle for thrust + - textures for laser, ammo + - animated textures for explosions + - animated textures shield hit indikator + - animated textures ammo hit indikator + - skyboxes with more content + - proper background sound + - sounds: ammo (fired/hit), explosion (sound in space!! "funny"), thruster + + +BUGS: +# - (linux)changing mousefocus by < Alt-TAB > lost key-repeat +# OIS disables autorepeat, fire `xset r on` to enable + - ogre always scale my skyboxes to 512x512 + +IDEAS: + - personal scanmission + - Spieler kann sich mit geeignetem Scanner eine eigene Datenbank von Astro erstellen die ingame abgerufen werden kann, f\xFCr jeden neuen Eintrag gibt es exp(nach Mission/Seltenheit/Gefahrenbereich) + - das erleichtert das Leben (kein Papierkram) und sorgt f\xFCr spielerentropie + + -Leuchtfeuer, manuel und als sectorobject \ No newline at end of file Added: branches/ogsector/aclocal.m4 =================================================================== --- branches/ogsector/aclocal.m4 (rev 0) +++ branches/ogsector/aclocal.m4 2007-03-17 19:44:27 UTC (rev 327) @@ -0,0 +1,1019 @@ +# generated automatically by aclocal 1.9.6 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005 Free Software Foundation, Inc. +# This file 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. + +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# +# Copyright © 2004 Scott James Remnant <sc...@ne...>. +# +# 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. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi + +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# +# Similar to PKG_CHECK_MODULES, make sure that the first instance of +# this or PKG_CHECK_MODULES is called, or make sure to call +# PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_ifval([$2], [$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$PKG_CONFIG"; then + if test -n "$$1"; then + pkg_cv_[]$1="$$1" + else + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], + [pkg_failed=yes]) + fi +else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + ifelse([$4], , [AC_MSG_ERROR(dnl +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT +])], + [$4]) +elif test $pkg_failed = untried; then + ifelse([$4], , [AC_MSG_FAILURE(dnl +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])], + [$4]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + ifelse([$3], , :, [$3]) +fi[]dnl +])# PKG_CHECK_MODULES + +# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file 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. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION so it can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], + [AM_AUTOMAKE_VERSION([1.9.6])]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file 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. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file 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. + +# serial 7 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file 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. + +# serial 8 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH]) +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file 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. + +#serial 3 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file 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. + +# serial 8 + +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file 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. + +# serial 12 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.58])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file 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. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"$am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file 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. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file 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. + +# serial 3 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file 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. + +# serial 4 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +# +# This file 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. + +# AM_PROG_MKDIR_P +# --------------- +# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. +# +# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories +# created by `make install' are always world readable, even if the +# installer happens to have an overly restrictive umask (e.g. 077). +# This was a mistake. There are at least two reasons why we must not +# use `-m 0755': +# - it causes special bits like SGID to be ignored, +# - it may be too restrictive (some setups expect 775 directories). +# +# Do not use -m 0755 and let people choose whatever they expect by +# setting umask. +# +# We cannot accept any implementation of `mkdir' that recognizes `-p'. +# Some implementations (such as Solaris 8's) are not thread-safe: if a +# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' +# concurrently, both version can detect that a/ is missing, but only +# one can create it and the other will error out. Consequently we +# restrict ourselves to GNU make (using the --version option ensures +# this.) +AC_DEFUN([AM_PROG_MKDIR_P], +[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi +AC_SUBST([mkdir_p])]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file 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. + +# serial 3 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file 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. + +# serial 4 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file 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. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `ma... [truncated message content] |
From: <spo...@us...> - 2007-03-19 03:12:42
|
Revision: 333 http://svn.sourceforge.net/opengate/?rev=333&view=rev Author: spom_spom Date: 2007-03-17 14:32:04 -0700 (Sat, 17 Mar 2007) Log Message: ----------- Modified Paths: -------------- branches/ogsector/Readme Added Paths: ----------- branches/ogsector/runClient.sh branches/ogsector/runServer.sh Modified: branches/ogsector/Readme =================================================================== --- branches/ogsector/Readme 2007-03-17 20:42:46 UTC (rev 332) +++ branches/ogsector/Readme 2007-03-17 21:32:04 UTC (rev 333) @@ -1,3 +1,8 @@ +Do not fly online!! +At test Nr.1 my router died 2 times. +Lost packets lead to crasy behaviour of the vessels. + + For installation: you will need: @@ -42,16 +47,11 @@ plugins.cfg ogre.cfg -resources.cfg +runClient.sh -src/ogsectorserver -src/ogsectorclient [username] [hostname] +./runClient.sh -as defaults: -username is set to 'testuser' -hostname is set to 'localhost' - You can test the openALsoundManager src/testopenalmanager Added: branches/ogsector/runClient.sh =================================================================== --- branches/ogsector/runClient.sh (rev 0) +++ branches/ogsector/runClient.sh 2007-03-17 21:32:04 UTC (rev 333) @@ -0,0 +1,9 @@ +#!/bin/bash + +USERNAME='player' + +HOSTNAME='localhost' + +export LD_LIBRARY_PATH=./externals/lib:$LD_LIBRARY_PATH + +./src/ogsectorclient $USERNAME $HOSTNAME Property changes on: branches/ogsector/runClient.sh ___________________________________________________________________ Name: svn:executable + * Added: branches/ogsector/runServer.sh =================================================================== --- branches/ogsector/runServer.sh (rev 0) +++ branches/ogsector/runServer.sh 2007-03-17 21:32:04 UTC (rev 333) @@ -0,0 +1,4 @@ +#!/bin/bash +export LD_LIBRARY_PATH=./externals/lib:$LD_LIBRARY_PATH + +./src/ogsectorserver Property changes on: branches/ogsector/runServer.sh ___________________________________________________________________ Name: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2007-04-01 18:01:19
|
Revision: 346 http://svn.sourceforge.net/opengate/?rev=346&view=rev Author: spom_spom Date: 2007-04-01 11:01:19 -0700 (Sun, 01 Apr 2007) Log Message: ----------- add interpolation/extrapolation for movement over net. Clearyfy the code a bit. For further infos see Redme. Modified Paths: -------------- branches/ogsector/Readme branches/ogsector/ToDo branches/ogsector/externals/ois-1.0RC1/Makefile.in branches/ogsector/runClient.sh branches/ogsector/src/InputManager.h branches/ogsector/src/Makefile.am branches/ogsector/src/Makefile.in branches/ogsector/src/Sector.cpp branches/ogsector/src/Sector.h branches/ogsector/src/SectorClient.cpp branches/ogsector/src/SectorClient.h branches/ogsector/src/SectorClientFrameListener.cpp branches/ogsector/src/SectorClientFrameListener.h branches/ogsector/src/SectorObjects.cpp branches/ogsector/src/SectorObjects.h branches/ogsector/src/common.h branches/ogsector/src/networkClient.cpp branches/ogsector/src/networkClient.h branches/ogsector/src/networkServer.cpp branches/ogsector/src/networkServer.h branches/ogsector/src/ogsectorclient.cpp Added Paths: ----------- branches/ogsector/src/common.cpp branches/ogsector/src/networkProtocol.h Removed Paths: ------------- branches/ogsector/src/network.cpp branches/ogsector/src/network.h branches/ogsector/src/network_protocol.h Modified: branches/ogsector/Readme =================================================================== --- branches/ogsector/Readme 2007-03-28 21:50:26 UTC (rev 345) +++ branches/ogsector/Readme 2007-04-01 18:01:19 UTC (rev 346) @@ -1,8 +1,19 @@ -Do not fly online!! -At test Nr.1 my router died 2 times. -Lost packets lead to crasy behaviour of the vessels. +-- 0.0.2 -- +Not yet testet with other players +need test Nr.2 ;) +- changed netprotocol to TCP (my router hangs with udp, I dont know why), port: 1234 +- add simple interpolation and extrapolation for smooth movement at higher pings or packetloss +(spawned ships still jiggle a bit) +- clear register/deregister of spawns and playerships +- add network protocol for: registering ships, ship status changed, ship hit by ammo +-- 0.0.1 -- +do not fly online +At test Nr.1 my router died 2 times. +Lost packets lead to crazy behaviour of the vessels. + +----------------------------------------------------------------------- For installation: you will need: @@ -15,29 +26,6 @@ sh genExternals.sh all cd .. -You have to take care that your LD_LIBRARY_PATH knows the external libs -There are several ways to achive this: - ---create a personal lib path and link the libraries - - mkdir $(HOME)/lib - cd ~/lib - ln -s ../src/ogsector/externals/lib/libOIS-1.0.0.so - ln -s ../src/ogsector/externals/lib/libgrapple-1.0.so.0 - ln -s ../src/ogsector/externals/lib/libOpcode.so - ln -s ../src/ogsector/externals/lib/libOgreOpcode.so - - export LD_LIBRARY_PATH=$HOME/lib:$LD_LIBRARY_PATH: - ---or you can set the LD_LIBRARY_PATH to the external libs - - export LD_LIBRARY_PATH=$HOME/src/ogsector/externals/lib:$LD_LIBRARY_PATH - ---or you can link the libs to common know libpaths - -or ... - - For building ogsector simple run: ./bootstrap ./configure @@ -49,10 +37,14 @@ ogre.cfg runClient.sh +then ./runClient.sh +# start a server (optional) +./runServer.sh -You can test the openALsoundManager +If you want to test the openALsoundManager you have to take care that your LD_LIBRARY_PATH knows the external libs + src/testopenalmanager Enjoy this first technical proof of concept. Modified: branches/ogsector/ToDo =================================================================== --- branches/ogsector/ToDo 2007-03-28 21:50:26 UTC (rev 345) +++ branches/ogsector/ToDo 2007-04-01 18:01:19 UTC (rev 346) @@ -130,7 +130,6 @@ - proper background sound - sounds: ammo (fired/hit), explosion (sound in space!! "funny"), thruster - BUGS: # - (linux)changing mousefocus by < Alt-TAB > lost key-repeat # OIS disables autorepeat, fire `xset r on` to enable Modified: branches/ogsector/externals/ois-1.0RC1/Makefile.in =================================================================== --- branches/ogsector/externals/ois-1.0RC1/Makefile.in 2007-03-28 21:50:26 UTC (rev 345) +++ branches/ogsector/externals/ois-1.0RC1/Makefile.in 2007-04-01 18:01:19 UTC (rev 346) @@ -160,8 +160,7 @@ check-recursive installcheck-recursive DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/configure Makefile.am \ OIS.pc.in acinclude.m4 aclocal.m4 config.guess config.sub \ - configure configure.ac depcomp install-sh ltmain.sh missing \ - mkinstalldirs + configure.ac depcomp install-sh ltmain.sh missing mkinstalldirs DIST_SUBDIRS = $(SUBDIRS) all: all-recursive Modified: branches/ogsector/runClient.sh =================================================================== --- branches/ogsector/runClient.sh 2007-03-28 21:50:26 UTC (rev 345) +++ branches/ogsector/runClient.sh 2007-04-01 18:01:19 UTC (rev 346) @@ -4,6 +4,11 @@ HOSTNAME='localhost' +[ $# -gt 0 ] && USERNAME=$1 + +[ $# -gt 1 ] && HOSTNAME=$2 + export LD_LIBRARY_PATH=./externals/lib:$LD_LIBRARY_PATH +echo "starting client for user: $USERNAME and looking for host: $HOSTNAME" ./src/ogsectorclient $USERNAME $HOSTNAME Modified: branches/ogsector/src/InputManager.h =================================================================== --- branches/ogsector/src/InputManager.h 2007-03-28 21:50:26 UTC (rev 345) +++ branches/ogsector/src/InputManager.h 2007-04-01 18:01:19 UTC (rev 346) @@ -9,50 +9,50 @@ #include <OgreRenderWindow.h> #if defined OIS_WIN32_PLATFORM -# define WIN32_LEAN_AND_MEAN -# include "windows.h" -# include "resource.h" - LRESULT DlgProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ); +#define WIN32_LEAN_AND_MEAN +#include "windows.h" +#include "resource.h" +LRESULT DlgProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ); #elif defined OIS_LINUX_PLATFORM -# include <X11/Xlib.h> - void checkX11Events(); +#include <X11/Xlib.h> +void checkX11Events(); #endif class InputManager : public OIS::KeyListener, public OIS::MouseListener, public OIS::JoyStickListener { public: - virtual ~InputManager( void ); + virtual ~InputManager( void ); - void initialise( Ogre::RenderWindow *renderWindow ); - void capture( void ); - - 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 ); - - void removeKeyListener( const std::string & instanceName ); - void removeMouseListener( const std::string & instanceName ); - void removeJoystickListener( const std::string & instanceName ); - + void initialise( Ogre::RenderWindow *renderWindow ); + void capture( void ); + + 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 ); + + void removeKeyListener( const std::string & instanceName ); + void removeMouseListener( const std::string & instanceName ); + void removeJoystickListener( const std::string & instanceName ); + void removeKeyListener( OIS::KeyListener * keyListener ); - void removeMouseListener( OIS::MouseListener * mouseListener ); - void removeJoystickListener( OIS::JoyStickListener * joystickListener ); - - void removeAllListeners( void ); - void removeAllKeyListeners( void ); - void removeAllMouseListeners( void ); - void removeAllJoystickListeners( void ); - - void setWindowExtents( int width, int height ); - - OIS::Mouse* getMouse( void ); - OIS::Keyboard* getKeyboard( void ); - OIS::JoyStick* getJoystick( unsigned int index ); - - int getNumOfJoysticks( void ); - - static InputManager* getSingletonPtr( void ); - + void removeMouseListener( OIS::MouseListener * mouseListener ); + void removeJoystickListener( OIS::JoyStickListener * joystickListener ); + + void removeAllListeners( void ); + void removeAllKeyListeners( void ); + void removeAllMouseListeners( void ); + void removeAllJoystickListeners( void ); + + void setWindowExtents( int width, int height ); + + OIS::Mouse* getMouse( void ); + OIS::Keyboard* getKeyboard( void ); + OIS::JoyStick* getJoystick( unsigned int index ); + + int getNumOfJoysticks( void ); + + static InputManager* getSingletonPtr( void ); + private: InputManager( void ); InputManager( const InputManager & input ) { } Modified: branches/ogsector/src/Makefile.am =================================================================== --- branches/ogsector/src/Makefile.am 2007-03-28 21:50:26 UTC (rev 345) +++ branches/ogsector/src/Makefile.am 2007-04-01 18:01:19 UTC (rev 346) @@ -6,6 +6,7 @@ ogsectorclient_SOURCES = \ ogsectorclient.cpp \ common.h \ + common.cpp \ network_protocol.h \ Sector.h \ Sector.cpp \ @@ -23,6 +24,7 @@ ogsectorserver_SOURCES = \ ogsectorserver.cpp \ common.h \ + common.cpp \ network_protocol.h \ networkServer.h \ networkServer.cpp Modified: branches/ogsector/src/Makefile.in =================================================================== --- branches/ogsector/src/Makefile.in 2007-03-28 21:50:26 UTC (rev 345) +++ branches/ogsector/src/Makefile.in 2007-04-01 18:01:19 UTC (rev 346) @@ -48,13 +48,13 @@ am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) -am_ogsectorclient_OBJECTS = ogsectorclient.$(OBJEXT) Sector.$(OBJEXT) \ - SectorClient.$(OBJEXT) SectorClientFrameListener.$(OBJEXT) \ - InputManager.$(OBJEXT) networkClient.$(OBJEXT) \ - SectorObjects.$(OBJEXT) +am_ogsectorclient_OBJECTS = ogsectorclient.$(OBJEXT) common.$(OBJEXT) \ + Sector.$(OBJEXT) SectorClient.$(OBJEXT) \ + SectorClientFrameListener.$(OBJEXT) InputManager.$(OBJEXT) \ + networkClient.$(OBJEXT) SectorObjects.$(OBJEXT) ogsectorclient_OBJECTS = $(am_ogsectorclient_OBJECTS) ogsectorclient_LDADD = $(LDADD) -am_ogsectorserver_OBJECTS = ogsectorserver.$(OBJEXT) \ +am_ogsectorserver_OBJECTS = ogsectorserver.$(OBJEXT) common.$(OBJEXT) \ networkServer.$(OBJEXT) ogsectorserver_OBJECTS = $(am_ogsectorserver_OBJECTS) ogsectorserver_LDADD = $(LDADD) @@ -171,6 +171,7 @@ ogsectorclient_SOURCES = \ ogsectorclient.cpp \ common.h \ + common.cpp \ network_protocol.h \ Sector.h \ Sector.cpp \ @@ -188,6 +189,7 @@ ogsectorserver_SOURCES = \ ogsectorserver.cpp \ common.h \ + common.cpp \ network_protocol.h \ networkServer.h \ networkServer.cpp @@ -274,6 +276,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SectorClient.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SectorClientFrameListener.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SectorObjects.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/networkClient.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/networkServer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogsectorclient.Po@am__quote@ Modified: branches/ogsector/src/Sector.cpp =================================================================== --- branches/ogsector/src/Sector.cpp 2007-03-28 21:50:26 UTC (rev 345) +++ branches/ogsector/src/Sector.cpp 2007-04-01 18:01:19 UTC (rev 346) @@ -2,15 +2,16 @@ namespace OpenGate{ -Sector::Sector( Ogre::SceneManager * sceneMgr ) : sceneMgr_( sceneMgr ){ +Sector::Sector( Ogre::SceneManager * sceneMgr, Network * network ) : sceneMgr_( sceneMgr ), network_( network ){ sectorname_ = "Testsector"; + avatarDeathSequenceTime_ = 0.0; sceneMgr_->setAmbientLight( Ogre::ColourValue(0.5, 0.5, 0.5) ); - //** Create a skybox + //** Create a skybox; sceneMgr_->setSkyBox( true, "OpenGate/SimpleSkyBox1", 100 ); - //** Create a light + //** Create a light; Ogre::Light * l = sceneMgr_->createLight("MainLight"); // Accept default settings: point light, white diffuse, just set position @@ -18,7 +19,6 @@ // other objects, but I don't l->setPosition( 20, 80, 50 ); - new OgreOpcode::CollisionManager( sceneMgr_ ); OgreOpcode::CollisionManager::getSingletonPtr()->addCollClass( "SectorObject" ); OgreOpcode::CollisionManager::getSingletonPtr()->addCollClass( "Bullet" ); @@ -37,27 +37,14 @@ Ogre::Real( 9.6 ), Ogre::Degree( -90 ) ); -// for ( int i = 0; i < max ; i ++ ){ -// for ( int j = 0; j < max ; j ++ ){ -// for ( int k = 0; k < max ; k ++ ){ -// createStaticObject( Ogre::String("ogrehead.mesh"), -// "ogrehead" + Ogre::StringConverter::toString( i * max * max + j * max + k ), -// Ogre::Vector3( -1000 + (max/2)*10 - i*10.0, -// (max/2)*10 - j*10.0, -// (max/2)*10 - k*10.0 ), -// Ogre::Real( 5.0 ), -// Ogre::Degree( 0.0 ) ); -// } -// } -// } createStaticObject( Ogre::String("ogrehead.mesh"), - "ogreheadStation", - Ogre::Vector3( 5000, 0, 0 ), - Ogre::Real( 500.0 ), - Ogre::Degree( 0.0 ) ); + "ogreheadStation", + Ogre::Vector3( 5000, 0, 0 ), + Ogre::Real( 500.0 ), + Ogre::Degree( 0.0 ) ); - createCircle(); +// createCircle(); createStaticObject( Ogre::String("ogrehead.mesh"), @@ -76,9 +63,11 @@ } Sector::~Sector( ){ - // delete OgreOpcode::CollisionManager::getSingletonPtr(); - //** delete movableObjects_; - //** delete fixedObjects_; + delete OgreOpcode::CollisionManager::getSingletonPtr(); + + for ( std::set< SectorObject * >::iterator it = sectorObjects_.begin(); it != sectorObjects_.end(); ){ + sectorObjects_.erase( (*it++) ); + } } void Sector::update( Ogre::Real elapsedTime ){ @@ -102,41 +91,67 @@ 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; - + } - for ( std::set< SectorObjectMoveable * >::iterator it = movableObjects_.begin(); it != movableObjects_.end(); ){ - if ( !(*it)->update( elapsedTime ) ) { - destructMoveableObject( *it ); - movableObjects_.erase( it++ ); + // avatar_->update( elapsedTime); + + bool tmpsegfaultDebug = false; + for ( std::map< long, SectorObjectMoveable * >::iterator it = movableObjects_.begin(); it != movableObjects_.end();){ + if ( !it->second->update( elapsedTime ) ) { + tmpsegfaultDebug = true; + std::cout << "Destructing: " << it->second->name() << std::endl; + destructMoveableObject( it->second ); + it++; + std::cout << " done." << std::endl; } else ++it; } + + if ( tmpsegfaultDebug) { + std::cout << "tmpsegfaultDebug done." << std::endl; + tmpsegfaultDebug = false; + } + + if ( avatarDeathSequenceTime_ > 0 ){ + avatarDeathSequenceTime_ -= elapsedTime; + } else if ( avatarDeathSequenceTime_ > -1 ) { + spawnAvatar(); + } + } +SectorObjectMoveable * Sector::createMoveableObject( const Ogre::String & name, int userID, int childID ){ + SectorObjectMoveable * obj = new SectorObjectMoveable( name, this, userID, childID ); + sectorObjects_.insert( obj ); + movableObjects_[ obj->globalID() ] = obj; + + return obj; +} + void Sector::destructMoveableObject( SectorObjectMoveable * obj ){ sectorObjects_.erase( obj ); if ( listener_->target() == obj ) listener_->setTarget( nextTarget() ); switch ( obj->getTypeID() ){ case SECTOROBJECTMOVABLE_RTTI: - delete obj; break; - case SECTOROBJECTMOVABLE_AI_RTTI: - aiObjects_.erase( dynamic_cast< SectorObjectMoveableAi * >(obj) ); - delete obj; break; + movableObjects_.erase( obj->globalID() ); + delete obj; + break; + case SECTOROBJECTMOVABLE_AI_RTTI: { + localAiObjects_.erase( dynamic_cast< SectorObjectMoveableAi *>(obj)->childID() ); + movableObjects_.erase( obj->globalID() ); + delete obj; + } break; default: std::cerr << "object type unknown. this should not happen." << obj->getTypeID() << std::endl; } } -void Sector::createStaticObject( const Ogre::String & meshname, - const Ogre::String & objectname, - const Ogre::Vector3 & pos, - Ogre::Real targetSize, - Ogre::Degree yaw ){ +void Sector::createStaticObject( const Ogre::String & meshname, const Ogre::String & objectname, + const Ogre::Vector3 & pos, Ogre::Real targetSize, Ogre::Degree yaw ){ SectorObject * obj = new SectorObject( objectname, this ); @@ -151,40 +166,22 @@ // insertCollisionSectorObject( obj ); } -SectorObjectMoveable * Sector::createExternalMoveableObject( const Ogre::String & name ){ - SectorObjectMoveable * obj = new SectorObjectMoveable( name, this ); +SectorObjectMoveableAi * Sector::createAiMoveableObject( const Ogre::String & name, int childID ){ + SectorObjectMoveableAi * obj = new SectorObjectMoveableAi( name, this, network_->userID(), childID ); sectorObjects_.insert( obj ); - movableObjects_.insert( obj ); + movableObjects_[ obj->globalID() ] = obj ; + localAiObjects_[ obj->childID() ] = obj; return obj; } -SectorObjectMoveableAi * Sector::createAiMoveableObject( const Ogre::String & name ){ - SectorObjectMoveableAi * obj = new SectorObjectMoveableAi( name, this ); - sectorObjects_.insert( obj ); - movableObjects_.insert( obj ); - aiObjects_.insert( obj ); +void Sector::spawnAiObject( ){ + + int childID = 1; + while ( localAiObjects_.find( childID ) != localAiObjects_.end() ){ childID ++; } - return obj; -} + SectorObjectMoveableAi *obj = createAiMoveableObject( avatar_->name() + "_Spawn" + Ogre::StringConverter::toString( childID ), childID ); -SectorObjectAvatar * Sector::createAvatar( const Ogre::String & playername ){ - SectorObjectAvatar * obj = new SectorObjectAvatar( playername, this ); - sectorObjects_.insert( obj ); - movableObjects_.insert( obj ); - avatar_ = obj; - - return obj; -} - -void Sector::destructAvatar( ){ - sectorObjects_.erase( avatar_ ); - movableObjects_.erase( avatar_ ); - delete avatar_; -} - -void Sector::spawnAiObject( ){ - SectorObjectMoveableAi *obj = createAiMoveableObject( avatar_->name() + "_Spawn" + Ogre::StringConverter::toString( aiObjects_.size() ) ); obj->setTarget( avatar_ ); Ogre::Real xmin = -1000.0, xmax = -500.0; @@ -194,26 +191,73 @@ obj->mainNode()->setPosition( Ogre::Math::RangeRandom( xmin, xmax ), Ogre::Math::RangeRandom( ymin, ymax ), Ogre::Math::RangeRandom( zmin, zmax ) ); - - // obj->mainNode()->setPosition( 0.0f, 0.0f, -200.0f); - + + //obj->mainNode()->setPosition( 0.0f, 0.0f, -200.0f); + obj->setThrustPercent( 70 ); + + MessageShipRegister msg( 0, obj->childID(), obj->name(), obj->mainNode()->getPosition(), true ); + network_->send( msg ); + + } +void Sector::createAvatar( const Ogre::String & playername ){ + avatar_ = new SectorObjectAvatar( playername, this, network_->userID() ); + //sectorObjects_.insert( obj ); + movableObjects_[ avatar_->globalID() ] = avatar_; +} + +void Sector::destructAvatar( ){ + // sectorObjects_.erase( avatar_ ); + movableObjects_.erase( avatar_->globalID() ); + delete avatar_; + avatar_ = NULL; +} + +void Sector::avatarDied( ){ + avatarDeathSequenceTime_ = 5.0; + avatar_->setVisible( true ); + MessageShipRegister msg( 0, 0, avatar_->name(), avatar_->mainNode()->getPosition(), false ); + network_->send( msg ); + listener_->avatarDeathSequence( true ); +} + +void Sector::spawnAvatar( ){ + avatarDeathSequenceTime_ = -1.0; + + avatar_->mainNode()->setPosition( 0.0, 0.0, 0.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_->reset(); + + MessageShipRegister msg( 0, 0, avatar_->name(), avatar_->mainNode()->getPosition(), true ); + network_->send( msg ); + + avatar_->setVisible( false ); + listener_->avatarDeathSequence( false ); +} + SectorObject * Sector::nextTarget( ){ - itTarget_ ++; - if ( (*itTarget_) == avatar_ ) return nextTarget(); - - if ( itTarget_ == sectorObjects_.end() ) itTarget_ = sectorObjects_.begin(); - return (*itTarget_); + if ( sectorObjects_.size() != 0 ){ + itTarget_ ++; + if ( (*itTarget_) == avatar_ ) return nextTarget(); + + if ( itTarget_ == sectorObjects_.end() ) itTarget_ = sectorObjects_.begin(); + return (*itTarget_); + } + return NULL; } SectorObject * Sector::prevTarget( ){ - if ( itTarget_ == sectorObjects_.begin() ) itTarget_ = sectorObjects_.end(); - itTarget_ --; - - if ( (*itTarget_) == avatar_ ) return prevTarget(); - return (*itTarget_); + if ( sectorObjects_.size() != 0 ){ + if ( itTarget_ == sectorObjects_.begin() ) itTarget_ = sectorObjects_.end(); + itTarget_ --; + + if ( (*itTarget_) == avatar_ ) return prevTarget(); + return (*itTarget_); + } + return NULL; } void Sector::createCircle(){ @@ -252,37 +296,153 @@ object->attachObject( circle ); } -SectorObjectMoveable * Sector::findMoveableObject( const Ogre::String & playername ) { - for ( std::set< SectorObjectMoveable * >::iterator it = movableObjects_.begin(); it != movableObjects_.end(); it ++ ){ - if ( (*it)->name( ) == playername ){ - return ( *it ); +void Sector::receiveVesselRegister( const MessageShipRegister & msg ){ + + if ( msg.senderID() != network_->userID() ){ + std::map< long , SectorObjectMoveable * >::iterator it; + + if ( ( it = movableObjects_.find( createGlobalID( msg.senderID(), msg.childID() ) ) ) != movableObjects_.end() ){ + if ( msg.status() == false ){ + std::cout << "Deregistering " << msg.name() << " " << std::endl; + destructMoveableObject( it->second ); + } else { + std::cout << "Object " << msg.name() << " allready registered." << std::endl; + } + } else { + if ( msg.status() == true ){ + std::cout << "Create object " << msg.name() + << " " << msg.senderID() << " " << (int)msg.childID() + << " " << msg.position() << std::endl; + + SectorObjectMoveable * obj = createMoveableObject( msg.name(), msg.senderID(), msg.childID() ); + obj->mainNode()->setPosition( msg.position() ); + sendAllVesselStatus( ); + } } } - return NULL; -} +} -void Sector::sendAllMovements( Network * network ){ - MessageShipMovement msg( avatar_->name(), +void Sector::sendAllVesselMovements( ){ + MessageShipMovement msg( 0, + avatar_->mainNode()->getPosition(), + avatar_->velDirection(), + avatar_->mainNode()->getOrientation(), avatar_->thrustPercent(), - avatar_->velDirection(), - avatar_->mainNode()->getPosition(), - avatar_->mainNode()->getOrientation(), - avatar_->firePressed(), - avatar_->afterburnerPressed(), - avatar_->breakPressed() ); - network->send( msg ); + avatar_->scaledYaw(), + avatar_->scaledPitch(), + avatar_->scaledRoll(), + avatar_->incNetSequence() ); - for ( std::set< SectorObjectMoveableAi * >::iterator it = aiObjects_.begin(); it != aiObjects_.end(); it ++ ){ - MessageShipMovement msgObj( (*it)->name(), - (*it)->thrustPercent(), - (*it)->velDirection(), - (*it)->mainNode()->getPosition(), - (*it)->mainNode()->getOrientation(), - (*it)->firePressed(), - (*it)->afterburnerPressed(), - (*it)->breakPressed() ); - network->send( msgObj ); + network_->send( msg, false ); + + for ( std::map< int, SectorObjectMoveableAi * >::iterator it = localAiObjects_.begin(); it != localAiObjects_.end(); it ++ ){ + MessageShipMovement msgObj( it->second->childID(), + it->second->mainNode()->getPosition(), + it->second->velDirection(), + it->second->mainNode()->getOrientation(), + it->second->thrustPercent(), + it->second->scaledYaw(), + it->second->scaledPitch(), + it->second->scaledRoll(), + it->second->incNetSequence() ); + + network_->send( msgObj, false ); } } +void Sector::receiveVesselMovement( const std::vector < MessageShipMovement * > & movements ){ + + std::map < long, const MessageShipMovement * > singleMsg; + + //** we sort the movement messaged + for ( int i = 0; i < movements.size(); i ++ ){ + if ( movements[ i ]->senderID() != network_->userID() ){ + //** apply only foreign movements, and take just the actual movement + singleMsg[ createGlobalID( movements[ i ]->senderID(), movements[ i ]->childID() ) ] = movements[ i ]; + } + } + + std::map< long, SectorObjectMoveable * >::iterator it; + + for ( std::map < long, const MessageShipMovement * >::iterator i = singleMsg.begin(); i != singleMsg.end(); i++ ){ + if ( ( it = movableObjects_.find( i->first ) ) != movableObjects_.end() ){ + it->second->setFlightProperties( (*i->second) ); + } else { + std::cerr << "Requested non existant object for shipmovement: " + << network_->username( i->second->senderID() ) << " this should not happen." << std::endl; + } + } +} + +void Sector::sendAllVesselStatus( ){ + sendVesselStatus( *avatar_ ); +// for ( std::map< int, SectorObjectMoveableAi * >::iterator it = localAiObjects_.begin(); it != localAiObjects_.end(); it ++ ){ +// sendVesselStatus( *(it->second) ); +// } +} + +void Sector::sendVesselStatus( const SectorObjectMoveable & obj ){ + MessageShipStatus msg( obj.childID(), + obj.shieldPercent(), + obj.armorPercent(), + obj.firePressed(), + obj.afterburnerPressed(), + obj.breakPressed() ); + network_->send( msg ); +} + +void Sector::receiveVesselStatus( const MessageShipStatus & msg ){ + if ( msg.senderID() != network_->userID() ){ + + std::map< long, SectorObjectMoveable * >::iterator it; + + SectorObjectMoveable *obj; + if ( ( it = movableObjects_.find( createGlobalID( msg.senderID(), msg.childID() ) ) ) != movableObjects_.end() ){ + std::cout << "ReceiveVesselStatus for " << it->second->name( ) << std::endl; + it->second->setStatus( msg ); + } else { + std::cerr << "Requested non existant object for shipstatus: " + << network_->username( msg.senderID() ) << " this should not happen." << std::endl; + } + } +} + +void Sector::sendVesselAmmoHit( const Projectile & projectile, BaseObject * victim ){ + + if ( projectile.parent().userID() == network_->userID() ){ + std::cout << "Send: Projectile from " << projectile.name() << " collide with: " << victim->name() + << " " << victim->userID() << " " << victim->childID() << std::endl; + + if ( network_->online() ){ + MessageShipAmmoHit msg( projectile.parent().childID(), victim->userID(), victim->childID(), projectile.damage() ); + network_->send( msg ); + } + } + victim->hitByAmmo( projectile.damage() ); +} + +void Sector::receiveVesselAmmoHit( const MessageShipAmmoHit & msg ){ + if ( msg.senderID() != network_->userID() ){ + + std::map< long, SectorObjectMoveable * >::iterator it; + + if ( ( it = movableObjects_.find( createGlobalID( msg.targetID(), msg.targetChildID() ) ) ) != movableObjects_.end() ){ + std::cout << "ReceiveVesselAmmoHit for " << network_->username( msg.targetID() ) << std::endl; + it->second->hitByAmmo( msg.damage() ); + } else { + std::cerr << "Requested non existant object for VesselAmmoHit " + << "shooter: " << network_->username( msg.senderID() ) + << " victim: " << network_->username( msg.targetID() ) + << " child: " << msg.targetChildID() + << " damage: " << msg.damage() << " this should not happen." << std::endl; + + std::cerr << "Available objects: " << std::endl; + for ( std::map< long, SectorObjectMoveable * >::iterator i = movableObjects_.begin(); i != movableObjects_.end(); i++){ + std::cerr << "\t" << i->first << " " << i->second->name() << " " << std::endl; + } + + } + } +} + } // namespace OpenGate Modified: branches/ogsector/src/Sector.h =================================================================== --- branches/ogsector/src/Sector.h 2007-03-28 21:50:26 UTC (rev 345) +++ branches/ogsector/src/Sector.h 2007-04-01 18:01:19 UTC (rev 346) @@ -13,48 +13,68 @@ public: - Sector( Ogre::SceneManager * sceneMgr ); + Sector( Ogre::SceneManager * sceneMgr, Network * network ); ~Sector( ); Ogre::SceneManager * sceneManager() { return sceneMgr_; } void setListener( SectorClientFrameListener * listener ){ listener_ = listener; } + SectorClientFrameListener * listener( ){ return listener_; } + void setNetwork( Network * network ){ network_ = network; } + + void update( Ogre::Real elapsedTime ); void createStaticObject( const Ogre::String & meshname, const Ogre::String & objectname, const Ogre::Vector3 & pos, Ogre::Real targetSize, Ogre::Degree yaw ); - SectorObjectMoveable * createExternalMoveableObject( const Ogre::String & name ); + SectorObjectMoveable * createMoveableObject( const Ogre::String & name, int userId, int childId ); - SectorObjectMoveableAi * createAiMoveableObject( const Ogre::String & name ); + SectorObjectMoveableAi * createAiMoveableObject( const Ogre::String & name, int childId ); - SectorObjectAvatar * createAvatar( const Ogre::String & playername ); + void destructMoveableObject( SectorObjectMoveable * obj ); - // void insertCollisionSectorObject( SectorObject * obj ); + void createAvatar( const Ogre::String & playername ); - OgreOpcode::CollisionContext * collisionContext() { return collideInSectorContext_; } + SectorObjectAvatar * avatar() { return avatar_; } - void destructMoveableObject( SectorObjectMoveable * obj ); + void destructAvatar( ); + void avatarDied( ); + + void spawnAvatar( ); + void spawnAiObject( ); - - void destructAvatar( ); - SectorObjectAvatar * avatar() { return avatar_; } + OgreOpcode::CollisionContext * collisionContext() { return collideInSectorContext_; } void createCircle( ); - SectorObjectMoveable * findMoveableObject( const Ogre::String & name ); - SectorObject * nextTarget( ); SectorObject * prevTarget( ); - void sendAllMovements( Network * network ); + void receiveVesselRegister( const MessageShipRegister & msg ); + + void sendAllVesselStatus( ); + + void sendAllVesselMovements( ); + + void receiveVesselMovement( const std::vector < MessageShipMovement * > & movements ); + + void sendVesselStatus( const SectorObjectMoveable & obj ); + + void receiveVesselStatus( const MessageShipStatus & msg ); + + void sendVesselAmmoHit( const Projectile & projectile, BaseObject * victim ); + + void receiveVesselAmmoHit( const MessageShipAmmoHit & msg ); + + protected: SectorClientFrameListener * listener_; Ogre::SceneManager * sceneMgr_; @@ -65,12 +85,15 @@ OgreOpcode::CollisionContext * collideInSectorContext_; - std::set< SectorObject * > sectorObjects_; - std::set< SectorObjectMoveable * > movableObjects_; - std::set< SectorObjectMoveableAi * > aiObjects_; + std::set< SectorObject * >::iterator itTarget_; - std::set< SectorObject * >::iterator itTarget_; + std::map< long, SectorObjectMoveable * > movableObjects_; + std::map< int, SectorObjectMoveableAi * > localAiObjects_; + + float avatarDeathSequenceTime_; + + Network * network_; }; } // namespace OpenGate Modified: branches/ogsector/src/SectorClient.cpp =================================================================== --- branches/ogsector/src/SectorClient.cpp 2007-03-28 21:50:26 UTC (rev 345) +++ branches/ogsector/src/SectorClient.cpp 2007-04-01 18:01:19 UTC (rev 346) @@ -3,41 +3,84 @@ namespace OpenGate{ void SectorClient::createScene( ){ - sector_ = new Sector( sceneMgr_ ); + sector_ = new Sector( sceneMgr_, network_ ); + sector_->createAvatar( network_->usernameMe() ); +} - SectorObjectAvatar *pS = sector_->createAvatar( network_->usernameMe() ); - pS->mainNode()->setPosition( 0.0, 0.0, 0.0 ); - pS->setVelocity( Ogre::Vector3( 0.0, 0.0, -20.0 ) ); +void SectorClient::destroyScene( ){ + if ( sector_ != NULL ) delete sector_; } -bool SectorClient::setup( void ){ - root_ = new Ogre::Root(); - setupResources(); - - bool carryOn = configure(); - if (!carryOn) return false; - - sceneMgr_ = root_->createSceneManager( Ogre::ST_GENERIC, "BaseSMInstance"); - createCameras(); +bool SectorClient::setup( ){ + root_ = new Ogre::Root(); - createViewports(); + setupResources(); + + if ( !configure() ) return false; + + sceneMgr_ = root_->createSceneManager( Ogre::ST_GENERIC, "BaseSMInstance"); - // Set default mipmap level (NB some APIs ignore this) - Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5); - - // Create any resource listeners (for loading screens) - // createResourceListener(); - -// // Load resources - loadResources(); - - // Create the scene - createScene(); - - createFrameListener(); - + createCameras(); + + createViewports(); + + // Set default mipmap level (NB some APIs ignore this) + Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5); + + // Create any resource listeners (for loading screens) + // createResourceListener(); + + // Load resources + loadResources(); + + // Create the scene + createScene(); + + createFrameListener(); + + sector_->spawnAvatar(); + + return true; +} + +void SectorClient::setupResources( ) { + // Load resource paths from config file + Ogre::ConfigFile cf; cf.load( "resources.cfg" ); + + // Go through all sections & settings in the file + Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator(); + + Ogre::String secName, typeName, archName; + while ( seci.hasMoreElements() ) { + + secName = seci.peekNextKey(); + Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext(); + + for ( Ogre::ConfigFile::SettingsMultiMap::iterator i = settings->begin(); i != settings->end(); ++i ){ + typeName = i->first; + archName = i->second; + Ogre::ResourceGroupManager::getSingleton().addResourceLocation( archName, typeName, secName ); + } + } +} + +bool SectorClient::configure( void ){ + root_->restoreConfig(); + window_ = root_->initialise( true ); + return true; + + // Show the configuration dialog and initialise the system + // You can skip this and use root.restoreConfig() to load configuration + // settings if you were sure there are valid ones saved in ogre.cfg + if ( root_->showConfigDialog() ) { + // If returned true, user clicked OK so initialise + // Here we choose to let the system create a default rendering window by passing 'true' + window_ = root_->initialise( true ); return true; + } else { + return false; } +} void SectorClient::createCameras( ) { camera_ = sceneMgr_->createCamera("CameraMain"); @@ -75,6 +118,11 @@ window_->removeViewport( 2 ); } +void SectorClient::createFrameListener( ) { + frameListener_ = new SectorClientFrameListener( window_, camera_, sector_, network_ ); + root_->addFrameListener( frameListener_ ); +} + } // namespace OpenGate{ Modified: branches/ogsector/src/SectorClient.h =================================================================== --- branches/ogsector/src/SectorClient.h 2007-03-28 21:50:26 UTC (rev 345) +++ branches/ogsector/src/SectorClient.h 2007-04-01 18:01:19 UTC (rev 346) @@ -16,15 +16,14 @@ class SectorClient { public: SectorClient( Network * nw ) : network_( nw ) { - frameListener_ = NULL; root_ = NULL; + frameListener_ = NULL; sector_ = NULL; } virtual ~SectorClient(){ if ( frameListener_ != NULL ) delete frameListener_; if ( root_ != NULL ) delete root_; - if ( sector_ != NULL ) delete sector_; } virtual void go( void ){ @@ -32,75 +31,36 @@ root_->startRendering(); - // clean up destroyScene(); } protected: - virtual bool setup( void ); + virtual bool setup( ); - virtual bool configure( void ){ - root_->restoreConfig(); - window_ = root_->initialise( true ); - return true; + //! Method which will define the source of resources (other than current folder) + virtual void setupResources( ); - // Show the configuration dialog and initialise the system - // You can skip this and use root.restoreConfig() to load configuration - // settings if you were sure there are valid ones saved in ogre.cfg - if( root_->showConfigDialog() ) { - // If returned true, user clicked OK so initialise - // Here we choose to let the system create a default rendering window by passing 'true' - window_ = root_->initialise( true ); - return true; - } else { - return false; - } - } + virtual bool configure( ); - virtual void chooseSceneManager( void ){ } + // virtual void chooseSceneManager( ){ } - virtual void createCameras( void ); + virtual void createCameras( ); - //! Create our viewports - virtual void createViewports( void ); + virtual void createViewports( ); - virtual void createFrameListener( void ) { - frameListener_ = new SectorClientFrameListener( window_, camera_, sector_, network_ ); - root_->addFrameListener( frameListener_ ); - } + virtual void createFrameListener( ); - virtual void createScene( void ); + virtual void createScene( ); - virtual void destroyScene(void){ } + virtual void destroyScene( ); - //! Method which will define the source of resources (other than current folder) - virtual void setupResources(void) { - // Load resource paths from config file - Ogre::ConfigFile cf; cf.load( "resources.cfg" ); - - // Go through all sections & settings in the file - Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator(); - - Ogre::String secName, typeName, archName; - while ( seci.hasMoreElements() ) { - secName = seci.peekNextKey(); - Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext(); - Ogre::ConfigFile::SettingsMultiMap::iterator i; - for ( i = settings->begin(); i != settings->end(); ++i ){ - typeName = i->first; - archName = i->second; - Ogre::ResourceGroupManager::getSingleton().addResourceLocation( archName, typeName, secName ); - } - } - } - - virtual void loadResources(void) { + virtual void loadResources( ) { Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups(); } - Ogre::Root * root_; + Ogre::Camera * camera_; Ogre::SceneManager * sceneMgr_; Modified: branches/ogsector/src/SectorClientFrameListener.cpp =================================================================== --- branches/ogsector/src/SectorClientFrameListener.cpp 2007-03-28 21:50:26 UTC (rev 345) +++ branches/ogsector/src/SectorClientFrameListener.cpp 2007-04-01 18:01:19 UTC (rev 346) @@ -1,6 +1,6 @@ #include "SectorClientFrameListener.h" #include "SectorClient.h" -#include "network_protocol.h" +#include "networkProtocol.h" #include <iostream> #include <OgreTextAreaOverlayElement.h> @@ -31,7 +31,7 @@ timeSinceLastSectorUpdate_ = 0.0; timeSinceLastNetworkUpdate_ = 0.0; - deathSequence_ = 0.0; + deathSequence_ = false; inputInitialState_ = true; lastInputWheelState_ = 0; windowsWidth_ = window_->getWidth( ); @@ -60,7 +60,7 @@ setTarget( sector_->nextTarget() ); -// targetPointer_ = camera_->getSceneManager()->getRootSceneNode()->createChildSceneNode( "TargetPointer" ); + // targetPointer_ = camera_->getSceneManager()->getRootSceneNode()->createChildSceneNode( "TargetPointer" ); // BillboardSet* mySet = camera_->getSceneManager()->createBillboardSet("mySet"); // targetPointerBB_ = mySet->createBillboard( Vector3(0, 0, 0) ); // mySet->setMaterialName( "TargetPointer" ); @@ -80,7 +80,7 @@ Ogre::SceneNode * spaceDustNode = sector_->avatar()->mainNode()->createChildSceneNode( "DustParticles", camera_->getRealPosition() ); // spaceDustNode_->attachObject( spaceDustParticleSystem_ ); - //camera_->getParentSceneNode() + //camera_->getParentSceneNode() // listener for the space dust @@ -111,71 +111,66 @@ bool SectorClientFrameListener::frameStarted( const Ogre::FrameEvent & evt ) { if ( window_->isClosed() ) return false; + timeSinceLastSectorUpdate_ += evt.timeSinceLastFrame; timeSinceLastNetworkUpdate_ += evt.timeSinceLastFrame; - if ( timeSinceLastSectorUpdate_ > 0.005 ){ // max 200 sector-updates/second - - if ( deathSequence_ > 0 ){ + if ( deathSequence_ ){ + + } else { + //** capture my input + inputManager_->capture(); + } + + //** start capture network; + std::vector < std::vector < Uint8 > > msgs; + std::vector < MessageShipMovement * > movements; + network_->pull( msgs ); + + for ( int i = 0; i < msgs.size(); i ++ ){ + switch ( msgs[ i ][ 0 ] ){ + case PROTO_CHAT:{ + network_->ping(); + + MessageChat msg( &msgs[ i ][ 0 ] ); + std::cout << network_->username( msg.senderID() ) + ": " + msg.message() << std::endl; - deathSequence_ -= timeSinceLastSectorUpdate_; - - if ( deathSequence_ <= 0 ){ - avatarSpawn( ); - } - } else { + Ogre::OverlayElement* hudChatIn = Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextChatIn"); + hudChatIn->setCaption( network_->username( msg.senderID() ) + ": " + msg.message() ); + } break; + case PROTO_SHIPREGISTER: + sector_->receiveVesselRegister( &msgs[ i ][ 0 ] ); break; + case PROTO_SHIPSTATUS: + sector_->receiveVesselStatus( &msgs[ i ][ 0 ] ); break; + case PROTO_SHIPMOVEMENT:{ + //** we handle that in sum, so we can ignore dups because of packet loss + MessageShipMovement msg( &msgs[ i ][ 0 ] ); + movements.push_back( &msg ); + } break; + case PROTO_SHIPAMMOHIT: + sector_->receiveVesselAmmoHit( &msgs[ i ][ 0 ] ); break; + default: + std::cerr << "PROTO type unknown: " << msgs[ i ][ 0 ] << " " << msgs[ i ].size() << std::endl; + break; + } + } + if ( movements.size() > 0 ) sector_->receiveVesselMovement( movements ); - //** capture my input - inputManager_->capture(); - - if ( timeSinceLastNetworkUpdate_ > 0.02 ){// max 100 net-updates/second - - std::vector < std::vector < Uint8 > > msgs; - network_->pull( msgs ); - - for ( int i = 0; i < msgs.size(); i ++ ){ - switch ( msgs[ i ][ 0 ] ){ - case PROTO_CHAT:{ - MessageChat msg( &msgs[ i ][ 0 ] ); - std::cout << network_->username( msg.senderId() ) + ": " + msg.message() << std::endl; - - Ogre::OverlayElement* hudChatIn = Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextChatIn"); - hudChatIn->setCaption( network_->username( msg.senderId() ) + ": " + msg.message() ); - } break; - case PROTO_SHIPMOVEMENT:{ - MessageShipMovement msg( &msgs[ i ][ 0 ] ); - - if ( msg.senderId() != network_->userId() ){ - - SectorObjectMoveable *obj; - if ( (obj = sector_->findMoveableObject( msg.name() ) ) == NULL ){ - obj = sector_->createExternalMoveableObject( msg.name() ); - } -// if ( (obj = sector_->findMoveableObject( network_->username( msg.senderId() ) )) == NULL ){ -// obj = sector_->createExternalMoveableObject( network_->username( msg.senderId() ) ); -// } - obj->setFlightProperties( msg ); - - } - } break; - default: - std::cerr << "PROTO type unknown: " << msgs[ i ][ 0 ] << " " << msgs[ i ].size() << std::endl; - break; - } - } - - sector_->sendAllMovements( network_ ); - - - timeSinceLastNetworkUpdate_ = 0.0; - } //** network update - } //** else if no deathsequence - + //** end capture network; + + // max 1000 sector-updates/second + if ( timeSinceLastSectorUpdate_ > 0.001 ){ sector_->update( timeSinceLastSectorUpdate_ ); timeSinceLastSectorUpdate_ = 0.0; updateHUD_(); - } //** sector update + } + //** send movement data, max 10 net-updates/second + if ( timeSinceLastNetworkUpdate_ > 0.1 ){ + sector_->sendAllVesselMovements( ); + timeSinceLastNetworkUpdate_ = 0.0; + } + //** update my camera; updateCamera_(); @@ -199,10 +194,10 @@ if ( e.key == OIS::KC_ESCAPE) { shutDownRequest_ = true; } //** Avatar yaw LEFT; - if ( e.key == OIS::KC_A || e.key == OIS::KC_NUMPAD6 ) { sector_->avatar()->setScaledYaw( 1.0 ); } + if ( e.key == OIS::KC_A || e.key == OIS::KC_NUMPAD4 ) { sector_->avatar()->setScaledYaw( 1.0 ); } //** Avatar yaw RIGHT; - if ( e.key == OIS::KC_D || e.key == OIS::KC_NUMPAD4 ) { sector_->avatar()->setScaledYaw( -1.0 ); } + if ( e.key == OIS::KC_D || e.key == OIS::KC_NUMPAD6 ) { sector_->avatar()->setScaledYaw( -1.0 ); } //** Avatar pitch DOWN; if ( e.key == OIS::KC_W || e.key == OIS::KC_NUMPAD8 ) { sector_->avatar()->setScaledPitch( -1.0 ); } @@ -242,7 +237,7 @@ if ( e.key == OIS::KC_P ) { setTarget( sector_->prevTarget() ); } //** selfdestruct and eject; - if ( e.key == OIS::KC_F11 ) { avatarDied(); } + if ( e.key == OIS::KC_F11 ) { sector_->avatarDied(); } //** spawn; if ( e.key == OIS::KC_F12 ) { sector_->spawnAiObject(); } @@ -449,7 +444,7 @@ } bool SectorClientFrameListener::buttonPressed( const OIS::JoyStickEvent & e , int button){ - window_->setDebugText( "Joy: " + toStr( button ) ); + // window_->setDebugText( "Joy: " + toStr( button ) ); if ( button == 0){ sector_->avatar()->setFirePressed( true ); @@ -457,7 +452,7 @@ } bool SectorClientFrameListener::buttonReleased( const OIS::JoyStickEvent & e , int button){ - window_->setDebugText( "Joy: " + toStr( button ) ); + // window_->setDebugText( "Joy: " + toStr( button ) ); if ( button == 0){ sector_->avatar()->setFirePressed( false ); @@ -474,7 +469,6 @@ switch ( cameraMode_ ){ case 0: //** free camera at orign camera_->setPosition( Ogre::Vector3( 0, 0, 500 ) ); - camera_->lookAt( Ogre::Vector3( 0, 0, -300 ) ); camera_->setAutoTracking( false, sector_->avatar()->mainNode() ); sector_->avatar()->setVisible( true ); break; @@ -496,7 +490,12 @@ void SectorClientFrameListener::updateCamera_(){ Ogre::Vector3 avatarPos( sector_->avatar()->mainNode()->getPosition() ); - Ogre::Vector3 targetPos( target_->mainNode()->getPosition() ); + + Ogre::Vector3 targetPos; + if ( target_ != NULL ){ + targetPos = target_->mainNode()->getPosition() ; + } + Ogre::Vector3 dist( targetPos - avatarPos ); Ogre::Vector3 distNorm( dist.normalisedCopy() ); Ogre::Quaternion avatarOrient( sector_->avatar()->mainNode()->getOrientation() ); @@ -508,14 +507,15 @@ // if ( ( 1.0f + cam1->getDirection( ).normalisedCopy().dotProduct( distNorm ) ) < 0.0001f ) { // cam1->yaw( Degree( 180 ) ); // } else { - Ogre::Quaternion rot( cam1->getDirection( ).normalisedCopy().getRotationTo( distNorm ) ); - cam1->rotate( rot ); - // } - - cam1->setPosition( avatarPos + distNorm * ( dist.length() - 2.0 * target_->baseSize() ) ); - + Ogre::Quaternion rot( cam1->getDirection( ).normalisedCopy().getRotationTo( distNorm ) ); + cam1->rotate( rot ); + // } + + if ( target_ != NULL ) cam1->setPosition( avatarPos + distNorm * ( dist.length() - 2.0 * target_->baseSize() ) ); + switch ( cameraMode_ ){ case 0: //** free camera at orign + camera_->lookAt( sector_->avatar()->mainNode()->getPosition( ) ); break; case 1: //** first person avatar camera camera_->setPosition( avatarPos ); @@ -625,54 +625,98 @@ void SectorClientFrameListener::setTarget( SectorObject * target ) { target_ = target; - Ogre::OverlayElement* targetName = Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextTargetName"); - targetName->setCaption( target_->name() ); - if ( hudTarget_->numChildren() > 0 ){ - hudTarget_->removeAllChildren( );// hudTarget_->getChild( "TargetTrans" ) ); - camera_->getSceneManager()->destroyEntity( "TargetShape" ); - } - Ogre::SceneNode * hudTargetTrans = new Ogre::SceneNode( NULL, "TargetTrans" ); - - - Ogre::Entity *targetShape = target_->shape()->clone( "TargetShape" ); - - hudTargetTrans->attachObject( targetShape ); - Ogre::Real scale = 0.5 / ( targetShape->getBoundingBox().getMaximum()[ 0 ] - - targetShape->getBoundingBox().getMinimum()[ 0 ] ); - hudTargetTrans->yaw( Ogre::Degree( -90 ) ); - hudTargetTrans->scale( scale, scale, scale ); - - hudTarget_->addChild( hudTargetTrans ); + if ( target_ != NULL ){ + Ogre::OverlayElement* targetName = Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextTargetName"); + targetName->setCaption( target_->name() ); + + if ( hudTarget_->numChildren() > 0 ){ + hudTarget_->removeAllChildren( );// hudTarget_->getChild( "TargetTrans" ) ); + camera_->getSceneManager()->destroyEntity( "TargetShape" ); + } + Ogre::SceneNode * hudTargetTrans = new Ogre::SceneNode( NULL, "TargetTrans" ); + + + Ogre::Entity *targetShape = target_->shape()->clone( "TargetShape" ); + + hudTargetTrans->attachObject( targetShape ); + Ogre::Real scale = 0.5 / ( targetShape->getBoundingBox().getMaximum()[ 0 ] + - targetShape->getBoundingBox().getMinimum()[ 0 ] ); + hudTargetTrans->yaw( Ogre::Degree( -90 ) ); + hudTargetTrans->scale( scale, scale, scale ); + + hudTarget_->addChild( hudTargetTrans ); + } } void SectorClientFrameListener::updateHUD_( void ) { - hudTarget_->setOrientation( target_->mainNode()->getOrientation() ); - - if ( sector_->avatar()->velocity() > 0 ){ + if ( fabs( sector_->avatar()->velocity() ) > 1e-1 ){ sector_->avatar()->flightArrow()->setVisible( true ); - sector_->avatar()->flightArrow()->setOrientation( target_->mainNode()->getOrientation() ); - sector_->avatar()->flightArrow()->setDirection( sector_->avatar()->flightDirection().normalisedCopy(), Ogre::Node::TS_WORLD ); + sector_->avatar()->flightArrow()->setOrientation( sector_->avatar()->mainNode()->getOrientation() ); + sector_->avatar()->flightArrow()->setDirection( sector_->avatar()->flightDirection().normalisedCopy(), + Ogre::Node::TS_WORLD ); } else { sector_->avatar()->flightArrow()->setVisible( false ); } + + if ( target_ != NULL ) { + sector_->avatar()->targetArrow()->setVisible( true ); + Ogre::Vector3 distToTarget = target_->mainNode()->getPosition() - sector_->avatar()->mainNode()->getPosition(); - Ogre::Vector3 distToTarget = target_->mainNode()->getPosition() - sector_->avatar()->mainNode()->getPosition(); - sector_->avatar()->targetArrow()->setOrientation( target_->mainNode()->getOrientation() ); - sector_->avatar()->targetArrow()->setDirection( distToTarget.normalisedCopy(), Ogre::Node::TS_WORLD ); + sector_->avatar()->targetArrow()->setOrientation( sector_->avatar()->mainNode()->getOrientation() ); + sector_->avatar()->targetArrow()->setDirection( distToTarget.normalisedCopy(), + Ogre::Node::TS_WORLD ); + hudTarget_->setOrientation( target_->mainNode()->getOrientation() ); - Ogre::Vector3 poss = camera_->getProjectionMatrix() * (camera_->getViewMatrix() * target_->mainNode()->getPosition() ); - poss.x = max( -1.0f, poss.x ); poss.x = min( 1.0f, poss.x ); - poss.y = max( -1.0f, poss.y ); poss.y = min( 1.0f, poss.y ); +// Ogre::Vector3 targetPos; +// Ogre::Quaternion targetOrient; targetOri = target_->mainNode().getOrientation(); +// targetPos = target_->mainNode().getPosition(); - Ogre::OverlayElement* hudTargetPointer = Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/TargetPointer"); - if ( poss.z < 1 ){ - hudTargetPointer->setPosition( windowsHalfWidth_ + (windowsHalfWidth_ * poss.x)-16, - windowsHalfHeight_ + (windowsHalfHeight_ * -poss.y)-16 ); + //** targeting pointer + Ogre::Vector3 poss = camera_->getProjectionMatrix() * (camera_->getViewMatrix() * target_->mainNode()->getPosition() ); + poss.x = max( -1.0f, poss.x ); poss.x = min( 1.0f, poss.x ); + poss.y = max( -1.0f, poss.y ); poss.y = min( 1.0f, poss.y ); + + Ogre::OverlayElement* hudTargetPointer = Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/TargetPointer"); + hudTargetPointer->show(); + + Ogre::OverlayElement* hudTargetDist = + Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextTargetDistance"); + + Ogre::OverlayElement* hudTargetShield = + Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextTargetShield"); + + Ogre::OverlayElement* hudTargetArmor = + Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextTargetArmor"); + + Ogre::OverlayElement* hudTargetVel = + Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextTargetVelocity"); + + hudTargetDist->setCaption( "D " + Ogre::StringConverter::toString( round( distToTarget.length(), 0 ) ) ); + + if ( poss.z < 1 ){ + hudTargetPointer->setPosition( windowsHalfWidth_ + (windowsHalfWidth_ * poss.x)-16, + windowsHalfHeight_ + (windowsHalfHeight_ * -poss.y)-16 ); + } + + if ( target_->getTypeID() == SECTOROBJECTMOVABLE_RTTI || + target_->getTypeID() == SECTOROBJECTMOVABLE_AI_RTTI ){ + hudTargetVel->setCaption( "V " + Ogre::StringConverter::toString( dynamic_cast< SectorObjectMoveable *>( target_ )->velocity(), 6 ) ); + hudTargetShield->setCaption( "S " + Ogre::StringConverter::toString( dynamic_cast< SectorObjectMoveable *>( target_ )->shieldPercent(), 4 ) ); + hudTargetArmor->setCaption( "A " + Ogre::StringConverter::toString( dynamic_cast< SectorObjectMoveable *>( target_ )->armorPercent(), 4 ) ); + } else{ + hudTargetVel->setCaption( "" ); + hudTargetShield->setCaption( "" ); + hudTargetArmor->setCaption( "" ); + } + + } else { + sector_->avatar()->targetArrow()->setVisible( false ); + Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/TargetPointer")->hide( ); } - + Ogre::OverlayElement* hudStat = Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextStats"); @@ -697,18 +741,6 @@ Ogre::OverlayElement* hudArmor = Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextArmor"); - Ogre::OverlayElement* hudTargetDist = - Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextTargetDistance"); - - Ogre::OverlayElement* hudTargetShield = - Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextTargetShield"); - - Ogre::OverlayElement* hudTargetArmor = - Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextTargetArmor"); - - Ogre::OverlayElement* hudTargetVel = - Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextTargetVelocity"); - const Ogre::RenderTarget::FrameStats & stats = window_->getStatistics(); hudStat->setCaption( "fps: " + toStr( stats.lastFPS ) + " ping: " + toStr( network_->pingTime() ) + " ms" ); hudVel->setCaption( "Vel: " + Ogre::StringConverter::toString( round( sector_->avatar()->velocity(), 2 ), 6 ) ); @@ -718,19 +750,7 @@ hudShield->setCaption( "S " + Ogre::StringConverter::toString( sector_->avatar()->shieldPercent(), 4 ) ); hudArmor->setCaption( "A " + Ogre::StringConverter::toString( sector_->avatar()->armorPercent(), 4 ) ); - hudTargetDist->setCaption( "D " + Ogre::StringConverter::toString( round( distToTarget.length(), 0 ) ) ); - - if ( target_->getTypeID() == SECTOROBJECTMOVABLE_RTTI || - target_->getTypeID() == SECTOROBJECTMOVABLE_AI_RTTI ){ - hudTargetVel->setCaption( "V " + Ogre::StringConverter::toString( dynamic_cast< SectorObjectMoveable *>( target_ )->velocity(), 6 ) ); - hudTargetShield->setCaption( "S " + Ogre::StringConverter::toString( dynamic_cast< SectorObjectMoveable *>( target_ )->shieldPercent(), 4 ) ); - hudTargetArmor->setCaption( "A " + Ogre::StringConverter::toString( dynamic_cast< SectorObjectMoveable *>( target_ )->armorPercent(), 4 ) ); - } else{ - hudTargetVel->setCaption( "" ); - hudTargetShield->setCaption( "" ); - hudTargetArmor->setCaption( "" ); - } - + Ogre::Vector3 pos( sector_->avatar()->mainNode()->getPosition() ); hudPos->setCaption( "Pos: " + Ogre::StringConverter::toString( Ogre::Real( rint( pos[ 0 ] ) ), 5, 5 ) + " " + @@ -758,30 +778,49 @@ // } } -void SectorClientFrameListener::avatarSpawn( ){ - // SectorObjectAvatar *obj = sector_->createAvatar( network_->usernameMe() ); - sector_->avatar()->mainNode()->setPosition( 0.0, 0.0, 0.0 ); - sector_->avatar()->mainNode()->setOrientation( Ogre::Quaternion( 1.0, 0.0, 0.0, 0.0 ) ); - sector_->avatar()->setVelocity( Ogre::Vector3( 0.0, 0.0, -20.0 ) ); - sector_->avatar()->reset(); - cameraMode_ = 1; - sector_->avatar()->setVisible( false ); - deathSequence_ = 0.0; - hudOverlay_->show(); +void SectorClientFrameListener::avatarDeathSequence( bool on ){ + if ( on ){ + deathSequence_ = true; + cameraMode_ = 0; + camera_->setOrientation( sector_->avatar()->mainNode()->getOrientation() ); + camera_->setPosition( sector_->avatar()->mainNode()->getOrientation().zAxis() * 100.0 ); + hudOverlay_->hide(); + } else { + deathSequence_ = false; + cameraMode_ = 1; + hudOverlay_->show(); + } } -void SectorClientFrameListener::avatarDied( ){ - deathSequence_ = 3.0; - cameraMode_ = 0; - sector_->avatar()->setVisible( true ); - camera_->setPosition( sector_->avatar()->mainNode()->getPosition() + - sector_->avatar()->mainNode()->getOrientation().zAxis() * 200 ); +// void SectorClientFrameListener::avatarSpawn( ){ +// // SectorObjectAvatar *obj = sector_->createAvatar( network_->usernameMe() ); +// sector_->avatar()->mainNode()->setPosition( 0.0, 0.0, 0.0 ); +// sector_->avatar()->mainNode()->setOrientation( Ogre::Quaternion( 1.0, 0.0, 0.0, 0.0 ) ); +// sector_->avatar()->setVelocity( Ogre::Vector3( 0.0, 0.0, -20.0 ) ); +// sector_->avatar()->reset(); +// cameraMode_ = 1; +// sector_->avatar()->setVisible( false ); +// deathSequence_ = 0.0; +// hudOverlay_->show(); +// MessageShipRegister msg( 0, 0, sector_->avatar()->name(), sector_->avatar()->mainNode()->getPosition(), true ); +// network_->send( msg ); +// } + +// void SectorClientFrameListener::avatarDied( ){ +// deathSequence_ = 3.0; +// cameraMode_ = 0; +// sector_->avatar()->setVisible( true ); +// camera_->setPosition( sector_->avatar()->mainNode()->getPosition() + +// sector_->avatar()->mainNode()->getOrientation().zAxis() * 200 ); - camera_->setOrientation( sector_->avatar()->mainNode()->getOrientation() ); - hudOverlay_->hide(); - // sector_->destroyAvatar( ); -} +// camera_->setOrientation( sector_->avatar()->mainNode()->getOrientation() ); +// hudOverlay_->hide(); +// MessageShipRegister msg( 0, 0, sector_->avatar()->name(), sector_->avatar()->mainNode()->getPosition(), false ); +// network_->send( msg ); +// // sector_->destroyAvatar( ); +// } + bool SectorClientFrameListener::renderSpaceDust(){ const Ogre::Real maxDist = 250.0; Modified: branches/ogsector/src/SectorClientFrameListener.h =================================================================== --- branches/ogsector/src/SectorClientFrameListener.h 2007-03-28 21:50:26 UTC (rev 345) +++ branches/ogsector/src/SectorClientFrameListener.h 2007-04-01 18:01:19 UTC (rev 346) @@ -2,10 +2,10 @@ #define SECTORCLIENTFRAMELISTENER__H #include <Ogre.h> -#include <OgreKeyEvent.h> -#include <OgreEventListeners.h> -#include <OgreStringConverter.h> -#include <OgreException.h> +// #include <OgreKeyEvent.h> +// #include <OgreEventListeners.h> +// #include <OgreStringConverter.h> +// #include <OgreException.h> #include "InputManager.h"... [truncated message content] |
From: <spo...@us...> - 2007-04-05 13:01:38
|
Revision: 359 http://svn.sourceforge.net/opengate/?rev=359&view=rev Author: spom_spom Date: 2007-04-05 06:01:37 -0700 (Thu, 05 Apr 2007) Log Message: ----------- Ported to ogre-1.4. Freeimage from gentoo-ebuild dont work with ogre-1.4, Running ogsector with a manual installed Freeimage works fine. Modified Paths: -------------- branches/ogsector/configure.ac branches/ogsector/data/MediaFromOgre/ogrehead.mesh branches/ogsector/data/arrow.mesh branches/ogsector/data/povray/buildSkyBox.sh branches/ogsector/data/simpleHUD.overlay branches/ogsector/data/simpleSkybox.material branches/ogsector/data/simpleSkybox.zip branches/ogsector/ogre.cfg branches/ogsector/resources.cfg branches/ogsector/src/InputManager.cpp branches/ogsector/src/InputManager.h branches/ogsector/src/Sector.cpp branches/ogsector/src/Sector.h branches/ogsector/src/SectorClient.cpp branches/ogsector/src/SectorClient.h branches/ogsector/src/SectorClientFrameListener.cpp branches/ogsector/src/SectorClientFrameListener.h branches/ogsector/src/SectorObjects.cpp branches/ogsector/src/networkClient.cpp branches/ogsector/src/networkClient.h branches/ogsector/src/ogsectorclient.cpp Modified: branches/ogsector/configure.ac =================================================================== --- branches/ogsector/configure.ac 2007-04-05 12:33:54 UTC (rev 358) +++ branches/ogsector/configure.ac 2007-04-05 13:01:37 UTC (rev 359) @@ -21,7 +21,7 @@ AC_SUBST(AM_CXXFLAGS,"$AM_CXXFLAGS $OGRE_CFLAGS") AC_SUBST(AM_LDFLAGS,"$AM_LDFLAGS $OGRE_LIBS") -#OIS - http://www.sourceforge.net/projects/wgois/ +dnl OIS - http://www.sourceforge.net/projects/wgois/ PKG_CHECK_MODULES(OIS, [OIS >= 0.9.9]) AC_SUBST(AM_CXXFLAGS, "$AM_CXXFLAGS $OIS_CFLAGS") AC_SUBST(AM_LDFLAGS, "$AM_LDFLAGS $OIS_LIBS") @@ -36,6 +36,7 @@ AC_SUBST(AM_CXXFLAGS, "$AM_CXXFLAGS $freealut_CFLAGS") AC_SUBST(AM_LDFLAGS, "$AM_LDFLAGS $freealut_LIBS") +AC_SUBST([CXXFLAGS], ["${CXXFLAGS} -I$OGSECTOR_EXTERNALS_PATH/include"]) AC_SUBST([CXXFLAGS], ["${CXXFLAGS} -I$OGSECTOR_EXTERNALS_PATH/ogreopcode/include"]) AC_SUBST([CXXFLAGS], ["${CXXFLAGS} -I$OGSECTOR_EXTERNALS_PATH/ogreopcode/opcode132"]) AC_SUBST([LDFLAGS], ["${LDFLAGS} -L$OGSECTOR_EXTERNALS_PATH/lib/ -lOpcode -lOgreOpcode"]) Modified: branches/ogsector/data/MediaFromOgre/ogrehead.mesh =================================================================== (Binary files differ) Modified: branches/ogsector/data/arrow.mesh =================================================================== (Binary files differ) Modified: branches/ogsector/data/povray/buildSkyBox.sh =================================================================== --- branches/ogsector/data/povray/buildSkyBox.sh 2007-04-05 12:33:54 UTC (rev 358) +++ branches/ogsector/data/povray/buildSkyBox.sh 2007-04-05 13:01:37 UTC (rev 359) @@ -1,4 +1,4 @@ -RESOLUTION=1024 +RESOLUTION=512 POVFILE=skybox2.pov OUTNAME=${POVFILE%.pov} Modified: branches/ogsector/data/simpleHUD.overlay =================================================================== --- branches/ogsector/data/simpleHUD.overlay 2007-04-05 12:33:54 UTC (rev 358) +++ branches/ogsector/data/simpleHUD.overlay 2007-04-05 13:01:37 UTC (rev 359) @@ -64,7 +64,7 @@ colour_bottom 1 1 0.7 } - element TextArea(Core/DebugText) + element TextArea(OpenGate/DebugText) { metrics_mode pixels left 230 Modified: branches/ogsector/data/simpleSkybox.material =================================================================== --- branches/ogsector/data/simpleSkybox.material 2007-04-05 12:33:54 UTC (rev 358) +++ branches/ogsector/data/simpleSkybox.material 2007-04-05 13:01:37 UTC (rev 359) @@ -1,34 +1,34 @@ -material OpenGate/SimpleSkyBox1 -{ - technique - { - pass - { - lighting off - depth_write off - - texture_unit - { - cubic_texture skybox1.jpg separateUV - tex_address_mode clamp - } - } - } -} -material OpenGate/SimpleSkyBox2 -{ - technique - { - pass - { - lighting off - depth_write off - - texture_unit - { - cubic_texture skybox2.jpg separateUV - tex_address_mode clamp - } - } - } -} +material OpenGate/SimpleSkyBox1 +{ + technique + { + pass + { + lighting off + depth_write off + + texture_unit + { + cubic_texture skybox1.png separateUV + tex_address_mode clamp + } + } + } +} +material OpenGate/SimpleSkyBox2 +{ + technique + { + pass + { + lighting off + depth_write off + + texture_unit + { + cubic_texture skybox2.png separateUV + tex_address_mode clamp + } + } + } +} Modified: branches/ogsector/data/simpleSkybox.zip =================================================================== (Binary files differ) Modified: branches/ogsector/ogre.cfg =================================================================== --- branches/ogsector/ogre.cfg 2007-04-05 12:33:54 UTC (rev 358) +++ branches/ogsector/ogre.cfg 2007-04-05 13:01:37 UTC (rev 359) @@ -1,7 +1,7 @@ Render System=OpenGL Rendering Subsystem [OpenGL Rendering Subsystem] -FSAA=6 +FSAA=0 Full Screen=No RTT Preferred Mode=FBO Video Mode=1024 x 768 Modified: branches/ogsector/resources.cfg =================================================================== --- branches/ogsector/resources.cfg 2007-04-05 12:33:54 UTC (rev 358) +++ branches/ogsector/resources.cfg 2007-04-05 13:01:37 UTC (rev 359) @@ -6,9 +6,9 @@ [General] FileSystem=./data Zip=./data/simpleSkybox.zip - +# FileSystem=./data/MediaFromOgre Zip=./data/MediaFromOgre/fonts.zip - +# FileSystem=../../trunk/data/ FileSystem=../../trunk/data/materials Modified: branches/ogsector/src/InputManager.cpp =================================================================== --- branches/ogsector/src/InputManager.cpp 2007-04-05 12:33:54 UTC (rev 358) +++ branches/ogsector/src/InputManager.cpp 2007-04-05 13:01:37 UTC (rev 359) @@ -1,384 +1,388 @@ #include "InputManager.h" +#include "OgreStringConverter.h" -InputManager *InputManager::mInputManager; +InputManager::InputManager( unsigned long hWnd ){ + mMouse = NULL; + mKeyboard = NULL; + mJoyStick = NULL; + mInputSystem = NULL; -InputManager::InputManager( void ) : - mMouse( 0 ), - mKeyboard( 0 ), - mInputSystem( 0 ) { + OIS::ParamList pl; + pl.insert( OIS::ParamList::value_type( "WINDOW", Ogre::StringConverter::toString( hWnd ) ) ); + + m_hWnd = hWnd; + mInputSystem = OIS::InputManager::createInputSystem( pl ); + + if ( mInputSystem ){ + mMouse = static_cast<OIS::Mouse*>(mInputSystem->createInputObject( OIS::OISMouse, true )); + mMouse->setEventCallback( this ); + + mKeyboard = static_cast<OIS::Keyboard*>(mInputSystem->createInputObject( OIS::OISKeyboard, true)); + mKeyboard->setEventCallback( this ); + + if ( mInputSystem->numJoysticks() > 0 ) { + + // mJoysticks.resize( mInputSystem->numJoysticks() ); + + // itJoystick = mJoysticks.begin(); + // itJoystickEnd = mJoysticks.end(); + // for(; itJoystick != itJoystickEnd; ++itJoystick ) { + // (*itJoystick) = static_cast<OIS::JoyStick*>( mInputSystem->createInputObject( OIS::OISJoyStick, true ) ); + // (*itJoystick)->setEventCallback( this ); + // } + mJoyStick = static_cast<OIS::JoyStick*>(mInputSystem->createInputObject( OIS::OISJoyStick, true)); + mJoyStick->setEventCallback( this ); + } + } } InputManager::~InputManager( void ) { if( mInputSystem ) { if( mMouse ) { mInputSystem->destroyInputObject( mMouse ); - mMouse = 0; + mMouse = NULL; } - + if( mKeyboard ) { mInputSystem->destroyInputObject( mKeyboard ); - mKeyboard = 0; + mKeyboard = NULL; } - if( mJoysticks.size() > 0 ) { - itJoystick = mJoysticks.begin(); - itJoystickEnd = mJoysticks.end(); - for(; itJoystick != itJoystickEnd; ++itJoystick ) { - mInputSystem->destroyInputObject( *itJoystick ); - } - - mJoysticks.clear(); + if( mJoyStick ) { + mInputSystem->destroyInputObject( mJoyStick ); + mJoyStick = NULL; } - - //** did not compile against my OIS version - // mInputSystem->destroyInputSystem( ); - //** did not compile against my OIS version + } - - mInputSystem = 0; - - // Clear Listeners - mKeyListeners.clear(); - mMouseListeners.clear(); - mJoystickListeners.clear(); - } + OIS::InputManager::destroyInputSystem( mInputSystem ); + + mInputSystem = NULL; + + // Clear Listeners + mKeyListeners.clear(); + mMouseListeners.clear(); + mJoystickListeners.clear(); } -void InputManager::initialise( Ogre::RenderWindow *renderWindow ) { - if( !mInputSystem ) { - // Setup basic variables - OIS::ParamList paramList; - size_t windowHnd = 0; - std::ostringstream windowHndStr; +void InputManager::capture( ) { + if( mMouse ) mMouse->capture(); - // Get window handle -#if defined OIS_WIN32_PLATFORM - renderWindow->getCustomAttribute( "HWND", &windowHnd ); - // Uncomment these two lines to allow users to switch keyboards via the language bar - //paramList.insert(std::make_pair(std::string("w32_keyboard"), std::string("DISCL_FOREGROUND") )); - //paramList.insert(std::make_pair(std::string("w32_keyboard"), std::string("DISCL_NONEXCLUSIVE") )); + if( mKeyboard ) mKeyboard->capture(); -#elif defined OIS_LINUX_PLATFORM - renderWindow->getCustomAttribute( "GLXWINDOW", &windowHnd ); -#endif - - // Fill parameter list - windowHndStr << (unsigned int) windowHnd; - paramList.insert( std::make_pair( std::string( "WINDOW" ), windowHndStr.str() ) ); - - // Create inputsystem - mInputSystem = OIS::InputManager::createInputSystem( paramList ); - - // If possible create a buffered keyboard - if( mInputSystem->numKeyBoards() > 0 ) { - mKeyboard = static_cast<OIS::Keyboard*>( mInputSystem->createInputObject( OIS::OISKeyboard, true ) ); - mKeyboard->setEventCallback( this ); - } - - // If possible create a buffered mouse - if( mInputSystem->numMice() > 0 ) { - mMouse = static_cast<OIS::Mouse*>( mInputSystem->createInputObject( OIS::OISMouse, true ) ); - mMouse->setEventCallback( this ); - - // Get window size - unsigned int width, height, depth; - int left, top; - renderWindow->getMetrics( width, height, depth, left, top ); - - // Set mouse region - this->setWindowExtents( width, height ); - } - - // If possible create all joysticks in buffered mode - if( mInputSystem->numJoysticks() > 0 ) { - mJoysticks.resize( mInputSystem->numJoysticks() ); - - itJoystick = mJoysticks.begin(); - itJoystickEnd = mJoysticks.end(); - for(; itJoystick != itJoystickEnd; ++itJoystick ) { - (*itJoystick) = static_cast<OIS::JoyStick*>( mInputSystem->createInputObject( OIS::OISJoyStick, true ) ); - (*itJoystick)->setEventCallback( this ); - } - } - } + if( mJoyStick ) mJoyStick->capture(); } -void InputManager::capture( void ) { - // Need to capture / update each device every frame - if( mMouse ) { - mMouse->capture(); - } - - if( mKeyboard ) { - mKeyboard->capture(); - } - - if( mJoysticks.size() > 0 ) { - itJoystick = mJoysticks.begin(); - itJoystickEnd = mJoysticks.end(); - for(; itJoystick != itJoystickEnd; ++itJoystick ) { - (*itJoystick)->capture(); - } - } +void InputManager::setWindowExtents(int width, int height){ + //Set Mouse Region.. if window resizes, we should alter this to reflect as well + const OIS::MouseState &ms = mMouse->getMouseState(); + ms.width = width; + ms.height = height; } void InputManager::addKeyListener( OIS::KeyListener *keyListener, const std::string& instanceName ) { - if( mKeyboard ) { - // Check for duplicate items - itKeyListener = mKeyListeners.find( instanceName ); - if( itKeyListener == mKeyListeners.end() ) { - mKeyListeners[ instanceName ] = keyListener; - } - else { - // Duplicate Item - } - } -} - -void InputManager::addMouseListener( OIS::MouseListener *mouseListener, const std::string& instanceName ) { - if( mMouse ) { - // Check for duplicate items - itMouseListener = mMouseListeners.find( instanceName ); - if( itMouseListener == mMouseListeners.end() ) { - mMouseListeners[ instanceName ] = mouseListener; - } - else { - // Duplicate Item - } - } -} - -void InputManager::addJoystickListener( OIS::JoyStickListener *joystickListener, const std::string& instanceName ) { - if( mJoysticks.size() > 0 ) { - // Check for duplicate items - itJoystickListener = mJoystickListeners.find( instanceName ); - if( itJoystickListener == mJoystickListeners.end() ) { - mJoystickListeners[ instanceName ] = joystickListener; - } - else { - // Duplicate Item - } - } -} - -void InputManager::removeKeyListener( const std::string& instanceName ) { - // Check if item exists + if( mKeyboard ) { + // Check for duplicate items itKeyListener = mKeyListeners.find( instanceName ); - if( itKeyListener != mKeyListeners.end() ) { - mKeyListeners.erase( itKeyListener ); + if( itKeyListener == mKeyListeners.end() ) { + mKeyListeners[ instanceName ] = keyListener; } else { - // Doesn't Exist + // Duplicate Item } + } } -void InputManager::removeMouseListener( const std::string& instanceName ) { - // Check if item exists +void InputManager::addMouseListener( OIS::MouseListener *mouseListener, const std::string& instanceName ) { + if( mMouse ) { + // Check for duplicate items itMouseListener = mMouseListeners.find( instanceName ); - if( itMouseListener != mMouseListeners.end() ) { - mMouseListeners.erase( itMouseListener ); + if( itMouseListener == mMouseListeners.end() ) { + mMouseListeners[ instanceName ] = mouseListener; } else { - // Doesn't Exist + // Duplicate Item } + } } -void InputManager::removeJoystickListener( const std::string& instanceName ) { - // Check if item exists +void InputManager::addJoystickListener( OIS::JoyStickListener *joystickListener, const std::string& instanceName ) { + if( mJoyStick ) { + // Check for duplicate items itJoystickListener = mJoystickListeners.find( instanceName ); - if( itJoystickListener != mJoystickListeners.end() ) { - mJoystickListeners.erase( itJoystickListener ); + if( itJoystickListener == mJoystickListeners.end() ) { + mJoystickListeners[ instanceName ] = joystickListener; } else { - // Doesn't Exist + // Duplicate Item } + } } +void InputManager::removeKeyListener( const std::string & instanceName ) { + // Check if item exists + itKeyListener = mKeyListeners.find( instanceName ); + if( itKeyListener != mKeyListeners.end() ) { + mKeyListeners.erase( itKeyListener ); + } + else { + // Doesn't Exist + } +} + +void InputManager::removeMouseListener( const std::string & instanceName ) { + // Check if item exists + itMouseListener = mMouseListeners.find( instanceName ); + if( itMouseListener != mMouseListeners.end() ) { + mMouseListeners.erase( itMouseListener ); + } + else { + // Doesn't Exist + } +} + +void InputManager::removeJoystickListener( const std::string & instanceName ) { + // Check if item exists + itJoystickListener = mJoystickListeners.find( instanceName ); + if( itJoystickListener != mJoystickListeners.end() ) { + mJoystickListeners.erase( itJoystickListener ); + } + else { + // Doesn't Exist + } +} + void InputManager::removeKeyListener( OIS::KeyListener *keyListener ) { - itKeyListener = mKeyListeners.begin(); - itKeyListenerEnd = mKeyListeners.end(); - for(; itKeyListener != itKeyListenerEnd; ++itKeyListener ) { - if( itKeyListener->second == keyListener ) { - mKeyListeners.erase( itKeyListener ); - break; - } + itKeyListener = mKeyListeners.begin(); + itKeyListenerEnd = mKeyListeners.end(); + for(; itKeyListener != itKeyListenerEnd; ++itKeyListener ) { + if( itKeyListener->second == keyListener ) { + mKeyListeners.erase( itKeyListener ); + break; } + } } void InputManager::removeMouseListener( OIS::MouseListener *mouseListener ) { - itMouseListener = mMouseListeners.begin(); - itMouseListenerEnd = mMouseListeners.end(); - for(; itMouseListener != itMouseListenerEnd; ++itMouseListener ) { - if( itMouseListener->second == mouseListener ) { - mMouseListeners.erase( itMouseListener ); - break; - } + itMouseListener = mMouseListeners.begin(); + itMouseListenerEnd = mMouseListeners.end(); + for(; itMouseListener != itMouseListenerEnd; ++itMouseListener ) { + if( itMouseListener->second == mouseListener ) { + mMouseListeners.erase( itMouseListener ); + break; } + } } void InputManager::removeJoystickListener( OIS::JoyStickListener *joystickListener ) { - itJoystickListener = mJoystickListeners.begin(); - itJoystickListenerEnd = mJoystickListeners.end(); - for(; itJoystickListener != itJoystickListenerEnd; ++itJoystickListener ) { - if( itJoystickListener->second == joystickListener ) { - mJoystickListeners.erase( itJoystickListener ); - break; - } + itJoystickListener = mJoystickListeners.begin(); + itJoystickListenerEnd = mJoystickListeners.end(); + for(; itJoystickListener != itJoystickListenerEnd; ++itJoystickListener ) { + if( itJoystickListener->second == joystickListener ) { + mJoystickListeners.erase( itJoystickListener ); + break; } + } } void InputManager::removeAllListeners( void ) { - mKeyListeners.clear(); - mMouseListeners.clear(); - mJoystickListeners.clear(); + mKeyListeners.clear(); + mMouseListeners.clear(); + mJoystickListeners.clear(); } void InputManager::removeAllKeyListeners( void ) { - mKeyListeners.clear(); + mKeyListeners.clear(); } void InputManager::removeAllMouseListeners( void ) { - mMouseListeners.clear(); + mMouseListeners.clear(); } void InputManager::removeAllJoystickListeners( void ) { - mJoystickListeners.clear(); + mJoystickListeners.clear(); } -void InputManager::setWindowExtents( int width, int height ) { - // Set mouse region (if window resizes, we should alter this to reflect as well) - const OIS::MouseState &mouseState = mMouse->getMouseState(); - mouseState.width = width; - mouseState.height = height; -} - -OIS::Mouse* InputManager::getMouse( void ) { - return mMouse; -} - -OIS::Keyboard* InputManager::getKeyboard( void ) { - return mKeyboard; -} - -OIS::JoyStick* InputManager::getJoystick( unsigned int index ) { - // Make sure it's a valid index - if( index < mJoysticks.size() ) { - return mJoysticks[ index ]; - } - - return 0; -} - -int InputManager::getNumOfJoysticks( void ) { - // Cast to keep compiler happy ^^ - return (int) mJoysticks.size(); -} - bool InputManager::keyPressed( const OIS::KeyEvent &e ) { - itKeyListener = mKeyListeners.begin(); - itKeyListenerEnd = mKeyListeners.end(); - for(; itKeyListener != itKeyListenerEnd; ++itKeyListener ) { - itKeyListener->second->keyPressed( e ); - } - - return true; + itKeyListener = mKeyListeners.begin(); + itKeyListenerEnd = mKeyListeners.end(); + for(; itKeyListener != itKeyListenerEnd; ++itKeyListener ) { + itKeyListener->second->keyPressed( e ); + } + return true; } bool InputManager::keyReleased( const OIS::KeyEvent &e ) { - itKeyListener = mKeyListeners.begin(); - itKeyListenerEnd = mKeyListeners.end(); - for(; itKeyListener != itKeyListenerEnd; ++itKeyListener ) { - itKeyListener->second->keyReleased( e ); - } - - return true; + itKeyListener = mKeyListeners.begin(); + itKeyListenerEnd = mKeyListeners.end(); + for(; itKeyListener != itKeyListenerEnd; ++itKeyListener ) { + itKeyListener->second->keyReleased( e ); + } + return true; } bool InputManager::mouseMoved( const OIS::MouseEvent &e ) { - itMouseListener = mMouseListeners.begin(); - itMouseListenerEnd = mMouseListeners.end(); - for(; itMouseListener != itMouseListenerEnd; ++itMouseListener ) { + // for_each( mMouseListeners.begin(), mMouseListeners.end(), std::mem_fun( itMouseListener.second->mouseMoved( e ) ) ); + + itMouseListener = mMouseListeners.begin(); + itMouseListenerEnd = mMouseListeners.end(); + for(; itMouseListener != itMouseListenerEnd; ++itMouseListener ) { itMouseListener->second->mouseMoved( e ); - } - - return true; + } + return true; } bool InputManager::mousePressed( const OIS::MouseEvent &e, OIS::MouseButtonID id ) { - itMouseListener = mMouseListeners.begin(); - itMouseListenerEnd = mMouseListeners.end(); - for(; itMouseListener != itMouseListenerEnd; ++itMouseListener ) { - itMouseListener->second->mousePressed( e, id ); - } - - return true; + itMouseListener = mMouseListeners.begin(); + itMouseListenerEnd = mMouseListeners.end(); + for(; itMouseListener != itMouseListenerEnd; ++itMouseListener ) { + itMouseListener->second->mousePressed( e, id ); + } + return true; } bool InputManager::mouseReleased( const OIS::MouseEvent &e, OIS::MouseButtonID id ) { - itMouseListener = mMouseListeners.begin(); - itMouseListenerEnd = mMouseListeners.end(); - for(; itMouseListener != itMouseListenerEnd; ++itMouseListener ) { - itMouseListener->second->mouseReleased( e, id ); - } - - return true; + itMouseListener = mMouseListeners.begin(); + itMouseListenerEnd = mMouseListeners.end(); + for(; itMouseListener != itMouseListenerEnd; ++itMouseListener ) { + itMouseListener->second->mouseReleased( e, id ); + } + return true; } bool InputManager::povMoved( const OIS::JoyStickEvent &e, int pov ) { - itJoystickListener = mJoystickListeners.begin(); - itJoystickListenerEnd = mJoystickListeners.end(); - for(; itJoystickListener != itJoystickListenerEnd; ++itJoystickListener ) { - itJoystickListener->second->povMoved( e, pov ); - } - - return true; + itJoystickListener = mJoystickListeners.begin(); + itJoystickListenerEnd = mJoystickListeners.end(); + for(; itJoystickListener != itJoystickListenerEnd; ++itJoystickListener ) { + itJoystickListener->second->povMoved( e, pov ); + } + return true; } bool InputManager::axisMoved( const OIS::JoyStickEvent &e, int axis ) { itJoystickListener = mJoystickListeners.begin(); itJoystickListenerEnd = mJoystickListeners.end(); - + for(; itJoystickListener != itJoystickListenerEnd; ++itJoystickListener ) { itJoystickListener->second->axisMoved( e, axis ); } - return true; } bool InputManager::sliderMoved( const OIS::JoyStickEvent &e, int sliderID ) { - itJoystickListener = mJoystickListeners.begin(); - itJoystickListenerEnd = mJoystickListeners.end(); - for(; itJoystickListener != itJoystickListenerEnd; ++itJoystickListener ) { - itJoystickListener->second->sliderMoved( e, sliderID ); - } - - return true; + itJoystickListener = mJoystickListeners.begin(); + itJoystickListenerEnd = mJoystickListeners.end(); + for(; itJoystickListener != itJoystickListenerEnd; ++itJoystickListener ) { + itJoystickListener->second->sliderMoved( e, sliderID ); + } + return true; } bool InputManager::buttonPressed( const OIS::JoyStickEvent &e, int button ) { - itJoystickListener = mJoystickListeners.begin(); - itJoystickListenerEnd = mJoystickListeners.end(); - for(; itJoystickListener != itJoystickListenerEnd; ++itJoystickListener ) { - itJoystickListener->second->buttonPressed( e, button ); - } - - return true; + itJoystickListener = mJoystickListeners.begin(); + itJoystickListenerEnd = mJoystickListeners.end(); + for(; itJoystickListener != itJoystickListenerEnd; ++itJoystickListener ) { + itJoystickListener->second->buttonPressed( e, button ); + } + return true; } bool InputManager::buttonReleased( const OIS::JoyStickEvent &e, int button ) { - itJoystickListener = mJoystickListeners.begin(); - itJoystickListenerEnd = mJoystickListeners.end(); - for(; itJoystickListener != itJoystickListenerEnd; ++itJoystickListener ) { - itJoystickListener->second->buttonReleased( e, button ); - } - - return true; + itJoystickListener = mJoystickListeners.begin(); + itJoystickListenerEnd = mJoystickListeners.end(); + for(; itJoystickListener != itJoystickListenerEnd; ++itJoystickListener ) { + itJoystickListener->second->buttonReleased( e, button ); + } + return true; } -InputManager* InputManager::getSingletonPtr( void ) { - if( !mInputManager ) { - mInputManager = new InputManager(); - } +// void InputManager::initialise( Ogre::RenderWindow *renderWindow ) { +// if( !mInputSystem ) { +// // Setup basic variables +// OIS::ParamList paramList; +// size_t windowHnd = 0; +// std::ostringstream windowHndStr; - return mInputManager; -} +// // Get window handle +// #if defined OIS_WIN32_PLATFORM +// renderWindow->getCustomAttribute( "HWND", &windowHnd ); +// // Uncomment these two lines to allow users to switch keyboards via the language bar +// //paramList.insert(std::make_pair(std::string("w32_keyboard"), std::string("DISCL_FOREGROUND") )); +// //paramList.insert(std::make_pair(std::string("w32_keyboard"), std::string("DISCL_NONEXCLUSIVE") )); + +// #elif defined OIS_LINUX_PLATFORM +// renderWindow->getCustomAttribute( "GLXWINDOW", &windowHnd ); +// #endif + +// // Fill parameter list +// windowHndStr << (unsigned int) windowHnd; +// paramList.insert( std::make_pair( std::string( "WINDOW" ), windowHndStr.str() ) ); + +// // Create inputsystem +// mInputSystem = OIS::InputManager::createInputSystem( paramList ); + +// // If possible create a buffered keyboard +// #ifndef WIN32 +// if( mInputSystem->numKeyBoards() > 0 ) { +// mKeyboard = static_cast<OIS::Keyboard*>( mInputSystem->createInputObject( OIS::OISKeyboard, true ) ); +// mKeyboard->setEventCallback( this ); +// } + +// // If possible create a buffered mouse +// if( mInputSystem->numMice() > 0 ) { +// mMouse = static_cast<OIS::Mouse*>( mInputSystem->createInputObject( OIS::OISMouse, true ) ); +// mMouse->setEventCallback( this ); + +// // Get window size +// unsigned int width, height, depth; +// int left, top; +// renderWindow->getMetrics( width, height, depth, left, top ); + +// // Set mouse region +// this->setWindowExtents( width, height ); +// } + +// // If possible create all joysticks in buffered mode +// if( mInputSystem->numJoysticks() > 0 ) { +// mJoysticks.resize( mInputSystem->numJoysticks() ); + +// itJoystick = mJoysticks.begin(); +// itJoystickEnd = mJoysticks.end(); +// for(; itJoystick != itJoystickEnd; ++itJoystick ) { +// (*itJoystick) = static_cast<OIS::JoyStick*>( mInputSystem->createInputObject( OIS::OISJoyStick, true ) ); +// (*itJoystick)->setEventCallback( this ); +// } +// } +// #endif +// } +// } + +// OIS::Mouse* InputManager::getMouse( void ) { +// return mMouse; +// } + +// OIS::Keyboard* InputManager::getKeyboard( void ) { +// return mKeyboard; +// } + +// OIS::JoyStick* InputManager::getJoystick( unsigned int index ) { +// // Make sure it's a valid index +// if( index < mJoysticks.size() ) { +// return mJoysticks[ index ]; +// } + +// return 0; +// } + +// int InputManager::getNumOfJoysticks( void ) { +// // Cast to keep compiler happy ^^ +// return (int) mJoysticks.size(); +// } + + +// InputManager* InputManager::getSingletonPtr( void ) { +// if( !mInputManager ) { +// mInputManager = new InputManager(); +// } + +// return mInputManager; +// } Modified: branches/ogsector/src/InputManager.h =================================================================== --- branches/ogsector/src/InputManager.h 2007-04-05 12:33:54 UTC (rev 358) +++ branches/ogsector/src/InputManager.h 2007-04-05 13:01:37 UTC (rev 359) @@ -1,97 +1,126 @@ #ifndef INPUTMANAGER_H // INPUTMANAGER_H #define INPUTMANAGER_H -#include <OISMouse.h> -#include <OISKeyboard.h> -#include <OISJoyStick.h> -#include <OISInputManager.h> +#ifdef WIN32 +#define OIS_WIN32_PLATFORM +#else +#define OIS_LINUX_PLATFORM +#endif -#include <OgreRenderWindow.h> +#include <OIS/OISEvents.h> +#include <OIS/OISInputManager.h> +#include <OIS/OISMouse.h> +#include <OIS/OISKeyboard.h> +#include <OIS/OISJoyStick.h> -#if defined OIS_WIN32_PLATFORM +#ifdef OIS_WIN32_PLATFORM #define WIN32_LEAN_AND_MEAN #include "windows.h" -#include "resource.h" -LRESULT DlgProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ); - +// #include "resource.h" +// LRESULT DlgProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ); #elif defined OIS_LINUX_PLATFORM -#include <X11/Xlib.h> -void checkX11Events(); #endif -class InputManager : public OIS::KeyListener, public OIS::MouseListener, public OIS::JoyStickListener { +class InputManager : public OIS::MouseListener, public OIS::KeyListener, public OIS::JoyStickListener { public: - virtual ~InputManager( void ); + InputManager( unsigned long hWnd ); + virtual ~InputManager(); + + void setWindowExtents( int width, int height ) ; - void initialise( Ogre::RenderWindow *renderWindow ); - void capture( void ); + /*! 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 ); - + void removeKeyListener( const std::string & instanceName ); void removeMouseListener( const std::string & instanceName ); void removeJoystickListener( const std::string & instanceName ); - + void removeKeyListener( OIS::KeyListener * keyListener ); void removeMouseListener( OIS::MouseListener * mouseListener ); void removeJoystickListener( OIS::JoyStickListener * joystickListener ); - + void removeAllListeners( void ); void removeAllKeyListeners( void ); void removeAllMouseListeners( void ); void removeAllJoystickListeners( void ); + + // KeyListener + bool keyPressed(const OIS::KeyEvent &evt); + bool keyReleased(const OIS::KeyEvent &evt); + + // MouseListener + bool mouseMoved(const OIS::MouseEvent &evt); + bool mousePressed(const OIS::MouseEvent &evt, OIS::MouseButtonID); + bool mouseReleased(const OIS::MouseEvent &evt, OIS::MouseButtonID); - void setWindowExtents( int width, int height ); - - OIS::Mouse* getMouse( void ); - OIS::Keyboard* getKeyboard( void ); - OIS::JoyStick* getJoystick( unsigned int index ); - - int getNumOfJoysticks( void ); - - static InputManager* getSingletonPtr( void ); - -private: - InputManager( void ); - InputManager( const InputManager & input ) { } - InputManager & operator = ( const InputManager & input ); - - bool keyPressed( const OIS::KeyEvent & e ); - bool keyReleased( const OIS::KeyEvent & e ); - - bool mouseMoved( const OIS::MouseEvent & e ); - bool mousePressed( const OIS::MouseEvent & e, OIS::MouseButtonID id ); - bool mouseReleased( const OIS::MouseEvent & e, OIS::MouseButtonID id ); - - bool povMoved( const OIS::JoyStickEvent & e, int pov ); - bool axisMoved( const OIS::JoyStickEvent & e, int axis ); + // JoyStickListener + bool axisMoved(const OIS::JoyStickEvent &evt, int index ); + bool buttonPressed(const OIS::JoyStickEvent &evt, int index ); + bool buttonReleased(const OIS::JoyStickEvent &evt, int index ); bool sliderMoved( const OIS::JoyStickEvent & e, int sliderID ); - bool buttonPressed( const OIS::JoyStickEvent & e, int button ); - bool buttonReleased( const OIS::JoyStickEvent & e, int button ); - - OIS::InputManager * mInputSystem; - OIS::Mouse * mMouse; - OIS::Keyboard * mKeyboard; - - std::vector< OIS::JoyStick * > mJoysticks; - std::vector< OIS::JoyStick * >::iterator itJoystick; - std::vector< OIS::JoyStick * >::iterator itJoystickEnd; - + bool povMoved(const OIS::JoyStickEvent &evt, int index ); + +protected: + + OIS::InputManager *mInputSystem; + OIS::Mouse *mMouse; + OIS::Keyboard *mKeyboard; + OIS::JoyStick *mJoyStick; + unsigned long m_hWnd; + std::map< std::string, OIS::KeyListener * > mKeyListeners; std::map< std::string, OIS::MouseListener * > mMouseListeners; std::map< std::string, OIS::JoyStickListener * > mJoystickListeners; - + std::map< std::string, OIS::KeyListener * >::iterator itKeyListener; std::map< std::string, OIS::MouseListener * >::iterator itMouseListener; std::map< std::string, OIS::JoyStickListener * >::iterator itJoystickListener; - + std::map< std::string, OIS::KeyListener * >::iterator itKeyListenerEnd; std::map< std::string, OIS::MouseListener * >::iterator itMouseListenerEnd; std::map< std::string, OIS::JoyStickListener * >::iterator itJoystickListenerEnd; - - static InputManager *mInputManager; + }; +// class InputManager : public OIS::KeyListener, public OIS::MouseListener, public OIS::JoyStickListener { +// public: +// virtual ~InputManager( void ); + +// void initialise( Ogre::RenderWindow *renderWindow ); +// void capture( void ); + +// void setWindowExtents( int width, int height ); + +// OIS::Mouse* getMouse( void ); +// OIS::Keyboard* getKeyboard( void ); +// OIS::JoyStick* getJoystick( unsigned int index ); + +// int getNumOfJoysticks( void ); + +// static InputManager* getSingletonPtr( void ); + +// private: +// InputManager( void ); +// InputManager( const InputManager & input ) { } +// InputManager & operator = ( const InputManager & input ); + +// OIS::InputManager * mInputSystem; +// OIS::Mouse * mMouse; +// OIS::Keyboard * mKeyboard; + +// std::vector< OIS::JoyStick * > mJoysticks; +// std::vector< OIS::JoyStick * >::iterator itJoystick; +// std::vector< OIS::JoyStick * >::iterator itJoystickEnd; + +// std::map< std::string, OIS::KeyListener * > mKeyListeners; +// std::map< std::string, OIS::MouseListener * > mMouseListeners; +// std::map< std::string, OIS::JoyStickListener * > mJoystickListeners; + +// static InputManager *mInputManager; +// }; + #endif // INPUTMANAGER_H Modified: branches/ogsector/src/Sector.cpp =================================================================== --- branches/ogsector/src/Sector.cpp 2007-04-05 12:33:54 UTC (rev 358) +++ branches/ogsector/src/Sector.cpp 2007-04-05 13:01:37 UTC (rev 359) @@ -5,20 +5,23 @@ Sector::Sector( Ogre::SceneManager * sceneMgr, Network * network ) : sceneMgr_( sceneMgr ), network_( network ){ sectorname_ = "Testsector"; + avatar_ = NULL; + avatarDeathSequenceTime_ = 0.0; sceneMgr_->setAmbientLight( Ogre::ColourValue(0.5, 0.5, 0.5) ); //** Create a skybox; sceneMgr_->setSkyBox( true, "OpenGate/SimpleSkyBox1", 100 ); - //** Create a light; - Ogre::Light * l = sceneMgr_->createLight("MainLight"); +// //** Create a light; + // Ogre::Light * l = sceneMgr_->createLight("MainLight"); - // Accept default settings: point light, white diffuse, just set position - // NB I could attach the light to a SceneNode if I wanted it to move automatically with - // other objects, but I don't - l->setPosition( 20, 80, 50 ); +// // Accept default settings: point light, white diffuse, just set position +// // NB I could attach the light to a SceneNode if I wanted it to move automatically with +// // other objects, but I don't +// l->setPosition( 0, 0, 200 ); + new OgreOpcode::CollisionManager( sceneMgr_ ); OgreOpcode::CollisionManager::getSingletonPtr()->addCollClass( "SectorObject" ); OgreOpcode::CollisionManager::getSingletonPtr()->addCollClass( "Bullet" ); @@ -39,28 +42,28 @@ createStaticObject( Ogre::String("ogrehead.mesh"), - "ogreheadStation", - Ogre::Vector3( 5000, 0, 0 ), - Ogre::Real( 500.0 ), - Ogre::Degree( 0.0 ) ); + "ogreheadStation", + Ogre::Vector3( 5000, 0, 0 ), + Ogre::Real( 500.0 ), + Ogre::Degree( 0.0 ) ); // createCircle(); createStaticObject( Ogre::String("ogrehead.mesh"), - "-100 0 0", - Ogre::Vector3( -100, 0, 0 ), - Ogre::Real( 10.0 ), - Ogre::Degree( 0.0 ) ); + "-100 0 0", + Ogre::Vector3( -100, 0, 0 ), + Ogre::Real( 10.0 ), + Ogre::Degree( 0.0 ) ); createStaticObject( Ogre::String("ogrehead.mesh"), - "100 0 0", - Ogre::Vector3( 100, 0, 0 ), - Ogre::Real( 10.0 ), - Ogre::Degree( 0.0 ) ); + "100 0 0", + Ogre::Vector3( 100, 0, 0 ), + Ogre::Real( 10.0 ), + Ogre::Degree( 0.0 ) ); itTarget_ = sectorObjects_.begin(); -} +} Sector::~Sector( ){ delete OgreOpcode::CollisionManager::getSingletonPtr(); @@ -73,7 +76,8 @@ void Sector::update( Ogre::Real elapsedTime ){ collideInSectorContext_->collide( 0.0 ); - // collideInSectorContext_->collide( elapsedTime ); + collideInSectorContext_->collide( elapsedTime ); + OgreOpcode::CollisionReporter report( collideInSectorContext_->getCollisionReport() ); int nCollids = report.getNumCollisions(); @@ -91,14 +95,12 @@ 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; + 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; - } + } - // avatar_->update( elapsedTime); - bool tmpsegfaultDebug = false; for ( std::map< long, SectorObjectMoveable * >::iterator it = movableObjects_.begin(); it != movableObjects_.end();){ if ( !it->second->update( elapsedTime ) ) { @@ -114,13 +116,13 @@ std::cout << "tmpsegfaultDebug done." << std::endl; tmpsegfaultDebug = false; } - - if ( avatarDeathSequenceTime_ > 0 ){ - avatarDeathSequenceTime_ -= elapsedTime; - } else if ( avatarDeathSequenceTime_ > -1 ) { - spawnAvatar(); - } - + + if ( avatarDeathSequenceTime_ > 0 ){ + avatarDeathSequenceTime_ -= elapsedTime; + } else if ( avatarDeathSequenceTime_ > -1 ) { + spawnAvatar(); + } + } SectorObjectMoveable * Sector::createMoveableObject( const Ogre::String & name, int userID, int childID ){ @@ -198,8 +200,6 @@ MessageShipRegister msg( 0, obj->childID(), obj->name(), obj->mainNode()->getPosition(), true ); network_->send( msg ); - - } void Sector::createAvatar( const Ogre::String & playername ){ @@ -211,7 +211,7 @@ void Sector::destructAvatar( ){ // sectorObjects_.erase( avatar_ ); movableObjects_.erase( avatar_->globalID() ); - delete avatar_; + if ( avatar_ != NULL ) delete avatar_; avatar_ = NULL; } @@ -224,24 +224,28 @@ } void Sector::spawnAvatar( ){ - avatarDeathSequenceTime_ = -1.0; - - avatar_->mainNode()->setPosition( 0.0, 0.0, 0.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_->reset(); - - MessageShipRegister msg( 0, 0, avatar_->name(), avatar_->mainNode()->getPosition(), true ); - network_->send( msg ); - - avatar_->setVisible( false ); - listener_->avatarDeathSequence( false ); + if ( avatar_ != NULL ){ + avatarDeathSequenceTime_ = -1.0; + + 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_->reset(); + + MessageShipRegister msg( 0, 0, avatar_->name(), avatar_->mainNode()->getPosition(), true ); + network_->send( msg ); + + avatar_->setVisible( false ); + listener_->avatarDeathSequence( false ); + } } SectorObject * Sector::nextTarget( ){ if ( sectorObjects_.size() != 0 ){ itTarget_ ++; - if ( (*itTarget_) == avatar_ ) return nextTarget(); + if ( avatar_ != NULL ){ + if ( (*itTarget_) == avatar_ ) return nextTarget(); + } if ( itTarget_ == sectorObjects_.end() ) itTarget_ = sectorObjects_.begin(); return (*itTarget_); @@ -254,7 +258,9 @@ if ( itTarget_ == sectorObjects_.begin() ) itTarget_ = sectorObjects_.end(); itTarget_ --; - if ( (*itTarget_) == avatar_ ) return prevTarget(); + if ( avatar_ != NULL ){ + if ( (*itTarget_) == avatar_ ) return prevTarget(); + } return (*itTarget_); } return NULL; @@ -323,17 +329,19 @@ } void Sector::sendAllVesselMovements( ){ - MessageShipMovement msg( 0, - avatar_->mainNode()->getPosition(), - avatar_->velDirection(), - avatar_->mainNode()->getOrientation(), - avatar_->thrustPercent(), - avatar_->scaledYaw(), - avatar_->scaledPitch(), - avatar_->scaledRoll(), - avatar_->incNetSequence() ); + if ( avatar_ != NULL ){ + MessageShipMovement msg( 0, + avatar_->mainNode()->getPosition(), + avatar_->velDirection(), + avatar_->mainNode()->getOrientation(), + avatar_->thrustPercent(), + avatar_->scaledYaw(), + avatar_->scaledPitch(), + avatar_->scaledRoll(), + avatar_->incNetSequence() ); - network_->send( msg, false ); + network_->send( msg, false ); + } for ( std::map< int, SectorObjectMoveableAi * >::iterator it = localAiObjects_.begin(); it != localAiObjects_.end(); it ++ ){ MessageShipMovement msgObj( it->second->childID(), @@ -375,7 +383,9 @@ } void Sector::sendAllVesselStatus( ){ - sendVesselStatus( *avatar_ ); + if ( avatar_ != NULL ){ + sendVesselStatus( *avatar_ ); + } // for ( std::map< int, SectorObjectMoveableAi * >::iterator it = localAiObjects_.begin(); it != localAiObjects_.end(); it ++ ){ // sendVesselStatus( *(it->second) ); // } Modified: branches/ogsector/src/Sector.h =================================================================== --- branches/ogsector/src/Sector.h 2007-04-05 12:33:54 UTC (rev 358) +++ branches/ogsector/src/Sector.h 2007-04-05 13:01:37 UTC (rev 359) @@ -25,7 +25,6 @@ void setNetwork( Network * network ){ network_ = network; } - void update( Ogre::Real elapsedTime ); void createStaticObject( const Ogre::String & meshname, const Ogre::String & objectname, @@ -57,7 +56,6 @@ SectorObject * prevTarget( ); - void receiveVesselRegister( const MessageShipRegister & msg ); void sendAllVesselStatus( ); @@ -74,7 +72,6 @@ void receiveVesselAmmoHit( const MessageShipAmmoHit & msg ); - protected: SectorClientFrameListener * listener_; Ogre::SceneManager * sceneMgr_; Modified: branches/ogsector/src/SectorClient.cpp =================================================================== --- branches/ogsector/src/SectorClient.cpp 2007-04-05 12:33:54 UTC (rev 358) +++ branches/ogsector/src/SectorClient.cpp 2007-04-05 13:01:37 UTC (rev 359) @@ -11,28 +11,30 @@ if ( sector_ != NULL ) delete sector_; } -bool SectorClient::setup( ){ - root_ = new Ogre::Root(); +bool SectorClient::setup( bool dialog ){ + root_ = new Ogre::Root; setupResources(); - if ( !configure() ) return false; + if ( !configure( dialog ) ) return false; - sceneMgr_ = root_->createSceneManager( Ogre::ST_GENERIC, "BaseSMInstance"); + //** load ressources + Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups(); + //** load scene Manager + sceneMgr_ = root_->createSceneManager( Ogre::ST_GENERIC, "BaseSMInstance" ); + createCameras(); createViewports(); + //** spom dont what for // Set default mipmap level (NB some APIs ignore this) - Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5); - - // Create any resource listeners (for loading screens) + // Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5); + // Create any resource listeners (for loading screens) // createResourceListener(); - - // Load resources - loadResources(); - + //** spom dont what for + // Create the scene createScene(); @@ -64,58 +66,61 @@ } } -bool SectorClient::configure( void ){ - root_->restoreConfig(); - window_ = root_->initialise( true ); - return true; - - // Show the configuration dialog and initialise the system - // You can skip this and use root.restoreConfig() to load configuration - // settings if you were sure there are valid ones saved in ogre.cfg - if ( root_->showConfigDialog() ) { - // If returned true, user clicked OK so initialise - // Here we choose to let the system create a default rendering window by passing 'true' - window_ = root_->initialise( true ); +bool SectorClient::configure( bool dialog ){ + if ( !dialog ){ + root_->restoreConfig(); + window_ = root_->initialise( true, "OGSectorClient"); return true; } else { - return false; + // Show the configuration dialog and initialise the system + // You can skip this and use root.restoreConfig() to load configuration + // settings if you were sure there are valid ones saved in ogre.cfg + if ( root_->showConfigDialog() ) { + // If returned true, user clicked OK so initialise + // Here we choose to let the system create a default rendering window by passing 'true' + window_ = root_->initialise( true ); + return true; + } else { + return false; + } } + return false; } void SectorClient::createCameras( ) { camera_ = sceneMgr_->createCamera("CameraMain"); - camera_->setPosition( Ogre::Vector3( 0, 0, 200 ) ); - camera_->lookAt( Ogre::Vector3( 0, 0, -300 ) ); + camera_->setPosition( Ogre::Vector3( 0, 0, 500 ) ); + camera_->lookAt( Ogre::Vector3( 0, 0, 0 ) ); camera_->setNearClipDistance( 1 ); // camera_->setAspectRatio( Real(vp->getActualWidth()) / Real(vp->getActualHeight())); Ogre::Camera * camera1 = sceneMgr_->createCamera("Camera1"); - camera1->setPosition( Ogre::Vector3( 0, 0, 200 ) ); - camera1->lookAt( Ogre::Vector3( 0, 0, -300 ) ); + camera1->setPosition( Ogre::Vector3( 0, 0, 500 ) ); + camera1->lookAt( Ogre::Vector3( 0, 0, 0 ) ); camera1->setNearClipDistance( 1 ); - Ogre::Camera * camera2 = sceneMgr_->createCamera("Camera2"); - camera2->setPosition( Ogre::Vector3( 0, 0, 200 ) ); - camera2->lookAt( Ogre::Vector3( 0, 0, -300 ) ); - camera2->setNearClipDistance( 1 ); +// Ogre::Camera * camera2 = sceneMgr_->createCamera("Camera2"); +// camera2->setPosition( Ogre::Vector3( 0, 0, 200 ) ); +// camera2->lookAt( Ogre::Vector3( 0, 0, -300 ) ); +// camera2->setNearClipDistance( 1 ); } void SectorClient::createViewports( ) { Ogre::Viewport* vp = window_->addViewport( camera_, 0, 0.0, 0.0, 1.0f, 1.0f ); vp->setBackgroundColour( Ogre::ColourValue( 0, 0, 0) ); - Ogre::Viewport* vp1 = window_->addViewport( sceneMgr_->getCamera( "Camera1" ), 1, 0.84, 0.84, 0.15, 0.15 ); + Ogre::Viewport* vp1 = window_->addViewport( sceneMgr_->getCamera( "Camera1" ), 1, 0.01, 0.84, 0.15, 0.15 ); vp1->setBackgroundColour( Ogre::ColourValue( 0.1, 0.1, 0.1 ) ); vp1->setSkiesEnabled( true ); vp1->setShadowsEnabled( false ); vp1->setOverlaysEnabled( false ); - Ogre::Viewport* vp2 = window_->addViewport( sceneMgr_->getCamera( "Camera2" ), 2, 0.84, 0.01, 0.15, 0.15 ); - vp2->setBackgroundColour( Ogre::ColourValue( 0.1, 0.1, 0.1 ) ); - vp2->setSkiesEnabled( false ); - vp2->setOverlaysEnabled( false ); - vp2->setShadowsEnabled( false ); - window_->removeViewport( 2 ); +// Ogre::Viewport* vp2 = window_->addViewport( sceneMgr_->getCamera( "Camera2" ), 2, 0.84, 0.01, 0.15, 0.15 ); +// vp2->setBackgroundColour( Ogre::ColourValue( 0.1, 0.1, 0.1 ) ); +// vp2->setSkiesEnabled( false ); +// vp2->setOverlaysEnabled( false ); +// vp2->setShadowsEnabled( false ); +// window_->removeViewport( 2 ); } void SectorClient::createFrameListener( ) { Modified: branches/ogsector/src/SectorClient.h =================================================================== --- branches/ogsector/src/SectorClient.h 2007-04-05 12:33:54 UTC (rev 358) +++ branches/ogsector/src/SectorClient.h 2007-04-05 13:01:37 UTC (rev 359) @@ -26,8 +26,8 @@ if ( root_ != NULL ) delete root_; } - virtual void go( void ){ - if ( !setup() ) return; + virtual void go( bool dialog ){ + if ( !setup( dialog ) ) return; root_->startRendering(); @@ -36,12 +36,12 @@ protected: - virtual bool setup( ); + virtual bool setup( bool dialog ); //! Method which will define the source of resources (other than current folder) virtual void setupResources( ); - virtual bool configure( ); + virtual bool configure( bool dialog ); // virtual void chooseSceneManager( ){ } @@ -55,10 +55,6 @@ virtual void destroyScene( ); - virtual void loadResources( ) { - Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups(); - } - Ogre::Root * root_; Ogre::Camera * camera_; Modified: branches/ogsector/src/SectorClientFrameListener.cpp =================================================================== --- branches/ogsector/src/SectorClientFrameListener.cpp 2007-04-05 12:33:54 UTC (rev 358) +++ branches/ogsector/src/SectorClientFrameListener.cpp 2007-04-05 13:01:37 UTC (rev 359) @@ -14,30 +14,33 @@ bool useBufferedInputMouse ) : camera_( cam ), window_( win ), sector_( sector ), network_( nw ){ + shutDownRequest_ = false; + deathSequence_ = false; + sceneDetailIndex_ = 0; + target_ = NULL; + cameraMode_ = 1; + sector_->setListener( this ); - inputManager_ = InputManager::getSingletonPtr(); - inputManager_->initialise( window_ ); + windowsWidth_ = window_->getWidth( ); + windowsHeight_ = window_->getHeight( ); + windowsHalfWidth_ = (int)(windowsWidth_ * 0.5); + windowsHalfHeight_ = (int)(windowsHeight_ * 0.5); + + unsigned long hWnd; + window_->getCustomAttribute( "WINDOW", &hWnd ); + + inputManager_ = new InputManager( hWnd ); + inputManager_->setWindowExtents( windowsWidth_, windowsHeight_ ); + inputManager_->addKeyListener( this, "SectorClientKeyListener" ); inputManager_->addMouseListener( this, "SectorClientMouseListener" ); inputManager_->addJoystickListener( this, "SectorClientJoystickListener" ); - cameraMode_ = 1; - cameraRotateSpeed_ = 36; - cameraRotateScale_ = 0.0f; - cameraMoveSpeed_ = 100; - cameraMoveScale_ = 0.0f; - cameraTranslate_ = Ogre::Vector3::ZERO; - timeSinceLastSectorUpdate_ = 0.0; timeSinceLastNetworkUpdate_ = 0.0; - deathSequence_ = false; inputInitialState_ = true; lastInputWheelState_ = 0; - windowsWidth_ = window_->getWidth( ); - windowsHeight_ = window_->getHeight( ); - windowsHalfWidth_ = (int)(windowsWidth_ * 0.5); - windowsHalfHeight_ = (int)(windowsHeight_ * 0.5); hudOverlay_ = Ogre::OverlayManager::getSingleton().getByName("OpenGate/SimpleHUD"); @@ -58,32 +61,35 @@ mouseOverlay_->show(); chatMode_ = false; - setTarget( sector_->nextTarget() ); - // targetPointer_ = camera_->getSceneManager()->getRootSceneNode()->createChildSceneNode( "TargetPointer" ); +// cameraRotateSpeed_ = 36; +// cameraRotateScale_ = 0.0f; +// cameraMoveSpeed_ = 100; +// cameraMoveScale_ = 0.0f; +// cameraTranslate_ = Ogre::Vector3::ZERO; + +// targetPointer_ = camera_->getSceneManager()->getRootSceneNode()->createChildSceneNode( "TargetPointer" ); // BillboardSet* mySet = camera_->getSceneManager()->createBillboardSet("mySet"); // targetPointerBB_ = mySet->createBillboard( Vector3(0, 0, 0) ); // mySet->setMaterialName( "TargetPointer" ); // targetPointerBB_->setDimensions( 32.0, 32.0 ); // targetPointer_->attachObject( mySet ); - //targetPointer_->scale( 0.05, 0.05, 0.05 ); +// targetPointer_->scale( 0.05, 0.05, 0.05 ); // BillboardSet *targetPointerBillboard = camera_->getSceneManager()->createBillboardSet( "hudTargetPointer" ); // targetPointerBillboard->setMaterialName( "TargetPointer" ); // Billboard * hudTargetPointer = targetPointerBillboard->createBillboard( Ogre::Vector3( 0.0, 0.0, -100 ) ); -// // hudTargetPointer-> +// hudTargetPointer-> - - spaceDustParticleSystem_ = camera_->getSceneManager()->createParticleSystem( "SpaceDust", "Space/Dust" ); - Ogre::SceneNode * spaceDustNode = sector_->avatar()->mainNode()->createChildSceneNode( "DustParticles", camera_->getRealPosition() ); +// spaceDustParticleSystem_ = camera_->getSceneManager()->createParticleSystem( "SpaceDust", "Space/Dust" ); +// Ogre::SceneNode * spaceDustNode = sector_->avatar()->mainNode()->createChildSceneNode( "DustParticles", camera_->getRealPosition() ); - // spaceDustNode_->attachObject( spaceDustParticleSystem_ ); - //camera_->getParentSceneNode() +// spaceDustNode_->attachObject( spaceDustParticleSystem_ ); +// camera_->getParentSceneNode() - - // listener for the space dust +// listener for the space dust // SpaceDust* psd = new SpaceDust(mCamera, ps); // mRoot->addFrameListener(psd); @@ -93,7 +99,6 @@ // statsOn_ = true; // numScreenShots_ = 0; - sceneDetailIndex_ = 0; // aniso_ = 1; // filtering_ = TFO_BILINEAR; } @@ -102,21 +107,18 @@ inputManager_->removeKeyListener( "SectorClientKeyListener" ); inputManager_->removeMouseListener( "SectorClientMouseListener" ); inputManager_->removeJoystickListener( "SectorClientJoystickListener" ); - - //** neccesary because of new operator in inputmanager + + //** neccesary because of new operator in inputmanager; if ( inputManager_ != NULL ) delete inputManager_; } bool SectorClientFrameListener::frameStarted( const Ogre::FrameEvent & evt ) { if ( window_->isClosed() ) return false; - - timeSinceLastSectorUpdate_ += evt.timeSinceLastFrame; timeSinceLastNetworkUpdate_ += evt.timeSinceLastFrame; if ( deathSequence_ ){ - } else { //** capture my input inputManager_->capture(); @@ -164,7 +166,7 @@ timeSinceLastSectorUpdate_ = 0.0; updateHUD_(); } - + //** send movement data, max 10 net-updates/second if ( timeSinceLastNetworkUpdate_ > 0.1 ){ sector_->sendAllVesselMovements( ); @@ -174,7 +176,7 @@ //** update my camera; updateCamera_(); - renderSpaceDust(); +// renderSpaceDust(); return true; } @@ -185,67 +187,67 @@ bool SectorClientFrameListener::keyPressed( const OIS::KeyEvent & e ){ + //** ESCAPE leads to shutdown; + if ( e.key == OIS::KC_ESCAPE) { shutDownRequest_ = true; } + if ( !chatMode_ ){ if ( e.key == OIS::KC_RETURN) { chatMode_ = true; } - - //** ESCAPE leads to shutdown; - if ( e.key == OIS::KC_ESCAPE) { shutDownRequest_ = true; } - //** Avatar yaw LEFT; - if ( e.key == OIS::KC_A || e.key == OIS::KC_NUMPAD4 ) { sector_->avatar()->setScaledYaw( 1.0 ); } - - //** Avatar yaw RIGHT; - if ( e.key == OIS::KC_D || e.key == OIS::KC_NUMPAD6 ) { sector_->avatar()->setScaledYaw( -1.0 ); } + if ( sector_->avatar() != NULL ){ + //** Avatar yaw LEFT; + if ( e.key == OIS::KC_A || e.key == OIS::KC_NUMPAD4 ) { sector_->avatar()->setScaledYaw( 1.0 ); } + + //** Avatar yaw RIGHT; + if ( e.key == OIS::KC_D || e.key == OIS::KC_NUMPAD6 ) { sector_->avatar()->setScaledYaw( -1.0 ); } + + //** Avatar pitch DOWN; + if ( e.key == OIS::KC_W || e.key == OIS::KC_NUMPAD8 ) { sector_->avatar()->setScaledPitch( -1.0 ); } + + //** Avatar pitch UP; + if ( e.key == OIS::KC_S || e.key == OIS::KC_NUMPAD2 ) { sector_->avatar()->setScaledPitch( 1.0 ); } + + //** Avatar roll (181 == NUM/); + if ( e.key == OIS::KC_NUMPAD0 || e.key == 181 ) { sector_->avatar()->setScaledRoll( 1.0 ); } + + //** Avatar roll (55 == NUM*); + if ( e.key == OIS::KC_NUMPADCOMMA || e.key == 55 ) { sector_->avatar()->setScaledRoll( -1.0 ); } + + //** Avatar increase thrust by 10%; + if ( e.key == OIS::KC_NUMPAD7 ) { sector_->avatar()->incrementThrust(); } + + //** Avatar increase thrust by 10%; + if ( e.key == OIS::KC_NUMPAD1 ) { sector_->avatar()->decrementThrust(); } + + //** Avatar press break; + if ( e.key == OIS::KC_NUMPAD3 ) { sector_->avatar()->setBreakPressed( true ); } + + //** Avatar press afterburner; + if ( e.key == OIS::KC_NUMPAD9 ) { sector_->avatar()->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 ); + } + //** selfdestruct and eject; + if ( e.key == OIS::KC_F11 ) { sector_->avatarDied(); } + } // if avatar; - //** Avatar pitch DOWN; - if ( e.key == OIS::KC_W || e.key == OIS::KC_NUMPAD8 ) { sector_->avatar()->setScaledPitch( -1.0 ); } - - //** Avatar pitch UP; - if ( e.key == OIS::KC_S || e.key == OIS::KC_NUMPAD2 ) { sector_->avatar()->setScaledPitch( 1.0 ); } - - //** Avatar roll (181 == NUM/); - if ( e.key == OIS::KC_NUMPAD0 || e.key == 181 ) { sector_->avatar()->setScaledRoll( 1.0 ); } - - //** Avatar roll (55 == NUM*); - if ( e.key == OIS::KC_NUMPADCOMMA || e.key == 55 ) { sector_->avatar()->setScaledRoll( -1.0 ); } - - //** Avatar increase thrust by 10%; - if ( e.key == OIS::KC_NUMPAD7 ) { sector_->avatar()->incrementThrust(); } - - //** Avatar increase thrust by 10%; - if ( e.key == OIS::KC_NUMPAD1 ) { sector_->avatar()->decrementThrust(); } - - //** Avatar press break; - if ( e.key == OIS::KC_NUMPAD3 ) { sector_->avatar()->setBreakPressed( true ); } - - //** Avatar press afterburner; - if ( e.key == OIS::KC_NUMPAD9 ) { sector_->avatar()->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 ); - } - //** next Target; if ( e.key == OIS::KC_N ) { setTarget( sector_->nextTarget() ); } - + //** prev Target; if ( e.key == OIS::KC_P ) { setTarget( sector_->prevTarget() ); } - - //** selfdestruct and eject; - if ( e.key == OIS::KC_F11 ) { sector_->avatarDied(); } - + //** spawn; if ( e.key == OIS::KC_F12 ) { sector_->spawnAiObject(); } - //** Toggle through camera modes; if ( e.key == OIS::KC_6 ) { toggleNextCamera_(); } - + //** Create one screenshot; if ( e.key == OIS::KC_SYSRQ ) { char tmp[ 20 ]; @@ -304,159 +306,169 @@ // MaterialManager::getSingleton().setDefaultTextureFiltering( filtering_ ); // MaterialManager::getSingleton().setDefaultAnisotropy( aniso_ );... [truncated message content] |
From: <spo...@us...> - 2007-04-06 18:18:49
|
Revision: 370 http://svn.sourceforge.net/opengate/?rev=370&view=rev Author: spom_spom Date: 2007-04-06 11:13:57 -0700 (Fri, 06 Apr 2007) Log Message: ----------- Ported to offline mode win32. libgrapple will not compile Modified Paths: -------------- branches/ogsector/ogre.cfg branches/ogsector/src/InputManager.cpp branches/ogsector/src/Sector.cpp branches/ogsector/src/SectorClient.cpp branches/ogsector/src/SectorClientFrameListener.cpp branches/ogsector/src/SectorClientFrameListener.h branches/ogsector/src/SectorObjects.cpp branches/ogsector/src/SectorObjects.h 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/ogsectorclient.cpp branches/ogsector/src/ogsectorserver.cpp Added Paths: ----------- branches/ogsector/win32/ branches/ogsector/win32/ogsectorclient/ branches/ogsector/win32/ogsectorclient/Plugins.cfg branches/ogsector/win32/ogsectorclient/ogre.cfg branches/ogsector/win32/ogsectorclient/ogsectorclient.cbp branches/ogsector/win32/ogsectorclient/resources.cfg Modified: branches/ogsector/ogre.cfg =================================================================== --- branches/ogsector/ogre.cfg 2007-04-06 18:07:28 UTC (rev 369) +++ branches/ogsector/ogre.cfg 2007-04-06 18:13:57 UTC (rev 370) @@ -4,4 +4,5 @@ FSAA=0 Full Screen=No RTT Preferred Mode=FBO +Refresh Rate=Not applicable Video Mode=1024 x 768 Modified: branches/ogsector/src/InputManager.cpp =================================================================== --- branches/ogsector/src/InputManager.cpp 2007-04-06 18:07:28 UTC (rev 369) +++ branches/ogsector/src/InputManager.cpp 2007-04-06 18:13:57 UTC (rev 370) @@ -9,21 +9,22 @@ OIS::ParamList pl; pl.insert( OIS::ParamList::value_type( "WINDOW", Ogre::StringConverter::toString( hWnd ) ) ); - + m_hWnd = hWnd; mInputSystem = OIS::InputManager::createInputSystem( pl ); - if ( mInputSystem ){ + if ( mInputSystem ){ mMouse = static_cast<OIS::Mouse*>(mInputSystem->createInputObject( OIS::OISMouse, true )); mMouse->setEventCallback( this ); mKeyboard = static_cast<OIS::Keyboard*>(mInputSystem->createInputObject( OIS::OISKeyboard, true)); mKeyboard->setEventCallback( this ); +#ifndef WIN32 if ( mInputSystem->numJoysticks() > 0 ) { // mJoysticks.resize( mInputSystem->numJoysticks() ); - + // itJoystick = mJoysticks.begin(); // itJoystickEnd = mJoysticks.end(); // for(; itJoystick != itJoystickEnd; ++itJoystick ) { @@ -32,7 +33,8 @@ // } mJoyStick = static_cast<OIS::JoyStick*>(mInputSystem->createInputObject( OIS::OISJoyStick, true)); mJoyStick->setEventCallback( this ); - } + } +#endif } } @@ -47,7 +49,7 @@ mInputSystem->destroyInputObject( mKeyboard ); mKeyboard = NULL; } - + if( mJoyStick ) { mInputSystem->destroyInputObject( mJoyStick ); mJoyStick = NULL; @@ -55,9 +57,9 @@ } OIS::InputManager::destroyInputSystem( mInputSystem ); - + mInputSystem = NULL; - + // Clear Listeners mKeyListeners.clear(); mMouseListeners.clear(); @@ -261,7 +263,7 @@ bool InputManager::axisMoved( const OIS::JoyStickEvent &e, int axis ) { itJoystickListener = mJoystickListeners.begin(); itJoystickListenerEnd = mJoystickListeners.end(); - + for(; itJoystickListener != itJoystickListenerEnd; ++itJoystickListener ) { itJoystickListener->second->axisMoved( e, axis ); } Modified: branches/ogsector/src/Sector.cpp =================================================================== --- branches/ogsector/src/Sector.cpp 2007-04-06 18:07:28 UTC (rev 369) +++ branches/ogsector/src/Sector.cpp 2007-04-06 18:13:57 UTC (rev 370) @@ -20,46 +20,44 @@ // // NB I could attach the light to a SceneNode if I wanted it to move automatically with // // other objects, but I don't // l->setPosition( 0, 0, 200 ); - 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_QUICK ); OgreOpcode::CollisionManager::getSingletonPtr()->addCollType( "SectorObject", "SectorObject", OgreOpcode::COLLTYPE_CONTACT ); - + collideInSectorContext_ = OgreOpcode::CollisionManager::getSingletonPtr()->getDefaultContext(); - createStaticObject( Ogre::String("ships/Quantar/Storm/quantar_storm.mesh"), + createStaticObject( Ogre::String("ships/quantar/storm/storm.mesh"), "StormShape", Ogre::Vector3( 10, 17, -129.0 ), - Ogre::Real( 9.6 ), + Ogre::Real( 9.6 ), Ogre::Degree( -90 ) ); - createStaticObject( Ogre::String("ogrehead.mesh"), + createStaticObject( Ogre::String("ogrehead.mesh"), "ogreheadStation", Ogre::Vector3( 5000, 0, 0 ), - Ogre::Real( 500.0 ), + Ogre::Real( 500.0 ), Ogre::Degree( 0.0 ) ); // createCircle(); - - createStaticObject( Ogre::String("ogrehead.mesh"), + createStaticObject( Ogre::String("ogrehead.mesh"), "-100 0 0", Ogre::Vector3( -100, 0, 0 ), - Ogre::Real( 10.0 ), + Ogre::Real( 10.0 ), Ogre::Degree( 0.0 ) ); - createStaticObject( Ogre::String("ogrehead.mesh"), + createStaticObject( Ogre::String("ogrehead.mesh"), "100 0 0", Ogre::Vector3( 100, 0, 0 ), - Ogre::Real( 10.0 ), + Ogre::Real( 10.0 ), Ogre::Degree( 0.0 ) ); itTarget_ = sectorObjects_.begin(); @@ -84,7 +82,7 @@ if ( nCollids > 0 ){ std::cout << "Collisions: " << nCollids << std::endl; - OgreOpcode::CollisionPair **collisionReport; + OgreOpcode::CollisionPair **collisionReport; report.getAllCollisions( collisionReport ); for ( int i = 0; i < nCollids; i ++ ){ @@ -94,11 +92,11 @@ 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; - + } bool tmpsegfaultDebug = false; @@ -116,13 +114,13 @@ std::cout << "tmpsegfaultDebug done." << std::endl; tmpsegfaultDebug = false; } - + if ( avatarDeathSequenceTime_ > 0 ){ avatarDeathSequenceTime_ -= elapsedTime; } else if ( avatarDeathSequenceTime_ > -1 ) { spawnAvatar(); } - + } SectorObjectMoveable * Sector::createMoveableObject( const Ogre::String & name, int userID, int childID ){ @@ -138,21 +136,21 @@ if ( listener_->target() == obj ) listener_->setTarget( nextTarget() ); switch ( obj->getTypeID() ){ - case SECTOROBJECTMOVABLE_RTTI: + case SECTOROBJECTMOVABLE_RTTI: movableObjects_.erase( obj->globalID() ); - delete obj; + delete obj; break; case SECTOROBJECTMOVABLE_AI_RTTI: { localAiObjects_.erase( dynamic_cast< SectorObjectMoveableAi *>(obj)->childID() ); movableObjects_.erase( obj->globalID() ); - delete obj; + delete obj; } break; default: std::cerr << "object type unknown. this should not happen." << obj->getTypeID() << std::endl; } } -void Sector::createStaticObject( const Ogre::String & meshname, const Ogre::String & objectname, +void Sector::createStaticObject( const Ogre::String & meshname, const Ogre::String & objectname, const Ogre::Vector3 & pos, Ogre::Real targetSize, Ogre::Degree yaw ){ SectorObject * obj = new SectorObject( objectname, this ); @@ -178,20 +176,20 @@ } void Sector::spawnAiObject( ){ - + int childID = 1; while ( localAiObjects_.find( childID ) != localAiObjects_.end() ){ childID ++; } SectorObjectMoveableAi *obj = createAiMoveableObject( avatar_->name() + "_Spawn" + Ogre::StringConverter::toString( childID ), childID ); obj->setTarget( avatar_ ); - + Ogre::Real xmin = -1000.0, xmax = -500.0; Ogre::Real ymin = -1000.0, ymax = -500.0; Ogre::Real zmin = -1000.0, zmax = -500.0; - obj->mainNode()->setPosition( Ogre::Math::RangeRandom( xmin, xmax ), - Ogre::Math::RangeRandom( ymin, ymax ), + obj->mainNode()->setPosition( Ogre::Math::RangeRandom( xmin, xmax ), + Ogre::Math::RangeRandom( ymin, ymax ), Ogre::Math::RangeRandom( zmin, zmax ) ); //obj->mainNode()->setPosition( 0.0f, 0.0f, -200.0f); @@ -226,15 +224,15 @@ void Sector::spawnAvatar( ){ if ( avatar_ != NULL ){ avatarDeathSequenceTime_ = -1.0; - + 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_->reset(); - + MessageShipRegister msg( 0, 0, avatar_->name(), avatar_->mainNode()->getPosition(), true ); network_->send( msg ); - + avatar_->setVisible( false ); listener_->avatarDeathSequence( false ); } @@ -246,33 +244,33 @@ if ( avatar_ != NULL ){ if ( (*itTarget_) == avatar_ ) return nextTarget(); } - + if ( itTarget_ == sectorObjects_.end() ) itTarget_ = sectorObjects_.begin(); return (*itTarget_); } return NULL; } - + SectorObject * Sector::prevTarget( ){ if ( sectorObjects_.size() != 0 ){ if ( itTarget_ == sectorObjects_.begin() ) itTarget_ = sectorObjects_.end(); itTarget_ --; - + if ( avatar_ != NULL ){ if ( (*itTarget_) == avatar_ ) return prevTarget(); } return (*itTarget_); - } + } return NULL; } void Sector::createCircle(){ - + Ogre::String name = "testcircle"; Ogre::SceneNode * object = sceneMgr_->getRootSceneNode()->createChildSceneNode( name ); Ogre::ManualObject * circle = sceneMgr_->createManualObject( name + "shape" ); - + float const radius = 50; float const thickness = 3; // Of course this must be less than the radius value. float const accuracy = 5; @@ -280,7 +278,7 @@ circle->begin("BaseWhiteNoLighting", Ogre::RenderOperation::OT_TRIANGLE_LIST); unsigned point_index = 0; - for( float theta = 0; + for( float theta = 0; theta <= 2.0 * 3.141592; // Ogre::Math::PI collide ;) with some stuff from opcode theta += 3.141592 / (radius * accuracy) ) { circle->position(radius * cos(theta), radius * sin(theta), -50 ); @@ -316,8 +314,8 @@ } } else { if ( msg.status() == true ){ - std::cout << "Create object " << msg.name() - << " " << msg.senderID() << " " << (int)msg.childID() + std::cout << "Create object " << msg.name() + << " " << msg.senderID() << " " << (int)msg.childID() << " " << msg.position() << std::endl; SectorObjectMoveable * obj = createMoveableObject( msg.name(), msg.senderID(), msg.childID() ); @@ -326,18 +324,18 @@ } } } -} +} -void Sector::sendAllVesselMovements( ){ +void Sector::sendAllVesselMovements( ){ if ( avatar_ != NULL ){ - MessageShipMovement msg( 0, + MessageShipMovement msg( 0, avatar_->mainNode()->getPosition(), avatar_->velDirection(), - avatar_->mainNode()->getOrientation(), - avatar_->thrustPercent(), - avatar_->scaledYaw(), - avatar_->scaledPitch(), - avatar_->scaledRoll(), + avatar_->mainNode()->getOrientation(), + avatar_->thrustPercent(), + avatar_->scaledYaw(), + avatar_->scaledPitch(), + avatar_->scaledRoll(), avatar_->incNetSequence() ); network_->send( msg, false ); @@ -348,41 +346,41 @@ it->second->mainNode()->getPosition(), it->second->velDirection(), it->second->mainNode()->getOrientation(), - it->second->thrustPercent(), - it->second->scaledYaw(), - it->second->scaledPitch(), - it->second->scaledRoll(), + it->second->thrustPercent(), + it->second->scaledYaw(), + it->second->scaledPitch(), + it->second->scaledRoll(), it->second->incNetSequence() ); - + network_->send( msgObj, false ); } } -void Sector::receiveVesselMovement( const std::vector < MessageShipMovement * > & movements ){ - +void Sector::receiveVesselMovement( const std::vector < MessageShipMovement * > & movements ){ + std::map < long, const MessageShipMovement * > singleMsg; //** we sort the movement messaged - for ( int i = 0; i < movements.size(); i ++ ){ + for ( size_t i = 0; i < movements.size(); i ++ ){ if ( movements[ i ]->senderID() != network_->userID() ){ //** apply only foreign movements, and take just the actual movement singleMsg[ createGlobalID( movements[ i ]->senderID(), movements[ i ]->childID() ) ] = movements[ i ]; } } - + std::map< long, SectorObjectMoveable * >::iterator it; - + for ( std::map < long, const MessageShipMovement * >::iterator i = singleMsg.begin(); i != singleMsg.end(); i++ ){ if ( ( it = movableObjects_.find( i->first ) ) != movableObjects_.end() ){ it->second->setFlightProperties( (*i->second) ); } else { - std::cerr << "Requested non existant object for shipmovement: " + std::cerr << "Requested non existant object for shipmovement: " << network_->username( i->second->senderID() ) << " this should not happen." << std::endl; - } + } } } -void Sector::sendAllVesselStatus( ){ +void Sector::sendAllVesselStatus( ){ if ( avatar_ != NULL ){ sendVesselStatus( *avatar_ ); } @@ -406,7 +404,6 @@ std::map< long, SectorObjectMoveable * >::iterator it; - SectorObjectMoveable *obj; if ( ( it = movableObjects_.find( createGlobalID( msg.senderID(), msg.childID() ) ) ) != movableObjects_.end() ){ std::cout << "ReceiveVesselStatus for " << it->second->name( ) << std::endl; it->second->setStatus( msg ); @@ -420,9 +417,9 @@ void Sector::sendVesselAmmoHit( const Projectile & projectile, BaseObject * victim ){ if ( projectile.parent().userID() == network_->userID() ){ - std::cout << "Send: Projectile from " << projectile.name() << " collide with: " << victim->name() + std::cout << "Send: Projectile from " << projectile.name() << " collide with: " << victim->name() << " " << victim->userID() << " " << victim->childID() << std::endl; - + if ( network_->online() ){ MessageShipAmmoHit msg( projectile.parent().childID(), victim->userID(), victim->childID(), projectile.damage() ); network_->send( msg ); @@ -435,14 +432,14 @@ if ( msg.senderID() != network_->userID() ){ std::map< long, SectorObjectMoveable * >::iterator it; - + if ( ( it = movableObjects_.find( createGlobalID( msg.targetID(), msg.targetChildID() ) ) ) != movableObjects_.end() ){ std::cout << "ReceiveVesselAmmoHit for " << network_->username( msg.targetID() ) << std::endl; it->second->hitByAmmo( msg.damage() ); } else { std::cerr << "Requested non existant object for VesselAmmoHit " << "shooter: " << network_->username( msg.senderID() ) - << " victim: " << network_->username( msg.targetID() ) + << " victim: " << network_->username( msg.targetID() ) << " child: " << msg.targetChildID() << " damage: " << msg.damage() << " this should not happen." << std::endl; @@ -450,7 +447,7 @@ for ( std::map< long, SectorObjectMoveable * >::iterator i = movableObjects_.begin(); i != movableObjects_.end(); i++){ std::cerr << "\t" << i->first << " " << i->second->name() << " " << std::endl; } - + } } } Modified: branches/ogsector/src/SectorClient.cpp =================================================================== --- branches/ogsector/src/SectorClient.cpp 2007-04-06 18:07:28 UTC (rev 369) +++ branches/ogsector/src/SectorClient.cpp 2007-04-06 18:13:57 UTC (rev 370) @@ -15,9 +15,9 @@ root_ = new Ogre::Root; setupResources(); - + if ( !configure( dialog ) ) return false; - + //** load ressources Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups(); @@ -25,19 +25,19 @@ sceneMgr_ = root_->createSceneManager( Ogre::ST_GENERIC, "BaseSMInstance" ); createCameras(); - + createViewports(); - + //** spom dont what for // Set default mipmap level (NB some APIs ignore this) // Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5); // Create any resource listeners (for loading screens) // createResourceListener(); //** spom dont what for - + // Create the scene createScene(); - + createFrameListener(); sector_->spawnAvatar(); @@ -48,10 +48,10 @@ void SectorClient::setupResources( ) { // Load resource paths from config file Ogre::ConfigFile cf; cf.load( "resources.cfg" ); - + // Go through all sections & settings in the file Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator(); - + Ogre::String secName, typeName, archName; while ( seci.hasMoreElements() ) { @@ -65,7 +65,7 @@ } } } - + bool SectorClient::configure( bool dialog ){ if ( !dialog ){ root_->restoreConfig(); @@ -93,7 +93,7 @@ camera_->lookAt( Ogre::Vector3( 0, 0, 0 ) ); camera_->setNearClipDistance( 1 ); // camera_->setAspectRatio( Real(vp->getActualWidth()) / Real(vp->getActualHeight())); - + Ogre::Camera * camera1 = sceneMgr_->createCamera("Camera1"); camera1->setPosition( Ogre::Vector3( 0, 0, 500 ) ); camera1->lookAt( Ogre::Vector3( 0, 0, 0 ) ); @@ -123,7 +123,7 @@ // window_->removeViewport( 2 ); } -void SectorClient::createFrameListener( ) { +void SectorClient::createFrameListener( ) { frameListener_ = new SectorClientFrameListener( window_, camera_, sector_, network_ ); root_->addFrameListener( frameListener_ ); } Modified: branches/ogsector/src/SectorClientFrameListener.cpp =================================================================== --- branches/ogsector/src/SectorClientFrameListener.cpp 2007-04-06 18:07:28 UTC (rev 369) +++ branches/ogsector/src/SectorClientFrameListener.cpp 2007-04-06 18:13:57 UTC (rev 370) @@ -8,11 +8,11 @@ namespace OpenGate{ -SectorClientFrameListener::SectorClientFrameListener( Ogre::RenderWindow * win, Ogre::Camera * cam, +SectorClientFrameListener::SectorClientFrameListener( Ogre::RenderWindow * win, Ogre::Camera * cam, Sector * sector, Network * nw, - bool useBufferedInputKeys, - bool useBufferedInputMouse ) - : camera_( cam ), window_( win ), sector_( sector ), network_( nw ){ + bool useBufferedInputKeys, + bool useBufferedInputMouse ) + : window_( win ), camera_( cam ), sector_( sector ), network_( nw ){ shutDownRequest_ = false; deathSequence_ = false; @@ -36,7 +36,7 @@ inputManager_->addKeyListener( this, "SectorClientKeyListener" ); inputManager_->addMouseListener( this, "SectorClientMouseListener" ); inputManager_->addJoystickListener( this, "SectorClientJoystickListener" ); - + timeSinceLastSectorUpdate_ = 0.0; timeSinceLastNetworkUpdate_ = 0.0; inputInitialState_ = true; @@ -73,7 +73,7 @@ // targetPointerBB_ = mySet->createBillboard( Vector3(0, 0, 0) ); // mySet->setMaterialName( "TargetPointer" ); // targetPointerBB_->setDimensions( 32.0, 32.0 ); - + // targetPointer_->attachObject( mySet ); // targetPointer_->scale( 0.05, 0.05, 0.05 ); @@ -83,18 +83,18 @@ // Billboard * hudTargetPointer = targetPointerBillboard->createBillboard( Ogre::Vector3( 0.0, 0.0, -100 ) ); // hudTargetPointer-> -// spaceDustParticleSystem_ = camera_->getSceneManager()->createParticleSystem( "SpaceDust", "Space/Dust" ); -// Ogre::SceneNode * spaceDustNode = sector_->avatar()->mainNode()->createChildSceneNode( "DustParticles", camera_->getRealPosition() ); - -// spaceDustNode_->attachObject( spaceDustParticleSystem_ ); +// spaceDustParticleSystem_ = camera_->getSceneManager()->createParticleSystem( "SpaceDust", "Space/Dust" ); +// Ogre::SceneNode * spaceDustNode = sector_->avatar()->mainNode()->createChildSceneNode( "DustParticles", camera_->getRealPosition() ); + +// spaceDustNode_->attachObject( spaceDustParticleSystem_ ); // camera_->getParentSceneNode() -// listener for the space dust -// SpaceDust* psd = new SpaceDust(mCamera, ps); +// listener for the space dust +// SpaceDust* psd = new SpaceDust(mCamera, ps); // mRoot->addFrameListener(psd); -// spaceDustParticle_ = camera_->getSceneManager()->createParticleSystem("Stardust"); -// particleNode_ = camera_->getSceneManager()->getRootSceneNode()->createChildSceneNode("SpaceDustParticle"); +// spaceDustParticle_ = camera_->getSceneManager()->createParticleSystem("Stardust"); +// particleNode_ = camera_->getSceneManager()->getRootSceneNode()->createChildSceneNode("SpaceDustParticle"); // particleNode_->attachObject( spaceDustParticle_ ); // statsOn_ = true; @@ -107,42 +107,42 @@ inputManager_->removeKeyListener( "SectorClientKeyListener" ); inputManager_->removeMouseListener( "SectorClientMouseListener" ); inputManager_->removeJoystickListener( "SectorClientJoystickListener" ); - + //** neccesary because of new operator in inputmanager; if ( inputManager_ != NULL ) delete inputManager_; } - + bool SectorClientFrameListener::frameStarted( const Ogre::FrameEvent & evt ) { if ( window_->isClosed() ) return false; timeSinceLastSectorUpdate_ += evt.timeSinceLastFrame; timeSinceLastNetworkUpdate_ += evt.timeSinceLastFrame; - + if ( deathSequence_ ){ } else { //** capture my input inputManager_->capture(); - } - + } + //** start capture network; std::vector < std::vector < Uint8 > > msgs; std::vector < MessageShipMovement * > movements; network_->pull( msgs ); - - for ( int i = 0; i < msgs.size(); i ++ ){ + + for ( size_t i = 0; i < msgs.size(); i ++ ){ switch ( msgs[ i ][ 0 ] ){ case PROTO_CHAT:{ network_->ping(); MessageChat msg( &msgs[ i ][ 0 ] ); std::cout << network_->username( msg.senderID() ) + ": " + msg.message() << std::endl; - + Ogre::OverlayElement* hudChatIn = Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextChatIn"); hudChatIn->setCaption( network_->username( msg.senderID() ) + ": " + msg.message() ); } break; - case PROTO_SHIPREGISTER: + case PROTO_SHIPREGISTER: sector_->receiveVesselRegister( &msgs[ i ][ 0 ] ); break; - case PROTO_SHIPSTATUS: + case PROTO_SHIPSTATUS: sector_->receiveVesselStatus( &msgs[ i ][ 0 ] ); break; case PROTO_SHIPMOVEMENT:{ //** we handle that in sum, so we can ignore dups because of packet loss @@ -160,24 +160,24 @@ //** end capture network; - // max 1000 sector-updates/second - if ( timeSinceLastSectorUpdate_ > 0.001 ){ + // max 1000 sector-updates/second + if ( timeSinceLastSectorUpdate_ > 0.001 ){ sector_->update( timeSinceLastSectorUpdate_ ); timeSinceLastSectorUpdate_ = 0.0; updateHUD_(); - } - + } + //** send movement data, max 10 net-updates/second if ( timeSinceLastNetworkUpdate_ > 0.1 ){ sector_->sendAllVesselMovements( ); timeSinceLastNetworkUpdate_ = 0.0; - } - + } + //** update my camera; updateCamera_(); // renderSpaceDust(); - + return true; } @@ -189,48 +189,48 @@ //** ESCAPE leads to shutdown; if ( e.key == OIS::KC_ESCAPE) { shutDownRequest_ = true; } - + if ( !chatMode_ ){ - if ( e.key == OIS::KC_RETURN) { - chatMode_ = true; + if ( e.key == OIS::KC_RETURN) { + chatMode_ = true; } - + if ( sector_->avatar() != NULL ){ //** Avatar yaw LEFT; if ( e.key == OIS::KC_A || e.key == OIS::KC_NUMPAD4 ) { sector_->avatar()->setScaledYaw( 1.0 ); } - + //** Avatar yaw RIGHT; if ( e.key == OIS::KC_D || e.key == OIS::KC_NUMPAD6 ) { sector_->avatar()->setScaledYaw( -1.0 ); } - + //** Avatar pitch DOWN; if ( e.key == OIS::KC_W || e.key == OIS::KC_NUMPAD8 ) { sector_->avatar()->setScaledPitch( -1.0 ); } - + //** Avatar pitch UP; if ( e.key == OIS::KC_S || e.key == OIS::KC_NUMPAD2 ) { sector_->avatar()->setScaledPitch( 1.0 ); } - + //** Avatar roll (181 == NUM/); if ( e.key == OIS::KC_NUMPAD0 || e.key == 181 ) { sector_->avatar()->setScaledRoll( 1.0 ); } - + //** Avatar roll (55 == NUM*); if ( e.key == OIS::KC_NUMPADCOMMA || e.key == 55 ) { sector_->avatar()->setScaledRoll( -1.0 ); } - + //** Avatar increase thrust by 10%; if ( e.key == OIS::KC_NUMPAD7 ) { sector_->avatar()->incrementThrust(); } - + //** Avatar increase thrust by 10%; if ( e.key == OIS::KC_NUMPAD1 ) { sector_->avatar()->decrementThrust(); } - + //** Avatar press break; if ( e.key == OIS::KC_NUMPAD3 ) { sector_->avatar()->setBreakPressed( true ); } - + //** Avatar press afterburner; if ( e.key == OIS::KC_NUMPAD9 ) { sector_->avatar()->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 ); + if ( e.key == OIS::KC_NUMPAD5 ) { + sector_->avatar()->setScaledYaw( 0.0 ); + sector_->avatar()->setScaledPitch( 0.0 ); + sector_->avatar()->setScaledRoll( 0.0 ); } //** selfdestruct and eject; if ( e.key == OIS::KC_F11 ) { sector_->avatarDied(); } @@ -238,24 +238,24 @@ //** next Target; if ( e.key == OIS::KC_N ) { setTarget( sector_->nextTarget() ); } - + //** prev Target; if ( e.key == OIS::KC_P ) { setTarget( sector_->prevTarget() ); } - + //** spawn; if ( e.key == OIS::KC_F12 ) { sector_->spawnAiObject(); } //** Toggle through camera modes; if ( e.key == OIS::KC_6 ) { toggleNextCamera_(); } - + //** Create one screenshot; - if ( e.key == OIS::KC_SYSRQ ) { + if ( e.key == OIS::KC_SYSRQ ) { char tmp[ 20 ]; sprintf(tmp, "screenshot.png" ); window_->writeContentsToFile(tmp); // window_->setDebugText(String("Wrote ") + tmp); } - if ( e.key == OIS::KC_R ) { + if ( e.key == OIS::KC_R ) { sceneDetailIndex_ = ( sceneDetailIndex_ + 1) % 3; switch( sceneDetailIndex_ ) { case 0: camera_->setPolygonMode( Ogre::PM_SOLID ); break; @@ -265,28 +265,28 @@ } } else { // ** chatmode - if ( e.key != OIS::KC_BACK ) { + if ( e.key != OIS::KC_BACK ) { chatString_ += e.text; } else if ( chatString_.length() > 1 ) { - chatString_ = chatString_.substr( 0, chatString_.length() - 1 ); + chatString_ = chatString_.substr( 0, chatString_.length() - 1 ); } Ogre::OverlayElement* hudChatIn = Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextChatOut"); hudChatIn->setCaption( chatString_ ); - - if ( e.key == OIS::KC_RETURN) { - + + if ( e.key == OIS::KC_RETURN) { + MessageChat chat( chatString_ ); network_->send( chat ); chatString_.clear(); Ogre::OverlayElement* hudChatIn = Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextChatOut"); hudChatIn->setCaption( chatString_ ); - chatMode_ = false; + chatMode_ = false; } } -// if ( e.key == OIS::KC_T ) { +// if ( e.key == OIS::KC_T ) { // switch( filtering_ ) { // case TFO_BILINEAR: // filtering_ = TFO_TRILINEAR; @@ -306,60 +306,61 @@ // MaterialManager::getSingleton().setDefaultTextureFiltering( filtering_ ); // MaterialManager::getSingleton().setDefaultAnisotropy( aniso_ ); // } - +return true; } bool SectorClientFrameListener::keyReleased( const OIS::KeyEvent & e ){ if ( sector_->avatar() != NULL ){ // Avatar release break if ( e.key == OIS::KC_NUMPAD3 ) { sector_->avatar()->setBreakPressed( false ); } - + // Avatar release afterburner if ( e.key == OIS::KC_NUMPAD9 ) { sector_->avatar()->setAfterburnerPressed( false ); } } + return true; } bool SectorClientFrameListener::mouseMoved( const OIS::MouseEvent & e ){ mousePointer_->setLeft( e.state.X.abs - 16); mousePointer_->setTop( e.state.Y.abs - 16); - + if ( sector_->avatar() != NULL ){ // std::cout << "X" << e.state.X.abs << " " << e.state.X.rel<< std::endl; // std::cout << "Y" << e.state.Y.abs << " " << e.state.Y.rel<< std::endl; // std::cout << "Z" << e.state.Z.abs << " " << e.state.Z.rel<< std::endl; - + int relativToMidPointX = (int)rint( e.state.X.abs - windowsHalfWidth_ ); int relativToMidPointY = (int)rint( e.state.Y.abs - windowsHalfHeight_ ); int minActiveZonePercent = 5; int maxActiveZonePercent = 90; - + double minRadius = ( windowsHeight_ / 2.0 ) * minActiveZonePercent / 100; double maxRadius = ( windowsHeight_ / 2.0 ) * maxActiveZonePercent / 100; - - Ogre::Real yaw = 0, pitch = 0; + + Ogre::Real yaw = 0, pitch = 0; if ( relativToMidPointX < 0 ) { yaw = (relativToMidPointX+minRadius) / (maxRadius - minRadius); } else { yaw = (relativToMidPointX-minRadius) / (maxRadius - minRadius); - } + } if ( relativToMidPointY < 0 ) { pitch = (relativToMidPointY + minRadius) / (maxRadius - minRadius); } else { pitch = (relativToMidPointY - minRadius) / (maxRadius - minRadius); } - + if ( fabs( relativToMidPointX ) < minRadius ) yaw = 0.0; if ( fabs( relativToMidPointY ) < minRadius ) pitch = 0.0; - + if ( inputInitialState_ == true ){ if ( yaw == 0.0 && pitch == 0.0 ){ inputInitialState_ = false; } } else{ - + yaw = min( yaw, 1.0f ); yaw = max( yaw, -1.0f ); pitch = min( pitch, 1.0f ); pitch = max( pitch, -1.0f ); - + // std::cout << ( String("Mouse rel: ") + StringConverter::toString( e.state.X.rel ) + // String(" ") + StringConverter::toString( e.state.Y.rel ) + // String(" abs: ") + StringConverter::toString( e.state.X.abs ) + @@ -368,7 +369,7 @@ // String(" ") + StringConverter::toString( relativToMidPointY ) + // String(" yaw: ") + StringConverter::toString( yaw ) + // String(" pitch ") + StringConverter::toString( pitch ) ) << std::endl; - + sector_->avatar()->setScaledYaw( -yaw ); sector_->avatar()->setScaledPitch( -pitch ); } @@ -377,11 +378,12 @@ if ( e.state.Z.abs-10 > lastInputWheelState_ ){ // mouse wheel up setTarget( sector_->nextTarget() ); lastInputWheelState_ = e.state.Z.abs; - + } else if( lastInputWheelState_ > e.state.Z.abs+10 ) { // mouse wheel down setTarget( sector_->prevTarget() ); lastInputWheelState_ = e.state.Z.abs; - } + } + return true; } bool SectorClientFrameListener::mousePressed( const OIS::MouseEvent &e , OIS::MouseButtonID button ){ @@ -390,7 +392,8 @@ if ( button == 0){ sector_->avatar()->setFirePressed( true ); } - } + } + return true; } bool SectorClientFrameListener::mouseReleased( const OIS::MouseEvent &e , OIS::MouseButtonID button ){ @@ -399,7 +402,8 @@ if ( button == 0){ sector_->avatar()->setFirePressed( false); } - } + } + return true; } bool SectorClientFrameListener::axisMoved( const OIS::JoyStickEvent & e, int axis ){ @@ -408,32 +412,32 @@ int joyStickAxisX = 0; int joyStickAxisY = 1; int joyStickAxisZ = 5; - int throwSliderAxis = 6; + int throwSliderAxis = 6; double axisScale = 32768; - + //** deadzone int minActiveZonePercent = 10; int maxActiveZonePercent = 95; - + double minRadius = ( axisScale ) * minActiveZonePercent / 100; double maxRadius = ( axisScale ) * maxActiveZonePercent / 100; - + Ogre::Real yaw = (e.state.mAxes[ joyStickAxisX ].abs) / (maxRadius); Ogre::Real pitch = (e.state.mAxes[ joyStickAxisY ].abs) / (maxRadius); Ogre::Real roll = (e.state.mAxes[ joyStickAxisZ ].abs) / (maxRadius); Ogre::Real thrust = ( -e.state.mAxes[ throwSliderAxis ].abs + axisScale ) / (maxRadius*2); - + yaw = min( yaw, 1.0f ); yaw = max( yaw, -1.0f ); pitch = min( pitch, 1.0f ); pitch = max( pitch, -1.0f ); roll = min( roll, 1.0f ); roll = max( roll, -1.0f ); thrust = min( thrust, 1.0f ); thrust = max( thrust, 0.0f ); - - + + if ( fabs( e.state.mAxes[ joyStickAxisX ].abs ) < minRadius ) yaw = 0.0; if ( fabs( e.state.mAxes[ joyStickAxisY ].abs ) < minRadius ) pitch = 0.0; if ( fabs( e.state.mAxes[ joyStickAxisZ ].abs ) < minRadius ) roll = 0.0; if ( fabs( -e.state.mAxes[ throwSliderAxis ].abs + axisScale ) < minRadius ) thrust = 0.0; - + //** little deadzone ; // window_->setDebugText( "Joy Axis: X: " + StringConverter::toString( e.state.mAxes[ joyStickAxisX ].abs ) + // " Y: " + StringConverter::toString( e.state.mAxes[ joyStickAxisY ].abs ) + @@ -443,12 +447,13 @@ // " pitch: " + StringConverter::toString(pitch) + // " roll: " + StringConverter::toString(roll) + // " thrust: " + StringConverter::toString(thrust) ); - - sector_->avatar()->setScaledYaw( -yaw ); - sector_->avatar()->setScaledPitch( pitch ); - sector_->avatar()->setScaledRoll( -roll ); + + sector_->avatar()->setScaledYaw( -yaw ); + sector_->avatar()->setScaledPitch( pitch ); + sector_->avatar()->setScaledRoll( -roll ); sector_->avatar()->setThrustPercent( thrust * 100. ); - } // if avatar + } // if avatar + return true; } bool SectorClientFrameListener::buttonPressed( const OIS::JoyStickEvent & e , int button){ @@ -458,7 +463,8 @@ if ( button == 0){ sector_->avatar()->setFirePressed( true ); } - } // if avatar_ + } // if avatar_ + return true; } bool SectorClientFrameListener::buttonReleased( const OIS::JoyStickEvent & e , int button){ @@ -469,7 +475,7 @@ sector_->avatar()->setFirePressed( false ); } } // if avatar_ - +return true; } void SectorClientFrameListener::toggleNextCamera_(){ @@ -486,7 +492,7 @@ sector_->avatar()->setVisible( true ); } break; - case 1: //** first person avatar camera + case 1: //** first person avatar camera if ( sector_->avatar() != NULL ){ sector_->avatar()->setVisible( false ); break; @@ -496,13 +502,13 @@ sector_->avatar()->setVisible( true ); break; } - case 3: //** free avatar tracking-camera at orign + case 3: //** free avatar tracking-camera at orign camera_->setPosition( Ogre::Vector3( 0, 0, 500 ) ); camera_->lookAt( Ogre::Vector3( 0, 0, -300 ) ); if ( sector_->avatar() != NULL ){ camera_->setAutoTracking( true, sector_->avatar()->mainNode() ); sector_->avatar()->setVisible( true ); - } + } break; } } @@ -511,34 +517,34 @@ if ( sector_->avatar() != NULL ){ Ogre::Vector3 avatarPos( sector_->avatar()->mainNode()->getPosition() ); - + Ogre::Vector3 targetPos; if ( target_ != NULL ){ targetPos = target_->mainNode()->getPosition() ; } - + Ogre::Vector3 dist( targetPos - avatarPos ); Ogre::Vector3 distNorm( dist.normalisedCopy() ); Ogre::Quaternion avatarOrient( sector_->avatar()->mainNode()->getOrientation() ); - + Ogre::Camera * cam1 = camera_->getSceneManager()->getCamera( "Camera1" ); - + cam1->setOrientation( avatarOrient ); - + // if ( ( 1.0f + cam1->getDirection( ).normalisedCopy().dotProduct( distNorm ) ) < 0.0001f ) { // cam1->yaw( Degree( 180 ) ); // } else { Ogre::Quaternion rot( cam1->getDirection( ).normalisedCopy().getRotationTo( distNorm ) ); cam1->rotate( rot ); // } - + if ( target_ != NULL ) cam1->setPosition( avatarPos + distNorm * ( dist.length() - 2.0 * target_->baseSize() ) ); - + switch ( cameraMode_ ){ case 0: //** free camera at orign camera_->lookAt( sector_->avatar()->mainNode()->getPosition( ) ); break; - case 1: //** first person avatar camera + case 1: //** first person avatar camera camera_->setPosition( avatarPos ); camera_->setOrientation( avatarOrient ); sector_->avatar()->setVisible( false ); @@ -548,7 +554,7 @@ camera_->setOrientation( avatarOrient ); camera_->yaw( Ogre::Degree(-90) ); break; - case 3: //** free avatar tracking-camera at orign + case 3: //** free avatar tracking-camera at orign break; } }// if avatar @@ -558,86 +564,86 @@ target_ = target; if ( target_ != NULL ){ - std::cout << target_->name()<< std::endl; + std::cout << target_->name()<< std::endl; Ogre::OverlayElement* targetName = Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextTargetName"); - targetName->setCaption( target_->name() ); - + targetName->setCaption( target_->name() ); + // if ( hudTarget_->numChildren() > 0 ){ // hudTarget_->removeAllChildren( );// hudTarget_->getChild( "TargetTrans" ) ); // camera_->getSceneManager()->destroyEntity( "TargetShape" ); -// } +// } // Ogre::SceneNode * hudTargetTrans = new Ogre::SceneNode( NULL, "TargetTrans" ); - + // Ogre::Entity *targetShape = target_->shape()->clone( "TargetShape" ); - + // hudTargetTrans->attachObject( targetShape ); -// Ogre::Real scale = 0.5 / ( targetShape->getBoundingBox().getMaximum()[ 0 ] +// Ogre::Real scale = 0.5 / ( targetShape->getBoundingBox().getMaximum()[ 0 ] // - targetShape->getBoundingBox().getMinimum()[ 0 ] ); // hudTargetTrans->yaw( Ogre::Degree( -90 ) ); // hudTargetTrans->scale( scale, scale, scale ); - + // hudTarget_->addChild( hudTargetTrans ); } } void SectorClientFrameListener::updateHUD_( void ) { const Ogre::RenderTarget::FrameStats & stats = window_->getStatistics(); - Ogre::OverlayElement* hudStat = + Ogre::OverlayElement* hudStat = Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextStats"); hudStat->setCaption( "fps: " + toStr( stats.lastFPS ) + " ping: " + toStr( network_->pingTime() ) + " ms" ); - + if ( sector_->avatar() != NULL ){ 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(), + sector_->avatar()->flightArrow()->setDirection( sector_->avatar()->flightDirection().normalisedCopy(), Ogre::Node::TS_WORLD ); } else { sector_->avatar()->flightArrow()->setVisible( false ); } - + if ( target_ != NULL ) { sector_->avatar()->targetArrow()->setVisible( true ); Ogre::Vector3 distToTarget = target_->mainNode()->getPosition() - sector_->avatar()->mainNode()->getPosition(); - + sector_->avatar()->targetArrow()->setOrientation( sector_->avatar()->mainNode()->getOrientation() ); - - sector_->avatar()->targetArrow()->setDirection( distToTarget.normalisedCopy(), + + sector_->avatar()->targetArrow()->setDirection( distToTarget.normalisedCopy(), Ogre::Node::TS_WORLD ); hudTarget_->setOrientation( target_->mainNode()->getOrientation() ); - + // Ogre::Vector3 targetPos; // Ogre::Quaternion targetOrient; targetOri = target_->mainNode().getOrientation(); // targetPos = target_->mainNode().getPosition(); - + //** targeting pointer - Ogre::Vector3 poss = camera_->getProjectionMatrix() * (camera_->getViewMatrix() * target_->mainNode()->getPosition() ); + Ogre::Vector3 poss = camera_->getProjectionMatrix() * (camera_->getViewMatrix() * target_->mainNode()->getPosition() ); poss.x = max( -1.0f, poss.x ); poss.x = min( 1.0f, poss.x ); poss.y = max( -1.0f, poss.y ); poss.y = min( 1.0f, poss.y ); - + Ogre::OverlayElement* hudTargetPointer = Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/TargetPointer"); hudTargetPointer->show(); - - Ogre::OverlayElement* hudTargetDist = + + Ogre::OverlayElement* hudTargetDist = Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextTargetDistance"); - - Ogre::OverlayElement* hudTargetShield = + + Ogre::OverlayElement* hudTargetShield = Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextTargetShield"); - - Ogre::OverlayElement* hudTargetArmor = + + Ogre::OverlayElement* hudTargetArmor = Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextTargetArmor"); - - Ogre::OverlayElement* hudTargetVel = + + Ogre::OverlayElement* hudTargetVel = Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextTargetVelocity"); - + hudTargetDist->setCaption( "D " + Ogre::StringConverter::toString( round( distToTarget.length(), 0 ) ) ); - + if ( poss.z < 1 ){ - hudTargetPointer->setPosition( windowsHalfWidth_ + (windowsHalfWidth_ * poss.x)-16, + hudTargetPointer->setPosition( windowsHalfWidth_ + (windowsHalfWidth_ * poss.x)-16, windowsHalfHeight_ + (windowsHalfHeight_ * -poss.y)-16 ); } - + if ( target_->getTypeID() == SECTOROBJECTMOVABLE_RTTI || target_->getTypeID() == SECTOROBJECTMOVABLE_AI_RTTI ){ hudTargetVel->setCaption( "V " + Ogre::StringConverter::toString( dynamic_cast< SectorObjectMoveable *>( target_ )->velocity(), 6 ) ); @@ -652,41 +658,41 @@ sector_->avatar()->targetArrow()->setVisible( false ); Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/TargetPointer")->hide( ); } - - Ogre::OverlayElement* hudVel = + + Ogre::OverlayElement* hudVel = Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextVelocity"); - - Ogre::OverlayElement* hudVelMax = + + Ogre::OverlayElement* hudVelMax = Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextVelocityMax"); - - Ogre::OverlayElement* hudThr = + + Ogre::OverlayElement* hudThr = Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextThr"); - - Ogre::OverlayElement* hudAcc = + + Ogre::OverlayElement* hudAcc = Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextAcc"); - - Ogre::OverlayElement* hudPos = + + Ogre::OverlayElement* hudPos = Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextPosition"); - - Ogre::OverlayElement* hudShield = + + Ogre::OverlayElement* hudShield = Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextShield"); - - Ogre::OverlayElement* hudArmor = + + Ogre::OverlayElement* hudArmor = Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextArmor"); - + hudVel->setCaption( "Vel: " + Ogre::StringConverter::toString( round( sector_->avatar()->velocity(), 2 ), 6 ) ); hudVelMax->setCaption( " / " + Ogre::StringConverter::toString( round( sector_->avatar()->velocityMax(), 2), 6 ) ); hudThr->setCaption( "Thr: " + Ogre::StringConverter::toString( sector_->avatar()->thrustPercent(), 4 ) + "%" ); hudAcc->setCaption( "Acc: " + Ogre::StringConverter::toString( sector_->avatar()->acceleration(), 2 ) ); hudShield->setCaption( "S " + Ogre::StringConverter::toString( sector_->avatar()->shieldPercent(), 4 ) ); hudArmor->setCaption( "A " + Ogre::StringConverter::toString( sector_->avatar()->armorPercent(), 4 ) ); - + Ogre::Vector3 pos( sector_->avatar()->mainNode()->getPosition() ); - hudPos->setCaption( "Pos: " + - Ogre::StringConverter::toString( Ogre::Real( rint( pos[ 0 ] ) ), 5, 5 ) + " " + - Ogre::StringConverter::toString( Ogre::Real( rint( pos[ 1 ] ) ), 5, 5 ) + " " + + hudPos->setCaption( "Pos: " + + Ogre::StringConverter::toString( Ogre::Real( rint( pos[ 0 ] ) ), 5, 5 ) + " " + + Ogre::StringConverter::toString( Ogre::Real( rint( pos[ 1 ] ) ), 5, 5 ) + " " + Ogre::StringConverter::toString( Ogre::Real( rint( pos[ 2 ] ) ), 5, 5 ) ); - + // OverlayElement* guiAvg = OverlayManager::getSingleton().getOverlayElement("Core/AverageFps"); // OverlayElement* guiCurr = OverlayManager::getSingleton().getOverlayElement("Core/CurrFps"); // OverlayElement* guiBest = OverlayManager::getSingleton().getOverlayElement("Core/BestFps"); @@ -696,10 +702,10 @@ // +" "+StringConverter::toString(stats.bestFrameTime)+" ms"); // guiWorst->setCaption(worstFps + StringConverter::toString(stats.worstFPS) // +" "+StringConverter::toString(stats.worstFrameTime)+" ms"); - + // OverlayElement* guiTris = OverlayManager::getSingleton().getOverlayElement("Core/NumTris"); // guiTris->setCaption(tris + StringConverter::toString(stats.triangleCount)); - + // OverlayElement* guiDbg = OverlayManager::getSingleton().getOverlayElement("Core/DebugText"); // guiDbg->setCaption( window_->getDebugText() ); // } @@ -727,46 +733,46 @@ bool SectorClientFrameListener::renderSpaceDust(){ // if ( sector_->avatar() != NULL ){ -// const Ogre::Real maxDist = 250.0; -// const Ogre::Real mirrorDist = maxDist*0.99; -// const Ogre::Real dimFactor = 0.8*0.005*0.005; -// const Ogre::Real maxDist2 = maxDist*maxDist; - +// const Ogre::Real maxDist = 250.0; +// const Ogre::Real mirrorDist = maxDist*0.99; +// const Ogre::Real dimFactor = 0.8*0.005*0.005; +// const Ogre::Real maxDist2 = maxDist*maxDist; + // const Ogre::Vector3 camPos( camera_->getWorldPosition() ); -// const Ogre::Real twiceMaxDist = 2 * maxDist; - -// Ogre::ParticleIterator pit = spaceDustParticleSystem_->_getIterator(); - -// while ( !pit.end() ){ -// Ogre::Particle * particle = pit.getNext(); -// Ogre::Vector3 & pos = particle->position; -// particle->timeToLive = 999999.0f; - -// // position particles near camera -// // (keep moving them toward camera until within range) -// while (pos.x - camPos.x > maxDist) -// pos.x -= twiceMaxDist; -// while (pos.x - camPos.x < -maxDist) -// pos.x += twiceMaxDist; -// while (pos.y - camPos.y > maxDist) -// pos.y -= twiceMaxDist; -// while (pos.y - camPos.y < -maxDist) -// pos.y += twiceMaxDist; -// while (pos.z - camPos.z > maxDist) -// pos.z -= twiceMaxDist; -// while (pos.z - camPos.z < -maxDist) -// pos.z += twiceMaxDist; - -// Ogre::Vector3 pDir = pos-camPos; -// Ogre::Real dist = pDir.squaredLength(); -// Ogre::Real dim = dist*dimFactor; -// particle->setDimensions(dim, dim); - -// } -// } // if avatar - return true; +// const Ogre::Real twiceMaxDist = 2 * maxDist; + +// Ogre::ParticleIterator pit = spaceDustParticleSystem_->_getIterator(); + +// while ( !pit.end() ){ +// Ogre::Particle * particle = pit.getNext(); +// Ogre::Vector3 & pos = particle->position; +// particle->timeToLive = 999999.0f; + +// // position particles near camera +// // (keep moving them toward camera until within range) +// while (pos.x - camPos.x > maxDist) +// pos.x -= twiceMaxDist; +// while (pos.x - camPos.x < -maxDist) +// pos.x += twiceMaxDist; +// while (pos.y - camPos.y > maxDist) +// pos.y -= twiceMaxDist; +// while (pos.y - camPos.y < -maxDist) +// pos.y += twiceMaxDist; +// while (pos.z - camPos.z > maxDist) +// pos.z -= twiceMaxDist; +// while (pos.z - camPos.z < -maxDist) +// pos.z += twiceMaxDist; + +// Ogre::Vector3 pDir = pos-camPos; +// Ogre::Real dist = pDir.squaredLength(); +// Ogre::Real dim = dist*dimFactor; +// particle->setDimensions(dim, dim); + +// } +// } // if avatar + return true; } } // namespace OpenGate{ - + Modified: branches/ogsector/src/SectorClientFrameListener.h =================================================================== --- branches/ogsector/src/SectorClientFrameListener.h 2007-04-06 18:07:28 UTC (rev 369) +++ branches/ogsector/src/SectorClientFrameListener.h 2007-04-06 18:13:57 UTC (rev 370) @@ -15,14 +15,14 @@ class Sector; -class SectorClientFrameListener: public Ogre::FrameListener, - public OIS::KeyListener, - public OIS::MouseListener, +class SectorClientFrameListener: public Ogre::FrameListener, + public OIS::KeyListener, + public OIS::MouseListener, public OIS::JoyStickListener { public: SectorClientFrameListener( Ogre::RenderWindow * win, Ogre::Camera * cam, Sector * sector, Network * nw, - bool useBufferedInputKeys = false, + bool useBufferedInputKeys = false, bool useBufferedInputMouse = false ); virtual ~SectorClientFrameListener( ); @@ -58,9 +58,10 @@ Ogre::RenderWindow * window_; Ogre::Camera * camera_; Sector * sector_; - InputManager * inputManager_; Network * network_; + InputManager * inputManager_; + Ogre::Overlay * hudOverlay_; Ogre::Overlay * mouseOverlay_; Ogre::OverlayElement * mousePointer_; @@ -90,7 +91,7 @@ int windowsHeight_; int windowsHalfWidth_; int windowsHalfHeight_; - + bool chatMode_; std::string chatString_; Modified: branches/ogsector/src/SectorObjects.cpp =================================================================== --- branches/ogsector/src/SectorObjects.cpp 2007-04-06 18:07:28 UTC (rev 369) +++ branches/ogsector/src/SectorObjects.cpp 2007-04-06 18:13:57 UTC (rev 370) @@ -4,8 +4,8 @@ namespace OpenGate{ -BaseObject::BaseObject( const Ogre::String & name, Sector * sector, int userID, int childID ) - : sector_( sector ), name_( name ), mainNode_( NULL ), userID_( userID ), childID_( childID ) { +BaseObject::BaseObject( const Ogre::String & name, Sector * sector, int userID, int childID ) + : name_( name ), sector_( sector ), userID_( userID ), childID_( childID ), mainNode_( NULL ){ globalID_ = createGlobalID( userID, childID ); sceneMgr_ = sector_->sceneManager(); @@ -18,7 +18,7 @@ sceneMgr_->getRootSceneNode()->removeAndDestroyChild( mainNode_->getName() ); } -Projectile::Projectile( BaseObject * parent, long shotCounter ) +Projectile::Projectile( BaseObject * parent, long shotCounter ) : BaseObject( parent->name(), parent->sector() ), parent_( parent ) { Ogre::String bulletName( name_ + "_" + toStr( shotCounter ) ); @@ -26,19 +26,19 @@ // chain_ = sceneMgr_->createBillboardChain( name_ + "_" + toStr( shotCounter ) + "_ProjectileBBC" ); // chain_->setMaxChainElements( 10 ); // chain_->setMaterialName("BulletWhite"); - + // for ( int i = 0; i < 10; i ++ ){ -// chain_->addChainElement(0, Ogre::BillboardChain::Element( Ogre::Vector3( 0.0, 0.0, Ogre::Real( i * 0.01 ) ), +// chain_->addChainElement(0, Ogre::BillboardChain::Element( Ogre::Vector3( 0.0, 0.0, Ogre::Real( i * 0.01 ) ), // 0.2, 0.1, Ogre::ColourValue(0.0f, 0.0f, 0.0f) ) ); -// // chain_->addChainElement(0, Ogre::BillboardChain::Element( Ogre::Vector3( 0.0, -0.1, Ogre::Real( i * 0.01 ) ), +// // chain_->addChainElement(0, Ogre::BillboardChain::Element( Ogre::Vector3( 0.0, -0.1, Ogre::Real( i * 0.01 ) ), // // 0.2, 0.1, Ogre::ColourValue(1.0f, 1.0f, 1.0f) ) ); // } // mainNode_->attachObject( chain_ ); // chain_->setVisible( true ); Ogre::Vector3 position( parent_->mainNode()->getPosition() ); - Ogre::Quaternion direction( parent_->mainNode()->getOrientation() ); - + Ogre::Quaternion direction( parent_->mainNode()->getOrientation() ); + int maxBB = 20; bbs_ = sceneMgr_->createBillboardSet( bulletName + "_BBS", maxBB ); bbs_->setMaterialName("Bullet"); @@ -79,9 +79,9 @@ mainNode_->setPosition( position ); mainNode_->setPosition( position + direction.zAxis().normalisedCopy() * -6.2 + - direction.xAxis().normalisedCopy() * 1.5 + + direction.xAxis().normalisedCopy() * 1.5 + direction.yAxis().normalisedCopy() * -0.2 ); - + // mainNode_->setOrientation( direction ); maxLiveTime_ = 1.4; @@ -113,7 +113,7 @@ bbs_->getBillboard( 0 )->setDimensions( 10, 10 ); lifeTime_ = max( lifeTime_, maxLiveTime_ - 0.1f ); -// sector_->collisionContext()->removeObject( collObj_ ); +// sector_->collisionContext()->removeObject( collObj_ ); // OgreOpcode::CollisionManager::getSingletonPtr()->detachShape( collObj_->getShape() ); } @@ -130,17 +130,17 @@ OgreOpcode::CollisionPair ** rayPickReport; Ogre::Ray bulletRay( mainNode_->getPosition(), vel_.normalisedCopy() ); - - int nColl = sector_->collisionContext()->rayCheck( bulletRay, (vel_ * elapsedTime).length(), - OgreOpcode::COLLTYPE_EXACT, + + int nColl = sector_->collisionContext()->rayCheck( bulletRay, (vel_ * elapsedTime).length(), + 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 ( this->name() != static_cast< BaseObject * >( col1->getClientData() )->name() ){ - + mainNode_->setPosition( rayPickReport[ 0 ]->contact ); this->collide( static_cast< BaseObject * >( col2->getClientData() ) ); @@ -152,8 +152,8 @@ } return true; } - + SectorObject::SectorObject( const Ogre::String & name, Sector * sector, int userID, int childID ) : BaseObject( name, sector, userID, childID ) { @@ -165,12 +165,12 @@ mainNodeShape_->detachObject( shape_ ); sceneMgr_->destroyEntity( shape_ ); - sector_->collisionContext()->destroyObject( collObj_ ); + sector_->collisionContext()->destroyObject( collObj_ ); OgreOpcode::CollisionManager::getSingletonPtr()->destroyShape( collObj_->getShape() ); // mainNode_->detachObject( mainNodeShape_->getName() ); mainNode_->removeAndDestroyChild( mainNodeShape_->getName() ); - + } void SectorObject::setShape( const Ogre::String & meshname ){ @@ -189,7 +189,7 @@ } void SectorObject::setBaseSize( Ogre::Real targetSize ){ - Ogre::Real scale = targetSize / ( shape_->getBoundingBox().getMaximum()[ 0 ] + Ogre::Real scale = targetSize / ( shape_->getBoundingBox().getMaximum()[ 0 ] - shape_->getBoundingBox().getMinimum()[ 0 ] ); mainNodeShape_->scale( scale, scale, scale ); baseSize_ = targetSize; @@ -199,7 +199,7 @@ : SectorObject( name, sector, userID, childID ) { inititializeVesselStats_(); - setShape( "ships/Octavius/Apteryx/octavius_apteryx.mesh" ); + setShape( "ships/octavius/apteryx/apteryx.mesh" ); //setShape( "ogrehead.mesh" ); baseYaw( Ogre::Degree( -90 ) ); @@ -212,14 +212,14 @@ Ogre::ParticleEmitter *pEmit1 = thrusterParticles_->addEmitter( "Point" ); pEmit1->setDirection( mainNode_->getOrientation().zAxis() ); pEmit1->setPosition( Ogre::Vector3( 0.0f, 0.5f, 5.0f ) ); - pEmit1->setColour( Ogre::ColourValue::Blue, Ogre::ColourValue::Green); + pEmit1->setColour( Ogre::ColourValue::Blue, Ogre::ColourValue::Green); mainNode_->attachObject( thrusterParticles_ ); setThrustPercent( 0.0 ); updateThruster(); } - + SectorObjectMoveable::~SectorObjectMoveable() { mainNode_->detachObject( thrusterParticles_ ); sceneMgr_->destroyParticleSystem( thrusterParticles_ ); @@ -255,7 +255,7 @@ // } else { // setScaledRoll( 0.0 ); // } - + setScaledYaw( msg.yaw() ); setScaledRoll( msg.roll() ); setScaledPitch( msg.pitch() ); @@ -274,30 +274,30 @@ if ( !1 ){ std::cout << std::endl; - std::cout << msg.sequenceNr() << "LastFrameCount: " << lastFrameCount_ - << " life: " << lifeTime_ << " last: " << lastLifeTime_ + std::cout << msg.sequenceNr() << "LastFrameCount: " << lastFrameCount_ + << " life: " << lifeTime_ << " last: " << lastLifeTime_ << " diff: "<< lifeTime_ - lastLifeTime_ << std::endl; - - // std::cout << "Ist: " << mainNode_->getOrientation( ) + + // std::cout << "Ist: " << mainNode_->getOrientation( ) // << " " << mainNode_->getOrientation( ).getYaw().valueDegrees() << std::endl; - + // std::cout << "Soll: " << msg.orientation() << " " << msg.orientation().getYaw().valueDegrees() << std::endl; std::cout << "Diff: send: " << msg.yaw() << " " << msg.pitch() << " " << msg.roll() << std::endl; - - std::cout << "Diff: Pos: " << (srcP-destP).length() - << " Y:" << interpolateRot_.getYaw().valueDegrees() - << " P:" << interpolateRot_.getPitch().valueDegrees() + + std::cout << "Diff: Pos: " << (srcP-destP).length() + << " Y:" << interpolateRot_.getYaw().valueDegrees() + << " P:" << interpolateRot_.getPitch().valueDegrees() << " R:" << interpolateRot_.getRoll().valueDegrees() << std::endl; } // mainNode_->rotate( interpolateRot_, Ogre::Node::TS_PARENT ); - + Ogre::Degree yawTo( interpolateRot_.getYaw() ); Ogre::Degree pitchTo( interpolateRot_.getPitch() ); Ogre::Degree rollTo( interpolateRot_.getRoll() ); - + mainNode_->yaw( yawTo / 5.0 , Ogre::Node::TS_PARENT ); mainNode_->pitch( pitchTo / 5.0, Ogre::Node::TS_PARENT ); mainNode_->roll( rollTo / 5.0, Ogre::Node::TS_PARENT ); @@ -309,7 +309,7 @@ // yaw_ += scaledYaw; // pitch_ += scaledPitch; // roll_ += scaledRoll; - + // mainNode_->translate( ( destP- srcP ) / 5.0 ); interpolateVel_ = ( destP-srcP ) / lastFrameCount_ / 1.0; @@ -359,7 +359,7 @@ void SectorObjectMoveable::hitByAmmo( float damage ){ shield_ -= damage; - + if ( shield_ < 0 ){ armor_ += shield_; shield_ = 0.0; @@ -367,7 +367,7 @@ } statusChanged_ = true; } - + bool SectorObjectMoveable::update( Ogre::Real elapsedTime ){ if ( elapsedTime < 0.001 ) return true; @@ -389,19 +389,19 @@ //** friction = drag * v^2; Ogre::Real friction = ethernalDensity_ * dragFactor_ * velocity() * velocity(); - + Ogre::Vector3 trustDir( mainNode_->getOrientation().zAxis() ); Ogre::Vector3 flightDir( vel_ ); flightDir.normalise(); - + //** thrust = mass * acc; acc_ = ( - trustDir * thrust() - flightDir * friction ) / mass_; - + if ( breakPressed_ == true ) { if ( velocity() > 0 ) { acc_ -= flightDir * 4.0; } } - + //** v = a * t; vel_ += acc_ * elapsedTime; mainNode_->translate( ( vel_ + interpolateVel_ )* elapsedTime ); @@ -421,27 +421,27 @@ shield_ += shieldRechargeBaseRate_ * elapsedTime; shield_ = min( maxShield_, shield_ ); - fire( elapsedTime ); + fire( elapsedTime ); //** snap quaternion Ogre::Quaternion rnd( mainNode_->getOrientation() ); mainNode_->setOrientation( round( rnd.w, 5 ), round( rnd.x, 5 ), round( rnd.y, 5 ), round( rnd.z, 5 ) ); - + return true; -} +} void SectorObjectMoveable::inititializ... [truncated message content] |
From: <spo...@us...> - 2007-04-13 16:50:52
|
Revision: 384 http://svn.sourceforge.net/opengate/?rev=384&view=rev Author: spom_spom Date: 2007-04-13 09:50:52 -0700 (Fri, 13 Apr 2007) Log Message: ----------- Replaced libgrapple by boost::asio, works sweet whith linux and win32. Add simple logmanager and simple console. Modified Paths: -------------- branches/ogsector/config.h.in branches/ogsector/configure.ac branches/ogsector/data/simpleHUD.material branches/ogsector/data/simpleHUD.overlay branches/ogsector/ogre.cfg branches/ogsector/plugins.cfg branches/ogsector/resources.cfg branches/ogsector/runClient.sh branches/ogsector/src/InputManager.cpp branches/ogsector/src/InputManager.h branches/ogsector/src/Makefile.am branches/ogsector/src/Makefile.in branches/ogsector/src/Sector.cpp branches/ogsector/src/Sector.h branches/ogsector/src/SectorClient.cpp branches/ogsector/src/SectorClient.h branches/ogsector/src/SectorClientFrameListener.cpp branches/ogsector/src/SectorClientFrameListener.h branches/ogsector/src/SectorObjects.cpp branches/ogsector/src/SectorObjects.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/ogsectorclient.cpp branches/ogsector/src/ogsectorserver.cpp branches/ogsector/win32/ogsectorclient/resources.cfg Added Paths: ----------- branches/ogsector/data/Console.png branches/ogsector/data/fonts.zip branches/ogsector/data/simpleHUD.fontdef branches/ogsector/src/LogManager.cpp branches/ogsector/src/LogManager.h branches/ogsector/src/networkServerUser.cpp branches/ogsector/src/networkServerUser.h branches/ogsector/src/ogconsole.cpp branches/ogsector/src/ogconsole.h branches/ogsector/win32/ogsectorclient/runClient.bat Removed Paths: ------------- branches/ogsector/data/MediaFromOgre/fonts.zip Modified: branches/ogsector/config.h.in =================================================================== --- branches/ogsector/config.h.in 2007-04-12 19:53:37 UTC (rev 383) +++ branches/ogsector/config.h.in 2007-04-13 16:50:52 UTC (rev 384) @@ -1,5 +1,32 @@ /* config.h.in. Generated from configure.ac by autoheader. */ +/* Define to 1 if you have the <inttypes.h> header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the <memory.h> header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the <stdint.h> header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the <stdlib.h> header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the <strings.h> header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the <string.h> header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the <sys/types.h> header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the <unistd.h> header file. */ +#undef HAVE_UNISTD_H + /* Name of package */ #undef PACKAGE @@ -18,5 +45,8 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + /* Version number of package */ #undef VERSION Modified: branches/ogsector/configure.ac =================================================================== --- branches/ogsector/configure.ac 2007-04-12 19:53:37 UTC (rev 383) +++ branches/ogsector/configure.ac 2007-04-13 16:50:52 UTC (rev 384) @@ -26,11 +26,13 @@ AC_SUBST(AM_CXXFLAGS, "$AM_CXXFLAGS $OIS_CFLAGS") AC_SUBST(AM_LDFLAGS, "$AM_LDFLAGS $OIS_LIBS") -#libgrapple - http://grapple.linuxgamepublishing.com/grapple.php -PKG_CHECK_MODULES(GRAPPLE, [GRAPPLE >= 0.9]) -AC_SUBST(AM_CXXFLAGS, "$AM_CXXFLAGS $GRAPPLE_CFLAGS") -AC_SUBST(AM_LDFLAGS, "$AM_LDFLAGS $GRAPPLE_LIBS") +dnl asio: http://sourceforge.net/projects/asio/ +AC_CHECK_HEADER([asio.hpp]) +dnl boost: http://www.boost.org/ +dnl # some of the boost headers are needed by asio +#AC_CHECK_HEADER([boost/bind.h]) + #freealut - http://www.openal.org PKG_CHECK_MODULES(freealut, [freealut >= 1.0.1]) AC_SUBST(AM_CXXFLAGS, "$AM_CXXFLAGS $freealut_CFLAGS") @@ -41,6 +43,7 @@ AC_SUBST([CXXFLAGS], ["${CXXFLAGS} -I$OGSECTOR_EXTERNALS_PATH/ogreopcode/opcode132"]) AC_SUBST([LDFLAGS], ["${LDFLAGS} -L$OGSECTOR_EXTERNALS_PATH/lib/ -lOpcode -lOgreOpcode"]) +#AC_SUBST([CXXFLAGS], ["-g -Wall ${CXXFLAGS}"]) dnl #libopcode dnl PKG_CHECK_MODULES(GRAPPLE, [GRAPPLE >= 0.9]) dnl AM_CXXFLAGS="$AM_CXXFLAGS $GRAPPLE_CFLAGS" Added: branches/ogsector/data/Console.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/Console.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Deleted: branches/ogsector/data/MediaFromOgre/fonts.zip =================================================================== (Binary files differ) Added: branches/ogsector/data/fonts.zip =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/fonts.zip ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/simpleHUD.fontdef =================================================================== --- branches/ogsector/data/simpleHUD.fontdef (rev 0) +++ branches/ogsector/data/simpleHUD.fontdef 2007-04-13 16:50:52 UTC (rev 384) @@ -0,0 +1,17 @@ +Console +{ + type truetype + source bluehigh.ttf + size 32 + resolution 55 +} + + +BlueHighway +{ + type truetype + source bluehigh.ttf + size 32 + resolution 55 +} + Modified: branches/ogsector/data/simpleHUD.material =================================================================== --- branches/ogsector/data/simpleHUD.material 2007-04-12 19:53:37 UTC (rev 383) +++ branches/ogsector/data/simpleHUD.material 2007-04-13 16:50:52 UTC (rev 384) @@ -33,3 +33,22 @@ } } } + +material console/background +{ + technique + { + pass + { + depth_check off + lighting off + scene_blend alpha_blend + diffuse 1.0 1.0 1.0 1.0 + + texture_unit + { + texture Console.png + } + } + } +} Modified: branches/ogsector/data/simpleHUD.overlay =================================================================== --- branches/ogsector/data/simpleHUD.overlay 2007-04-12 19:53:37 UTC (rev 383) +++ branches/ogsector/data/simpleHUD.overlay 2007-04-13 16:50:52 UTC (rev 384) @@ -1,16 +1,69 @@ OpenGate/SimpleHUD { zorder 500 -// container Panel(OpenGate/SimpleHUDPanelChatInput) -// { -// metrics_mode pixels -// left 200 -// top 800 -// width 700 -// height 30 -// material Core/BreakPanel -// } + container Panel(OpenGate/SimpleHUDConsole) + { + left 0.01 + top 0.01 + width 0.98 + height 0.5 + material console/background + element TextArea(OpenGate/SimpleHUDConsoleTextArea) + { + left 0.01 + top 0.01 + width 0.98 + height 0.5 + font_name Console + char_height 0.02 + colour_top 1 1 1 + colour_bottom 1 1 1 + } + } + + container Panel(OpenGate/SimpleHUDConsoleShort) + { + left 0.01 + top 0.01 + width 0.98 + height 0.075 +// material console/background + + element TextArea(OpenGate/SimpleHUDConsoleShortTextArea) + { + left 0.01 + top 0.01 + width 0.98 + height 0.075 + font_name Console + char_height 0.02 + colour_top 1.0 1.0 1.0 + colour_bottom 1.0 1.0 1.0 + } + } + + container Panel(OpenGate/SimpleHUDChatInPanel) + { + left 0.01 + top 0.52 + width 0.98 + height 0.025 + material console/background + + element TextArea(OpenGate/SimpleHUDChatInTextField) + { + left 0.01 + top 0.005 + width 0.9 + height 0.025 + font_name Console + char_height 0.02 + colour_top 1.0 1.0 1.0 + colour_bottom 1.0 1.0 1.0 + } + } + container Panel(OpenGate/CenterPointer) { metrics_mode pixels @@ -33,239 +86,163 @@ container Panel(OpenGate/SimpleHUDPanel) { -// metrics_mode pixels -// vert_align bottom left 0 top 0 width 1.0 height 1.0 -// border_size 1 1 1 1 -// border_material Core/StatsBlockBorder -// border_topleft_uv 0.0000 1.0000 0.0039 0.9961 -// border_top_uv 0.0039 1.0000 0.9961 0.9961 -// border_topright_uv 0.9961 1.0000 1.0000 0.9961 -// border_left_uv 0.0000 0.9961 0.0039 0.0039 -// border_right_uv 0.9961 0.9961 1.0000 0.0039 -// border_bottomleft_uv 0.0000 0.0039 0.0039 0.0000 -// border_bottom_uv 0.0039 0.0039 0.9961 0.0000 -// border_bottomright_uv 0.9961 0.0039 1.0000 0.0000 -// + element TextArea(OpenGate/SimpleHUDTextStats) { - metrics_mode pixels - left 700 - top 10 - width 100 - height 10 - font_name BlueHighway - char_height 16 + left 0.8 + top 0.01 + width 0.2 + height 0.03 caption FPS: + font_name BlueHighway + char_height 0.02 colour_top 1 1 0.7 colour_bottom 1 1 0.7 } - element TextArea(OpenGate/DebugText) - { - metrics_mode pixels - left 230 - top 70 - width 200 - height 30 - font_name BlueHighway - char_height 16 - colour_top 0.5 0.7 0.5 - colour_bottom 0.3 0.5 0.3 - } - - element TextArea(OpenGate/SimpleHUDTextChatIn) - { - metrics_mode pixels - left 10 - top 10 - width 700 - height 100 - font_name BlueHighway - char_height 16 - colour_top 1.0 1.0 1.0 - colour_bottom 1.0 1.0 1.0 - } - - element TextArea(OpenGate/SimpleHUDTextChatOut) - { - metrics_mode pixels - left 10 - top 450 - width 700 - height 100 - font_name BlueHighway - char_height 16 - colour_top 1.0 1.0 1.0 - colour_bottom 1.0 1.0 1.0 - } - element TextArea(OpenGate/SimpleHUDTextVelocity) { - metrics_mode pixels - left 200 - top 200 - width 200 - height 200 - font_name BlueHighway - char_height 16 + left 0.25 + top 0.3 + width 0.1 + height 0.03 caption Vel: + font_name BlueHighway + char_height 0.02 colour_top 0.5 0.7 0.5 colour_bottom 0.3 0.5 0.3 } - element TextArea(OpenGate/SimpleHUDTextVelocityMax) { - metrics_mode pixels - left 260 - top 200 - width 200 - height 200 - font_name BlueHighway - char_height 16 + left 0.31 + top 0.3 + width 0.1 + height 0.03 caption / + font_name BlueHighway + char_height 0.02 colour_top 0.5 0.7 0.5 colour_bottom 0.3 0.5 0.3 } - element TextArea(OpenGate/SimpleHUDTextThr) { - metrics_mode pixels - left 200 - top 220 - width 200 - height 200 - font_name BlueHighway - char_height 16 + left 0.25 + top 0.33 + width 0.1 + height 0.03 caption Thr: + font_name BlueHighway + char_height 0.02 colour_top 0.5 0.7 0.5 colour_bottom 0.3 0.5 0.3 } - element TextArea(OpenGate/SimpleHUDTextAcc) { - metrics_mode pixels - left 200 - top 240 - width 200 - height 200 - font_name BlueHighway - char_height 16 + left 0.25 + top 0.36 + width 0.03 + height 0.1 caption Current Acc: + font_name BlueHighway + char_height 0.022 colour_top 0.5 0.7 0.5 colour_bottom 0.3 0.5 0.3 } - element TextArea(OpenGate/SimpleHUDTextShield) { - metrics_mode pixels - left 200 - top 260 - width 200 - height 200 + left 0.25 + top 0.39 + width 0.1 + height 0.03 font_name BlueHighway - char_height 16 + char_height 0.02 colour_top 0.5 0.7 0.5 colour_bottom 0.3 0.5 0.3 } - element TextArea(OpenGate/SimpleHUDTextArmor) { - metrics_mode pixels - left 200 - top 280 - width 200 - height 200 + left 0.25 + top 0.42 + width 0.1 + height 0.03 font_name BlueHighway - char_height 16 + char_height 0.02 colour_top 0.5 0.7 0.5 colour_bottom 0.3 0.5 0.3 } - element TextArea(OpenGate/SimpleHUDTextPosition) { - metrics_mode pixels - left 200 - top 300 - width 200 - height 200 - font_name BlueHighway - char_height 16 + left 0.25 + top 0.45 + width 0.1 + height 0.1 caption Current Pos: + font_name BlueHighway + char_height 0.02 colour_top 0.5 0.7 0.5 colour_bottom 0.3 0.5 0.3 } - + element TextArea(OpenGate/SimpleHUDTextTargetName) { - metrics_mode pixels - left 20 - top 550 - width 100 - height 20 + left 0.015 + top 0.80 + width 0.1 + height 0.02 font_name BlueHighway - char_height 14 + char_height 0.02 colour_top 0.5 0.7 0.5 colour_bottom 0.3 0.5 0.3 } - element TextArea(OpenGate/SimpleHUDTextTargetDistance) { - metrics_mode pixels - left 20 - top 565 - width 100 - height 20 + left 0.015 + top 0.82 + width 0.1 + height 0.02 font_name BlueHighway - char_height 14 + char_height 0.02 colour_top 0.5 0.7 0.5 colour_bottom 0.3 0.5 0.3 } element TextArea(OpenGate/SimpleHUDTextTargetVelocity) { - metrics_mode pixels - left 20 - top 580 - width 100 - height 20 + left 0.17 + top 0.84 + width 0.1 + height 0.02 font_name BlueHighway - char_height 14 + char_height 0.02 colour_top 0.5 0.7 0.5 colour_bottom 0.3 0.5 0.3 } + element TextArea(OpenGate/SimpleHUDTextTargetShield) { - metrics_mode pixels - left 20 - top 595 - width 100 - height 20 + left 0.17 + top 0.86 + width 0.1 + height 0.02 font_name BlueHighway - char_height 14 + char_height 0.02 colour_top 0.5 0.7 0.5 colour_bottom 0.3 0.5 0.3 } element TextArea(OpenGate/SimpleHUDTextTargetArmor) { - metrics_mode pixels - left 20 - top 610 - width 100 - height 20 + left 0.17 + top 0.88 + width 0.1 + height 0.02 font_name BlueHighway - char_height 14 + char_height 0.02 colour_top 0.5 0.7 0.5 colour_bottom 0.3 0.5 0.3 } } - -// element Entity cone1.mesh(cone) -// { -// position 700 700 0 -// rotation 0 0 0 0 -// } } Modified: branches/ogsector/ogre.cfg =================================================================== --- branches/ogsector/ogre.cfg 2007-04-12 19:53:37 UTC (rev 383) +++ branches/ogsector/ogre.cfg 2007-04-13 16:50:52 UTC (rev 384) @@ -1,7 +1,7 @@ Render System=OpenGL Rendering Subsystem [OpenGL Rendering Subsystem] -FSAA=0 +FSAA=6 Full Screen=No RTT Preferred Mode=FBO Refresh Rate=Not applicable Modified: branches/ogsector/plugins.cfg =================================================================== --- branches/ogsector/plugins.cfg 2007-04-12 19:53:37 UTC (rev 383) +++ branches/ogsector/plugins.cfg 2007-04-13 16:50:52 UTC (rev 384) @@ -1,7 +1,7 @@ # Defines plugins to load # Define plugin folder -PluginFolder=/usr/local/lib/OGRE +PluginFolder=/usr/lib/OGRE # Define D3D rendering implementation plugin Plugin=RenderSystem_GL.so Modified: branches/ogsector/resources.cfg =================================================================== --- branches/ogsector/resources.cfg 2007-04-12 19:53:37 UTC (rev 383) +++ branches/ogsector/resources.cfg 2007-04-13 16:50:52 UTC (rev 384) @@ -6,9 +6,9 @@ [General] FileSystem=./data Zip=./data/simpleSkybox.zip +Zip=./data/fonts.zip # FileSystem=./data/MediaFromOgre -Zip=./data/MediaFromOgre/fonts.zip # FileSystem=../../trunk/data/ FileSystem=../../trunk/data/materials Modified: branches/ogsector/runClient.sh =================================================================== --- branches/ogsector/runClient.sh 2007-04-12 19:53:37 UTC (rev 383) +++ branches/ogsector/runClient.sh 2007-04-13 16:50:52 UTC (rev 384) @@ -11,4 +11,5 @@ export LD_LIBRARY_PATH=./externals/lib:$LD_LIBRARY_PATH echo "starting client for user: $USERNAME and looking for host: $HOSTNAME" -./src/ogsectorclient $USERNAME $HOSTNAME + +./src/ogsectorclient $USERNAME $HOSTNAME --ogreconfig=0 Modified: branches/ogsector/src/InputManager.cpp =================================================================== --- branches/ogsector/src/InputManager.cpp 2007-04-12 19:53:37 UTC (rev 383) +++ branches/ogsector/src/InputManager.cpp 2007-04-13 16:50:52 UTC (rev 384) @@ -20,7 +20,7 @@ mKeyboard = static_cast<OIS::Keyboard*>(mInputSystem->createInputObject( OIS::OISKeyboard, true)); mKeyboard->setEventCallback( this ); -#ifndef WIN32 +#ifndef WIN32 if ( mInputSystem->numJoysticks() > 0 ) { // mJoysticks.resize( mInputSystem->numJoysticks() ); @@ -33,7 +33,7 @@ // } mJoyStick = static_cast<OIS::JoyStick*>(mInputSystem->createInputObject( OIS::OISJoyStick, true)); mJoyStick->setEventCallback( this ); - } + } #endif } } Modified: branches/ogsector/src/InputManager.h =================================================================== --- branches/ogsector/src/InputManager.h 2007-04-12 19:53:37 UTC (rev 383) +++ branches/ogsector/src/InputManager.h 2007-04-13 16:50:52 UTC (rev 384) @@ -86,41 +86,4 @@ }; -// class InputManager : public OIS::KeyListener, public OIS::MouseListener, public OIS::JoyStickListener { -// public: -// virtual ~InputManager( void ); - -// void initialise( Ogre::RenderWindow *renderWindow ); -// void capture( void ); - -// void setWindowExtents( int width, int height ); - -// OIS::Mouse* getMouse( void ); -// OIS::Keyboard* getKeyboard( void ); -// OIS::JoyStick* getJoystick( unsigned int index ); - -// int getNumOfJoysticks( void ); - -// static InputManager* getSingletonPtr( void ); - -// private: -// InputManager( void ); -// InputManager( const InputManager & input ) { } -// InputManager & operator = ( const InputManager & input ); - -// OIS::InputManager * mInputSystem; -// OIS::Mouse * mMouse; -// OIS::Keyboard * mKeyboard; - -// std::vector< OIS::JoyStick * > mJoysticks; -// std::vector< OIS::JoyStick * >::iterator itJoystick; -// std::vector< OIS::JoyStick * >::iterator itJoystickEnd; - -// std::map< std::string, OIS::KeyListener * > mKeyListeners; -// std::map< std::string, OIS::MouseListener * > mMouseListeners; -// std::map< std::string, OIS::JoyStickListener * > mJoystickListeners; - -// static InputManager *mInputManager; -// }; - #endif // INPUTMANAGER_H Added: branches/ogsector/src/LogManager.cpp =================================================================== --- branches/ogsector/src/LogManager.cpp (rev 0) +++ branches/ogsector/src/LogManager.cpp 2007-04-13 16:50:52 UTC (rev 384) @@ -0,0 +1,98 @@ +#include "LogManager.h" + +namespace OpenGate{ + +LogManager::LogManager( const std::string & logFileName, const std::string & chatLogFileName ) { + logFile_.open( logFileName.c_str(), std::fstream::trunc ); + + chatLogFile_.open( chatLogFileName.c_str(), std::fstream::app ); + chatLogFile_ << "\n" << timeStamp() << "Starting new session" << std::endl; + + // stdLog_ = std::cout; + logType_ = None; + console_ = NULL; +} + +LogManager::~LogManager( ) { + logFile_.close(); + chatLogFile_.close(); +} + +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 ) + "." + + toStr( time->tm_mday ) + "-" + + toStr( time->tm_hour ) + ":" + + toStr( time->tm_min ) + ":" + + toStr( time->tm_sec ) + "]" ); +} + +void LogManager::setConsole( OGConsole * console ){ + console_ = console; +} + +void LogManager::chat( const std::string & name, const std::string & msg ){ + std::string logMsg( name + ": " + msg ); + + if ( console_ ) console_->print( logMsg ); + chatLogFile_ << timeStamp() << " " << logMsg << std::endl; + write_( msg ); +} + +void LogManager::info( const std::string & msg ){ + if ( console_ ) console_->print( msg ); + write_( msg ); +} + +void LogManager::debug( const std::string & msg ){ + write_( msg ); +} + +void LogManager::fatal( const std::string & msg ){ + if ( console_ ) console_->print( msg ); + write_( msg ); +} + +void LogManager::write_( const std::string & msg ){ + std::cout << msg << std::endl; + logFile_ << timeStamp() << ": " << msg << std::endl; +} + +void LogManager::cout( const std::string & msg ){ + std::cout << msg << std::endl; +} + +// LogManager & LogManager::operator - ( LogType logType ) { +// logType_ = logType; +// return *this; +// } + +// class Flush{ +// public: +// Flush( LogManager & log ){ +// } +// }; + +// LogManager & LogManager::operator << ( const Flush & flush ) { +// switch( logType_ ){ +// case Chat: +// chatLogFile_ << std::endl; +// case Info: +// case Fatal: +// // if ( console_ ) (*console_) << x; +// case Debug: +// std::cout << std::endl; +// logFile_ << std::endl; +// break; +// } +// return *this; +// } + + +} //namespace OpenGate + + Added: branches/ogsector/src/LogManager.h =================================================================== --- branches/ogsector/src/LogManager.h (rev 0) +++ branches/ogsector/src/LogManager.h 2007-04-13 16:50:52 UTC (rev 384) @@ -0,0 +1,56 @@ +#ifndef LOGMANAGER__H +#define LOGMANAGER__H + +#include <iostream> +#include <fstream> +#include <string> + +#include "common.h" +#include "ogconsole.h" + +namespace OpenGate{ + +enum LogType{ None, Info, Chat, Debug, Fatal}; + + //class Flush; + +class LogManager { +public: + LogManager( const std::string & logFileName, const std::string & chatLogFileName ); + + ~LogManager( ); + + LogManager & operator - ( LogType type ); + + void setConsole( OGConsole * console ); + + std::string timeStamp(); + + void info( const std::string & msg ); + + void chat( const std::string & name, const std::string & msg ); + + void debug( const std::string & msg ); + + void fatal( const std::string & msg ); + + void cout( const std::string & msg ); +// template < class T > LogManager & operator << ( const T & x ); +// // LogManager & operator << ( const std::endl & endl ){} +// LogManager & operator << ( const Flush & flush ); + +protected: + void write_( const std::string & msg ); + + std::ofstream logFile_; + std::ofstream chatLogFile_; + OGConsole *console_; + + LogType logType_; +}; + +} //namespace OpenGate + + + +#endif // #ifndef __LOGCPP_H Modified: branches/ogsector/src/Makefile.am =================================================================== --- branches/ogsector/src/Makefile.am 2007-04-12 19:53:37 UTC (rev 383) +++ branches/ogsector/src/Makefile.am 2007-04-13 16:50:52 UTC (rev 384) @@ -6,8 +6,12 @@ ogsectorclient_SOURCES = \ ogsectorclient.cpp \ common.h \ + LogManager.h \ + LogManager.cpp \ common.cpp \ - network_protocol.h \ + ogconsole.h \ + ogconsole.cpp \ + networkProtocol.h \ Sector.h \ Sector.cpp \ SectorClient.h \ @@ -25,9 +29,11 @@ ogsectorserver.cpp \ common.h \ common.cpp \ - network_protocol.h \ + networkProtocol.h \ networkServer.h \ - networkServer.cpp + networkServer.cpp \ + networkServerUser.h \ + networkServerUser.cpp testopenalmanager_SOURCES = \ testopenalmanager.cpp \ Modified: branches/ogsector/src/Makefile.in =================================================================== --- branches/ogsector/src/Makefile.in 2007-04-12 19:53:37 UTC (rev 383) +++ branches/ogsector/src/Makefile.in 2007-04-13 16:50:52 UTC (rev 384) @@ -48,14 +48,15 @@ am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) -am_ogsectorclient_OBJECTS = ogsectorclient.$(OBJEXT) common.$(OBJEXT) \ +am_ogsectorclient_OBJECTS = ogsectorclient.$(OBJEXT) \ + LogManager.$(OBJEXT) common.$(OBJEXT) ogconsole.$(OBJEXT) \ Sector.$(OBJEXT) SectorClient.$(OBJEXT) \ SectorClientFrameListener.$(OBJEXT) InputManager.$(OBJEXT) \ networkClient.$(OBJEXT) SectorObjects.$(OBJEXT) ogsectorclient_OBJECTS = $(am_ogsectorclient_OBJECTS) ogsectorclient_LDADD = $(LDADD) am_ogsectorserver_OBJECTS = ogsectorserver.$(OBJEXT) common.$(OBJEXT) \ - networkServer.$(OBJEXT) + networkServer.$(OBJEXT) networkServerUser.$(OBJEXT) ogsectorserver_OBJECTS = $(am_ogsectorserver_OBJECTS) ogsectorserver_LDADD = $(LDADD) am_testopenalmanager_OBJECTS = testopenalmanager.$(OBJEXT) \ @@ -93,6 +94,7 @@ AWK = @AWK@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ +CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ @@ -101,9 +103,9 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ +EGREP = @EGREP@ EXEEXT = @EXEEXT@ -GRAPPLE_CFLAGS = @GRAPPLE_CFLAGS@ -GRAPPLE_LIBS = @GRAPPLE_LIBS@ +GREP = @GREP@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -171,8 +173,12 @@ ogsectorclient_SOURCES = \ ogsectorclient.cpp \ common.h \ + LogManager.h \ + LogManager.cpp \ common.cpp \ - network_protocol.h \ + ogconsole.h \ + ogconsole.cpp \ + networkProtocol.h \ Sector.h \ Sector.cpp \ SectorClient.h \ @@ -190,9 +196,11 @@ ogsectorserver.cpp \ common.h \ common.cpp \ - network_protocol.h \ + networkProtocol.h \ networkServer.h \ - networkServer.cpp + networkServer.cpp \ + networkServerUser.h \ + networkServerUser.cpp testopenalmanager_SOURCES = \ testopenalmanager.cpp \ @@ -272,6 +280,7 @@ -rm -f *.tab.c @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)/Sector.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SectorClient.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SectorClientFrameListener.Po@am__quote@ @@ -279,6 +288,8 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/networkClient.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/networkServer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/networkServerUser.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogconsole.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogsectorclient.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogsectorserver.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openALSoundManager.Po@am__quote@ Modified: branches/ogsector/src/Sector.cpp =================================================================== --- branches/ogsector/src/Sector.cpp 2007-04-12 19:53:37 UTC (rev 383) +++ branches/ogsector/src/Sector.cpp 2007-04-13 16:50:52 UTC (rev 384) @@ -2,7 +2,8 @@ namespace OpenGate{ -Sector::Sector( Ogre::SceneManager * sceneMgr, Network * network ) : sceneMgr_( sceneMgr ), network_( network ){ +Sector::Sector( Ogre::SceneManager * sceneMgr, NetworkClient * network, LogManager * log ) + : sceneMgr_( sceneMgr ), network_( network ), log_( log ) { sectorname_ = "Testsector"; avatar_ = NULL; @@ -13,14 +14,13 @@ //** Create a skybox; sceneMgr_->setSkyBox( true, "OpenGate/SimpleSkyBox1", 100 ); -// //** Create a light; - // Ogre::Light * l = sceneMgr_->createLight("MainLight"); + //** Create a light; + Ogre::Light * l = sceneMgr_->createLight("MainLight"); + // Accept default settings: point light, white diffuse, just set position + // NB I could attach the light to a SceneNode if I wanted it to move automatically with + // the avatar, but I don't + l->setPosition( 0, 0, 0 ); -// // Accept default settings: point light, white diffuse, just set position -// // NB I could attach the light to a SceneNode if I wanted it to move automatically with -// // other objects, but I don't -// l->setPosition( 0, 0, 200 ); - new OgreOpcode::CollisionManager( sceneMgr_ ); OgreOpcode::CollisionManager::getSingletonPtr()->addCollClass( "SectorObject" ); OgreOpcode::CollisionManager::getSingletonPtr()->addCollClass( "Bullet" ); @@ -46,6 +46,12 @@ Ogre::Real( 500.0 ), Ogre::Degree( 0.0 ) ); +// createStaticObject( Ogre::String("misc/jumpgate.mesh"), +// "jumpgate", +// Ogre::Vector3( 0, -1000, 0 ), +// Ogre::Real( 10.0 ), +// Ogre::Degree( 0.0 ) ); + // createCircle(); createStaticObject( Ogre::String("ogrehead.mesh"), @@ -80,7 +86,7 @@ int nCollids = report.getNumCollisions(); if ( nCollids > 0 ){ - std::cout << "Collisions: " << nCollids << std::endl; + // std::cout << "Collisions: " << nCollids << std::endl; OgreOpcode::CollisionPair **collisionReport; report.getAllCollisions( collisionReport ); @@ -93,27 +99,27 @@ 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; +// 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; - } + } - bool tmpsegfaultDebug = false; + // bool tmpsegfaultDebug = false; for ( std::map< long, SectorObjectMoveable * >::iterator it = movableObjects_.begin(); it != movableObjects_.end();){ if ( !it->second->update( elapsedTime ) ) { - tmpsegfaultDebug = true; - std::cout << "Destructing: " << it->second->name() << std::endl; + // tmpsegfaultDebug = true; + log_->info( "Destructing: " + it->second->name() ); destructMoveableObject( it->second ); it++; - std::cout << " done." << std::endl; + log_->info( "... done." ); } else ++it; } - if ( tmpsegfaultDebug) { - std::cout << "tmpsegfaultDebug done." << std::endl; - tmpsegfaultDebug = false; - } +// if ( tmpsegfaultDebug) { +// log_->debug( " tmpsegfaultDebug done." ); +// tmpsegfaultDebug = false; +// } if ( avatarDeathSequenceTime_ > 0 ){ avatarDeathSequenceTime_ -= elapsedTime; @@ -196,7 +202,7 @@ obj->setThrustPercent( 70 ); - MessageShipRegister msg( 0, obj->childID(), obj->name(), obj->mainNode()->getPosition(), true ); + MessageBodyShipRegister msg( 0, obj->childID(), obj->name(), obj->mainNode()->getPosition(), true ); network_->send( msg ); } @@ -216,7 +222,7 @@ void Sector::avatarDied( ){ avatarDeathSequenceTime_ = 5.0; avatar_->setVisible( true ); - MessageShipRegister msg( 0, 0, avatar_->name(), avatar_->mainNode()->getPosition(), false ); + MessageBodyShipRegister msg( 0, 0, avatar_->name(), avatar_->mainNode()->getPosition(), false ); network_->send( msg ); listener_->avatarDeathSequence( true ); } @@ -230,7 +236,7 @@ avatar_->setVelocity( Ogre::Vector3( 0.0, 0.0, -20.0 ) ); avatar_->reset(); - MessageShipRegister msg( 0, 0, avatar_->name(), avatar_->mainNode()->getPosition(), true ); + MessageBodyShipRegister msg( 0, 0, avatar_->name(), avatar_->mainNode()->getPosition(), true ); network_->send( msg ); avatar_->setVisible( false ); @@ -300,24 +306,21 @@ object->attachObject( circle ); } -void Sector::receiveVesselRegister( const MessageShipRegister & msg ){ +void Sector::receiveVesselRegister( const MessageBodyShipRegister & msg ){ if ( msg.senderID() != network_->userID() ){ std::map< long , SectorObjectMoveable * >::iterator it; if ( ( it = movableObjects_.find( createGlobalID( msg.senderID(), msg.childID() ) ) ) != movableObjects_.end() ){ if ( msg.status() == false ){ - std::cout << "Deregistering " << msg.name() << " " << std::endl; + log_->info( "Deregistering " + msg.name() ); destructMoveableObject( it->second ); } else { - std::cout << "Object " << msg.name() << " allready registered." << std::endl; + log_->info( "Object " + msg.name() + " allready registered." ); } } else { if ( msg.status() == true ){ - std::cout << "Create object " << msg.name() - << " " << msg.senderID() << " " << (int)msg.childID() - << " " << msg.position() << std::endl; - + log_->info( "Create object " + msg.name()+ " " + toStr( msg.senderID() ) + " " + toStr( (int)msg.childID() ) + " " ); SectorObjectMoveable * obj = createMoveableObject( msg.name(), msg.senderID(), msg.childID() ); obj->mainNode()->setPosition( msg.position() ); sendAllVesselStatus( ); @@ -328,7 +331,7 @@ void Sector::sendAllVesselMovements( ){ if ( avatar_ != NULL ){ - MessageShipMovement msg( 0, + MessageBodyShipMovement msg( 0, avatar_->mainNode()->getPosition(), avatar_->velDirection(), avatar_->mainNode()->getOrientation(), @@ -338,11 +341,11 @@ avatar_->scaledRoll(), avatar_->incNetSequence() ); - network_->send( msg, false ); + network_->send( msg ); } for ( std::map< int, SectorObjectMoveableAi * >::iterator it = localAiObjects_.begin(); it != localAiObjects_.end(); it ++ ){ - MessageShipMovement msgObj( it->second->childID(), + MessageBodyShipMovement msgObj( it->second->childID(), it->second->mainNode()->getPosition(), it->second->velDirection(), it->second->mainNode()->getOrientation(), @@ -352,13 +355,13 @@ it->second->scaledRoll(), it->second->incNetSequence() ); - network_->send( msgObj, false ); + network_->send( msgObj ); } } -void Sector::receiveVesselMovement( const std::vector < MessageShipMovement * > & movements ){ +void Sector::receiveVesselMovement( const std::vector < MessageBodyShipMovement * > & movements ){ - std::map < long, const MessageShipMovement * > singleMsg; + std::map < long, const MessageBodyShipMovement * > singleMsg; //** we sort the movement messaged for ( size_t i = 0; i < movements.size(); i ++ ){ @@ -370,12 +373,13 @@ std::map< long, SectorObjectMoveable * >::iterator it; - for ( std::map < long, const MessageShipMovement * >::iterator i = singleMsg.begin(); i != singleMsg.end(); i++ ){ + for ( std::map < long, const MessageBodyShipMovement * >::iterator i = singleMsg.begin(); i != singleMsg.end(); i++ ){ if ( ( it = movableObjects_.find( i->first ) ) != movableObjects_.end() ){ it->second->setFlightProperties( (*i->second) ); } else { std::cerr << "Requested non existant object for shipmovement: " - << network_->username( i->second->senderID() ) << " this should not happen." << std::endl; + << network_->userName( i->second->senderID() ) << " at: " + << i->second->position() << " this should not happen." << std::endl; } } } @@ -390,7 +394,7 @@ } void Sector::sendVesselStatus( const SectorObjectMoveable & obj ){ - MessageShipStatus msg( obj.childID(), + MessageBodyShipStatus msg( obj.childID(), obj.shieldPercent(), obj.armorPercent(), obj.firePressed(), @@ -399,17 +403,17 @@ network_->send( msg ); } -void Sector::receiveVesselStatus( const MessageShipStatus & msg ){ +void Sector::receiveVesselStatus( const MessageBodyShipStatus & msg ){ if ( msg.senderID() != network_->userID() ){ std::map< long, SectorObjectMoveable * >::iterator it; if ( ( it = movableObjects_.find( createGlobalID( msg.senderID(), msg.childID() ) ) ) != movableObjects_.end() ){ - std::cout << "ReceiveVesselStatus for " << it->second->name( ) << std::endl; + log_->cout( "ReceiveVesselStatus for " + it->second->name( ) ); it->second->setStatus( msg ); } else { - std::cerr << "Requested non existant object for shipstatus: " - << network_->username( msg.senderID() ) << " this should not happen." << std::endl; + log_->fatal( "Requested non existant object for shipstatus: " + + network_->userName( msg.senderID() ) + " this should not happen." ); } } } @@ -418,30 +422,30 @@ if ( projectile.parent().userID() == network_->userID() ){ std::cout << "Send: Projectile from " << projectile.name() << " collide with: " << victim->name() - << " " << victim->userID() << " " << victim->childID() << std::endl; + << " " << victim->userID() << " " << victim->childID() << std::endl; if ( network_->online() ){ - MessageShipAmmoHit msg( projectile.parent().childID(), victim->userID(), victim->childID(), projectile.damage() ); + MessageBodyShipAmmoHit msg( projectile.parent().childID(), victim->userID(), victim->childID(), projectile.damage() ); network_->send( msg ); } + victim->hitByAmmo( projectile.damage() ); } - victim->hitByAmmo( projectile.damage() ); } -void Sector::receiveVesselAmmoHit( const MessageShipAmmoHit & msg ){ +void Sector::receiveVesselAmmoHit( const MessageBodyShipAmmoHit & msg ){ if ( msg.senderID() != network_->userID() ){ std::map< long, SectorObjectMoveable * >::iterator it; if ( ( it = movableObjects_.find( createGlobalID( msg.targetID(), msg.targetChildID() ) ) ) != movableObjects_.end() ){ - std::cout << "ReceiveVesselAmmoHit for " << network_->username( msg.targetID() ) << std::endl; + log_->cout( "ReceiveVesselAmmoHit for " + network_->userName( msg.targetID() ) + " " + toStr( msg.damage() ) ); it->second->hitByAmmo( msg.damage() ); } else { - std::cerr << "Requested non existant object for VesselAmmoHit " - << "shooter: " << network_->username( msg.senderID() ) - << " victim: " << network_->username( msg.targetID() ) - << " child: " << msg.targetChildID() - << " damage: " << msg.damage() << " this should not happen." << std::endl; + log_->fatal( std::string( "Requested non existant object for VesselAmmoHit " ) + + " shooter: " + network_->userName( msg.senderID() ) + + " victim: " + network_->userName( msg.targetID() ) + + " child: " + toStr( msg.targetChildID() ) + + " damage: " + toStr( msg.damage() ) + " this should not happen." ) ; std::cerr << "Available objects: " << std::endl; for ( std::map< long, SectorObjectMoveable * >::iterator i = movableObjects_.begin(); i != movableObjects_.end(); i++){ Modified: branches/ogsector/src/Sector.h =================================================================== --- branches/ogsector/src/Sector.h 2007-04-12 19:53:37 UTC (rev 383) +++ branches/ogsector/src/Sector.h 2007-04-13 16:50:52 UTC (rev 384) @@ -6,6 +6,7 @@ #include "SectorClientFrameListener.h" #include "SectorObjects.h" +#include "LogManager.h" namespace OpenGate{ @@ -13,7 +14,7 @@ public: - Sector( Ogre::SceneManager * sceneMgr, Network * network ); + Sector( Ogre::SceneManager * sceneMgr, NetworkClient * network, LogManager * log ); ~Sector( ); @@ -23,10 +24,12 @@ SectorClientFrameListener * listener( ){ return listener_; } - void setNetwork( Network * network ){ network_ = network; } + void setNetwork( NetworkClient * network ){ network_ = network; } void update( Ogre::Real elapsedTime ); + LogManager * log() { return log_; } + void createStaticObject( const Ogre::String & meshname, const Ogre::String & objectname, const Ogre::Vector3 & pos, Ogre::Real targetSize, Ogre::Degree yaw ); @@ -56,26 +59,29 @@ SectorObject * prevTarget( ); - void receiveVesselRegister( const MessageShipRegister & msg ); + void receiveVesselRegister( const MessageBodyShipRegister & msg ); void sendAllVesselStatus( ); void sendAllVesselMovements( ); - void receiveVesselMovement( const std::vector < MessageShipMovement * > & movements ); + void receiveVesselMovement( const std::vector < MessageBodyShipMovement * > & movements ); void sendVesselStatus( const SectorObjectMoveable & obj ); - void receiveVesselStatus( const MessageShipStatus & msg ); + void receiveVesselStatus( const MessageBodyShipStatus & msg ); void sendVesselAmmoHit( const Projectile & projectile, BaseObject * victim ); - void receiveVesselAmmoHit( const MessageShipAmmoHit & msg ); + void receiveVesselAmmoHit( const MessageBodyShipAmmoHit & msg ); protected: - SectorClientFrameListener * listener_; Ogre::SceneManager * sceneMgr_; + NetworkClient * network_; + LogManager * log_; + SectorClientFrameListener * listener_; + std::string sectorname_; SectorObjectAvatar * avatar_; @@ -90,7 +96,6 @@ float avatarDeathSequenceTime_; - Network * network_; }; } // namespace OpenGate Modified: branches/ogsector/src/SectorClient.cpp =================================================================== --- branches/ogsector/src/SectorClient.cpp 2007-04-12 19:53:37 UTC (rev 383) +++ branches/ogsector/src/SectorClient.cpp 2007-04-13 16:50:52 UTC (rev 384) @@ -3,8 +3,8 @@ namespace OpenGate{ void SectorClient::createScene( ){ - sector_ = new Sector( sceneMgr_, network_ ); - sector_->createAvatar( network_->usernameMe() ); + sector_ = new Sector( sceneMgr_, network_, log_ ); + sector_->createAvatar( network_->userName() ); } void SectorClient::destroyScene( ){ @@ -28,20 +28,33 @@ createViewports(); - //** spom dont what for + //** spom dont know what for // Set default mipmap level (NB some APIs ignore this) // Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5); // Create any resource listeners (for loading screens) // createResourceListener(); - //** spom dont what for + //** spom dont know what for // Create the scene createScene(); - createFrameListener(); + unsigned long hWnd; + window_->getCustomAttribute( "WINDOW", &hWnd ); + inputManager_ = new InputManager( hWnd ); + inputManager_->setWindowExtents( window_->getWidth( ), window_->getHeight( ) ); + //** createFrameListener ** + frameListener_ = new SectorClientFrameListener( window_, camera_, sector_, network_, inputManager_ ); + root_->addFrameListener( frameListener_ ); + + console_ = new OGConsole( root_, inputManager_ ); + root_->addFrameListener( console_ ); + log_->setConsole( console_ ); + +// OgreConsole::getSingleton().addCommand("quit",&CMD_Quit); +// OgreConsole::getSingleton().addCommand("screenshot",&CMD_Screenshot); + sector_->spawnAvatar(); - return true; } @@ -124,8 +137,8 @@ } void SectorClient::createFrameListener( ) { - frameListener_ = new SectorClientFrameListener( window_, camera_, sector_, network_ ); - root_->addFrameListener( frameListener_ ); +// frameListener_ = new SectorClientFrameListener( window_, camera_, sector_, network_ ); +// root_->addFrameListener( frameListener_ ); } } // namespace OpenGate{ Modified: branches/ogsector/src/SectorClient.h =================================================================== --- branches/ogsector/src/SectorClient.h 2007-04-12 19:53:37 UTC (rev 383) +++ branches/ogsector/src/SectorClient.h 2007-04-13 16:50:52 UTC (rev 384) @@ -8,6 +8,8 @@ #include "Sector.h" #include "SectorClientFrameListener.h" #include "networkClient.h" +#include "ogconsole.h" +#include "LogManager.h" #include <list> @@ -15,14 +17,22 @@ class SectorClient { public: - SectorClient( Network * nw ) : network_( nw ) { + SectorClient( NetworkClient * nw, LogManager * log ) + : network_( nw ), log_( log ){ root_ = NULL; + window_ = NULL; + sceneMgr_ = NULL; + camera_ = NULL; + frameListener_ = NULL; - sector_ = NULL; + inputManager_ = NULL; + sector_ = NULL ; + console_ = NULL; } virtual ~SectorClient(){ if ( frameListener_ != NULL ) delete frameListener_; + if ( inputManager_ != NULL ) delete inputManager_; if ( root_ != NULL ) delete root_; } @@ -55,18 +65,19 @@ virtual void destroyScene( ); - Ogre::Root * root_; + NetworkClient * network_; + LogManager * log_; + Ogre::Root * root_; + SectorClientFrameListener * frameListener_; + Sector * sector_; + Ogre::Camera * camera_; - Ogre::SceneManager * sceneMgr_; - Ogre::RenderWindow * window_; + InputManager * inputManager_; - SectorClientFrameListener * frameListener_; - Sector * sector_; - - Network * network_; + OGConsole * console_; }; } // namespace OpenGate Modified: branches/ogsector/src/SectorClientFrameListener.cpp =================================================================== --- branches/ogsector/src/SectorClientFrameListener.cpp 2007-04-12 19:53:37 UTC (rev 383) +++ branches/ogsector/src/SectorClientFrameListener.cpp 2007-04-13 16:50:52 UTC (rev 384) @@ -1,6 +1,7 @@ #include "SectorClientFrameListener.h" #include "SectorClient.h" #include "networkProtocol.h" +#include "InputManager.h" #include <iostream> #include <OgreTextAreaOverlayElement.h> @@ -9,16 +10,17 @@ namespace OpenGate{ SectorClientFrameListener::SectorClientFrameListener( Ogre::RenderWindow * win, Ogre::Camera * cam, - Sector * sector, Network * nw, - bool useBufferedInputKeys, - bool useBufferedInputMouse ) - : window_( win ), camera_( cam ), sector_( sector ), network_( nw ){ + Sector * sector, NetworkClient * nw, + InputManager * input ) + : window_( win ), camera_( cam ), sector_( sector ), network_( nw ), inputManager_( input ){ shutDownRequest_ = false; deathSequence_ = false; sceneDetailIndex_ = 0; target_ = NULL; cameraMode_ = 1; + consoleMode_ = false; + chatMode_ = false; sector_->setListener( this ); @@ -27,12 +29,6 @@ windowsHalfWidth_ = (int)(windowsWidth_ * 0.5); windowsHalfHeight_ = (int)(windowsHeight_ * 0.5); - unsigned long hWnd; - window_->getCustomAttribute( "WINDOW", &hWnd ); - - inputManager_ = new InputManager( hWnd ); - inputManager_->setWindowExtents( windowsWidth_, windowsHeight_ ); - inputManager_->addKeyListener( this, "SectorClientKeyListener" ); inputManager_->addMouseListener( this, "SectorClientMouseListener" ); inputManager_->addJoystickListener( this, "SectorClientJoystickListener" ); @@ -43,14 +39,15 @@ lastInputWheelState_ = 0; hudOverlay_ = Ogre::OverlayManager::getSingleton().getByName("OpenGate/SimpleHUD"); + Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDChatInPanel")->hide( ); Ogre::OverlayElement* hudCenter = Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/CenterPointer"); hudCenter->setTop( windowsHalfHeight_ - 16 ); hudCenter->setLeft( windowsHalfWidth_ - 16 ); - hudTarget_ = new Ogre::SceneNode( NULL, "Target" ); - hudTarget_->setPosition( -2.5, -1.9, -6.0 ); - hudOverlay_->add3D( hudTarget_ ); +// hudTarget_ = new Ogre::SceneNode( NULL, "Target" ); +// hudTarget_->setPosition( -2.5, -1.9, -6.0 ); +// hudOverlay_->add3D( hudTarget_ ); hudOverlay_->show( ); @@ -59,9 +56,9 @@ mousePointer_->setTop( windowsHalfWidth_ ); mousePointer_->setLeft( windowsHalfHeight_ ); mouseOverlay_->show(); - chatMode_ = false; + // cameraRotateSpeed_ = 36; // cameraRotateScale_ = 0.0f; // cameraMoveSpeed_ = 100; @@ -107,12 +104,8 @@ inputManager_->removeKeyListener( "SectorClientKeyListener" ); inputManager_->removeMouseListener( "SectorClientMouseListener" ); inputManager_->removeJoystickListener( "SectorClientJoystickListener" ); - - //** neccesary because of new operator in inputmanager; - if ( inputManager_ != NULL ) delete inputManager_; } - bool SectorClientFrameListener::frameStarted( const Ogre::FrameEvent & evt ) { if ( window_->isClosed() ) return false; timeSinceLastSectorUpdate_ += evt.timeSinceLastFrame; @@ -125,20 +118,16 @@ } //** start capture network; - std::vector < std::vector < Uint8 > > msgs; - std::vector < MessageShipMovement * > movements; + std::vector < std::vector < char > > msgs; + std::vector < MessageBodyShipMovement * > movements; network_->pull( msgs ); for ( size_t i = 0; i < msgs.size(); i ++ ){ switch ( msgs[ i ][ 0 ] ){ case PROTO_CHAT:{ network_->ping(); - - MessageChat msg( &msgs[ i ][ 0 ] ); - std::cout << network_->username( msg.senderID() ) + ": " + msg.message() << std::endl; - - Ogre::OverlayElement* hudChatIn = Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextChatIn"); - hudChatIn->setCaption( network_->username( msg.senderID() ) + ": " + msg.message() ); + MessageBodyChat msg( &msgs[ i ][ 0 ] ); + sector_->log()->chat( network_->userName( msg.senderID() ), msg.message() ); } break; case PROTO_SHIPREGISTER: sector_->receiveVesselRegister( &msgs[ i ][ 0 ] ); break; @@ -146,7 +135,7 @@ sector_->receiveVesselStatus( &msgs[ i ][ 0 ] ); break; case PROTO_SHIPMOVEMENT:{ //** we handle that in sum, so we can ignore dups because of packet loss - MessageShipMovement msg( &msgs[ i ][ 0 ] ); + MessageBodyShipMovement msg( &msgs[ i ][ 0 ] ); movements.push_back( &msg ); } break; case PROTO_SHIPAMMOHIT: @@ -156,7 +145,7 @@ break; } } - if ( movements.size() > 0 ) sector_->receiveVesselMovement( movements ); + if ( movements.size() > 0 ) sector_->receiveVesselMovement( movements ); //** end capture network; @@ -186,46 +175,53 @@ } bool SectorClientFrameListener::keyPressed( const OIS::KeyEvent & e ){ + // std::cout << "SectorClientFrameListener: " << e.key << " " << (char)e.key<< std::endl; //** ESCAPE leads to shutdown; if ( e.key == OIS::KC_ESCAPE) { shutDownRequest_ = true; } + if ( e.key == OIS::KC_F1 ){ + consoleMode_ = !consoleMode_; + } + if( consoleMode_ ) return true; + if ( !chatMode_ ){ if ( e.key == OIS::KC_RETURN) { + Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDChatInPanel")->show( ); chatMode_ = true; } - + if ( sector_->avatar() != NULL ){ //** Avatar yaw LEFT; if ( e.key == OIS::KC_A || e.key == OIS::KC_NUMPAD4 ) { sector_->avatar()->setScaledYaw( 1.0 ); } - + //** Avatar yaw RIGHT; if ( e.key == OIS::KC_D || e.key == OIS::KC_NUMPAD6 ) { sector_->avatar()->setScaledYaw( -1.0 ); } - + //** Avatar pitch DOWN; if ( e.key == OIS::KC_W || e.key == OIS::KC_NUMPAD8 ) { sector_->avatar()->setScaledPitch( -1.0 ); } - + //** Avatar pitch UP; if ( e.key == OIS::KC_S || e.key == OIS::KC_NUMPAD2 ) { sector_->avatar()->setScaledPitch( 1.0 ); } - + //** Avatar roll (181 == NUM/); if ( e.key == OIS::KC_NUMPAD0 || e.key == 181 ) { sector_->avatar()->setScaledRoll( 1.0 ); } - + //** Avatar roll (55 == NUM*); if ( e.key == OIS::KC_NUMPADCOMMA || e.key == 55 ) { sector_->avatar()->setScaledRoll( -1.0 ); } - + //** Avatar increase thrust by 10%; if ( e.key == OIS::KC_NUMPAD7 ) { sector_->avatar()->incrementThrust(); } - + //** Avatar increase thrust by 10%; if ( e.key == OIS::KC_NUMPAD1 ) { sector_->avatar()->decrementThrust(); } - + //** Avatar press break; if ( e.key == OIS::KC_NUMPAD3 ) { sector_->avatar()->setBreakPressed( true ); } - + //** Avatar press afterburner; if ( e.key == OIS::KC_NUMPAD9 ) { sector_->avatar()->setAfterburnerPressed( true ); } - + //** Avatar centering; if ( e.key == OIS::KC_NUMPAD5 ) { sector_->avatar()->setScaledYaw( 0.0 ); @@ -235,19 +231,19 @@ //** selfdestruct and eject; if ( e.key == OIS::KC_F11 ) { sector_->avatarDied(); } } // if avatar; - - //** next Target; + + //** next Target; if ( e.key == OIS::KC_N ) { setTarget( sector_->nextTarget() ); } - + //** prev Target; if ( e.key == OIS::KC_P ) { setTarget( sector_->prevTarget() ); } - + //** spawn; if ( e.key == OIS::KC_F12 ) { sector_->spawnAiObject(); } - + //** Toggle through camera modes; if ( e.key == OIS::KC_6 ) { toggleNextCamera_(); } - + //** Create one screenshot; if ( e.key == OIS::KC_SYSRQ ) { char tmp[ 20 ]; @@ -263,25 +259,31 @@ case 2: camera_->setPolygonMode( Ogre::PM_POINTS ); break; } } - + } else { // ** chatmode if ( e.key != OIS::KC_BACK ) { - chatString_ += e.text; + if ( (int)e.text < 255 && (int)e.text > 0 ) { + chatString_ += e.text; + } else { + std::cout << (char)e.text << " " << e.text << std::endl; + } } else if ( chatString_.length() > 1 ) { chatString_ = chatString_.substr( 0, chatString_.length() - 1 ); } - Ogre::OverlayElement* hudChatIn = Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextChatOut"); - hudChatIn->setCaption( chatString_ ); + Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDChatInTextField")->setCaption( chatString_ ); + // hudChatIn->setCaption( Ogre::UTFString(chatString_.c_str()).asUTF32() ); + // hudChatIn->setCaption( Ogre::UTFString( chatString_ ).asUTF32_c_str() ); + if ( e.key == OIS::KC_RETURN) { - - MessageChat chat( chatString_ ); + + MessageBodyChat chat( chatString_ ); network_->send( chat ); - + chatString_.clear(); - Ogre::OverlayElement* hudChatIn = Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextChatOut"); - hudChatIn->setCaption( chatString_ ); + Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDChatInTextField")->setCaption( chatString_ ); + Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDChatInPanel")->hide( ); chatMode_ = false; } } @@ -317,7 +319,7 @@ // Avatar release afterburner if ( e.key == OIS::KC_NUMPAD9 ) { sector_->avatar()->setAfterburnerPressed( false ); } } - return true; + return true; } bool SectorClientFrameListener::mouseMoved( const OIS::MouseEvent & e ){ @@ -382,7 +384,7 @@ } else if( lastInputWheelState_ > e.state.Z.abs+10 ) { // mouse wheel down setTarget( sector_->prevTarget() ); lastInputWheelState_ = e.state.Z.abs; - } + } return true; } @@ -392,7 +394,7 @@ if ( button == 0){ sector_->avatar()->setFirePressed( true ); } - } + } return true; } @@ -402,7 +404,7 @@ if ( button == 0){ sector_->avatar()->setFirePressed( false); } - } + } return true; } @@ -452,7 +454,7 @@ sector_->avatar()->setScaledPitch( pitch ); sector_->avatar()->setScaledRoll( -roll ); sector_->avatar()->setThrustPercent( thrust * 100. ); - } // if avatar + } // if avatar return true; } @@ -463,7 +465,7 @@ if ( button == 0){ sector_->avatar()->setFirePressed( true ); } - } // if avatar_ + } // if avatar_ return true; } @@ -564,11 +566,9 @@ target_ = target; if ( target_ != NULL ){ - std::cout << target_->name()<< std::endl; + // std::cout << target_->name()<< std::endl; + Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextTargetName")->setCaption( target_->name() ); - Ogre::OverlayElement* targetName = Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextTargetName"); - targetName->setCaption( target_->name() ); - // if ( hudTarget_->numChildren() > 0 ){ // hudTarget_->removeAllChildren( );// hudTarget_->getChild( "TargetTrans" ) ); // camera_->getSceneManager()->destroyEntity( "TargetShape" ); @@ -611,7 +611,6 @@ sector_->avatar()->targetArrow()->setDirection( distToTarget.normalisedCopy(), Ogre::Node::TS_WORLD ); - hudTarget_->setOrientation( target_->mainNode()->getOrientation() ); // Ogre::Vector3 targetPos; // Ogre::Quaternion targetOrient; targetOri = target_->mainNode().getOrientation(); Modified: branches/ogsector/src/SectorClientFrameListener.h =================================================================== --- branches/ogsector/src/SectorClientFrameListener.h 2007-04-12 19:53:37 UTC (rev 383) +++ branches/ogsector/src/SectorClientFrameListener.h 2007-04-13 16:50:52 UTC (rev 384) @@ -21,9 +21,8 @@ public OIS::JoyStickListener { public: - SectorClientFrameListener( Ogre::RenderWindow * win, Ogre::Camera * cam, Sector * sector, Network * nw, - bool useBufferedInputKeys = false, - bool useBufferedInputMouse = false ); + SectorClientFrameListener( Ogre::RenderWindow * win, Ogre::Camera * cam, Sector * sector, + NetworkClient * nw, InputManager * input ); virtual ~SectorClientFrameListener( ); @@ -58,10 +57,9 @@ Ogre::RenderWindow * window_; Ogre::Camera * camera_; Sector * sector_; - Network * network_; + NetworkClient * network_; + InputManager * inputManager_; - InputManager * inputManager_; - Ogre::Overlay * hudOverlay_; Ogre::Overlay * mouseOverlay_; Ogre::OverlayElement * mousePointer_; @@ -92,8 +90,9 @@ int windowsHalfWidth_; int windowsHalfHeight_; - bool chatMode_; std::string chatString_; + bool chatMode_; + bool consoleMode_; int sceneDetailIndex_ ; Modified: branches/ogsector/src/SectorObjects.cpp =================================================================== --- branches/ogsector/src/SectorObjects.cpp 2007-04-12 19:53:37 UTC (rev 383) +++ branches/ogsector/src/SectorObjects.cpp 2007-04-13 16:50:52 UTC (rev 384) @@ -14,7 +14,6 @@ } BaseObject::~BaseObject(){ - sceneMgr_->getRootSceneNode()->removeAndDestroyChild( mainNode_->getName() ); } @@ -110,7 +109,7 @@ //** show us a small visible feedback bbs_->getBillboard( 0 )->setColour( Ogre::ColourValue(0.0, 1.0, 0.0) ); - bbs_->getBillboard( 0 )->setDimensions( 10, 10 ); + bbs_->getBillboard( 0 )->setDimensions( 5, 5 ); lifeTime_ = max( lifeTime_, maxLiveTime_ - 0.1f ); // sector_->collisionContext()->removeObject( collObj_ ); @@ -224,10 +223,14 @@ mainNode_->detachObject( thrusterParticles_ ); sceneMgr_->destroyParticleSystem( thrusterParticles_ ); + for ( std::set < Projectile * >::iterator it = projectiles_.begin(); it != projectiles_.end(); ){ + delete *it; + projectiles_.erase( it++ ); + } // Projectile globalisieren. } -void SectorObjectMoveable::setFlightProperties( const MessageShipMovement & msg ){ +void SectorObjectMoveable::setFlightProperties( const MessageBodyShipMovement & msg ){ if ( forceMovement_ ){ mainNode_->setPosition( msg.position() ); @@ -320,7 +323,7 @@ lastLifeTime_ = lifeTime_; } -void SectorObjectMoveable::setStatus( const MessageShipStatus & msg ){ +void SectorObjectMoveable::setStatus( const MessageBodyShipStatus & msg ){ setFirePressed( msg.firePressed() ); setAfterburnerPressed( msg.afterburnerPressed() ); setBreakPressed( msg.breakPressed() ); Modified: branches/ogsector/src/SectorObjects.h =================================================================== --- branches/ogsector/src/SectorObjects.h 2007-04-12 19:53:37 UTC (rev 383) +++ branches/ogsector/src/SectorObjects.h 2007-04-13 16:50:52 UTC (rev 384) @@ -132,9 +132,9 @@ inline virtual long getTypeID() const { return SECTOROBJECTMOVABLE_RTTI; } - void setFlightProperties( const MessageShipMovement & msg ); + void setFlightProperties( const MessageBodyShipMovement & msg ); - void setStatus( const MessageShipStatus & msg ); + void setStatus( const MessageBodyShipStatus & msg ); virtual void collide( BaseObject * object ); Modified: branches/ogsector/src/common.cpp =================================================================== --- branches/ogsector/src/common.cpp 2007-04-12 19:53:37 UTC (rev 383) +++ branches/ogsector/src/common.cpp 2007-04-13 16:50:52 UTC (rev 384) @@ -22,3 +22,11 @@ #include "common.h" long createGlobalID( int userId, int childId ) { return childId * MAXUSERID + userId; } + +void myMSleep( int s ){ +#ifdef WIN32 + Sleep( s ); +#else + usleep( s * 1000 ); +#endif +} Modified: branches/ogsec... [truncated message content] |
From: <spo...@us...> - 2007-04-14 18:04:37
|
Revision: 388 http://svn.sourceforge.net/opengate/?rev=388&view=rev Author: spom_spom Date: 2007-04-14 11:04:36 -0700 (Sat, 14 Apr 2007) Log Message: ----------- Fixed some client and server issues. Modified Paths: -------------- branches/ogsector/data/Console.png branches/ogsector/data/simpleHUD.fontdef branches/ogsector/src/Sector.cpp branches/ogsector/src/SectorClientFrameListener.cpp branches/ogsector/src/SectorClientFrameListener.h branches/ogsector/src/SectorObjects.cpp branches/ogsector/src/SectorObjects.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/ogconsole.cpp branches/ogsector/src/ogsectorclient.cpp branches/ogsector/src/ogsectorserver.cpp Modified: branches/ogsector/data/Console.png =================================================================== (Binary files differ) Modified: branches/ogsector/data/simpleHUD.fontdef =================================================================== --- branches/ogsector/data/simpleHUD.fontdef 2007-04-14 00:25:52 UTC (rev 387) +++ branches/ogsector/data/simpleHUD.fontdef 2007-04-14 18:04:36 UTC (rev 388) @@ -4,6 +4,7 @@ source bluehigh.ttf size 32 resolution 55 + code_points 33-255 } @@ -13,5 +14,6 @@ source bluehigh.ttf size 32 resolution 55 + code_points 33-255 } Modified: branches/ogsector/src/Sector.cpp =================================================================== --- branches/ogsector/src/Sector.cpp 2007-04-14 00:25:52 UTC (rev 387) +++ branches/ogsector/src/Sector.cpp 2007-04-14 18:04:36 UTC (rev 388) @@ -46,6 +46,12 @@ Ogre::Real( 500.0 ), Ogre::Degree( 0.0 ) ); +// createStaticObject( Ogre::String("tmp/astro1.mesh"), +// "tmp", +// Ogre::Vector3( -300, 300, 0 ), +// Ogre::Real( 100.0 ), +// Ogre::Degree( 0.0 ) ); + // createStaticObject( Ogre::String("misc/jumpgate.mesh"), // "jumpgate", // Ogre::Vector3( 0, -1000, 0 ), @@ -184,7 +190,7 @@ void Sector::spawnAiObject( ){ int childID = 1; - while ( localAiObjects_.find( childID ) != localAiObjects_.end() ){ childID ++; } + while ( localAiObjects_.count( childID ) ){ childID ++; } SectorObjectMoveableAi *obj = createAiMoveableObject( avatar_->name() + "_Spawn" + Ogre::StringConverter::toString( childID ), childID ); @@ -309,12 +315,12 @@ void Sector::receiveVesselRegister( const MessageBodyShipRegister & msg ){ if ( msg.senderID() != network_->userID() ){ - std::map< long , SectorObjectMoveable * >::iterator it; + // std::map< long , SectorObjectMoveable * >::iterator it; - if ( ( it = movableObjects_.find( createGlobalID( msg.senderID(), msg.childID() ) ) ) != movableObjects_.end() ){ + if ( movableObjects_.count( createGlobalID( msg.senderID(), msg.childID() ) ) ){ if ( msg.status() == false ){ log_->info( "Deregistering " + msg.name() ); - destructMoveableObject( it->second ); + destructMoveableObject( movableObjects_[ createGlobalID( msg.senderID(), msg.childID() ) ] ); } else { log_->info( "Object " + msg.name() + " allready registered." ); } Modified: branches/ogsector/src/SectorClientFrameListener.cpp =================================================================== --- branches/ogsector/src/SectorClientFrameListener.cpp 2007-04-14 00:25:52 UTC (rev 387) +++ branches/ogsector/src/SectorClientFrameListener.cpp 2007-04-14 18:04:36 UTC (rev 388) @@ -9,6 +9,25 @@ namespace OpenGate{ +// inline std::string encode_utf8( std::string & ansi ){ +// size_t ansi_len = ansi.length(); +// int len = MultiByteToWideChar( Ogre::CP_ACP, 0, ansi.c_str(), ansi_len, NULL, 0 ); + +// if (ansi_len > 0 && len > 0) { +// WCHAR *utf16 = new WCHAR[len]; + +// MultiByteToWideChar(CP_ACP, 0, ansi.c_str(), ansi_len, (LPWSTR)utf16, len); +// ansi_len = WideCharToMultiByte(CP_UTF8, 0, (LPWSTR)utf16, len, NULL, 0, NULL, NULL); + +// std::string unicode(ansi_len, 0); + +// WideCharToMultiByte(CP_UTF8, 0, (LPWSTR)utf16, len, (LPSTR)unicode.c_str(), ansi_len, NULL, NULL); +// delete[] utf16; +// return unicode; +// } +// return ""; +// } + SectorClientFrameListener::SectorClientFrameListener( Ogre::RenderWindow * win, Ogre::Camera * cam, Sector * sector, NetworkClient * nw, InputManager * input ) @@ -35,8 +54,6 @@ timeSinceLastSectorUpdate_ = 0.0; timeSinceLastNetworkUpdate_ = 0.0; - inputInitialState_ = true; - lastInputWheelState_ = 0; hudOverlay_ = Ogre::OverlayManager::getSingleton().getByName("OpenGate/SimpleHUD"); Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDChatInPanel")->hide( ); @@ -51,14 +68,13 @@ hudOverlay_->show( ); - mouseOverlay_ = Ogre::OverlayManager::getSingleton().getByName( "Overlay/MousePointer" ); + Ogre::OverlayManager::getSingleton().getByName( "Overlay/MousePointer" )->show(); + mousePointer_ = Ogre::OverlayManager::getSingleton().getOverlayElement( "MousePointer/Pointer" ); - mousePointer_->setTop( windowsHalfWidth_ ); - mousePointer_->setLeft( windowsHalfHeight_ ); - mouseOverlay_->show(); + mousePointer_->setTop( windowsHalfHeight_ - 16 ); + mousePointer_->setLeft( windowsHalfWidth_ - 16 ); - // cameraRotateSpeed_ = 36; // cameraRotateScale_ = 0.0f; // cameraMoveSpeed_ = 100; @@ -262,18 +278,19 @@ } else { // ** chatmode if ( e.key != OIS::KC_BACK ) { - if ( (int)e.text < 255 && (int)e.text > 0 ) { + if ( (int)e.text > 32 && (int)e.text < 167 ) { chatString_ += e.text; } else { - std::cout << (char)e.text << " " << e.text << std::endl; + std::cout << (char)e.text << " " << e.text << std::endl; } } else if ( chatString_.length() > 1 ) { chatString_ = chatString_.substr( 0, chatString_.length() - 1 ); } - Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDChatInTextField")->setCaption( chatString_ ); + Ogre::OverlayElement *hudChatIn = Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDChatInTextField"); +// hudChatIn->setCaption( chatString_ ); - // hudChatIn->setCaption( Ogre::UTFString(chatString_.c_str()).asUTF32() ); + hudChatIn->setCaption( Ogre::UTFString( chatString_ ) ); // hudChatIn->setCaption( Ogre::UTFString( chatString_ ).asUTF32_c_str() ); if ( e.key == OIS::KC_RETURN) { @@ -323,16 +340,24 @@ } bool SectorClientFrameListener::mouseMoved( const OIS::MouseEvent & e ){ - mousePointer_->setLeft( e.state.X.abs - 16); - mousePointer_->setTop( e.state.Y.abs - 16); + mousePointer_->setLeft( mousePointer_->getLeft( ) + e.state.X.rel ); + mousePointer_->setTop( mousePointer_->getTop( ) + e.state.Y.rel ); + if ( mousePointer_->getLeft( ) < -16 ) mousePointer_->setLeft( -16 ); + if ( mousePointer_->getTop( ) < -16 ) mousePointer_->setTop( -16 ); + + if ( mousePointer_->getLeft( ) > windowsWidth_-16 ) mousePointer_->setLeft( windowsWidth_-16 ); + if ( mousePointer_->getTop( ) > windowsHeight_-16 ) mousePointer_->setTop( windowsHeight_-16 ); + if ( sector_->avatar() != NULL ){ - // std::cout << "X" << e.state.X.abs << " " << e.state.X.rel<< std::endl; - // std::cout << "Y" << e.state.Y.abs << " " << e.state.Y.rel<< std::endl; - // std::cout << "Z" << e.state.Z.abs << " " << e.state.Z.rel<< std::endl; +// 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; +// return true; - int relativToMidPointX = (int)rint( e.state.X.abs - windowsHalfWidth_ ); - int relativToMidPointY = (int)rint( e.state.Y.abs - windowsHalfHeight_ ); + int relativToMidPointX = (int)rint( (mousePointer_->getLeft( ) +16) - windowsHalfWidth_ ); + int relativToMidPointY = (int)rint( (mousePointer_->getTop( ) +16) - windowsHalfHeight_ ); + int minActiveZonePercent = 5; int maxActiveZonePercent = 90; @@ -354,37 +379,28 @@ if ( fabs( relativToMidPointX ) < minRadius ) yaw = 0.0; if ( fabs( relativToMidPointY ) < minRadius ) pitch = 0.0; - if ( inputInitialState_ == true ){ - if ( yaw == 0.0 && pitch == 0.0 ){ - inputInitialState_ = false; - } - } else{ - - yaw = min( yaw, 1.0f ); yaw = max( yaw, -1.0f ); - pitch = min( pitch, 1.0f ); pitch = max( pitch, -1.0f ); - - // std::cout << ( String("Mouse rel: ") + StringConverter::toString( e.state.X.rel ) + - // String(" ") + StringConverter::toString( e.state.Y.rel ) + - // String(" abs: ") + StringConverter::toString( e.state.X.abs ) + - // String(" ") + StringConverter::toString( e.state.Y.abs ) + - // String(" relMid: ") + StringConverter::toString( relativToMidPointX ) + - // String(" ") + StringConverter::toString( relativToMidPointY ) + - // String(" yaw: ") + StringConverter::toString( yaw ) + - // String(" pitch ") + StringConverter::toString( pitch ) ) << std::endl; - - sector_->avatar()->setScaledYaw( -yaw ); - sector_->avatar()->setScaledPitch( -pitch ); - } + yaw = min( yaw, 1.0f ); yaw = max( yaw, -1.0f ); + pitch = min( pitch, 1.0f ); pitch = max( pitch, -1.0f ); + + // std::cout << ( String("Mouse rel: ") + StringConverter::toString( e.state.X.rel ) + + // String(" ") + StringConverter::toString( e.state.Y.rel ) + + // String(" abs: ") + StringConverter::toString( e.state.X.abs ) + + // String(" ") + StringConverter::toString( e.state.Y.abs ) + + // String(" relMid: ") + StringConverter::toString( relativToMidPointX ) + + // String(" ") + StringConverter::toString( relativToMidPointY ) + + // String(" yaw: ") + StringConverter::toString( yaw ) + + // String(" pitch ") + StringConverter::toString( pitch ) ) << std::endl; + + sector_->avatar()->setScaledYaw( -yaw ); + sector_->avatar()->setScaledPitch( -pitch ); } // if avatar; - if ( e.state.Z.abs-10 > lastInputWheelState_ ){ // mouse wheel up + if ( e.state.Z.rel < -10 ){ // mouse wheel up setTarget( sector_->nextTarget() ); - lastInputWheelState_ = e.state.Z.abs; - - } else if( lastInputWheelState_ > e.state.Z.abs+10 ) { // mouse wheel down + } else if ( e.state.Z.rel > 10 ) { setTarget( sector_->prevTarget() ); - lastInputWheelState_ = e.state.Z.abs; } + return true; } Modified: branches/ogsector/src/SectorClientFrameListener.h =================================================================== --- branches/ogsector/src/SectorClientFrameListener.h 2007-04-14 00:25:52 UTC (rev 387) +++ branches/ogsector/src/SectorClientFrameListener.h 2007-04-14 18:04:36 UTC (rev 388) @@ -61,9 +61,8 @@ InputManager * inputManager_; Ogre::Overlay * hudOverlay_; - Ogre::Overlay * mouseOverlay_; Ogre::OverlayElement * mousePointer_; - Ogre::SceneNode * hudTarget_; + // Ogre::SceneNode * hudTarget_; Ogre::SceneNode * targetPointer_; SectorObject * target_; Ogre::Billboard *targetPointerBB_; @@ -73,8 +72,6 @@ bool deathSequence_; double timeSinceLastSectorUpdate_; double timeSinceLastNetworkUpdate_; - bool inputInitialState_; - int lastInputWheelState_; int cameraMode_; double cameraMoveScale_; Modified: branches/ogsector/src/SectorObjects.cpp =================================================================== --- branches/ogsector/src/SectorObjects.cpp 2007-04-14 00:25:52 UTC (rev 387) +++ branches/ogsector/src/SectorObjects.cpp 2007-04-14 18:04:36 UTC (rev 388) @@ -314,7 +314,9 @@ // roll_ += scaledRoll; // mainNode_->translate( ( destP- srcP ) / 5.0 ); - interpolateVel_ = ( destP-srcP ) / lastFrameCount_ / 1.0; + if ( lastFrameCount_ > 0 ){ + interpolateVel_ = ( destP-srcP ) / lastFrameCount_ / 1.0; + } if ( ( srcP - destP ).length() > 100 ) forceMovement_ = true; } @@ -397,7 +399,11 @@ Ogre::Vector3 flightDir( vel_ ); flightDir.normalise(); //** thrust = mass * acc; - acc_ = ( - trustDir * thrust() - flightDir * friction ) / mass_; + if ( mass_ > 0 ){ + acc_ = ( - trustDir * thrust() - flightDir * friction ) / mass_; + } else { + std::cerr << "mass: " << mass_ << std::endl; + } if ( breakPressed_ == true ) { if ( velocity() > 0 ) { @@ -556,7 +562,7 @@ } bool SectorObjectMoveableAi::update( Ogre::Real elapsedTime ){ - if ( target_ != NULL ) { + if ( target_ != NULL && elapsedTime > 1e-4 ) { Ogre::Vector3 src = mainNode_->getWorldOrientation() * Ogre::Vector3::NEGATIVE_UNIT_Z; src.normalise(); Modified: branches/ogsector/src/SectorObjects.h =================================================================== --- branches/ogsector/src/SectorObjects.h 2007-04-14 00:25:52 UTC (rev 387) +++ branches/ogsector/src/SectorObjects.h 2007-04-14 18:04:36 UTC (rev 388) @@ -151,7 +151,7 @@ inline Ogre::Real scaledRoll() const { return roll_; } inline void setScaledRoll( float rotZScale ){ roll_ = rotZScale; } - Ogre::Real rotFriction(){ return 0.4 + (0.6 * (100.0-percentageThrust_ )/ 100.0 ); } + Ogre::Real rotFriction(){ return 0.4 + ( 0.6 * ( 100.0 - percentageThrust_ )/ 100.0 ); } inline Ogre::Real thrustPercent() const { return 100.0 * thrust() / maxThrust(); } inline void setThrustPercent( Ogre::Real thrust ) { Modified: branches/ogsector/src/networkClient.cpp =================================================================== --- branches/ogsector/src/networkClient.cpp 2007-04-14 00:25:52 UTC (rev 387) +++ branches/ogsector/src/networkClient.cpp 2007-04-14 18:04:36 UTC (rev 388) @@ -48,6 +48,7 @@ } void NetworkClient::login( const std::string & userName, const std::string & passwd ) { + userName_ = userName; if ( online_ ){ MessageBodyUserName msg( userName ); send( msg ); @@ -68,12 +69,12 @@ } } -std::string NetworkClient::userName( int userID ) const { +std::string NetworkClient::userName( int userID ) { if ( userID == 0 ) userID = userID_; - std::map < int, std::string >::const_iterator it; - if ( ( it = users_.find( userID ) ) != users_.end() ){ - return it->second; + if ( users_.count( userID ) ){ + std::string str( users_[ userID ] ); + return str; } else { return "unknown user: " + toStr( userID ) ; } @@ -139,6 +140,18 @@ std::cout << "New user = " << (int)msg.senderID() << " " << msg.userName() << std::endl; users_[ (int)msg.senderID() ] = msg.userName(); } break; + case PROTO_CONNECTION_REFUSED: { + MessageBodyConnectionRefused msg( readMsg_.body() ); + switch ( msg.reason() ){ + case CONNECTION_REFUSED_USER_ALREADY_EXIST: + std::cerr << "Connection refused: " << userName_ << " already conneced to the server" << std::endl; + doClose(); + online_ = false; + break; + default: + std::cerr << "Connection refused for unknown reason:" << msg.reason() << std::endl; + } + } break; case PROTO_DISCONNECT: { MessageBodyDisconnect msg( readMsg_.body() ); std::cout << "Disconnect user = " << (int)msg.userID() << " " << userName( (int)msg.userID() ) << std::endl; @@ -168,7 +181,7 @@ bool write_in_progress = !msgsToWrite_.empty(); msgsToWrite_.push_back( Message( body ) ); // std::cout << "send.length() = " << msgsToWrite_.front().length() << std::endl; - if ( !write_in_progress ) { + if ( !write_in_progress && online_ ) { asio::async_write( socket_, asio::buffer( msgsToWrite_.front().data(), msgsToWrite_.front().length() ), boost::bind( & NetworkClient::handleWrite, this, asio::placeholders::error ) ); @@ -180,7 +193,7 @@ if ( online_ ){ if ( !error ){ msgsToWrite_.pop_front(); - if ( !msgsToWrite_.empty() ) { + if ( !msgsToWrite_.empty() && online_ ) { asio::async_write(socket_, asio::buffer( msgsToWrite_.front().data(), msgsToWrite_.front().length() ), boost::bind( &NetworkClient::handleWrite, this, asio::placeholders::error ) ); @@ -196,6 +209,7 @@ if ( online_ ){ std::cout << "User disconnected." << std::endl; socket_.close(); + pingTime_ = -1; online_ = false; } } Modified: branches/ogsector/src/networkClient.h =================================================================== --- branches/ogsector/src/networkClient.h 2007-04-14 00:25:52 UTC (rev 387) +++ branches/ogsector/src/networkClient.h 2007-04-14 18:04:36 UTC (rev 388) @@ -26,7 +26,7 @@ Uint32 userID() const { return userID_; } - std::string userName( int userID = 0 ) const; + std::string userName( int userID = 0 ); bool online() const { return online_; } @@ -73,6 +73,7 @@ std::deque< std::vector< char > > msgsToPull_; + std::string userName_; std::map < int, std::string > users_; Uint32 userID_; float pingTime_; Modified: branches/ogsector/src/networkProtocol.h =================================================================== --- branches/ogsector/src/networkProtocol.h 2007-04-14 00:25:52 UTC (rev 387) +++ branches/ogsector/src/networkProtocol.h 2007-04-14 18:04:36 UTC (rev 388) @@ -38,7 +38,8 @@ #define PROTO_USERNAME 3 #define PROTO_LOGIN 4 #define PROTO_DISCONNECT 5 -#define PROTO_CHAT 6 +#define PROTO_CONNECTION_REFUSED 6 +#define PROTO_CHAT 7 #define PROTO_SHIPBASE 10 #define PROTO_SHIPREGISTER 11 #define PROTO_SHIPSTATUS 12 @@ -46,6 +47,8 @@ #define PROTO_SHIPAMMOHIT 14 #define PROTO_TEST 255 +#define CONNECTION_REFUSED_USER_ALREADY_EXIST 1 + typedef unsigned char Uint8; typedef unsigned short Uint16; typedef int Uint32; @@ -176,6 +179,30 @@ std::string username_; }; +class MessageBodyConnectionRefused : public MessageBodyBase{ +public: + MessageBodyConnectionRefused( Uint8 reason ) : MessageBodyBase(), reason_( reason ){ + type_ = (Uint8)PROTO_CONNECTION_REFUSED; + } + + MessageBodyConnectionRefused( const char * data ) : MessageBodyBase( data ) { + int count = MessageBodyBase::dataSize(); + readFromData( reason_, data, count ); + } + + ~MessageBodyConnectionRefused(){} + + virtual void createOutStream() { + MessageBodyBase::createOutStream(); + writeToOut( out_, reason_ ); + } + + Uint8 reason( ) const { return reason_; } + +protected: + Uint8 reason_; +}; + class MessageBodyChat : public MessageBodyBase { public: MessageBodyChat( const std::string & message ) : MessageBodyBase(), message_( message ) { Modified: branches/ogsector/src/networkServer.cpp =================================================================== --- branches/ogsector/src/networkServer.cpp 2007-04-14 00:25:52 UTC (rev 387) +++ branches/ogsector/src/networkServer.cpp 2007-04-14 18:04:36 UTC (rev 388) @@ -29,7 +29,7 @@ void Server::handleAccept( UserSession * user, const asio::error & error ){ // std::cout << "Server::handle_accept" << std::endl; if ( !error ) { - addUser( user ); + addUserSession( user ); UserSession * newUser = new UserSession( this, ++userIDCounter_ ); acceptor_.async_accept( newUser->socket(), @@ -40,43 +40,59 @@ } } -void Server::addUser( UserSession * user ){ +void Server::addUserSession( UserSession * user ){ std::cout << "USER_NEW: " << user->userID() << std::endl; user->start(); - allUsers_.join( user ); } -void Server::disconnectUser( UserSession * user ){ - std::string name( user->userName() ); - std::cout << "DISCONNECTING: " << user->userID() << " " << user->userName() << std::endl; - allUsers_.leave( user ); +void Server::receiveUserName( UserSession * user, const MessageBodyUserName & msg ){ + std::cout << "USER_NAME: " << user->userID() << " " << msg.userName() << std::endl; - for ( std::map < int, UserObject * >::iterator i = user->childs()->begin(); i != user->childs()->end();){ - destroyUserObject( (i++)->second ); + if ( !userNames_.count( msg.userName() ) ){ + user->setUserName( msg.userName() ); + allUsers_.join( user ); + userNames_.insert( msg.userName() ); + + //** send the user name and the userId to all connected users; + MessageBodyUserName newUserMsg( msg.userName(), user->userID() ); + allUsers_.send( newUserMsg ); + + //** send all usernames and the userIds to the new user; + for ( UserSessionGroup::iterator it = allUsers_.begin(); it != allUsers_.end(); it ++ ){ + if ( (*it)->userID() != user->userID() ){ + MessageBodyUserName n( (*it)->userName(), (*it)->userID() ); + user->send( n ); + } + } + + user->setRegistered( true ); + } else { + std::cerr << "USER: " << msg.userName()<< " already exist." << std::endl; + + MessageBodyConnectionRefused msg( CONNECTION_REFUSED_USER_ALREADY_EXIST ); + user->send( msg ); + // disconnectUser( user, false ); } - - MessageBodyDisconnect disco( user->userID() ); - allUsers_.send( disco ); - - delete user; - std::cout << "DISCONNECTED: " << name << std::endl; } -void Server::receiveUserName( UserSession * user, const MessageBodyUserName & msg ){ - std::cout << "USER_NAME: " << user->userID() << " " << msg.userName() << std::endl; - user->setUserName( msg.userName() ); +void Server::disconnectUser( UserSession * user ){ + std::string name( user->userName() ); + std::cout << "DISCONNECTING: " << user->userID() << " " << name << std::endl; - //** send the user name and the userId to all connected users; - MessageBodyUserName newUserMsg( msg.userName(), user->userID() ); - allUsers_.send( newUserMsg ); - - //** send all usernames and the userIds to the new user; - for ( UserSessionGroup::iterator it = allUsers_.begin(); it != allUsers_.end(); it ++ ){ - if ( (*it)->userID() != user->userID() ){ - MessageBodyUserName n( (*it)->userName(), (*it)->userID() ); - user->send( n ); + if ( user->registered() ){ + allUsers_.leave( user ); + + for ( std::map < int, UserObject * >::iterator i = user->childs()->begin(); i != user->childs()->end();){ + destroyUserObject( (i++)->second ); } + + MessageBodyDisconnect disco( user->userID() ); + allUsers_.send( disco ); + userNames_.erase( name ); } + + // delete user; + std::cout << "DISCONNECTED: " << name << std::endl; } void Server::receiveChat( UserSession * user, const MessageBodyChat & msg ){ @@ -88,19 +104,32 @@ } UserObject * Server::createUserObject( UserSession * user, const std::string & name, int userID, int childID ){ - std::map < long, UserObject * >::iterator it; +// std::map < long, UserObject * >::iterator it; +// UserObject * obj = NULL; +// long id = createGlobalID( userID, childID ); + +// if ( ( it = userObjects_.find( id ) ) == userObjects_.end() ){ +// std::cout << "Create user object: " << name << std::endl; +// obj = new UserObject( user, name, childID ); +// user->insertChild( obj ); +// userObjects_[ id ] = obj; +// } else { +// std::cout << "Create request, but object already exist: " << name << std::endl; +// obj = it->second; +// } + UserObject * obj = NULL; long id = createGlobalID( userID, childID ); - if ( ( it = userObjects_.find( id ) ) == userObjects_.end() ){ + if ( !userObjects_.count( id ) ){ std::cout << "Create user object: " << name << std::endl; obj = new UserObject( user, name, childID ); user->insertChild( obj ); userObjects_[ id ] = obj; } else { - std::cout << "Create request, but object allready exist: " << name << std::endl; - obj = it->second; + std::cout << "Create request, but object already exist: " << name << std::endl; + obj = userObjects_[ id ]; } return obj; @@ -167,7 +196,7 @@ } } } else { - std::cerr << "object: " << name << " allready registered. " << std::endl; + std::cerr << "object: " << name << " already registered. " << std::endl; } } else { std::cerr << "Cannot register object: " << name << std::endl; Modified: branches/ogsector/src/networkServer.h =================================================================== --- branches/ogsector/src/networkServer.h 2007-04-14 00:25:52 UTC (rev 387) +++ branches/ogsector/src/networkServer.h 2007-04-14 18:04:36 UTC (rev 388) @@ -10,7 +10,6 @@ #include "networkProtocol.h" #include "networkServerUser.h" - using asio::ip::tcp; namespace OpenGate{ @@ -46,12 +45,12 @@ void handleAccept( UserSession * user, const asio::error & error ); - void addUser( UserSession * user ); + void addUserSession( UserSession * user ); - void disconnectUser( UserSession * user ); - void receiveUserName( UserSession * user, const MessageBodyUserName & msg ); - + + void disconnectUser( UserSession * user ); + void receiveChat( UserSession * user, const MessageBodyChat & msg ); UserObject * createUserObject( UserSession * user, const std::string & name, int userID, int childID ); @@ -62,13 +61,13 @@ void deRegisterUserObject( UserObject * obj ); - private: asio::io_service & io_service_; tcp::acceptor acceptor_; long userIDCounter_; std::map < long, UserObject * > userObjects_; + std::set < std::string > userNames_; UserSessionGroup allUsers_; }; Modified: branches/ogsector/src/networkServerUser.cpp =================================================================== --- branches/ogsector/src/networkServerUser.cpp 2007-04-14 00:25:52 UTC (rev 387) +++ branches/ogsector/src/networkServerUser.cpp 2007-04-14 18:04:36 UTC (rev 388) @@ -12,6 +12,8 @@ UserSession::UserSession( Server * server, int userID ) : socket_( server->io_service() ), server_( server ), userID_ ( userID ), userName_( "" ) { + connected_ = true; + registered_ = false; } UserSession::~UserSession(){ @@ -20,6 +22,7 @@ void UserSession::start() { MessageBodyUserID msg( userID_ ); this->send( msg ); + connected_ = true; asio::async_read( socket_, asio::buffer( readMsg_.data(), Message::HeaderLength ), boost::bind( & UserSession::handleReadHeader, this, asio::placeholders::error ) ); } @@ -29,13 +32,13 @@ } void UserSession::eraseChild( UserObject * obj ) { - if ( childs_.find( obj->childID() ) != childs_.end() ){ - childs_.erase( childs_.find( obj->childID() ) ); + if ( childs_.count( obj->childID() ) ){ + childs_.erase( obj->childID() ); } } UserObject * UserSession::child( int childID ) { - if ( childs_.find( childID ) != childs_.end() ) { + if ( childs_.count( childID ) ) { return childs_[ childID ]; } else { return NULL; @@ -49,7 +52,7 @@ // std::cout << "send.length() = " << writeMsgs_.front().length() << std::endl; - if ( ! write_in_progress ) { + if ( ! write_in_progress && connected_ ) { asio::async_write( socket_, asio::buffer( writeMsgs_.front().data(), writeMsgs_.front().length() ), boost::bind( & UserSession::handleWrite, this, asio::placeholders::error ) ); } @@ -82,6 +85,7 @@ asio::async_read( socket_, asio::buffer( readMsg_.body(), readMsg_.bodyLength() ), boost::bind( & UserSession::handleReadBody, this, asio::placeholders::error ) ); } else { + connected_ = false; server_->disconnectUser( this ); } } @@ -137,7 +141,7 @@ if ( !error ) { writeMsgs_.pop_front(); - if ( !writeMsgs_.empty() ) { + if ( !writeMsgs_.empty() && connected_ ) { asio::async_write( socket_, asio::buffer( writeMsgs_.front().data(), writeMsgs_.front().length() ), boost::bind( & UserSession::handleWrite, this, asio::placeholders::error ) ); } Modified: branches/ogsector/src/networkServerUser.h =================================================================== --- branches/ogsector/src/networkServerUser.h 2007-04-14 00:25:52 UTC (rev 387) +++ branches/ogsector/src/networkServerUser.h 2007-04-14 18:04:36 UTC (rev 388) @@ -28,6 +28,10 @@ int userID() const { return userID_; } + bool registered() const{ return registered_; } + + void setRegistered( bool reg ) { registered_ = reg; } + void setUserName( const std::string & userName ) { userName_ = userName; } const std::string userName( ) const { return userName_; } @@ -56,6 +60,8 @@ tcp::socket socket_; Server * server_; int userID_; + bool connected_; + bool registered_; std::string userName_; Message readMsg_; Modified: branches/ogsector/src/ogconsole.cpp =================================================================== --- branches/ogsector/src/ogconsole.cpp 2007-04-14 00:25:52 UTC (rev 387) +++ branches/ogsector/src/ogconsole.cpp 2007-04-14 18:04:36 UTC (rev 388) @@ -96,12 +96,14 @@ root_->getAutoCreatedWindow()->writeContentsToFile( screenieName ); print( std::string( "Wrote: " + screenieName ) ); } else{ - char legalchars[] = "ABCDEFGHIJKLMNOPQRSTUVWXUZabcdefghijklmnopqrstuvwxyz1234567890+!\"#%&/()=?[]\\*-_.:,; "; - for ( size_t c = 0; c < sizeof( legalchars ); c++ ){ - if ( legalchars[ c ] == e.text ){ - prompt_ += e.text; - break; - } +// char legalchars[] = "ABCDEFGHIJKLMNOPQRSTUVWXUZabcdefghijklmnopqrstuvwxyz1234567890+!\"#%&/()=?[]\\*-_.:,; "; +// for ( size_t c = 0; c < sizeof( legalchars ); c++ ){ +// if ( legalchars[ c ] == e.text ){ +// prompt_ += e.text; +// break; +// } + if ( (int)e.text > 32 && (int)e.text < 167 ) { + prompt_ += e.text; } } updateConsole_ = true; Modified: branches/ogsector/src/ogsectorclient.cpp =================================================================== --- branches/ogsector/src/ogsectorclient.cpp 2007-04-14 00:25:52 UTC (rev 387) +++ branches/ogsector/src/ogsectorclient.cpp 2007-04-14 18:04:36 UTC (rev 388) @@ -74,7 +74,7 @@ #ifdef NETWORKCHECK myMSleep( 1 ); int count = 0; - while( nw.online() && count < 20 ){ + while( nw.online() && count < 1000 ){ myMSleep( 1000 ); Modified: branches/ogsector/src/ogsectorserver.cpp =================================================================== --- branches/ogsector/src/ogsectorserver.cpp 2007-04-14 00:25:52 UTC (rev 387) +++ branches/ogsector/src/ogsectorserver.cpp 2007-04-14 18:04:36 UTC (rev 388) @@ -50,5 +50,4 @@ } return EXIT_SUCCESS; - } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2007-04-21 18:02:54
|
Revision: 411 http://svn.sourceforge.net/opengate/?rev=411&view=rev Author: spom_spom Date: 2007-04-21 11:02:53 -0700 (Sat, 21 Apr 2007) Log Message: ----------- Added JG like radar and some simple graphics.(stars, planet, explosion) Modified Paths: -------------- branches/ogsector/data/MediaFromOgre/Example.material branches/ogsector/data/povray/buildSkyBox.sh branches/ogsector/data/simpleHUD.material branches/ogsector/data/simpleHUD.overlay branches/ogsector/data/simpleSkybox.material branches/ogsector/ogre.cfg branches/ogsector/resources.cfg 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/SectorClient.cpp branches/ogsector/src/SectorClient.h branches/ogsector/src/SectorClientFrameListener.cpp branches/ogsector/src/SectorClientFrameListener.h branches/ogsector/src/SectorObjects.cpp branches/ogsector/src/SectorObjects.h branches/ogsector/src/networkClient.cpp branches/ogsector/src/networkClient.h branches/ogsector/src/ogconsole.cpp branches/ogsector/src/ogconsole.h branches/ogsector/src/ogsectorclient.cpp Added Paths: ----------- branches/ogsector/data/MediaFromOgre/AdvancedMaterials/ branches/ogsector/data/MediaFromOgre/AdvancedMaterials/AmbientOneTexture.glsl branches/ogsector/data/MediaFromOgre/AdvancedMaterials/Example_Basic.cg branches/ogsector/data/MediaFromOgre/AdvancedMaterials/Example_BumpMapping.cg branches/ogsector/data/MediaFromOgre/AdvancedMaterials/Example_Projection.cg branches/ogsector/data/MediaFromOgre/AdvancedMaterials/Examples-Advanced.material branches/ogsector/data/MediaFromOgre/AdvancedMaterials/Examples.program branches/ogsector/data/MediaFromOgre/AdvancedMaterials/OffsetMapping.cg branches/ogsector/data/MediaFromOgre/AdvancedMaterials/OffsetMapping.material branches/ogsector/data/MediaFromOgre/AdvancedMaterials/OffsetMappingFp.glsl branches/ogsector/data/MediaFromOgre/AdvancedMaterials/OffsetMappingVp.glsl branches/ogsector/data/MediaFromOgre/AdvancedMaterials/RustedMetal.jpg branches/ogsector/data/MediaFromOgre/AdvancedMaterials/RustySteel.jpg branches/ogsector/data/MediaFromOgre/AdvancedMaterials/nm_bk.png branches/ogsector/data/MediaFromOgre/AdvancedMaterials/nm_dn.png branches/ogsector/data/MediaFromOgre/AdvancedMaterials/nm_fr.png branches/ogsector/data/MediaFromOgre/AdvancedMaterials/nm_lf.png branches/ogsector/data/MediaFromOgre/AdvancedMaterials/nm_rt.png branches/ogsector/data/MediaFromOgre/AdvancedMaterials/nm_up.png branches/ogsector/data/MediaFromOgre/AdvancedMaterials/rockwall.png branches/ogsector/data/MediaFromOgre/AdvancedMaterials/rockwall_NH.png branches/ogsector/data/MediaFromOgre/AdvancedMaterials/skinningTwoWeightsVp.glsl branches/ogsector/data/explosion.material branches/ogsector/data/explosion.particle branches/ogsector/data/mousePointer.material branches/ogsector/data/mousePointer.overlay branches/ogsector/data/planets.material branches/ogsector/data/textures/ branches/ogsector/data/textures/blank.png branches/ogsector/data/textures/consoleBackground.png branches/ogsector/data/textures/explosion.png branches/ogsector/data/textures/flare.png branches/ogsector/data/textures/hudCenter.png branches/ogsector/data/textures/hudTarget.png branches/ogsector/data/textures/mousePointer.png branches/ogsector/data/textures/radarBackground.png branches/ogsector/data/textures/redPlanet.png branches/ogsector/data/textures/star.png Removed Paths: ------------- branches/ogsector/data/Console.png branches/ogsector/data/HUDCenter.png branches/ogsector/data/HUDTarget.png branches/ogsector/data/MousePointer.material branches/ogsector/data/MousePointer.overlay branches/ogsector/data/MousePointer.png Deleted: branches/ogsector/data/Console.png =================================================================== (Binary files differ) Deleted: branches/ogsector/data/HUDCenter.png =================================================================== (Binary files differ) Deleted: branches/ogsector/data/HUDTarget.png =================================================================== (Binary files differ) Added: branches/ogsector/data/MediaFromOgre/AdvancedMaterials/AmbientOneTexture.glsl =================================================================== --- branches/ogsector/data/MediaFromOgre/AdvancedMaterials/AmbientOneTexture.glsl (rev 0) +++ branches/ogsector/data/MediaFromOgre/AdvancedMaterials/AmbientOneTexture.glsl 2007-04-21 18:02:53 UTC (rev 411) @@ -0,0 +1,13 @@ +uniform vec4 ambient; + +/* + Basic ambient lighting vertex program +*/ +void main() +{ + gl_Position = ftransform(); + gl_TexCoord[0] = gl_MultiTexCoord0; + gl_FrontColor = ambient; +} + + Added: branches/ogsector/data/MediaFromOgre/AdvancedMaterials/Example_Basic.cg =================================================================== --- branches/ogsector/data/MediaFromOgre/AdvancedMaterials/Example_Basic.cg (rev 0) +++ branches/ogsector/data/MediaFromOgre/AdvancedMaterials/Example_Basic.cg 2007-04-21 18:02:53 UTC (rev 411) @@ -0,0 +1,272 @@ +/* + Basic ambient lighting vertex program +*/ +void ambientOneTexture_vp(float4 position : POSITION, + float2 uv : TEXCOORD0, + + out float4 oPosition : POSITION, + out float2 oUv : TEXCOORD0, + out float4 colour : COLOR, + + uniform float4x4 worldViewProj, + uniform float4 ambient) +{ + oPosition = mul(worldViewProj, position); + oUv = uv; + colour = ambient; +} + +/* + Single-weight-per-vertex hardware skinning, 2 lights + The trouble with vertex programs is they're not general purpose, but + fixed function hardware skinning is very poorly supported +*/ +void hardwareSkinningOneWeight_vp( + float4 position : POSITION, + float3 normal : NORMAL, + float2 uv : TEXCOORD0, + float blendIdx : BLENDINDICES, + + + out float4 oPosition : POSITION, + out float2 oUv : TEXCOORD0, + out float4 colour : COLOR, + // Support up to 24 bones of float3x4 + // vs_1_1 only supports 96 params so more than this is not feasible + uniform float3x4 worldMatrix3x4Array[24], + uniform float4x4 viewProjectionMatrix, + uniform float4 lightPos[2], + uniform float4 lightDiffuseColour[2], + uniform float4 ambient) +{ + // transform by indexed matrix + float4 blendPos = float4(mul(worldMatrix3x4Array[blendIdx], position).xyz, 1.0); + // view / projection + oPosition = mul(viewProjectionMatrix, blendPos); + // transform normal + float3 norm = mul((float3x3)worldMatrix3x4Array[blendIdx], normal); + // Lighting - support point and directional + float3 lightDir0 = normalize( + lightPos[0].xyz - (blendPos.xyz * lightPos[0].w)); + float3 lightDir1 = normalize( + lightPos[1].xyz - (blendPos.xyz * lightPos[1].w)); + + oUv = uv; + colour = ambient + + (saturate(dot(lightDir0, norm)) * lightDiffuseColour[0]) + + (saturate(dot(lightDir1, norm)) * lightDiffuseColour[1]); + +} + +/* + Single-weight-per-vertex hardware skinning, shadow-caster pass +*/ +void hardwareSkinningOneWeightCaster_vp( + float4 position : POSITION, + float3 normal : NORMAL, + float blendIdx : BLENDINDICES, + + + out float4 oPosition : POSITION, + out float4 colour : COLOR, + // Support up to 24 bones of float3x4 + // vs_1_1 only supports 96 params so more than this is not feasible + uniform float3x4 worldMatrix3x4Array[24], + uniform float4x4 viewProjectionMatrix, + uniform float4 ambient) +{ + // transform by indexed matrix + float4 blendPos = float4(mul(worldMatrix3x4Array[blendIdx], position).xyz, 1.0); + // view / projection + oPosition = mul(viewProjectionMatrix, blendPos); + + colour = ambient; + +} + +/* + Two-weight-per-vertex hardware skinning, 2 lights + The trouble with vertex programs is they're not general purpose, but + fixed function hardware skinning is very poorly supported +*/ +void hardwareSkinningTwoWeights_vp( + float4 position : POSITION, + float3 normal : NORMAL, + float2 uv : TEXCOORD0, + float4 blendIdx : BLENDINDICES, + float4 blendWgt : BLENDWEIGHT, + + + out float4 oPosition : POSITION, + out float2 oUv : TEXCOORD0, + out float4 colour : COLOR, + // Support up to 24 bones of float3x4 + // vs_1_1 only supports 96 params so more than this is not feasible + uniform float3x4 worldMatrix3x4Array[24], + uniform float4x4 viewProjectionMatrix, + uniform float4 lightPos[2], + uniform float4 lightDiffuseColour[2], + uniform float4 ambient) +{ + // transform by indexed matrix + float4 blendPos = float4(0,0,0,0); + int i; + for (i = 0; i < 2; ++i) + { + blendPos += float4(mul(worldMatrix3x4Array[blendIdx[i]], position).xyz, 1.0) * blendWgt[i]; + } + // view / projection + oPosition = mul(viewProjectionMatrix, blendPos); + // transform normal + float3 norm = float3(0,0,0); + for (i = 0; i < 2; ++i) + { + norm += mul((float3x3)worldMatrix3x4Array[blendIdx[i]], normal) * + blendWgt[i]; + } + norm = normalize(norm); + // Lighting - support point and directional + float3 lightDir0 = normalize( + lightPos[0].xyz - (blendPos.xyz * lightPos[0].w)); + float3 lightDir1 = normalize( + lightPos[1].xyz - (blendPos.xyz * lightPos[1].w)); + + + oUv = uv; + colour = float4(0.5, 0.5, 0.5, 1) + + (saturate(dot(lightDir0, norm)) * lightDiffuseColour[0]) + + (saturate(dot(lightDir1, norm)) * lightDiffuseColour[1]); + +} + +/* + Two-weight-per-vertex hardware skinning, shadow caster pass +*/ +void hardwareSkinningTwoWeightsCaster_vp( + float4 position : POSITION, + float3 normal : NORMAL, + float2 uv : TEXCOORD0, + float4 blendIdx : BLENDINDICES, + float4 blendWgt : BLENDWEIGHT, + + + out float4 oPosition : POSITION, + out float4 colour : COLOR, + // Support up to 24 bones of float3x4 + // vs_1_1 only supports 96 params so more than this is not feasible + uniform float3x4 worldMatrix3x4Array[24], + uniform float4x4 viewProjectionMatrix, + uniform float4 ambient) +{ + // transform by indexed matrix + float4 blendPos = float4(0,0,0,0); + int i; + for (i = 0; i < 2; ++i) + { + blendPos += float4(mul(worldMatrix3x4Array[blendIdx[i]], position).xyz, 1.0) * blendWgt[i]; + } + // view / projection + oPosition = mul(viewProjectionMatrix, blendPos); + + + colour = ambient; + + +} + + +/* + Four-weight-per-vertex hardware skinning, 2 lights + The trouble with vertex programs is they're not general purpose, but + fixed function hardware skinning is very poorly supported +*/ +void hardwareSkinningFourWeights_vp( + float4 position : POSITION, + float3 normal : NORMAL, + float2 uv : TEXCOORD0, + float4 blendIdx : BLENDINDICES, + float4 blendWgt : BLENDWEIGHT, + + + out float4 oPosition : POSITION, + out float2 oUv : TEXCOORD0, + out float4 colour : COLOR, + // Support up to 24 bones of float3x4 + // vs_1_1 only supports 96 params so more than this is not feasible + uniform float3x4 worldMatrix3x4Array[24], + uniform float4x4 viewProjectionMatrix, + uniform float4 lightPos[2], + uniform float4 lightDiffuseColour[2], + uniform float4 ambient) +{ + // transform by indexed matrix + float4 blendPos = float4(0,0,0,0); + int i; + for (i = 0; i < 4; ++i) + { + blendPos += float4(mul(worldMatrix3x4Array[blendIdx[i]], position).xyz, 1.0) * blendWgt[i]; + } + // view / projection + oPosition = mul(viewProjectionMatrix, blendPos); + // transform normal + float3 norm = float3(0,0,0); + for (i = 0; i < 4; ++i) + { + norm += mul((float3x3)worldMatrix3x4Array[blendIdx[i]], normal) * + blendWgt[i]; + } + norm = normalize(norm); + // Lighting - support point and directional + float3 lightDir0 = normalize( + lightPos[0].xyz - (blendPos.xyz * lightPos[0].w)); + float3 lightDir1 = normalize( + lightPos[1].xyz - (blendPos.xyz * lightPos[1].w)); + + + oUv = uv; + colour = ambient + + (saturate(dot(lightDir0, norm)) * lightDiffuseColour[0]) + + (saturate(dot(lightDir1, norm)) * lightDiffuseColour[1]); + +} + +void hardwareMorphAnimation(float3 pos1 : POSITION, + float4 normal : NORMAL, + float2 uv : TEXCOORD0, + float3 pos2 : TEXCOORD1, + + out float4 oPosition : POSITION, + out float2 oUv : TEXCOORD0, + out float4 colour : COLOR, + + uniform float4x4 worldViewProj, + uniform float4 anim_t) +{ + // interpolate + float4 interp = float4(pos1 + anim_t.x*(pos2 - pos1), 1.0f); + + oPosition = mul(worldViewProj, interp); + oUv = uv; + colour = float4(1,0,0,1); +} + +void hardwarePoseAnimation(float3 pos : POSITION, + float4 normal : NORMAL, + float2 uv : TEXCOORD0, + float3 pose1 : TEXCOORD1, + float3 pose2 : TEXCOORD2, + + out float4 oPosition : POSITION, + out float2 oUv : TEXCOORD0, + out float4 colour : COLOR, + + uniform float4x4 worldViewProj, + uniform float4 anim_t) +{ + // interpolate + float4 interp = float4(pos + anim_t.x*pose1 + anim_t.y*pose2, 1.0f); + + oPosition = mul(worldViewProj, interp); + oUv = uv; + colour = float4(1,0,0,1); +} Added: branches/ogsector/data/MediaFromOgre/AdvancedMaterials/Example_BumpMapping.cg =================================================================== --- branches/ogsector/data/MediaFromOgre/AdvancedMaterials/Example_BumpMapping.cg (rev 0) +++ branches/ogsector/data/MediaFromOgre/AdvancedMaterials/Example_BumpMapping.cg 2007-04-21 18:02:53 UTC (rev 411) @@ -0,0 +1,236 @@ +// General functions + +// Expand a range-compressed vector +float3 expand(float3 v) +{ + return (v - 0.5) * 2; +} + + +/* Bump mapping vertex program + In this program, we want to calculate the tangent space light vector + on a per-vertex level which will get passed to the fragment program, + or to the fixed function dot3 operation, to produce the per-pixel + lighting effect. +*/ +void main_vp(float4 position : POSITION, + float3 normal : NORMAL, + float2 uv : TEXCOORD0, + float3 tangent : TANGENT0, + // outputs + out float4 oPosition : POSITION, + out float2 oUv : TEXCOORD0, + out float3 oTSLightDir : TEXCOORD1, + // parameters + uniform float4 lightPosition, // object space + uniform float4x4 worldViewProj) +{ + // calculate output position + oPosition = mul(worldViewProj, position); + + // pass the main uvs straight through unchanged + oUv = uv; + + // calculate tangent space light vector + // Get object space light direction + // Non-normalised since we'll do that in the fragment program anyway + float3 lightDir = lightPosition.xyz - (position * lightPosition.w); + + // Calculate the binormal (NB we assume both normal and tangent are + // already normalised) + // NB looks like nvidia cross params are BACKWARDS to what you'd expect + // this equates to NxT, not TxN + float3 binormal = cross(tangent, normal); + + // Form a rotation matrix out of the vectors + float3x3 rotation = float3x3(tangent, binormal, normal); + + // Transform the light vector according to this matrix + oTSLightDir = mul(rotation, lightDir); + + +} + +/* Bump mapping vertex program for shadow receiving + In this program, we want to calculate the tangent space light vector + on a per-vertex level which will get passed to the fragment program, + or to the fixed function dot3 operation, to produce the per-pixel + lighting effect. +*/ +void main_shadowreceiver_vp(float4 position : POSITION, + float3 normal : NORMAL, + float2 uv : TEXCOORD0, + float3 tangent : TANGENT0, + + // outputs + out float4 oPosition : POSITION, + out float4 uvproj : TEXCOORD0, + out float2 oUv : TEXCOORD1, + out float3 oTSLightDir : TEXCOORD2, + + // parameters + uniform float4 lightPosition, // object space + uniform float4x4 worldViewProj, + uniform float4x4 worldMatrix, + uniform float4x4 texViewProj) +{ + // calculate output position + oPosition = mul(worldViewProj, position); + + // pass the main uvs straight through unchanged + oUv = uv; + + // calculate tangent space light vector + // Get object space light direction + // Non-normalised since we'll do that in the fragment program anyway + float3 lightDir = lightPosition.xyz - (position * lightPosition.w); + + // Calculate the binormal (NB we assume both normal and tangent are + // already normalised) + // NB looks like nvidia cross params are BACKWARDS to what you'd expect + // this equates to NxT, not TxN + float3 binormal = cross(tangent, normal); + + // Form a rotation matrix out of the vectors + float3x3 rotation = float3x3(tangent, binormal, normal); + + // Transform the light vector according to this matrix + oTSLightDir = mul(rotation, lightDir); + + // Projection + uvproj = mul(worldMatrix, position); + uvproj = mul(texViewProj, uvproj); + +} + + +void main_fp( float2 uv : TEXCOORD0, + float3 TSlightDir : TEXCOORD1, + + out float4 colour : COLOR, + + uniform float4 lightDiffuse, + uniform sampler2D normalMap : register(s0), + uniform samplerCUBE normalCubeMap : register(s1) ) +{ + // retrieve normalised light vector, expand from range-compressed + float3 lightVec = expand(texCUBE(normalCubeMap, TSlightDir).xyz); + + // get bump map vector, again expand from range-compressed + float3 bumpVec = expand(tex2D(normalMap, uv).xyz); + + // Calculate dot product + colour = lightDiffuse * dot(bumpVec, lightVec); + +} + +void main_shadowreceiver_fp( + float4 uvproj : TEXCOORD0, + float2 uv : TEXCOORD1, + float3 TSlightDir : TEXCOORD2, + + out float4 colour : COLOR, + + uniform float4 lightDiffuse, + uniform sampler2D shadowMap : register(s0), + uniform sampler2D normalMap : register(s1), + uniform samplerCUBE normalCubeMap : register(s2)) +{ + + + // retrieve normalised light vector, expand from range-compressed + float3 lightVec = expand(texCUBE(normalCubeMap, TSlightDir).xyz); + + // get bump map vector, again expand from range-compressed + float3 bumpVec = expand(tex2D(normalMap, uv).xyz); + + // get shadow value + float3 shadow = tex2Dproj(shadowMap, uvproj).xyz; + + // Calculate dot product + colour = float4(shadow * lightDiffuse * dot(bumpVec, lightVec), 1.0f); + +} + +/* Vertex program which includes specular component */ +void specular_vp(float4 position : POSITION, + float3 normal : NORMAL, + float2 uv : TEXCOORD0, + float3 tangent : TANGENT0, + // outputs + out float4 oPosition : POSITION, + out float2 oUv : TEXCOORD0, + out float3 oTSLightDir : TEXCOORD1, + out float3 oTSHalfAngle : TEXCOORD2, + // parameters + uniform float4 lightPosition, // object space + uniform float3 eyePosition, // object space + uniform float4x4 worldViewProj) +{ + // calculate output position + oPosition = mul(worldViewProj, position); + + // pass the main uvs straight through unchanged + oUv = uv; + + // calculate tangent space light vector + // Get object space light direction + float3 lightDir = normalize(lightPosition.xyz - (position * lightPosition.w)); + + // Calculate the binormal (NB we assume both normal and tangent are + // already normalised) + // NB looks like nvidia cross params are BACKWARDS to what you'd expect + // this equates to NxT, not TxN + float3 binormal = cross(tangent, normal); + + // Form a rotation matrix out of the vectors + float3x3 rotation = float3x3(tangent, binormal, normal); + + // Transform the light vector according to this matrix + oTSLightDir = mul(rotation, lightDir); + + // Calculate half-angle in tangent space + float3 eyeDir = normalize(eyePosition - position.xyz); + float3 halfAngle = normalize(eyeDir + lightDir); + oTSHalfAngle = mul(rotation, halfAngle); + + +} + +/* Fragment program which supports specular component */ +void specular_fp( float2 uv : TEXCOORD0, + float3 TSlightDir : TEXCOORD1, + float3 TShalfAngle: TEXCOORD2, + + out float4 colour : COLOR, + + uniform float4 lightDiffuse, + uniform float4 lightSpecular, + uniform sampler2D normalMap : register(s0), + uniform samplerCUBE normalCubeMap : register(s1), + uniform samplerCUBE normalCubeMap2 : register(s2)) // we need this second binding to be compatible with ps_1_1, ps_2_0 could reuse the other +{ + // retrieve normalised light vector, expand from range-compressed + float3 lightVec = expand(texCUBE(normalCubeMap, TSlightDir).xyz); + + // retrieve half angle and normalise through cube map + float3 halfAngle = expand(texCUBE(normalCubeMap2, TShalfAngle).xyz); + + // get bump map vector, again expand from range-compressed + float3 bumpVec = expand(tex2D(normalMap, uv).xyz); + + // Pre-raise the specular exponent to the eight power + // Note we have no 'pow' function in basic fragment programs, if we were willing to accept compatibility + // with ps_2_0 / arbfp1 and above, we could have a variable shininess parameter + // This is equivalent to + float specFactor = dot(bumpVec, halfAngle); + for (int i = 0; i < 3; ++i) + specFactor *= specFactor; + + + // Calculate dot product for diffuse + colour = (lightDiffuse * saturate(dot(bumpVec, lightVec))) + + (lightSpecular * specFactor); + +} + Added: branches/ogsector/data/MediaFromOgre/AdvancedMaterials/Example_Projection.cg =================================================================== --- branches/ogsector/data/MediaFromOgre/AdvancedMaterials/Example_Projection.cg (rev 0) +++ branches/ogsector/data/MediaFromOgre/AdvancedMaterials/Example_Projection.cg 2007-04-21 18:02:53 UTC (rev 411) @@ -0,0 +1,28 @@ + +void generalPurposeProjection_vp( + float4 pos : POSITION, + + out float4 oPos : POSITION, + out float4 texCoord : TEXCOORD0, + + uniform float4x4 worldViewProjMatrix, + uniform float4x4 worldMatrix, + uniform float4x4 texViewProjMatrix) +{ + oPos = mul(worldViewProjMatrix, pos); + // multiply position by world matrix, then by projective view/proj + float4 newpos = mul(worldMatrix, pos); + texCoord = mul(texViewProjMatrix, newpos); + +} + +void generalPurposeProjection_fp( + float4 texCoord : TEXCOORD0, + out float4 col : COLOR, + uniform sampler2D texMap) +{ + col = tex2Dproj(texMap, texCoord); + +} + + Added: branches/ogsector/data/MediaFromOgre/AdvancedMaterials/Examples-Advanced.material =================================================================== --- branches/ogsector/data/MediaFromOgre/AdvancedMaterials/Examples-Advanced.material (rev 0) +++ branches/ogsector/data/MediaFromOgre/AdvancedMaterials/Examples-Advanced.material 2007-04-21 18:02:53 UTC (rev 411) @@ -0,0 +1,499 @@ +//------------------------ +// Bump mapping section +//------------------------ + +// Bump map vertex program, support for this is required +vertex_program Examples/BumpMapVP cg +{ + source Example_BumpMapping.cg + entry_point main_vp + profiles vs_1_1 arbvp1 +} + +// Bump map fragment program, support for this is optional +fragment_program Examples/BumpMapFP cg +{ + source Example_BumpMapping.cg + entry_point main_fp + profiles ps_1_1 arbfp1 fp20 +} + +// Bump map vertex program shadow receiver +vertex_program Examples/BumpMapVPShadowRcv cg +{ + source Example_BumpMapping.cg + entry_point main_shadowreceiver_vp + profiles vs_1_1 arbvp1 +} +// Bump map fragment program shadow receiver, support for this is optional +fragment_program Examples/BumpMapFPShadowRcv cg +{ + source Example_BumpMapping.cg + entry_point main_shadowreceiver_fp + profiles ps_1_1 arbfp1 fp20 +} + + +// Bump map with specular vertex program, support for this is required +vertex_program Examples/BumpMapVPSpecular cg +{ + source Example_BumpMapping.cg + entry_point specular_vp + profiles vs_1_1 arbvp1 +} + +// Bump map fragment program, support for this is optional +fragment_program Examples/BumpMapFPSpecular cg +{ + source Example_BumpMapping.cg + entry_point specular_fp + profiles ps_1_1 arbfp1 fp20 +} + +// Single light material, less passes (one pass on a 4-unit card) +material Examples/BumpMapping/SingleLight +{ + // Preferred technique, uses vertex and fragment programs + // to support a single coloured light + technique + { + pass + { + // base colours, not needed for rendering, but as information + // to lighting pass categorisation routine + ambient 0 0 0 + // Vertex program reference + vertex_program_ref Examples/BumpMapVP + { + param_named_auto lightPosition light_position_object_space 0 + param_named_auto worldViewProj worldviewproj_matrix + } + + // Fragment program + fragment_program_ref Examples/BumpMapFP + { + param_named_auto lightDiffuse light_diffuse_colour 0 + } + + // Base bump map + texture_unit + { + texture NMBumpsOut.png + colour_op replace + } + // Normalisation cube map + texture_unit + { + cubic_texture nm.png combinedUVW + tex_coord_set 1 + tex_address_mode clamp + } + // Decal + texture_unit + { + texture RustySteel.jpg + } + } + } + // Fallback technique, uses vertex program but only fixed-function + // fragment shading, which does not support coloured light + technique + { + pass + { + // base colours, not needed for rendering, but as information + // to lighting pass categorisation routine + ambient 0 0 0 + // Vertex program reference + vertex_program_ref Examples/BumpMapVP + { + param_named_auto lightPosition light_position_object_space 0 + param_named_auto worldViewProj worldviewproj_matrix + } + + // Base bump map + texture_unit + { + texture NMBumpsOut.png + colour_op replace + } + // Normalisation cube map + texture_unit + { + cubic_texture nm.png combinedUVW + tex_coord_set 1 + tex_address_mode clamp + colour_op_ex dotproduct src_texture src_current + colour_op_multipass_fallback dest_colour zero + } + // Decal + texture_unit + { + texture RustySteel.jpg + } + } + } +} + +// Any number of lights, diffuse +material Examples/BumpMapping/MultiLight +{ + + // This is the preferred technique which uses both vertex and + // fragment programs, supports coloured lights + technique + { + // Base ambient pass + pass + { + // base colours, not needed for rendering, but as information + // to lighting pass categorisation routine + ambient 1 1 1 + diffuse 0 0 0 + specular 0 0 0 0 + // Really basic vertex program + // NB we don't use fixed function here because GL does not like + // mixing fixed function and vertex programs, depth fighting can + // be an issue + vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture + { + param_named_auto worldViewProj worldviewproj_matrix + param_named_auto ambient ambient_light_colour + } + + } + // Now do the lighting pass + // NB we don't do decal texture here because this is repeated per light + pass + { + // base colours, not needed for rendering, but as information + // to lighting pass categorisation routine + ambient 0 0 0 + + // do this for each light + iteration once_per_light + + + scene_blend add + + // Vertex program reference + vertex_program_ref Examples/BumpMapVP + { + param_named_auto lightPosition light_position_object_space 0 + param_named_auto worldViewProj worldviewproj_matrix + } + + // Fragment program + fragment_program_ref Examples/BumpMapFP + { + param_named_auto lightDiffuse light_diffuse_colour 0 + } + + // Base bump map + texture_unit + { + texture NMBumpsOut.png + colour_op replace + } + // Normalisation cube map + texture_unit + { + cubic_texture nm.png combinedUVW + tex_coord_set 1 + tex_address_mode clamp + } + } + + // Decal pass + pass + { + // base colours, not needed for rendering, but as information + // to lighting pass categorisation routine + lighting off + // Really basic vertex program + // NB we don't use fixed function here because GL does not like + // mixing fixed function and vertex programs, depth fighting can + // be an issue + vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture + { + param_named_auto worldViewProj worldviewproj_matrix + param_named ambient float4 1 1 1 1 + } + scene_blend dest_colour zero + texture_unit + { + texture RustedMetal.jpg + } + + } + } + + // This is the fallback which cards which don't have fragment program + // support will use + // Note that it still requires vertex program support + technique + { + // Base ambient pass + pass + { + // base colours, not needed for rendering, but as information + // to lighting pass categorisation routine + ambient 1 1 1 + diffuse 0 0 0 + specular 0 0 0 0 + // Really basic vertex program + // NB we don't use fixed function here because GL does not like + // mixing fixed function and vertex programs, depth fighting can + // be an issue + vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture + { + param_named_auto worldViewProj worldviewproj_matrix + param_named_auto ambient ambient_light_colour + } + + } + // Now do the lighting pass + // NB we don't do decal texture here because this is repeated per light + pass + { + // base colours, not needed for rendering, but as information + // to lighting pass categorisation routine + ambient 0 0 0 + // do this for each light + iteration once_per_light + + + scene_blend add + + // Vertex program reference + vertex_program_ref Examples/BumpMapVP + { + param_named_auto lightPosition light_position_object_space 0 + param_named_auto worldViewProj worldviewproj_matrix + } + + // Base bump map + texture_unit + { + texture NMBumpsOut.png + colour_op replace + } + // Normalisation cube map, with dot product on bump map + texture_unit + { + cubic_texture nm.png combinedUVW + tex_coord_set 1 + tex_address_mode clamp + colour_op_ex dotproduct src_texture src_current + colour_op_multipass_fallback dest_colour zero + } + } + + // Decal pass + pass + { + lighting off + // Really basic vertex program + // NB we don't use fixed function here because GL does not like + // mixing fixed function and vertex programs, depth fighting can + // be an issue + vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture + { + param_named_auto worldViewProj worldviewproj_matrix + param_named ambient float4 1 1 1 1 + } + scene_blend dest_colour zero + texture_unit + { + texture RustedMetal.jpg + } + + } + + } +} + +// Any number of lights, diffuse and specular +material Examples/BumpMapping/MultiLightSpecular +{ + + // This is the preferred technique which uses both vertex and + // fragment programs, supports coloured lights + technique + { + // Base ambient pass + pass + { + // base colours, not needed for rendering, but as information + // to lighting pass categorisation routine + ambient 1 1 1 + diffuse 0 0 0 + specular 0 0 0 0 + // Really basic vertex program + // NB we don't use fixed function here because GL does not like + // mixing fixed function and vertex programs, depth fighting can + // be an issue + vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture + { + param_named_auto worldViewProj worldviewproj_matrix + param_named_auto ambient ambient_light_colour + } + + } + // Now do the lighting pass + // NB we don't do decal texture here because this is repeated per light + pass + { + // base colours, not needed for rendering, but as information + // to lighting pass categorisation routine + ambient 0 0 0 + // do this for each light + iteration once_per_light + + + scene_blend add + + // Vertex program reference + vertex_program_ref Examples/BumpMapVPSpecular + { + param_named_auto lightPosition light_position_object_space 0 + param_named_auto eyePosition camera_position_object_space + param_named_auto worldViewProj worldviewproj_matrix + } + + // Fragment program + fragment_program_ref Examples/BumpMapFPSpecular + { + param_named_auto lightDiffuse light_diffuse_colour 0 + param_named_auto lightSpecular light_specular_colour 0 + } + + // Base bump map + texture_unit + { + texture NMBumpsOut.png + colour_op replace + } + // Normalisation cube map + texture_unit + { + cubic_texture nm.png combinedUVW + tex_coord_set 1 + tex_address_mode clamp + } + // Normalisation cube map #2 + texture_unit + { + cubic_texture nm.png combinedUVW + tex_coord_set 2 + tex_address_mode clamp + } + } + + // Decal pass + pass + { + lighting off + // Really basic vertex program + // NB we don't use fixed function here because GL does not like + // mixing fixed function and vertex programs, depth fighting can + // be an issue + vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture + { + param_named_auto worldViewProj worldviewproj_matrix + param_named ambient float4 1 1 1 1 + } + scene_blend dest_colour zero + texture_unit + { + texture RustedMetal.jpg + } + + } + } + + // This is the fallback which cards which don't have fragment program + // support will use, NB does not support specular colour + // Note that it still requires vertex program support + technique + { + // Base ambient pass + pass + { + // base colours, not needed for rendering, but as information + // to lighting pass categorisation routine + ambient 1 1 1 + diffuse 0 0 0 + specular 0 0 0 0 + // Really basic vertex program + // NB we don't use fixed function here because GL does not like + // mixing fixed function and vertex programs, depth fighting can + // be an issue + vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture + { + param_named_auto worldViewProj worldviewproj_matrix + param_named_auto ambient ambient_light_colour + } + + } + // Now do the lighting pass + // NB we don't do decal texture here because this is repeated per light + pass + { + // base colours, not needed for rendering, but as information + // to lighting pass categorisation routine + ambient 0 0 0 + // do this for each light + iteration once_per_light + + + scene_blend add + + // Vertex program reference + vertex_program_ref Examples/BumpMapVP + { + param_named_auto lightPosition light_position_object_space 0 + param_named_auto worldViewProj worldviewproj_matrix + } + + // Base bump map + texture_unit + { + texture NMBumpsOut.png + colour_op replace + } + // Normalisation cube map, with dot product on bump map + texture_unit + { + cubic_texture nm.png combinedUVW + tex_coord_set 1 + tex_address_mode clamp + colour_op_ex dotproduct src_texture src_current + colour_op_multipass_fallback dest_colour zero + } + } + + // Decal pass + pass + { + lighting off + // Really basic vertex program + // NB we don't use fixed function here because GL does not like + // mixing fixed function and vertex programs, depth fighting can + // be an issue + vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture + { + param_named_auto worldViewProj worldviewproj_matrix + param_named ambient float4 1 1 1 1 + } + scene_blend dest_colour zero + texture_unit + { + texture RustedMetal.jpg + } + + } + + } +} + Added: branches/ogsector/data/MediaFromOgre/AdvancedMaterials/Examples.program =================================================================== --- branches/ogsector/data/MediaFromOgre/AdvancedMaterials/Examples.program (rev 0) +++ branches/ogsector/data/MediaFromOgre/AdvancedMaterials/Examples.program 2007-04-21 18:02:53 UTC (rev 411) @@ -0,0 +1,158 @@ +//--------------------------------------------------- +// This file includes a number of basic GPU programs +// for use in many materials. +//--------------------------------------------------- + + +// A really basic ambient pass program, support for one texture coodinate set +vertex_program Ogre/BasicVertexPrograms/AmbientOneTexture cg +{ + source Example_Basic.cg + entry_point ambientOneTexture_vp + profiles vs_1_1 arbvp1 + + default_params + { + param_named_auto worldViewProj worldviewproj_matrix + param_named_auto ambient ambient_light_colour + } + +} +// A really basic ambient pass program, support for one texture coodinate set +vertex_program Ogre/BasicVertexPrograms/AmbientOneTextureHLSL hlsl +{ + source Example_Basic.hlsl + entry_point ambientOneTexture_vp + target vs_1_1 + + default_params + { + param_named_auto worldViewProj worldviewproj_matrix + param_named_auto ambient ambient_light_colour + } +} +// A really basic ambient pass program, support for one texture coodinate set +vertex_program Ogre/BasicVertexPrograms/AmbientOneTextureGLSL glsl +{ + source AmbientOneTexture.glsl + + default_params + { + param_named_auto ambient ambient_light_colour + } +} + +vertex_program Ogre/BasicVertexPrograms/AmbientOneTextureUnified unified +{ + delegate Ogre/BasicVertexPrograms/AmbientOneTextureGLSL + delegate Ogre/BasicVertexPrograms/AmbientOneTextureHLSL +} + + +// Same as below, but for use when rendering texture shadows +vertex_program Ogre/HardwareSkinningOneWeightShadowCaster cg +{ + source Example_Basic.cg + entry_point hardwareSkinningOneWeightCaster_vp + profiles vs_1_1 arbvp1 + includes_skeletal_animation true +} +// Basic hardware skinning using one indexed weight per vertex +vertex_program Ogre/HardwareSkinningOneWeight cg +{ + source Example_Basic.cg + entry_point hardwareSkinningOneWeight_vp + profiles vs_1_1 arbvp1 + includes_skeletal_animation true +} +// Same as below, but for use when rendering texture shadows +vertex_program Ogre/HardwareSkinningTwoWeightsShadowCasterCg cg +{ + source Example_Basic.cg + entry_point hardwareSkinningTwoWeightsCaster_vp + profiles vs_1_1 arbvp1 + includes_skeletal_animation true +} + +vertex_program Ogre/HardwareSkinningTwoWeightsShadowCasterGLSL glsl +{ + source skinningTwoWeightsShadowCasterVp.glsl + includes_skeletal_animation true +} + +vertex_program Ogre/HardwareSkinningTwoWeightsShadowCaster unified +{ + delegate Ogre/HardwareSkinningTwoWeightsShadowCasterGLSL + delegate Ogre/HardwareSkinningTwoWeightsShadowCasterCg +} + +// Basic hardware skinning using two indexed weights per vertex +vertex_program Ogre/HardwareSkinningTwoWeightsCg cg +{ + source Example_Basic.cg + entry_point hardwareSkinningTwoWeights_vp + profiles vs_1_1 arbvp1 + includes_skeletal_animation true +} + +vertex_program Ogre/HardwareSkinningTwoWeightsGLSL glsl +{ + source skinningTwoWeightsVp.glsl + includes_skeletal_animation true +} + +vertex_program Ogre/HardwareSkinningTwoWeights unified +{ + delegate Ogre/HardwareSkinningTwoWeightsGLSL + delegate Ogre/HardwareSkinningTwoWeightsCg + + default_params + { + param_named_auto worldMatrix3x4Array world_matrix_array_3x4 + param_named_auto viewProjectionMatrix viewproj_matrix + param_named_auto lightPos[0] light_position 0 + param_named_auto lightPos[1] light_position 1 + param_named_auto lightDiffuseColour[0] light_diffuse_colour 0 + param_named_auto lightDiffuseColour[1] light_diffuse_colour 1 + } +} + +// Basic hardware skinning using four indexed weights per vertex +vertex_program Ogre/HardwareSkinningFourWeights cg +{ + source Example_Basic.cg + entry_point hardwareSkinningFourWeights_vp + profiles vs_1_1 arbvp1 + includes_skeletal_animation true + +} +// Basic hardware morph animation +vertex_program Ogre/HardwareMorphAnimation cg +{ + source Example_Basic.cg + entry_point hardwareMorphAnimation + profiles vs_1_1 arbvp1 + + includes_morph_animation true + default_params + { + param_named_auto worldViewProj worldviewproj_matrix + param_named_auto anim_t animation_parametric + } +} +// Basic hardware pose animation supporting 2 active poses +vertex_program Ogre/HardwarePoseAnimation cg +{ + source Example_Basic.cg + entry_point hardwarePoseAnimation + profiles vs_1_1 arbvp1 + + includes_pose_animation 2 + default_params + { + param_named_auto worldViewProj worldviewproj_matrix + param_named_auto anim_t animation_parametric + } +} + + Added: branches/ogsector/data/MediaFromOgre/AdvancedMaterials/OffsetMapping.cg =================================================================== --- branches/ogsector/data/MediaFromOgre/AdvancedMaterials/OffsetMapping.cg (rev 0) +++ branches/ogsector/data/MediaFromOgre/AdvancedMaterials/OffsetMapping.cg 2007-04-21 18:02:53 UTC (rev 411) @@ -0,0 +1,97 @@ +/* Bump mapping with Parallax offset vertex program + In this program, we want to calculate the tangent space light end eye vectors + which will get passed to the fragment program to produce the per-pixel bump map + with parallax offset effect. +*/ + +/* Vertex program that moves light and eye vectors into texture tangent space at vertex */ + +void main_vp(float4 position : POSITION, + float3 normal : NORMAL, + float2 uv : TEXCOORD0, + float3 tangent : TANGENT0, + // outputs + out float4 oPosition : POSITION, + out float2 oUv : TEXCOORD0, + out float3 oLightDir : TEXCOORD1, // tangent space + out float3 oEyeDir : TEXCOORD2, // tangent space + out float3 oHalfAngle : TEXCOORD3, // + // parameters + uniform float4 lightPosition, // object space + uniform float3 eyePosition, // object space + uniform float4x4 worldViewProj) +{ + // calculate output position + oPosition = mul(worldViewProj, position); + + // pass the main uvs straight through unchanged + oUv = uv; + + // calculate tangent space light vector + // Get object space light direction + float3 lightDir = normalize(lightPosition.xyz - (position * lightPosition.w)); + float3 eyeDir = eyePosition - position.xyz; + + // Calculate the binormal (NB we assume both normal and tangent are + // already normalised) + // NB looks like nvidia cross params are BACKWARDS to what you'd expect + // this equates to NxT, not TxN + float3 binormal = cross(tangent, normal); + + // Form a rotation matrix out of the vectors + float3x3 rotation = float3x3(tangent, binormal, normal); + + // Transform the light vector according to this matrix + lightDir = normalize(mul(rotation, lightDir)); + eyeDir = normalize(mul(rotation, eyeDir)); + + oLightDir = lightDir; + oEyeDir = eyeDir; + oHalfAngle = normalize(eyeDir + lightDir); +} + +// General functions + +// Expand a range-compressed vector +float3 expand(float3 v) +{ + return (v - 0.5) * 2; +} + +void main_fp(float2 uv : TEXCOORD0, + float3 lightDir : TEXCOORD1, + float3 eyeDir : TEXCOORD2, + float3 halfAngle : TEXCOORD3, + uniform float3 lightDiffuse, + uniform float3 lightSpecular, + uniform float4 scaleBias, + uniform sampler2D normalHeightMap, + uniform sampler2D diffuseMap, + out float4 oColor : COLOR) +{ + // get the height using the tex coords + float height = tex2D(normalHeightMap, uv).a; + + // scale and bias factors + float scale = scaleBias.x; + float bias = scaleBias.y; + + // calculate displacement + float displacement = (height * scale) + bias; + + float3 uv2 = float3(uv, 1); + + // calculate the new tex coord to use for normal and diffuse + float2 newTexCoord = ((eyeDir * displacement) + uv2).xy; + + // get the new normal and diffuse values + float3 normal = expand(tex2D(normalHeightMap, newTexCoord).xyz); + float3 diffuse = tex2D(diffuseMap, newTexCoord).xyz; + + float3 specular = pow(saturate(dot(normal, halfAngle)), 32) * lightSpecular; + float3 col = diffuse * saturate(dot(normal, lightDir)) * lightDiffuse + specular; + + oColor = float4(col, 1); +} + + Added: branches/ogsector/data/MediaFromOgre/AdvancedMaterials/OffsetMapping.material =================================================================== --- branches/ogsector/data/MediaFromOgre/AdvancedMaterials/OffsetMapping.material (rev 0) +++ branches/ogsector/data/MediaFromOgre/AdvancedMaterials/OffsetMapping.material 2007-04-21 18:02:53 UTC (rev 411) @@ -0,0 +1,242 @@ +// Bump map with Parallax offset vertex program, support for this is required +vertex_program Examples/OffsetMappingVP cg +{ + source OffsetMapping.cg + entry_point main_vp + profiles vs_1_1 arbvp1 +} + +// Bump map with parallax fragment program +fragment_program Examples/OffsetMappingFP cg +{ + source OffsetMapping.cg + entry_point main_fp + profiles ps_2_0 arbfp1 +} + +// Bump map with parallax fragment program +fragment_program Examples/OffsetMappingPS asm +{ + source OffsetMapping_specular.asm + // sorry, only for ps_1_4 and above:) + syntax ps_1_4 +} + + +material Examples/OffsetMapping/Specular +{ + + // This is the preferred technique which uses both vertex and + // fragment programs, supports coloured lights + technique + { + // do the lighting and bump mapping with parallax pass + pass + { + + // Vertex program reference + vertex_program_ref Examples/OffsetMappingVP + { + param_named_auto lightPosition light_position_object_space 0 + param_named_auto eyePosition camera_position_object_space + param_named_auto worldViewProj worldviewproj_matrix + } + + // Fragment program + fragment_program_ref Examples/OffsetMappingFP + { + param_named_auto lightDiffuse light_diffuse_colour 0 + param_named_auto lightSpecular light_specular_colour 0 + // Parallax Height scale and bias + param_named scaleBias float4 0.04 -0.02 1 0 + } + + // Normal + height(alpha) map + texture_unit + { + texture rockwall_NH.png + tex_coord_set 0 + } + + // Base diffuse texture map + texture_unit + { + texture rockwall.png + tex_coord_set 1 + } + } + } + + + // This is the preferred technique which uses both vertex and + // fragment programs, supports coloured lights + technique + { + // do the lighting and bump mapping with parallax pass + pass + { + + // Vertex program reference + vertex_program_ref Examples/OffsetMappingVP + { + param_named_auto lightPosition light_position_object_space 0 + param_named_auto eyePosition camera_position_object_space + param_named_auto worldViewProj worldviewproj_matrix + } + + // Fragment program + fragment_program_ref Examples/OffsetMappingPS + { + param_indexed_auto 0 light_diffuse_colour 0 + param_indexed_auto 1 light_specular_colour 0 + // Parallax Height scale and bias + param_indexed 2 float4 0.04 -0.02 1 0 + } + + // Normal + height(alpha) map + texture_unit + { + texture rockwall_NH.png + tex_coord_set 0 + } + + // Base diffuse texture map + texture_unit + { + texture rockwall.png + tex_coord_set 1 + } + } + } + + // Simple no-shader fallback + technique + { + pass + { + // Base diffuse texture map + texture_unit + { + texture rockwall.png + } + } + } + +} + + + +// Single-pass offset mapping with shadows +vertex_program Examples/OffsetMappingIntegratedShadowsVPhlsl hlsl +{ + source OffsetMapping.hlsl + entry_point integratedshadows_vp + target vs_2_0 +} +vertex_program Examples/OffsetMappingIntegratedShadowsVPglsl glsl +{ + source OffsetMappingVp.glsl +} + +// Single-pass offset mapping with shadows +fragment_program Examples/OffsetMappingIntegratedShadowsFPhlsl hlsl +{ + source OffsetMapping.hlsl + entry_point integratedshadows_fp + target ps_2_0 +} +fragment_program Examples/OffsetMappingIntegratedShadowsFPglsl glsl +{ + source OffsetMappingFp.glsl + default_params + { + // assign samplers as required by GLSL + param_named normalHeightMap int 0 + param_named diffuseMap int 1 + param_named shadowMap1 int 2 + param_named shadowMap2 int 3 + } +} +// Single-pass offset mapping with shadows +vertex_program Examples/OffsetMappingIntegratedShadowsVP unified +{ + delegate Examples/OffsetMappingIntegratedShadowsVPhlsl + delegate Examples/OffsetMappingIntegratedShadowsVPglsl +} +// Single-pass offset mapping with shadows +fragment_program Examples/OffsetMappingIntegratedShadowsFP unified +{ + delegate Examples/OffsetMappingIntegratedShadowsFPhlsl + delegate Examples/OffsetMappingIntegratedShadowsFPglsl +} + + + +material Examples/OffsetMapping/IntegratedShadows +{ + + technique + { + // do the lighting and bump mapping with parallax pass + pass + { + + // Vertex program reference + vertex_program_ref Examples/OffsetMappingIntegratedShadowsVP + { + param_named_auto lightPosition light_position_object_space 0 + param_named_auto eyePosition camera_position_object_space + param_named_auto worldViewProj worldviewproj_matrix + param_named_auto spotDirection light_direction_object_space 0 + + param_named_auto lightPosition1 light_position_object_space 1 + param_named_auto spotDirection1 light_direction_object_space 1 + // shadow texture projections + param_named_auto worldMatrix world_matrix + param_named_auto texViewProj1 texture_viewproj_matrix 0 + param_named_auto texViewProj2 texture_viewproj_matrix 1 + } + + // Fragment program + fragment_program_ref Examples/OffsetMappingIntegratedShadowsFP + { + param_named_auto lightDiffuse light_diffuse_colour 0 + param_named_auto spotParams spotlight_params 0 + + param_named_auto lightDiffuse1 light_diffuse_colour 1 + param_named_auto spotParams1 spotlight_params 1 + // Parallax Height scale and bias + param_named scaleBias float4 0.04 -0.02 1 0 + } + + // Normal + height(alpha) map + texture_unit + { + texture rockwall_NH.png + tex_coord_set 0 + } + + // Base diffuse texture map + texture_unit + { + texture rockwall.png + tex_coord_set 1 + } + + // shadowmap 1 + texture_unit + { + content_type shadow + } + // shadowmap 2 + texture_unit + { + content_type shadow + } + } + } + + + +} + Added: branches/ogsector/data/MediaFromOgre/AdvancedMaterials/OffsetMappingFp.glsl =================================================================== --- branches/ogsector/data/MediaFromOgre/AdvancedMaterials/OffsetMappingFp.glsl (rev 0) +++ branches/ogsector/data/MediaFromOgre/AdvancedMaterials/OffsetMappingFp.glsl 2007-04-21 18:02:53 UTC (rev 411) @@ -0,0 +1,69 @@ +uniform vec4 lightDiffuse; +uniform vec4 scaleBias; +uniform vec4 spotParams; +uniform vec4 lightDiffuse1; +uniform vec4 spotParams1; + +uniform sampler2D normalHeightMap; +uniform sampler2D diffuseMap; +uniform sampler2D shadowMap1; +uniform sampler2D shadowMap2; + + + +varying vec3 tangentEyeDir; +varying vec3 tangentLightDir[2]; +varying vec3 tangentSpotDir[2]; +varying vec4 shadowUV[2]; + + +// Expand a range-compressed vector +vec3 expand(vec3 v) +{ + return (v - 0.5) * 2.0; +} + + +void main() +{ + // get the height using the tex coords + float height = texture2D(normalHeightMap, gl_TexCoord[0].xy).a; + // scale and bias factors + float scale = scaleBias.x; + float bias = scaleBias.y; + + // calculate displacement + float displacement = (height * scale) + bias; + //float displacement = (height * 0.04) - 0.02; + + vec3 scaledEyeDir = tangentEyeDir * displacement; + + // calculate the new tex coord to use for normal and diffuse + vec2 newTexCoord = (scaledEyeDir + gl_TexCoord[0].xyz).xy; + + // get the new normal and diffuse values + vec3 normal = expand(texture2D(normalHeightMap, newTexCoord).xyz); + vec4 diffuse = texture2D(diffuseMap, newTexCoord); + + vec4 col1 = diffuse * clamp(dot(normal, tangentLightDir[0]),0.0,1.0) * lightDiffuse; + // factor in spotlight angle + float rho = clamp(dot(tangentSpotDir[0], tangentLightDir[0]),0.0,1.0); + // factor = (rho - cos(outer/2) / cos(inner/2) - cos(outer/2)) ^ falloff + float spotFactor = pow( + clamp(rho - spotParams.y,0.0,1.0) / (spotParams.x - spotParams.y), spotParams.z); + col1 = col1 * spotFactor; + vec4 col2 = diffuse * clamp(dot(normal, tangentLightDir[1]),0.0,1.0) * lightDiffuse1; + // factor in spotlight angle + rho = clamp(dot(tangentSpotDir[1], tangentLightDir[1]),0.0,1.0); + // factor = (rho - cos(outer/2) / cos(inner/2) - cos(outer/2)) ^ falloff + spotFactor = pow( + clamp(rho - spotParams1.y,0.0,1.0) / (spotParams1.x - spotParams1.y), spotParams1.z); + col2 = col2 * spotFactor; + + // shadow textures + col1 = col1 * texture2DProj(shadowMap1, shadowUV[0]); + col2 = col2 * texture2DProj(shadowMap2, shadowUV[1]); + + gl_FragColor = col1 + col2; + +} Added: branches/ogsector/data/MediaFromOgre/AdvancedMaterials/OffsetMappingVp.glsl =================================================================== --- branches/ogsector/data/MediaFromOgre/AdvancedMaterials/OffsetMappingVp.glsl (rev 0) +++ branches/ogsector/data/MediaFromOgre/AdvancedMaterials/OffsetMappingVp.glsl 2007-04-21 18:02:53 UTC (rev 411) @@ -0,0 +1,54 @@ +attribute vec3 tangent; + +uniform vec4 lightPosition; // object space +uniform vec4 lightPosition1; // object space +uniform vec4 eyePosition; // object space +uniform vec4 spotDirection; // object space +uniform vec4 spotDirection1; // object space +uniform mat4 worldViewProj; // not actually used but here for compat with HLSL +uniform mat4 worldMatrix; +uniform mat4 texViewProj1; +uniform mat4 texViewProj2; + + +varying vec3 tangentEyeDir; +varying vec3 tangentLightDir[2]; +varying vec3 tangentSpotDir[2]; +varying vec4 shadowUV[2]; + +void main() +{ + gl_Position = ftransform(); + + vec4 worldPos = worldMatrix * gl_Vertex; + + shadowUV[0] = texViewProj1 * worldPos; + shadowUV[1] = texViewProj2 * worldPos; + + // pass the main uvs straight through unchanged + gl_TexCoord[0] = gl_MultiTexCoord0; + + // calculate tangent space light vector + // Get object space light direction + vec3 lightDir = normalize(lightPosition.xyz - (gl_Vertex.xyz * lightPosition.w)); + vec3 lightDir1 = normalize(lightPosition1.xyz - (gl_Vertex.xyz * lightPosition1.w)); + + vec3 eyeDir = (eyePosition - gl_Vertex).xyz; + + // Calculate the binormal (NB we assume both normal and tangent are + // already normalised) + vec3 binormal = cross(gl_Normal, tangent); + + // Form a rotation matrix out of the vectors + mat3 rotation = mat3(tangent, binormal, gl_Normal); + + // Transform the light vector according to this matrix + tangentLightDir[0] = normalize(rotation * lightDir); + tangentLightDir[1] = normalize(rotation * lightDir1); + // Invert the Y on the eye dir since we'll be using this to alter UVs and + // GL has Y inverted + tangentEyeDir = normalize(rotation * eyeDir) * vec3(1, -1, 1); + + tangentSpotDir[0] = normalize(rotation * -spotDirection.xyz); + tangentSpotDir[1] = normalize(rotation * -spotDirection1.xyz); +} Added: branches/ogsector/data/MediaFromOgre/AdvancedMaterials/RustedMetal.jpg =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/MediaFromOgre/AdvancedMaterials/RustedMetal.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/MediaFromOgre/AdvancedMaterials/RustySteel.jpg =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/MediaFromOgre/AdvancedMaterials/RustySteel.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/MediaFromOgre/AdvancedMaterials/nm_bk.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/MediaFromOgre/AdvancedMaterials/nm_bk.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/MediaFromOgre/AdvancedMaterials/nm_dn.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/MediaFromOgre/AdvancedMaterials/nm_dn.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/MediaFromOgre/AdvancedMaterials/nm_fr.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/MediaFromOgre/AdvancedMaterials/nm_fr.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/MediaFromOgre/AdvancedMaterials/nm_lf.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/MediaFromOgre/AdvancedMaterials/nm_lf.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/MediaFromOgre/AdvancedMaterials/nm_rt.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/MediaFromOgre/AdvancedMaterials/nm_rt.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/MediaFromOgre/AdvancedMaterials/nm_up.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/MediaFromOgre/AdvancedMaterials/nm_up.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/MediaFromOgre/AdvancedMaterials/rockwall.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/MediaFromOgre/AdvancedMaterials/rockwall.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/MediaFromOgre/AdvancedMaterials/rockwall_NH.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/MediaFromOgre/AdvancedMaterials/rockwall_NH.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/MediaFromOgre/AdvancedMaterials/skinningTwoWeightsVp.glsl =================================================================== --- branches/ogsector/data/MediaFromOgre/AdvancedMaterials/skinningTwoWeightsVp.glsl (rev 0) +++ branches/ogsector/data/MediaFromOgre/AdvancedMaterials/skinningTwoWeightsVp.glsl 2007-04-21 18:02:53 UTC (rev 411) @@ -0,0 +1,57 @@ +// Example GLSL program for skinning with two bone weights per vertex + +attribute vec4 blendIndices; +attribute vec4 blendWeights; + +// 3x4 matrix, passed as vec4's for compatibility with GL 2.0 +// GL 2.0 supports 3x4 matrices +// Support 24 bones ie 24*3, but use 72 since our parser can pick that out for sizing +uniform vec4 worldMatrix3x4Array[72]; +uniform mat4 viewProjectionMatrix; +uniform vec4 lightPos[2]; +uniform vec4 lightDiffuseColour[2]; + +void main() +{ ... [truncated message content] |
From: <spo...@us...> - 2007-04-22 21:40:44
|
Revision: 413 http://svn.sourceforge.net/opengate/?rev=413&view=rev Author: spom_spom Date: 2007-04-22 14:40:45 -0700 (Sun, 22 Apr 2007) Log Message: ----------- 'My aiming sucks, dude.', (added: Duelist, fixed some issued, slightly code clearance) Modified Paths: -------------- branches/ogsector/data/mousePointer.material branches/ogsector/data/mousePointer.overlay branches/ogsector/data/simpleHUD.material branches/ogsector/data/simpleHUD.overlay branches/ogsector/data/textures/hudCenter.png branches/ogsector/ogre.cfg branches/ogsector/src/LogManager.cpp branches/ogsector/src/Makefile.am branches/ogsector/src/Makefile.in branches/ogsector/src/Sector.cpp branches/ogsector/src/SectorClientFrameListener.cpp branches/ogsector/src/SectorClientFrameListener.h branches/ogsector/src/SectorObjects.cpp branches/ogsector/src/SectorObjects.h branches/ogsector/src/networkServer.cpp branches/ogsector/src/networkServer.h branches/ogsector/src/networkServerUser.cpp branches/ogsector/src/ogconsole.cpp branches/ogsector/src/ogsectorclient.cpp branches/ogsector/src/ogsectorserver.cpp Added Paths: ----------- branches/ogsector/data/textures/duelistPilotPointer.png branches/ogsector/data/textures/duelistTargetPointer.png branches/ogsector/data/textures/flightCurser.png branches/ogsector/data/textures/targetPointer.png Removed Paths: ------------- branches/ogsector/data/textures/hudTarget.png Modified: branches/ogsector/data/mousePointer.material =================================================================== --- branches/ogsector/data/mousePointer.material 2007-04-21 19:48:08 UTC (rev 412) +++ branches/ogsector/data/mousePointer.material 2007-04-22 21:40:45 UTC (rev 413) @@ -1,17 +1,18 @@ -material OpenGate/MousePointer -{ - technique - { - pass - { - depth_check off - lighting off - scene_blend alpha_blend - - texture_unit - { - texture textures/mousePointer.png - } - } - } -} +//material OpenGate/FlightCurser +//{ +// technique +// { +// pass +// { +// depth_check off +// lighting off +// scene_blend alpha_blend +// +// texture_unit +// { +// texture textures/flightCurser.png +// } +// } +// } +//} +// Modified: branches/ogsector/data/mousePointer.overlay =================================================================== --- branches/ogsector/data/mousePointer.overlay 2007-04-21 19:48:08 UTC (rev 412) +++ branches/ogsector/data/mousePointer.overlay 2007-04-22 21:40:45 UTC (rev 413) @@ -1,13 +1,13 @@ -OpenGate/MousePointer -{ - zorder 502 - container Panel(OpenGate/MousePointer/Pointer) - { - metrics_mode pixels - top 0 - left 0 - width 32 - height 32 - material OpenGate/MousePointer - } -} \ No newline at end of file +//OpenGate/MousePointer +//{ +// zorder 502 +// container Panel(OpenGate/MousePointer/Pointer) +// { +// metrics_mode pixels +// top 0 +// left 0 +// width 32 +// height 32 +// material OpenGate/MousePointer +// } +//} \ No newline at end of file Modified: branches/ogsector/data/simpleHUD.material =================================================================== --- branches/ogsector/data/simpleHUD.material 2007-04-21 19:48:08 UTC (rev 412) +++ branches/ogsector/data/simpleHUD.material 2007-04-22 21:40:45 UTC (rev 413) @@ -1,4 +1,4 @@ -material OpenGate/SimpleHUD/CenterPointer +material SimpleHUD/FlightCurser { technique { @@ -10,13 +10,31 @@ texture_unit { + texture textures/flightCurser.png + } + } + } +} + +material SimpleHUD/CenterPointer +{ + technique + { + pass + { + depth_check off + lighting off + scene_blend alpha_blend + + texture_unit + { texture textures/hudCenter.png } } } } -material OpenGate/SimpleHUD/TargetPointer +material SimpleHUD/TargetPointer { technique { @@ -28,12 +46,48 @@ texture_unit { - texture textures/hudTarget.png + texture textures/targetPointer.png } } } } +material SimpleHUD/DuelistPilotPointer +{ + technique + { + pass + { + depth_check off + lighting off + scene_blend alpha_blend + + texture_unit + { + texture textures/duelistPilotPointer.png + } + } + } +} + +material SimpleHUD/DuelistTargetPointer +{ + technique + { + pass + { + depth_check off + lighting off + scene_blend alpha_blend + + texture_unit + { + texture textures/duelistTargetPointer.png + } + } + } +} + material OpenGate/Console/Background { technique Modified: branches/ogsector/data/simpleHUD.overlay =================================================================== --- branches/ogsector/data/simpleHUD.overlay 2007-04-21 19:48:08 UTC (rev 412) +++ branches/ogsector/data/simpleHUD.overlay 2007-04-22 21:40:45 UTC (rev 413) @@ -1,24 +1,24 @@ -OpenGate/Radar +Radar { zorder 501 - container Panel(OpenGate/Radar/Map) + container Panel(Radar/Map) { - left 0.35 - top 0.8 - width 0.3 - height 0.2 + left 0.4 + top 0.84 + width 0.2 + height 0.15 material OpenGate/Radar/Background } -// container Panel(OpenGate/Radar/Dot) +// container Panel(Radar/Dot) // { -// material OpenGate/Radar/Dot +// material Radar/Dot // } } -OpenGate/SimpleHUD +SimpleHUD { zorder 500 - container Panel(OpenGate/SimpleHUDConsole) + container Panel(SimpleHUD/Console) { left 0.01 top 0.01 @@ -26,7 +26,7 @@ height 0.5 material OpenGate/Console/Background - element TextArea(OpenGate/SimpleHUDConsoleTextArea) + element TextArea(SimpleHUD/Console/TextArea) { left 0.01 top 0.01 @@ -39,7 +39,7 @@ } } - container Panel(OpenGate/SimpleHUDConsoleShort) + container Panel(SimpleHUD/ConsoleShort) { left 0.01 top 0.01 @@ -47,7 +47,7 @@ height 0.075 // material OpenGate/Console/Background - element TextArea(OpenGate/SimpleHUDConsoleShortTextArea) + element TextArea(SimpleHUD/ConsoleShort/TextArea) { left 0.01 top 0.01 @@ -60,7 +60,7 @@ } } - container Panel(OpenGate/SimpleHUDChatInPanel) + container Panel(SimpleHUD/ChatIn) { left 0.01 top 0.52 @@ -68,7 +68,7 @@ height 0.025 material OpenGate/Console/Background - element TextArea(OpenGate/SimpleHUDChatInTextField) + element TextArea(SimpleHUD/ChatIn/TextArea) { left 0.01 top 0.005 @@ -81,34 +81,64 @@ } } - container Panel(OpenGate/CenterPointer) + container Panel(SimpleHUD/CenterPointer) { metrics_mode pixels top 0 left 0 + width 48 + height 48 + material SimpleHUD/CenterPointer + } + + container Panel(SimpleHUD/FlightCurser) + { + metrics_mode pixels + top 0 + left 0 width 32 height 32 - material OpenGate/SimpleHUD/CenterPointer + material SimpleHUD/FlightCurser } - container Panel(OpenGate/TargetPointer) + container Panel(SimpleHUD/TargetPointer) { metrics_mode pixels top 0 left 0 width 32 height 32 - material OpenGate/SimpleHUD/TargetPointer + material SimpleHUD/TargetPointer } - container Panel(OpenGate/SimpleHUDPanel) + container Panel(SimpleHUD/DuelistPilotPointer) + { + metrics_mode pixels + top 0 + left 0 + width 32 + height 32 + material SimpleHUD/DuelistPilotPointer + } + + container Panel(SimpleHUD/DuelistTargetPointer) + { + metrics_mode pixels + top 0 + left 0 + width 32 + height 32 + material SimpleHUD/DuelistTargetPointer + } + + container Panel(SimpleHUD/MainPanel) { left 0 top 0 width 1.0 height 1.0 - element TextArea(OpenGate/SimpleHUDTextStats) + element TextArea(SimpleHUD/MainPanel/StatsTextArea) { left 0.8 top 0.01 @@ -121,7 +151,7 @@ colour_bottom 1 1 0.7 } - element TextArea(OpenGate/SimpleHUDTextVelocity) + element TextArea(SimpleHUD/MainPanel/TextVelocity) { left 0.25 top 0.3 @@ -133,7 +163,7 @@ colour_top 0.5 0.7 0.5 colour_bottom 0.3 0.5 0.3 } - element TextArea(OpenGate/SimpleHUDTextVelocityMax) + element TextArea(SimpleHUD/MainPanel/TextVelocityMax) { left 0.31 top 0.3 @@ -145,7 +175,7 @@ colour_top 0.5 0.7 0.5 colour_bottom 0.3 0.5 0.3 } - element TextArea(OpenGate/SimpleHUDTextThr) + element TextArea(SimpleHUD/MainPanel/TextThr) { left 0.25 top 0.33 @@ -157,7 +187,7 @@ colour_top 0.5 0.7 0.5 colour_bottom 0.3 0.5 0.3 } - element TextArea(OpenGate/SimpleHUDTextAcc) + element TextArea(SimpleHUD/MainPanel/TextAcc) { left 0.25 top 0.36 @@ -169,7 +199,7 @@ colour_top 0.5 0.7 0.5 colour_bottom 0.3 0.5 0.3 } - element TextArea(OpenGate/SimpleHUDTextShield) + element TextArea(SimpleHUD/MainPanel/TextShield) { left 0.25 top 0.39 @@ -180,7 +210,7 @@ colour_top 0.5 0.7 0.5 colour_bottom 0.3 0.5 0.3 } - element TextArea(OpenGate/SimpleHUDTextArmor) + element TextArea(SimpleHUD/MainPanel/TextArmor) { left 0.25 top 0.42 @@ -191,7 +221,7 @@ colour_top 0.5 0.7 0.5 colour_bottom 0.3 0.5 0.3 } - element TextArea(OpenGate/SimpleHUDTextPosition) + element TextArea(SimpleHUD/MainPanel/TextPosition) { left 0.25 top 0.45 @@ -204,7 +234,7 @@ colour_bottom 0.3 0.5 0.3 } - element TextArea(OpenGate/SimpleHUDTextTargetName) + element TextArea(SimpleHUD/MainPanel/TextTargetName) { left 0.015 top 0.80 @@ -215,7 +245,7 @@ colour_top 0.5 0.7 0.5 colour_bottom 0.3 0.5 0.3 } - element TextArea(OpenGate/SimpleHUDTextTargetDistance) + element TextArea(SimpleHUD/MainPanel/TextTargetDistance) { left 0.015 top 0.82 @@ -226,7 +256,7 @@ colour_top 0.5 0.7 0.5 colour_bottom 0.3 0.5 0.3 } - element TextArea(OpenGate/SimpleHUDTextTargetVelocity) + element TextArea(SimpleHUD/MainPanel/TextTargetVelocity) { left 0.17 top 0.84 @@ -238,7 +268,7 @@ colour_bottom 0.3 0.5 0.3 } - element TextArea(OpenGate/SimpleHUDTextTargetShield) + element TextArea(SimpleHUD/MainPanel/TextTargetShield) { left 0.17 top 0.86 @@ -249,7 +279,7 @@ colour_top 0.5 0.7 0.5 colour_bottom 0.3 0.5 0.3 } - element TextArea(OpenGate/SimpleHUDTextTargetArmor) + element TextArea(SimpleHUD/MainPanel/TextTargetArmor) { left 0.17 top 0.88 Added: branches/ogsector/data/textures/duelistPilotPointer.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/textures/duelistPilotPointer.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/textures/duelistTargetPointer.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/textures/duelistTargetPointer.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/textures/flightCurser.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/textures/flightCurser.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: branches/ogsector/data/textures/hudCenter.png =================================================================== (Binary files differ) Deleted: branches/ogsector/data/textures/hudTarget.png =================================================================== (Binary files differ) Added: branches/ogsector/data/textures/targetPointer.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/textures/targetPointer.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: branches/ogsector/ogre.cfg =================================================================== --- branches/ogsector/ogre.cfg 2007-04-21 19:48:08 UTC (rev 412) +++ branches/ogsector/ogre.cfg 2007-04-22 21:40:45 UTC (rev 413) @@ -4,5 +4,5 @@ FSAA=6 Full Screen=No RTT Preferred Mode=FBO -Refresh Rate=75 -Video Mode=1024x768 +Refresh Rate=Not applicable +Video Mode=1024 x 768 Modified: branches/ogsector/src/LogManager.cpp =================================================================== --- branches/ogsector/src/LogManager.cpp 2007-04-21 19:48:08 UTC (rev 412) +++ branches/ogsector/src/LogManager.cpp 2007-04-22 21:40:45 UTC (rev 413) @@ -1,4 +1,5 @@ #include "LogManager.h" +#include "ogconsole.h" namespace OpenGate{ @@ -50,21 +51,25 @@ if ( haveChatLogFile_ ) chatLogFile_ << timeStamp() << " " << logMsg << std::endl; writeToConsole_( logMsg ); - write_( logMsg ); + cout( logMsg ); } void LogManager::info( const std::string & msg ){ - writeToConsole_( msg ); - write_( msg ); + std::string logMsg( "INFO: " + msg ); + writeToConsole_( logMsg ); + write_( logMsg ); } void LogManager::debug( const std::string & msg ){ - write_( msg ); + std::string logMsg( "DEBUG: " + msg ); + write_( logMsg ); } void LogManager::fatal( const std::string & msg ){ - writeToConsole_( msg ); - write_( msg ); + std::string logMsg( "FATAL: " + msg ); + + writeToConsole_( logMsg ); + write_( logMsg ); } void LogManager::cout( const std::string & msg ){ Modified: branches/ogsector/src/Makefile.am =================================================================== --- branches/ogsector/src/Makefile.am 2007-04-21 19:48:08 UTC (rev 412) +++ branches/ogsector/src/Makefile.am 2007-04-22 21:40:45 UTC (rev 413) @@ -29,6 +29,12 @@ ogsectorserver.cpp \ common.h \ common.cpp \ + LogManager.h \ + LogManager.cpp \ + ogconsole.h \ + ogconsole.cpp \ + InputManager.h \ + InputManager.cpp \ networkProtocol.h \ networkServer.h \ networkServer.cpp \ Modified: branches/ogsector/src/Makefile.in =================================================================== --- branches/ogsector/src/Makefile.in 2007-04-21 19:48:08 UTC (rev 412) +++ branches/ogsector/src/Makefile.in 2007-04-22 21:40:45 UTC (rev 413) @@ -56,7 +56,9 @@ ogsectorclient_OBJECTS = $(am_ogsectorclient_OBJECTS) ogsectorclient_LDADD = $(LDADD) am_ogsectorserver_OBJECTS = ogsectorserver.$(OBJEXT) common.$(OBJEXT) \ - networkServer.$(OBJEXT) networkServerUser.$(OBJEXT) + LogManager.$(OBJEXT) ogconsole.$(OBJEXT) \ + InputManager.$(OBJEXT) networkServer.$(OBJEXT) \ + networkServerUser.$(OBJEXT) ogsectorserver_OBJECTS = $(am_ogsectorserver_OBJECTS) ogsectorserver_LDADD = $(LDADD) am_testopenalmanager_OBJECTS = testopenalmanager.$(OBJEXT) \ @@ -196,6 +198,12 @@ ogsectorserver.cpp \ common.h \ common.cpp \ + LogManager.h \ + LogManager.cpp \ + ogconsole.h \ + ogconsole.cpp \ + InputManager.h \ + InputManager.cpp \ networkProtocol.h \ networkServer.h \ networkServer.cpp \ Modified: branches/ogsector/src/Sector.cpp =================================================================== --- branches/ogsector/src/Sector.cpp 2007-04-21 19:48:08 UTC (rev 412) +++ branches/ogsector/src/Sector.cpp 2007-04-22 21:40:45 UTC (rev 413) @@ -71,16 +71,16 @@ //*** starfield test 2 - starsNode_ = sceneMgr_->getRootSceneNode()->createChildSceneNode("StarfieldNode"); - Ogre::BillboardSet* mySet = sceneMgr_->createBillboardSet("StarfieldNode"); - mySet->setMaterialName( "OpenGate/Star"); - for ( int i = 0; i < 1000; i ++ ){ - Ogre::Billboard* myBillboard = mySet->createBillboard(Ogre::Vector3(Ogre::Math::RangeRandom(-1,1), - Ogre::Math::RangeRandom(-1,1), - Ogre::Math::RangeRandom(-1,1)).normalisedCopy()* Ogre::Math::RangeRandom( 1000, 3000 ) ); - myBillboard->setDimensions( 10, 10 ); - } - starsNode_->attachObject(mySet); +// starsNode_ = sceneMgr_->getRootSceneNode()->createChildSceneNode("StarfieldNode"); +// Ogre::BillboardSet* mySet = sceneMgr_->createBillboardSet("StarfieldNode"); +// mySet->setMaterialName( "OpenGate/Star"); +// for ( int i = 0; i < 1000; i ++ ){ +// Ogre::Billboard* myBillboard = mySet->createBillboard(Ogre::Vector3(Ogre::Math::RangeRandom(-1,1), +// Ogre::Math::RangeRandom(-1,1), +// Ogre::Math::RangeRandom(-1,1)).normalisedCopy()* Ogre::Math::RangeRandom( 1000, 3000 ) ); +// myBillboard->setDimensions( 10, 10 ); +// } +// starsNode_->attachObject(mySet); //*** end starfield test 2; @@ -186,6 +186,12 @@ Ogre::Real( 10.0 ), Ogre::Degree( 0.0 ) ); +// createStaticObject( Ogre::String("local/squid/Plane.001.mesh"), +// "Testsquid", +// Ogre::Vector3( 0, 0, 300 ), +// Ogre::Real( 7.0 ), +// Ogre::Degree( 0.0 ) ); + itTarget_ = sectorObjects_.begin(); } @@ -241,8 +247,8 @@ } - Ogre::Overlay * radar = Ogre::OverlayManager::getSingleton().getByName( "OpenGate/Radar" ); - Ogre::OverlayContainer * radarMap = radar->getChild( "OpenGate/Radar/Map" ); + Ogre::Overlay * radar = Ogre::OverlayManager::getSingleton().getByName( "Radar" ); + Ogre::OverlayContainer * radarMap = radar->getChild( "Radar/Map" ); int dotAWidth = 4; int dotAHeight = 2; @@ -260,14 +266,14 @@ Ogre::OverlayElement * dotA, * dotB; if ( !(*it)->isOnRadar() ) { - dotA = Ogre::OverlayManager::getSingleton().createOverlayElement( "Panel", "Overlay/Radar/DotA" + (*it)->name() ); + 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 ); - dotB = Ogre::OverlayManager::getSingleton().createOverlayElement( "Panel", "Overlay/Radar/DotB" + (*it)->name() ); + dotB = Ogre::OverlayManager::getSingleton().createOverlayElement( "Panel", "Radar/Map/DotB" + (*it)->name() ); dotB->setMaterialName( "BaseWhite" ); dotB->setMetricsMode( Ogre::GMM_PIXELS ); dotB->setWidth( 1 ); @@ -277,8 +283,8 @@ (*it)->onRadar( true ); } else { - dotA = radarMap->getChild( "Overlay/Radar/DotA" + (*it)->name() ); - dotB = radarMap->getChild( "Overlay/Radar/DotB" + (*it)->name() ); + dotA = radarMap->getChild( "Radar/Map/DotA" + (*it)->name() ); + dotB = radarMap->getChild( "Radar/Map/DotB" + (*it)->name() ); } Ogre::Quaternion q; @@ -341,15 +347,12 @@ if ( listener_->target() == obj ) listener_->setTarget( nextTarget() ); sectorObjects_.erase( obj ); - Ogre::Overlay * radar = Ogre::OverlayManager::getSingleton().getByName( "OpenGate/Radar" ); - Ogre::OverlayContainer * radarMap = radar->getChild( "OpenGate/Radar/Map" ); - Ogre::OverlayElement *dotA = radarMap->getChild( "Overlay/Radar/DotA" + obj->name() ); - Ogre::OverlayElement *dotB = radarMap->getChild( "Overlay/Radar/DotB" + obj->name() ); - radarMap->removeChild( "Overlay/Radar/DotA" + obj->name() ); - radarMap->removeChild( "Overlay/Radar/DotB" + obj->name() ); - // Ogre::OverlayManager::getSingleton().destroyOverlayElementImpl( dotA ); - Ogre::OverlayManager::getSingleton().destroyOverlayElement( "Overlay/Radar/DotA" + obj->name() ); - Ogre::OverlayManager::getSingleton().destroyOverlayElement( "Overlay/Radar/DotB" + obj->name() ); + 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() ); switch ( obj->getTypeID() ){ case SECTOROBJECTMOVABLE_RTTI: @@ -524,7 +527,7 @@ if ( movableObjects_.count( createGlobalID( msg.senderID(), msg.childID() ) ) ){ if ( msg.status() == false ){ - log_->info( "Deregistering " + msg.name() ); + log_->info( "Deregistering " + movableObjects_[ createGlobalID( msg.senderID(), msg.childID() ) ]->name() ); destructMoveableObject( movableObjects_[ createGlobalID( msg.senderID(), msg.childID() ) ] ); } else { log_->info( "Object " + msg.name() + " allready registered." ); Modified: branches/ogsector/src/SectorClientFrameListener.cpp =================================================================== --- branches/ogsector/src/SectorClientFrameListener.cpp 2007-04-21 19:48:08 UTC (rev 412) +++ branches/ogsector/src/SectorClientFrameListener.cpp 2007-04-22 21:40:45 UTC (rev 413) @@ -39,7 +39,8 @@ cameraMode_ = 1; consoleMode_ = false; chatMode_ = false; - + duelistPilot_ = false; + duelistTarget_ = false; sector_->setListener( this ); windowsWidth_ = window_->getWidth( ); @@ -55,49 +56,31 @@ timeSinceLastSectorUpdate_ = 0.0; timeSinceLastNetworkUpdate_ = 0.0; - hudOverlay_ = Ogre::OverlayManager::getSingleton().getByName("OpenGate/SimpleHUD"); - Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDChatInPanel")->hide( ); + overlayName_ = "SimpleHUD"; - Ogre::OverlayElement* hudCenter = Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/CenterPointer"); - hudCenter->setTop( windowsHalfHeight_ - 16 ); - hudCenter->setLeft( windowsHalfWidth_ - 16 ); + hudOverlay_ = Ogre::OverlayManager::getSingleton().getByName( overlayName_ ); + hudOverlay_->getChild( overlayName_ + "/ChatIn" )->hide( ); + + Ogre::OverlayElement * centerPointer_ = hudOverlay_->getChild( overlayName_ + "/CenterPointer" ); + centerPointer_->setTop( windowsHalfHeight_ - centerPointer_->getHeight() / 2 ); + centerPointer_->setLeft( windowsHalfWidth_ - centerPointer_->getWidth() / 2 ); + + mousePointer_ = hudOverlay_->getChild( overlayName_ + "/FlightCurser" ); + mousePointer_->setTop( windowsHalfHeight_ - mousePointer_->getHeight() / 2 ); + mousePointer_->setLeft( windowsHalfWidth_ - mousePointer_->getWidth() / 2 ); hudOverlay_->show( ); - Ogre::OverlayManager::getSingleton().getByName( "OpenGate/MousePointer" )->show(); - mousePointer_ = Ogre::OverlayManager::getSingleton().getOverlayElement( "OpenGate/MousePointer/Pointer" ); - mousePointer_->setTop( windowsHalfHeight_ - 16 ); - mousePointer_->setLeft( windowsHalfWidth_ - 16 ); + Ogre::OverlayElement * duelistPilotPointer = hudOverlay_->getChild( overlayName_ + "/DuelistPilotPointer" ); + duelistPilotPointer->setLeft( windowsHalfWidth_ - duelistPilotPointer->getWidth() / 2 ); + duelistPilotPointer->setTop( windowsHalfHeight_ - duelistPilotPointer->getHeight() / 2 ); + duelistPilotPointer->show(); + hudOverlay_->getChild( overlayName_ + "/DuelistTargetPointer" )->hide(); - //** start radar hud; - Ogre::Overlay * radar = Ogre::OverlayManager::getSingleton().getByName( "OpenGate/Radar" ); + Ogre::Overlay * radar = Ogre::OverlayManager::getSingleton().getByName( "Radar" ); radar->show(); - // Ogre::Overlay * radar = Ogre::OverlayManager::getSingleton().getByName("OpenGate/Radar"); -// element Panel(OpenGate/Radar/Dot) -// { -// // material BaseWhiteNoLighting -// } - -// // Ogre::OverlayContainer * pMinMapElement = radar->getChild( "OpenGate/Radar/Dot" ); -// Ogre::OverlayContainer * pDot = (Ogre::OverlayContainer*)Ogre::OverlayManager::getSingleton().createOverlayElement( "Panel", "Dot"); - - - // Make sure the alignement and metrics are the same as the MiniMap -// pDot->setVerticalAlignment( pMinMapElement->getVerticalAlignment() ); -// pDot->setHorizontalAlignment( pMinMapElement->getHorizontalAlignment() ); -// pDot->setMetricsMode( pMinMapElement->getMetricsMode() ); -// pDot->setWidth( 10 ); -// pDot->setHeight( 10 ); -// Ogre::Overlay * radarMap = Ogre::OverlayManager::getSingleton().getByName("OpenGate/Radar/Map"); -// radarMap->add2D( pDot ); - //** end radar hud - // radar->show(); - - - - // cameraRotateSpeed_ = 36; // cameraRotateScale_ = 0.0f; // cameraMoveSpeed_ = 100; @@ -226,7 +209,7 @@ if ( !chatMode_ ){ if ( e.key == OIS::KC_RETURN) { - Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDChatInPanel")->show( ); + hudOverlay_->getChild( overlayName_ + "/ChatIn" )->show( ); chatMode_ = true; } @@ -269,6 +252,8 @@ } //** selfdestruct and eject; if ( e.key == OIS::KC_F11 ) { sector_->avatarDied(); } + if ( e.key == OIS::KC_F5 ){ duelistPilot_ = !duelistPilot_; } + if ( e.key == OIS::KC_F6 ){ duelistTarget_ = !duelistTarget_; } } // if avatar; //** next Target; @@ -301,20 +286,16 @@ } else { // ** chatmode if ( e.key != OIS::KC_BACK ) { - if ( (int)e.text > 32 && (int)e.text < 167 ) { + if ( (int)e.text > 31 && (int)e.text < 167 ) { chatString_ += e.text; } else { std::cout << (char)e.text << " " << e.text << std::endl; } - } else if ( chatString_.length() > 1 ) { + } else if ( chatString_.length() > 0 ) { chatString_ = chatString_.substr( 0, chatString_.length() - 1 ); } - Ogre::OverlayElement *hudChatIn = Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDChatInTextField"); -// hudChatIn->setCaption( chatString_ ); - - hudChatIn->setCaption( Ogre::UTFString( chatString_ ) ); - // hudChatIn->setCaption( Ogre::UTFString( chatString_ ).asUTF32_c_str() ); + hudOverlay_->getChild( overlayName_ + "/ChatIn/TextArea" )->setCaption( Ogre::UTFString( chatString_ ) ); if ( e.key == OIS::KC_RETURN) { @@ -322,8 +303,8 @@ network_->send( chat ); chatString_.clear(); - Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDChatInTextField")->setCaption( chatString_ ); - Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDChatInPanel")->hide( ); + hudOverlay_->getChild( overlayName_ + "/ChatIn/TextArea" )->setCaption( chatString_ ); + hudOverlay_->getChild( overlayName_ + "/ChatIn" )->hide( ); chatMode_ = false; } } @@ -366,11 +347,15 @@ mousePointer_->setLeft( mousePointer_->getLeft( ) + e.state.X.rel ); mousePointer_->setTop( mousePointer_->getTop( ) + e.state.Y.rel ); - if ( mousePointer_->getLeft( ) < -16 ) mousePointer_->setLeft( -16 ); - if ( mousePointer_->getTop( ) < -16 ) mousePointer_->setTop( -16 ); + Ogre::Real mousePointerWidth = mousePointer_->getWidth(); + Ogre::Real mousePointerHeight = mousePointer_->getHeight(); + if ( mousePointer_->getLeft( ) < -mousePointerWidth ) mousePointer_->setLeft( -mousePointerWidth ); + if ( mousePointer_->getTop( ) < -mousePointerHeight ) mousePointer_->setTop( -mousePointerHeight ); - if ( mousePointer_->getLeft( ) > windowsWidth_-16 ) mousePointer_->setLeft( windowsWidth_-16 ); - if ( mousePointer_->getTop( ) > windowsHeight_-16 ) mousePointer_->setTop( windowsHeight_-16 ); + if ( mousePointer_->getLeft( ) > windowsWidth_-mousePointerWidth ) mousePointer_->setLeft( windowsWidth_- + mousePointerWidth ); + if ( mousePointer_->getTop( ) > windowsHeight_-mousePointerHeight ) mousePointer_->setTop( windowsHeight_- + mousePointerHeight ); if ( sector_->avatar() != NULL ){ // std::cout << "X" << e.state.X.abs << " " << e.state.X.rel << " " << mousePointer_->getLeft( ) << std::endl; @@ -378,8 +363,8 @@ // std::cout << "Z" << e.state.Z.abs << " " << e.state.Z.rel<< std::endl; // return true; - int relativToMidPointX = (int)rint( (mousePointer_->getLeft( ) +16) - windowsHalfWidth_ ); - int relativToMidPointY = (int)rint( (mousePointer_->getTop( ) +16) - windowsHalfHeight_ ); + int relativToMidPointX = (int)rint( (mousePointer_->getLeft( ) + mousePointerWidth) - windowsHalfWidth_ ); + int relativToMidPointY = (int)rint( (mousePointer_->getTop( ) + mousePointerHeight) - windowsHalfHeight_ ); int minActiveZonePercent = 5; int maxActiveZonePercent = 90; @@ -456,43 +441,42 @@ int throwSliderAxis = 6; double axisScale = 32768; - //** deadzone - int minActiveZonePercent = 10; - int maxActiveZonePercent = 95; - - double minRadius = ( axisScale ) * minActiveZonePercent / 100; - double maxRadius = ( axisScale ) * maxActiveZonePercent / 100; - - Ogre::Real yaw = (e.state.mAxes[ joyStickAxisX ].abs) / (maxRadius); - Ogre::Real pitch = (e.state.mAxes[ joyStickAxisY ].abs) / (maxRadius); - Ogre::Real roll = (e.state.mAxes[ joyStickAxisZ ].abs) / (maxRadius); - Ogre::Real thrust = ( -e.state.mAxes[ throwSliderAxis ].abs + axisScale ) / (maxRadius*2); - - yaw = min( yaw, 1.0f ); yaw = max( yaw, -1.0f ); - pitch = min( pitch, 1.0f ); pitch = max( pitch, -1.0f ); - roll = min( roll, 1.0f ); roll = max( roll, -1.0f ); - thrust = min( thrust, 1.0f ); thrust = max( thrust, 0.0f ); - - - if ( fabs( e.state.mAxes[ joyStickAxisX ].abs ) < minRadius ) yaw = 0.0; - if ( fabs( e.state.mAxes[ joyStickAxisY ].abs ) < minRadius ) pitch = 0.0; - if ( fabs( e.state.mAxes[ joyStickAxisZ ].abs ) < minRadius ) roll = 0.0; - if ( fabs( -e.state.mAxes[ throwSliderAxis ].abs + axisScale ) < minRadius ) thrust = 0.0; - - //** little deadzone ; - // window_->setDebugText( "Joy Axis: X: " + StringConverter::toString( e.state.mAxes[ joyStickAxisX ].abs ) + - // " Y: " + StringConverter::toString( e.state.mAxes[ joyStickAxisY ].abs ) + - // " Z: " + StringConverter::toString( e.state.mAxes[ joyStickAxisZ ].abs ) + - // " T: " + StringConverter::toString( e.state.mAxes[ throwSliderAxis ].abs ) + - // " yaw: " + StringConverter::toString(yaw) + - // " pitch: " + StringConverter::toString(pitch) + - // " 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. ); + //** deadzone; + int minActiveZonePercent = 10; + int maxActiveZonePercent = 95; + + double minRadius = ( axisScale ) * minActiveZonePercent / 100; + double maxRadius = ( axisScale ) * maxActiveZonePercent / 100; + + Ogre::Real yaw = (e.state.mAxes[ joyStickAxisX ].abs) / (maxRadius); + Ogre::Real pitch = (e.state.mAxes[ joyStickAxisY ].abs) / (maxRadius); + Ogre::Real roll = (e.state.mAxes[ joyStickAxisZ ].abs) / (maxRadius); + Ogre::Real thrust = ( -e.state.mAxes[ throwSliderAxis ].abs + axisScale ) / (maxRadius*2); + + yaw = min( yaw, 1.0f ); yaw = max( yaw, -1.0f ); + pitch = min( pitch, 1.0f ); pitch = max( pitch, -1.0f ); + roll = min( roll, 1.0f ); roll = max( roll, -1.0f ); + thrust = min( thrust, 1.0f ); thrust = max( thrust, 0.0f ); + + if ( fabs( e.state.mAxes[ joyStickAxisX ].abs ) < minRadius ) yaw = 0.0; + if ( fabs( e.state.mAxes[ joyStickAxisY ].abs ) < minRadius ) pitch = 0.0; + if ( fabs( e.state.mAxes[ joyStickAxisZ ].abs ) < minRadius ) roll = 0.0; + if ( fabs( -e.state.mAxes[ throwSliderAxis ].abs + axisScale ) < minRadius ) thrust = 0.0; + + //** little deadzone ; + // window_->setDebugText( "Joy Axis: X: " + StringConverter::toString( e.state.mAxes[ joyStickAxisX ].abs ) + + // " Y: " + StringConverter::toString( e.state.mAxes[ joyStickAxisY ].abs ) + + // " Z: " + StringConverter::toString( e.state.mAxes[ joyStickAxisZ ].abs ) + + // " T: " + StringConverter::toString( e.state.mAxes[ throwSliderAxis ].abs ) + + // " yaw: " + StringConverter::toString(yaw) + + // " pitch: " + StringConverter::toString(pitch) + + // " 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. ); } // if avatar return true; } @@ -605,9 +589,11 @@ target_ = target; if ( target_ != NULL ){ - // std::cout << target_->name()<< std::endl; - Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextTargetName")->setCaption( target_->name() ); + hudOverlay_->getChild( overlayName_ + "/TargetPointer" )->show(); + Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + + "/MainPanel/TextTargetName" )->setCaption( target_->name() ); + // if ( hudTarget_->numChildren() > 0 ){ // hudTarget_->removeAllChildren( );// hudTarget_->getChild( "TargetTrans" ) ); // camera_->getSceneManager()->destroyEntity( "TargetShape" ); @@ -628,9 +614,8 @@ void SectorClientFrameListener::updateHUD_( void ) { const Ogre::RenderTarget::FrameStats & stats = window_->getStatistics(); - Ogre::OverlayElement* hudStat = - Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextStats"); - hudStat->setCaption( "fps: " + toStr( stats.lastFPS ) + " ping: " + toStr( network_->pingTime() ) + " ms" ); + Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/MainPanel/StatsTextArea" ) + ->setCaption( "fps: " + toStr( stats.lastFPS ) + " ping: " + toStr( network_->pingTime() ) + " ms" ); if ( sector_->avatar() != NULL ){ if ( fabs( sector_->avatar()->velocity() ) > 1e-1 ){ @@ -642,82 +627,131 @@ sector_->avatar()->flightArrow()->setVisible( false ); } + if ( target_ != NULL ) { sector_->avatar()->targetArrow()->setVisible( true ); Ogre::Vector3 distToTarget = target_->mainNode()->getPosition() - sector_->avatar()->mainNode()->getPosition(); - + sector_->avatar()->targetArrow()->setOrientation( sector_->avatar()->mainNode()->getOrientation() ); + sector_->avatar()->targetArrow()->setDirection( distToTarget.normalisedCopy(), Ogre::Node::TS_WORLD ); - sector_->avatar()->targetArrow()->setDirection( distToTarget.normalisedCopy(), - Ogre::Node::TS_WORLD ); + //** Start update targeting pointer and duelist pointers; + Ogre::Vector3 targetPos( target_->mainNode()->getPosition() ); + Ogre::Vector3 targetScreenPos( camera_->getProjectionMatrix() * ( camera_->getViewMatrix() * targetPos ) ); + +// poss.x = max( -1.0f, poss.x ); poss.x = min( 1.0f, poss.x ); +// poss.y = max( -1.0f, poss.y ); poss.y = min( 1.0f, poss.y ); - // Ogre::Vector3 targetPos; - // Ogre::Quaternion targetOrient; targetOri = target_->mainNode().getOrientation(); - // targetPos = target_->mainNode().getPosition(); + if ( targetScreenPos[ 2 ] < 1 ){ + //"getAABB()" || "Entity::getBoundingRadius" + Ogre::OverlayElement * hudTargetPointer = + Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/TargetPointer" ); - //** targeting pointer - Ogre::Vector3 poss = camera_->getProjectionMatrix() * (camera_->getViewMatrix() * target_->mainNode()->getPosition() ); - poss.x = max( -1.0f, poss.x ); poss.x = min( 1.0f, poss.x ); - poss.y = max( -1.0f, poss.y ); poss.y = min( 1.0f, poss.y ); + hudTargetPointer->setPosition( windowsHalfWidth_ + ( windowsHalfWidth_ * targetScreenPos[ 0 ] ) - + hudTargetPointer->getWidth()/2, + windowsHalfHeight_ + ( windowsHalfHeight_ * -targetScreenPos[ 1 ] ) - + hudTargetPointer->getHeight()/2 ); + hudTargetPointer->_update(); + } + + Ogre::Real ammoTimeToTarget( distToTarget.length() / sector_->avatar()->ammoSpeed() ); - Ogre::OverlayElement* hudTargetPointer = Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/TargetPointer"); - hudTargetPointer->show(); + Ogre::OverlayElement * duelistPilotPointer = + Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/DuelistPilotPointer" ); + if ( duelistPilot_ ){ + Ogre::Vector3 duelistPilotPos( sector_->avatar()->mainNode()->getPosition() + + - sector_->avatar()->mainNode()->getOrientation().zAxis().normalisedCopy() + * sector_->avatar()->ammoSpeed() * ammoTimeToTarget + + sector_->avatar()->velDirection() * ammoTimeToTarget ); - Ogre::OverlayElement* hudTargetDist = - Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextTargetDistance"); + Ogre::Vector3 duelistPilotScreenPos( camera_->getProjectionMatrix() * ( camera_->getViewMatrix() * duelistPilotPos ) ); + if ( duelistPilotScreenPos[ 2 ] < 1 ){ + duelistPilotPointer->setPosition( windowsHalfWidth_ + (windowsHalfWidth_ * duelistPilotScreenPos[ 0 ] ) - + duelistPilotPointer->getWidth()/2, + windowsHalfHeight_ + (windowsHalfHeight_ * -duelistPilotScreenPos[ 1 ] ) - + duelistPilotPointer->getHeight()/2 ); + duelistPilotPointer->_update(); + } + } else { + duelistPilotPointer->setPosition( windowsHalfWidth_ - duelistPilotPointer->getWidth()/2, + windowsHalfHeight_ - duelistPilotPointer->getHeight()/2 ); + } - Ogre::OverlayElement* hudTargetShield = - Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextTargetShield"); + //** start duelist TargetPointer; + + Ogre::OverlayElement * duelistTargetPointer = + Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/DuelistTargetPointer" ); + + if ( duelistTarget_ && + ( target_->getTypeID() == SECTOROBJECTMOVABLE_RTTI || + target_->getTypeID() == SECTOROBJECTMOVABLE_AI_RTTI ) ){ + + Ogre::OverlayElement * duelistTargetPointer = + Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/DuelistTargetPointer" ); + duelistTargetPointer->show(); + + Ogre::Vector3 duelistTargetPos( targetPos + dynamic_cast< SectorObjectMoveable *>( target_ )->velDirection() + * ammoTimeToTarget ); + Ogre::Vector3 duelistTargetScreenPos( camera_->getProjectionMatrix() * ( camera_->getViewMatrix() * duelistTargetPos ) ); + if ( duelistTargetScreenPos[ 2 ] < 1 ){ + duelistTargetPointer->setPosition( windowsHalfWidth_ + (windowsHalfWidth_ * duelistTargetScreenPos[ 0 ] ) - + duelistTargetPointer->getWidth()/2, + windowsHalfHeight_ + (windowsHalfHeight_ * -duelistTargetScreenPos[ 1 ]) - + duelistTargetPointer->getHeight()/2 ); + duelistTargetPointer->_update(); + } + } else { + duelistTargetPointer->hide(); + } + //** end duelist TargetPointer - Ogre::OverlayElement* hudTargetArmor = - Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextTargetArmor"); + //** End update targeting pointer and duelist pointers; - Ogre::OverlayElement* hudTargetVel = - Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextTargetVelocity"); + Ogre::OverlayElement* hudTargetDist = + Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/MainPanel/TextTargetDistance" ); + hudTargetDist->setCaption( "D " + Ogre::StringConverter::toString( round( distToTarget.length(), 0 ) ) ); - hudTargetDist->setCaption( "D " + Ogre::StringConverter::toString( round( distToTarget.length(), 0 ) ) ); + Ogre::OverlayElement * hudTargetShield = + Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/MainPanel/TextTargetShield" ); + Ogre::OverlayElement * hudTargetArmor = + Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/MainPanel/TextTargetArmor" ); + Ogre::OverlayElement * hudTargetVel = + Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/MainPanel/TextTargetVelocity" ); - if ( poss.z < 1 ){ - //"getAABB()" || "Entity::getBoundingRadius" - hudTargetPointer->setPosition( windowsHalfWidth_ + (windowsHalfWidth_ * poss.x)-16, - windowsHalfHeight_ + (windowsHalfHeight_ * -poss.y)-16 ); - } - - if ( target_->getTypeID() == SECTOROBJECTMOVABLE_RTTI || - target_->getTypeID() == SECTOROBJECTMOVABLE_AI_RTTI ){ - hudTargetVel->setCaption( "V " + Ogre::StringConverter::toString( dynamic_cast< SectorObjectMoveable *>( target_ )->velocity(), 6 ) ); - hudTargetShield->setCaption( "S " + Ogre::StringConverter::toString( dynamic_cast< SectorObjectMoveable *>( target_ )->shieldPercent(), 4 ) ); - hudTargetArmor->setCaption( "A " + Ogre::StringConverter::toString( dynamic_cast< SectorObjectMoveable *>( target_ )->armorPercent(), 4 ) ); - } else{ - hudTargetVel->setCaption( "" ); - hudTargetShield->setCaption( "" ); - hudTargetArmor->setCaption( "" ); - } + if ( target_->getTypeID() == SECTOROBJECTMOVABLE_RTTI || target_->getTypeID() == SECTOROBJECTMOVABLE_AI_RTTI ){ + hudTargetShield->setCaption( "S " + Ogre::StringConverter::toString( dynamic_cast< SectorObjectMoveable *>( target_ )->shieldPercent(), 4 ) ); + hudTargetArmor->setCaption( "A " + Ogre::StringConverter::toString( dynamic_cast< SectorObjectMoveable *>( target_ )->armorPercent(), 4 ) ); + hudTargetVel->setCaption( "V " + Ogre::StringConverter::toString( dynamic_cast< SectorObjectMoveable *>( target_ )->velocity(), 6 ) ); + } else{ + hudTargetVel->setCaption( "" ); + hudTargetShield->setCaption( "" ); + hudTargetArmor->setCaption( "" ); + } } else { sector_->avatar()->targetArrow()->setVisible( false ); - Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/TargetPointer")->hide( ); + Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/TargetPointer")->hide( ); } Ogre::OverlayElement* hudVel = - Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextVelocity"); + Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/MainPanel/TextVelocity"); Ogre::OverlayElement* hudVelMax = - Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextVelocityMax"); + Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/MainPanel/TextVelocityMax"); Ogre::OverlayElement* hudThr = - Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextThr"); + Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/MainPanel/TextThr"); Ogre::OverlayElement* hudAcc = - Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextAcc"); + Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/MainPanel/TextAcc"); Ogre::OverlayElement* hudPos = - Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextPosition"); + Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/MainPanel/TextPosition"); Ogre::OverlayElement* hudShield = - Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextShield"); + Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/MainPanel/TextShield"); Ogre::OverlayElement* hudArmor = - Ogre::OverlayManager::getSingleton().getOverlayElement("OpenGate/SimpleHUDTextArmor"); + Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/MainPanel/TextArmor"); hudVel->setCaption( "Vel: " + Ogre::StringConverter::toString( round( sector_->avatar()->velocity(), 2 ), 6 ) ); hudVelMax->setCaption( " / " + Ogre::StringConverter::toString( round( sector_->avatar()->velocityMax(), 2), 6 ) ); @@ -732,6 +766,10 @@ Ogre::StringConverter::toString( Ogre::Real( rint( pos[ 1 ] ) ), 5, 5 ) + " " + Ogre::StringConverter::toString( Ogre::Real( rint( pos[ 2 ] ) ), 5, 5 ) ); + + + + // OverlayElement* guiAvg = OverlayManager::getSingleton().getOverlayElement("Core/AverageFps"); // OverlayElement* guiCurr = OverlayManager::getSingleton().getOverlayElement("Core/CurrFps"); // OverlayElement* guiBest = OverlayManager::getSingleton().getOverlayElement("Core/BestFps"); Modified: branches/ogsector/src/SectorClientFrameListener.h =================================================================== --- branches/ogsector/src/SectorClientFrameListener.h 2007-04-21 19:48:08 UTC (rev 412) +++ branches/ogsector/src/SectorClientFrameListener.h 2007-04-22 21:40:45 UTC (rev 413) @@ -61,6 +61,8 @@ NetworkClient * network_; InputManager * inputManager_; + std::string overlayName_; + Ogre::Overlay * hudOverlay_; Ogre::OverlayElement * mousePointer_; // Ogre::SceneNode * hudTarget_; @@ -91,6 +93,8 @@ std::string chatString_; bool chatMode_; bool consoleMode_; + bool duelistPilot_; + bool duelistTarget_; int sceneDetailIndex_ ; Modified: branches/ogsector/src/SectorObjects.cpp =================================================================== --- branches/ogsector/src/SectorObjects.cpp 2007-04-21 19:48:08 UTC (rev 412) +++ branches/ogsector/src/SectorObjects.cpp 2007-04-22 21:40:45 UTC (rev 413) @@ -17,7 +17,7 @@ sceneMgr_->getRootSceneNode()->removeAndDestroyChild( mainNode_->getName() ); } -Projectile::Projectile( BaseObject * parent, long shotCounter ) +Projectile::Projectile( BaseObject * parent, long shotCounter, Ogre::Real speed ) : BaseObject( parent->name(), parent->sector() ), parent_( parent ) { Ogre::String bulletName( name_ + "_" + toStr( shotCounter ) ); @@ -86,14 +86,10 @@ maxLiveTime_ = 1.4; lifeTime_ = 0.0; oldTime_ = 0.0; - speed_ = 2000.0; - //speed_ = 200.0; // damage_ = 250.0; - damage_ = (9000.0 + 5700.0) / 4.01; - // vel_ = speed_ * -direction.zAxis(); - vel_ = speed_ * -direction.zAxis().normalisedCopy(); + vel_ = speed * -direction.zAxis().normalisedCopy() + parent->velDirection(); } Projectile::~Projectile() { @@ -477,6 +473,8 @@ shield_ = maxShield_; shieldRechargeBaseRate_ = 52.500; + ammoSpeed_ = 1000; + velocity_ = 0.0; acceleration_ = 0.0; percentageThrust_ = 0.0; @@ -533,7 +531,7 @@ if ( fireDelay_ <= 0 ){ if ( firePressed_ ){ - projectiles_.insert( new Projectile( this, shotsFired_ ) ); + projectiles_.insert( new Projectile( this, shotsFired_, ammoSpeed_ ) ); fireDelay_ = delayTime; shotsFired_++; } @@ -554,8 +552,11 @@ bool SectorObjectMoveable::deathSequence( Ogre::Real elapsedTime ){ if ( !deathSequence_ ){ LogManager::getSingleton().info( name_ + " destroyed." ); - explosion_ = sceneMgr_->createParticleSystem( name_ + "ExplosionSystem", "OpenGate/ExplosionStart" ); - mainNode_->attachObject( explosion_ ); + if ( !explosion_ ){ + explosion_ = sceneMgr_->createParticleSystem( name_ + "ExplosionSystem", "OpenGate/ExplosionStart" ); + mainNode_->attachObject( explosion_ ); + explosion_->getEmitter( 0 )->setEnabled( true ); + } percentageThrust_ = 0; updateThruster(); } Modified: branches/ogsector/src/SectorObjects.h =================================================================== --- branches/ogsector/src/SectorObjects.h 2007-04-21 19:48:08 UTC (rev 412) +++ branches/ogsector/src/SectorObjects.h 2007-04-22 21:40:45 UTC (rev 413) @@ -44,8 +44,10 @@ virtual void hitByAmmo( float damage ){} - Sector * sector( ) { return sector_; } + Sector * sector( ) { return sector_; } + virtual Ogre::Vector3 velDirection() const = 0; + protected: Ogre::String name_; Sector * sector_; @@ -62,7 +64,7 @@ class Projectile : public BaseObject { public: - Projectile( BaseObject * parent, long shotCount ); + Projectile( BaseObject * parent, long shotCount, Ogre::Real speed ); virtual ~Projectile(); @@ -78,6 +80,8 @@ BaseObject & parent( ) const { return *parent_; } + Ogre::Vector3 velDirection() const { return vel_; } + protected: BaseObject * parent_; // Ogre::BillboardChain * chain_; @@ -87,7 +91,6 @@ Ogre::Real maxLiveTime_; Ogre::Real oldTime_; - Ogre::Real speed_; Ogre::Real damage_; }; @@ -118,6 +121,8 @@ bool isOnRadar() const { return isOnRadar_; } void onRadar( bool onradar ) { isOnRadar_ = onradar; } + virtual Ogre::Vector3 velDirection() const { return Ogre::Vector3(0.0, 0.0, 0.0 ); } + protected: Ogre::SceneNode * mainNodeShape_; // Main character node @@ -224,6 +229,8 @@ return flightDir; } + Ogre::Real ammoSpeed() const { return ammoSpeed_; } + Ogre::Vector3 velDirection() const { return vel_; } Ogre::Real velocity() const { return vel_.length(); } @@ -269,6 +276,8 @@ Ogre::Real roll_; Ogre::Real maxRoll_; + Ogre::Real ammoSpeed_; + Ogre::Real explodeSequenceTime_; bool deathSequence_; Modified: branches/ogsector/src/networkServer.cpp =================================================================== --- branches/ogsector/src/networkServer.cpp 2007-04-21 19:48:08 UTC (rev 412) +++ branches/ogsector/src/networkServer.cpp 2007-04-22 21:40:45 UTC (rev 413) @@ -12,6 +12,7 @@ Server::Server( asio::io_service & io_service, const tcp::endpoint & endpoint ) : io_service_( io_service ), acceptor_( io_service ), userIDCounter_( 1000 ) { + log_ = LogManager::getSingletonPtr(); acceptor_.open( endpoint.protocol() ); acceptor_.set_option( asio::ip::tcp::acceptor::reuse_address( true ) ); acceptor_.bind( endpoint ); @@ -27,7 +28,6 @@ } void Server::handleAccept( UserSession * user, const asio::error & error ){ - // std::cout << "Server::handle_accept" << std::endl; if ( !error ) { addUserSession( user ); @@ -35,18 +35,18 @@ acceptor_.async_accept( newUser->socket(), boost::bind( & Server::handleAccept, this, newUser, asio::placeholders::error ) ); } else { - std::cout << "Server::handle_accept::error: " << error << std::endl; + log_->info( std::string("Server::handle_accept::error: ") + error.what() ); delete user; } } void Server::addUserSession( UserSession * user ){ - std::cout << "USER_NEW: " << user->userID() << std::endl; + log_->info( std::string( "USER_NEW: " ) + toStr( user->userID() ) ); user->start(); } void Server::receiveUserName( UserSession * user, const MessageBodyUserName & msg ){ - std::cout << "USER_NAME: " << user->userID() << " " << msg.userName() << std::endl; + log_->info( std::string( "USER_NAME: " ) + toStr( user->userID() ) + " " + msg.userName() ); if ( !userNames_.count( msg.userName() ) ){ user->setUserName( msg.userName() ); @@ -67,7 +67,7 @@ user->setRegistered( true ); } else { - std::cerr << "USER: " << msg.userName()<< " already exist." << std::endl; + log_->info( std::string( "USER: " ) + msg.userName() + " already exist." ); MessageBodyConnectionRefused msg( CONNECTION_REFUSED_USER_ALREADY_EXIST ); user->send( msg ); @@ -77,7 +77,7 @@ void Server::disconnectUser( UserSession * user ){ std::string name( user->userName() ); - std::cout << "DISCONNECTING: " << user->userID() << " " << name << std::endl; + log_->info( std::string( "DISCONNECTING: " ) + toStr( user->userID() ) + " " + name ); if ( user->registered() ){ allUsers_.leave( user ); @@ -92,11 +92,11 @@ } // delete user; - std::cout << "DISCONNECTED: " << name << std::endl; + log_->info( std::string( "DISCONNECTED: " ) + name ); } void Server::receiveChat( UserSession * user, const MessageBodyChat & msg ){ - std::cout << user->userName() << ": " << msg.message() << std::endl; + log_->chat( user->userName(), msg.message() ); MessageBodyChat chat( msg.message() ); chat.setSenderID( user->userID() ); @@ -104,31 +104,17 @@ } UserObject * Server::createUserObject( UserSession * user, const std::string & name, int userID, int childID ){ -// std::map < long, UserObject * >::iterator it; -// UserObject * obj = NULL; -// long id = createGlobalID( userID, childID ); - -// if ( ( it = userObjects_.find( id ) ) == userObjects_.end() ){ -// std::cout << "Create user object: " << name << std::endl; -// obj = new UserObject( user, name, childID ); -// user->insertChild( obj ); -// userObjects_[ id ] = obj; -// } else { -// std::cout << "Create request, but object already exist: " << name << std::endl; -// obj = it->second; -// } - UserObject * obj = NULL; long id = createGlobalID( userID, childID ); if ( !userObjects_.count( id ) ){ - std::cout << "Create user object: " << name << std::endl; + log_->info( std::string( "Create user object: " ) + name ); obj = new UserObject( user, name, childID ); user->insertChild( obj ); userObjects_[ id ] = obj; } else { - std::cout << "Create request, but object already exist: " << name << std::endl; + log_->info( std::string( "Create request, but object already exist: " ) + name ); obj = userObjects_[ id ]; } @@ -139,7 +125,7 @@ deRegisterUserObject( obj ); obj->parent()->eraseChild( obj ); userObjects_.erase( obj->globalID() ); - std::cout << "Destroy user object: " << obj->name() << std::endl; + log_->info( std::string( "Destroy user object: " ) + obj->name() ); delete obj; } @@ -149,7 +135,7 @@ int childID = msg.childID(); Ogre::Vector3 pos = msg.position(); - std::cerr << "receiveShipRegister: " << name << " " << msg.status() << std::endl; + log_->info( std::string( "receiveShipRegister: " ) + name + " " + toStr((int)msg.status()) ); UserObject *obj; @@ -157,7 +143,7 @@ if ( ( obj = userObjects_[ createGlobalID( userID, childID ) ] ) != NULL ){ deRegisterUserObject( obj ); } else{ - std::cerr << "Deregister request for non existing object " << name << std::endl; + log_->info( std::string( "Deregister request for non existing object " ) + name ); } } else { obj = createUserObject( user, name, userID, childID ); @@ -166,7 +152,7 @@ obj->setPosition( pos ); if ( obj->status() != Registered ){ - std::cout << "Register: " << obj->name() << std::endl; + log_->info( std::string( "Register: " ) + obj->name() ); obj->setStatus( Registered ); std::map < long, UserObject * >::iterator it; @@ -177,9 +163,8 @@ //** if the object is no child, register all objects to them; if ( !obj->isChild() && ( obj->userID() != it->second->userID() ) ){ - std::cout << "\tSend to user: " << obj->userName() - << " object: " << it->second->name() - << " at: " << it->second->position() << std::endl; + log_->info( std::string( "\tSend to user: " ) + obj->userName() + + " object: " + it->second->name() ); MessageBodyShipRegister msg( it->second->userID(), it->second->childID(), it->second->name(), it->second->position(), true ); @@ -187,25 +172,24 @@ } if ( !it->second->isChild() && ( obj->userID() != it->second->userID() ) ){ - std::cout << "\tSend to user: " << it->second->userName() - << " object: " << obj->name() - << " at: " << obj->position() << std::endl; + log_->info( std::string( "\tSend to user: " ) + it->second->userName() + + " object: " + obj->name() ); MessageBodyShipRegister msg( obj->userID(), obj->childID(), obj->name(), obj->position(), true ); it->second->parent()->send( msg ); } } } else { - std::cerr << "object: " << name << " already registered. " << std::endl; + log_->info( std::string( "object: " ) + name + " already registered. " ); } } else { - std::cerr << "Cannot register object: " << name << std::endl; + log_->info( std::string( "Cannot register object: " ) + name ); } } } void Server::deRegisterUserObject( UserObject * obj ){ - std::cout << "Deregister: " << obj->name() << std::endl; + log_->info( std::string( "Deregister: " ) + obj->name() ); if ( obj->status() == Registered ){ obj->setStatus( NotRegistered ); @@ -217,8 +201,8 @@ for ( std::set < UserObject * >::const_iterator it = usersInRange->begin(); it != usersInRange->end(); ){ if ( obj->userID() != (*it)->userID() && !(*it)->isChild() ) { - std::cout << "\tSend to user: " << (*it)->userName() - << " object: " << obj->name() << std::endl; + log_->info( std::string( "\tSend to user: ") + (*it)->userName() + + " object: " + obj->name()); (*it)->parent()->send( msg ); } Modified: branches/ogsector/src/networkServer.h =================================================================== --- branches/ogsector/src/networkServer.h 2007-04-21 19:48:08 UTC (rev 412) +++ branches/ogsector/src/networkServer.h 2007-04-22 21:40:45 UTC (rev 413) @@ -7,6 +7,7 @@ #include <asio.hpp> #include <boost/bind.hpp> +#include "LogManager.h" #include "networkProtocol.h" #include "networkServerUser.h" @@ -70,6 +71,7 @@ std::set < std::string > userNames_; UserSessionGroup allUsers_; + LogManager * log_; }; } // namespace OpenGate Modified: branches/ogsector/src/networkServerUser.cpp =================================================================== --- branches/ogsector/src/networkServerUser.cpp 2007-04-21 19:48:08 UTC (rev 412) +++ branches/ogsector/src/networkServerUser.cpp 2007-04-22 21:40:45 UTC (rev 413) @@ -74,7 +74,8 @@ } } } else { - std::cout << "Received msg for unknown object: " << userName() << " child: " << childID << std::endl; + LogManager::getSingleton().info( std::string( "Received msg for unknown object: " ) + + userName() + " child: " + toStr( childID ) ); } } @@ -123,7 +124,7 @@ sendToRange( msg ); } break; default: - std::cout << "PROTO_UNKNOWN: " << (int)base.type() << std::endl; + LogManager::getSingleton().info( std::string( "PROTO_UNKNOWN: " ) + toStr( (int)base.type() ) ); break; } // std::cout << "User::handle_read_body: " << userID_ << std::endl; @@ -131,7 +132,7 @@ asio::async_read( socket_, asio::buffer( readMsg_.data(), Message::HeaderLength ), boost::bind( & UserSession::handleReadHeader, this, asio::placeholders::error ) ); } else { - std::cout << "Cannot read body: " << userID_ << " " << error << std::endl; + LogManager::getSingleton().fatal( std::string( "Cannot read body: " ) + toStr( userID_ ) ); // room_.leave( this ); } } @@ -146,7 +147,7 @@ boost::bind( & UserSession::handleWrite, this, asio::placeholders::error ) ); } } else { - std::cout << "Cannot write to user: " << userID_ << " " << error << std::endl; + LogManager::getSingleton().fatal( std::string( "Cannot write to user: " ) + toStr( userID_ ) + error.what() ); // room_.leave( this ); } } Modified: branches/ogsector/src/ogconsole.cpp =================================================================== --- branches/ogsector/src/ogconsole.cpp 2007-04-21 19:48:08 UTC (rev 412) +++ branches/ogsector/src/ogconsole.cpp 2007-04-22 21:40:45 UTC (rev 413) @@ -10,7 +10,7 @@ visible_ = false; height_ = 0; - consoleLineLength_ = 85 ; + consoleLineLength_ = 120 ; consoleLineMaxCount_ = (int)rint( 0.5 / 0.02 ) - 2; consoleLineShortCount_ = 3; consoleLineCount_ = consoleLineShortCount_; @@ -24,12 +24,11 @@ InputManager::getSingleton().addKeyListener( this, "OGConsoleKeyListener" ); - Ogre::OverlayManager::getSingleton().getOverlayElement( "OpenGate/SimpleHUDConsole" )->hide(); - Ogre::OverlayManager::getSingleton().getOverlayElement( "OpenGate/SimpleHUDConsoleShort" )->show(); + Ogre::OverlayManager::getSingleton().getOverlayElement( "SimpleHUD/Console" )->hide(); + Og... [truncated message content] |
From: <spo...@us...> - 2007-04-28 15:24:32
|
Revision: 419 http://svn.sourceforge.net/opengate/?rev=419&view=rev Author: spom_spom Date: 2007-04-28 08:24:32 -0700 (Sat, 28 Apr 2007) Log Message: ----------- Added: Vesselmanager and Tinyxml for easy ship administration. (e.g. F12 now spawns squadrok/squid) Modified Paths: -------------- branches/ogsector/ToDo branches/ogsector/data/explosion.particle branches/ogsector/data/simpleHUD.fontdef branches/ogsector/data/textures/radarBackground.png branches/ogsector/resources.cfg branches/ogsector/src/InputManager.cpp branches/ogsector/src/Makefile.am branches/ogsector/src/Makefile.in branches/ogsector/src/Sector.cpp branches/ogsector/src/Sector.h branches/ogsector/src/SectorClient.cpp branches/ogsector/src/SectorClient.h branches/ogsector/src/SectorClientFrameListener.cpp branches/ogsector/src/SectorObjects.cpp branches/ogsector/src/SectorObjects.h branches/ogsector/src/common.h branches/ogsector/src/networkProtocol.h branches/ogsector/src/networkServer.cpp branches/ogsector/src/ogconsole.cpp Added Paths: ----------- branches/ogsector/data/materials/ branches/ogsector/data/materials/ammo.material branches/ogsector/data/materials/explosion.material branches/ogsector/data/materials/mousePointer.material branches/ogsector/data/materials/planets.material branches/ogsector/data/materials/simpleHUD.material branches/ogsector/data/materials/simpleSkybox.material branches/ogsector/data/materials/squadrok.material branches/ogsector/data/materials/squid.material branches/ogsector/data/ships/ branches/ogsector/data/ships/squadrok/ branches/ogsector/data/ships/squadrok/squid/ branches/ogsector/data/ships/squadrok/squid/squid.mesh branches/ogsector/data/ships/squadrok/squid/squid.xml branches/ogsector/data/ships.xml branches/ogsector/data/textures/explosion/ branches/ogsector/data/textures/explosion/explosion1_0.png branches/ogsector/data/textures/explosion/explosion1_1.png branches/ogsector/data/textures/explosion/explosion1_10.png branches/ogsector/data/textures/explosion/explosion1_11.png branches/ogsector/data/textures/explosion/explosion1_12.png branches/ogsector/data/textures/explosion/explosion1_13.png branches/ogsector/data/textures/explosion/explosion1_14.png branches/ogsector/data/textures/explosion/explosion1_15.png branches/ogsector/data/textures/explosion/explosion1_2.png branches/ogsector/data/textures/explosion/explosion1_3.png branches/ogsector/data/textures/explosion/explosion1_4.png branches/ogsector/data/textures/explosion/explosion1_5.png branches/ogsector/data/textures/explosion/explosion1_6.png branches/ogsector/data/textures/explosion/explosion1_7.png branches/ogsector/data/textures/explosion/explosion1_8.png branches/ogsector/data/textures/explosion/explosion1_9.png branches/ogsector/data/textures/squadrokThrusterColor.png branches/ogsector/data/textures/squadrokThrusterLight.png branches/ogsector/data/textures/squidLeiste.png branches/ogsector/data/textures/squidTexture.png branches/ogsector/src/VesselManager.cpp branches/ogsector/src/VesselManager.h branches/ogsector/src/tinyxml/ branches/ogsector/src/tinyxml/tinyxml.cpp branches/ogsector/src/tinyxml/tinyxml.h branches/ogsector/src/tinyxml/tinyxmlerror.cpp branches/ogsector/src/tinyxml/tinyxmlparser.cpp Removed Paths: ------------- branches/ogsector/data/ammo.material branches/ogsector/data/explosion.material branches/ogsector/data/mousePointer.material branches/ogsector/data/planets.material branches/ogsector/data/simpleHUD.material branches/ogsector/data/simpleSkybox.material Modified: branches/ogsector/ToDo =================================================================== --- branches/ogsector/ToDo 2007-04-24 09:52:17 UTC (rev 418) +++ branches/ogsector/ToDo 2007-04-28 15:24:32 UTC (rev 419) @@ -30,6 +30,8 @@ - Speed/MaxSpeed - Acceleration - Mousecurser + - Bullseye/VCT-1 (Duelist) + - JG-like Radar - Simplest global chat @@ -49,10 +51,10 @@ - fullscreen switch (probably not supported by ogre) - show Whos online - chat - - console for input - - input/output highlight - - multiple out-lines - - log to file +# - console for input +# - input/output highlight +# - multiple out-lines +# - log to file - channeling - netcode @@ -64,6 +66,7 @@ - show all objects - skybox with higher resolution - stars +# - planet - xml-read - read playership data @@ -93,8 +96,8 @@ - HUD # - targetarrow # - target infos - - duellist - - bullseye/VCR (??) +# - duellist +# - bullseye/VCR (??) # - flydirection arrow - colorindex for break/AB/FF # - shield/ammo @@ -133,8 +136,11 @@ BUGS: # - (linux)changing mousefocus by < Alt-TAB > lost key-repeat # OIS disables autorepeat, fire `xset r on` to enable - - ogre always scale my skyboxes to 512x512 + - UTF support (\xFC\xF6\xE4) + since Ogre1.4 Overlay only support Ogre::UTFString, which throws exception by using umlaut + + IDEAS: - personal scanmission - Spieler kann sich mit geeignetem Scanner eine eigene Datenbank von Astro erstellen die ingame abgerufen werden kann, f\xFCr jeden neuen Eintrag gibt es exp(nach Mission/Seltenheit/Gefahrenbereich) Deleted: branches/ogsector/data/ammo.material =================================================================== --- branches/ogsector/data/ammo.material 2007-04-24 09:52:17 UTC (rev 418) +++ branches/ogsector/data/ammo.material 2007-04-28 15:24:32 UTC (rev 419) @@ -1,19 +0,0 @@ -material Bullet -{ - technique - { - pass - { - depth_check off - lighting off -// depth_write off - scene_blend add -// scene_blend alpha_blend - - texture_unit - { - texture Bullet.png - } - } - } -} Deleted: branches/ogsector/data/explosion.material =================================================================== --- branches/ogsector/data/explosion.material 2007-04-24 09:52:17 UTC (rev 418) +++ branches/ogsector/data/explosion.material 2007-04-28 15:24:32 UTC (rev 419) @@ -1,35 +0,0 @@ -material OpenGate/Explosion/Base -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture textures/explosion.png - } - } - } -} - -material OpenGate/Explosion/Flare -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture textures/flare.png - } - } - } -} \ No newline at end of file Modified: branches/ogsector/data/explosion.particle =================================================================== --- branches/ogsector/data/explosion.particle 2007-04-24 09:52:17 UTC (rev 418) +++ branches/ogsector/data/explosion.particle 2007-04-28 15:24:32 UTC (rev 419) @@ -79,7 +79,6 @@ affector Scaler { rate -9 - } +} -} \ No newline at end of file Added: branches/ogsector/data/materials/ammo.material =================================================================== --- branches/ogsector/data/materials/ammo.material (rev 0) +++ branches/ogsector/data/materials/ammo.material 2007-04-28 15:24:32 UTC (rev 419) @@ -0,0 +1,19 @@ +material Bullet +{ + technique + { + pass + { + depth_check on + depth_write off + lighting off + scene_blend add +// scene_blend alpha_blend + + texture_unit + { + texture Bullet.png + } + } + } +} Added: branches/ogsector/data/materials/explosion.material =================================================================== --- branches/ogsector/data/materials/explosion.material (rev 0) +++ branches/ogsector/data/materials/explosion.material 2007-04-28 15:24:32 UTC (rev 419) @@ -0,0 +1,35 @@ +material OpenGate/Explosion/Base +{ + technique + { + pass + { + lighting off + scene_blend add + depth_write off + + texture_unit + { + texture textures/explosion.png + } + } + } +} + +material OpenGate/Explosion/Flare +{ + technique + { + pass + { + lighting off + scene_blend add + depth_write off + + texture_unit + { + texture textures/flare.png + } + } + } +} \ No newline at end of file Added: branches/ogsector/data/materials/mousePointer.material =================================================================== --- branches/ogsector/data/materials/mousePointer.material (rev 0) +++ branches/ogsector/data/materials/mousePointer.material 2007-04-28 15:24:32 UTC (rev 419) @@ -0,0 +1,18 @@ +//material OpenGate/FlightCurser +//{ +// technique +// { +// pass +// { +// depth_check off +// lighting off +// scene_blend alpha_blend +// +// texture_unit +// { +// texture textures/flightCurser.png +// } +// } +// } +//} +// Added: branches/ogsector/data/materials/planets.material =================================================================== --- branches/ogsector/data/materials/planets.material (rev 0) +++ branches/ogsector/data/materials/planets.material 2007-04-28 15:24:32 UTC (rev 419) @@ -0,0 +1,36 @@ +material OpenGate/Star +{ + technique + { + pass + { + lighting on + scene_blend add + depth_write off + + texture_unit + { + texture textures/star.png + } + } + } +} + +material OpenGate/RedPlanet +{ + technique + { + pass + { + lighting off + scene_blend add + depth_write off +// alpha_rejection greater 128 + texture_unit + { + texture textures/redPlanet.png + + } + } + } +} Added: branches/ogsector/data/materials/simpleHUD.material =================================================================== --- branches/ogsector/data/materials/simpleHUD.material (rev 0) +++ branches/ogsector/data/materials/simpleHUD.material 2007-04-28 15:24:32 UTC (rev 419) @@ -0,0 +1,156 @@ +material SimpleHUD/FlightCurser +{ + technique + { + pass + { + depth_check off + lighting off + scene_blend alpha_blend + + texture_unit + { + texture textures/flightCurser.png + } + } + } +} + +material SimpleHUD/CenterPointer +{ + technique + { + pass + { + depth_check off + lighting off + scene_blend alpha_blend + + texture_unit + { + texture textures/hudCenter.png + } + } + } +} + +material SimpleHUD/TargetPointer +{ + technique + { + pass + { + depth_check off + lighting off + scene_blend alpha_blend + + texture_unit + { + texture textures/targetPointer.png + } + } + } +} + +material SimpleHUD/DuelistPilotPointer +{ + technique + { + pass + { + depth_check off + lighting off + scene_blend alpha_blend + + texture_unit + { + texture textures/duelistPilotPointer.png + } + } + } +} + +material SimpleHUD/DuelistTargetPointer +{ + technique + { + pass + { + depth_check off + lighting off + scene_blend alpha_blend + + texture_unit + { + texture textures/duelistTargetPointer.png + } + } + } +} + +material SimpleHUD/FlightArrow +{ + receive_shadows on + technique + { + ambient 1.000000 0.500000 0.50000 1.000000 + diffuse 0.000000 0.500000 0.50000 1.000000 + specular 1.000000 1.00000 1.000000 1.000000 12.500000 + emission 0.000000 0.50000 0.500000 1.000000 + + pass + { + } + } +} + +material SimpleHUD/TargetArrow +{ + technique + { + pass + { + } + } +} + +material OpenGate/Console/Background +{ + technique + { + pass + { + depth_check off + lighting off +// scene_blend alpha_blend + scene_blend add +// diffuse 1.0 1.0 1.0 1.0 + + texture_unit + { + texture textures/consoleBackground.png + } + } + } +} + +material OpenGate/Radar/Background +{ + technique + { + pass + { + depth_check off + lighting off + scene_blend add +// diffuse 1.0 1.0 1.0 1.0 +// alpha_rejection greater 128 + + texture_unit + { + texture textures/radarBackground.png + } + } + } +} + Added: branches/ogsector/data/materials/simpleSkybox.material =================================================================== --- branches/ogsector/data/materials/simpleSkybox.material (rev 0) +++ branches/ogsector/data/materials/simpleSkybox.material 2007-04-28 15:24:32 UTC (rev 419) @@ -0,0 +1,39 @@ +material OpenGate/SimpleSkyBox1 +{ + technique + { + pass + { + lighting off + depth_write off +// scene_blend add + + texture_unit + { + cubic_texture skybox1.png separateUV +// cubic_texture skybox1_4096.png separateUV +// cubic_texture skybox1_2048.png separateUV +// cubic_texture skybox1_1024.png separateUV +// cubic_texture skybox1_512.png separateUV + tex_address_mode clamp + } + } + } +} +material OpenGate/SimpleSkyBox2 +{ + technique + { + pass + { + lighting off + depth_write off + + texture_unit + { + cubic_texture skybox2.png separateUV + tex_address_mode clamp + } + } + } +} Added: branches/ogsector/data/materials/squadrok.material =================================================================== --- branches/ogsector/data/materials/squadrok.material (rev 0) +++ branches/ogsector/data/materials/squadrok.material 2007-04-28 15:24:32 UTC (rev 419) @@ -0,0 +1,60 @@ +material squadrok/thrusterLight +{ + receive_shadows off + technique + { + pass + { + ambient 1.000000 1.000000 1.00000 1.000000 + diffuse 1.000000 1.000000 1.00000 1.000000 + specular 1.000000 1.00000 1.000000 1.000000 12.500000 + emissive 1.000000 1.000000 1.000000 1.000000 + scene_blend alpha_blend +// scene_blend add +// scene_blend modulate +// scene_blend colour_blend + depth_check on + depth_write off + lighting of + texture_unit + { + texture textures/squadrokThrusterLight.png + rotate_anim 0.2 +// wave_xform scale_x sine 1.0 0.2 0.0 5.0 +// colour_op add +// colour_op alpha_blend + } + } + pass + { + ambient 1.000000 1.000000 1.00000 1.000000 + diffuse 1.000000 1.000000 1.00000 1.000000 + specular 1.000000 1.00000 1.000000 1.000000 12.500000 + emissive 1.000000 1.000000 1.000000 1.000000 + scene_blend alpha_blend + lighting on + depth_check on + depth_write off + texture_unit + { + texture textures/squadrokThrusterLight.png + rotate_anim -0.2 + colour_op add + } + } + pass + { + specular 1.000000 1.00000 1.000000 1.000000 12.500000 + scene_blend alpha_blend + depth_check on + depth_write off + texture_unit + { + texture textures/squadrokThrusterColor.png + rotate_anim -0.2 + colour_op add + } + } + } +} + Added: branches/ogsector/data/materials/squid.material =================================================================== --- branches/ogsector/data/materials/squid.material (rev 0) +++ branches/ogsector/data/materials/squid.material 2007-04-28 15:24:32 UTC (rev 419) @@ -0,0 +1,50 @@ +material squid/TEXFACE/texture.png +{ + receive_shadows on + technique + { + pass + { + ambient 0.500000 0.500000 0.500000 1.000000 + diffuse 0.900000 0.900000 0.900000 1.000000 + emissive 0.000000 0.000000 0.000000 1.000000 + texture_unit + { + texture squidTexture.png + colour_op modulate + } + } + pass + { + ambient 0.0 0.0 0.0 + diffuse 0.0 0.0 0.0 + specular 0.500000 0.500000 0.500000 1.000000 12.500000 + scene_blend add + } + } +} +material squid/TEXFACE/Leiste.png +{ + receive_shadows on + technique + { + pass + { + ambient 0.500000 0.500000 0.500000 1.000000 + diffuse 0.800000 0.800000 0.800000 1.000000 + emissive 0.000000 0.000000 0.000000 1.000000 + texture_unit + { + texture squidLeiste.png + colour_op modulate + } + } + pass + { + ambient 0.0 0.0 0.0 + diffuse 0.0 0.0 0.0 + specular 0.500000 0.500000 0.500000 1.000000 12.500000 + scene_blend add + } + } +} Deleted: branches/ogsector/data/mousePointer.material =================================================================== --- branches/ogsector/data/mousePointer.material 2007-04-24 09:52:17 UTC (rev 418) +++ branches/ogsector/data/mousePointer.material 2007-04-28 15:24:32 UTC (rev 419) @@ -1,18 +0,0 @@ -//material OpenGate/FlightCurser -//{ -// technique -// { -// pass -// { -// depth_check off -// lighting off -// scene_blend alpha_blend -// -// texture_unit -// { -// texture textures/flightCurser.png -// } -// } -// } -//} -// Deleted: branches/ogsector/data/planets.material =================================================================== --- branches/ogsector/data/planets.material 2007-04-24 09:52:17 UTC (rev 418) +++ branches/ogsector/data/planets.material 2007-04-28 15:24:32 UTC (rev 419) @@ -1,36 +0,0 @@ -material OpenGate/Star -{ - technique - { - pass - { - lighting on - scene_blend add - depth_write off - - texture_unit - { - texture textures/star.png - } - } - } -} - -material OpenGate/RedPlanet -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off -// alpha_rejection greater 128 - texture_unit - { - texture textures/redPlanet.png - - } - } - } -} Added: branches/ogsector/data/ships/squadrok/squid/squid.mesh =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/ships/squadrok/squid/squid.mesh ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/ships/squadrok/squid/squid.xml =================================================================== --- branches/ogsector/data/ships/squadrok/squid/squid.xml (rev 0) +++ branches/ogsector/data/ships/squadrok/squid/squid.xml 2007-04-28 15:24:32 UTC (rev 419) @@ -0,0 +1,26 @@ +<?xml version="1.0"?> + +<ship> + <!-- Naming --> + <faction>squadrok</faction> + <name>squid</name> + + <!-- Generic Data --> + <class>Probe</class> + <size>10</size> + <mass>8500</mass> + + <!-- Sizes --> + <engines>1</engines> + <guns>2</guns> + <armor>1000</armor> + + <!-- Movement --> + <dragfactor>12.96</dragfactor> + <pitch>0.001571</pitch> + <roll>0.001222</roll> + <yaw>0.001396</yaw> + + <mesh>squid.mesh</mesh> + <baseyaw>180</baseyaw> +</ship> \ No newline at end of file Added: branches/ogsector/data/ships.xml =================================================================== --- branches/ogsector/data/ships.xml (rev 0) +++ branches/ogsector/data/ships.xml 2007-04-28 15:24:32 UTC (rev 419) @@ -0,0 +1,7 @@ +<?xml version="1.0"?> + +<ships> + <Resource id="1" location="./data/ships/squadrok/squid/squid.xml"/> + <Resource id="2" location="../../trunk/data/ships/octavius/apteryx/apteryx.xml" /> + <Resource id="3" location="../../trunk/data/ships/quantar/storm/storm.xml" /> +</ships> Modified: branches/ogsector/data/simpleHUD.fontdef =================================================================== --- branches/ogsector/data/simpleHUD.fontdef 2007-04-24 09:52:17 UTC (rev 418) +++ branches/ogsector/data/simpleHUD.fontdef 2007-04-28 15:24:32 UTC (rev 419) @@ -4,6 +4,7 @@ source bluehigh.ttf size 32 resolution 55 + antialias_colour false code_points 33-255 } @@ -14,6 +15,7 @@ source bluehigh.ttf size 32 resolution 55 + antialias_colour false code_points 33-255 } Deleted: branches/ogsector/data/simpleHUD.material =================================================================== --- branches/ogsector/data/simpleHUD.material 2007-04-24 09:52:17 UTC (rev 418) +++ branches/ogsector/data/simpleHUD.material 2007-04-28 15:24:32 UTC (rev 419) @@ -1,130 +0,0 @@ -material SimpleHUD/FlightCurser -{ - technique - { - pass - { - depth_check off - lighting off - scene_blend alpha_blend - - texture_unit - { - texture textures/flightCurser.png - } - } - } -} - -material SimpleHUD/CenterPointer -{ - technique - { - pass - { - depth_check off - lighting off - scene_blend alpha_blend - - texture_unit - { - texture textures/hudCenter.png - } - } - } -} - -material SimpleHUD/TargetPointer -{ - technique - { - pass - { - depth_check off - lighting off - scene_blend alpha_blend - - texture_unit - { - texture textures/targetPointer.png - } - } - } -} - -material SimpleHUD/DuelistPilotPointer -{ - technique - { - pass - { - depth_check off - lighting off - scene_blend alpha_blend - - texture_unit - { - texture textures/duelistPilotPointer.png - } - } - } -} - -material SimpleHUD/DuelistTargetPointer -{ - technique - { - pass - { - depth_check off - lighting off - scene_blend alpha_blend - - texture_unit - { - texture textures/duelistTargetPointer.png - } - } - } -} - -material OpenGate/Console/Background -{ - technique - { - pass - { - depth_check off - lighting off -// scene_blend alpha_blend - scene_blend add -// diffuse 1.0 1.0 1.0 1.0 - - texture_unit - { - texture textures/consoleBackground.png - } - } - } -} - -material OpenGate/Radar/Background -{ - technique - { - pass - { - depth_check off - lighting off - scene_blend add -// diffuse 1.0 1.0 1.0 1.0 -// alpha_rejection greater 128 - - texture_unit - { - texture textures/radarBackground.png - } - } - } -} - Deleted: branches/ogsector/data/simpleSkybox.material =================================================================== --- branches/ogsector/data/simpleSkybox.material 2007-04-24 09:52:17 UTC (rev 418) +++ branches/ogsector/data/simpleSkybox.material 2007-04-28 15:24:32 UTC (rev 419) @@ -1,39 +0,0 @@ -material OpenGate/SimpleSkyBox1 -{ - technique - { - pass - { - lighting off - depth_write off -// scene_blend add - - texture_unit - { - cubic_texture skybox1.png separateUV -// cubic_texture skybox1_4096.png separateUV -// cubic_texture skybox1_2048.png separateUV -// cubic_texture skybox1_1024.png separateUV -// cubic_texture skybox1_512.png separateUV - tex_address_mode clamp - } - } - } -} -material OpenGate/SimpleSkyBox2 -{ - technique - { - pass - { - lighting off - depth_write off - - texture_unit - { - cubic_texture skybox2.png separateUV - tex_address_mode clamp - } - } - } -} Added: branches/ogsector/data/textures/explosion/explosion1_0.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/textures/explosion/explosion1_0.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/textures/explosion/explosion1_1.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/textures/explosion/explosion1_1.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/textures/explosion/explosion1_10.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/textures/explosion/explosion1_10.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/textures/explosion/explosion1_11.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/textures/explosion/explosion1_11.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/textures/explosion/explosion1_12.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/textures/explosion/explosion1_12.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/textures/explosion/explosion1_13.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/textures/explosion/explosion1_13.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/textures/explosion/explosion1_14.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/textures/explosion/explosion1_14.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/textures/explosion/explosion1_15.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/textures/explosion/explosion1_15.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/textures/explosion/explosion1_2.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/textures/explosion/explosion1_2.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/textures/explosion/explosion1_3.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/textures/explosion/explosion1_3.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/textures/explosion/explosion1_4.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/textures/explosion/explosion1_4.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/textures/explosion/explosion1_5.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/textures/explosion/explosion1_5.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/textures/explosion/explosion1_6.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/textures/explosion/explosion1_6.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/textures/explosion/explosion1_7.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/textures/explosion/explosion1_7.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/textures/explosion/explosion1_8.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/textures/explosion/explosion1_8.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/textures/explosion/explosion1_9.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/textures/explosion/explosion1_9.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: branches/ogsector/data/textures/radarBackground.png =================================================================== (Binary files differ) Added: branches/ogsector/data/textures/squadrokThrusterColor.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/textures/squadrokThrusterColor.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/textures/squadrokThrusterLight.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/textures/squadrokThrusterLight.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/textures/squidLeiste.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/textures/squidLeiste.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/textures/squidTexture.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/textures/squidTexture.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: branches/ogsector/resources.cfg =================================================================== --- branches/ogsector/resources.cfg 2007-04-24 09:52:17 UTC (rev 418) +++ branches/ogsector/resources.cfg 2007-04-28 15:24:32 UTC (rev 419) @@ -5,7 +5,10 @@ # Resource locations to be added to the default path [General] FileSystem=./data -FileSystem=./data/squid +FileSystem=./data/materials +FileSystem=./data/textures +FileSystem=./data/local +FileSystem=./data/local/astro/ Zip=./data/simpleSkybox.zip #Zip=./data/skybox_512.zip #Zip=./data/skybox_1024.zip Modified: branches/ogsector/src/InputManager.cpp =================================================================== --- branches/ogsector/src/InputManager.cpp 2007-04-24 09:52:17 UTC (rev 418) +++ branches/ogsector/src/InputManager.cpp 2007-04-28 15:24:32 UTC (rev 419) @@ -55,6 +55,8 @@ keyboard_ = static_cast<OIS::Keyboard*>(inputSystem_->createInputObject( OIS::OISKeyboard, true)); keyboard_->setEventCallback( this ); + std::cout << " keyboard.TextTranslationMode " << (int)keyboard_->getTextTranslation() << std::endl; + keyboard_->setTextTranslation( OIS::Keyboard::Unicode ); #ifndef WIN32 if ( inputSystem_->numJoysticks() > 0 ) { Modified: branches/ogsector/src/Makefile.am =================================================================== --- branches/ogsector/src/Makefile.am 2007-04-24 09:52:17 UTC (rev 418) +++ branches/ogsector/src/Makefile.am 2007-04-28 15:24:32 UTC (rev 419) @@ -5,6 +5,10 @@ ogsectorclient_SOURCES = \ ogsectorclient.cpp \ + tinyxml/tinyxml.h \ + tinyxml/tinyxml.cpp \ + tinyxml/tinyxmlerror.cpp \ + tinyxml/tinyxmlparser.cpp \ common.h \ LogManager.h \ LogManager.cpp \ @@ -20,6 +24,8 @@ SectorClientFrameListener.cpp \ InputManager.h \ InputManager.cpp \ + VesselManager.h \ + VesselManager.cpp \ networkClient.h \ networkClient.cpp \ SectorObjects.h \ Modified: branches/ogsector/src/Makefile.in =================================================================== --- branches/ogsector/src/Makefile.in 2007-04-24 09:52:17 UTC (rev 418) +++ branches/ogsector/src/Makefile.in 2007-04-28 15:24:32 UTC (rev 419) @@ -48,11 +48,13 @@ am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) -am_ogsectorclient_OBJECTS = ogsectorclient.$(OBJEXT) \ +am_ogsectorclient_OBJECTS = ogsectorclient.$(OBJEXT) tinyxml.$(OBJEXT) \ + tinyxmlerror.$(OBJEXT) tinyxmlparser.$(OBJEXT) \ LogManager.$(OBJEXT) common.$(OBJEXT) ogconsole.$(OBJEXT) \ Sector.$(OBJEXT) SectorClient.$(OBJEXT) \ SectorClientFrameListener.$(OBJEXT) InputManager.$(OBJEXT) \ - networkClient.$(OBJEXT) SectorObjects.$(OBJEXT) + VesselManager.$(OBJEXT) networkClient.$(OBJEXT) \ + SectorObjects.$(OBJEXT) ogsectorclient_OBJECTS = $(am_ogsectorclient_OBJECTS) ogsectorclient_LDADD = $(LDADD) am_ogsectorserver_OBJECTS = ogsectorserver.$(OBJEXT) common.$(OBJEXT) \ @@ -174,6 +176,10 @@ target_alias = @target_alias@ ogsectorclient_SOURCES = \ ogsectorclient.cpp \ + tinyxml/tinyxml.h \ + tinyxml/tinyxml.cpp \ + tinyxml/tinyxmlerror.cpp \ + tinyxml/tinyxmlparser.cpp \ common.h \ LogManager.h \ LogManager.cpp \ @@ -189,6 +195,8 @@ SectorClientFrameListener.cpp \ InputManager.h \ InputManager.cpp \ + VesselManager.h \ + VesselManager.cpp \ networkClient.h \ networkClient.cpp \ SectorObjects.h \ @@ -293,6 +301,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SectorClient.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SectorClientFrameListener.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SectorObjects.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VesselManager.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/networkClient.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/networkServer.Po@am__quote@ @@ -302,6 +311,9 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogsectorserver.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openALSoundManager.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testopenalmanager.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tinyxml.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tinyxmlerror.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tinyxmlparser.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @@ -316,6 +328,48 @@ @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) '$<'` + +tinyxml.o: tinyxml/tinyxml.cpp +@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tinyxml.o -MD -MP -MF "$(DEPDIR)/tinyxml.Tpo" -c -o tinyxml.o `test -f 'tinyxml/tinyxml.cpp' || echo '$(srcdir)/'`tinyxml/tinyxml.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/tinyxml.Tpo" "$(DEPDIR)/tinyxml.Po"; else rm -f "$(DEPDIR)/tinyxml.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='tinyxml/tinyxml.cpp' object='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) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tinyxml.o `test -f 'tinyxml/tinyxml.cpp' || echo '$(srcdir)/'`tinyxml/tinyxml.cpp + +tinyxml.obj: tinyxml/tinyxml.cpp +@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tinyxml.obj -MD -MP -MF "$(DEPDIR)/tinyxml.Tpo" -c -o 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)/tinyxml.Tpo" "$(DEPDIR)/tinyxml.Po"; else rm -f "$(DEPDIR)/tinyxml.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='tinyxml/tinyxml.cpp' object='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) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tinyxml.obj `if test -f 'tinyxml/tinyxml.cpp'; then $(CYGPATH_W) 'tinyxml/tinyxml.cpp'; else $(CYGPATH_W) '$(srcdir)/tinyxml/tinyxml.cpp'; fi` + +tinyxmlerror.o: tinyxml/tinyxmlerror.cpp +@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tinyxmlerror.o -MD -MP -MF "$(DEPDIR)/tinyxmlerror.Tpo" -c -o tinyxmlerror.o `test -f 'tinyxml/tinyxmlerror.cpp' || echo '$(srcdir)/'`tinyxml/tinyxmlerror.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/tinyxmlerror.Tpo" "$(DEPDIR)/tinyxmlerror.Po"; else rm -f "$(DEPDIR)/tinyxmlerror.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='tinyxml/tinyxmlerror.cpp' object='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) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tinyxmlerror.o `test -f 'tinyxml/tinyxmlerror.cpp' || echo '$(srcdir)/'`tinyxml/tinyxmlerror.cpp + +tinyxmlerror.obj: tinyxml/tinyxmlerror.cpp +@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tinyxmlerror.obj -MD -MP -MF "$(DEPDIR)/tinyxmlerror.Tpo" -c -o 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)/tinyxmlerror.Tpo" "$(DEPDIR)/tinyxmlerror.Po"; else rm -f "$(DEPDIR)/tinyxmlerror.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='tinyxml/tinyxmlerror.cpp' object='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) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tinyxmlerror.obj `if test -f 'tinyxml/tinyxmlerror.cpp'; then $(CYGPATH_W) 'tinyxml/tinyxmlerror.cpp'; else $(CYGPATH_W) '$(srcdir)/tinyxml/tinyxmlerror.cpp'; fi` + +tinyxmlparser.o: tinyxml/tinyxmlparser.cpp +@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tinyxmlparser.o -MD -MP -MF "$(DEPDIR)/tinyxmlparser.Tpo" -c -o tinyxmlparser.o `test -f 'tinyxml/tinyxmlparser.cpp' || echo '$(srcdir)/'`tinyxml/tinyxmlparser.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/tinyxmlparser.Tpo" "$(DEPDIR)/tinyxmlparser.Po"; else rm -f "$(DEPDIR)/tinyxmlparser.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='tinyxml/tinyxmlparser.cpp' object='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) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tinyxmlparser.o `test -f 'tinyxml/tinyxmlparser.cpp' || echo '$(srcdir)/'`tinyxml/tinyxmlparser.cpp + +tinyxmlparser.obj: tinyxml/tinyxmlparser.cpp +@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tinyxmlparser.obj -MD -MP -MF "$(DEPDIR)/tinyxmlparser.Tpo" -c -o 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)/tinyxmlparser.Tpo" "$(DEPDIR)/tinyxmlparser.Po"; else rm -f "$(DEPDIR)/tinyxmlparser.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='tinyxml/tinyxmlparser.cpp' object='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) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tinyxmlparser.obj `if test -f 'tinyxml/tinyxmlparser.cpp'; then $(CYGPATH_W) 'tinyxml/tinyxmlparser.cpp'; else $(CYGPATH_W) '$(srcdir)/tinyxml/tinyxmlparser.cpp'; fi` uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) Modified: branches/ogsector/src/Sector.cpp =================================================================== --- branches/ogsector/src/Sector.cpp 2007-04-24 09:52:17 UTC (rev 418) +++ branches/ogsector/src/Sector.cpp 2007-04-28 15:24:32 UTC (rev 419) @@ -112,8 +112,8 @@ 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 ); - OgreOpcode::CollisionManager::getSingletonPtr()->addCollType( "SectorObject", "SectorObject", OgreOpcode::COLLTYPE_CONTACT ); collideInSectorContext_ = OgreOpcode::CollisionManager::getSingletonPtr()->getDefaultContext(); @@ -162,19 +162,7 @@ // createCircle(); - createStaticObject( Ogre::String("ships/quantar/storm/storm.mesh"), - "StormShape", - Ogre::Vector3( 10, 17, -129.0 ), - Ogre::Real( 9.6 ), - Ogre::Degree( -90 ) ); - createStaticObject( Ogre::String("ogrehead.mesh"), - "ogreheadStation", - Ogre::Vector3( 5000, 0, 0 ), - Ogre::Real( 500.0 ), - Ogre::Degree( 0.0 ) ); - - createStaticObject( Ogre::String("ogrehead.mesh"), "-100 0 0", Ogre::Vector3( -100, 0, 0 ), Ogre::Real( 10.0 ), @@ -186,12 +174,33 @@ Ogre::Real( 10.0 ), Ogre::Degree( 0.0 ) ); -// createStaticObject( Ogre::String("local/squid/Plane.001.mesh"), -// "Testsquid", -// Ogre::Vector3( 0, 0, 300 ), -// Ogre::Real( 7.0 ), -// Ogre::Degree( 0.0 ) ); + createStaticObject( Ogre::String("ogrehead.mesh"), + "ogreheadStation", + Ogre::Vector3( 5000, 0, 0 ), + Ogre::Real( 500.0 ), + Ogre::Degree( 0.0 ) ); +// createStaticObject( VesselManager::getSingleton().vessel( SQUADROK_SQUID1 )->meshPtr().get()->getName(), +// "0test", +// Ogre::Vector3( 0, 0, 200 ), +// Ogre::Real( 10.0 ), +// Ogre::Degree( 180.0 ) ); + + + std::set < std::string > factions = VesselManager::getSingleton().factionNames(); + int factionCounter = 0; + for ( std::set < std::string >::iterator factIt = factions.begin(); factIt != factions.end(); factIt ++ ){ + std::set < Vessel * > vessels( VesselManager::getSingleton().factionVessels( (*factIt) ) ); + int vesselCounter = 0; + for ( std::set < Vessel * >::iterator it = vessels.begin(); it != vessels.end(); it ++ ){ + createStaticObject( (*it)->meshPtr().get()->getName(), (*it)->factionName() + "/" + (*it)->name(), + Ogre::Vector3( -1000.0, 50 * factionCounter, -100.0 + 100 * vesselCounter ), + Ogre::Real( (*it)->baseSize() ), Ogre::Degree( (*it)->baseYaw() ) ); + vesselCounter++; + } + factionCounter++; + } + itTarget_ = sectorObjects_.begin(); } @@ -335,8 +344,9 @@ } -SectorObjectMoveable * Sector::createMoveableObject( const Ogre::String & name, int userID, int childID ){ - SectorObjectMoveable * obj = new SectorObjectMoveable( name, this, userID, childID ); +SectorObjectMoveable * Sector::createMoveableObject( const Ogre::String & name, int userID, int childID, + Vessel & vessel ){ + SectorObjectMoveable * obj = new SectorObjectMoveable( name, this, userID, childID, vessel ); sectorObjects_.insert( obj ); movableObjects_[ obj->globalID() ] = obj; @@ -344,7 +354,7 @@ } void Sector::destructMoveableObject( SectorObjectMoveable * obj ){ - if ( listener_->target() == obj ) listener_->setTarget( nextTarget() ); + selectNextTarget( obj ); sectorObjects_.erase( obj ); Ogre::Overlay * radar = Ogre::OverlayManager::getSingleton().getByName( "Radar" ); @@ -385,8 +395,10 @@ // insertCollisionSectorObject( obj ); } -SectorObjectMoveableAi * Sector::createAiMoveableObject( const Ogre::String & name, int childID ){ - SectorObjectMoveableAi * obj = new SectorObjectMoveableAi( name, this, network_->userID(), childID ); + +SectorObjectMoveableAi * Sector::createAiMoveableObject( const Ogre::String & name, int childID, + Vessel & vessel ){ + SectorObjectMoveableAi * obj = new SectorObjectMoveableAi( name, this, network_->userID(), childID, vessel ); sectorObjects_.insert( obj ); movableObjects_[ obj->globalID() ] = obj ; localAiObjects_[ obj->childID() ] = obj; @@ -399,29 +411,29 @@ int childID = 1; while ( localAiObjects_.count( childID ) ){ childID ++; } - SectorObjectMoveableAi *obj = createAiMoveableObject( avatar_->name() + "_Spawn" + Ogre::StringConverter::toString( childID ), childID ); + SectorObjectMoveableAi *obj = createAiMoveableObject( avatar_->name() + "_Spawn" + Ogre::StringConverter::toString( childID ), childID, *VesselManager::getSingleton().vessel( "squid" ) ); obj->setTarget( avatar_ ); - Ogre::Real xmin = -1000.0, xmax = -500.0; - Ogre::Real ymin = -1000.0, ymax = -500.0; - Ogre::Real zmin = -1000.0, zmax = -500.0; + Ogre::Real xmin = -5000.0, xmax = -4000.0; + Ogre::Real ymin = -5000.0, ymax = -4000.0; + Ogre::Real zmin = -5000.0, zmax = -4000.0; obj->mainNode()->setPosition( Ogre::Math::RangeRandom( xmin, xmax ), Ogre::Math::RangeRandom( ymin, ymax ), Ogre::Math::RangeRandom( zmin, zmax ) ); - obj->setThrustPercent( 70 ); + obj->setThrustPercent( 100 ); // obj->mainNode()->setPosition( 0.0f, 0.0f, 200.0f); - - - - MessageBodyShipRegister msg( 0, obj->childID(), obj->name(), obj->mainNode()->getPosition(), true ); + + MessageBodyShipRegister msg( 0, obj->childID(), obj->name(), obj->mainNode()->getPosition(), + true, obj->vesselBluePrint()->vesselID() ); network_->send( msg ); } void Sector::createAvatar( const Ogre::String & playername ){ - avatar_ = new SectorObjectAvatar( playername, this, network_->userID() ); + avatar_ = new SectorObjectAvatar( playername, this, network_->userID(), + *VesselManager::getSingleton().vessel( "apteryx" ) ); //sectorObjects_.insert( obj ); movableObjects_[ avatar_->globalID() ] = avatar_; } @@ -436,7 +448,7 @@ void Sector::avatarDied( ){ avatarDeathSequenceTime_ = 5.0; avatar_->setVisible( true ); - MessageBodyShipRegister msg( 0, 0, avatar_->name(), avatar_->mainNode()->getPosition(), false ); + MessageBodyShipRegister msg( 0, 0, avatar_->name(), avatar_->mainNode()->getPosition(), false, 0 ); network_->send( msg ); listener_->avatarDeathSequence( true ); } @@ -450,7 +462,8 @@ avatar_->setVelocity( Ogre::Vector3( 0.0, 0.0, -20.0 ) ); avatar_->reset(); - MessageBodyShipRegister msg( 0, 0, avatar_->name(), avatar_->mainNode()->getPosition(), true ); + MessageBodyShipRegister msg( 0, 0, avatar_->name(), avatar_->mainNode()->getPosition(), + true, avatar_->vesselBluePrint()->vesselID() ); network_->send( msg ); avatar_->setVisible( false ); @@ -458,15 +471,39 @@ } } +void Sector::selectNextTarget( SectorObject * obj ){ + if ( obj != NULL ){ + if ( listener_->target() == obj ) listener_->setTarget( nextTarget() ); + } else { + listener_->setTarget( nextTarget() ); + } +} + +void Sector::selectPrevTarget( SectorObject * obj ){ + if ( obj != NULL ){ + if ( listener_->target() == obj ) listener_->setTarget( prevTarget() ); + } else { + listener_->setTarget( prevTarget() ); + } +} + SectorObject * Sector::nextTarget( ){ if ( sectorObjects_.size() != 0 ){ itTarget_ ++; + if ( avatar_ != NULL ){ if ( (*itTarget_) == avatar_ ) return nextTarget(); } if ( itTarget_ == sectorObjects_.end() ) itTarget_ = sectorObjects_.begin(); - return (*itTarget_); + + if ( (*itTarget_)->selectable() ) { + return (*itTarget_); + } else { + //** have to check for infinity loop + return nextTarget(); + } + } return NULL; } @@ -479,7 +516,12 @@ if ( avatar_ != NULL ){ if ( (*itTarget_) == avatar_ ) return prevTarget(); } - return (*itTarget_); + if ( (*itTarget_)->selectable() ) { + return (*itTarget_); + } else { + //** have to check for infinity loop + return prevTarget(); + } } return NULL; } @@ -535,7 +577,8 @@ } else { if ( msg.status() == true ){ log_->info( "Create object " + msg.name()+ " " + toStr( msg.senderID() ) + " " + toStr( (int)msg.childID() ) + " " ); - SectorObjectMoveable * obj = createMoveableObject( msg.name(), msg.senderID(), msg.childID() ); + SectorObjectMoveable * obj = createMoveableObject( msg.name(), msg.senderID(), msg.childID(), + *VesselManager::getSingleton().vessel( msg.vesselID() ) ); obj->mainNode()->setPosition( msg.position() ); sendAllVesselStatus( ); } Modified: branches/ogsector/src/Sector.h =================================================================== --- branches/ogsector/src/Sector.h 2007-04-24 09:52:17 UTC (rev 418) +++ branches/ogsector/src/Sector.h 2007-04-28 15:24:32 UTC (rev 419) @@ -33,9 +33,9 @@ void createStaticObject( const Ogre::String & meshname, const Ogre::String & objectname, const Ogre::Vector3 & pos, Ogre::Real targetSize, Ogre::Degree yaw ); - SectorObjectMoveable * createMoveableObject( const Ogre::String & name, int userId, int childId ); + SectorObjectMoveable * createMoveableObject( const Ogre::String & name, int userId, int childId, Vessel & vessel ); - SectorObjectMoveableAi * createAiMoveableObject( const Ogre::String & name, int childId ); + SectorObjectMoveableAi * createAiMoveableObject( const Ogre::String & name, int childId, Vessel & vessel ); void destructMoveableObject( SectorObjectMoveable * obj ); @@ -55,6 +55,9 @@ void createCircle( ); + void selectNextTarget( SectorObject * obj = NULL ); + void selectPrevTarget( SectorObject * obj = NULL ); + SectorObject * nextTarget( ); SectorObject * prevTarget( ); Modified: branches/ogsector/src/SectorClient.cpp =================================================================== --- branches/ogsector/src/SectorClient.cpp 2007-04-24 09:52:17 UTC (rev 418) +++ branches/ogsector/src/SectorClient.cpp 2007-04-28 15:24:32 UTC (rev 419) @@ -14,10 +14,10 @@ bool SectorClient::setup( bool dialog ){ root_ = new Ogre::Root; + if ( !configure( dialog ) ) return false; + setupResources(); - if ( !configure( dialog ) ) return false; - //** load ressources Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups(); @@ -36,6 +36,8 @@ //** spom dont know what for // Create the scene + vesselManager_ = new VesselManager( ); + createScene(); inputManager_ = new InputManager( ); Modified: branches/ogsector/src/SectorClient.h =================================================================== --- branches/ogsector/src/SectorClient.h 2007-04-24 09:52:17 UTC (rev 418) +++ branches/ogsector/src/SectorClient.h 2007-04-28 15:24:32 UTC (rev 419) @@ -10,6 +10,7 @@ #include "networkClient.h" #include "ogconsole.h" #include "LogManager.h" +#include "VesselManager.h" #include <list> @@ -76,6 +77,7 @@ Ogre::SceneManager * sceneMgr_; Ogre::RenderWindow * window_; InputManager * inputManager_; + VesselManager * vesselManager_; OGConsole * console_; }; Modified: branches/ogsector/src/SectorClientFrameListener.cpp =================================================================== --- branches/ogsector/src/SectorClientFrameListener.cpp 2007-04-24 09:52:17 UTC (rev 418) +++ branches/ogsector/src/SectorClientFrameListener.cpp 2007-04-28 15:24:32 UTC (rev 419) @@ -9,25 +9,6 @@ namespace OpenGate{ -// inline std::string encode_utf8( std::string & ansi ){ -// size_t ansi_len = ansi.length(); -// int len = MultiByteToWideChar( Ogre::CP_ACP, 0, ansi.c_str(), ansi_len, NULL, 0 ); - -// if (ansi_len > 0 && len > 0) { -// WCHAR *utf16 = new WCHAR[len]; - -// MultiByteToWideChar(CP_ACP, 0, ansi.c_str(), ansi_len, (LPWSTR)utf16, len); -// ansi_len = WideCharToMultiByte(CP_UTF8, 0, (LPWSTR)utf16, len, NULL, 0, NULL, NULL); - -// std::string unicode(ansi_len, 0); - -// WideCharToMultiByte(CP_UTF8, 0, (LPWSTR)utf16, len, (LPSTR)unicode.c_str(), ansi_len, NULL, NULL); -// delete[] utf16; -// return unicode; -// } -// return ""; -// } - SectorClientFrameListener::SectorClientFrameListener( Ogre::RenderWindow * win, Ogre::Camera * cam, Sector * sector, NetworkClient * nw ) : window_( win ), camera_( cam ), sector_( sector ), network_( nw ) { @@ -286,24 +267,40 @@ } else { // ** chatmode if ( e.key != OIS::KC_BACK ) { - if ( (int)e.text > 31 && (int)e.text < 167 ) { + if ( (int)e.text > 31 && (int)e.text < 127 ) { chatString_ += e.text; } else { - std::cout << (char)e.text << " " << e.text << std::endl; + std::cout << (char)e.text << " " << (unsigned int)e.text << " " << std::endl; } } else if ( chatString_.length() > 0 ) { chatString_ = chatString_.substr( 0, chatString_.length() - 1 ); } - hudOverlay_->getChild( overlayName_ + "/ChatIn/TextArea" )->setCaption( Ogre::UTFString( chatString_ ) ); +// std::wstring wstr( (wchar_t*)&e.text ); +// chatString_ +=(char(196)); +// std::cout << chatString_<< std::endl; +// std::cout << Ogre::String( chatString_.c_str() ) << std::endl; +// std::cout << Ogre::UTFString( wstr ) << std::endl; + +// std::cout << Ogre::UTFString( stws( chatString_ ) ) << std::endl; + + // std::cout << Ogre::UTFString( std::wstring( "\xF6\xE4\xFC") ) << std::endl; +// std::cout << Ogre::UTFString("\xF6\xFC\xE4") << std::endl; +// std::cout << Ogre::UTFString(chatString_).asUTF8_c_str() << std::endl; + + + Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + + "/ChatIn/TextArea" )->setCaption( chatString_ ); + if ( e.key == OIS::KC_RETURN) { MessageBodyChat chat( chatString_ ); network_->send( chat ); chatString_.clear(); - hudOverlay_->getChild( overlayName_ + "/ChatIn/TextArea" )->setCaption( chatString_ ); + Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + + "/ChatIn/TextArea" )->setCaption( chatString_ ); hudOverlay_->getChild( overlayName_ + "/ChatIn" )->hide( ); chatMode_ = false; } Modified: branches/ogsector/src/SectorObjects.cpp =================================================================== --- branches/ogsector/src/SectorObjects.cpp 2007-04-24 09:52:17 UTC (rev 418) +++ branches/ogsector/src/SectorObjects.cpp 2007-04-28 15:24:32 UTC (rev 419) @@ -11,6 +11,7 @@ sceneMgr_ = sector_->sceneManager(); mainNode_ = static_cast< Ogre::SceneNode * >( sceneMgr_->getRootSceneNode()->createChild() ); lifeTime_ = 0.0; + selectable_ = false; } BaseObject::~BaseObject(){ @@ -19,6 +20,7 @@ Projectile::Projectile( BaseObject * parent, long shotCounter, Ogre::Real speed ) : BaseObject( parent->name(), parent->sector() ), parent_( parent ) { + selectable_ = false; Ogre::String bulletName( name_ + "_" + toStr( shotCounter ) ); @@ -157,6 +159,7 @@ isOnRadar_ = false; mainNodeShape_ = mainNode_->createChildSceneNode( name_ + "_transform" ); baseSize_ = 0.0; + selectable_ = true; } SectorObject::~SectorObject(){ @@ -193,39 +196,56 @@ baseSize_ = targetSize; } -SectorObjectMoveable::SectorObjectMoveable( const Ogre::String & name, Sector * sector, int userID, int childID ) - : SectorObject( name, sector, userID, childID ) { +SectorObjectMoveable::SectorObjectMoveable( const Ogre::String & name, Sector * sector, int userID, int childID, + Vessel & vessel ) + : SectorObject( name, sector, userID, childID ), vesselBluePrint_( &vessel ) { inititializeVesselStats_(); - setShape( "ships/octavius/apteryx/apteryx.mesh" ); - //setShape( "ogrehead.mesh" ); + setShape( vesselBluePrint_->meshPtr().get()->getName() ); - baseYaw( Ogre::Degree( -90 ) ); - setBaseSize( 12.2 ); + baseYaw( Ogre::Degree( vesselBluePrint_->baseYaw() ) ); + setBaseSize( vesselBluePrint_->baseSize() ); - thrusterParticles_ = sceneMgr_->createParticleSystem( name_ + "Thruster" ); - thrusterParticles_->setMaterialName( "Examples/Flare" ); - thrusterParticles_->setDefaultDimensions( 2, 1 ); - Ogre::ParticleEmitter *pEmit1 = thrusterParticles_->addEmitter( "Point" ); - pEmit1->setDirection( mainNode_->getOrientation().zAxis() ); - pEmit1->setPosition( Ogre::Vector3( 0.0f, 0.5f, 5.0f ) ); - pEmit1->setColour( Ogre::ColourValue::Blue, Ogre::ColourValue::Green); + if ( vesselBluePrint_->factionName() == "squadrok" ){ + thrusterParticles_ = NULL; - mainNode_->attachObject( thrusterParticles_ ); + thrusterBbs_ = sceneMgr_->createBillboardSet( name_ + "thrust_BBS" ); + thrusterBbs_->setMaterialName("squadrok/thrusterLight"); + Ogre::Billboard *bb = thrusterBbs_->createBillboard( mainNode_->getOrientation().zAxis().normalisedCopy() * 10.0 ); + bb->setDimensions( 12.0, 12.0 ); + ... [truncated message content] |
From: <spo...@us...> - 2007-04-30 17:59:30
|
Revision: 425 http://svn.sourceforge.net/opengate/?rev=425&view=rev Author: spom_spom Date: 2007-04-30 10:59:31 -0700 (Mon, 30 Apr 2007) Log Message: ----------- Improved spawn synchronisation and fixed some net issues. Removed unused libgrapple. Modified Paths: -------------- branches/ogsector/configure.ac branches/ogsector/externals/genExternals.sh branches/ogsector/src/LogManager.cpp branches/ogsector/src/LogManager.h branches/ogsector/src/Sector.cpp branches/ogsector/src/Sector.h branches/ogsector/src/SectorClient.cpp branches/ogsector/src/SectorClient.h branches/ogsector/src/SectorClientFrameListener.cpp branches/ogsector/src/SectorObjects.cpp branches/ogsector/src/SectorObjects.h branches/ogsector/src/VesselManager.cpp branches/ogsector/src/VesselManager.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/ogconsole.cpp branches/ogsector/src/ogsectorclient.cpp Removed Paths: ------------- branches/ogsector/externals/libgrapple branches/ogsector/externals/libgrapple-0.9.1/ Modified: branches/ogsector/configure.ac =================================================================== --- branches/ogsector/configure.ac 2007-04-30 16:27:17 UTC (rev 424) +++ branches/ogsector/configure.ac 2007-04-30 17:59:31 UTC (rev 425) @@ -29,7 +29,7 @@ dnl asio: http://sourceforge.net/projects/asio/ AC_CHECK_HEADER([asio.hpp],, [ - echo "Can't find asio headers. Pleas install the asio development packages." + echo "Can't find asio headers. Please install the asio development packages." echo "You can get them from http://sourceforge.net/projects/asio/" exit 1 ],[]) Modified: branches/ogsector/externals/genExternals.sh =================================================================== --- branches/ogsector/externals/genExternals.sh 2007-04-30 16:27:17 UTC (rev 424) +++ branches/ogsector/externals/genExternals.sh 2007-04-30 17:59:31 UTC (rev 425) @@ -5,7 +5,6 @@ INSTALLPATH=$(pwd) OISPATH='ois' -GRAPPLEPATH='libgrapple' OGREOPCODE='ogreopcode' help(){ @@ -17,13 +16,11 @@ slotAll(){ slotOIS - slotGrapple slotOgreOpcode } slotClean(){ slotOIS clean - slotGrapple clean slotOgreOpcode clean [ -d "$INSTALLPATH/lib/" ] && rm -r $INSTALLPATH/lib/ [ -d "$INSTALLPATH/include/" ] && rm -r $INSTALLPATH/include/ @@ -52,28 +49,6 @@ fi } -slotGrapple(){ - ARG=$1 - - if [ -d "$GRAPPLEPATH" ] - then - cd $GRAPPLEPATH - if [ "$ARG" = "clean" ] - then - [ -f "Makefile" ] && make distclean - rm -rf configure aclocal.m4 autom4te.cache/ ltmain.sh - else - sh autogen.sh - ./configure --prefix=$INSTALLPATH - make - make install - fi - cd .. - else - echo "Cannot find grapple path: $GRAPPLEPATH" - fi -} - slotOgreOpcode(){ ARG=$1 @@ -109,8 +84,6 @@ slotClean;; ois) slotOIS;; - grapple) - slotGrapple;; ogreopcode) slotOgreOpcode;; help) help;; Deleted: branches/ogsector/externals/libgrapple =================================================================== --- branches/ogsector/externals/libgrapple 2007-04-30 16:27:17 UTC (rev 424) +++ branches/ogsector/externals/libgrapple 2007-04-30 17:59:31 UTC (rev 425) @@ -1 +0,0 @@ -link libgrapple-0.9.1/ \ No newline at end of file Modified: branches/ogsector/src/LogManager.cpp =================================================================== --- branches/ogsector/src/LogManager.cpp 2007-04-30 16:27:17 UTC (rev 424) +++ branches/ogsector/src/LogManager.cpp 2007-04-30 17:59:31 UTC (rev 425) @@ -29,8 +29,12 @@ } void LogManager::setConsole( OGConsole * console ){ - console_ = console; - haveConsole_ = true; + if ( console ){ + console_ = console; + haveConsole_ = true; + } else { + haveConsole_ = false; + } } std::string LogManager::timeStamp() { @@ -65,6 +69,11 @@ write_( logMsg ); } +void LogManager::warn( const std::string & msg ){ + std::string logMsg( "WARNING: " + msg ); + write_( logMsg ); +} + void LogManager::fatal( const std::string & msg ){ std::string logMsg( "FATAL: " + msg ); Modified: branches/ogsector/src/LogManager.h =================================================================== --- branches/ogsector/src/LogManager.h 2007-04-30 16:27:17 UTC (rev 424) +++ branches/ogsector/src/LogManager.h 2007-04-30 17:59:31 UTC (rev 425) @@ -34,6 +34,8 @@ void debug( const std::string & msg ); + void warn( const std::string & msg ); + void fatal( const std::string & msg ); void cout( const std::string & msg ); Modified: branches/ogsector/src/Sector.cpp =================================================================== --- branches/ogsector/src/Sector.cpp 2007-04-30 16:27:17 UTC (rev 424) +++ branches/ogsector/src/Sector.cpp 2007-04-30 17:59:31 UTC (rev 425) @@ -33,7 +33,7 @@ starsNode_ = NULL; avatar_ = NULL; - avatarDeathSequenceTime_ = 0.0; + avatarRespawnTime_ = 0.0; sceneMgr_->setAmbientLight( Ogre::ColourValue(0.5, 0.5, 0.5) ); //** Create a light; @@ -253,95 +253,92 @@ planetNode_->setPosition( Ogre::Vector3( 20000.0, 10000.0, 50000 ) + avatar_->mainNode()->getPosition() ); planetNode_->rotate( rot, Ogre::Node::TS_PARENT ); 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++){ - - Ogre::Vector3 relativPosition( (*it)->mainNode()->getPosition( ) - avatar_->mainNode()->getPosition( ) ); - - if ( relativPosition.length() < radarRange ){ - Ogre::OverlayElement * dotA, * dotB; + 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 ( !(*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( ) ); + + if ( relativPosition.length() < radarRange ){ + Ogre::OverlayElement * dotA, * dotB; - 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 ); + 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 ); + + 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 ); + + (*it)->onRadar( true ); + } else { + dotA = radarMap->getChild( "Radar/Map/DotA" + (*it)->name() ); + dotB = radarMap->getChild( "Radar/Map/DotB" + (*it)->name() ); + } + + 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 ); + } - - 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 + } // if in radarrange + } + for ( std::map< long, SectorObjectMoveable * >::iterator it = movableObjects_.begin(); it != movableObjects_.end();){ + if ( !it->second->update( elapsedTime ) ) { //** object died; - //bool tmpsegfaultDebug = false; - for ( std::map< long, SectorObjectMoveable * >::iterator it = movableObjects_.begin(); it != movableObjects_.end();){ - if ( !it->second->update( elapsedTime ) ) { - // tmpsegfaultDebug = true; - log_->info( "Destructing: " + it->second->name() ); - SectorObjectMoveable * obj = it->second; - // movableObjects_.erase( it++ ); - destructMoveableObject( (it++)->second ); - log_->info( "... done." ); + if ( it->second == avatar_ ) { + if ( avatarRespawnTime_ == 0.0 ){ + sendVesselDeRegister( avatar_ ); + avatarRespawnTime_ = 5.0; + } else { + avatarRespawnTime_ -= elapsedTime; + if ( avatarRespawnTime_ < 0 ){ + spawnAvatar(); + } + } + it++; + } else { //** died object is not avatar; + log_->info( "Destructing: " + it->second->name() ); + destructMoveableObject( (it++)->second ); + log_->info( "done: " ); + } } else ++it; } - -// if ( tmpsegfaultDebug) { -// log_->debug( " tmpsegfaultDebug done." ); -// tmpsegfaultDebug = false; -// } - - if ( avatarDeathSequenceTime_ > 0 ){ - avatarDeathSequenceTime_ -= elapsedTime; - } else if ( avatarDeathSequenceTime_ > -1 ) { - spawnAvatar(); - } - } SectorObjectMoveable * Sector::createMoveableObject( const Ogre::String & name, int userID, int childID, @@ -357,22 +354,36 @@ selectNextTarget( obj ); sectorObjects_.erase( obj ); - 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() ); + if ( obj->isOnRadar() ){ + 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() ); + } + for ( std::map< long, SectorObjectMoveableAi * >::iterator it = localAiObjects_.begin(); + it != localAiObjects_.end(); it ++ ){ + if ( it->second->target() == obj ){ + log_->warn( std::string( "ai object target: " ) + it->second->name() + " loose target." ); + it->second->setTarget( NULL ); + } + } + switch ( obj->getTypeID() ){ case SECTOROBJECTMOVABLE_RTTI: movableObjects_.erase( obj->globalID() ); delete obj; + obj = NULL; + break; case SECTOROBJECTMOVABLE_AI_RTTI: { + if ( dynamic_cast< SectorObjectMoveableAi *>( obj )->target() == avatar_ ) sendVesselDeRegister( obj ); movableObjects_.erase( obj->globalID() ); - localAiObjects_.erase( dynamic_cast< SectorObjectMoveableAi *>(obj)->childID() ); + localAiObjects_.erase( dynamic_cast< SectorObjectMoveableAi *>(obj)->globalID() ); delete obj; + obj = NULL; } break; default: std::cerr << "object type unknown. this should not happen." << obj->getTypeID() << std::endl; @@ -391,17 +402,15 @@ obj->mainNode()->setPosition( pos ); sectorObjects_.insert( obj ); - - // insertCollisionSectorObject( obj ); } -SectorObjectMoveableAi * Sector::createAiMoveableObject( const Ogre::String & name, int childID, +SectorObjectMoveableAi * Sector::createAiMoveableObject( const Ogre::String & name, int userID, int childID, Vessel & vessel ){ - SectorObjectMoveableAi * obj = new SectorObjectMoveableAi( name, this, network_->userID(), childID, vessel ); + SectorObjectMoveableAi * obj = new SectorObjectMoveableAi( name, this, userID, childID, vessel ); sectorObjects_.insert( obj ); movableObjects_[ obj->globalID() ] = obj ; - localAiObjects_[ obj->childID() ] = obj; + localAiObjects_[ obj->globalID() ] = obj; return obj; } @@ -409,11 +418,14 @@ void Sector::spawnAiObject( ){ int childID = 1; - while ( localAiObjects_.count( childID ) ){ childID ++; } + while ( localAiObjects_.count( createGlobalID( network_->userID(), childID ) ) ){ childID ++; } - SectorObjectMoveableAi *obj = createAiMoveableObject( avatar_->name() + "_Spawn" + Ogre::StringConverter::toString( childID ), childID, *VesselManager::getSingleton().vessel( "squid" ) ); + SectorObjectMoveableAi *obj = createAiMoveableObject( network_->userName() + "_Spawn" + toStr( childID ), + network_->userID(), childID, + *VesselManager::getSingleton().vessel( "squid" ) ); - obj->setTarget( avatar_ ); + if ( avatar_ ) obj->setTarget( avatar_ ); + log_->info( std::string( "Create ai object: ") + obj->name() ); Ogre::Real xmin = -5000.0, xmax = -4000.0; Ogre::Real ymin = -5000.0, ymax = -4000.0; @@ -426,12 +438,12 @@ // obj->mainNode()->setPosition( 0.0f, 0.0f, 200.0f); - MessageBodyShipRegister msg( 0, obj->childID(), obj->name(), obj->mainNode()->getPosition(), - true, obj->vesselBluePrint()->vesselID() ); - network_->send( msg ); + sendVesselRegister( obj ); + 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" ) ); //sectorObjects_.insert( obj ); @@ -440,33 +452,30 @@ void Sector::destructAvatar( ){ // sectorObjects_.erase( avatar_ ); + sendVesselDeRegister( avatar_ ); movableObjects_.erase( avatar_->globalID() ); - if ( avatar_ != NULL ) delete avatar_; + if ( avatar_ ) delete avatar_; avatar_ = NULL; } void Sector::avatarDied( ){ - avatarDeathSequenceTime_ = 5.0; - avatar_->setVisible( true ); - MessageBodyShipRegister msg( 0, 0, avatar_->name(), avatar_->mainNode()->getPosition(), false, 0 ); - network_->send( msg ); - listener_->avatarDeathSequence( true ); + if ( avatar_ ){ + avatar_->setVisible( true ); + listener_->avatarDeathSequence( true ); + } } void Sector::spawnAvatar( ){ - if ( avatar_ != NULL ){ - avatarDeathSequenceTime_ = -1.0; - + 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_->reset(); - MessageBodyShipRegister msg( 0, 0, avatar_->name(), avatar_->mainNode()->getPosition(), - true, avatar_->vesselBluePrint()->vesselID() ); - network_->send( msg ); - avatar_->setVisible( false ); + sendVesselRegister( avatar_ ); listener_->avatarDeathSequence( false ); } } @@ -562,66 +571,117 @@ object->attachObject( circle ); } -void Sector::receiveVesselRegister( const MessageBodyShipRegister & msg ){ +void Sector::sendAllVesselMovements( ){ + if ( avatar_ ) sendVesselMovement( avatar_ ); - if ( msg.senderID() != network_->userID() ){ - // std::map< long , SectorObjectMoveable * >::iterator it; +// for ( std::map< int, SectorObjectMoveableAi * >::iterator it = localAiObjects_.begin(); it != localAiObjects_.end(); it ++ ){ +// sendVesselMovement( it->second ); +// } - if ( movableObjects_.count( createGlobalID( msg.senderID(), msg.childID() ) ) ){ - if ( msg.status() == false ){ - log_->info( "Deregistering " + movableObjects_[ createGlobalID( msg.senderID(), msg.childID() ) ]->name() ); - destructMoveableObject( movableObjects_[ createGlobalID( msg.senderID(), msg.childID() ) ] ); - } else { - log_->info( "Object " + msg.name() + " allready registered." ); +} + +void Sector::sendAllVesselInfos( ){ + if ( avatar_ ){ + sendVesselStatus( avatar_ ); + + for ( std::map< long, SectorObjectMoveableAi * >::iterator it = localAiObjects_.begin(); it != localAiObjects_.end(); it ++ ){ + if ( it->second->target() == avatar_ ){ + sendVesselMovement( it->second ); + sendVesselStatus( it->second ); } - } else { - if ( msg.status() == true ){ - log_->info( "Create object " + msg.name()+ " " + toStr( msg.senderID() ) + " " + toStr( (int)msg.childID() ) + " " ); - SectorObjectMoveable * obj = createMoveableObject( msg.name(), msg.senderID(), msg.childID(), - *VesselManager::getSingleton().vessel( msg.vesselID() ) ); - obj->mainNode()->setPosition( msg.position() ); - sendAllVesselStatus( ); - } } } } -void Sector::sendAllVesselMovements( ){ - if ( avatar_ != NULL ){ - MessageBodyShipMovement msg( 0, - avatar_->mainNode()->getPosition(), - avatar_->velDirection(), - avatar_->mainNode()->getOrientation(), - avatar_->thrustPercent(), - avatar_->scaledYaw(), - avatar_->scaledPitch(), - avatar_->scaledRoll(), - avatar_->incNetSequence() ); +void Sector::sendVesselMovement( SectorObjectMoveable * obj ){ + if ( obj ){ + MessageBodyShipMovement msg( obj->childID(), + obj->mainNode()->getPosition(), + obj->velDirection(), + obj->mainNode()->getOrientation(), + obj->thrustPercent(), + obj->scaledYaw(), + obj->scaledPitch(), + obj->scaledRoll(), + obj->incNetSequence() ); + + network_->send( msg ); + } +} +void Sector::sendVesselRegister( SectorObjectMoveable * obj ){ + if ( obj ) { + log_->info( std::string( "Send register " ) + obj->name() ); + MessageBodyShipRegister msg( obj->userID(), obj->childID(), obj->name(), obj->mainNode()->getPosition(), + obj->vesselBluePrint()->vesselID() ); network_->send( msg ); } - for ( std::map< int, SectorObjectMoveableAi * >::iterator it = localAiObjects_.begin(); it != localAiObjects_.end(); it ++ ){ - MessageBodyShipMovement msgObj( it->second->childID(), - it->second->mainNode()->getPosition(), - it->second->velDirection(), - it->second->mainNode()->getOrientation(), - it->second->thrustPercent(), - it->second->scaledYaw(), - it->second->scaledPitch(), - it->second->scaledRoll(), - it->second->incNetSequence() ); +} - network_->send( msgObj ); +void Sector::receiveVesselRegister( const MessageBodyShipRegister & msg ){ + + 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() ) ); + SectorObjectMoveable * obj = createMoveableObject( msg.name(), msg.senderID(), msg.childID(), + *VesselManager::getSingleton().vessel( msg.vesselID() ) ); + obj->mainNode()->setPosition( msg.position() ); + } else { + log_->info( "Create ai object " + msg.name()+ " " + toStr( msg.senderID() ) + " " + + toStr( (int)msg.childID() ) + " " + toStr( msg.vesselID() ) ); + + SectorObjectMoveableAi * obj = createAiMoveableObject( msg.name(), msg.senderID(), msg.childID(), + *VesselManager::getSingleton().vessel( msg.vesselID() ) ); + obj->mainNode()->setPosition( msg.position() ); + + if ( movableObjects_.count( createGlobalID( msg.senderID(), 0 ) ) ){ + log_->info( "ai object target: " + movableObjects_[ createGlobalID( msg.senderID(), 0 ) ]->name() ); + obj->setTarget( movableObjects_[ createGlobalID( msg.senderID(), 0 ) ] ); + } + } + + sendAllVesselInfos( ); + + } else { + log_->warn( std::string( "Registering: object allready exist: " ) + + movableObjects_[ createGlobalID( msg.senderID(), msg.childID() ) ]->name() ); } + } +void Sector::sendVesselDeRegister( SectorObjectMoveable * obj ){ + if ( obj ) { + log_->info( std::string( "Send Deregister " ) + obj->name() ); + MessageBodyShipDeRegister msg( 0, obj->childID() ); + network_->send( msg ); + } +} +void Sector::receiveVesselDeRegister( const MessageBodyShipDeRegister & msg ){ + if ( movableObjects_.count( createGlobalID( msg.senderID(), msg.childID() ) ) ){ + log_->info( std::string( "Receive deregister " ) + + movableObjects_[ createGlobalID( msg.senderID(), msg.childID() ) ]->name() ); + + SectorObjectMoveable *obj = movableObjects_[ createGlobalID( msg.senderID(), msg.childID() ) ]; + + destructMoveableObject( obj ); + + } else { + log_->warn( std::string( "Deregistering request for unknown object: " ) + + toStr( msg.senderID() ) + ": " + toStr( msg.childID() ) ); + } +} + void Sector::receiveVesselMovement( const std::vector < MessageBodyShipMovement * > & movements ){ std::map < long, const MessageBodyShipMovement * > singleMsg; //** we sort the movement messaged for ( size_t i = 0; i < movements.size(); i ++ ){ +// LogManager::getSingleton().debug( std::string( "Movement: " ) + +// movableObjects_[ createGlobalID( movements[ i ]->senderID(), movements[ i ]->childID() )]->name() + " " + toStr( movements[ i ]->senderID() ) + " " + toStr( (int)movements[ i ]->childID() ) + +// " " + toStr( movements[ i ]->position() ) ); + if ( movements[ i ]->senderID() != network_->userID() ){ //** apply only foreign movements, and take just the actual movement singleMsg[ createGlobalID( movements[ i ]->senderID(), movements[ i ]->childID() ) ] = movements[ i ]; @@ -639,38 +699,35 @@ << i->second->position() << " this should not happen." << std::endl; } } + for ( size_t i = 0; i < movements.size(); i ++ ){ + delete movements[ i ]; + } + } -void Sector::sendAllVesselStatus( ){ - if ( avatar_ != NULL ){ - sendVesselStatus( *avatar_ ); +void Sector::sendVesselStatus( SectorObjectMoveable * obj ){ + if ( obj ){ + MessageBodyShipStatus msg( obj->childID(), + obj->shieldPercent(), + obj->armorPercent(), + obj->firePressed(), + obj->afterburnerPressed(), + obj->breakPressed() ); + network_->send( msg ); } -// for ( std::map< int, SectorObjectMoveableAi * >::iterator it = localAiObjects_.begin(); it != localAiObjects_.end(); it ++ ){ -// sendVesselStatus( *(it->second) ); -// } } -void Sector::sendVesselStatus( const SectorObjectMoveable & obj ){ - MessageBodyShipStatus msg( obj.childID(), - obj.shieldPercent(), - obj.armorPercent(), - obj.firePressed(), - obj.afterburnerPressed(), - obj.breakPressed() ); - network_->send( msg ); -} - void Sector::receiveVesselStatus( const MessageBodyShipStatus & msg ){ if ( msg.senderID() != network_->userID() ){ std::map< long, SectorObjectMoveable * >::iterator it; if ( ( it = movableObjects_.find( createGlobalID( msg.senderID(), msg.childID() ) ) ) != movableObjects_.end() ){ - log_->cout( "ReceiveVesselStatus for " + it->second->name( ) ); + log_->debug( "ReceiveVesselStatus for " + it->second->name( ) ); it->second->setStatus( msg ); } else { log_->fatal( "Requested non existant object for shipstatus: " + - network_->userName( msg.senderID() ) + " this should not happen." ); + network_->userName( msg.senderID() ) + " this should not happen." ); } } } Modified: branches/ogsector/src/Sector.h =================================================================== --- branches/ogsector/src/Sector.h 2007-04-30 16:27:17 UTC (rev 424) +++ branches/ogsector/src/Sector.h 2007-04-30 17:59:31 UTC (rev 425) @@ -35,7 +35,7 @@ SectorObjectMoveable * createMoveableObject( const Ogre::String & name, int userId, int childId, Vessel & vessel ); - SectorObjectMoveableAi * createAiMoveableObject( const Ogre::String & name, int childId, Vessel & vessel ); + SectorObjectMoveableAi * createAiMoveableObject( const Ogre::String & name, int userId, int childId, Vessel & vessel ); void destructMoveableObject( SectorObjectMoveable * obj ); @@ -62,20 +62,22 @@ SectorObject * prevTarget( ); + void sendAllVesselInfos( ); + void sendAllVesselMovements( ); + + void sendVesselRegister( SectorObjectMoveable * obj ); void receiveVesselRegister( const MessageBodyShipRegister & msg ); - void sendAllVesselStatus( ); + void sendVesselDeRegister( SectorObjectMoveable * obj ); + void receiveVesselDeRegister( const MessageBodyShipDeRegister & msg ); - void sendAllVesselMovements( ); - + void sendVesselMovement( SectorObjectMoveable * obj ); void receiveVesselMovement( const std::vector < MessageBodyShipMovement * > & movements ); - void sendVesselStatus( const SectorObjectMoveable & obj ); - + void sendVesselStatus( SectorObjectMoveable * obj ); void receiveVesselStatus( const MessageBodyShipStatus & msg ); void sendVesselAmmoHit( const Projectile & projectile, BaseObject * victim ); - void receiveVesselAmmoHit( const MessageBodyShipAmmoHit & msg ); protected: @@ -97,9 +99,9 @@ std::set< SectorObject * >::iterator itTarget_; std::map< long, SectorObjectMoveable * > movableObjects_; - std::map< int, SectorObjectMoveableAi * > localAiObjects_; + std::map< long, SectorObjectMoveableAi * > localAiObjects_; - float avatarDeathSequenceTime_; + float avatarRespawnTime_; }; Modified: branches/ogsector/src/SectorClient.cpp =================================================================== --- branches/ogsector/src/SectorClient.cpp 2007-04-30 16:27:17 UTC (rev 424) +++ branches/ogsector/src/SectorClient.cpp 2007-04-30 17:59:31 UTC (rev 425) @@ -2,15 +2,6 @@ namespace OpenGate{ -void SectorClient::createScene( ){ - sector_ = new Sector( sceneMgr_, network_ ); - sector_->createAvatar( network_->userName() ); -} - -void SectorClient::destroyScene( ){ - if ( sector_ != NULL ) delete sector_; -} - bool SectorClient::setup( bool dialog ){ root_ = new Ogre::Root; @@ -37,8 +28,9 @@ // Create the scene vesselManager_ = new VesselManager( ); + vesselManager_->loadVessels( resourcePaths_, "ships.xml" ); - createScene(); + sector_ = new Sector( sceneMgr_, network_ ); inputManager_ = new InputManager( ); @@ -58,8 +50,7 @@ // OgreConsole::getSingleton().addCommand("quit",&CMD_Quit); // OgreConsole::getSingleton().addCommand("screenshot",&CMD_Screenshot); - - sector_->spawnAvatar(); + return true; } @@ -80,6 +71,7 @@ typeName = i->first; archName = i->second; Ogre::ResourceGroupManager::getSingleton().addResourceLocation( archName, typeName, secName ); + resourcePaths_.insert( archName ); } } } Modified: branches/ogsector/src/SectorClient.h =================================================================== --- branches/ogsector/src/SectorClient.h 2007-04-30 16:27:17 UTC (rev 424) +++ branches/ogsector/src/SectorClient.h 2007-04-30 17:59:31 UTC (rev 425) @@ -31,19 +31,49 @@ console_ = NULL; } - virtual ~SectorClient(){ - if ( console_ != NULL ) delete console_; - if ( frameListener_ != NULL ) delete frameListener_; - if ( inputManager_ != NULL ) delete inputManager_; + virtual ~SectorClient(){ + shutdown(); if ( root_ != NULL ) delete root_; } + void shutdown(){ + if ( console_ != NULL ) { + LogManager::getSingleton().debug( "Shutdown console." ); + delete console_; + console_ = NULL; + } + if ( frameListener_ != NULL ) { + LogManager::getSingleton().info( "Shutdown framelistener." ); + delete frameListener_; + frameListener_ = NULL; + } + if ( inputManager_ != NULL ) { + LogManager::getSingleton().info( "Shutdown inputmanager." ); + delete inputManager_; + inputManager_ = NULL; + } + if ( sector_ != NULL ) { + LogManager::getSingleton().info( "Shutdown sector." ); + delete sector_; + sector_ = NULL; + } + if ( vesselManager_ ){ + LogManager::getSingleton().info( "Shutdown vesselmanager." ); + delete vesselManager_; + vesselManager_ = NULL; + } + } + virtual void go( bool dialog ){ if ( !setup( dialog ) ) return; + sector_->createAvatar( network_->userName() ); + sector_->spawnAvatar(); + root_->startRendering(); - - destroyScene(); + + sector_->destructAvatar( ); + shutdown(); } protected: @@ -63,11 +93,6 @@ virtual void createFrameListener( ); - virtual void createScene( ); - - virtual void destroyScene( ); - - NetworkClient * network_; Ogre::Root * root_; SectorClientFrameListener * frameListener_; @@ -80,6 +105,8 @@ VesselManager * vesselManager_; OGConsole * console_; + + std::set < std::string > resourcePaths_; }; } // namespace OpenGate Modified: branches/ogsector/src/SectorClientFrameListener.cpp =================================================================== --- branches/ogsector/src/SectorClientFrameListener.cpp 2007-04-30 16:27:17 UTC (rev 424) +++ branches/ogsector/src/SectorClientFrameListener.cpp 2007-04-30 17:59:31 UTC (rev 425) @@ -125,31 +125,44 @@ std::vector < MessageBodyShipMovement * > movements; network_->pull( msgs ); - for ( size_t i = 0; i < msgs.size(); i ++ ){ - switch ( msgs[ i ][ 0 ] ){ - case PROTO_CHAT:{ - network_->ping(); - MessageBodyChat msg( &msgs[ i ][ 0 ] ); - sector_->log()->chat( network_->userName( msg.senderID() ), msg.message() ); - } break; - case PROTO_SHIPREGISTER: - sector_->receiveVesselRegister( &msgs[ i ][ 0 ] ); break; - case PROTO_SHIPSTATUS: - sector_->receiveVesselStatus( &msgs[ i ][ 0 ] ); break; - case PROTO_SHIPMOVEMENT:{ - //** we handle that in sum, so we can ignore dups because of packet loss - MessageBodyShipMovement msg( &msgs[ i ][ 0 ] ); - movements.push_back( &msg ); - } break; - case PROTO_SHIPAMMOHIT: - sector_->receiveVesselAmmoHit( &msgs[ i ][ 0 ] ); break; - default: - std::cerr << "PROTO type unknown: " << msgs[ i ][ 0 ] << " " << msgs[ i ].size() << std::endl; - break; + if ( msgs.size() > 0 ) { + + // LogManager::getSingleton().debug( std::string( "Pullcount: " ) + toStr( msgs.size() ) ); + + for ( size_t i = 0; i < msgs.size(); i ++ ){ + +// LogManager::getSingleton().debug( std::string( "Pull: " ) + toStr( (int)msgs[ i ][ 0 ] ) ); +// if ( msgs[ i ][ 0 ] == PROTO_SHIPMOVEMENT ) { +// MessageBodyShipMovement m( &msgs[ i ][ 0 ] ); +// std::cout << m << std::endl; +// } + + switch ( msgs[ i ][ 0 ] ){ + case PROTO_CHAT:{ + network_->ping(); + MessageBodyChat msg( &msgs[ i ][ 0 ] ); + sector_->log()->chat( network_->userName( msg.senderID() ), msg.message() ); + } break; + case PROTO_SHIPREGISTER: + sector_->receiveVesselRegister( &msgs[ i ][ 0 ] ); break; + case PROTO_SHIPDEREGISTER: + sector_->receiveVesselDeRegister( &msgs[ i ][ 0 ] ); break; + case PROTO_SHIPSTATUS: + sector_->receiveVesselStatus( &msgs[ i ][ 0 ] ); break; + case PROTO_SHIPMOVEMENT:{ + //** we handle that in sum, so we can ignore dups because of packet loss + MessageBodyShipMovement *msg = new MessageBodyShipMovement( &msgs[ i ][ 0 ] ); + movements.push_back( msg ); + } break; + case PROTO_SHIPAMMOHIT: + sector_->receiveVesselAmmoHit( &msgs[ i ][ 0 ] ); break; + default: + std::cerr << "PROTO type unknown: " << msgs[ i ][ 0 ] << " " << msgs[ i ].size() << std::endl; + break; + } } + if ( movements.size() > 0 ) sector_->receiveVesselMovement( movements ); } - if ( movements.size() > 0 ) sector_->receiveVesselMovement( movements ); - //** end capture network; // max 1000 sector-updates/second @@ -232,9 +245,9 @@ sector_->avatar()->setScaledRoll( 0.0 ); } //** selfdestruct and eject; - if ( e.key == OIS::KC_F11 ) { sector_->avatarDied(); } - 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_F5 ) { duelistPilot_ = !duelistPilot_; } + if ( e.key == OIS::KC_F6 ) { duelistTarget_ = !duelistTarget_; } } // if avatar; //** next Target; Modified: branches/ogsector/src/SectorObjects.cpp =================================================================== --- branches/ogsector/src/SectorObjects.cpp 2007-04-30 16:27:17 UTC (rev 424) +++ branches/ogsector/src/SectorObjects.cpp 2007-04-30 17:59:31 UTC (rev 425) @@ -255,7 +255,6 @@ } void SectorObjectMoveable::setFlightProperties( const MessageBodyShipMovement & msg ){ - if ( forceMovement_ ){ mainNode_->setPosition( msg.position() ); mainNode_->setOrientation( msg.orientation() ); @@ -298,7 +297,7 @@ interpolateRot_ = diff * srcQ.Inverse(); // if ( msg.childID() > 0 ){ - if ( !1 ){ + if ( !1 ){ std::cout << std::endl; std::cout << msg.sequenceNr() << "LastFrameCount: " << lastFrameCount_ @@ -560,27 +559,27 @@ bool SectorObjectMoveable::deathSequence( Ogre::Real elapsedTime ){ if ( !deathSequence_ ){ + setVisible( false ); setSelectable( false ); sector_->selectNextTarget( this ); LogManager::getSingleton().info( name_ + " destroyed." ); + if ( !explosion_ ){ explosion_ = sceneMgr_->createParticleSystem( name_ + "ExplosionSystem", "OpenGate/ExplosionStart" ); mainNode_->attachObject( explosion_ ); - explosion_->getEmitter( 0 )->setEnabled( true ); - explodeSequenceTime_ = explosion_->getEmitter( 0 )->getDuration() + explosion_->getEmitter( 0 )->getMaxTimeToLive(); } + explosion_->getEmitter( 0 )->setEnabled( true ); + explodeSequenceTime_ = explosion_->getEmitter( 0 )->getDuration() + explosion_->getEmitter( 0 )->getMaxTimeToLive(); + if ( thrusterBbs_ ) thrusterBbs_->setVisible( false ); percentageThrust_ = 0; updateThruster(); + deathSequence_ = true; } - deathSequence_ = true; explodeSequenceTime_ -= elapsedTime; if ( explodeSequenceTime_ > 0 || projectiles_.size() > 0 ) { - setVisible( false ); - //mainNode_->showBoundingBox( true ); - return true; } else { explosion_->getEmitter( 0 )->setEnabled( false ); @@ -641,7 +640,7 @@ } if ( statusChanged_ ){ - sector_->sendVesselStatus( *this ); + sector_->sendVesselStatus( this ); statusChanged_ = false; }; @@ -705,7 +704,7 @@ bool SectorObjectAvatar::update( Ogre::Real elapsedTime ){ if ( statusChanged_ ){ - sector_->sendVesselStatus( *this ); + sector_->sendVesselStatus( this ); statusChanged_ = false; }; return SectorObjectMoveable::update( elapsedTime ); @@ -724,10 +723,7 @@ sector_->avatarDied( ); } - SectorObjectMoveable::deathSequence( elapsedTime ); - - //** return always true, this object should not be automatic destroyed by the sector - return true; + return SectorObjectMoveable::deathSequence( elapsedTime ); } Modified: branches/ogsector/src/SectorObjects.h =================================================================== --- branches/ogsector/src/SectorObjects.h 2007-04-30 16:27:17 UTC (rev 424) +++ branches/ogsector/src/SectorObjects.h 2007-04-30 17:59:31 UTC (rev 425) @@ -322,6 +322,9 @@ inline virtual long getTypeID() const { return SECTOROBJECTMOVABLE_AI_RTTI; } virtual void setTarget( SectorObject * target ){ target_ = target; } + + virtual SectorObject * target( ){ return target_; } + // virtual searchTarget( SectorObjectMoveable * target ){ target_ = target; } virtual bool update( Ogre::Real elapsedTime ); Modified: branches/ogsector/src/VesselManager.cpp =================================================================== --- branches/ogsector/src/VesselManager.cpp 2007-04-30 16:27:17 UTC (rev 424) +++ branches/ogsector/src/VesselManager.cpp 2007-04-30 17:59:31 UTC (rev 425) @@ -9,7 +9,6 @@ VesselManager::VesselManager(){ log_ = LogManager::getSingletonPtr(); - loadVessels( ); } VesselManager::~VesselManager(){ @@ -19,56 +18,45 @@ vesselID_.end(); } -void VesselManager::loadVessels( ){ - - std::string shipResourceFile = "./data/ships.xml"; - TiXmlDocument doc( shipResourceFile ); - bool loadOkay = doc.LoadFile(); +void VesselManager::loadVessels( const std::set < std::string > & resourcePaths, const std::string & resourceName ){ - std::map < int, std::string > ships; + for ( std::set < std::string >::iterator it = resourcePaths.begin(); it != resourcePaths.end(); it ++ ){ + std::string shipResourceFile( (*it) + "/" + resourceName ); - if ( loadOkay ) { - TiXmlHandle docHandle( &doc ); - TiXmlElement* pElem; - TiXmlHandle hRoot( 0 ); - - //** block: Ships; - pElem = docHandle.FirstChildElement().Element(); - hRoot = TiXmlHandle( pElem ); + TiXmlDocument doc( shipResourceFile ); + bool loadOkay = doc.LoadFile(); - if ( pElem ) { - log_->debug( pElem->Value() ); - 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_->fatal( shipResourceFile + " cannot read shipResourceFile." ); - } - - - for ( std::map < int, std::string >::iterator it = ships.begin(); it != ships.end(); it ++ ){ - Vessel * vessel = loadAndCreateVessel( it->second ); - if ( vessel ){ - if ( vessel->name().length() > 0 && vessel->factionName().length() > 0 ){ - vesselID_[ it->first ] = vessel; - vessel->setVesselID( it->first ); - vessels_[ vessel->name() ] = vessel; - factions_.insert( vessel->factionName() ); - log_->info( std::string( "Loaded: " ) + vessel->factionName() + "/" + vessel->name() ); + 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( it->second + " has no valid name and factionname." ); + log_->fatal( shipResourceFile + " cannot read first node." ); } } else { - log_->fatal( it->second + " is no valid vessel description." ); + // 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( const std::string & fileName ){ +Vessel * VesselManager::loadAndCreateVessel( int vesselID, const std::string & fileName ){ TiXmlDocument doc( fileName ); bool loadOkay = doc.LoadFile(); @@ -94,9 +82,20 @@ Vessel *vessel = new Vessel(); pElem = hRoot.ChildElement( "faction", 0 ).Element(); - if ( pElem ) vessel->setFactionName( pElem->FirstChild()->Value() ); + if ( pElem ) { + vessel->setFactionName( pElem->FirstChild()->Value() ); + } else { + log_->fatal( fileName + " has no mandatory factionname (mandatory)." ); + return NULL; + } pElem = hRoot.ChildElement( "name", 0 ).Element(); - if ( pElem ) vessel->setName( pElem->FirstChild()->Value() ); + 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() ); @@ -159,6 +158,18 @@ 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; } else { log_->fatal( fileName + " is no ship description" ); Modified: branches/ogsector/src/VesselManager.h =================================================================== --- branches/ogsector/src/VesselManager.h 2007-04-30 16:27:17 UTC (rev 424) +++ branches/ogsector/src/VesselManager.h 2007-04-30 17:59:31 UTC (rev 425) @@ -175,11 +175,12 @@ static VesselManager * getSingletonPtr( ); VesselManager(); + ~VesselManager(); + + void loadVessels( const std::set < std::string > & resourcePaths, const std::string & resourceName ); - void loadVessels( ); - - Vessel * loadAndCreateVessel( const std::string & filename ); + Vessel * loadAndCreateVessel( int vesselID, const std::string & filename ); Vessel * vessel( int vesselID ){ if ( vesselID_.count( vesselID ) ){ Modified: branches/ogsector/src/networkClient.cpp =================================================================== --- branches/ogsector/src/networkClient.cpp 2007-04-30 16:27:17 UTC (rev 424) +++ branches/ogsector/src/networkClient.cpp 2007-04-30 17:59:31 UTC (rev 425) @@ -11,10 +11,11 @@ : io_service_( io_service ), socket_( io_service ), resolver_( io_service ), hostname_( hostName ), online_( false ){ + log_ = LogManager::getSingletonPtr(); pingTime_ = 0; userID_ = 0; - std::cout << "Connecting to " << hostname_ << ":" << 1234 << std::endl; + log_->info( std::string( "Connecting to " ) + hostname_ + ":" + toStr( 1234 ) ); asio::error error = asio::error::host_not_found; try{ @@ -27,19 +28,18 @@ socket_.connect( *endpoint_iterator++, asio::assign_error( error ) ); } } catch ( asio::error & e) { - std::cerr << e << std::endl; + log_->fatal( e.what() ); } catch ( std::exception & e) { - std::cerr << "Exception: " << e.what() << std::endl; + log_->fatal( std::string( "Exception: " ) + e.what() ); } catch (...) { } if ( !error ){ - std::cout << "Connected: waiting for userID. " << std::endl; + log_->info( "Connected: waiting for userID. " ); online_ = true; asio::async_read( socket_, asio::buffer( readMsg_.data(), Message::HeaderLength+MessageBodyUserID( 0 ).dataSize() ), - boost::bind( & NetworkClient::handleReceiveUserID, this, - asio::placeholders::error ) ); + boost::bind( & NetworkClient::handleReceiveUserID, this, asio::placeholders::error ) ); } else { - std::cout << error << std::endl; + log_->fatal( error.what() ); } } @@ -95,8 +95,8 @@ userID_ = (int)msg.userID(); } break; default: - std::cerr << " unknown MESSAGE_PROTO " << base.type() << std::endl; - std::cerr << " wait for userid " << std::endl; + log_->fatal( std::string( "unknown MESSAGE_PROTO " ) + toStr( base.type() ) ); + log_->fatal( "wait for userid " ); asio::async_read( socket_, asio::buffer( readMsg_.data(), Message::HeaderLength+MessageBodyUserID( 0 ).dataSize() ), boost::bind( & NetworkClient::handleReceiveUserID, this, @@ -108,7 +108,7 @@ boost::bind( & NetworkClient::handleReadMessageHeader, this, asio::placeholders::error ) ); } else { - std::cout << "handleReceiveUserID: " << " " << error << std::endl; + log_->fatal( std::string( "handleReceiveUserID: " ) + error.what() ); } } } @@ -122,7 +122,7 @@ boost::bind( &NetworkClient::handleReadMessageBody, this, asio::placeholders::error ) ); } else { - std::cout << "handleReadMessageHeader: " << " " << error << std::endl; + log_->fatal( std::string( "handleReadMessageHeader: " ) + error.what() ); doClose(); } } @@ -137,27 +137,33 @@ switch( base.type() ){ case PROTO_USERNAME: { MessageBodyUserName msg( readMsg_.body() ); - std::cout << "New user = " << (int)msg.senderID() << " " << msg.userName() << std::endl; + log_->info( std::string( "New user = " ) + toStr((int)msg.senderID()) + " " + msg.userName() ); users_[ (int)msg.senderID() ] = msg.userName(); } break; case PROTO_CONNECTION_REFUSED: { MessageBodyConnectionRefused msg( readMsg_.body() ); switch ( msg.reason() ){ case CONNECTION_REFUSED_USER_ALREADY_EXIST: - std::cerr << "Connection refused: " << userName_ << " already conneced to the server" << std::endl; + log_->fatal( std::string( "Connection refused: " ) + userName_ + " already conneced to the server" ); doClose(); online_ = false; break; default: - std::cerr << "Connection refused for unknown reason:" << msg.reason() << std::endl; + log_->fatal( std::string("Connection refused for unknown reason: " ) + toStr( msg.reason() ) ); } } break; case PROTO_DISCONNECT: { MessageBodyDisconnect msg( readMsg_.body() ); - std::cout << "Disconnect user = " << (int)msg.userID() << " " << userName( (int)msg.userID() ) << std::endl; + log_->info( std::string( "Disconnect user = " ) + toStr( (int)msg.userID() ) + " " + + userName( (int)msg.userID() ) ); users_.erase( users_.find( (int)msg.userID() ) ) ; } break; default: +// if ( base.type() == PROTO_SHIPMOVEMENT ) { +// MessageBodyShipMovement m( readMsg_.body() ); +// std::cout << m << std::endl; +// } + std::vector < char > vec( readMsg_.bodyLength() ); vec.resize( readMsg_.bodyLength() ); memcpy( &vec[ 0 ], (char*)readMsg_.body(), readMsg_.bodyLength() ); @@ -168,7 +174,7 @@ boost::bind( & NetworkClient::handleReadMessageHeader, this, asio::placeholders::error ) ); } else { - std::cout << "handleReadMessageBody error: " << " " << error << std::endl; + log_->fatal( std::string( "handleReadMessageBody error: " ) + error.what() ); doClose(); } } @@ -199,7 +205,7 @@ asio::placeholders::error ) ); } } else { - std::cout << "handleWrite: " << " " << error << std::endl; + log_->fatal( std::string( "handleWrite: " ) + error.what() ); doClose(); } } @@ -207,7 +213,8 @@ void NetworkClient::doClose() { if ( online_ ){ - std::cout << "User disconnected." << std::endl; + sleep( 1 ); + // log_->info( std::string( "Network closed, user disconnected." ) ); socket_.close(); pingTime_ = -1; online_ = false; Modified: branches/ogsector/src/networkClient.h =================================================================== --- branches/ogsector/src/networkClient.h 2007-04-30 16:27:17 UTC (rev 424) +++ branches/ogsector/src/networkClient.h 2007-04-30 17:59:31 UTC (rev 425) @@ -4,6 +4,7 @@ #include <asio.hpp> #include <boost/bind.hpp> +#include "LogManager.h" #include "networkProtocol.h" using asio::ip::tcp; @@ -80,6 +81,7 @@ Uint32 userID_; float pingTime_; + LogManager *log_; }; } //namespace OpenGate Modified: branches/ogsector/src/networkProtocol.h =================================================================== --- branches/ogsector/src/networkProtocol.h 2007-04-30 16:27:17 UTC (rev 424) +++ branches/ogsector/src/networkProtocol.h 2007-04-30 17:59:31 UTC (rev 425) @@ -42,9 +42,10 @@ #define PROTO_CHAT 7 #define PROTO_SHIPBASE 10 #define PROTO_SHIPREGISTER 11 -#define PROTO_SHIPSTATUS 12 -#define PROTO_SHIPMOVEMENT 13 -#define PROTO_SHIPAMMOHIT 14 +#define PROTO_SHIPDEREGISTER 12 +#define PROTO_SHIPSTATUS 13 +#define PROTO_SHIPMOVEMENT 14 +#define PROTO_SHIPAMMOHIT 15 #define PROTO_TEST 255 #define CONNECTION_REFUSED_USER_ALREADY_EXIST 1 @@ -103,6 +104,11 @@ virtual int dataSize() const { return sizeof( Uint8 ) + sizeof( Uint32 ); } + friend std::ostream & operator << ( std::ostream & str, const MessageBodyBase & msg ){ + str << "Type: " << (int)( msg.type() ) << " senderID: " << msg.senderID() ; + return str; + } + protected: Uint8 type_; Uint32 senderID_; @@ -267,27 +273,20 @@ class MessageBodyShipRegister : public MessageBodyShipBase { public: - MessageBodyShipRegister( const Uint32 senderID, Uint8 childID, const std::string & name, - const Ogre::Vector3 & pos, Uint8 status, Uint8 vesselID ) - : MessageBodyShipBase( childID ), name_( name ), pos_( pos ), status_( status ), vesselID_( vesselID ){ + MessageBodyShipRegister( const Uint32 senderID, const Uint8 childID, const std::string & name, + const Ogre::Vector3 & pos, Uint16 vesselID ) + : MessageBodyShipBase( childID ), name_( name ), pos_( pos ), vesselID_( vesselID ){ senderID_ = senderID; type_ = (Uint8)PROTO_SHIPREGISTER; } - MessageBodyShipRegister( const Uint32 senderID, Uint8 childID, Uint8 status ) - : MessageBodyShipBase( childID ), name_( "" ), status_( status ){ - senderID_ = senderID; - type_ = (Uint8)PROTO_SHIPREGISTER; - } - MessageBodyShipRegister( const char * data ) : MessageBodyShipBase( data ){ int count = MessageBodyShipBase::dataSize(); readFromData( nameLength_, data, count ); std::string msg( (char*) &data[ count ], nameLength_ ); count += nameLength_; name_ = msg; - readFromData( pos_, data, count ); - readFromData( status_, data, count ); + readFromData( pos_, data, count ); readFromData( vesselID_, data, count ); } @@ -298,10 +297,9 @@ nameLength_ = name_.length(); writeToOut( out_, nameLength_ ); - out_.write( ( char* )( name_.c_str() ), sizeof( char ) * nameLength_ ); + out_.write( ( char* )( name_.c_str() ), sizeof( char ) * nameLength_ ); writeToOut( out_, pos_ ); - writeToOut( out_, status_ ); writeToOut( out_, vesselID_ ); } @@ -309,18 +307,38 @@ Ogre::Vector3 position() const { return pos_; } - Uint8 status( ) const { return status_; } - Uint16 vesselID() const { return vesselID_; } protected: Uint16 nameLength_; std::string name_; Ogre::Vector3 pos_; - Uint8 status_; Uint16 vesselID_; }; +class MessageBodyShipDeRegister : public MessageBodyShipBase { +public: + MessageBodyShipDeRegister( const Uint32 senderID, const Uint8 childID ): MessageBodyShipBase( childID ){ + senderID_ = senderID; + type_ = (Uint8)PROTO_SHIPDEREGISTER; + } + + MessageBodyShipDeRegister( const char * data ) : MessageBodyShipBase( data ){ } + + virtual ~MessageBodyShipDeRegister( ){ } + + void createOutStream() { + MessageBodyShipBase::createOutStream(); + } + + friend std::ostream & operator << ( std::ostream & str, const MessageBodyShipDeRegister & 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, @@ -374,6 +392,14 @@ Uint16 sequenceNr( ) const { return seqNr_; } + friend std::ostream & operator << ( std::ostream & str, const MessageBodyShipMovement & msg ){ + str << "Type: " << (int)( msg.type() ) << " senderID: " << msg.senderID() << std::endl; + str << "pos: " << msg.position() << " vel: " << msg.velocity() << " orient: " << msg.orientation() << std::endl; + str << "thrust: " << msg.thrust() << + " yaw: " << msg.yaw() << " pitch: " << msg.pitch() << " roll: " << msg.roll(); + return str; + } + protected: Ogre::Vector3 pos_; Ogre::Vector3 vel_; Modified: branches/ogsector/src/networkServer.cpp =================================================================== --- branches/ogsector/src/networkServer.cpp 2007-04-30 16:27:17 UTC (rev 424) +++ branches/ogsector/src/networkServer.cpp 2007-04-30 17:59:31 UTC (rev 425) @@ -103,14 +103,14 @@ allUsers_.send( chat ); } -UserObject * Server::createUserObject( UserSession * user, const std::string & name, int userID, int childID ){ +UserObject * Server::createUserObject( UserSession * user, const std::string & name, int userID, int childID, int vesselID ){ UserObject * obj = NULL; long id = createGlobalID( userID, childID ); if ( !userObjects_.count( id ) ){ log_->info( std::string( "Create user object: " ) + name ); - obj = new UserObject( user, name, childID ); + obj = new UserObject( user, name, childID, vesselID ); user->insertChild( obj ); userObjects_[ id ] = obj; } else { @@ -129,67 +129,74 @@ delete obj; } -void Server::receiveShipRegister( UserSession * user, const MessageBodyShipRegister & msg ){ - std::string name = msg.name(); +void Server::receiveShipRegister( UserSession * user, const MessageBodyShipRegister & msgIn ){ + std::string name = msgIn.name(); int userID = user->userID(); - int childID = msg.childID(); - Ogre::Vector3 pos = msg.position(); + int childID = msgIn.childID(); + int vesselID = msgIn.vesselID(); + int senderID = msgIn.senderID(); + Ogre::Vector3 pos = msgIn.position(); - log_->info( std::string( "receiveShipRegister: " ) + name + " " + toStr((int)msg.status()) ); + log_->info( std::string( "receiveShipRegister from " ) + toStr( senderID ) + " " + name + " " + + " " + toStr( vesselID ) ); UserObject *obj; + obj = createUserObject( user, name, userID, childID, vesselID ); - if ( msg.status() == false ){ - if ( ( obj = userObjects_[ createGlobalID( userID, childID ) ] ) != NULL ){ - deRegisterUserObject( obj ); - } else{ - log_->info( std::string( "Deregister request for non existing object " ) + name ); - } - } else { - obj = createUserObject( user, name, userID, childID ); + if ( obj != NULL ){ + obj->setPosition( pos ); - if ( obj != NULL ){ - obj->setPosition( pos ); + if ( obj->status() != Registered ){ + log_->info( std::string( "Register: " ) + obj->name() ); + obj->setStatus( Registered ); - if ( obj->status() != Registered ){ - log_->info( std::string( "Register: " ) + obj->name() ); - obj->setStatus( Registered ); + //** first register all userobjects to the new object; + for ( std::map < long, UserObject * >::iterator it = userObjects_.begin(); it != userObjects_.end(); it ++ ){ - std::map < long, UserObject * >::iterator it; - for ( it = userObjects_.begin(); it != userObjects_.end(); it ++ ){ - - //** atm all is global; - obj->joinRange( it->second ); + //** atm all is global; + obj->joinRange( it->second ); + + //** if the object is no child, register all objects to them; + if ( !obj->isChild() && ( obj->userID() != it->second->userID() ) ){ + log_->info( std::string( "\tSend register: " ) + obj->userName() + " <- " + it->second->name() ); - //** if the object is no child, register all objects to them; - if ( !obj->isChild() && ( obj->userID() != it->second->userID() ) ){ - log_->info( std::string( "\tSend to user: " ) + obj->userName() - + " object: " + it->second->name() ); - - MessageBodyShipRegister msg( it->second->userID(), it->second->childID(), - it->second->name(), it->second->position(), - true, msg.vesselID() ); - obj->parent()->send( msg ); - } - - if ( !it->second->isChild() && ( obj->userID() != it->second->userID() ) ){ - log_->info( std::string( "\tSend to user: " ) + it->second->userName() - + " object: " + obj->name() ); - - MessageBodyShipRegister msg( obj->userID(), obj->childID(), obj->name(), obj->position(), - true, msg.vesselID() ); - it->second->parent()->send( msg ); - } - } - } else { - log_->info( std::string( "object: " ) + name + " already registered. " ); + MessageBodyShipRegister msg( it->second->userID(), it->second->childID(), + it->second->name(), it->second->position(), + it->second->vesselID() ); + obj->parent()->send( msg ); + } } + + //** second register the new object to all existing objects in range; + MessageBodyShipRegister msg( obj->userID(), obj->childID(), obj->name(), obj->position(), obj->vesselID() ); + + // ** atm just global; + for ( std::map < long, UserObject * >::iterator it = userObjects_.begin(); it != userObjects_.end(); it ++ ){ + + if ( !it->second->isChild() && ( obj->parent() != it->second->parent() ) ){ + log_->info( std::string( "\tSend register: " ) + obj->name() + " -> " + it->second->userName() ); + it->second->parent()->send( msg ); + } + } } else { - log_->info( std::string( "Cannot register object: " ) + name ); + log_->warn( std::string( "object: " ) + name + " already registered. " ); } + } else { + log_->fatal( std::string( "Cannot create ... [truncated message content] |
From: <spo...@us...> - 2007-04-30 18:20:51
|
Revision: 426 http://svn.sourceforge.net/opengate/?rev=426&view=rev Author: spom_spom Date: 2007-04-30 11:20:52 -0700 (Mon, 30 Apr 2007) Log Message: ----------- win32 compatibility commit. Modified Paths: -------------- branches/ogsector/src/networkClient.cpp branches/ogsector/win32/ogsectorclient/ogsectorclient.cbp branches/ogsector/win32/ogsectorclient/ogsectorclient.exe branches/ogsector/win32/ogsectorclient/resources.cfg Added Paths: ----------- branches/ogsector/win32/ogsectorclient/ships.xml Removed Paths: ------------- branches/ogsector/win32/ogsectorclient/ogsectorclient.depend branches/ogsector/win32/ogsectorclient/ogsectorclient.layout Modified: branches/ogsector/src/networkClient.cpp =================================================================== --- branches/ogsector/src/networkClient.cpp 2007-04-30 17:59:31 UTC (rev 425) +++ branches/ogsector/src/networkClient.cpp 2007-04-30 18:20:52 UTC (rev 426) @@ -7,22 +7,22 @@ namespace OpenGate{ -NetworkClient::NetworkClient( asio::io_service & io_service, const std::string & hostName ) - : io_service_( io_service ), socket_( io_service ), resolver_( io_service ), +NetworkClient::NetworkClient( asio::io_service & io_service, const std::string & hostName ) + : io_service_( io_service ), socket_( io_service ), resolver_( io_service ), hostname_( hostName ), online_( false ){ - + log_ = LogManager::getSingletonPtr(); pingTime_ = 0; userID_ = 0; log_->info( std::string( "Connecting to " ) + hostname_ + ":" + toStr( 1234 ) ); - + asio::error error = asio::error::host_not_found; try{ tcp::resolver::query query( hostname_, toStr( (int)OG_PORT) ); tcp::resolver::iterator endpoint_iterator = resolver_.resolve( query ); tcp::resolver::iterator end; - + while ( error && endpoint_iterator != end ) { socket_.close(); socket_.connect( *endpoint_iterator++, asio::assign_error( error ) ); @@ -83,9 +83,9 @@ void NetworkClient::handleReceiveUserID( const asio::error & error ) { if ( online_ ){ // std::cout << "handleReceiveUserID " << std::endl; - + if ( !error && readMsg_.decodeHeader() ) { - + MessageBodyBase base( readMsg_.body() ); // std::cout << "Type: = " << (int)base.type() << std::endl; switch( base.type() ){ @@ -97,19 +97,19 @@ default: log_->fatal( std::string( "unknown MESSAGE_PROTO " ) + toStr( base.type() ) ); log_->fatal( "wait for userid " ); - asio::async_read( socket_, asio::buffer( readMsg_.data(), + asio::async_read( socket_, asio::buffer( readMsg_.data(), Message::HeaderLength+MessageBodyUserID( 0 ).dataSize() ), - boost::bind( & NetworkClient::handleReceiveUserID, this, + boost::bind( & NetworkClient::handleReceiveUserID, this, asio::placeholders::error ) ); - + } - + asio::async_read(socket_, asio::buffer( readMsg_.data(), Message::HeaderLength ), - boost::bind( & NetworkClient::handleReadMessageHeader, this, + boost::bind( & NetworkClient::handleReadMessageHeader, this, asio::placeholders::error ) ); } else { log_->fatal( std::string( "handleReceiveUserID: " ) + error.what() ); - } + } } } @@ -117,9 +117,9 @@ if ( online_ ){ if ( !error && readMsg_.decodeHeader() ) { // std::cout << "handle_read_header " << (int)readMsg_.bodyLength() << std::endl; - + asio::async_read( socket_, asio::buffer( readMsg_.body(), readMsg_.bodyLength() ), - boost::bind( &NetworkClient::handleReadMessageBody, this, + boost::bind( &NetworkClient::handleReadMessageBody, this, asio::placeholders::error ) ); } else { log_->fatal( std::string( "handleReadMessageHeader: " ) + error.what() ); @@ -154,7 +154,7 @@ } break; case PROTO_DISCONNECT: { MessageBodyDisconnect msg( readMsg_.body() ); - log_->info( std::string( "Disconnect user = " ) + toStr( (int)msg.userID() ) + " " + log_->info( std::string( "Disconnect user = " ) + toStr( (int)msg.userID() ) + " " + userName( (int)msg.userID() ) ); users_.erase( users_.find( (int)msg.userID() ) ) ; } break; @@ -164,14 +164,14 @@ // std::cout << m << std::endl; // } - std::vector < char > vec( readMsg_.bodyLength() ); - vec.resize( readMsg_.bodyLength() ); + std::vector < char > vec( readMsg_.bodyLength() ); + vec.resize( readMsg_.bodyLength() ); memcpy( &vec[ 0 ], (char*)readMsg_.body(), readMsg_.bodyLength() ); msgsToPull_.push_back( vec ); } - + asio::async_read(socket_, asio::buffer( readMsg_.data(), Message::HeaderLength ), - boost::bind( & NetworkClient::handleReadMessageHeader, this, + boost::bind( & NetworkClient::handleReadMessageHeader, this, asio::placeholders::error ) ); } else { log_->fatal( std::string( "handleReadMessageBody error: " ) + error.what() ); @@ -183,25 +183,25 @@ void NetworkClient::handleSendMsg( MessageBodyBase & body ) { if ( online_ ){ // std::cout << "Send to server, type: " << (int)body.type() << std::endl; - + bool write_in_progress = !msgsToWrite_.empty(); msgsToWrite_.push_back( Message( body ) ); // std::cout << "send.length() = " << msgsToWrite_.front().length() << std::endl; if ( !write_in_progress && online_ ) { asio::async_write( socket_, asio::buffer( msgsToWrite_.front().data(), msgsToWrite_.front().length() ), - boost::bind( & NetworkClient::handleWrite, this, + boost::bind( & NetworkClient::handleWrite, this, asio::placeholders::error ) ); } } } - + void NetworkClient::handleWrite( const asio::error & error ) { if ( online_ ){ if ( !error ){ msgsToWrite_.pop_front(); if ( !msgsToWrite_.empty() && online_ ) { asio::async_write(socket_, asio::buffer( msgsToWrite_.front().data(), msgsToWrite_.front().length() ), - boost::bind( &NetworkClient::handleWrite, this, + boost::bind( &NetworkClient::handleWrite, this, asio::placeholders::error ) ); } } else { @@ -210,15 +210,15 @@ } } } - -void NetworkClient::doClose() { + +void NetworkClient::doClose() { if ( online_ ){ - sleep( 1 ); + //myMSleep( 1000 ); // log_->info( std::string( "Network closed, user disconnected." ) ); - socket_.close(); + socket_.close(); pingTime_ = -1; online_ = false; } } - + } //namespace OpenGate Modified: branches/ogsector/win32/ogsectorclient/ogsectorclient.cbp =================================================================== --- branches/ogsector/win32/ogsectorclient/ogsectorclient.cbp 2007-04-30 17:59:31 UTC (rev 425) +++ branches/ogsector/win32/ogsectorclient/ogsectorclient.cbp 2007-04-30 18:20:52 UTC (rev 426) @@ -63,6 +63,8 @@ <Unit filename="..\..\src\SectorClientFrameListener.h" /> <Unit filename="..\..\src\SectorObjects.cpp" /> <Unit filename="..\..\src\SectorObjects.h" /> + <Unit filename="..\..\src\VesselManager.cpp" /> + <Unit filename="..\..\src\VesselManager.h" /> <Unit filename="..\..\src\common.cpp" /> <Unit filename="..\..\src\common.h" /> <Unit filename="..\..\src\networkClient.cpp" /> @@ -71,6 +73,10 @@ <Unit filename="..\..\src\ogconsole.cpp" /> <Unit filename="..\..\src\ogconsole.h" /> <Unit filename="..\..\src\ogsectorclient.cpp" /> + <Unit filename="..\..\src\tinyxml\tinyxml.cpp" /> + <Unit filename="..\..\src\tinyxml\tinyxml.h" /> + <Unit filename="..\..\src\tinyxml\tinyxmlerror.cpp" /> + <Unit filename="..\..\src\tinyxml\tinyxmlparser.cpp" /> <Extensions> <code_completion /> </Extensions> Deleted: branches/ogsector/win32/ogsectorclient/ogsectorclient.depend =================================================================== --- branches/ogsector/win32/ogsectorclient/ogsectorclient.depend 2007-04-30 17:59:31 UTC (rev 425) +++ branches/ogsector/win32/ogsectorclient/ogsectorclient.depend 2007-04-30 18:20:52 UTC (rev 426) @@ -1,1538 +0,0 @@ -# depslib dependency file v1.0 -1175879798 source:c:\home\src\opengate\branches\ogsector\src\sector.cpp - "Sector.h" - -1175778098 c:\home\src\opengate\branches\ogsector\src\sector.h - <Ogre.h> - <OgreOpcode.h> - "SectorClientFrameListener.h" - "SectorObjects.h" - -1165510934 c:\ogresdk\include\ogre.h - "OgrePrerequisites.h" - "OgreAnimation.h" - "OgreAnimationState.h" - "OgreAnimationTrack.h" - "OgreAny.h" - "OgreArchive.h" - "OgreArchiveManager.h" - "OgreAxisAlignedBox.h" - "OgreBillboardChain.h" - "OgreBillboardSet.h" - "OgreBone.h" - "OgreCamera.h" - "OgreConfigFile.h" - "OgreControllerManager.h" - "OgreDataStream.h" - "OgreEntity.h" - "OgreException.h" - "OgreFrustum.h" - "OgreGpuProgram.h" - "OgreGpuProgramManager.h" - "OgreHardwareBufferManager.h" - "OgreHardwareIndexBuffer.h" - "OgreHardwarePixelBuffer.h" - "OgreHardwareOcclusionQuery.h" - "OgreHardwareVertexBuffer.h" - "OgreHardwarePixelBuffer.h" - "OgreHighLevelGpuProgram.h" - "OgreHighLevelGpuProgramManager.h" - "OgreKeyFrame.h" - "OgreLight.h" - "OgreLogManager.h" - "OgreManualObject.h" - "OgreMaterial.h" - "OgreMaterialManager.h" - "OgreMaterialSerializer.h" - "OgreMath.h" - "OgreMatrix3.h" - "OgreMatrix4.h" - "OgreMesh.h" - "OgreMeshManager.h" - "OgreMeshSerializer.h" - "OgreOverlay.h" - "OgreOverlayContainer.h" - "OgreOverlayElement.h" - "OgreOverlayManager.h" - "OgreParticleAffector.h" - "OgreParticleEmitter.h" - "OgreParticleSystemManager.h" - "OgrePass.h" - "OgrePatchMesh.h" - "OgrePatchSurface.h" - "OgreProfiler.h" - "OgreRadixSort.h" - "OgreRenderQueueInvocation.h" - "OgreRenderQueueListener.h" - "OgreRenderSystem.h" - "OgreRenderTargetListener.h" - "OgreRenderTexture.h" - "OgreRenderWindow.h" - "OgreResourceBackgroundQueue.h" - "OgreResourceGroupManager.h" - "OgreRibbonTrail.h" - "OgreRoot.h" - "OgreSceneManager.h" - "OgreSceneManagerEnumerator.h" - "OgreSceneNode.h" - "OgreSimpleRenderable.h" - "OgreSkeleton.h" - "OgreSkeletonInstance.h" - "OgreSkeletonManager.h" - "OgreSkeletonSerializer.h" - "OgreStaticGeometry.h" - "OgreString.h" - "OgreStringConverter.h" - "OgreStringVector.h" - "OgreSubEntity.h" - "OgreSubMesh.h" - "OgreTechnique.h" - "OgreTextureManager.h" - "OgreTextureUnitState.h" - "OgreUserDefinedObject.h" - "OgreVector2.h" - "OgreViewport.h" - "OgreCompositor.h" - "OgreCompositorManager.h" - "OgreCompositorChain.h" - "OgreCompositorInstance.h" - "OgreCompositionTechnique.h" - "OgreCompositionPass.h" - "OgreCompositionTargetPass.h" - "OgreWindowEventUtilities.h" - "OgreShadowCameraSetup.h" - "OgreShadowCameraSetupFocused.h" - "OgreShadowCameraSetupLiSPSM.h" - "OgreShadowCameraSetupPlaneOptimal.h" - -1172953494 c:\ogresdk\include\ogreprerequisites.h - "OgrePlatform.h" - "OgreMemoryManager.h" - -1172537114 c:\ogresdk\include\ogreplatform.h - "OgreConfig.h" - <_mingw.h> - "config.h" - -1172941426 c:\ogresdk\include\ogreconfig.h - "config.h" - -1156321112 c:\ogresdk\include\ogrememorymanager.h - "OgrePlatform.h" - "OgreStdHeaders.h" - "OgreMemoryMacros.h" - -1172524826 c:\ogresdk\include\ogrestdheaders.h - <cassert> - <cstdio> - <cstdlib> - <ctime> - <cstring> - <cstdarg> - <cmath> - <vector> - <map> - <string> - <set> - <list> - <deque> - <queue> - <bitset> - <ext/hash_map> - <ext/hash_set> - <hash_set> - <hash_map> - <algorithm> - <functional> - <limits> - <fstream> - <iostream> - <iomanip> - <sstream> - <sys/types.h> - <sys/stat.h> - <unistd.h> - <unistd.h> - <dlfcn.h> - <unistd.h> - <sys/param.h> - <CoreFoundation/CoreFoundation.h> - <boost/thread/recursive_mutex.hpp> - -1156321112 c:\ogresdk\include\ogrememorymacros.h - -1171960516 c:\ogresdk\include\ogreanimation.h - "OgrePrerequisites.h" - "OgreString.h" - "OgreIteratorWrappers.h" - "OgreAnimable.h" - "OgreAnimationTrack.h" - -1156321116 c:\ogresdk\include\ogrestring.h - "OgrePrerequisites.h" - <ext/hash_map> - -1158007782 c:\ogresdk\include\ogreiteratorwrappers.h - "OgrePrerequisites.h" - -1166587762 c:\ogresdk\include\ogreanimable.h - "OgrePrerequisites.h" - "OgreVector2.h" - "OgreVector3.h" - "OgreVector4.h" - "OgreQuaternion.h" - "OgreColourValue.h" - "OgreSharedPtr.h" - "OgreStringVector.h" - "OgreException.h" - "OgreAny.h" - -1166587762 c:\ogresdk\include\ogrevector2.h - "OgrePrerequisites.h" - "OgreMath.h" - -1168638894 c:\ogresdk\include\ogremath.h - "OgrePrerequisites.h" - -1171161004 c:\ogresdk\include\ogrevector3.h - "OgrePrerequisites.h" - "OgreMath.h" - "OgreQuaternion.h" - -1166587762 c:\ogresdk\include\ogrequaternion.h - "OgrePrerequisites.h" - "OgreMath.h" - -1166587764 c:\ogresdk\include\ogrevector4.h - "OgrePrerequisites.h" - "OgreVector3.h" - -1171161004 c:\ogresdk\include\ogrecolourvalue.h - "OgrePrerequisites.h" - -1168440044 c:\ogresdk\include\ogresharedptr.h - "OgrePrerequisites.h" - -1156321116 c:\ogresdk\include\ogrestringvector.h - "OgrePrerequisites.h" - "OgreString.h" - "OgreSharedPtr.h" - -1169876010 c:\ogresdk\include\ogreexception.h - "OgrePrerequisites.h" - "OgreString.h" - <exception> - -1156321112 c:\ogresdk\include\ogreany.h - "OgrePrerequisites.h" - "OgreException.h" - "OgreString.h" - <algorithm> - <typeinfo> - -1166587762 c:\ogresdk\include\ogreanimationtrack.h - "OgrePrerequisites.h" - "OgreSimpleSpline.h" - "OgreRotationalSpline.h" - "OgreKeyFrame.h" - "OgreAnimable.h" - "OgrePose.h" - -1156321116 c:\ogresdk\include\ogresimplespline.h - "OgrePrerequisites.h" - "OgreVector3.h" - "OgreMatrix4.h" - -1172506520 c:\ogresdk\include\ogrematrix4.h - "OgrePrerequisites.h" - "OgreVector3.h" - "OgreMatrix3.h" - "OgreVector4.h" - "OgrePlane.h" - -1156321112 c:\ogresdk\include\ogrematrix3.h - "OgrePrerequisites.h" - "OgreVector3.h" - -1171161004 c:\ogresdk\include\ogreplane.h - "OgrePrerequisites.h" - "OgreVector3.h" - -1156321116 c:\ogresdk\include\ogrerotationalspline.h - "OgrePrerequisites.h" - "OgreQuaternion.h" - -1158532582 c:\ogresdk\include\ogrekeyframe.h - "OgrePrerequisites.h" - "OgreVector3.h" - "OgreQuaternion.h" - "OgreAny.h" - "OgreHardwareVertexBuffer.h" - "OgreIteratorWrappers.h" - -1171161004 c:\ogresdk\include\ogrehardwarevertexbuffer.h - "OgrePrerequisites.h" - "OgreHardwareBuffer.h" - "OgreSharedPtr.h" - "OgreColourValue.h" - -1156321112 c:\ogresdk\include\ogrehardwarebuffer.h - "OgrePrerequisites.h" - -1173005240 c:\ogresdk\include\ogrepose.h - "OgrePrerequisites.h" - "OgreString.h" - "OgreHardwareVertexBuffer.h" - "OgreVector3.h" - "OgreIteratorWrappers.h" - -1171161002 c:\ogresdk\include\ogreanimationstate.h - "OgrePrerequisites.h" - "OgreString.h" - "OgreController.h" - "OgreIteratorWrappers.h" - -1156321112 c:\ogresdk\include\ogrecontroller.h - "OgrePrerequisites.h" - "OgreSharedPtr.h" - -1168440042 c:\ogresdk\include\ogrearchive.h - "OgrePrerequisites.h" - "OgreString.h" - "OgreDataStream.h" - "OgreSharedPtr.h" - "OgreStringVector.h" - -1156321112 c:\ogresdk\include\ogredatastream.h - "OgrePrerequisites.h" - "OgreString.h" - "OgreSharedPtr.h" - <istream> - -1156321112 c:\ogresdk\include\ogrearchivemanager.h - "OgrePrerequisites.h" - "OgreResourceManager.h" - "OgreSingleton.h" - -1172769892 c:\ogresdk\include\ogreresourcemanager.h - "OgrePrerequisites.h" - "OgreResource.h" - "OgreResourceGroupManager.h" - "OgreIteratorWrappers.h" - "OgreCommon.h" - "OgreDataStream.h" - "OgreStringVector.h" - "OgreScriptLoader.h" - -1172615020 c:\ogresdk\include\ogreresource.h - "OgrePrerequisites.h" - "OgreString.h" - "OgreSharedPtr.h" - "OgreStringInterface.h" - -1156321116 c:\ogresdk\include\ogrestringinterface.h - "OgrePrerequisites.h" - "OgreString.h" - "OgreCommon.h" - -1172524824 c:\ogresdk\include\ogrecommon.h - "OgreString.h" - <utility> - <vector> - <map> - -1168440044 c:\ogresdk\include\ogreresourcegroupmanager.h - "OgrePrerequisites.h" - "OgreSingleton.h" - "OgreCommon.h" - "OgreDataStream.h" - "OgreResource.h" - "OgreArchive.h" - "OgreIteratorWrappers.h" - -1156321116 c:\ogresdk\include\ogresingleton.h - "OgrePrerequisites.h" - -1156321116 c:\ogresdk\include\ogrescriptloader.h - "OgrePrerequisites.h" - "OgreDataStream.h" - "OgreStringVector.h" - -1172848582 c:\ogresdk\include\ogreaxisalignedbox.h - "OgrePrerequisites.h" - "OgreVector3.h" - "OgreMatrix4.h" - -1156321112 c:\ogresdk\include\ogrebillboardchain.h - "OgrePrerequisites.h" - "OgreMovableObject.h" - "OgreRenderable.h" - -1169876010 c:\ogresdk\include\ogremovableobject.h - "OgrePrerequisites.h" - "OgreRenderQueue.h" - "OgreAxisAlignedBox.h" - "OgreSphere.h" - "OgreShadowCaster.h" - "OgreFactoryObj.h" - "OgreAnimable.h" - "OgreAny.h" - "OgreUserDefinedObject.h" - -1156321114 c:\ogresdk\include\ogrerenderqueue.h - "OgrePrerequisites.h" - "OgreIteratorWrappers.h" - -1156321116 c:\ogresdk\include\ogresphere.h - "OgrePrerequisites.h" - "OgreVector3.h" - -1169876012 c:\ogresdk\include\ogreshadowcaster.h - "OgrePrerequisites.h" - "OgreRenderable.h" - -1172769892 c:\ogresdk\include\ogrerenderable.h - "OgrePrerequisites.h" - "OgreCommon.h" - "OgreRenderOperation.h" - "OgreMatrix4.h" - "OgreMaterial.h" - "OgrePlane.h" - "OgreGpuProgram.h" - "OgreVector4.h" - "OgreException.h" - -1156321114 c:\ogresdk\include\ogrerenderoperation.h - "OgrePrerequisites.h" - "OgreVertexIndexData.h" - -1171161004 c:\ogresdk\include\ogrevertexindexdata.h - "OgrePrerequisites.h" - "OgreHardwareVertexBuffer.h" - "OgreHardwareIndexBuffer.h" - -1156321112 c:\ogresdk\include\ogrehardwareindexbuffer.h - "OgrePrerequisites.h" - "OgreHardwareBuffer.h" - "OgreSharedPtr.h" - -1168797388 c:\ogresdk\include\ogrematerial.h - "OgrePrerequisites.h" - "OgreResource.h" - "OgreIteratorWrappers.h" - "OgreCommon.h" - "OgreColourValue.h" - "OgreBlendMode.h" - -1156321112 c:\ogresdk\include\ogreblendmode.h - "OgrePrerequisites.h" - "OgreColourValue.h" - -1172848582 c:\ogresdk\include\ogregpuprogram.h - "OgrePrerequisites.h" - "OgreResource.h" - "OgreSharedPtr.h" - "OgreIteratorWrappers.h" - -1156321112 c:\ogresdk\include\ogrefactoryobj.h - "OgrePrerequisites.h" - -1156321116 c:\ogresdk\include\ogreuserdefinedobject.h - "OgrePrerequisites.h" - -1166587762 c:\ogresdk\include\ogrebillboardset.h - "OgrePrerequisites.h" - "OgreMovableObject.h" - "OgreRenderable.h" - "OgreRadixSort.h" - "OgreCommon.h" - -1156321114 c:\ogresdk\include\ogreradixsort.h - "OgrePrerequisites.h" - -1156321112 c:\ogresdk\include\ogrebone.h - "OgrePrerequisites.h" - "OgreNode.h" - -1166587762 c:\ogresdk\include\ogrenode.h - "OgrePrerequisites.h" - "OgreMatrix3.h" - "OgreMatrix4.h" - "OgreQuaternion.h" - "OgreString.h" - "OgreRenderable.h" - "OgreIteratorWrappers.h" - -1172506520 c:\ogresdk\include\ogrecamera.h - "OgrePrerequisites.h" - "OgreString.h" - "OgreMovableObject.h" - "OgreMatrix4.h" - "OgreVector3.h" - "OgrePlane.h" - "OgreQuaternion.h" - "OgreCommon.h" - "OgreFrustum.h" - "OgreRay.h" - -1165678642 c:\ogresdk\include\ogrefrustum.h - "OgrePrerequisites.h" - "OgreMovableObject.h" - "OgreRenderable.h" - "OgreAxisAlignedBox.h" - "OgreVertexIndexData.h" - "OgreMovablePlane.h" - -1166587762 c:\ogresdk\include\ogremovableplane.h - "OgrePrerequisites.h" - "OgrePlane.h" - "OgreMovableObject.h" - -1156321114 c:\ogresdk\include\ogreray.h - "OgrePrerequisites.h" - "OgreVector3.h" - "OgrePlaneBoundedVolume.h" - -1171161004 c:\ogresdk\include\ogreplaneboundedvolume.h - "OgrePrerequisites.h" - "OgreAxisAlignedBox.h" - "OgreSphere.h" - "OgreMath.h" - "OgrePlane.h" - -1156321112 c:\ogresdk\include\ogreconfigfile.h - "OgrePrerequisites.h" - "OgreString.h" - "OgreStringVector.h" - "OgreIteratorWrappers.h" - "OgreDataStream.h" - -1156321112 c:\ogresdk\include\ogrecontrollermanager.h - "OgrePrerequisites.h" - "OgreCommon.h" - "OgreSingleton.h" - "OgreController.h" - "OgrePredefinedControllers.h" - "OgreTextureUnitState.h" - "OgreSharedPtr.h" - -1156321114 c:\ogresdk\include\ogrepredefinedcontrollers.h - "OgrePrerequisites.h" - "OgreCommon.h" - "OgreController.h" - "OgreFrameListener.h" - "OgreGpuProgram.h" - -1156321112 c:\ogresdk\include\ogreframelistener.h - "OgrePrerequisites.h" - -1171960516 c:\ogresdk\include\ogretextureunitstate.h - "OgrePrerequisites.h" - "OgreCommon.h" - "OgreBlendMode.h" - "OgreMatrix4.h" - "OgreIteratorWrappers.h" - "OgreString.h" - "OgreTexture.h" - -1166587762 c:\ogresdk\include\ogretexture.h - "OgrePrerequisites.h" - "OgreHardwareBuffer.h" - "OgreResource.h" - "OgreImage.h" - -1157064472 c:\ogresdk\include\ogreimage.h - "OgrePrerequisites.h" - "OgreCommon.h" - "OgrePixelFormat.h" - "OgreDataStream.h" - -1171960516 c:\ogresdk\include\ogrepixelformat.h - "OgrePrerequisites.h" - "OgreCommon.h" - -1172687706 c:\ogresdk\include\ogreentity.h - "OgrePrerequisites.h" - "OgreCommon.h" - "OgreString.h" - "OgreMovableObject.h" - "OgreQuaternion.h" - "OgreVector3.h" - "OgreHardwareBufferManager.h" - "OgreMesh.h" - -1159139400 c:\ogresdk\include\ogrehardwarebuffermanager.h - "OgrePrerequisites.h" - "OgreSingleton.h" - "OgreHardwareVertexBuffer.h" - "OgreHardwareIndexBuffer.h" - -1159031360 c:\ogresdk\include\ogremesh.h - "OgrePrerequisites.h" - "OgreResource.h" - "OgreVertexIndexData.h" - "OgreAxisAlignedBox.h" - "OgreVertexBoneAssignment.h" - "OgreIteratorWrappers.h" - "OgreProgressiveMesh.h" - "OgreHardwareVertexBuffer.h" - "OgreSkeleton.h" - "OgreAnimationTrack.h" - "OgrePose.h" - -1156321116 c:\ogresdk\include\ogrevertexboneassignment.h - "OgrePrerequisites.h" - -1156321114 c:\ogresdk\include\ogreprogressivemesh.h - "OgrePrerequisites.h" - "OgreVector3.h" - "OgreHardwareVertexBuffer.h" - "OgreHardwareIndexBuffer.h" - "OgreRenderOperation.h" - -1163781926 c:\ogresdk\include\ogreskeleton.h - "OgrePrerequisites.h" - "OgreResource.h" - "OgreQuaternion.h" - "OgreVector3.h" - "OgreIteratorWrappers.h" - "OgreStringVector.h" - -1160325242 c:\ogresdk\include\ogregpuprogrammanager.h - "OgrePrerequisites.h" - "OgreResourceManager.h" - "OgreException.h" - "OgreGpuProgram.h" - "OgreSingleton.h" - -1156321112 c:\ogresdk\include\ogrehardwarepixelbuffer.h - "OgrePrerequisites.h" - "OgreHardwareBuffer.h" - "OgreSharedPtr.h" - "OgrePixelFormat.h" - "OgreImage.h" - -1164560838 c:\ogresdk\include\ogrehardwareocclusionquery.h - "OgrePrerequisites.h" - -1168638894 c:\ogresdk\include\ogrehighlevelgpuprogram.h - "OgrePrerequisites.h" - "OgreGpuProgram.h" - -1168440042 c:\ogresdk\include\ogrehighlevelgpuprogrammanager.h - "OgrePrerequisites.h" - "OgreResourceManager.h" - "OgreSingleton.h" - "OgreException.h" - "OgreHighLevelGpuProgram.h" - -1165529990 c:\ogresdk\include\ogrelight.h - "OgrePrerequisites.h" - "OgreColourValue.h" - "OgreVector3.h" - "OgreVector4.h" - "OgreString.h" - "OgreMovableObject.h" - "OgrePlaneBoundedVolume.h" - "OgreShadowCameraSetup.h" - -1165529990 c:\ogresdk\include\ogreshadowcamerasetup.h - "OgrePrerequisites.h" - "OgreMovablePlane.h" - "OgreSharedPtr.h" - -1163446424 c:\ogresdk\include\ogrelogmanager.h - "OgrePrerequisites.h" - "OgreLog.h" - "OgreSingleton.h" - "OgreString.h" - -1163446424 c:\ogresdk\include\ogrelog.h - "OgrePrerequisites.h" - -1171960516 c:\ogresdk\include\ogremanualobject.h - "OgrePrerequisites.h" - "OgreMovableObject.h" - "OgreRenderable.h" - "OgreResourceGroupManager.h" - -1161122428 c:\ogresdk\include\ogrematerialmanager.h - "OgrePrerequisites.h" - "OgreSingleton.h" - "OgreResourceManager.h" - "OgreMaterial.h" - "OgreStringVector.h" - "OgreMaterialSerializer.h" - "OgreNoMemoryMacros.h" - <boost/thread/tss.hpp> - "OgreMemoryMacros.h" - -1168638894 c:\ogresdk\include\ogrematerialserializer.h - "OgrePrerequisites.h" - "OgreMaterial.h" - "OgreBlendMode.h" - "OgreTextureUnitState.h" - "OgreGpuProgram.h" - "OgreStringVector.h" - -1156321112 c:\ogresdk\include\ogrenomemorymacros.h - -1168440042 c:\ogresdk\include\ogremeshmanager.h - "OgrePrerequisites.h" - "OgreResourceManager.h" - "OgreSingleton.h" - "OgreVector3.h" - "OgreHardwareBuffer.h" - "OgreMesh.h" - "OgrePatchMesh.h" - -1159139400 c:\ogresdk\include\ogrepatchmesh.h - "OgrePrerequisites.h" - "OgreMesh.h" - "OgrePatchSurface.h" - -1156321114 c:\ogresdk\include\ogrepatchsurface.h - "OgrePrerequisites.h" - "OgreVector3.h" - "OgreString.h" - "OgreRenderOperation.h" - "OgreAxisAlignedBox.h" - -1156321112 c:\ogresdk\include\ogremeshserializer.h - "OgrePrerequisites.h" - "OgreMeshSerializerImpl.h" - "OgreSerializer.h" - -1168440044 c:\ogresdk\include\ogremeshserializerimpl.h - "OgrePrerequisites.h" - "OgreString.h" - "OgreSerializer.h" - "OgreMaterial.h" - "OgreMesh.h" - "OgreEdgeListBuilder.h" - -1166587762 c:\ogresdk\include\ogreserializer.h - "OgrePrerequisites.h" - "OgreString.h" - "OgreDataStream.h" - -1156321112 c:\ogresdk\include\ogreedgelistbuilder.h - "OgrePrerequisites.h" - "OgreVector4.h" - "OgreHardwareVertexBuffer.h" - "OgreRenderOperation.h" - "OgreAlignedAllocator.h" - -1158965048 c:\ogresdk\include\ogrealignedallocator.h - "OgrePrerequisites.h" - -1156321112 c:\ogresdk\include\ogreoverlay.h - "OgrePrerequisites.h" - "OgreSceneNode.h" - "OgreIteratorWrappers.h" - "OgreMatrix4.h" - -1166893324 c:\ogresdk\include\ogrescenenode.h - "OgrePrerequisites.h" - "OgreNode.h" - "OgreIteratorWrappers.h" - "OgreAxisAlignedBox.h" - -1156321112 c:\ogresdk\include\ogreoverlaycontainer.h - "OgrePrerequisites.h" - "OgreOverlayElement.h" - "OgreIteratorWrappers.h" - -1172506520 c:\ogresdk\include\ogreoverlayelement.h - "OgrePrerequisites.h" - "OgreString.h" - "OgreRenderable.h" - "OgreUTFString.h" - "OgreStringInterface.h" - "OgreOverlayElementCommands.h" - "OgreColourValue.h" - "OgreRectangle.h" - -1172506520 c:\ogresdk\include\ogreutfstring.h - "OgrePrerequisites.h" - <iterator> - <string> - <stdexcept> - -1156321112 c:\ogresdk\include\ogreoverlayelementcommands.h - "OgrePrerequisites.h" - "OgreStringInterface.h" - -1164560840 c:\ogresdk\include\ogrerectangle.h - "OgrePrerequisites.h" - -1156321114 c:\ogresdk\include\ogreoverlaymanager.h - "OgrePrerequisites.h" - "OgreSingleton.h" - "OgreStringVector.h" - "OgreOverlay.h" - "OgreScriptLoader.h" - -1156321114 c:\ogresdk\include\ogreparticleaffector.h - "OgrePrerequisites.h" - "OgreString.h" - "OgreStringInterface.h" - -1160867994 c:\ogresdk\include\ogreparticleemitter.h - "OgrePrerequisites.h" - "OgreString.h" - "OgreVector3.h" - "OgreColourValue.h" - "OgreStringInterface.h" - "OgreParticleEmitterCommands.h" - "OgreParticle.h" - -1159468430 c:\ogresdk\include\ogreparticleemittercommands.h - "OgrePrerequisites.h" - "OgreStringInterface.h" - -1160867994 c:\ogresdk\include\ogreparticle.h - "OgrePrerequisites.h" - "OgreBillboard.h" - -1156321112 c:\ogresdk\include\ogrebillboard.h - "OgrePrerequisites.h" - "OgreVector3.h" - "OgreColourValue.h" - "OgreCommon.h" - -1168440044 c:\ogresdk\include\ogreparticlesystemmanager.h - "OgrePrerequisites.h" - "OgreParticleSystem.h" - "OgreFrameListener.h" - "OgreSingleton.h" - "OgreIteratorWrappers.h" - "OgreScriptLoader.h" - "OgreResourceGroupManager.h" - -1159468430 c:\ogresdk\include\ogreparticlesystem.h - "OgrePrerequisites.h" - "OgreVector3.h" - "OgreString.h" - "OgreParticleIterator.h" - "OgreStringInterface.h" - "OgreMovableObject.h" - "OgreRadixSort.h" - "OgreController.h" - -1156321114 c:\ogresdk\include\ogreparticleiterator.h - "OgrePrerequisites.h" - -1171960516 c:\ogresdk\include\ogrepass.h - "OgrePrerequisites.h" - "OgreGpuProgram.h" - "OgreColourValue.h" - "OgreBlendMode.h" - "OgreCommon.h" - "OgreLight.h" - "OgreTextureUnitState.h" - -1156321114 c:\ogresdk\include\ogreprofiler.h - "OgrePrerequisites.h" - "OgreSingleton.h" - "OgreString.h" - "OgreOverlay.h" - -1173005240 c:\ogresdk\include\ogrerenderqueueinvocation.h - "OgrePrerequisites.h" - "OgreRenderQueueSortingGrouping.h" - "OgreIteratorWrappers.h" - -1156321114 c:\ogresdk\include\ogrerenderqueuesortinggrouping.h - "OgrePrerequisites.h" - "OgreIteratorWrappers.h" - "OgreMaterial.h" - "OgreTechnique.h" - "OgrePass.h" - "OgreRadixSort.h" - -1168797388 c:\ogresdk\include\ogretechnique.h - "OgrePrerequisites.h" - "OgreIteratorWrappers.h" - "OgreBlendMode.h" - "OgreCommon.h" - "OgrePass.h" - -1156321114 c:\ogresdk\include\ogrerenderqueuelistener.h - "OgrePrerequisites.h" - "OgreRenderQueue.h" - -1172615020 c:\ogresdk\include\ogrerendersystem.h - "OgrePrerequisites.h" - "OgreString.h" - "OgreTextureUnitState.h" - "OgreCommon.h" - "OgreRenderOperation.h" - "OgreRenderSystemCapabilities.h" - "OgreRenderTarget.h" - "OgreRenderTexture.h" - "OgreFrameListener.h" - "OgreConfigOptionMap.h" - "OgreGpuProgram.h" - "OgrePlane.h" - "OgreIteratorWrappers.h" - -1163353544 c:\ogresdk\include\ogrerendersystemcapabilities.h - "OgrePrerequisites.h" - "OgreString.h" - -1172506520 c:\ogresdk\include\ogrerendertarget.h - "OgrePrerequisites.h" - "OgreString.h" - "OgreTextureManager.h" - "OgreViewport.h" - "OgreTimer.h" - -1171960516 c:\ogresdk\include\ogretexturemanager.h - "OgrePrerequisites.h" - "OgreResourceManager.h" - "OgreTexture.h" - "OgreSingleton.h" - -1172506520 c:\ogresdk\include\ogreviewport.h - "OgrePrerequisites.h" - "OgreCommon.h" - "OgreColourValue.h" - -1164282732 c:\ogresdk\include\ogretimer.h - "OgrePrerequisites.h" - "OgrePlatform.h" - "WIN32/OgreTimerImp.h" - "GLX/OgreTimerImp.h" - "OSX/OgreTimerImp.h" - -1160336896 c:\ogresdk\include\win32\ogretimerimp.h - "windows.h" - -1156321114 c:\ogresdk\include\ogrerendertexture.h - "OgrePrerequisites.h" - "OgreRenderTarget.h" - -1156321112 c:\ogresdk\include\ogreconfigoptionmap.h - "OgrePrerequisites.h" - "OgreStringVector.h" - "OgreString.h" - -1156321114 c:\ogresdk\include\ogrerendertargetlistener.h - "OgrePrerequisites.h" - -1155988494 c:\ogresdk\include\ogrerenderwindow.h - "OgrePrerequisites.h" - "OgreRenderTarget.h" - -1172615020 c:\ogresdk\include\ogreresourcebackgroundqueue.h - "OgrePrerequisites.h" - "OgreCommon.h" - "OgreSingleton.h" - "OgreResource.h" - <boost/thread/thread.hpp> - <boost/thread/condition.hpp> - -1160238392 c:\ogresdk\include\ogreribbontrail.h - "OgrePrerequisites.h" - "OgreBillboardChain.h" - "OgreNode.h" - "OgreIteratorWrappers.h" - "OgreFrameListener.h" - "OgreControllerManager.h" - -1169876012 c:\ogresdk\include\ogreroot.h - "OgrePrerequisites.h" - "OgreSingleton.h" - "OgreString.h" - "OgreSceneManagerEnumerator.h" - "OgreResourceGroupManager.h" - <exception> - -1156321116 c:\ogresdk\include\ogrescenemanagerenumerator.h - "OgrePrerequisites.h" - "OgreSceneManager.h" - "OgreSingleton.h" - "OgreIteratorWrappers.h" - -1172953494 c:\ogresdk\include\ogrescenemanager.h - "OgrePrerequisites.h" - "OgreString.h" - "OgreSceneNode.h" - "OgrePlane.h" - "OgreQuaternion.h" - "OgreColourValue.h" - "OgreCommon.h" - "OgreSceneQuery.h" - "OgreAutoParamDataSource.h" - "OgreAnimationState.h" - "OgreRenderQueue.h" - "OgreRenderQueueSortingGrouping.h" - "OgreRectangle2D.h" - "OgrePixelFormat.h" - "OgreResourceGroupManager.h" - "OgreTexture.h" - "OgreShadowCameraSetup.h" - "OgreShadowTextureManager.h" - "OgreCamera.h" - "OgreInstancedGeometry.h" - -1156321116 c:\ogresdk\include\ogrescenequery.h - "OgrePrerequisites.h" - "OgreAxisAlignedBox.h" - "OgreSphere.h" - "OgreRay.h" - "OgreRenderOperation.h" - "OgrePlaneBoundedVolume.h" - -1171161004 c:\ogresdk\include\ogreautoparamdatasource.h - "OgrePrerequisites.h" - "OgreCommon.h" - "OgreMatrix4.h" - "OgreVector4.h" - "OgreLight.h" - "OgreColourValue.h" - -1156321114 c:\ogresdk\include\ogrerectangle2d.h - "OgrePrerequisites.h" - "OgreSimpleRenderable.h" - -1156321116 c:\ogresdk\include\ogresimplerenderable.h - "OgrePrerequisites.h" - "OgreMovableObject.h" - "OgreRenderable.h" - "OgreAxisAlignedBox.h" - "OgreMaterial.h" - -1169349958 c:\ogresdk\include\ogreshadowtexturemanager.h - "OgrePrerequisites.h" - "OgreSingleton.h" - "OgrePixelFormat.h" - "OgreTexture.h" - "OgreIteratorWrappers.h" - -1170376278 c:\ogresdk\include\ogreinstancedgeometry.h - "OgrePrerequisites.h" - "OgreMovableObject.h" - "OgreSimpleRenderable.h" - "OgreSkeleton.h" - "OgreSkeletonInstance.h" - "OgreAnimationTrack.h" - "OgreBone.h" - -1168440044 c:\ogresdk\include\ogreskeletoninstance.h - "OgrePrerequisites.h" - "OgreSkeleton.h" - -1156321116 c:\ogresdk\include\ogreskeletonmanager.h - "OgrePrerequisites.h" - "OgreResourceManager.h" - "OgreSingleton.h" - -1156321116 c:\ogresdk\include\ogreskeletonserializer.h - "OgrePrerequisites.h" - "OgreSkeleton.h" - "OgreSerializer.h" - -1171960516 c:\ogresdk\include\ogrestaticgeometry.h - "OgrePrerequisites.h" - "OgreMovableObject.h" - "OgreRenderable.h" - -1168440044 c:\ogresdk\include\ogrestringconverter.h - "OgrePrerequisites.h" - "OgreMath.h" - "OgreString.h" - "OgreStringVector.h" - -1168440044 c:\ogresdk\include\ogresubentity.h - "OgrePrerequisites.h" - "OgreString.h" - "OgreRenderable.h" - "OgreHardwareBufferManager.h" - -1168440044 c:\ogresdk\include\ogresubmesh.h - "OgrePrerequisites.h" - "OgreVertexIndexData.h" - "OgreMaterial.h" - "OgreRenderOperation.h" - "OgreVertexBoneAssignment.h" - "OgreProgressiveMesh.h" - "OgreAnimationTrack.h" - -1159139400 c:\ogresdk\include\ogrecompositor.h - "OgrePrerequisites.h" - "OgreIteratorWrappers.h" - "OgreResource.h" - -1161122428 c:\ogresdk\include\ogrecompositormanager.h - "OgrePrerequisites.h" - "OgreResourceManager.h" - "OgreCompositor.h" - "OgreRectangle2D.h" - "OgreCompositorSerializer.h" - "OgreNoMemoryMacros.h" - <boost/thread/tss.hpp> - "OgreMemoryMacros.h" - -1156321112 c:\ogresdk\include\ogrecompositorserializer.h - "OgrePrerequisites.h" - "OgreDataStream.h" - -1165678642 c:\ogresdk\include\ogrecompositorchain.h - "OgrePrerequisites.h" - "OgreRenderTargetListener.h" - "OgreRenderQueueListener.h" - "OgreCompositorInstance.h" - "OgreCompositor.h" - -1157386276 c:\ogresdk\include\ogrecompositorinstance.h - "OgrePrerequisites.h" - "OgreMaterial.h" - "OgreTexture.h" - "OgreRenderQueue.h" - -1156321112 c:\ogresdk\include\ogrecompositiontechnique.h - "OgrePrerequisites.h" - "OgrePixelFormat.h" - "OgreIteratorWrappers.h" - -1156321112 c:\ogresdk\include\ogrecompositionpass.h - "OgrePrerequisites.h" - "OgreMaterial.h" - "OgreRenderSystem.h" - "OgreRenderQueue.h" - -1156321112 c:\ogresdk\include\ogrecompositiontargetpass.h - "OgrePrerequisites.h" - "OgreIteratorWrappers.h" - -1156321116 c:\ogresdk\include\ogrewindoweventutilities.h - "OgrePrerequisites.h" - "OgrePlatform.h" - <windows.h> - -1166161408 c:\ogresdk\include\ogreshadowcamerasetupfocused.h - "OgrePrerequisites.h" - "OgreShadowCameraSetup.h" - "OgrePolygon.h" - "OgreConvexBody.h" - -1165247958 c:\ogresdk\include\ogrepolygon.h - "OgrePrerequisites.h" - "OgreVector3.h" - -1168440042 c:\ogresdk\include\ogreconvexbody.h - "OgrePrerequisites.h" - "OgrePolygon.h" - -1166161408 c:\ogresdk\include\ogreshadowcamerasetuplispsm.h - "OgrePrerequisites.h" - "OgreShadowCameraSetupFocused.h" - -1166222272 c:\ogresdk\include\ogreshadowcamerasetupplaneoptimal.h - "OgrePrerequisites.h" - "OgreShadowCameraSetup.h" - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\include\ogreopcode.h - "OgreOpcodeExports.h" - "OgreCollisionManager.h" - "OgreCollisionContext.h" - "OgreCollisionObject.h" - "OgreCollisionTypes.h" - "OgreMeshCollisionShape.h" - "OgreEntityCollisionShape.h" - "OgrePtrCollisionShape.h" - "OgreBoxCollisionShape.h" - "OgreSphereMeshCollisionShape.h" - "OgreTerrainCollisionShape.h" - "OgreCollisionReporter.h" - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\include\ogreopcodeexports.h - "Ogre.h" - "OgrePrerequisites.h" - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\include\ogrecollisionmanager.h - "OgreOpcodeExports.h" - <Ogre.h> - "OgreCollisionTypes.h" - "OgreNodes.h" - "OgreCollisionContext.h" - "Opcode.h" - "IOgreCollisionShape.h" - <list> - <map> - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\include\ogrecollisiontypes.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\include\ogrenodes.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\include\ogrecollisioncontext.h - <Ogre.h> - "OgreNodes.h" - "OgreCollisionReporter.h" - "OgreCollisionTypes.h" - "OgreOpcodeDebugObject.h" - <Opcode.h> - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\include\ogrecollisionreporter.h - <Ogre.h> - "OgreOpcodeExports.h" - <set> - <map> - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\include\ogreopcodedebugobject.h - "OgreOpcodeExports.h" - "Ogre.h" - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\opcode.h - "OPC_IceHook.h" - "OPC_Settings.h" - "OPC_Common.h" - "OPC_MeshInterface.h" - "OPC_TreeBuilders.h" - "OPC_AABBTree.h" - "OPC_OptimizedTree.h" - "OPC_BaseModel.h" - "OPC_Model.h" - "OPC_HybridModel.h" - "OPC_Collider.h" - "OPC_VolumeCollider.h" - "OPC_TreeCollider.h" - "OPC_RayCollider.h" - "OPC_SphereCollider.h" - "OPC_OBBCollider.h" - "OPC_AABBCollider.h" - "OPC_LSSCollider.h" - "OPC_PlanesCollider.h" - "OPC_Picking.h" - "OPC_BoxPruning.h" - "OPC_SweepAndPrune.h" - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\opc_icehook.h - <stdio.h> - <stdlib.h> - <assert.h> - <string.h> - <float.h> - <math.h> - "Ice/IcePreprocessor.h" - "Ice/IceTypes.h" - "Ice/IceFPU.h" - "Ice/IceMemoryMacros.h" - "Ice/IceUtils.h" - "Ice/IceContainer.h" - "Ice/IcePairs.h" - "Ice/IceRevisitedRadix.h" - "Ice/IceRandom.h" - "Ice/IceAxes.h" - "Ice/IcePoint.h" - "Ice/IceHPoint.h" - "Ice/IceMatrix3x3.h" - "Ice/IceMatrix4x4.h" - "Ice/IcePlane.h" - "Ice/IceRay.h" - "Ice/IceIndexedTriangle.h" - "Ice/IceTriangle.h" - "Ice/IceTriList.h" - "Ice/IceAABB.h" - "Ice/IceOBB.h" - "Ice/IceBoundingSphere.h" - "Ice/IceSegment.h" - "Ice/IceLSS.h" - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\ice\icepreprocessor.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\ice\icetypes.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\ice\icefpu.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\ice\icememorymacros.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\ice\iceutils.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\ice\icecontainer.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\ice\icepairs.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\ice\icerevisitedradix.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\ice\icerandom.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\ice\iceaxes.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\ice\icepoint.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\ice\icehpoint.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\ice\icematrix3x3.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\ice\icematrix4x4.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\ice\iceplane.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\ice\iceray.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\ice\iceindexedtriangle.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\ice\icetriangle.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\ice\icetrilist.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\ice\iceaabb.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\ice\iceobb.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\ice\iceboundingsphere.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\ice\icesegment.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\ice\icelss.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\opc_settings.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\opc_common.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\opc_meshinterface.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\opc_treebuilders.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\opc_aabbtree.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\opc_optimizedtree.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\opc_basemodel.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\opc_model.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\opc_hybridmodel.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\opc_collider.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\opc_volumecollider.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\opc_treecollider.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\opc_raycollider.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\opc_spherecollider.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\opc_obbcollider.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\opc_aabbcollider.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\opc_lsscollider.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\opc_planescollider.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\opc_picking.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\opc_boxpruning.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\opcode132\opc_sweepandprune.h - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\include\iogrecollisionshape.h - "OgreOpcodeExports.h" - <Ogre.h> - "OgreCollisionTypes.h" - "OgreOpcodeDebugObject.h" - "Opcode.h" - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\include\ogrecollisionobject.h - <Ogre.h> - "OgreNodes.h" - "OgreCollisionManager.h" - "OgreCollisionContext.h" - "OgreOpcodeMath.h" - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\include\ogreopcodemath.h - <Ogre.h> - "OgreOpcodeExports.h" - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\include\ogremeshcollisionshape.h - "OgreOpcodeExports.h" - <Ogre.h> - "IOgreCollisionShape.h" - "OgreCollisionTypes.h" - "OgreOpcodeDebugObject.h" - "Opcode.h" - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\include\ogreentitycollisionshape.h - "OgreOpcodeExports.h" - <Ogre.h> - "IOgreCollisionShape.h" - "OgreCollisionTypes.h" - "OgreOpcodeDebugObject.h" - "Opcode.h" - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\include\ogreptrcollisionshape.h - "OgreOpcodeExports.h" - <Ogre.h> - "IOgreCollisionShape.h" - "OgreCollisionTypes.h" - "OgreOpcodeDebugObject.h" - "Opcode.h" - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\include\ogreboxcollisionshape.h - "OgreOpcodeExports.h" - <Ogre.h> - "IOgreCollisionShape.h" - "OgreCollisionTypes.h" - "OgreOpcodeDebugObject.h" - "Opcode.h" - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\include\ogrespheremeshcollisionshape.h - "OgreOpcodeExports.h" - <Ogre.h> - "IOgreCollisionShape.h" - "OgreCollisionTypes.h" - "OgreOpcodeDebugObject.h" - "Opcode.h" - -1174165722 c:\home\src\opengate\branches\ogsector\externals\ogreopcode\include\ogreterraincollisionshape.h - "OgreOpcodeExports.h" - <Ogre.h> - "IOgreCollisionShape.h" - "OgreCollisionTypes.h" - "OgreOpcodeDebugObject.h" - "Opcode.h" - -1175879502 c:\home\src\opengate\branches\ogsector\src\sectorclientframelistener.h - <Ogre.h> - "InputManager.h" - "networkClient.h" - "SectorObjects.h" - -1175876378 c:\home\src\opengate\branches\ogsector\src\inputmanager.h - <OIS/OISEvents.h> - <OIS/OISInputManager.h> - <OIS/OISMouse.h> - <OIS/OISKeyboard.h> - <OIS/OISJoyStick.h> - "windows.h" - -1171217122 c:\ogresdk\include\ois\oismouse.h - "OISObject.h" - "OISEvents.h" - -1171217122 c:\ogresdk\include\ois\oisobject.h - "OISPrereqs.h" - "OISInterface.h" - -1171976394 c:\ogresdk\include\ois\oisprereqs.h - <vector> - <string> - <map> - "OISConfig.h" - -1171217122 c:\ogresdk\include\ois\oisconfig.h - -1171217122 c:\ogresdk\include\ois\oisinterface.h - "OISPrereqs.h" - -1171217122 c:\ogresdk\include\ois\oisevents.h - "OISPrereqs.h" - -1171217122 c:\ogresdk\include\ois\oiskeyboard.h - "OISObject.h" - "OISEvents.h" - -1171217122 c:\ogresdk\include\ois\oisjoystick.h - "OISObject.h" - "OISEvents.h" - -1171217122 c:\ogresdk\include\ois\oisinputmanager.h - "OISPrereqs.h" - -1175879122 c:\home\src\opengate\branches\ogsector\src\networkclient.h - "common.h" - <grapple/grapple.h> - <string> - <vector> - <map> - "networkProtocol.h" - -1175876378 c:\home\src\opengate\branches\ogsector\src\common.h - <config.h> - <sstream> - <iostream> - <cmath> - -1175879018 c:\home\src\opengate\branches\ogsector\src\networkprotocol.h - <iostream> - <sstream> - <string> - <Ogre.h> - -1175879394 c:\home\src\opengate\branches\ogsector\src\sectorobjects.h - <Ogre.h> - <OgreOpcode.h> - "common.h" - "networkProtocol.h" - -1175778098 source:c:\home\src\opengate\branches\ogsector\src\sectorclient.cpp - "SectorClient.h" - -1175778098 c:\home\src\opengate\branches\ogsector\src\sectorclient.h - <Ogre.h> - <OgreConfigFile.h> - "common.h" - "Sector.h" - "SectorClientFrameListener.h" - "networkClient.h" - <list> - -1175879610 source:c:\home\src\opengate\branches\ogsector\src\sectorclientframelistener.cpp - "SectorClientFrameListener.h" - "SectorClient.h" - "networkProtocol.h" - <iostream> - <OgreTextAreaOverlayElement.h> - <OgreFontManager.h> - -1172506520 c:\ogresdk\include\ogretextareaoverlayelement.h - "OgreOverlayElement.h" - "OgreFont.h" - -1172524824 c:\ogresdk\include\ogrefont.h - "OgrePrerequisites.h" - "OgreResource.h" - "OgreTexture.h" - "OgreMaterial.h" - "OgreCommon.h" - -1155988492 c:\ogresdk\include\ogrefontmanager.h - "OgrePrerequisites.h" - "OgreSingleton.h" - "OgreResourceManager.h" - "OgreFont.h" - -1175879306 source:c:\home\src\opengate\branches\ogsector\src\sectorobjects.cpp - "Sector.h" - "SectorObjects.h" - "common.h" - -1175876378 source:c:\home\src\opengate\branches\ogsector\src\common.cpp - "common.h" - -1175876378 source:c:\home\src\opengate\branches\ogsector\src\networkclient.cpp - <config.h> - "networkClient.h" - <iostream> - <sstream> - -1175878712 source:c:\home\src\opengate\branches\ogsector\src\ogsectorclient.cpp - "SectorClient.h" - "networkProtocol.h" - "networkClient.h" - "windows.h" - <iostream> - <sstream> - <fstream> - <string> - <vector> - -1175878648 source:c:\home\src\opengate\branches\ogsector\src\inputmanager.cpp - "InputManager.h" - "OgreStringConverter.h" - Modified: branches/ogsector/win32/ogsectorclient/ogsectorclient.exe =================================================================== (Binary files differ) Deleted: branches/ogsector/win32/ogsectorclient/ogsectorclient.layout =================================================================== --- branches/ogsector/win32/ogsectorclient/ogsectorclient.layout 2007-04-30 17:59:31 UTC (rev 425) +++ branches/ogsector/win32/ogsectorclient/ogsectorclient.layout 2007-04-30 18:20:52 UTC (rev 426) @@ -1,40 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> -<CodeBlocks_layout_file> - <ActiveTarget name="Release" /> - <File name="..\..\src\InputManager.cpp" open="1" top="0" tabpos="3"> - <Cursor position="1325" topLine="2" /> - </File> - <File name="..\..\src\InputManager.h" open="1" top="0" tabpos="2"> - <Cursor position="241" topLine="3" /> - </File> - <File name="..\..\src\Sector.cpp" open="1" top="0" tabpos="4"> - <Cursor position="8310" topLine="0" /> - </File> - <File name="..\..\src\Sector.h" open="1" top="0" tabpos="1"> - <Cursor position="55" topLine="0" /> - </File> - <File name="..\..\src\SectorClient.cpp" open="1" top="1" tabpos="15"> - <Cursor position="132" topLine="3" /> - </File> - <File name="..\..\src\SectorClientFrameListener.cpp" open="1" top="0" tabpos="14"> - <Cursor position="6375" topLine="167" /> - </File> - <File name="..\..\src\SectorClientFrameListener.h" open="1" top="0" tabpos="13"> - <Cursor position="1665" topLine="43" /> - </File> - <File name="..\..\src\SectorObjects.cpp" open="1" top="0" tabpos="8"> - <Cursor position="7341" topLine="189" /> - </File> - <File name="..\..\src\SectorObjects.h" open="1" top="0" tabpos="11"> - <Cursor position="2493" topLine="89" /> - </File> - <File name="..\..\src\networkClient.h" open="1" top="0" tabpos="10"> - <Cursor position="3405" topLine="102" /> - </File> - <File name="..\..\src\networkProtocol.h" open="1" top="0" tabpos="5"> - <Cursor position="9305" topLine="326" /> - </File> - <File name="..\..\src\ogsectorclient.cpp" open="1" top="0" tabpos="7"> - <Cursor position="783" topLine="35" /> - </File> -</CodeBlocks_layout_file> Modified: branches/ogsector/win32/ogsectorclient/resources.cfg =================================================================== --- branches/ogsector/win32/ogsectorclient/resources.cfg 2007-04-30 17:59:31 UTC (rev 425) +++ branches/ogsector/win32/ogsectorclient/resources.cfg 2007-04-30 18:20:52 UTC (rev 426) @@ -2,7 +2,10 @@ # Resource locations to be added to the default path [General] +FileSystem=./ FileSystem=../../data +FileSystem=../../data/materials +FileSystem=../../data/textures Zip=../../data/simpleSkybox.zip FileSystem=../../data/MediaFromOgre Zip=../../data/fonts.zip Added: branches/ogsector/win32/ogsectorclient/ships.xml =================================================================== --- branches/ogsector/win32/ogsectorclient/ships.xml (rev 0) +++ branches/ogsector/win32/ogsectorclient/ships.xml 2007-04-30 18:20:52 UTC (rev 426) @@ -0,0 +1,7 @@ +<?xml version="1.0"?> + +<ships> + <Resource id="1" location="../../data/ships/squadrok/squid/squid.xml"/> + <Resource id="2" location="../../../../trunk/data/ships/octavius/apteryx/apteryx.xml" /> + <Resource id="3" location="../../../../trunk/data/ships/quantar/storm/storm.xml" /> +</ships> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2007-05-10 17:09:32
|
Revision: 452 http://svn.sourceforge.net/opengate/?rev=452&view=rev Author: spom_spom Date: 2007-05-10 10:09:32 -0700 (Thu, 10 May 2007) Log Message: ----------- Added GameStateManager and Gamestates for docked and undocked. GUI system for docked is set to CEGUI-0.5 Modified Paths: -------------- branches/ogsector/configure.ac branches/ogsector/data/materials/simpleHUD.material branches/ogsector/data/materials/squadrok.material branches/ogsector/data/ships.xml branches/ogsector/resources.cfg branches/ogsector/runClient.sh branches/ogsector/src/InputManager.cpp branches/ogsector/src/LogManager.cpp 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/VesselManager.h branches/ogsector/src/networkClient.cpp branches/ogsector/src/ogconsole.cpp branches/ogsector/win32/ogsectorclient/resources.cfg Added Paths: ----------- branches/ogsector/data/gui/ branches/ogsector/data/gui/layouts/ branches/ogsector/data/gui/layouts/GUILayout.xsd branches/ogsector/data/gui/layouts/dialogs/ branches/ogsector/data/gui/layouts/dialogs/ShipConfigDialog.layout branches/ogsector/data/gui/layouts/opengateDocked.layout branches/ogsector/data/gui/schemes/ branches/ogsector/data/gui/schemes/Falagard.xsd branches/ogsector/data/gui/schemes/Falagard.xsx branches/ogsector/data/gui/schemes/Font.xsd branches/ogsector/data/gui/schemes/GUIScheme.xsd branches/ogsector/data/gui/schemes/Imageset.xsd branches/ogsector/data/gui/schemes/opengate/ branches/ogsector/data/gui/schemes/opengate/opengate.imageset branches/ogsector/data/gui/schemes/opengate/opengate.looknfeel branches/ogsector/data/gui/schemes/opengate/opengate.png branches/ogsector/data/gui/schemes/opengate/opengate.scheme branches/ogsector/data/gui/schemes/opengate/opengateButtons.looknfeel branches/ogsector/data/gui/schemes/opengate/opengateContainers.looknfeel branches/ogsector/data/gui/schemes/opengate/opengateScroll.looknfeel branches/ogsector/data/gui/schemes/opengate/opengateStatic.looknfeel branches/ogsector/data/gui/schemes/opengate/static.looknfeel branches/ogsector/data/gui/schemes/opengate/textures/ branches/ogsector/data/gui/schemes/opengate/textures/mainBottomLeft.png branches/ogsector/data/gui/schemes/opengate/textures/mainBottomMiddle.png branches/ogsector/data/gui/schemes/opengate/textures/mainBottomRight.png branches/ogsector/data/gui/schemes/opengate/textures/mainLeftLogo90.png branches/ogsector/data/gui/schemes/opengate/textures/mainRedLine.png branches/ogsector/data/gui/schemes/opengate/textures/mainRedLineBottom.png branches/ogsector/data/gui/schemes/opengate/textures/mainRedLineTop.png branches/ogsector/data/gui/schemes/opengate/textures/mainTopLeft.png branches/ogsector/data/gui/schemes/opengate/textures/mainTopRight.png branches/ogsector/data/gui/schemes/opengate/textures/scrollbar/ branches/ogsector/data/gui/schemes/opengate/textures/scrollbar/downHover.png branches/ogsector/data/gui/schemes/opengate/textures/scrollbar/downNormal.png branches/ogsector/data/gui/schemes/opengate/textures/scrollbar/downPushed.png branches/ogsector/data/gui/schemes/opengate/textures/scrollbar/leftHover.png branches/ogsector/data/gui/schemes/opengate/textures/scrollbar/leftNormal.png branches/ogsector/data/gui/schemes/opengate/textures/scrollbar/leftPushed.png branches/ogsector/data/gui/schemes/opengate/textures/scrollbar/rightHover.png branches/ogsector/data/gui/schemes/opengate/textures/scrollbar/rightNormal.png branches/ogsector/data/gui/schemes/opengate/textures/scrollbar/rightPushed.png branches/ogsector/data/gui/schemes/opengate/textures/scrollbar/upHover.png branches/ogsector/data/gui/schemes/opengate/textures/scrollbar/upNormal.png branches/ogsector/data/gui/schemes/opengate/textures/scrollbar/upPushed.png branches/ogsector/src/DockedState.cpp branches/ogsector/src/DockedState.h branches/ogsector/src/GameState.cpp branches/ogsector/src/GameState.h branches/ogsector/src/GameStateManager.cpp branches/ogsector/src/GameStateManager.h branches/ogsector/src/ShipConfigDialog.cpp branches/ogsector/src/ShipConfigDialog.h branches/ogsector/src/UnDockedState.cpp branches/ogsector/src/UnDockedState.h Removed Paths: ------------- branches/ogsector/src/SectorClient.cpp branches/ogsector/src/SectorClient.h branches/ogsector/src/SectorClientFrameListener.cpp branches/ogsector/src/SectorClientFrameListener.h branches/ogsector/src/ogsectorclient.cpp branches/ogsector/src/ogsectorserver.cpp Modified: branches/ogsector/configure.ac =================================================================== --- branches/ogsector/configure.ac 2007-05-10 12:23:21 UTC (rev 451) +++ branches/ogsector/configure.ac 2007-05-10 17:09:32 UTC (rev 452) @@ -21,6 +21,14 @@ AC_SUBST(AM_CXXFLAGS,"$AM_CXXFLAGS $OGRE_CFLAGS") AC_SUBST(AM_LDFLAGS,"$AM_LDFLAGS $OGRE_LIBS") +PKG_CHECK_MODULES(CEGUI, [CEGUI >= 0.5.0]) +AC_SUBST(AM_CXXFLAGS,"$AM_CXXFLAGS $CEGUI_CFLAGS") +AC_SUBST(AM_LDFLAGS,"$AM_LDFLAGS $CEGUI_LIBS") + +PKG_CHECK_MODULES(CEGUIOGRE, [CEGUI-OGRE >= 1.4.0]) +AC_SUBST(AM_CXXFLAGS,"$AM_CXXFLAGS $CEGUIOGRE_CFLAGS") +AC_SUBST(AM_LDFLAGS,"$AM_LDFLAGS $CEGUIOGRE_LIBS") + dnl OIS - http://www.sourceforge.net/projects/wgois/ PKG_CHECK_MODULES(OIS, [OIS >= 0.9.9]) AC_SUBST(AM_CXXFLAGS, "$AM_CXXFLAGS $OIS_CFLAGS") Added: branches/ogsector/data/gui/layouts/GUILayout.xsd =================================================================== --- branches/ogsector/data/gui/layouts/GUILayout.xsd (rev 0) +++ branches/ogsector/data/gui/layouts/GUILayout.xsd 2007-05-10 17:09:32 UTC (rev 452) @@ -0,0 +1,63 @@ +<?xml version="1.0"?> +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> + + <xsd:element name="GUILayout" type="GUILayoutType"/> + + <xsd:complexType name="GUILayoutType"> + <xsd:sequence> + <xsd:element name="Window" type="WindowType" /> + </xsd:sequence> + <xsd:attribute name="Parent" type="xsd:string" use="optional" default=""/> + </xsd:complexType> + + <xsd:complexType name="WindowType"> + <xsd:sequence> + <xsd:element name="LayoutImport" type="LayoutImportType" minOccurs="0" maxOccurs="unbounded" /> + <xsd:element name="Property" type="PropertyType" minOccurs="0" maxOccurs="unbounded" /> + <xsd:element name="Event" type="EventType" minOccurs="0" maxOccurs="unbounded" /> + <xsd:choice minOccurs="0" maxOccurs="unbounded"> + <xsd:element name="Window" type="WindowType" /> + <xsd:element name="AutoWindow" type="AutoWindowType" /> + </xsd:choice> + <xsd:element name="Property" type="PropertyType" minOccurs="0" maxOccurs="unbounded" /> + </xsd:sequence> + <xsd:attribute name="Type" type="xsd:string" use="required"/> + <xsd:attribute name="Name" type="xsd:string" use="optional" default="" /> + </xsd:complexType> + + <xsd:complexType name="AutoWindowType"> + <xsd:sequence> + <xsd:element name="LayoutImport" type="LayoutImportType" minOccurs="0" maxOccurs="unbounded" /> + <xsd:element name="Property" type="PropertyType" minOccurs="0" maxOccurs="unbounded" /> + <xsd:element name="Event" type="EventType" minOccurs="0" maxOccurs="unbounded" /> + <xsd:choice minOccurs="0" maxOccurs="unbounded"> + <xsd:element name="Window" type="WindowType" /> + <xsd:element name="AutoWindow" type="AutoWindowType" /> + </xsd:choice> + <xsd:element name="Property" type="PropertyType" minOccurs="0" maxOccurs="unbounded" /> + </xsd:sequence> + <xsd:attribute name="NameSuffix" type="xsd:string" use="required"/> + </xsd:complexType> + + <xsd:complexType name="PropertyType"> + <xsd:simpleContent> + <xsd:extension base="xsd:string"> + <xsd:attribute name="Name" type="xsd:string" use="required"/> + <xsd:attribute name="Value" type="xsd:string" use="optional"/> + </xsd:extension> + </xsd:simpleContent> + </xsd:complexType> + + <xsd:complexType name="LayoutImportType"> + <xsd:attribute name="Filename" type="xsd:string" use="required"/> + <xsd:attribute name="Prefix" type="xsd:string" use="optional" default="" /> + <xsd:attribute name="ResourceGroup" type="xsd:string" use="optional" default="" /> + </xsd:complexType> + + <xsd:complexType name="EventType"> + <xsd:attribute name="Name" type="xsd:string" use="required"/> + <xsd:attribute name="Function" type="xsd:string" use="required"/> + </xsd:complexType> + +</xsd:schema> + Added: branches/ogsector/data/gui/layouts/dialogs/ShipConfigDialog.layout =================================================================== --- branches/ogsector/data/gui/layouts/dialogs/ShipConfigDialog.layout (rev 0) +++ branches/ogsector/data/gui/layouts/dialogs/ShipConfigDialog.layout 2007-05-10 17:09:32 UTC (rev 452) @@ -0,0 +1,69 @@ +<?xml version="1.0" ?> +<GUILayout> + <Window Type="opengate/FrameWindow" Name="ShipConfigDialog"> + <Property Name="UnifiedPosition" Value="{{0.15,0},{0.1,0}}" /> + <Property Name="UnifiedSize" Value="{{0.7,0},{0.7,0}}" /> + <Property Name="SizingEnabled" Value="false" /> + +<!-- <Property Name="HorizontalAlignment" Value="Centre" /> --> +<!-- <Property Name="VerticalAlignment" Value="Centre" /> --> + <Property Name="Alpha" Value="0.7" /> + <Property Name="Text" Value="Ship Configurator" /> + <Window Type="opengate/FrameWindow" Name="ShipConfigDialog/ShipStats"> + <Property Name="UnifiedPosition" Value="{{0.7,0},{0.0,22}}" /> + <Property Name="UnifiedSize" Value="{{0.3,0},{1.0,-22}}" /> + <Property Name="SizingEnabled" Value="false" /> + <Property Name="TitlebarEnabled" Value="false" /> + <Property Name="CloseButtonEnabled" Value="false" /> + <Property Name="Alpha" Value="0.7" /> + </Window> + <Window Type="opengate/Button" Name="ShipConfigDialog/SelectOctavius"> + <Property Name="UnifiedPosition" Value="{{0.55,0.0},{0.3,0}}" /> + <Property Name="UnifiedSize" Value="{{0.0,100},{0.0,24}}" /> + <Property Name="Text" Value="Octavius" /> + <Property Name="Disabled" Value="true" /> + </Window> + <Window Type="opengate/Button" Name="ShipConfigDialog/SelectQuanter"> + <Property Name="UnifiedPosition" Value="{{0.55,0.0},{0.3,+26}}" /> + <Property Name="UnifiedSize" Value="{{0.0,100},{0.0,24}}" /> + <Property Name="Text" Value="Quantar" /> + <Property Name="Disabled" Value="true" /> + </Window> + <Window Type="opengate/Button" Name="ShipConfigDialog/SelectTauseti"> + <Property Name="UnifiedPosition" Value="{{0.55,0.0},{0.3,+52}}" /> + <Property Name="UnifiedSize" Value="{{0.0,100},{0.0,24}}" /> + <Property Name="Text" Value="Tauseti" /> + <Property Name="Disabled" Value="true" /> + </Window> + <Window Type="opengate/Button" Name="ShipConfigDialog/SelectSquadrok"> + <Property Name="UnifiedPosition" Value="{{0.55,0.0},{0.3,+78}}" /> + <Property Name="UnifiedSize" Value="{{0.0,100},{0.0,24}}" /> + <Property Name="Text" Value="Squadrok" /> + <Property Name="Disabled" Value="true" /> + </Window> + <Window Type="opengate/Button" Name="ShipConfigDialog/SelectAll"> + <Property Name="UnifiedPosition" Value="{{0.55,0.0},{0.3,+110}}" /> + <Property Name="UnifiedSize" Value="{{0.0,100},{0.0,24}}" /> + <Property Name="Text" Value="All" /> + <Property Name="Disabled" Value="true" /> + </Window> + <Window Type="opengate/StaticImage" Name="ShipConfigDialog/ShipView"> + <Property Name="UnifiedPosition" Value="{{0.1,0},{0.3,0}}" /> + <Property Name="UnifiedSize" Value="{{0.4,0},{ 0.4,0}}" /> + <Property Name="Alpha" Value="1.0" /> + </Window> + <Window Type="opengate/HorizontalScrollbarLeftThumb" Name="ShipConfigDialog/PrevShip"> + <Property Name="UnifiedPosition" Value="{{0.1,0},{0.7,+10}}" /> + <Property Name="UnifiedSize" Value="{{0.0,56},{ 0.0,14}}" /> + </Window> + <Window Type="opengate/HorizontalScrollbarRightThumb" Name="ShipConfigDialog/NextShip"> + <Property Name="UnifiedPosition" Value="{{0.5,-56},{0.7,+10}}" /> + <Property Name="UnifiedSize" Value="{{0.0,56},{ 0.0,14}}" /> + </Window> + <Window Type="opengate/Button" Name="ShipConfigDialog/SelectShip"> + <Property Name="UnifiedPosition" Value="{{0.0,+10},{1,-34}}" /> + <Property Name="UnifiedSize" Value="{{0.0,100},{0.0,24}}" /> + <Property Name="Text" Value="Select" /> + </Window> + </Window> +</GUILayout> Added: branches/ogsector/data/gui/layouts/opengateDocked.layout =================================================================== --- branches/ogsector/data/gui/layouts/opengateDocked.layout (rev 0) +++ branches/ogsector/data/gui/layouts/opengateDocked.layout 2007-05-10 17:09:32 UTC (rev 452) @@ -0,0 +1,131 @@ +<?xml version="1.0" ?> +<GUILayout> + <Window Type="DefaultWindow" Name="Docked/MainWindow"> + <Property Name="UnifiedPosition" Value="{{0.0,1},{0.0,1}}" /> + <Property Name="UnifiedSize" Value="{{1.0,-2},{1.0,-2}}" /> +<!-- <Property Name="UnifiedPosition" Value="{{0.0,23},{0.0,5}}" /> --> +<!-- <Property Name="UnifiedSize" Value="{{1.0,-46},{1.0,-10}}" /> --> + <Property Name="Alpha" Value="1" /> + + <Window Type="opengate/StaticImage" Name="Docked/MainWindow/TopLeft"> + <Property Name="UnifiedPosition" Value="{{0.0,25},{0.0,10}}" /> + <Property Name="UnifiedSize" Value="{{0.0,62},{0.0,374}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:MainWindowTopLeft image:full_image" /> + </Window> + <Window Type="opengate/StaticImage" Name="Docked/MainWindow/LeftRedLineTop"> + <Property Name="UnifiedPosition" Value="{{0.0,40},{0.0,384}}" /> + <Property Name="UnifiedSize" Value="{{0.0,44},{0.0, 22}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:MainWindowRedLineTop image:full_image" /> + </Window> + <Window Type="opengate/StaticImage" Name="Docked/MainWindow/LeftLine"> + <Property Name="UnifiedPosition" Value="{{0.0,61},{0.0,384}}" /> + <Property Name="UnifiedSize" Value="{{0.0,4},{1.0,-504}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:MainWindowRedLine image:full_image" /> + </Window> + <Window Type="opengate/StaticImage" Name="Docked/MainWindow/LeftRedLineBottom"> + <Property Name="UnifiedPosition" Value="{{0.0,40},{1.0,-140}}" /> + <Property Name="UnifiedSize" Value="{{0.0,44},{0.0, 22}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:MainWindowRedLineBottom image:full_image" /> + </Window> + <Window Type="opengate/StaticImage" Name="Docked/MainWindow/RightRedLineTop"> + <Property Name="UnifiedPosition" Value="{{1.0,-68},{0.0,132}}" /> + <Property Name="UnifiedSize" Value="{{0.0,44},{0.0, 22}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:MainWindowRedLineTop image:full_image" /> + </Window> + <Window Type="opengate/StaticImage" Name="Docked/MainWindow/RightLine"> + <Property Name="UnifiedPosition" Value="{{1.0,-47},{0.0,132}}" /> + <Property Name="UnifiedSize" Value="{{0.0,4},{1.0,-197}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:MainWindowRedLine image:full_image" /> + </Window> + <Window Type="opengate/StaticImage" Name="Docked/MainWindow/RightRedLineBottom"> + <Property Name="UnifiedPosition" Value="{{1.0,-68},{1.0,-94}}" /> + <Property Name="UnifiedSize" Value="{{0.0,44},{0.0, 22}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:MainWindowRedLineBottom image:full_image" /> + </Window> + <Window Type="opengate/StaticImage" Name="Docked/MainWindow/BottomMiddle"> + <Property Name="UnifiedPosition" Value="{{0.0,108},{1.0,-64}}" /> + <Property Name="UnifiedSize" Value="{{1.0,-291},{0.0,59}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:MainWindowBottomMiddle image:full_image" /> + </Window> + <Window Type="opengate/StaticImage" Name="Docked/MainWindow/BottomLeft"> + <Property Name="UnifiedPosition" Value="{{0.0,36},{1.0,-118}}" /> + <Property Name="UnifiedSize" Value="{{0.0,83},{0.0,113}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:MainWindowBottomLeft image:full_image" /> + </Window> + <Window Type="opengate/StaticImage" Name="Docked/MainWindow/BottomRight"> + <Property Name="UnifiedPosition" Value="{{1.0,-185},{1.0,-104}}" /> + <Property Name="UnifiedSize" Value="{{0.0,158},{0.0,99}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:MainWindowBottomRight image:full_image" /> + </Window> + <Window Type="opengate/StaticImage" Name="Docked/MainWindow/TopRight"> + <Property Name="UnifiedPosition" Value="{{1.0,-326},{0.0,10}}" /> + <Property Name="UnifiedSize" Value="{{0.0,301},{0.0,122}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:MainWindowTopRight image:full_image" /> + </Window> + + <Window Type="opengate/Button" Name="Docked/MainWindow/ShipConfigButton"> + <Property Name="UnifiedPosition" Value="{{0.125,0},{1.0,-88}}" /> + <Property Name="UnifiedSize" Value="{{0.0,100},{0.0,24}}" /> + <Property Name="Text" Value="Ship Configurator" /> + </Window> + <Window Type="opengate/Button" Name="Docked/MainWindow/MarketButton"> + <Property Name="UnifiedPosition" Value="{{0.125,+101},{1.0,-88}}" /> + <Property Name="UnifiedSize" Value="{{0.0,100},{0.0,24}}" /> + <Property Name="Disabled" Value="true" /> + <Property Name="Text" Value="Market" /> + </Window> + <Window Type="opengate/Button" Name="Docked/MainWindow/MissionButton"> + <Property Name="UnifiedPosition" Value="{{0.125,+202},{1.0,-88}}" /> + <Property Name="UnifiedSize" Value="{{0.0,100},{0.0,24}}" /> + <Property Name="Disabled" Value="true" /> + <Property Name="Text" Value="Mission" /> + </Window> + <Window Type="opengate/Button" Name="Docked/MainWindow/TradeButton"> + <Property Name="UnifiedPosition" Value="{{0.125,+303},{1.0,-88}}" /> + <Property Name="UnifiedSize" Value="{{0.0,100},{0.0,24}}" /> + <Property Name="Disabled" Value="true" /> + <Property Name="Text" Value="Trade" /> + </Window> + <Window Type="opengate/Button" Name="Docked/MainWindow/SimulatorButton"> + <Property Name="UnifiedPosition" Value="{{0.125,+404},{1.0,-88}}" /> + <Property Name="UnifiedSize" Value="{{0.0,100},{0.0,24}}" /> + <Property Name="Disabled" Value="true" /> + <Property Name="Text" Value="Simulator" /> + </Window> + + <Window Type="opengate/Button" Name="Docked/MainWindow/Quit"> + <Property Name="UnifiedPosition" Value="{{1,-165},{1.0,-96}}" /> + <Property Name="UnifiedSize" Value="{{0.0,75},{0.0,24}}" /> +<!-- <Property Name="HorizontalAlignment" Value="Centre" /> --> +<!-- <Property Name="VerticalAlignment" Value="Centre" /> --> + <Property Name="Text" Value="Quit" /> + </Window> + <Window Type="opengate/Button" Name="Docked/MainWindow/Launch"> + <Property Name="UnifiedPosition" Value="{{1,-165},{1.0,-53}}" /> + <Property Name="UnifiedSize" Value="{{0.0,75},{0.0,24}}" /> + <Property Name="Text" Value="Launch" /> + </Window> + </Window> +</GUILayout> Added: branches/ogsector/data/gui/schemes/Falagard.xsd =================================================================== --- branches/ogsector/data/gui/schemes/Falagard.xsd (rev 0) +++ branches/ogsector/data/gui/schemes/Falagard.xsd 2007-05-10 17:09:32 UTC (rev 452) @@ -0,0 +1,383 @@ +<?xml version="1.0" ?> +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> + <xsd:element name="Falagard" type="falagardSpecificationType" /> + <xsd:complexType name="falagardSpecificationType"> + <xsd:sequence> + <xsd:element name="WidgetLook" type="widgetLookType" minOccurs="0" maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + <xsd:complexType name="widgetLookType"> + <xsd:sequence> + <xsd:element name="PropertyDefinition" type="propertyDefinitionType" minOccurs="0" maxOccurs="unbounded" /> + <xsd:element name="PropertyLinkDefinition" type="propertyLinkDefinitionType" minOccurs="0" maxOccurs="unbounded" /> + <xsd:element name="Property" type="propertyType" minOccurs="0" maxOccurs="unbounded" /> + <xsd:element name="NamedArea" type="namedAreaType" minOccurs="0" maxOccurs="unbounded" /> + <xsd:element name="Child" type="widgetComponentType" minOccurs="0" maxOccurs="unbounded" /> + <xsd:element name="ImagerySection" type="imagerySectionType" minOccurs="0" maxOccurs="unbounded" /> + <xsd:element name="StateImagery" type="stateType" minOccurs="0" maxOccurs="unbounded" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + <xsd:complexType name="propertyDefinitionType"> + <xsd:attribute name="type" type="propertyTypeEnum" use="optional" default="Generic" /> + <xsd:attribute name="name" type="xsd:string" use="required" /> + <xsd:attribute name="initialValue" type="xsd:string" use="optional" default="" /> + <xsd:attribute name="layoutOnWrite" type="xsd:boolean" use="optional" default="false" /> + <xsd:attribute name="redrawOnWrite" type="xsd:boolean" use="optional" default="false" /> + </xsd:complexType> + <xsd:complexType name="propertyLinkDefinitionType"> + <xsd:attribute name="type" type="propertyTypeEnum" use="optional" default="Generic" /> + <xsd:attribute name="name" type="xsd:string" use="required" /> + <xsd:attribute name="widget" type="xsd:string" use="required" /> + <xsd:attribute name="targetProperty" type="xsd:string" use="optional" default="" /> + <xsd:attribute name="initialValue" type="xsd:string" use="optional" default="" /> + <xsd:attribute name="layoutOnWrite" type="xsd:boolean" use="optional" default="false" /> + <xsd:attribute name="redrawOnWrite" type="xsd:boolean" use="optional" default="false" /> + </xsd:complexType> + <xsd:complexType name="namedAreaType"> + <xsd:sequence> + <xsd:element name="Area" type="componentAreaType" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + <xsd:complexType name="stateType"> + <xsd:sequence> + <xsd:element name="Layer" type="layerType" minOccurs="0" maxOccurs="unbounded" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + <xsd:attribute name="clipped" type="xsd:boolean" use="optional" default="true" /> + </xsd:complexType> + <xsd:complexType name="layerType"> + <xsd:sequence> + <xsd:element name="Section" type="sectionSpecType" minOccurs="0" maxOccurs="unbounded" /> + </xsd:sequence> + <xsd:attribute name="priority" type="xsd:integer" use="optional" default="0" /> + </xsd:complexType> + <xsd:complexType name="sectionSpecType"> + <xsd:choice minOccurs="0" maxOccurs="1"> + <xsd:element name="Colours" type="colourRectType" /> + <xsd:element name="ColourProperty" type="settingByPropertyType" /> + <xsd:element name="ColourRectProperty" type="settingByPropertyType" /> + </xsd:choice> + <xsd:attribute name="look" type="xsd:string" use="optional" default="" /> + <xsd:attribute name="section" type="xsd:string" use="required" /> + <xsd:attribute name="controlProperty" type="xsd:string" use="optional" default="" /> + </xsd:complexType> + <xsd:complexType name="imagerySectionType"> + <xsd:sequence> + <xsd:choice minOccurs="0" maxOccurs="1"> + <xsd:element name="Colours" type="colourRectType" /> + <xsd:element name="ColourProperty" type="settingByPropertyType" /> + <xsd:element name="ColourRectProperty" type="settingByPropertyType" /> + </xsd:choice> + <xsd:element name="FrameComponent" type="frameComponentType" minOccurs="0" maxOccurs="unbounded" /> + <xsd:element name="ImageryComponent" type="imageryComponentType" minOccurs="0" maxOccurs="unbounded" /> + <xsd:element name="TextComponent" type="textComponentType" minOccurs="0" maxOccurs="unbounded" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + <xsd:complexType name="frameComponentType"> + <xsd:sequence> + <xsd:element name="Area" type="componentAreaType" /> + <xsd:element name="Image" type="frameImageType" minOccurs="0" maxOccurs="9" /> + <xsd:choice minOccurs="0" maxOccurs="1"> + <xsd:element name="Colours" type="colourRectType" /> + <xsd:element name="ColourProperty" type="settingByPropertyType" /> + <xsd:element name="ColourRectProperty" type="settingByPropertyType" /> + </xsd:choice> + <xsd:choice minOccurs="0" maxOccurs="1"> + <xsd:element name="VertFormat" type="vertFormatType" /> + <xsd:element name="VertFormatProperty" type="settingByPropertyType" /> + </xsd:choice> + <xsd:choice minOccurs="0" maxOccurs="1"> + <xsd:element name="HorzFormat" type="horzFormatType" /> + <xsd:element name="HorzFormatProperty" type="settingByPropertyType" /> + </xsd:choice> + </xsd:sequence> + </xsd:complexType> + <xsd:complexType name="textComponentType"> + <xsd:sequence> + <xsd:element name="Area" type="componentAreaType" /> + <xsd:element name="Text" type="textStringType" minOccurs="0" maxOccurs="1" /> + <xsd:element name="TextProperty" type="textPropertyType" minOccurs="0" maxOccurs="1" /> + <xsd:element name="FontProperty" type="fontPropertyType" minOccurs="0" maxOccurs="1" /> + <xsd:choice minOccurs="0" maxOccurs="1"> + <xsd:element name="Colours" type="colourRectType" /> + <xsd:element name="ColourProperty" type="settingByPropertyType" /> + <xsd:element name="ColourRectProperty" type="settingByPropertyType" /> + </xsd:choice> + <xsd:choice minOccurs="0" maxOccurs="1"> + <xsd:element name="VertFormat" type="vertTextFormatType" /> + <xsd:element name="VertFormatProperty" type="settingByPropertyType" /> + </xsd:choice> + <xsd:choice minOccurs="0" maxOccurs="1"> + <xsd:element name="HorzFormat" type="horzTextFormatType" /> + <xsd:element name="HorzFormatProperty" type="settingByPropertyType" /> + </xsd:choice> + </xsd:sequence> + </xsd:complexType> + <xsd:complexType name="imageryComponentType"> + <xsd:sequence> + <xsd:element name="Area" type="componentAreaType" /> + <xsd:choice> + <xsd:element name="Image" type="imageType" /> + <xsd:element name="ImageProperty" type="settingByPropertyType" /> + </xsd:choice> + <xsd:choice minOccurs="0" maxOccurs="1"> + <xsd:element name="Colours" type="colourRectType" /> + <xsd:element name="ColourProperty" type="settingByPropertyType" /> + <xsd:element name="ColourRectProperty" type="settingByPropertyType" /> + </xsd:choice> + <xsd:choice minOccurs="0" maxOccurs="1"> + <xsd:element name="VertFormat" type="vertFormatType" /> + <xsd:element name="VertFormatProperty" type="settingByPropertyType" /> + </xsd:choice> + <xsd:choice minOccurs="0" maxOccurs="1"> + <xsd:element name="HorzFormat" type="horzFormatType" /> + <xsd:element name="HorzFormatProperty" type="settingByPropertyType" /> + </xsd:choice> + </xsd:sequence> + </xsd:complexType> + <xsd:complexType name="widgetComponentType"> + <xsd:sequence> + <xsd:element name="Area" type="componentAreaType" /> + <xsd:element name="VertAlignment" type="vertAlignmentType" minOccurs="0" maxOccurs="1" /> + <xsd:element name="HorzAlignment" type="horzAlignmentType" minOccurs="0" maxOccurs="1" /> + <xsd:element name="Property" type="propertyType" minOccurs="0" maxOccurs="unbounded" /> + </xsd:sequence> + <xsd:attribute name="type" type="xsd:string" use="required" /> + <xsd:attribute name="nameSuffix" type="xsd:string" use="required" /> + <xsd:attribute name="renderer" type="xsd:string" use="optional" default="" /> + <xsd:attribute name="look" type="xsd:string" use="optional" default="" /> + </xsd:complexType> + <xsd:complexType name="horzFormatType"> + <xsd:attribute name="type" type="horzFormatEnum" use="required" /> + </xsd:complexType> + <xsd:complexType name="vertFormatType"> + <xsd:attribute name="type" type="vertFormatEnum" use="required" /> + </xsd:complexType> + <xsd:complexType name="horzTextFormatType"> + <xsd:attribute name="type" type="horzTextFormatEnum" use="required" /> + </xsd:complexType> + <xsd:complexType name="vertTextFormatType"> + <xsd:attribute name="type" type="vertTextFormatEnum" use="required" /> + </xsd:complexType> + <xsd:complexType name="horzAlignmentType"> + <xsd:attribute name="type" type="horzAlignmentEnum" use="required" /> + </xsd:complexType> + <xsd:complexType name="vertAlignmentType"> + <xsd:attribute name="type" type="vertAlignmentEnum" use="required" /> + </xsd:complexType> + <xsd:complexType name="propertyType"> + <xsd:attribute name="name" type="xsd:string" use="required" /> + <xsd:attribute name="value" type="xsd:string" use="required" /> + </xsd:complexType> + <xsd:complexType name="imageType"> + <xsd:attribute name="imageset" type="xsd:string" use="required" /> + <xsd:attribute name="image" type="xsd:string" use="required" /> + </xsd:complexType> + <xsd:complexType name="frameImageType"> + <xsd:attribute name="type" type="frameImageComponentEnum" use="required" /> + <xsd:attribute name="imageset" type="xsd:string" use="required" /> + <xsd:attribute name="image" type="xsd:string" use="required" /> + </xsd:complexType> + <xsd:complexType name="componentAreaType"> + <xsd:choice> + <xsd:sequence> + <xsd:element name="Dim" type="dimensionType" minOccurs="4" maxOccurs="4" /> + </xsd:sequence> + <xsd:element name="AreaProperty" type="settingByPropertyType" /> + </xsd:choice> + </xsd:complexType> + <xsd:complexType name="dimensionType"> + <xsd:choice> + <xsd:element name="UnifiedDim" type="unifiedDimType" /> + <xsd:element name="AbsoluteDim" type="absoluteDimType" /> + <xsd:element name="ImageDim" type="imageDimType" /> + <xsd:element name="WidgetDim" type="widgetDimType" /> + <xsd:element name="FontDim" type="fontDimType" /> + <xsd:element name="PropertyDim" type="propertyDimType" /> + </xsd:choice> + <xsd:attribute name="type" type="dimensionTypeEnum" use="required" /> + </xsd:complexType> + <xsd:complexType name="fontDimType"> + <xsd:sequence> + <xsd:element name="DimOperator" type="dimensionOperatorType" minOccurs="0" maxOccurs="1" /> + </xsd:sequence> + <xsd:attribute name="widget" type="xsd:string" use="optional" default="" /> + <xsd:attribute name="font" type="xsd:string" use="optional" default="" /> + <xsd:attribute name="string" type="xsd:string" use="optional" default="" /> + <xsd:attribute name="type" type="fontMetricTypeEnum" use="required" /> + <xsd:attribute name="padding" type="xsd:decimal" use="optional" default="0" /> + </xsd:complexType> + <xsd:complexType name="propertyDimType"> + <xsd:sequence> + <xsd:element name="DimOperator" type="dimensionOperatorType" minOccurs="0" maxOccurs="1" /> + </xsd:sequence> + <xsd:attribute name="widget" type="xsd:string" use="optional" default="" /> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + <xsd:complexType name="unifiedDimType"> + <xsd:sequence> + <xsd:element name="DimOperator" type="dimensionOperatorType" minOccurs="0" maxOccurs="1" /> + </xsd:sequence> + <xsd:attribute name="scale" type="xsd:decimal" use="optional" default="0" /> + <xsd:attribute name="offset" type="xsd:integer" use="optional" default="0" /> + <xsd:attribute name="type" type="dimensionTypeEnum" use="required" /> + </xsd:complexType> + <xsd:complexType name="absoluteDimType"> + <xsd:sequence> + <xsd:element name="DimOperator" type="dimensionOperatorType" minOccurs="0" maxOccurs="1" /> + </xsd:sequence> + <xsd:attribute name="value" type="xsd:decimal" use="optional" default="0" /> + </xsd:complexType> + <xsd:complexType name="imageDimType"> + <xsd:sequence> + <xsd:element name="DimOperator" type="dimensionOperatorType" minOccurs="0" maxOccurs="1" /> + </xsd:sequence> + <xsd:attribute name="imageset" type="xsd:string" use="required" /> + <xsd:attribute name="image" type="xsd:string" use="required" /> + <xsd:attribute name="dimension" type="dimensionTypeEnum" use="required" /> + </xsd:complexType> + <xsd:complexType name="widgetDimType"> + <xsd:sequence> + <xsd:element name="DimOperator" type="dimensionOperatorType" minOccurs="0" maxOccurs="1" /> + </xsd:sequence> + <xsd:attribute name="widget" type="xsd:string" use="optional" default="" /> + <xsd:attribute name="dimension" type="dimensionTypeEnum" use="required" /> + </xsd:complexType> + <xsd:complexType name="settingByPropertyType"> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + <xsd:complexType name="colourRectType"> + <xsd:attribute name="topLeft" type="colourValType" use="required" /> + <xsd:attribute name="topRight" type="colourValType" use="required" /> + <xsd:attribute name="bottomLeft" type="colourValType" use="required" /> + <xsd:attribute name="bottomRight" type="colourValType" use="required" /> + </xsd:complexType> + <xsd:simpleType name="colourValType"> + <xsd:restriction base="xsd:string"> + <xsd:pattern value="[a-fA-F0-9]{8}" /> + </xsd:restriction> + </xsd:simpleType> + <xsd:complexType name="textStringType"> + <xsd:attribute name="string" type="xsd:string" use="optional" default="" /> + <xsd:attribute name="font" type="xsd:string" use="optional" default="" /> + </xsd:complexType> + <xsd:complexType name="textPropertyType"> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + <xsd:complexType name="fontPropertyType"> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + <xsd:complexType name="dimensionOperatorType"> + <xsd:choice> + <xsd:element name="UnifiedDim" type="unifiedDimType" /> + <xsd:element name="AbsoluteDim" type="absoluteDimType" /> + <xsd:element name="ImageDim" type="imageDimType" /> + <xsd:element name="WidgetDim" type="widgetDimType" /> + <xsd:element name="FontDim" type="fontDimType" /> + <xsd:element name="PropertyDim" type="propertyDimType" /> + </xsd:choice> + <xsd:attribute name="op" type="dimensionOperatorEnum" use="required" /> + </xsd:complexType> + <xsd:simpleType name="dimensionTypeEnum"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="LeftEdge" /> + <xsd:enumeration value="TopEdge" /> + <xsd:enumeration value="RightEdge" /> + <xsd:enumeration value="BottomEdge" /> + <xsd:enumeration value="XPosition" /> + <xsd:enumeration value="YPosition" /> + <xsd:enumeration value="Width" /> + <xsd:enumeration value="Height" /> + <xsd:enumeration value="XOffset" /> + <xsd:enumeration value="YOffset" /> + </xsd:restriction> + </xsd:simpleType> + <xsd:simpleType name="vertFormatEnum"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="TopAligned" /> + <xsd:enumeration value="CentreAligned" /> + <xsd:enumeration value="BottomAligned" /> + <xsd:enumeration value="Stretched" /> + <xsd:enumeration value="Tiled" /> + </xsd:restriction> + </xsd:simpleType> + <xsd:simpleType name="horzFormatEnum"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="LeftAligned" /> + <xsd:enumeration value="CentreAligned" /> + <xsd:enumeration value="RightAligned" /> + <xsd:enumeration value="Stretched" /> + <xsd:enumeration value="Tiled" /> + </xsd:restriction> + </xsd:simpleType> + <xsd:simpleType name="vertAlignmentEnum"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="TopAligned" /> + <xsd:enumeration value="CentreAligned" /> + <xsd:enumeration value="BottomAligned" /> + </xsd:restriction> + </xsd:simpleType> + <xsd:simpleType name="horzAlignmentEnum"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="LeftAligned" /> + <xsd:enumeration value="CentreAligned" /> + <xsd:enumeration value="RightAligned" /> + </xsd:restriction> + </xsd:simpleType> + <xsd:simpleType name="horzTextFormatEnum"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="LeftAligned" /> + <xsd:enumeration value="RightAligned" /> + <xsd:enumeration value="CentreAligned" /> + <xsd:enumeration value="Justified" /> + <xsd:enumeration value="WordWrapLeftAligned" /> + <xsd:enumeration value="WordWrapRightAligned" /> + <xsd:enumeration value="WordWrapCentreAligned" /> + <xsd:enumeration value="WordWrapJustified" /> + </xsd:restriction> + </xsd:simpleType> + <xsd:simpleType name="vertTextFormatEnum"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="TopAligned" /> + <xsd:enumeration value="BottomAligned" /> + <xsd:enumeration value="CentreAligned" /> + </xsd:restriction> + </xsd:simpleType> + <xsd:simpleType name="propertyTypeEnum"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="Generic" /> + </xsd:restriction> + </xsd:simpleType> + <xsd:simpleType name="fontMetricTypeEnum"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="LineSpacing" /> + <xsd:enumeration value="Baseline" /> + <xsd:enumeration value="HorzExtent" /> + </xsd:restriction> + </xsd:simpleType> + <xsd:simpleType name="dimensionOperatorEnum"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="Noop" /> + <xsd:enumeration value="Add" /> + <xsd:enumeration value="Subtract" /> + <xsd:enumeration value="Multiply" /> + <xsd:enumeration value="Divide" /> + </xsd:restriction> + </xsd:simpleType> + <xsd:simpleType name="frameImageComponentEnum"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="Background" /> + <xsd:enumeration value="TopLeftCorner" /> + <xsd:enumeration value="TopRightCorner" /> + <xsd:enumeration value="BottomLeftCorner" /> + <xsd:enumeration value="BottomRightCorner" /> + <xsd:enumeration value="LeftEdge" /> + <xsd:enumeration value="RightEdge" /> + <xsd:enumeration value="TopEdge" /> + <xsd:enumeration value="BottomEdge" /> + </xsd:restriction> + </xsd:simpleType> +</xsd:schema> Added: branches/ogsector/data/gui/schemes/Falagard.xsx =================================================================== --- branches/ogsector/data/gui/schemes/Falagard.xsx (rev 0) +++ branches/ogsector/data/gui/schemes/Falagard.xsx 2007-05-10 17:09:32 UTC (rev 452) @@ -0,0 +1,3 @@ +<?xml version="1.0" encoding="utf-8"?> +<!--This file is auto-generated by the XML Schema Designer. It holds layout information for components on the designer surface.--> +<XSDDesignerLayout /> \ No newline at end of file Added: branches/ogsector/data/gui/schemes/Font.xsd =================================================================== --- branches/ogsector/data/gui/schemes/Font.xsd (rev 0) +++ branches/ogsector/data/gui/schemes/Font.xsd 2007-05-10 17:09:32 UTC (rev 452) @@ -0,0 +1,34 @@ +<?xml version="1.0" ?> +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> + <xsd:element name="Font" type="FontType" /> + + <xsd:complexType name="FontType"> + <xsd:sequence> + <xsd:element name="Mapping" type="MapType" maxOccurs="unbounded" minOccurs="0" /> + </xsd:sequence> + <xsd:attributeGroup ref="FontAttrs" /> + </xsd:complexType> + <xsd:complexType name="MapType"> + <xsd:attribute name="Codepoint" type="xsd:nonNegativeInteger" use="required" /> + <xsd:attribute name="Image" type="xsd:string" use="required" /> + <xsd:attribute name="HorzAdvance" type="xsd:integer" use="optional" default="-1" /> + </xsd:complexType> + <xsd:attributeGroup name="FontAttrs"> + <xsd:attribute name="Name" type="xsd:string" use="required" /> + <xsd:attribute name="Filename" type="xsd:string" use="required" /> + <xsd:attribute name="ResourceGroup" type="xsd:string" use="optional" default="" /> + <xsd:attribute name="Type" use="required"> + <xsd:simpleType> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="FreeType" /> + <xsd:enumeration value="Pixmap" /> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + <xsd:attribute name="Size" type="xsd:nonNegativeInteger" use="optional" default="12" /> + <xsd:attribute name="NativeHorzRes" type="xsd:nonNegativeInteger" use="optional" default="640" /> + <xsd:attribute name="NativeVertRes" type="xsd:nonNegativeInteger" use="optional" default="480" /> + <xsd:attribute name="AutoScaled" type="xsd:boolean" use="optional" default="false" /> + <xsd:attribute name="AntiAlias" type="xsd:boolean" use="optional" default="true" /> + </xsd:attributeGroup> +</xsd:schema> Added: branches/ogsector/data/gui/schemes/GUIScheme.xsd =================================================================== --- branches/ogsector/data/gui/schemes/GUIScheme.xsd (rev 0) +++ branches/ogsector/data/gui/schemes/GUIScheme.xsd 2007-05-10 17:09:32 UTC (rev 452) @@ -0,0 +1,54 @@ +<?xml version="1.0" ?> +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> + <xsd:element name="GUIScheme" type="SchemeType" /> + <xsd:complexType name="SchemeType"> + <xsd:choice minOccurs="0" maxOccurs="unbounded"> + <xsd:element name="Imageset" type="NamedDataType" /> + <xsd:element name="ImagesetFromImage" type="NamedDataType" /> + <xsd:element name="Font" type="NamedDataType" /> + <xsd:element name="LookNFeel" type="FileDataType" /> + <xsd:element name="WindowSet" type="WindowSetType" /> + <xsd:element name="WindowRendererSet" type="WindowRendererSetType" /> + <xsd:element name="WindowAlias" type="WindowAliasType" /> + <xsd:element name="FalagardMapping" type="FalagardMapType" /> + </xsd:choice> + <xsd:attribute name="Name" type="xsd:string" use="required" /> + </xsd:complexType> + <xsd:complexType name="WindowSetType"> + <xsd:sequence> + <xsd:element name="WindowFactory" type="WindowFactoryType" minOccurs="0" maxOccurs="unbounded" /> + </xsd:sequence> + <xsd:attribute name="Filename" type="xsd:string" use="required" /> + </xsd:complexType> + <xsd:complexType name="WindowRendererSetType"> + <xsd:sequence> + <xsd:element name="WindowRendererFactory" type="WindowRendererFactoryType" minOccurs="0" maxOccurs="unbounded" /> + </xsd:sequence> + <xsd:attribute name="Filename" type="xsd:string" use="required" /> + </xsd:complexType> + <xsd:complexType name="FileDataType"> + <xsd:attribute name="Filename" type="xsd:string" use="required" /> + <xsd:attribute name="ResourceGroup" type="xsd:string" use="optional" default="" /> + </xsd:complexType> + <xsd:complexType name="NamedDataType"> + <xsd:attribute name="Name" type="xsd:string" use="required" /> + <xsd:attribute name="Filename" type="xsd:string" use="required" /> + <xsd:attribute name="ResourceGroup" type="xsd:string" use="optional" default="" /> + </xsd:complexType> + <xsd:complexType name="WindowFactoryType"> + <xsd:attribute name="Name" type="xsd:string" use="required" /> + </xsd:complexType> + <xsd:complexType name="WindowRendererFactoryType"> + <xsd:attribute name="Name" type="xsd:string" use="required" /> + </xsd:complexType> + <xsd:complexType name="WindowAliasType"> + <xsd:attribute name="Alias" type="xsd:string" use="required" /> + <xsd:attribute name="Target" type="xsd:string" use="required" /> + </xsd:complexType> + <xsd:complexType name="FalagardMapType"> + <xsd:attribute name="WindowType" type="xsd:string" use="required" /> + <xsd:attribute name="TargetType" type="xsd:string" use="required" /> + <xsd:attribute name="Renderer" type="xsd:string" use="required" /> + <xsd:attribute name="LookNFeel" type="xsd:string" use="required" /> + </xsd:complexType> +</xsd:schema> Added: branches/ogsector/data/gui/schemes/Imageset.xsd =================================================================== --- branches/ogsector/data/gui/schemes/Imageset.xsd (rev 0) +++ branches/ogsector/data/gui/schemes/Imageset.xsd 2007-05-10 17:09:32 UTC (rev 452) @@ -0,0 +1,28 @@ +<?xml version="1.0"?> +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> + + <xsd:element name="Imageset" type="ImagesetType"/> + + <xsd:complexType name="ImagesetType"> + <xsd:sequence> + <xsd:element name="Image" type="ImageType" maxOccurs="unbounded"/> + </xsd:sequence> + <xsd:attribute name="Imagefile" type="xsd:string" use="required"/> + <xsd:attribute name="ResourceGroup" type="xsd:string" use="optional" default="" /> + <xsd:attribute name="Name" type="xsd:string" use="required"/> + <xsd:attribute name="NativeHorzRes" type="xsd:nonNegativeInteger" use="optional" default="640" /> + <xsd:attribute name="NativeVertRes" type="xsd:nonNegativeInteger" use="optional" default="480" /> + <xsd:attribute name="AutoScaled" type="xsd:boolean" use="optional" default="false" /> + </xsd:complexType> + + <xsd:complexType name="ImageType"> + <xsd:attribute name="Name" type="xsd:string" use="required"/> + <xsd:attribute name="XPos" type="xsd:nonNegativeInteger" use="required"/> + <xsd:attribute name="YPos" type="xsd:nonNegativeInteger" use="required"/> + <xsd:attribute name="Width" type="xsd:nonNegativeInteger" use="required"/> + <xsd:attribute name="Height" type="xsd:nonNegativeInteger" use="required"/> + <xsd:attribute name="XOffset" type="xsd:integer" use="optional" default="0"/> + <xsd:attribute name="YOffset" type="xsd:integer" use="optional" default="0"/> + </xsd:complexType> + +</xsd:schema> Added: branches/ogsector/data/gui/schemes/opengate/opengate.imageset =================================================================== --- branches/ogsector/data/gui/schemes/opengate/opengate.imageset (rev 0) +++ branches/ogsector/data/gui/schemes/opengate/opengate.imageset 2007-05-10 17:09:32 UTC (rev 452) @@ -0,0 +1,224 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Imageset Name="opengate" Imagefile="opengate.png"> + <Image Name="AltProgressLeft" XPos="10" YPos="10" Width="10" Height="10" /> + <Image Name="AltProgressMiddle" XPos="20" YPos="10" Width="10" Height="10" /> + <Image Name="AltProgressRight" XPos="30" YPos="10" Width="10" Height="10" /> + <Image Name="AltProgressHalf" XPos="10" YPos="10" Width="10" Height="10" /> + <Image Name="AltProgressLight1" XPos="10" YPos="10" Width="10" Height="10" /> + <Image Name="AltProgressLight10" XPos="10" YPos="10" Width="10" Height="10" /> + <Image Name="AltProgressLight2" XPos="10" YPos="10" Width="10" Height="10" /> + <Image Name="AltProgressLight3" XPos="10" YPos="10" Width="10" Height="10" /> + <Image Name="AltProgressLight4" XPos="10" YPos="10" Width="10" Height="10" /> + <Image Name="AltProgressLight5" XPos="10" YPos="10" Width="10" Height="10" /> + <Image Name="AltProgressLight6" XPos="10" YPos="10" Width="10" Height="10" /> + <Image Name="AltProgressLight7" XPos="10" YPos="10" Width="10" Height="10" /> + <Image Name="AltProgressLight8" XPos="10" YPos="10" Width="10" Height="10" /> + <Image Name="AltProgressLight9" XPos="10" YPos="10" Width="10" Height="10" /> + <Image Name="AltProgressQuarter" XPos="10" YPos="10" Width="10" Height="10" /> + <Image Name="ButtonLeftHighlight" XPos="91" YPos="9" Width="8" Height="26" /> + <Image Name="ButtonMiddleHighlight" XPos="97" YPos="9" Width="5" Height="26" /> + <Image Name="ButtonRightHighlight" XPos="100" YPos="9" Width="8" Height="26" /> + <Image Name="ButtonLeftNormal" XPos="73" YPos="9" Width="8" Height="26" /> + <Image Name="ButtonMiddleNormal" XPos="82" YPos="9" Width="2" Height="26" /> + <Image Name="ButtonRightNormal" XPos="82" YPos="9" Width="8" Height="26" /> + <Image Name="ButtonLeftPushed" XPos="109" YPos="9" Width="8" Height="26" /> + <Image Name="ButtonMiddlePushed" XPos="115" YPos="9" Width="4" Height="26" /> + <Image Name="ButtonRightPushed" XPos="118" YPos="9" Width="8" Height="26" /> + <Image Name="CheckboxHover" XPos="100" YPos="79" Width="12" Height="12" /> + <Image Name="CheckboxMark" XPos="119" YPos="79" Width="12" Height="12" /> + <Image Name="CheckboxNormal" XPos="77" YPos="79" Width="12" Height="12" /> + <Image Name="ClientBrush" XPos="20" YPos="34" Width="29" Height="22" /> + <Image Name="CloseButtonHover" XPos="35" YPos="166" Width="14" Height="14" /> + <Image Name="CloseButtonNormal" XPos="20" YPos="166" Width="14" Height="14" /> + <Image Name="CloseButtonPressed" XPos="50" YPos="166" Width="14" Height="14" /> + <Image Name="ComboboxDividerLeft" XPos="10" YPos="10" Width="10" Height="10" /> + <Image Name="ComboboxDividerMiddle" XPos="20" YPos="10" Width="10" Height="10" /> + <Image Name="ComboboxDividerRight" XPos="30" YPos="10" Width="10" Height="10" /> + <Image Name="ComboboxEditLeft" XPos="153" YPos="11" Width="7" Height="23" /> + <Image Name="ComboboxEditMiddle" XPos="164" YPos="11" Width="8" Height="23" /> + <Image Name="ComboboxListTopLeft" XPos="175" YPos="103" Width="7" Height="7" /> + <Image Name="ComboboxListTop" XPos="183" YPos="103" Width="30" Height="4" /> + <Image Name="ComboboxListTopRight" XPos="214" YPos="103" Width="3" Height="3" /> + <Image Name="ComboboxListLeft" XPos="175" YPos="110" Width="4" Height="30" /> + <Image Name="ComboboxListBackdrop" XPos="181" YPos="109" Width="10" Height="10" /> + <Image Name="ComboboxListRight" XPos="214" YPos="105" Width="3" Height="38" /> + <Image Name="ComboboxListBottomLeft" XPos="175" YPos="144" Width="3" Height="3" /> + <Image Name="ComboboxListBottom" XPos="178" YPos="144" Width="36" Height="3" /> + <Image Name="ComboboxListBottomRight" XPos="214" YPos="144" Width="3" Height="3" /> + <Image Name="ComboboxListButtonHover" XPos="91" YPos="39" Width="16" Height="26" /> + <Image Name="ComboboxListButtonNormal" XPos="73" YPos="39" Width="16" Height="26" /> + <Image Name="ComboboxSelectionBrush" XPos="178" YPos="132" Width="36" Height="5" /> + <Image Name="EditBoxLeft" XPos="153" YPos="11" Width="11" Height="23" /> + <Image Name="EditBoxMiddle" XPos="178" YPos="11" Width="10" Height="23" /> + <Image Name="EditBoxRight" XPos="201" YPos="11" Width="10" Height="23" /> + <Image Name="EditBoxCarat" XPos="217" YPos="16" Width="1" Height="12" /> + <Image Name="HeaderBarBackdropHover" XPos="1" YPos="132" Width="10" Height="14" /> + <Image Name="HeaderBarBackdropNormal" XPos="1" YPos="116" Width="10" Height="14" /> + <Image Name="HeaderBarSortDown" XPos="56" YPos="117" Width="7" Height="6" /> + <Image Name="HeaderBarSortUp" XPos="65" YPos="118" Width="6" Height="5" /> + <Image Name="HeaderBarSplitterHover" XPos="66" YPos="127" Width="3" Height="16" /> + <Image Name="HeaderBarSplitterNormal" XPos="58" YPos="127" Width="3" Height="16" /> + <Image Name="HorzSliderBody" XPos="151" YPos="168" Width="6" Height="10" /> + <Image Name="HorzSliderThumbHover" XPos="145" YPos="163" Width="6" Height="21" /> + <Image Name="HorzSliderThumbNormal" XPos="137" YPos="163" Width="6" Height="21" /> + <Image Name="ListboxTopLeft" XPos="175" YPos="103" Width="7" Height="7" /> + <Image Name="ListboxTop" XPos="183" YPos="103" Width="30" Height="4" /> + <Image Name="ListboxTopRight" XPos="214" YPos="103" Width="3" Height="3" /> + <Image Name="ListboxLeft" XPos="175" YPos="110" Width="4" Height="30" /> + <Image Name="ListboxBackdrop" XPos="181" YPos="109" Width="10" Height="10" /> + <Image Name="ListboxRight" XPos="214" YPos="105" Width="3" Height="38" /> + <Image Name="ListboxBottomLeft" XPos="175" YPos="144" Width="3" Height="3" /> + <Image Name="ListboxBottom" XPos="178" YPos="144" Width="36" Height="3" /> + <Image Name="ListboxBottomRight" XPos="214" YPos="144" Width="3" Height="3" /> + <Image Name="ListboxSelectionBrush" XPos="179" YPos="132" Width="34" Height="5" /> + <Image Name="MiniHorzScrollBarSegment" XPos="82" YPos="20" Width="10" Height="10" /> + <Image Name="MiniHorzScrollLeftHover" XPos="72" YPos="212" Width="16" Height="16" /> + <Image Name="MiniHorzScrollLeftNormal" XPos="72" YPos="192" Width="16" Height="16" /> + <Image Name="MiniHorzScrollRightHover" XPos="119" YPos="212" Width="16" Height="16" /> + <Image Name="MiniHorzScrollRightNormal" XPos="119" YPos="192" Width="16" Height="16" /> + <Image Name="MiniHorzScrollThumbHover" XPos="93" YPos="212" Width="20" Height="16" /> + <Image Name="MiniHorzScrollThumbLeftHover" XPos="93" YPos="212" Width="2" Height="16" /> + <Image Name="MiniHorzScrollThumbMiddleHover" XPos="100" YPos="212" Width="3" Height="16" /> + <Image Name="MiniHorzScrollThumbRightHover" XPos="111" YPos="212" Width="2" Height="16" /> + <Image Name="MiniHorzScrollThumbNormal" XPos="93" YPos="192" Width="20" Height="16" /> + <Image Name="MiniHorzScrollThumbLeftNormal" XPos="93" YPos="192" Width="2" Height="16" /> + <Image Name="MiniHorzScrollThumbMiddleNormal" XPos="98" YPos="192" Width="3" Height="16" /> + <Image Name="MiniHorzScrollThumbRightNormal" XPos="111" YPos="192" Width="2" Height="16" /> + <Image Name="MiniVertScrollBarSegment" XPos="134" YPos="17" Width="12" Height="10" /> + <Image Name="MiniVertScrollDownHover" XPos="96" YPos="167" Width="16" Height="16" /> + <Image Name="MiniVertScrollDownNormal" XPos="76" YPos="167" Width="16" Height="16" /> + <Image Name="MiniVertScrollThumbHover" XPos="96" YPos="141" Width="16" Height="20" /> + <Image Name="MiniVertScrollThumbTopHover" XPos="96" YPos="141" Width="16" Height="2" /> + <Image Name="MiniVertScrollThumbMiddleHover" XPos="96" YPos="148" Width="16" Height="1" /> + <Image Name="MiniVertScrollThumbBottomHover" XPos="96" YPos="159" Width="16" Height="2" /> + <Image Name="MiniVertScrollThumbNormal" XPos="76" YPos="141" Width="16" Height="20" /> + <Image Name="MiniVertScrollThumbTopNormal" XPos="76" YPos="141" Width="16" Height="2" /> + <Image Name="MiniVertScrollThumbMiddleNormal" XPos="76" YPos="151" Width="16" Height="2" /> + <Image Name="MiniVertScrollThumbBottomNormal" XPos="76" YPos="159" Width="16" Height="2" /> + <Image Name="MiniVertScrollUpHover" XPos="96" YPos="120" Width="16" Height="16" /> + <Image Name="MiniVertScrollUpNormal" XPos="76" YPos="120" Width="16" Height="16" /> + <Image Name="MouseArrow" XPos="10" YPos="79" Width="17" Height="18" /> + <Image Name="MouseEsWeCursor" XPos="9" YPos="104" Width="19" Height="13" /> + <Image Name="MouseMoveCursor" XPos="8" YPos="142" Width="19" Height="19" /> + <Image Name="MouseNeSwCursor" XPos="34" YPos="123" Width="12" Height="12" /> + <Image Name="MouseNoSoCursor" XPos="34" YPos="101" Width="13" Height="19" /> + <Image Name="MouseNwSeCursor" XPos="12" YPos="123" Width="12" Height="12" /> + <Image Name="MouseTarget" XPos="36" YPos="145" Width="14" Height="14" /> + <Image Name="MouseTextBar" XPos="37" YPos="83" Width="6" Height="14" /> + <Image Name="MultiLineEditboxTopLeft" XPos="175" YPos="103" Width="7" Height="7" /> + <Image Name="MultiLineEditboxTop" XPos="183" YPos="103" Width="30" Height="4" /> + <Image Name="MultiLineEditboxTopRight" XPos="214" YPos="103" Width="3" Height="3" /> + <Image Name="MultiLineEditboxLeft" XPos="175" YPos="110" Width="4" Height="30" /> + <Image Name="MultiLineEditboxBackdrop" XPos="181" YPos="109" Width="10" Height="10" /> + <Image Name="MultiLineEditboxRight" XPos="214" YPos="105" Width="3" Height="38" /> + <Image Name="MultiLineEditboxBottomLeft" XPos="175" YPos="144" Width="3" Height="3" /> + <Image Name="MultiLineEditboxBottom" XPos="178" YPos="144" Width="36" Height="3" /> + <Image Name="MultiLineEditboxBottomRight" XPos="214" YPos="144" Width="3" Height="3" /> + <Image Name="MultiLineEditboxSelectionBrush" XPos="179" YPos="132" Width="34" Height="5" /> + <Image Name="MultiListTopLeft" XPos="175" YPos="103" Width="7" Height="7" /> + <Image Name="MultiListTop" XPos="183" YPos="103" Width="30" Height="4" /> + <Image Name="MultiListTopRight" XPos="214" YPos="103" Width="3" Height="3" /> + <Image Name="MultiListLeft" XPos="175" YPos="110" Width="4" Height="30" /> + <Image Name="MultiListBackdrop" XPos="181" YPos="109" Width="10" Height="10" /> + <Image Name="MultiListRight" XPos="214" YPos="105" Width="3" Height="38" /> + <Image Name="MultiListBottomLeft" XPos="175" YPos="144" Width="3" Height="3" /> + <Image Name="MultiListBottom" XPos="178" YPos="144" Width="36" Height="3" /> + <Image Name="MultiListBottomRight" XPos="214" YPos="144" Width="3" Height="3" /> + <Image Name="MultiListSelectionBrush" XPos="178" YPos="132" Width="36" Height="5" /> + <Image Name="SysAreaMiddle" XPos="44" YPos="8" Width="9" Height="22" /> + <Image Name="SysAreaRight" XPos="55" YPos="8" Width="11" Height="22" /> + <Image Name="ProgressBarLeft" XPos="155" YPos="43" Width="5" Height="17" /> + <Image Name="ProgressBarMiddle" XPos="175" YPos="43" Width="12" Height="17" /> + <Image Name="ProgressBarRight" XPos="216" YPos="43" Width="5" Height="17" /> + <Image Name="ProgressBarDimSegment" XPos="150" YPos="110" Width="11" Height="11" /> + <Image Name="ProgressBarLitSegment" XPos="164" YPos="47" Width="10" Height="10" /> + <Image Name="RadioButtonHover" XPos="100" YPos="98" Width="12" Height="12" /> + <Image Name="RadioButtonMark" XPos="120" YPos="98" Width="12" Height="12" /> + <Image Name="RadioButtonNormal" XPos="77" YPos="98" Width="12" Height="12" /> + <Image Name="StaticTopLeft" XPos="11" YPos="11" Width="3" Height="3" /> + <Image Name="StaticTop" XPos="15" YPos="11" Width="45" Height="3" /> + <Image Name="StaticTopRight" XPos="60" YPos="11" Width="3" Height="3" /> + <Image Name="StaticLeft" XPos="11" YPos="15" Width="3" Height="11" /> + <Image Name="StaticBackdrop" XPos="13" YPos="13" Width="3" Height="3" /> + <Image Name="StaticRight" XPos="60" YPos="14" Width="3" Height="11" /> + <Image Name="StaticBottomLeft" XPos="11" YPo... [truncated message content] |
From: <spo...@us...> - 2007-05-11 20:10:32
|
Revision: 456 http://svn.sourceforge.net/opengate/?rev=456&view=rev Author: spom_spom Date: 2007-05-11 13:10:32 -0700 (Fri, 11 May 2007) Log Message: ----------- Fix: some minors Modified Paths: -------------- branches/ogsector/resources.cfg branches/ogsector/runClient.sh branches/ogsector/src/GameState.h branches/ogsector/src/GameStateManager.cpp branches/ogsector/src/Sector.cpp branches/ogsector/src/SectorObjects.cpp branches/ogsector/src/SectorObjects.h branches/ogsector/src/opengateclient.cpp Modified: branches/ogsector/resources.cfg =================================================================== --- branches/ogsector/resources.cfg 2007-05-10 21:24:04 UTC (rev 455) +++ branches/ogsector/resources.cfg 2007-05-11 20:10:32 UTC (rev 456) @@ -7,27 +7,24 @@ FileSystem=./data FileSystem=./data/materials FileSystem=./data/textures +FileSystem=./data/gui/ +FileSystem=./data/gui/layouts/ FileSystem=./data/gui/schemes/ -FileSystem=./data/gui/schemes/sleekspace FileSystem=./data/gui/schemes/opengate -FileSystem=./data/gui/layouts/ -FileSystem=./data/local -FileSystem=./data/local/astro/ -FileSystem=./data/local/station/ +#FileSystem=./data/local +#FileSystem=./data/local/astro/ +#FileSystem=./data/local/station/ Zip=./data/simpleSkybox.zip -#Zip=./data/skybox_512.zip -#Zip=./data/skybox_1024.zip -#Zip=./data/skybox_2048.zip -#Zip=./data/skybox_4096.zip Zip=./data/fonts.zip # FileSystem=./data/MediaFromOgre -FileSystem=./data/MediaFromOgre/AdvancedMaterials/ +#FileSystem=./data/MediaFromOgre/AdvancedMaterials/ # FileSystem=../../trunk/data/ FileSystem=../../trunk/data/ships/octavius/apteryx FileSystem=../../trunk/data/ships/quantar/storm -FileSystem=../../trunk/data/ships/tauseti/lady_kickstart/ +FileSystem=../../trunk/data/ships/tauseti/lady_kickstart +FileSystem=../../trunk/data/stations/tauseti #FileSystem=../../trunk/data/GUI #FileSystem=../../trunk/data/client/data1.x/ #FileSystem=../../trunk/data/client/data1.x/GUI Modified: branches/ogsector/runClient.sh =================================================================== --- branches/ogsector/runClient.sh 2007-05-10 21:24:04 UTC (rev 455) +++ branches/ogsector/runClient.sh 2007-05-11 20:10:32 UTC (rev 456) @@ -13,4 +13,3 @@ echo "starting client for user: $USERNAME and looking for host: $HOSTNAME" ./src/opengateclient $USERNAME $HOSTNAME --ogreconfig=0 -#./src/ogsectorclient $USERNAME $HOSTNAME --ogreconfig=0 Modified: branches/ogsector/src/GameState.h =================================================================== --- branches/ogsector/src/GameState.h 2007-05-10 21:24:04 UTC (rev 455) +++ branches/ogsector/src/GameState.h 2007-05-11 20:10:32 UTC (rev 456) @@ -45,7 +45,7 @@ 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; + virtual GameState * findByName( const std::string & stateName) = 0; /** Request a change to state. */ virtual void changeGameState( GameState * state ) = 0; @@ -133,7 +133,7 @@ virtual ~GameState( ) {}; /** Find a state by its name. */ - GameState * findByName( const std::string & state_name ) { parent_->findByName(state_name); } + GameState * findByName( const std::string & stateName ) { return parent_->findByName( stateName ); } /** Request a change to game state. */ void changeGameState( GameState *state ) { parent_->changeGameState( state ); } Modified: branches/ogsector/src/GameStateManager.cpp =================================================================== --- branches/ogsector/src/GameStateManager.cpp 2007-05-10 21:24:04 UTC (rev 455) +++ branches/ogsector/src/GameStateManager.cpp 2007-05-11 20:10:32 UTC (rev 456) @@ -28,8 +28,18 @@ #include "VesselManager.h" +#include <OgreFrameListener.h> namespace OpenGate { +// class TestFrameListener : public Ogre::FrameListener { +// public: +// SimpleFrameListener() { } +// bool frameStarted(const Ogre::FrameEvent& evt) { return true; } +// bool frameEnded(const Ogre::FrameEvent& evt) { return true; } +// private: +// }; + + class NetworkClient; GameStateManager::GameStateManager( NetworkClient & nw, bool dialog ) { @@ -49,6 +59,26 @@ initialiseDevices_( dialog ); + //** start for test purposes +// shutdownRequest_ = false; +// Ogre::SceneManager* sceneMgr = devices_.ogreRoot->createSceneManager(Ogre::ST_GENERIC); +// Ogre::Camera* camera = sceneMgr->createCamera("SimpleCamera"); +// Ogre::Viewport* viewPort = devices_.renderWindow->addViewport(camera); +// SimpleFrameListener* frameListener = new SimpleFrameListener( ); +// devices_.ogreRoot->addFrameListener(frameListener); +// camera->setPosition( Ogre::Vector3( 0, 0, 200 ) ); +// camera->lookAt( Ogre::Vector3( 0, 0, -300 ) ); +// camera->setNearClipDistance( 1 ); +// sceneMgr->setAmbientLight( Ogre::ColourValue(0.5, 0.5, 0.5) ); +// // sceneMgr->setSkyBox( true, "Examples/SpaceSkyBox", 100 ); +// Ogre::SceneNode * mainNode = static_cast< Ogre::SceneNode * >( sceneMgr->getRootSceneNode()->createChild() ); +// Ogre::Entity * shape = sceneMgr->createEntity( "ogrehead", "ogrehead.mesh" ); +// mainNode->attachObject( shape ); +// while(1){ +// // devices_.ogreRoot->startRendering(); +// devices_.ogreRoot->renderOneFrame( ); +// } + //** end just for test purposes } GameStateManager::~GameStateManager( ){ @@ -96,13 +126,15 @@ while ( !shutdownRequest_ ){ devices_.inputManager->capture(); - + + Ogre::WindowEventUtilities::messagePump(); + #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 { MSG msg; while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { if (msg.message == WM_QUIT){ - Shutdown(); + shutdown(); } else { // TranslateMessage(&msg); // DispatchMessage(&msg); Modified: branches/ogsector/src/Sector.cpp =================================================================== --- branches/ogsector/src/Sector.cpp 2007-05-10 21:24:04 UTC (rev 455) +++ branches/ogsector/src/Sector.cpp 2007-05-11 20:10:32 UTC (rev 456) @@ -180,9 +180,9 @@ Ogre::Real( 500.0 ), Ogre::Degree( 0.0 ) ); -// createStaticObject( Ogre::String("Mesh.004.mesh"), +// createStaticObject( Ogre::String("tauseti_wake.mesh"), // "Tauseti - Wake", -// Ogre::Vector3( 0, 0, -5000 ), +// Ogre::Vector3( 0, 0, 5000 ), // Ogre::Real( 1000.0 ), // Ogre::Degree( 00.0 ) ); Modified: branches/ogsector/src/SectorObjects.cpp =================================================================== --- branches/ogsector/src/SectorObjects.cpp 2007-05-10 21:24:04 UTC (rev 455) +++ branches/ogsector/src/SectorObjects.cpp 2007-05-11 20:10:32 UTC (rev 456) @@ -157,7 +157,7 @@ : BaseObject( name, sector, userID, childID ) { isOnRadar_ = false; - mainNodeEntity = mainNode_->createChildSceneNode( name_ + "_transform" ); + mainNodeEntity_ = mainNode_->createChildSceneNode( name_ + "_transform" ); baseSize_ = 0.0; selectable_ = true; } @@ -166,14 +166,14 @@ sector_->collisionContext()->destroyObject( collObj_ ); OgreOpcode::CollisionManager::getSingletonPtr()->destroyShape( collObj_->getShape() ); - mainNodeEntity->detachObject( entity ); - sceneMgr_->destroyEntity( entity ); - mainNode_->removeAndDestroyChild( mainNodeEntity->getName() ); + mainNodeEntity_->detachObject( entity_ ); + sceneMgr_->destroyEntity( entity_ ); + mainNode_->removeAndDestroyChild( mainNodeEntity_->getName() ); } void SectorObject::setShape( const Ogre::String & meshname ){ - entity = sceneMgr_->createEntity( name_ + "_shape", meshname ); - mainNodeEntity->attachObject( entity ); + entity_ = sceneMgr_->createEntity( name_ + "_shape", meshname ); + mainNodeEntity_->attachObject( entity_ ); OgreOpcode::EntityCollisionShape * collShape = OgreOpcode::CollisionManager::getSingletonPtr()->createEntityCollisionShape( name_ + "CollShape" ); collShape->load( this->shape() ); @@ -187,9 +187,9 @@ } void SectorObject::setBaseSize( Ogre::Real targetSize ){ - Ogre::Real scale = targetSize / ( entity->getBoundingBox().getMaximum()[ 0 ] - - entity->getBoundingBox().getMinimum()[ 0 ] ); - mainNodeEntity->scale( scale, scale, scale ); + Ogre::Real scale = targetSize / ( entity_->getBoundingBox().getMaximum()[ 0 ] + - entity_->getBoundingBox().getMinimum()[ 0 ] ); + mainNodeEntity_->scale( scale, scale, scale ); baseSize_ = targetSize; } Modified: branches/ogsector/src/SectorObjects.h =================================================================== --- branches/ogsector/src/SectorObjects.h 2007-05-10 21:24:04 UTC (rev 455) +++ branches/ogsector/src/SectorObjects.h 2007-05-11 20:10:32 UTC (rev 456) @@ -50,6 +50,7 @@ virtual Ogre::Vector3 velDirection() const = 0; bool selectable() const { return selectable_ ;} + void setSelectable( bool selectable ) { selectable_ = selectable; } protected: @@ -112,13 +113,13 @@ virtual bool update( Ogre::Real elapsedTime ){ return true; } - void baseYaw( Ogre::Degree yaw ) { mainNodeEntity->yaw( yaw ); } + void baseYaw( Ogre::Degree yaw ) { mainNodeEntity_->yaw( yaw ); } void setShape( const Ogre::String & meshname ); void setShape( Ogre::MeshPtr & mesh ); - Ogre::Entity * shape(){ return entity; } + Ogre::Entity * shape(){ return entity_; } void setBaseSize( Ogre::Real targetSize ); @@ -131,8 +132,8 @@ protected: - Ogre::SceneNode * mainNodeEntity; // Main character node - Ogre::Entity * entity; + Ogre::SceneNode * mainNodeEntity_; // Main character node + Ogre::Entity * entity_; bool isOnRadar_; double baseSize_; @@ -178,7 +179,7 @@ } // Change visibility - Useful for 1st person view - inline void setVisible( bool visible ) { mainNodeEntity->setVisible( visible ); } + inline void setVisible( bool visible ) { mainNodeEntity_->setVisible( visible ); } void updateThruster(); Modified: branches/ogsector/src/opengateclient.cpp =================================================================== --- branches/ogsector/src/opengateclient.cpp 2007-05-10 21:24:04 UTC (rev 455) +++ branches/ogsector/src/opengateclient.cpp 2007-05-11 20:10:32 UTC (rev 456) @@ -60,10 +60,8 @@ try { OpenGate::GameStateManager gameStateMgr( nw, dialog ); OpenGate::DockedState::create( &gameStateMgr, "DockedState" ); - // OpenGate::UnDockedState::create( &gameStateMgr, "UnDockedState" ); - + OpenGate::UnDockedState::create( &gameStateMgr, "UnDockedState" ); gameStateMgr.start( gameStateMgr.findByName( "DockedState" ) ); - } catch( Ogre::Exception& e ) { #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2007-05-19 15:46:19
|
Revision: 480 http://svn.sourceforge.net/opengate/?rev=480&view=rev Author: spom_spom Date: 2007-05-19 08:46:19 -0700 (Sat, 19 May 2007) Log Message: ----------- Improved console, add console commands: /quit /help /time /ai. Removed F12 for spawn use /ai instead. Modified Paths: -------------- branches/ogsector/ToDo branches/ogsector/data/gui/layouts/dialogs/ShipConfigDialog.layout branches/ogsector/data/gui/layouts/opengateDocked.layout branches/ogsector/data/gui/schemes/opengate/opengate.imageset branches/ogsector/data/gui/schemes/opengate/opengate.png branches/ogsector/data/gui/schemes/opengate/opengate.scheme branches/ogsector/data/gui/schemes/opengate/opengateButtons.looknfeel branches/ogsector/data/gui/schemes/opengate/opengateScroll.looknfeel branches/ogsector/data/gui/schemes/opengate/opengateStatic.looknfeel branches/ogsector/data/simpleHUD.overlay branches/ogsector/runServer.sh branches/ogsector/src/DockedState.cpp branches/ogsector/src/DockedState.h branches/ogsector/src/GameState.h branches/ogsector/src/GameStateManager.cpp branches/ogsector/src/GameStateManager.h branches/ogsector/src/LogManager.cpp branches/ogsector/src/LogManager.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/ShipConfigDialog.cpp branches/ogsector/src/ShipConfigDialog.h branches/ogsector/src/UnDockedState.cpp branches/ogsector/src/UnDockedState.h branches/ogsector/src/VesselManager.h branches/ogsector/src/common.cpp branches/ogsector/src/common.h branches/ogsector/src/networkClient.cpp branches/ogsector/src/networkServer.cpp branches/ogsector/src/networkServer.h branches/ogsector/src/opengateserver.cpp Added Paths: ----------- branches/ogsector/data/gui/layouts/opengateConsole.layout branches/ogsector/data/gui/layouts/opengateUnDocked.layout branches/ogsector/data/gui/schemes/opengate/opengateLists.looknfeel branches/ogsector/src/Console.cpp branches/ogsector/src/Console.h Removed Paths: ------------- branches/ogsector/data/gui/schemes/opengate/textures/scrollbar/ branches/ogsector/src/ogconsole.cpp branches/ogsector/src/ogconsole.h Modified: branches/ogsector/ToDo =================================================================== --- branches/ogsector/ToDo 2007-05-19 12:21:50 UTC (rev 479) +++ branches/ogsector/ToDo 2007-05-19 15:46:19 UTC (rev 480) @@ -146,4 +146,8 @@ - Spieler kann sich mit geeignetem Scanner eine eigene Datenbank von Astro erstellen die ingame abgerufen werden kann, f\xFCr jeden neuen Eintrag gibt es exp(nach Mission/Seltenheit/Gefahrenbereich) - das erleichtert das Leben (kein Papierkram) und sorgt f\xFCr spielerentropie - -Leuchtfeuer, manuel und als sectorobject \ No newline at end of file + -Leuchtfeuer, manuel und als sectorobject + + -Fire: Funke, Brand, Leuchtfeuer, Phoenix, Fl\xE4chenbrand, Feuerball, Hephaistos, Vulkanus, Hitze, Flamme, Sonne, Plasma, Hestia = (griech.) G\xF6ttin des Herdfeuers, Loki = (germ.) Gott des Feuers, Pele = (polyn.) G\xF6ttin der Vulkane und des Feuers, Asche + + -Wave: Brandung,Tsunami,Kr\xE4usel, Rayleigh waves, Love wave, Gicht, Monsterwelle, Aegir = (germ.) Gott des Meeres,Poseidon = (griech.) Gott des Wassers und Meeres, Sedna = (innuit) G\xF6ttin des Meeres, Woge, Brecher, D\xFCnung, Seegang, See, Wellenschlag, Ebbe, Flut, Str\xF6mung, leises Pl\xE4tschern, Modified: branches/ogsector/data/gui/layouts/dialogs/ShipConfigDialog.layout =================================================================== --- branches/ogsector/data/gui/layouts/dialogs/ShipConfigDialog.layout 2007-05-19 12:21:50 UTC (rev 479) +++ branches/ogsector/data/gui/layouts/dialogs/ShipConfigDialog.layout 2007-05-19 15:46:19 UTC (rev 480) @@ -1,7 +1,7 @@ <?xml version="1.0" ?> <GUILayout> <Window Type="opengate/FrameWindow" Name="ShipConfigDialog"> - <Property Name="UnifiedPosition" Value="{{0.15,0},{0.1,0}}" /> + <Property Name="UnifiedPosition" Value="{{0.15,0},{0.15,0}}" /> <Property Name="UnifiedSize" Value="{{0.7,0},{0.7,0}}" /> <Property Name="SizingEnabled" Value="false" /> @@ -52,11 +52,11 @@ <Property Name="UnifiedSize" Value="{{0.4,0},{ 0.4,0}}" /> <Property Name="Alpha" Value="1.0" /> </Window> - <Window Type="opengate/HorizontalScrollbarLeftThumb" Name="ShipConfigDialog/PrevShip"> + <Window Type="opengate/HorizontalScrollLeftButton" Name="ShipConfigDialog/PrevShip"> <Property Name="UnifiedPosition" Value="{{0.1,0},{0.7,+10}}" /> <Property Name="UnifiedSize" Value="{{0.0,56},{ 0.0,14}}" /> </Window> - <Window Type="opengate/HorizontalScrollbarRightThumb" Name="ShipConfigDialog/NextShip"> + <Window Type="opengate/HorizontalScrollRightButton" Name="ShipConfigDialog/NextShip"> <Property Name="UnifiedPosition" Value="{{0.5,-56},{0.7,+10}}" /> <Property Name="UnifiedSize" Value="{{0.0,56},{ 0.0,14}}" /> </Window> Added: branches/ogsector/data/gui/layouts/opengateConsole.layout =================================================================== --- branches/ogsector/data/gui/layouts/opengateConsole.layout (rev 0) +++ branches/ogsector/data/gui/layouts/opengateConsole.layout 2007-05-19 15:46:19 UTC (rev 480) @@ -0,0 +1,15 @@ +<?xml version="1.0" ?> +<GUILayout> + <Window Type="DefaultWindow" Name="Console"> + <Property Name="UnifiedPosition" Value="{{0.0,+100},{0.0,21}}" /> + <Property Name="UnifiedSize" Value="{{1.0,-453},{0.0,50}}" /> + <Window Type="opengate/ConsoleListbox" Name="ConsoleList" > + <Property Name="UnifiedPosition" Value="{{0.0,0},{0.0,0}}" /> + <Property Name="UnifiedSize" Value="{{1.0,0},{1.0,-20}}" /> + </Window> + <Window Type="opengate/ConsoleEditbox" Name="ConsoleEdit" > + <Property Name="UnifiedPosition" Value="{{0.0,0},{1.0,-24}}" /> + <Property Name="UnifiedSize" Value="{{1.0,0},{0.0,20}}" /> + </Window> + </Window> +</GUILayout> Modified: branches/ogsector/data/gui/layouts/opengateDocked.layout =================================================================== --- branches/ogsector/data/gui/layouts/opengateDocked.layout 2007-05-19 12:21:50 UTC (rev 479) +++ branches/ogsector/data/gui/layouts/opengateDocked.layout 2007-05-19 15:46:19 UTC (rev 480) @@ -7,12 +7,103 @@ <!-- <Property Name="UnifiedSize" Value="{{1.0,-46},{1.0,-10}}" /> --> <Property Name="Alpha" Value="1" /> - <Window Type="opengate/StaticImage" Name="Docked/MainWindow/TopLeft"> - <Property Name="UnifiedPosition" Value="{{0.0,25},{0.0,10}}" /> - <Property Name="UnifiedSize" Value="{{0.0,62},{0.0,374}}" /> - <Property Name="BackgroundEnabled" Value="False" /> - <Property Name="FrameEnabled" Value="False" /> - <Property Name="Image" Value="set:MainWindowTopLeft image:full_image" /> + <Window Type="DefaultWindow" Name="Docked/MainWindow/ConsoleFrame"> + <Property Name="UnifiedPosition" Value="{{0.0,62},{0.0,10}}" /> + <Property Name="UnifiedSize" Value="{{1.0,-370},{0.0,100}}" /> + <Window Type="opengate/StaticImage" Name="Docked/MainWindow/ConsoleBackground"> + <Property Name="UnifiedPosition" Value="{{0.0,9},{0.0,9}}" /> + <Property Name="UnifiedSize" Value="{{1.0,-18},{1.0,-16}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="false" /> + <Property Name="Image" Value="set:opengate image:ConsoleBackground50" /> + </Window> + <Window Type="opengate/StaticImage" Name="Docked/MainWindow/ConsoleFrameTopLeftHS"> + <Property Name="UnifiedPosition" Value="{{0.0,+21},{0.0,0}}" /> + <Property Name="UnifiedSize" Value="{{0.0,9},{0.0,16}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:MainConsoleFrameHorizontalSide image:full_image" /> + </Window> + <Window Type="opengate/StaticImage" Name="Docked/MainWindow/ConsoleFrameTop"> + <Property Name="UnifiedPosition" Value="{{0.0,+29},{0.0,0}}" /> + <Property Name="UnifiedSize" Value="{{1.0,-55},{0.0,16}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:MainConsoleFrameHorizontalMiddle image:full_image" /> + </Window> + <Window Type="opengate/StaticImage" Name="Docked/MainWindow/ConsoleFrameTopRightHS"> + <Property Name="UnifiedPosition" Value="{{1.0,-26},{0.0,0}}" /> + <Property Name="UnifiedSize" Value="{{0.0,9},{0.0,16}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:MainConsoleFrameHorizontalSide image:full_image" /> + </Window> + + <Window Type="opengate/StaticImage" Name="ConsoleFrameBottomLeft"> + <Property Name="UnifiedPosition" Value="{{0.0,0},{1.0,-27}}" /> + <Property Name="UnifiedSize" Value="{{0.0,17},{0.0,27}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:MainConsoleFrameBottomLeft image:full_image" /> + </Window> + <Window Type="opengate/StaticImage" Name="Docked/MainWindow/ConsoleFrameBottomLeftHS"> + <Property Name="UnifiedPosition" Value="{{0.0,+17},{1.0,-16}}" /> + <Property Name="UnifiedSize" Value="{{0.0,9},{0.0,16}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:MainConsoleFrameHorizontalSide image:full_image" /> + </Window> + <Window Type="opengate/StaticImage" Name="Docked/MainWindow/ConsoleFrameBottom"> + <Property Name="UnifiedPosition" Value="{{0.0,+26},{1.0,-16}}" /> + <Property Name="UnifiedSize" Value="{{1.0,-52},{0.0,16}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:MainConsoleFrameHorizontalMiddle image:full_image" /> + </Window> + <Window Type="opengate/StaticImage" Name="Docked/MainWindow/ConsoleFrameBottomRightHS"> + <Property Name="UnifiedPosition" Value="{{1.0,-26},{1.0,-16}}" /> + <Property Name="UnifiedSize" Value="{{0.0,9},{0.0,16}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:MainConsoleFrameHorizontalSide image:full_image" /> + </Window> + <Window Type="opengate/StaticImage" Name="Docked/MainWindow/ConsoleFrameBottomRight"> + <Property Name="UnifiedPosition" Value="{{1.0,-17},{1.0,-27}}" /> + <Property Name="UnifiedSize" Value="{{0.0,17},{0.0,27}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:MainConsoleFrameBottomRight image:full_image" /> + </Window> + + <Window Type="opengate/StaticImage" Name="Docked/MainWindow/ConsoleFrameLeft"> + <Property Name="UnifiedPosition" Value="{{0.0,0},{0.0,+84}}" /> + <Property Name="UnifiedSize" Value="{{0.0,16},{1.0,-115}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:MainConsoleFrameVerticalMiddle image:full_image" /> + </Window> + <Window Type="opengate/StaticImage" Name="Docked/MainWindow/ConsoleFrameBottomLeftVS"> + <Property Name="UnifiedPosition" Value="{{0.0,0},{1.0,-36}}" /> + <Property Name="UnifiedSize" Value="{{0.0,16},{0.0,9}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:MainConsoleFrameVerticalSide image:full_image" /> + </Window> + + <Window Type="opengate/StaticImage" Name="Docked/MainWindow/ConsoleFrameBottomRightVS"> + <Property Name="UnifiedPosition" Value="{{1.0,-15},{1.0,-36}}" /> + <Property Name="UnifiedSize" Value="{{0.0,16},{0.0,9}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:MainConsoleFrameVerticalSide image:full_image" /> + </Window> + <Window Type="opengate/StaticImage" Name="Docked/MainWindow/ConsoleFrameRight"> + <Property Name="UnifiedPosition" Value="{{1.0,-16},{0.0,+49}}" /> + <Property Name="UnifiedSize" Value="{{0.0,16},{1.0,-85}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:MainConsoleFrameVerticalMiddle image:full_image" /> + </Window> </Window> <Window Type="opengate/StaticImage" Name="Docked/MainWindow/LeftRedLineTop"> <Property Name="UnifiedPosition" Value="{{0.0,40},{0.0,384}}" /> @@ -36,15 +127,15 @@ <Property Name="Image" Value="set:MainWindowRedLineBottom image:full_image" /> </Window> <Window Type="opengate/StaticImage" Name="Docked/MainWindow/RightRedLineTop"> - <Property Name="UnifiedPosition" Value="{{1.0,-68},{0.0,132}}" /> + <Property Name="UnifiedPosition" Value="{{1.0,-68},{0.0,126}}" /> <Property Name="UnifiedSize" Value="{{0.0,44},{0.0, 22}}" /> <Property Name="BackgroundEnabled" Value="False" /> <Property Name="FrameEnabled" Value="False" /> <Property Name="Image" Value="set:MainWindowRedLineTop image:full_image" /> </Window> <Window Type="opengate/StaticImage" Name="Docked/MainWindow/RightLine"> - <Property Name="UnifiedPosition" Value="{{1.0,-47},{0.0,132}}" /> - <Property Name="UnifiedSize" Value="{{0.0,4},{1.0,-197}}" /> + <Property Name="UnifiedPosition" Value="{{1.0,-47},{0.0,126}}" /> + <Property Name="UnifiedSize" Value="{{0.0,4},{1.0,-191}}" /> <Property Name="BackgroundEnabled" Value="False" /> <Property Name="FrameEnabled" Value="False" /> <Property Name="Image" Value="set:MainWindowRedLine image:full_image" /> @@ -57,8 +148,8 @@ <Property Name="Image" Value="set:MainWindowRedLineBottom image:full_image" /> </Window> <Window Type="opengate/StaticImage" Name="Docked/MainWindow/BottomMiddle"> - <Property Name="UnifiedPosition" Value="{{0.0,108},{1.0,-64}}" /> - <Property Name="UnifiedSize" Value="{{1.0,-291},{0.0,59}}" /> + <Property Name="UnifiedPosition" Value="{{0.0,119},{1.0,-64}}" /> + <Property Name="UnifiedSize" Value="{{1.0,-304},{0.0,59}}" /> <Property Name="BackgroundEnabled" Value="False" /> <Property Name="FrameEnabled" Value="False" /> <Property Name="Image" Value="set:MainWindowBottomMiddle image:full_image" /> @@ -78,13 +169,29 @@ <Property Name="Image" Value="set:MainWindowBottomRight image:full_image" /> </Window> <Window Type="opengate/StaticImage" Name="Docked/MainWindow/TopRight"> - <Property Name="UnifiedPosition" Value="{{1.0,-326},{0.0,10}}" /> + <Property Name="UnifiedPosition" Value="{{1.0,-326},{0.0,4}}" /> <Property Name="UnifiedSize" Value="{{0.0,301},{0.0,122}}" /> <Property Name="BackgroundEnabled" Value="False" /> <Property Name="FrameEnabled" Value="False" /> <Property Name="Image" Value="set:MainWindowTopRight image:full_image" /> </Window> + <Window Type="opengate/StaticImage" Name="Docked/MainWindow/TopLeft"> + <Property Name="UnifiedPosition" Value="{{0.0,25},{0.0,10}}" /> + <Property Name="UnifiedSize" Value="{{0.0,62},{0.0,374}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:MainWindowTopLeft image:full_image" /> + </Window> + <Window Type="opengate/GreyButtonUp" Name="Docked/MainWindow/ConsoleMinButton"> + <Property Name="UnifiedPosition" Value="{{0.0,+74},{0.0,+49}}" /> + <Property Name="UnifiedSize" Value="{{0.0,13},{0.0,13}}" /> + </Window> + <Window Type="opengate/GreyButtonDown" Name="Docked/MainWindow/ConsoleLargeButton"> + <Property Name="UnifiedPosition" Value="{{0.0,+74},{0.0,+49}}" /> + <Property Name="UnifiedSize" Value="{{0.0,13},{0.0,13}}" /> + </Window> + <Window Type="opengate/Button" Name="Docked/MainWindow/ShipConfigButton"> <Property Name="UnifiedPosition" Value="{{0.125,0},{1.0,-88}}" /> <Property Name="UnifiedSize" Value="{{0.0,100},{0.0,24}}" /> Added: branches/ogsector/data/gui/layouts/opengateUnDocked.layout =================================================================== --- branches/ogsector/data/gui/layouts/opengateUnDocked.layout (rev 0) +++ branches/ogsector/data/gui/layouts/opengateUnDocked.layout 2007-05-19 15:46:19 UTC (rev 480) @@ -0,0 +1,21 @@ +<?xml version="1.0" ?> +<GUILayout> + <Window Type="DefaultWindow" Name="UnDocked/MainWindow"> + <Property Name="UnifiedPosition" Value="{{0.0,0},{0.0,0}}" /> + <Property Name="UnifiedSize" Value="{{1.0,0},{1.0,0}}" /> +<!-- <Property Name="UnifiedPosition" Value="{{0.0,23},{0.0,5}}" /> --> +<!-- <Property Name="UnifiedSize" Value="{{1.0,-46},{1.0,-10}}" /> --> + <Property Name="Alpha" Value="1" /> + <Window Type="DefaultWindow" Name="UnDocked/MainWindow/ConsoleFrame"> + <Property Name="UnifiedPosition" Value="{{0.0,62},{0.0,10}}" /> + <Property Name="UnifiedSize" Value="{{1.0,-370},{0.0,100}}" /> + <Window Type="opengate/StaticImage" Name="UnDocked/MainWindow/ConsoleBackground"> + <Property Name="UnifiedPosition" Value="{{0.0,9},{0.0,9}}" /> + <Property Name="UnifiedSize" Value="{{1.0,-18},{1.0,-16}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:ConsoleBackground50" /> + </Window> + </Window> + </Window> +</GUILayout> Modified: branches/ogsector/data/gui/schemes/opengate/opengate.imageset =================================================================== --- branches/ogsector/data/gui/schemes/opengate/opengate.imageset 2007-05-19 12:21:50 UTC (rev 479) +++ branches/ogsector/data/gui/schemes/opengate/opengate.imageset 2007-05-19 15:46:19 UTC (rev 480) @@ -1,5 +1,43 @@ <?xml version="1.0" encoding="UTF-8"?> <Imageset Name="opengate" Imagefile="opengate.png"> + <Image Name="Blank" XPos="492" YPos="6" Width="1" Height="1" /> + <Image Name="ConsoleBackground50" XPos="265" YPos="13" Width="10" Height="10" /> + <Image Name="ConsoleLeftEdge50" XPos="256" YPos="34" Width="3" Height="30" /> + <Image Name="ConsoleRightEdge50" XPos="321" YPos="34" Width="3" Height="30" /> + <Image Name="ConsoleTopEdge50" XPos="277" YPos="5" Width="30" Height="3" /> + <Image Name="ConsoleBottomEdge50" XPos="277" YPos="78" Width="30" Height="3" /> + <Image Name="ConsoleTopLeft" XPos="256" YPos="5" Width="3" Height="3" /> + <Image Name="ConsoleTopRight" XPos="321" YPos="5" Width="3" Height="3" /> + <Image Name="ConsoleBottomLeft" XPos="256" YPos="78" Width="3" Height="3" /> + <Image Name="ConsoleBottomRight" XPos="321" YPos="78" Width="3" Height="3" /> + <Image Name="ScrollThumbLeftNormal" XPos="374" YPos="4" Width="56" Height="14" /> + <Image Name="ScrollThumbLeftHover" XPos="374" YPos="19" Width="56" Height="14" /> + <Image Name="ScrollThumbLeftPushed" XPos="374" YPos="34" Width="56" Height="14" /> + <Image Name="ScrollThumbRightNormal" XPos="432" YPos="4" Width="56" Height="14" /> + <Image Name="ScrollThumbRightHover" XPos="432" YPos="19" Width="56" Height="14" /> + <Image Name="ScrollThumbRightPushed" XPos="432" YPos="34" Width="56" Height="14" /> + <Image Name="ScrollThumbUpNormal" XPos="328" YPos="4" Width="14" Height="56" /> + <Image Name="ScrollThumbUpHover" XPos="343" YPos="4" Width="14" Height="56" /> + <Image Name="ScrollThumbUpPushed" XPos="358" YPos="4" Width="14" Height="56" /> + <Image Name="ScrollThumbDownNormal" XPos="328" YPos="62" Width="14" Height="56" /> + <Image Name="ScrollThumbDownHover" XPos="343" YPos="62" Width="14" Height="56" /> + <Image Name="ScrollThumbDownPushed" XPos="358" YPos="62" Width="14" Height="56" /> + <Image Name="ConsoleScrollThumbUpNormal" XPos="376" YPos="50" Width="10" Height="18" /> + <Image Name="ConsoleScrollThumbUpHover" XPos="387" YPos="50" Width="10" Height="18" /> + <Image Name="ConsoleScrollThumbUpPushed" XPos="398" YPos="50" Width="10" Height="18" /> + <Image Name="ConsoleScrollThumbDownNormal" XPos="376" YPos="71" Width="10" Height="18" /> + <Image Name="ConsoleScrollThumbDownHover" XPos="387" YPos="71" Width="10" Height="18" /> + <Image Name="ConsoleScrollThumbDownPushed" XPos="398" YPos="71" Width="10" Height="18" /> + <Image Name="GreyButtonUpNormal" XPos="409" YPos="50" Width="13" Height="13" /> + <Image Name="GreyButtonUpHover" XPos="424" YPos="50" Width="13" Height="13" /> + <Image Name="GreyButtonUpPushed" XPos="439" YPos="50" Width="13" Height="13" /> + <Image Name="GreyButtonDownNormal" XPos="409" YPos="65" Width="13" Height="13" /> + <Image Name="GreyButtonDownHover" XPos="424" YPos="65" Width="13" Height="13" /> + <Image Name="GreyButtonDownPushed" XPos="439" YPos="65" Width="13" Height="13" /> + + <Image Name="ConsoleMouseTextBar" XPos="313" YPos="89" Width="5" Height="14" /> + <Image Name="ConsoleMouseEditBoxCarat" XPos="308" YPos="89" Width="1" Height="14" /> + <Image Name="AltProgressLeft" XPos="10" YPos="10" Width="10" Height="10" /> <Image Name="AltProgressMiddle" XPos="20" YPos="10" Width="10" Height="10" /> <Image Name="AltProgressRight" XPos="30" YPos="10" Width="10" Height="10" /> Modified: branches/ogsector/data/gui/schemes/opengate/opengate.png =================================================================== (Binary files differ) Modified: branches/ogsector/data/gui/schemes/opengate/opengate.scheme =================================================================== --- branches/ogsector/data/gui/schemes/opengate/opengate.scheme 2007-05-19 12:21:50 UTC (rev 479) +++ branches/ogsector/data/gui/schemes/opengate/opengate.scheme 2007-05-19 15:46:19 UTC (rev 480) @@ -11,20 +11,13 @@ <ImagesetFromImage Name="MainWindowRedLine" Filename="textures/mainRedLine.png" /> <ImagesetFromImage Name="MainWindowRedLineTop" Filename="textures/mainRedLineTop.png" /> <ImagesetFromImage Name="MainWindowRedLineBottom" Filename="textures/mainRedLineBottom.png" /> - <ImagesetFromImage Name="HorzScrollThumbLeftNormal" Filename="textures/scrollbar/leftNormal.png" /> - <ImagesetFromImage Name="HorzScrollThumbLeftHover" Filename="textures/scrollbar/leftHover.png" /> - <ImagesetFromImage Name="HorzScrollThumbLeftPushed" Filename="textures/scrollbar/leftPushed.png" /> - <ImagesetFromImage Name="HorzScrollThumbRightNormal" Filename="textures/scrollbar/rightNormal.png" /> - <ImagesetFromImage Name="HorzScrollThumbRightHover" Filename="textures/scrollbar/rightHover.png" /> - <ImagesetFromImage Name="HorzScrollThumbRightPushed" Filename="textures/scrollbar/rightPushed.png" /> - <ImagesetFromImage Name="HorzScrollThumbUpNormal" Filename="textures/scrollbar/upNormal.png" /> - <ImagesetFromImage Name="HorzScrollThumbUpHover" Filename="textures/scrollbar/upHover.png" /> - <ImagesetFromImage Name="HorzScrollThumbUpPushed" Filename="textures/scrollbar/upPushed.png" /> - <ImagesetFromImage Name="HorzScrollThumbDownNormal" Filename="textures/scrollbar/downNormal.png" /> - <ImagesetFromImage Name="HorzScrollThumbDownHover" Filename="textures/scrollbar/downHover.png" /> - <ImagesetFromImage Name="HorzScrollThumbDownPushed" Filename="textures/scrollbar/downPushed.png" /> + <ImagesetFromImage Name="MainConsoleFrameBottomRight" Filename="textures/mainConsoleFrameBottomRight.png" /> + <ImagesetFromImage Name="MainConsoleFrameBottomLeft" Filename="textures/mainConsoleFrameBottomLeft.png" /> + <ImagesetFromImage Name="MainConsoleFrameHorizontalSide" Filename="textures/mainConsoleFrameHorizontalSide.png" /> + <ImagesetFromImage Name="MainConsoleFrameHorizontalMiddle" Filename="textures/mainConsoleFrameHorizontalMiddle.png" /> + <ImagesetFromImage Name="MainConsoleFrameVerticalSide" Filename="textures/mainConsoleFrameVerticalSide.png" /> + <ImagesetFromImage Name="MainConsoleFrameVerticalMiddle" Filename="textures/mainConsoleFrameVerticalMiddle.png" /> - <Font Name="BlueHighway-12" Filename="BlueHighway-12.font" /> <Font Name="BlueHighway-10" Filename="BlueHighway-10.font" /> @@ -32,7 +25,7 @@ <LookNFeel Filename="opengateStatic.looknfeel" /> <LookNFeel Filename="opengateContainers.looknfeel" /> <LookNFeel Filename="opengateScroll.looknfeel" /> -<!-- <LookNFeel Filename="lists.looknfeel" /> --> + <LookNFeel Filename="opengateLists.looknfeel" /> <!-- <LookNFeel Filename="menu.looknfeel" /> --> <!-- <LookNFeel Filename="progress.looknfeel" /> --> <!-- <LookNFeel Filename="targeting.looknfeel" /> --> @@ -63,8 +56,47 @@ WindowType="opengate/SystemButton" TargetType="CEGUI/PushButton" Renderer="Falagard/SystemButton" - LookNFeel="opengate/Button" - /> + LookNFeel="opengate/Button" /> + <FalagardMapping + WindowType="opengate/HorizontalScrollLeftButton" + TargetType="CEGUI/PushButton" + Renderer="Falagard/SystemButton" + LookNFeel="opengate/HorizontalScrollLeftButton" /> + <FalagardMapping + WindowType="opengate/HorizontalScrollRightButton" + TargetType="CEGUI/PushButton" + Renderer="Falagard/SystemButton" + LookNFeel="opengate/HorizontalScrollRightButton" /> + <FalagardMapping + WindowType="opengate/GreyButtonUp" + TargetType="CEGUI/PushButton" + Renderer="Falagard/SystemButton" + LookNFeel="opengate/GreyButtonUp" /> + <FalagardMapping + WindowType="opengate/GreyButtonDown" + TargetType="CEGUI/PushButton" + Renderer="Falagard/SystemButton" + LookNFeel="opengate/GreyButtonDown" /> + <FalagardMapping + WindowType="opengate/ConsoleScrollButtonUp" + TargetType="CEGUI/PushButton" + Renderer="Falagard/SystemButton" + LookNFeel="opengate/ConsoleScrollButtonUp" /> + <FalagardMapping + WindowType="opengate/ConsoleScrollButtonDown" + TargetType="CEGUI/PushButton" + Renderer="Falagard/SystemButton" + LookNFeel="opengate/ConsoleScrollButtonDown" /> + <FalagardMapping + WindowType="opengate/Editbox" + TargetType="CEGUI/Editbox" + Renderer="Falagard/Editbox" + LookNFeel="opengate/Editbox"/> + <FalagardMapping + WindowType="opengate/ConsoleEditbox" + TargetType="CEGUI/Editbox" + Renderer="Falagard/Editbox" + LookNFeel="opengate/ConsoleEditbox"/> <!-- opengateContainers.looknfeel --> @@ -82,15 +114,33 @@ opengateScroll.looknfeel --> <FalagardMapping - WindowType="opengate/HorizontalScrollbarLeftThumb" + WindowType="opengate/ConsoleHorizontalScrollbarThumb" TargetType="CEGUI/Thumb" Renderer="Falagard/Button" - LookNFeel="opengate/HorizontalScrollbarLeftThumb" /> + LookNFeel="opengate/ConsoleHorizontalScrollbarThumb" /> <FalagardMapping - WindowType="opengate/HorizontalScrollbarRightThumb" + WindowType="opengate/ConsoleHorizontalScrollbar" + TargetType="CEGUI/Scrollbar" + Renderer="Falagard/Scrollbar" + LookNFeel="opengate/ConsoleHorizontalScrollbar"/> + <FalagardMapping + WindowType="opengate/ConsoleVerticalScrollbarThumb" TargetType="CEGUI/Thumb" Renderer="Falagard/Button" - LookNFeel="opengate/HorizontalScrollbarRightThumb" /> + LookNFeel="opengate/ConsoleVerticalScrollbarThumb"/> + <FalagardMapping + WindowType="opengate/ConsoleVerticalScrollbar" + TargetType="CEGUI/Scrollbar" + Renderer="Falagard/Scrollbar" + LookNFeel="opengate/ConsoleVerticalScrollbar"/> + <!-- + opengateLists.looknfeel + --> + <FalagardMapping + WindowType="opengate/ConsoleListbox" + TargetType="CEGUI/Listbox" + Renderer="Falagard/Listbox" + LookNFeel="opengate/ConsoleListbox"/> </GUIScheme> <!-- <FalagardMapping --> @@ -106,12 +156,6 @@ <!-- LookNFeel="SleekSpace/Checkbox" --> <!-- /> --> <!-- <FalagardMapping --> -<!-- WindowType="SleekSpace/Editbox" --> -<!-- TargetType="CEGUI/Editbox" --> -<!-- Renderer="Falagard/Editbox" --> -<!-- LookNFeel="SleekSpace/Editbox" --> -<!-- /> --> -<!-- <FalagardMapping --> <!-- WindowType="SleekSpace/MultiLineEditbox" --> <!-- TargetType="CEGUI/MultiLineEditbox" --> <!-- Renderer="Falagard/MultiLineEditbox" --> @@ -128,12 +172,6 @@ lists.looknfeel --> <!-- <FalagardMapping --> -<!-- WindowType="SleekSpace/Listbox" --> -<!-- TargetType="CEGUI/Listbox" --> -<!-- Renderer="Falagard/Listbox" --> -<!-- LookNFeel="SleekSpace/Listbox" --> -<!-- /> --> -<!-- <FalagardMapping --> <!-- WindowType="SleekSpace/ListHeader" --> <!-- TargetType="CEGUI/ListHeader" --> <!-- Renderer="Falagard/ListHeader" --> Modified: branches/ogsector/data/gui/schemes/opengate/opengateButtons.looknfeel =================================================================== --- branches/ogsector/data/gui/schemes/opengate/opengateButtons.looknfeel 2007-05-19 12:21:50 UTC (rev 479) +++ branches/ogsector/data/gui/schemes/opengate/opengateButtons.looknfeel 2007-05-19 15:46:19 UTC (rev 480) @@ -145,5 +145,625 @@ </Layer> </StateImagery> </WidgetLook> + + + <!-- + *************************************************** + opengate/HorizontalScrollLeftThumb + *************************************************** + --> + <WidgetLook name="opengate/HorizontalScrollLeftButton"> + <ImagerySection name="normal"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image type="LeftEdge" imageset="opengate" image="ScrollThumbLeftNormal" /> + </FrameComponent> + </ImagerySection> + <ImagerySection name="hover"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image type="LeftEdge" imageset="opengate" image="ScrollThumbLeftHover" /> + </FrameComponent> + </ImagerySection> + <ImagerySection name="pushed"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image type="LeftEdge" imageset="opengate" image="ScrollThumbLeftPushed" /> + </FrameComponent> + </ImagerySection> + <StateImagery name="Normal"> + <Layer> + <Section section="normal" /> + </Layer> + </StateImagery> + <StateImagery name="Hover"> + <Layer> + <Section section="hover" /> + </Layer> + </StateImagery> + <StateImagery name="Pushed"> + <Layer> + <Section section="pushed" /> + </Layer> + </StateImagery> + <StateImagery name="Disabled"> + <Layer> + <Section section="normal"> + <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" /> + </Section> + </Layer> + </StateImagery> + </WidgetLook> + <!-- + *************************************************** + opengate/ConsoleHorizontalScrollRightThumb + *************************************************** + --> + <WidgetLook name="opengate/HorizontalScrollRightButton"> + <ImagerySection name="normal"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image type="RightEdge" imageset="opengate" image="ScrollThumbRightNormal" /> + </FrameComponent> + </ImagerySection> + <ImagerySection name="hover"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image type="RightEdge" imageset="opengate" image="ScrollThumbRightHover" /> + </FrameComponent> + </ImagerySection> + <ImagerySection name="pushed"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image type="RightEdge" imageset="opengate" image="ScrollThumbRightPushed" /> + </FrameComponent> + </ImagerySection> + <StateImagery name="Normal"> + <Layer> + <Section section="normal" /> + </Layer> + </StateImagery> + <StateImagery name="Hover"> + <Layer> + <Section section="hover" /> + </Layer> + </StateImagery> + <StateImagery name="Pushed"> + <Layer> + <Section section="pushed" /> + </Layer> + </StateImagery> + <StateImagery name="Disabled"> + <Layer> + <Section section="normal"> + <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" /> + </Section> + </Layer> + </StateImagery> + </WidgetLook> + <!-- + *************************************************** + opengate/GreyButtonUp + *************************************************** + --> + <WidgetLook name="opengate/GreyButtonUp"> + <ImagerySection name="normal"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image type="LeftEdge" imageset="opengate" image="GreyButtonUpNormal" /> + </FrameComponent> + </ImagerySection> + <ImagerySection name="hover"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image type="LeftEdge" imageset="opengate" image="GreyButtonUpHover" /> + </FrameComponent> + </ImagerySection> + <ImagerySection name="pushed"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image type="LeftEdge" imageset="opengate" image="GreyButtonUpPushed" /> + </FrameComponent> + </ImagerySection> + <StateImagery name="Normal"> + <Layer> + <Section section="normal" /> + </Layer> + </StateImagery> + <StateImagery name="Hover"> + <Layer> + <Section section="hover" /> + </Layer> + </StateImagery> + <StateImagery name="Pushed"> + <Layer> + <Section section="pushed" /> + </Layer> + </StateImagery> + <StateImagery name="Disabled"> + <Layer> + <Section section="normal"> + <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" /> + </Section> + </Layer> + </StateImagery> + </WidgetLook> + + <!-- + *************************************************** + opengate/GreyButtonDown + *************************************************** + --> + <WidgetLook name="opengate/GreyButtonDown"> + <ImagerySection name="normal"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image type="LeftEdge" imageset="opengate" image="GreyButtonDownNormal" /> + </FrameComponent> + </ImagerySection> + <ImagerySection name="hover"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image type="LeftEdge" imageset="opengate" image="GreyButtonDownHover" /> + </FrameComponent> + </ImagerySection> + <ImagerySection name="pushed"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image type="LeftEdge" imageset="opengate" image="GreyButtonDownPushed" /> + </FrameComponent> + </ImagerySection> + <StateImagery name="Normal"> + <Layer> + <Section section="normal" /> + </Layer> + </StateImagery> + <StateImagery name="Hover"> + <Layer> + <Section section="hover" /> + </Layer> + </StateImagery> + <StateImagery name="Pushed"> + <Layer> + <Section section="pushed" /> + </Layer> + </StateImagery> + <StateImagery name="Disabled"> + <Layer> + <Section section="normal"> + <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" /> + </Section> + </Layer> + </StateImagery> + </WidgetLook> + + <!-- + *************************************************** + opengate/ConsoleScrollButtonUp + *************************************************** + --> + <WidgetLook name="opengate/ConsoleScrollButtonUp"> + <ImagerySection name="normal"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image type="LeftEdge" imageset="opengate" image="ConsoleScrollThumbUpNormal" /> + </FrameComponent> + </ImagerySection> + <ImagerySection name="hover"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image type="LeftEdge" imageset="opengate" image="ConsoleScrollThumbUpHover" /> + </FrameComponent> + </ImagerySection> + <ImagerySection name="pushed"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image type="LeftEdge" imageset="opengate" image="ConsoleScrollThumbUpPushed" /> + </FrameComponent> + </ImagerySection> + <StateImagery name="Normal"> + <Layer> + <Section section="normal" /> + </Layer> + </StateImagery> + <StateImagery name="Hover"> + <Layer> + <Section section="hover" /> + </Layer> + </StateImagery> + <StateImagery name="Pushed"> + <Layer> + <Section section="pushed" /> + </Layer> + </StateImagery> + <StateImagery name="Disabled"> + <Layer> + <Section section="normal"> + <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" /> + </Section> + </Layer> + </StateImagery> + </WidgetLook> + + <!-- + *************************************************** + opengate/ConsoleScrollButtonDown + *************************************************** + --> + <WidgetLook name="opengate/ConsoleScrollButtonDown"> + <ImagerySection name="normal"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image type="LeftEdge" imageset="opengate" image="ConsoleScrollThumbDownNormal" /> + </FrameComponent> + </ImagerySection> + <ImagerySection name="hover"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image type="LeftEdge" imageset="opengate" image="ConsoleScrollThumbDownHover" /> + </FrameComponent> + </ImagerySection> + <ImagerySection name="pushed"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image type="LeftEdge" imageset="opengate" image="ConsoleScrollThumbDownPushed" /> + </FrameComponent> + </ImagerySection> + <StateImagery name="Normal"> + <Layer> + <Section section="normal" /> + </Layer> + </StateImagery> + <StateImagery name="Hover"> + <Layer> + <Section section="hover" /> + </Layer> + </StateImagery> + <StateImagery name="Pushed"> + <Layer> + <Section section="pushed" /> + </Layer> + </StateImagery> + <StateImagery name="Disabled"> + <Layer> + <Section section="normal"> + <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" /> + </Section> + </Layer> + </StateImagery> + </WidgetLook> + + <!-- + *************************************************** + opengate/ConsoleButtonDown + *************************************************** + --> + <WidgetLook name="opengate/ConsoleButtonDown"> + <ImagerySection name="normal"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image type="LeftEdge" imageset="opengate" image="ConsoleScrollThumbDownNormal" /> + </FrameComponent> + </ImagerySection> + <ImagerySection name="hover"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image type="LeftEdge" imageset="opengate" image="ConsoleScrollThumbDownHover" /> + </FrameComponent> + </ImagerySection> + <ImagerySection name="pushed"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image type="LeftEdge" imageset="opengate" image="ConsoleScrollThumbDownPushed" /> + </FrameComponent> + </ImagerySection> + <StateImagery name="Normal"> + <Layer> + <Section section="normal" /> + </Layer> + </StateImagery> + <StateImagery name="Hover"> + <Layer> + <Section section="hover" /> + </Layer> + </StateImagery> + <StateImagery name="Pushed"> + <Layer> + <Section section="pushed" /> + </Layer> + </StateImagery> + <StateImagery name="Disabled"> + <Layer> + <Section section="normal"> + <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" /> + </Section> + </Layer> + </StateImagery> + </WidgetLook> + <!-- + *************************************************** + opengate/ConsoleEditbox + *************************************************** + --> + <WidgetLook name="opengate/ConsoleEditbox"> + <PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" /> + <PropertyDefinition name="SelectedTextColour" initialValue="FF000000" redrawOnWrite="true" /> + <PropertyDefinition name="ActiveSelectionColour" initialValue="FF607FFF" redrawOnWrite="true" /> + <PropertyDefinition name="InactiveSelectionColour" initialValue="FF808080" redrawOnWrite="true" /> + <Property name="MouseCursorImage" value="set:opengate image:ConsoleMouseTextBar" /> + <NamedArea name="TextArea"> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="5" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="3" /></Dim> + <Dim type="RightEdge" ><UnifiedDim scale="1.0" offset="-5" type="RightEdge" /></Dim> + <Dim type="BottomEdge" ><UnifiedDim scale="1.0" offset="-3" type="BottomEdge" /></Dim> + </Area> + </NamedArea> + <ImagerySection name="container_normal"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> +<!-- <Image type="LeftEdge" imageset="opengate" image="EditBoxLeft" /> --> +<!-- <Image type="RightEdge" imageset="opengate" image="EditBoxRight" /> --> +<!-- <Image type="Background" imageset="opengate" image="ConsoleBackground50" /> --> + </FrameComponent> + </ImagerySection> + <ImagerySection name="selection"> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim> + <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim> + </Area> + <Image imageset="opengate" image="TextSelectionBrush" /> + <VertFormat type="Stretched" /> + <HorzFormat type="Stretched" /> + </ImageryComponent> + </ImagerySection> + <ImagerySection name="Carat"> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><ImageDim imageset="opengate" image="ConsoleMouseEditBoxCarat" dimension="Width" /></Dim> + <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim> + </Area> + <Image imageset="opengate" image="ConsoleMouseEditBoxCarat" /> + <VertFormat type="Stretched" /> + <HorzFormat type="Stretched" /> + </ImageryComponent> + </ImagerySection> + <StateImagery name="Enabled"> + <Layer> + <Section section="container_normal" /> + </Layer> + </StateImagery> + <StateImagery name="ReadOnly"> + <Layer> + <Section section="container_normal" /> + </Layer> + </StateImagery> + <StateImagery name="Disabled"> + <Layer> + <Section section="container_normal"> + <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="ActiveSelection"> + <Layer> + <Section section="selection"> + <ColourProperty name="ActiveSelectionColour" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="InactiveSelection"> + <Layer> + <Section section="selection"> + <ColourProperty name="InactiveSelectionColour" /> + </Section> + </Layer> + </StateImagery> + </WidgetLook> + <!-- + *************************************************** + opengate/Editbox + *************************************************** + --> + <WidgetLook name="opengate/Editbox"> + <PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" /> + <PropertyDefinition name="SelectedTextColour" initialValue="FF000000" redrawOnWrite="true" /> + <PropertyDefinition name="ActiveSelectionColour" initialValue="FF607FFF" redrawOnWrite="true" /> + <PropertyDefinition name="InactiveSelectionColour" initialValue="FF808080" redrawOnWrite="true" /> + <Property name="MouseCursorImage" value="set:opengate image:MouseTextBar" /> + <NamedArea name="TextArea"> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="5" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="3" /></Dim> + <Dim type="RightEdge" ><UnifiedDim scale="1.0" offset="-5" type="RightEdge" /></Dim> + <Dim type="BottomEdge" ><UnifiedDim scale="1.0" offset="-3" type="BottomEdge" /></Dim> + </Area> + </NamedArea> + <ImagerySection name="container_normal"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <Image type="LeftEdge" imageset="opengate" image="EditBoxLeft" /> + <Image type="RightEdge" imageset="opengate" image="EditBoxRight" /> + <Image type="Background" imageset="opengate" image="EditBoxMiddle" /> + </FrameComponent> + </ImagerySection> + <ImagerySection name="selection"> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim> + <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim> + </Area> + <Image imageset="opengate" image="TextSelectionBrush" /> + <VertFormat type="Stretched" /> + <HorzFormat type="Stretched" /> + </ImageryComponent> + </ImagerySection> + <ImagerySection name="Carat"> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><ImageDim imageset="opengate" image="EditBoxCarat" dimension="Width" /></Dim> + <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim> + </Area> + <Image imageset="opengate" image="EditBoxCarat" /> + <VertFormat type="Stretched" /> + <HorzFormat type="Stretched" /> + </ImageryComponent> + </ImagerySection> + <StateImagery name="Enabled"> + <Layer> + <Section section="container_normal" /> + </Layer> + </StateImagery> + <StateImagery name="ReadOnly"> + <Layer> + <Section section="container_normal" /> + </Layer> + </StateImagery> + <StateImagery name="Disabled"> + <Layer> + <Section section="container_normal"> + <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="ActiveSelection"> + <Layer> + <Section section="selection"> + <ColourProperty name="ActiveSelectionColour" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="InactiveSelection"> + <Layer> + <Section section="selection"> + <ColourProperty name="InactiveSelectionColour" /> + </Section> + </Layer> + </StateImagery> + </WidgetLook> </Falagard> Added: branches/ogsector/data/gui/schemes/opengate/opengateLists.looknfeel =================================================================== --- branches/ogsector/data/gui/schemes/opengate/opengateLists.looknfeel (rev 0) +++ branches/ogsector/data/gui/schemes/opengate/opengateLists.looknfeel 2007-05-19 15:46:19 UTC (rev 480) @@ -0,0 +1,139 @@ +<?xml version="1.0" ?> +<Falagard> + <!-- + *************************************************** + opengate/Listbox + *************************************************** + --> + <WidgetLook name="opengate/ConsoleListbox"> + <NamedArea name="ItemRenderingArea"> + <Area> + <Dim type="LeftEdge" ><ImageDim imageset="opengate" image="ListboxLeft" dimension="Width" /></Dim> + <Dim type="TopEdge" ><ImageDim imageset="opengate" image="ListboxTop" dimension="Height" /></Dim> + <Dim type="RightEdge" > + <UnifiedDim scale="1" type="RightEdge"> + <DimOperator op="Subtract"> + <ImageDim imageset="opengate" image="ListboxRight" dimension="Width" /> + </DimOperator> + </UnifiedDim> + </Dim> + <Dim type="BottomEdge" > + <UnifiedDim scale="1" type="BottomEdge"> + <DimOperator op="Subtract"> + <ImageDim imageset="opengate" image="ListboxBottom" dimension="Height" /> + </DimOperator> + </UnifiedDim> + </Dim> + </Area> + </NamedArea> + <NamedArea name="ItemRenderingAreaHScroll"> + <Area> + <Dim type="LeftEdge" ><ImageDim imageset="opengate" image="ListboxLeft" dimension="Width" /></Dim> + <Dim type="TopEdge" ><ImageDim imageset="opengate" image="ListboxTop" dimension="Height" /></Dim> + <Dim type="RightEdge" > + <UnifiedDim scale="1" type="RightEdge"> + <DimOperator op="Subtract"> + <ImageDim imageset="opengate" image="ListboxRight" dimension="Width" /> + </DimOperator> + </UnifiedDim> + </Dim> + <Dim type="BottomEdge" > + <UnifiedDim scale="1" type="BottomEdge"> + <DimOperator op="Subtract"> + <WidgetDim widget="__auto_hscrollbar__" dimension="Height" /> + </DimOperator> + </UnifiedDim> + </Dim> + </Area> + </NamedArea> + <NamedArea name="ItemRenderingAreaVScroll"> + <Area> + <Dim type="LeftEdge" ><ImageDim imageset="opengate" image="ListboxLeft" dimension="Width" /></Dim> + <Dim type="TopEdge" ><ImageDim imageset="opengate" image="ListboxTop" dimension="Height" /></Dim> + <Dim type="RightEdge" > + <UnifiedDim scale="1" type="RightEdge"> + <DimOperator op="Subtract"> + <WidgetDim widget="__auto_vscrollbar__" dimension="Width" /> + </DimOperator> + </UnifiedDim> + </Dim> + <Dim type="BottomEdge" > + <UnifiedDim scale="1" type="BottomEdge"> + <DimOperator op="Subtract"> + <ImageDim imageset="opengate" image="ListboxBottom" dimension="Height" /> + </DimOperator> + </UnifiedDim> + </Dim> + </Area> + </NamedArea> + <NamedArea name="ItemRenderingAreaHVScroll"> + <Area> + <Dim type="LeftEdge" ><ImageDim imageset="opengate" image="ListboxLeft" dimension="Width" /></Dim> + <Dim type="TopEdge" ><ImageDim imageset="opengate" image="ListboxTop" dimension="Height" /></Dim> + <Dim type="RightEdge" > + <UnifiedDim scale="1" type="RightEdge"> + <DimOperator op="Subtract"> + <WidgetDim widget="__auto_vscrollbar__" dimension="Width" /> + </DimOperator> + </UnifiedDim> + </Dim> + <Dim type="BottomEdge" > + <UnifiedDim scale="1" type="BottomEdge"> + <DimOperator op="Subtract"> + <WidgetDim widget="__auto_hscrollbar__" dimension="Height" /> + </DimOperator> + </UnifiedDim> + </Dim> + </Area> + </NamedArea> + <Child type="opengate/ConsoleHorizontalScrollbar" nameSuffix="__auto_hscrollbar__"> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" offset="-12" type="Width" /></Dim> + <Dim type="Height" ><AbsoluteDim value="12" /></Dim> + </Area> + <VertAlignment type="BottomAligned" /> + </Child> + <Child type="opengate/ConsoleVerticalScrollbar" nameSuffix="__auto_vscrollbar__"> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><AbsoluteDim value="12" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" offset="-12" type="Height" /></Dim> + </Area> + <HorzAlignment type="RightAligned" /> + </Child> + <ImagerySection name="main"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> +<!-- <Image type="TopLeftCorner" imageset="opengate" image="ConsoleTopLeft" /> --> +<!-- <Image type="TopRightCorner" imageset="opengate" image="ConsoleTopRight" /> --> +<!-- <Image type="BottomLeftCorner" imageset="opengate" image="ConsoleBottomLeft" /> --> +<!-- <Image type="BottomRightCorner" imageset="opengate" image="ConsoleBottomRight" /> --> +<!-- <Image type="LeftEdge" imageset="opengate" image="ConsoleLeftEdge50" /> --> +<!-- <Image type="RightEdge" imageset="opengate" image="ConsoleRightEdge50" /> --> +<!-- <Image type="TopEdge" imageset="opengate" image="ConsoleTopEdge50" /> --> +<!-- <Image type="BottomEdge" imageset="opengate" image="ConsoleBottomEdge50" /> --> +<!-- <Image type="Background" imageset="opengate" image="Co... [truncated message content] |
From: <spo...@us...> - 2007-05-19 16:40:35
|
Revision: 482 http://svn.sourceforge.net/opengate/?rev=482&view=rev Author: spom_spom Date: 2007-05-19 09:40:34 -0700 (Sat, 19 May 2007) Log Message: ----------- win compatibility commit Modified Paths: -------------- branches/ogsector/src/opengateclient.cpp branches/ogsector/win32/ogsectorclient/ogsectorclient.cbp branches/ogsector/win32/ogsectorclient/ogsectorclient.exe Modified: branches/ogsector/src/opengateclient.cpp =================================================================== --- branches/ogsector/src/opengateclient.cpp 2007-05-19 16:05:05 UTC (rev 481) +++ branches/ogsector/src/opengateclient.cpp 2007-05-19 16:40:34 UTC (rev 482) @@ -38,7 +38,9 @@ log->setLogFile( "OpenGate.log" ); log->setChatLogFile( "OpenGateChat.log" ); log->info("Starting up"); - log->info(PACKAGE_STRING); +#ifdef PACKAGE_STRING + log->info(PACKAGE_STRING); +#endif std::string username = "testuser"; std::string hostname = "localhost"; @@ -61,15 +63,15 @@ 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 ); @@ -77,7 +79,7 @@ nw.setUserName( username ); log->info( "Offline mode." ); } - + try { OpenGate::GameStateManager gameStateMgr( nw, dialog ); OpenGate::DockedState::create( &gameStateMgr, "DockedState" ); @@ -86,7 +88,7 @@ } catch( Ogre::Exception& e ) { #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 - MessageBox( NULL, e.getFullDescription().c_str(), + 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() ); Modified: branches/ogsector/win32/ogsectorclient/ogsectorclient.cbp =================================================================== --- branches/ogsector/win32/ogsectorclient/ogsectorclient.cbp 2007-05-19 16:05:05 UTC (rev 481) +++ branches/ogsector/win32/ogsectorclient/ogsectorclient.cbp 2007-05-19 16:40:34 UTC (rev 482) @@ -55,6 +55,8 @@ <Add directory="C:\OgreSDK\lib" /> <Add directory="C:\OgreSDK\bin\Release" /> </Linker> + <Unit filename="..\..\src\Console.cpp" /> + <Unit filename="..\..\src\Console.h" /> <Unit filename="..\..\src\DockedState.cpp" /> <Unit filename="..\..\src\DockedState.h" /> <Unit filename="..\..\src\GameState.cpp" /> @@ -80,8 +82,6 @@ <Unit filename="..\..\src\networkClient.cpp" /> <Unit filename="..\..\src\networkClient.h" /> <Unit filename="..\..\src\networkProtocol.h" /> - <Unit filename="..\..\src\ogconsole.cpp" /> - <Unit filename="..\..\src\ogconsole.h" /> <Unit filename="..\..\src\opengateclient.cpp" /> <Unit filename="..\..\src\tinyxml\tinyxml.cpp" /> <Unit filename="..\..\src\tinyxml\tinyxml.h" /> Modified: branches/ogsector/win32/ogsectorclient/ogsectorclient.exe =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2007-05-20 20:42:10
|
Revision: 495 http://svn.sourceforge.net/opengate/?rev=495&view=rev Author: spom_spom Date: 2007-05-20 13:42:09 -0700 (Sun, 20 May 2007) Log Message: ----------- Add support for global configuration dialog (Press ESC). Atm. you can just quit the game, Also the looknfeel need improvement. Modified Paths: -------------- branches/ogsector/data/gui/layouts/opengateDocked.layout branches/ogsector/data/gui/schemes/opengate/opengate.imageset branches/ogsector/data/gui/schemes/opengate/opengate.png branches/ogsector/data/gui/schemes/opengate/opengate.scheme branches/ogsector/data/gui/schemes/opengate/opengateButtons.looknfeel branches/ogsector/src/DockedState.cpp branches/ogsector/src/DockedState.h branches/ogsector/src/GameState.h branches/ogsector/src/GameStateManager.cpp branches/ogsector/src/GameStateManager.h branches/ogsector/src/Makefile.am branches/ogsector/src/ShipConfigDialog.cpp branches/ogsector/src/UnDockedState.cpp branches/ogsector/src/UnDockedState.h branches/ogsector/src/opengateclient.cpp Added Paths: ----------- branches/ogsector/data/gui/layouts/dialogs/ConfigDialog.layout branches/ogsector/data/gui/schemes/opengate/textures/configMain.png branches/ogsector/src/ConfigDialog.cpp branches/ogsector/src/ConfigDialog.h Added: branches/ogsector/data/gui/layouts/dialogs/ConfigDialog.layout =================================================================== --- branches/ogsector/data/gui/layouts/dialogs/ConfigDialog.layout (rev 0) +++ branches/ogsector/data/gui/layouts/dialogs/ConfigDialog.layout 2007-05-20 20:42:09 UTC (rev 495) @@ -0,0 +1,69 @@ +<?xml version="1.0" ?> +<GUILayout> + <Window Type="opengate/StaticImage" Name="Config/Main"> + <Property Name="UnifiedPosition" Value="{{0.0,0},{0.0,0}}" /> + <Property Name="UnifiedSize" Value="{{1.0,0},{1.0,0}}" /> +<!-- <Property Name="UnifiedPosition" Value="{{0.0,23},{0.0,5}}" /> --> +<!-- <Property Name="UnifiedSize" Value="{{1.0,-46},{1.0,-10}}" /> --> + <Property Name="Alpha" Value="1" /> + + <Window Type="opengate/StaticImage" Name="Config/MainWindow"> + <Property Name="UnifiedPosition" Value="{{0.5,-202},{0.0,10}}" /> + <Property Name="UnifiedSize" Value="{{0.0,405},{0.0, 705}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:ConfigMainWindow image:full_image" /> + <Window Type="opengate/StaticImage" Name="Config/MainFrame"> + <Property Name="UnifiedPosition" Value="{{0.0,60},{0.0,109}}" /> + <Property Name="UnifiedSize" Value="{{1.0,-98},{1.0,-115}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Window Type="opengate/Button" Name="Config/ConnectButton"> + <Property Name="UnifiedPosition" Value="{{0.0,10},{0.0,10}}" /> + <Property Name="UnifiedSize" Value="{{0.0,80},{0.0, 48}}" /> + <Property Name="Disabled" Value="true" /> + <Property Name="Text" Value="Connect" /> + </Window> + <Window Type="opengate/Button" Name="Config/GraphicButton"> + <Property Name="UnifiedPosition" Value="{{0.0,10},{0.0,60}}" /> + <Property Name="UnifiedSize" Value="{{0.0,80},{0.0, 48}}" /> + <Property Name="Disabled" Value="true" /> + <Property Name="Text" Value="Graphic" /> + </Window> + <Window Type="opengate/Button" Name="Config/SoundButton"> + <Property Name="UnifiedPosition" Value="{{0.0,10},{0.0,110}}" /> + <Property Name="UnifiedSize" Value="{{0.0,80},{0.0, 48}}" /> + <Property Name="Disabled" Value="true" /> + <Property Name="Text" Value="Sound" /> + </Window> + <Window Type="opengate/Button" Name="Config/ControlsButton"> + <Property Name="UnifiedPosition" Value="{{0.0,10},{0.0,160}}" /> + <Property Name="UnifiedSize" Value="{{0.0,80},{0.0, 48}}" /> + <Property Name="Disabled" Value="true" /> + <Property Name="Text" Value="Controls" /> + </Window> + <Window Type="opengate/Button" Name="Config/CreditsButton"> + <Property Name="UnifiedPosition" Value="{{0.0,10},{0.0,210}}" /> + <Property Name="UnifiedSize" Value="{{0.0,80},{0.0, 48}}" /> + <Property Name="Disabled" Value="true" /> + <Property Name="Text" Value="Credits" /> + </Window> + <Window Type="opengate/Button" Name="Config/QuitButton"> + <Property Name="UnifiedPosition" Value="{{0.0,10},{0.0,260}" /> + <Property Name="UnifiedSize" Value="{{0.0,80},{0.0, 48}}" /> + <Property Name="Text" Value="Quit Opengate" /> + </Window> + <Window Type="opengate/Button" Name="Config/BackButton"> + <Property Name="UnifiedPosition" Value="{{0.0,10},{1.0,-38}" /> + <Property Name="UnifiedSize" Value="{{0.0,80},{0.0, 24}}" /> + <Property Name="Text" Value="Back" /> + </Window> + <Window Type="opengate/StaticImage" Name="Config/SubFrame"> + <Property Name="UnifiedPosition" Value="{{0.0,100},{0.0,10}}" /> + <Property Name="UnifiedSize" Value="{{1.0,-110},{1.0, -20}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + </Window> + </Window> + </Window> + </Window> +</GUILayout> Modified: branches/ogsector/data/gui/layouts/opengateDocked.layout =================================================================== --- branches/ogsector/data/gui/layouts/opengateDocked.layout 2007-05-20 19:41:21 UTC (rev 494) +++ branches/ogsector/data/gui/layouts/opengateDocked.layout 2007-05-20 20:42:09 UTC (rev 495) @@ -183,6 +183,10 @@ <Property Name="Image" Value="set:MainWindowTopLeft image:full_image" /> </Window> + <Window Type="opengate/RoundConfigButton" Name="Docked/MainWindow/ConfigButton"> + <Property Name="UnifiedPosition" Value="{{0.0,35},{0.0,75}}" /> + <Property Name="UnifiedSize" Value="{{0.0,18},{0.0,18}}" /> + </Window> <Window Type="opengate/GreyButtonUp" Name="Docked/MainWindow/ConsoleMinButton"> <Property Name="UnifiedPosition" Value="{{0.0,+74},{0.0,+49}}" /> <Property Name="UnifiedSize" Value="{{0.0,13},{0.0,13}}" /> Modified: branches/ogsector/data/gui/schemes/opengate/opengate.imageset =================================================================== --- branches/ogsector/data/gui/schemes/opengate/opengate.imageset 2007-05-20 19:41:21 UTC (rev 494) +++ branches/ogsector/data/gui/schemes/opengate/opengate.imageset 2007-05-20 20:42:09 UTC (rev 495) @@ -34,10 +34,17 @@ <Image Name="GreyButtonDownNormal" XPos="409" YPos="65" Width="13" Height="13" /> <Image Name="GreyButtonDownHover" XPos="424" YPos="65" Width="13" Height="13" /> <Image Name="GreyButtonDownPushed" XPos="439" YPos="65" Width="13" Height="13" /> + <Image Name="RoundConfigButtonNormal" XPos="372" YPos="92" Width="18" Height="18" /> + <Image Name="RoundConfigButtonHover" XPos="391" YPos="92" Width="18" Height="18" /> + <Image Name="RoundConfigButtonPushed" XPos="410" YPos="92" Width="18" Height="18" /> + <Image Name="RoundHelpButtonNormal" XPos="372" YPos="111" Width="18" Height="18" /> + <Image Name="RoundHelpButtonHover" XPos="391" YPos="111" Width="18" Height="18" /> + <Image Name="RoundHelpButtonPushed" XPos="410" YPos="111" Width="18" Height="18" /> <Image Name="ConsoleMouseTextBar" XPos="313" YPos="89" Width="5" Height="14" /> <Image Name="ConsoleMouseEditBoxCarat" XPos="308" YPos="89" Width="1" Height="14" /> + <Image Name="AltProgressLeft" XPos="10" YPos="10" Width="10" Height="10" /> <Image Name="AltProgressMiddle" XPos="20" YPos="10" Width="10" Height="10" /> <Image Name="AltProgressRight" XPos="30" YPos="10" Width="10" Height="10" /> Modified: branches/ogsector/data/gui/schemes/opengate/opengate.png =================================================================== (Binary files differ) Modified: branches/ogsector/data/gui/schemes/opengate/opengate.scheme =================================================================== --- branches/ogsector/data/gui/schemes/opengate/opengate.scheme 2007-05-20 19:41:21 UTC (rev 494) +++ branches/ogsector/data/gui/schemes/opengate/opengate.scheme 2007-05-20 20:42:09 UTC (rev 495) @@ -17,6 +17,7 @@ <ImagesetFromImage Name="MainConsoleFrameHorizontalMiddle" Filename="textures/mainConsoleFrameHorizontalMiddle.png" /> <ImagesetFromImage Name="MainConsoleFrameVerticalSide" Filename="textures/mainConsoleFrameVerticalSide.png" /> <ImagesetFromImage Name="MainConsoleFrameVerticalMiddle" Filename="textures/mainConsoleFrameVerticalMiddle.png" /> + <ImagesetFromImage Name="ConfigMainWindow" Filename="textures/configMain.png" /> <Font Name="BlueHighway-12" Filename="BlueHighway-12.font" /> <Font Name="BlueHighway-10" Filename="BlueHighway-10.font" /> @@ -78,6 +79,16 @@ Renderer="Falagard/SystemButton" LookNFeel="opengate/GreyButtonDown" /> <FalagardMapping + WindowType="opengate/RoundConfigButton" + TargetType="CEGUI/PushButton" + Renderer="Falagard/SystemButton" + LookNFeel="opengate/RoundConfigButton" /> + <FalagardMapping + WindowType="opengate/RoundHelpButton" + TargetType="CEGUI/PushButton" + Renderer="Falagard/SystemButton" + LookNFeel="opengate/RoundHelpButton" /> + <FalagardMapping WindowType="opengate/ConsoleScrollButtonUp" TargetType="CEGUI/PushButton" Renderer="Falagard/SystemButton" Modified: branches/ogsector/data/gui/schemes/opengate/opengateButtons.looknfeel =================================================================== --- branches/ogsector/data/gui/schemes/opengate/opengateButtons.looknfeel 2007-05-20 19:41:21 UTC (rev 494) +++ branches/ogsector/data/gui/schemes/opengate/opengateButtons.looknfeel 2007-05-20 20:42:09 UTC (rev 495) @@ -145,8 +145,6 @@ </Layer> </StateImagery> </WidgetLook> - - <!-- *************************************************** opengate/HorizontalScrollLeftThumb @@ -396,9 +394,133 @@ </Layer> </StateImagery> </WidgetLook> + <!-- + *************************************************** + opengate/RoundConfigButton + *************************************************** + --> + <WidgetLook name="opengate/RoundConfigButton"> + <ImagerySection name="normal"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image type="LeftEdge" imageset="opengate" image="RoundConfigButtonNormal" /> + </FrameComponent> + </ImagerySection> + <ImagerySection name="hover"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image type="LeftEdge" imageset="opengate" image="RoundConfigButtonHover" /> + </FrameComponent> + </ImagerySection> + <ImagerySection name="pushed"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image type="LeftEdge" imageset="opengate" image="RoundConfigButtonPushed" /> + </FrameComponent> + </ImagerySection> + <StateImagery name="Normal"> + <Layer> + <Section section="normal" /> + </Layer> + </StateImagery> + <StateImagery name="Hover"> + <Layer> + <Section section="hover" /> + </Layer> + </StateImagery> + <StateImagery name="Pushed"> + <Layer> + <Section section="pushed" /> + </Layer> + </StateImagery> + <StateImagery name="Disabled"> + <Layer> + <Section section="normal"> + <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" /> + </Section> + </Layer> + </StateImagery> + </WidgetLook> <!-- *************************************************** + opengate/RoundHelpButton + *************************************************** + --> + <WidgetLook name="opengate/RoundHelpButton"> + <ImagerySection name="normal"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image type="LeftEdge" imageset="opengate" image="RoundHelpButtonNormal" /> + </FrameComponent> + </ImagerySection> + <ImagerySection name="hover"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image type="LeftEdge" imageset="opengate" image="RoundHelpButtonHover" /> + </FrameComponent> + </ImagerySection> + <ImagerySection name="pushed"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image type="LeftEdge" imageset="opengate" image="RoundHelpButtonPushed" /> + </FrameComponent> + </ImagerySection> + <StateImagery name="Normal"> + <Layer> + <Section section="normal" /> + </Layer> + </StateImagery> + <StateImagery name="Hover"> + <Layer> + <Section section="hover" /> + </Layer> + </StateImagery> + <StateImagery name="Pushed"> + <Layer> + <Section section="pushed" /> + </Layer> + </StateImagery> + <StateImagery name="Disabled"> + <Layer> + <Section section="normal"> + <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" /> + </Section> + </Layer> + </StateImagery> + </WidgetLook> + <!-- + *************************************************** opengate/ConsoleScrollButtonUp *************************************************** --> Added: branches/ogsector/data/gui/schemes/opengate/textures/configMain.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/gui/schemes/opengate/textures/configMain.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/src/ConfigDialog.cpp =================================================================== --- branches/ogsector/src/ConfigDialog.cpp (rev 0) +++ branches/ogsector/src/ConfigDialog.cpp 2007-05-20 20:42:09 UTC (rev 495) @@ -0,0 +1,66 @@ +/*************************************************************************** + * 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 "ConfigDialog.h" +#include "common.h" +#include "GameStateManager.h" +#include <CEGUI/elements/CEGUIPushButton.h> + +namespace OpenGate{ + +ConfigDialog::ConfigDialog( DeviceInfo * devices ) + : rootWindow_( CEGUI::WindowManager::getSingleton().loadWindowLayout( "dialogs/ConfigDialog.layout" ) ), + devices_( devices ) { + setupEventHandlers(); + hide(); +} + +ConfigDialog::~ConfigDialog(){ + if ( devices_->guiSystem ){ + if ( devices_->guiSystem->getGUISheet() ){ + devices_->guiSystem->getGUISheet()->removeChildWindow( rootWindow_ ); + } + } + CEGUI::WindowManager::getSingleton().destroyWindow( rootWindow_ ); +} + +void ConfigDialog::show( ){ + visible_ = true; + rootWindow_->show(); + rootWindow_->moveToFront(); +} + +void ConfigDialog::hide( ){ + visible_ = false; + rootWindow_->hide(); +} + +void ConfigDialog::setupEventHandlers(){ + CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton(); + + BIND_CEGUI_EVENT( wmgr.getWindow( (CEGUI::utf8*)"Config/QuitButton" ), + CEGUI::PushButton::EventClicked, ConfigDialog::handleQuitButton ); +} + +bool ConfigDialog::handleQuitButton( const CEGUI::EventArgs & e ){ + devices_->gameStateRoot->shutdown(); +} + +} // namespace OpenGate Added: branches/ogsector/src/ConfigDialog.h =================================================================== --- branches/ogsector/src/ConfigDialog.h (rev 0) +++ branches/ogsector/src/ConfigDialog.h 2007-05-20 20:42:09 UTC (rev 495) @@ -0,0 +1,60 @@ +/*************************************************************************** + * 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_CONFIGDIALOG__H +#define _OPENGATE_CONFIGDIALOG__H + +#include "GameState.h" +#include <CEGUIWindow.h> + +namespace OpenGate{ + +class ConfigDialog { +public: + ConfigDialog( DeviceInfo * devices ); + ~ConfigDialog(); + + /*! This method is used to show the configuration dialog. */ + void show( ); + + /*! This method is used to hide the configuration dialog. */ + void hide( ); + + inline bool isVisible() const { return visible_; } + + virtual void setupEventHandlers(); + + bool handleQuitButton( const CEGUI::EventArgs & e ); + + bool handleBackButton( const CEGUI::EventArgs & e ); + + CEGUI::Window * rootWindow() { return rootWindow_; } + +protected: + + DeviceInfo * devices_; + + bool visible_; + CEGUI::Window * rootWindow_; +}; + +} //namespace OpenGate + +#endif // _OPENGATE_CONFIGDIALOG__H Modified: branches/ogsector/src/DockedState.cpp =================================================================== --- branches/ogsector/src/DockedState.cpp 2007-05-20 19:41:21 UTC (rev 494) +++ branches/ogsector/src/DockedState.cpp 2007-05-20 20:42:09 UTC (rev 495) @@ -119,9 +119,15 @@ Ogre::Viewport * vp = devices_->renderWindow->addViewport( sceneMgr_->getCamera( "StationCamera" ), 0, 0.0, 0.0, 1.0f, 1.0f ); vp->setBackgroundColour( Ogre::ColourValue( 0, 0, 0) ); minimiseConsole( ); + + CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"Config/BackButton" )->subscribeEvent( + CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber( &DockedState::handleConfigBackButton, this ) ) ; } void DockedState::exit(){ + CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"Config/BackButton" )->removeEvent( + CEGUI::PushButton::EventClicked ); + log_->info("Exiting dockstate"); overlayRootWindow_->hide(); devices_->console->stop(); @@ -142,7 +148,7 @@ bool DockedState::keyPressed( const OIS::KeyEvent & e ){ //** ESCAPE leads to shutdown; - if ( e.key == OIS::KC_ESCAPE) { shutdown(); } + if ( e.key == OIS::KC_ESCAPE) { switchConfigDialog( ); } if ( e.key == 70 ){ // 70 == Roll if ( !consoleMax_ ){ @@ -182,6 +188,8 @@ BIND_CEGUI_EVENT( wmgr.getWindow( (CEGUI::utf8*)"Docked/MainWindow/Quit" ), CEGUI::PushButton::EventClicked, DockedState::handleQuit ); + BIND_CEGUI_EVENT( wmgr.getWindow( (CEGUI::utf8*)"Docked/MainWindow/ConfigButton" ), + CEGUI::PushButton::EventClicked, DockedState::handleConfigButton ); BIND_CEGUI_EVENT( wmgr.getWindow( (CEGUI::utf8*)"Docked/MainWindow/Launch" ), CEGUI::PushButton::EventClicked, DockedState::handleLaunch ); BIND_CEGUI_EVENT( wmgr.getWindow( (CEGUI::utf8*)"Docked/MainWindow/ShipConfigButton" ), @@ -194,26 +202,13 @@ wmgr.getWindow( (CEGUI::utf8*)"Docked/MainWindow/ConsoleBackground" )->subscribeEvent( CEGUI::Window::EventSized, CEGUI::Event::Subscriber(&Console::handleResize, devices_->console ) ) ; - -// wmgr.getWindow( (CEGUI::utf8*)"Docked/MainWindow/ConsoleFrame" )->subscribeEvent( -// CEGUI::Window::EventSized, CEGUI::Event::Subscriber(&Console::handleResize, devices_->console ) ) ; } -bool DockedState::handleQuit( const CEGUI::EventArgs & e ){ - shutdown(); +bool DockedState::switchConfigDialog( ){ + devices_->gameStateRoot->switchConfigDialog( ); return true; } -bool DockedState::handleLaunch( const CEGUI::EventArgs & e ){ - parent_->start( parent_->findByName( "UnDockedState" ) ); - return true; -} - -bool DockedState::handleShipConfigButton( const CEGUI::EventArgs & e ){ - if ( shipConfigDialog_ ) shipConfigDialog_->setVisible( !shipConfigDialog_->isVisible() ); - return true; -} - bool DockedState::maximiseConsole( ){ CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"Docked/MainWindow/ConsoleFrame")-> setHeight(CEGUI::UDim( 0.8, 4.0 )); @@ -232,7 +227,4 @@ return true; } -bool DockedState::handleMaximiseConsole( const CEGUI::EventArgs & e ){ maximiseConsole(); return true; } -bool DockedState::handleMinimiseConsole( const CEGUI::EventArgs & e ){ minimiseConsole(); return true; } - } // namespace OpenGate Modified: branches/ogsector/src/DockedState.h =================================================================== --- branches/ogsector/src/DockedState.h 2007-05-20 19:41:21 UTC (rev 494) +++ branches/ogsector/src/DockedState.h 2007-05-20 20:42:09 UTC (rev 495) @@ -72,18 +72,27 @@ bool maximiseConsole( ); bool minimiseConsole( ); + bool switchConfigDialog( ); - bool handleShipConfigButton( const CEGUI::EventArgs & e ); - bool handleLaunch( const CEGUI::EventArgs & e ); - bool handleQuit( const CEGUI::EventArgs & e ); - bool handleMinimiseConsole( const CEGUI::EventArgs & e ); - bool handleMaximiseConsole( const CEGUI::EventArgs & e ); - protected: DockedState(); virtual ~DockedState(){} - CEGUI::Window * overlayRootWindow_; + inline bool handleQuit( const CEGUI::EventArgs & e ){ shutdown(); return true; } + inline bool handleLaunch( const CEGUI::EventArgs & e ){ + parent_->start( parent_->findByName( "UnDockedState" ) ); + return true; + } + inline bool handleShipConfigButton( const CEGUI::EventArgs & e ){ + if ( shipConfigDialog_ ) shipConfigDialog_->setVisible( !shipConfigDialog_->isVisible() ); + return true; + } + + inline bool handleMaximiseConsole( const CEGUI::EventArgs & e ){ return maximiseConsole(); } + inline bool handleMinimiseConsole( const CEGUI::EventArgs & e ){ return minimiseConsole(); } + inline bool handleConfigBackButton( const CEGUI::EventArgs & e ){ return switchConfigDialog(); } + inline bool handleConfigButton( const CEGUI::EventArgs & e ){ return switchConfigDialog(); } + Ogre::SceneManager * sceneMgr_; ShipConfigDialog * shipConfigDialog_; Modified: branches/ogsector/src/GameState.h =================================================================== --- branches/ogsector/src/GameState.h 2007-05-20 19:41:21 UTC (rev 494) +++ branches/ogsector/src/GameState.h 2007-05-20 20:42:09 UTC (rev 495) @@ -175,6 +175,8 @@ } } + CEGUI::Window * rootWindow() { return overlayRootWindow_; } + protected: /*! Constructor: This should be a private member of an inherited class. */ GameState() {}; @@ -206,6 +208,9 @@ DeviceInfo * devices_; LogManager * log_; + + CEGUI::Window * overlayRootWindow_; + }; #define DECLARE_GAMESTATE_CLASS(T) \ Modified: branches/ogsector/src/GameStateManager.cpp =================================================================== --- branches/ogsector/src/GameStateManager.cpp 2007-05-20 19:41:21 UTC (rev 494) +++ branches/ogsector/src/GameStateManager.cpp 2007-05-20 20:42:09 UTC (rev 495) @@ -29,6 +29,7 @@ #include "InputManager.h" #include "VesselManager.h" #include "UnDockedState.h" +#include "ConfigDialog.h" #include "EntityManager.h" #include <OgreFrameListener.h> @@ -48,6 +49,7 @@ devices_.console = NULL; vesselManager_ = NULL; + configDialog_ = NULL; //** without any gamestate, shutdown immediately; shutdownRequest_ = true; @@ -73,6 +75,8 @@ // // devices_.ogreRoot->renderOneFrame( ); // //} //** end just for test purposes + + configDialog_ = new ConfigDialog( &devices_ ); } GameStateManager::~GameStateManager( ){ @@ -112,6 +116,15 @@ // if ( devices_.ogreRoot ) delete devices_.ogreRoot; } +void GameStateManager::switchConfigDialog( ){ + if ( configDialog_->isVisible() ) { + configDialog_->hide(); + } else{ + configDialog_->show(); + } +} + + void GameStateManager::manageGameState( const std::string & stateName, GameState * state ){ StateInfo newStateInfo; newStateInfo.name = stateName; @@ -217,6 +230,7 @@ if ( !stateStack_.empty() ) { cleanup_( stateStack_.back() ); stateStack_.back()->exit(); + stateStack_.back()->rootWindow()->removeChildWindow( configDialog_->rootWindow() ); stateStack_.pop_back(); } @@ -224,6 +238,7 @@ stateStack_.push_back( state ); init_( state ); stateStack_.back()->enter(); + stateStack_.back()->rootWindow()->addChildWindow( configDialog_->rootWindow() ); } bool GameStateManager::pushGameState( GameState * state ){ Modified: branches/ogsector/src/GameStateManager.h =================================================================== --- branches/ogsector/src/GameStateManager.h 2007-05-20 19:41:21 UTC (rev 494) +++ branches/ogsector/src/GameStateManager.h 2007-05-20 20:42:09 UTC (rev 495) @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2006-2007 by OpenGate development team * + * Copyright (C) 2006-2007 by OpenGate development team * * spo...@us... * * * * This program is free software; you can redistribute it and/or modify * @@ -31,6 +31,7 @@ class LogManager; class InputManager; class VesselManager; +class ConfigDialog; class EquipmentManager; /*! @@ -55,6 +56,9 @@ /*! Destructor that cleans up the states before the instance dies. */ ~GameStateManager(); + ConfigDialog * configDialog() { return configDialog_; } + void switchConfigDialog( ); + /*! Store a game state to manage. */ void manageGameState( const std::string & stateName, GameState * state ); @@ -109,6 +113,8 @@ DeviceInfo devices_; /*! If this is set to true, the game state manager prepares to exit. */ bool shutdownRequest_; + + ConfigDialog * configDialog_; }; } // namespace OpenGate Modified: branches/ogsector/src/Makefile.am =================================================================== --- branches/ogsector/src/Makefile.am 2007-05-20 19:41:21 UTC (rev 494) +++ branches/ogsector/src/Makefile.am 2007-05-20 20:42:09 UTC (rev 495) @@ -16,6 +16,8 @@ tinyxml/tinyxmlparser.cpp \ Console.h \ Console.cpp \ + ConfigDialog.h \ + ConfigDialog.cpp \ Entity.h \ Entity.cpp \ EntityManager.h \ Modified: branches/ogsector/src/ShipConfigDialog.cpp =================================================================== --- branches/ogsector/src/ShipConfigDialog.cpp 2007-05-20 19:41:21 UTC (rev 494) +++ branches/ogsector/src/ShipConfigDialog.cpp 2007-05-20 20:42:09 UTC (rev 495) @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2006 by OpenGate development team * + * Copyright (C) 2006-2007 by OpenGate development team * * spo...@us... * * * * This program is free software; you can redistribute it and/or modify * Modified: branches/ogsector/src/UnDockedState.cpp =================================================================== --- branches/ogsector/src/UnDockedState.cpp 2007-05-20 19:41:21 UTC (rev 494) +++ branches/ogsector/src/UnDockedState.cpp 2007-05-20 20:42:09 UTC (rev 495) @@ -24,16 +24,20 @@ #include "networkClient.h" #include "InputManager.h" #include "Console.h" +#include "ConfigDialog.h" #include <iostream> #include <OgreTextAreaOverlayElement.h> #include <OgreFontManager.h> +#include <CEGUI/elements/CEGUIPushButton.h> + namespace OpenGate{ UnDockedState::UnDockedState( ){ consoleMax_ = false; + configMode_ = false; overlayRootWindow_ = NULL; } @@ -179,9 +183,15 @@ } minimiseConsole( ); + + CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"Config/BackButton" )->subscribeEvent( + CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&UnDockedState::handleConfigBackButton, this ) ) ; } void UnDockedState::exit(){ + 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(); @@ -198,6 +208,20 @@ sector_->destructAvatar( ); } +bool UnDockedState::switchConfigDialog( ){ + devices_->gameStateRoot->switchConfigDialog( ); + configMode_ = devices_->gameStateRoot->configDialog()->isVisible(); + + if ( configMode_ ){ + hudOverlay_->hide( ); + Ogre::OverlayManager::getSingleton().getByName( "Radar" )->hide(); + } else { + hudOverlay_->show( ); + Ogre::OverlayManager::getSingleton().getByName( "Radar" )->show(); + } + return true; +} + void UnDockedState::setupEventHandlers( ){ CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton(); @@ -245,18 +269,20 @@ bool UnDockedState::keyPressed( const OIS::KeyEvent & e ){ // std::cout << "UnDockedState: " << e.key << " " << (char)e.key<< std::endl; - //** ESCAPE leads to shutdown; - if ( e.key == OIS::KC_ESCAPE) { shutdown(); } + if ( e.key == OIS::KC_ESCAPE) { + switchConfigDialog(); + } - if ( e.key == 70 ){ // 70 == Roll - if ( !consoleMax_ ){ - maximiseConsole(); - } else { - minimiseConsole(); + if ( !chatMode_ && !configMode_ ){ + + if ( e.key == 70 ){ // 70 == Roll + if ( !consoleMax_ ){ + maximiseConsole(); + } else { + minimiseConsole(); + } } - } - if ( !chatMode_ ){ if ( e.key == OIS::KC_RETURN) { CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"ConsoleEdit")->activate(); // hudOverlay_->getChild( overlayName_ + "/ChatIn" )->show( ); @@ -363,173 +389,191 @@ } bool UnDockedState::keyReleased( const OIS::KeyEvent & e ){ - if ( sector_->avatar() != NULL ){ - // Avatar release break - if ( e.key == OIS::KC_NUMPAD3 ) { sector_->avatar()->setBreakPressed( false ); } - - // Avatar release afterburner - if ( e.key == OIS::KC_NUMPAD9 ) { sector_->avatar()->setAfterburnerPressed( false ); } - } + if (!configMode_){ + if ( sector_->avatar() != NULL ){ + // Avatar release break + if ( e.key == OIS::KC_NUMPAD3 ) { sector_->avatar()->setBreakPressed( false ); } + + // Avatar release afterburner + if ( e.key == OIS::KC_NUMPAD9 ) { sector_->avatar()->setAfterburnerPressed( false ); } + } + } return true; } bool UnDockedState::mouseMoved( const OIS::MouseEvent & e ){ - mousePointer_->setLeft( mousePointer_->getLeft( ) + e.state.X.rel ); - mousePointer_->setTop( mousePointer_->getTop( ) + e.state.Y.rel ); - - Ogre::Real mousePointerWidth = mousePointer_->getWidth(); - Ogre::Real mousePointerHeight = mousePointer_->getHeight(); - if ( mousePointer_->getLeft( ) < -mousePointerWidth ) mousePointer_->setLeft( -mousePointerWidth ); - if ( mousePointer_->getTop( ) < -mousePointerHeight ) mousePointer_->setTop( -mousePointerHeight ); - - if ( mousePointer_->getLeft( ) > windowsWidth_-mousePointerWidth ) mousePointer_->setLeft( windowsWidth_- - mousePointerWidth ); - if ( mousePointer_->getTop( ) > windowsHeight_-mousePointerHeight ) mousePointer_->setTop( windowsHeight_- - mousePointerHeight ); - - if ( sector_->avatar() != 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; -// return true; - - int relativToMidPointX = (int)rint( (mousePointer_->getLeft( ) + mousePointerWidth) - windowsHalfWidth_ ); - int relativToMidPointY = (int)rint( (mousePointer_->getTop( ) + mousePointerHeight) - windowsHalfHeight_ ); - - int minActiveZonePercent = 5; - int maxActiveZonePercent = 90; - - double minRadius = ( windowsHeight_ / 2.0 ) * minActiveZonePercent / 100; - double maxRadius = ( windowsHeight_ / 2.0 ) * maxActiveZonePercent / 100; - - Ogre::Real yaw = 0, pitch = 0; - if ( relativToMidPointX < 0 ) { - yaw = (relativToMidPointX+minRadius) / (maxRadius - minRadius); - } else { - yaw = (relativToMidPointX-minRadius) / (maxRadius - minRadius); - } - if ( relativToMidPointY < 0 ) { - pitch = (relativToMidPointY + minRadius) / (maxRadius - minRadius); - } else { - pitch = (relativToMidPointY - minRadius) / (maxRadius - minRadius); - } - - if ( fabs( relativToMidPointX ) < minRadius ) yaw = 0.0; - if ( fabs( relativToMidPointY ) < minRadius ) pitch = 0.0; - - yaw = min( yaw, 1.0f ); yaw = max( yaw, -1.0f ); - pitch = min( pitch, 1.0f ); pitch = max( pitch, -1.0f ); + if (!configMode_){ + mousePointer_->setLeft( mousePointer_->getLeft( ) + e.state.X.rel ); + mousePointer_->setTop( mousePointer_->getTop( ) + e.state.Y.rel ); - // std::cout << ( String("Mouse rel: ") + StringConverter::toString( e.state.X.rel ) + - // String(" ") + StringConverter::toString( e.state.Y.rel ) + - // String(" abs: ") + StringConverter::toString( e.state.X.abs ) + - // String(" ") + StringConverter::toString( e.state.Y.abs ) + - // String(" relMid: ") + StringConverter::toString( relativToMidPointX ) + - // String(" ") + StringConverter::toString( relativToMidPointY ) + - // String(" yaw: ") + StringConverter::toString( yaw ) + - // String(" pitch ") + StringConverter::toString( pitch ) ) << std::endl; + Ogre::Real mousePointerWidth = mousePointer_->getWidth(); + Ogre::Real mousePointerHeight = mousePointer_->getHeight(); + if ( mousePointer_->getLeft( ) < -mousePointerWidth ) mousePointer_->setLeft( -mousePointerWidth ); + if ( mousePointer_->getTop( ) < -mousePointerHeight ) mousePointer_->setTop( -mousePointerHeight ); - sector_->avatar()->setScaledYaw( -yaw ); - sector_->avatar()->setScaledPitch( -pitch ); - } // if avatar; - - if ( e.state.Z.rel < -10 ){ // mouse wheel up - setTarget( sector_->nextTarget() ); - } else if ( e.state.Z.rel > 10 ) { - setTarget( sector_->prevTarget() ); + if ( mousePointer_->getLeft( ) > windowsWidth_-mousePointerWidth ) mousePointer_->setLeft( windowsWidth_- + mousePointerWidth ); + if ( mousePointer_->getTop( ) > windowsHeight_-mousePointerHeight ) mousePointer_->setTop( windowsHeight_- + mousePointerHeight ); + + if ( sector_->avatar() != 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; + // return true; + + int relativToMidPointX = (int)rint( (mousePointer_->getLeft( ) + mousePointerWidth) - windowsHalfWidth_ ); + int relativToMidPointY = (int)rint( (mousePointer_->getTop( ) + mousePointerHeight) - windowsHalfHeight_ ); + + int minActiveZonePercent = 5; + int maxActiveZonePercent = 90; + + double minRadius = ( windowsHeight_ / 2.0 ) * minActiveZonePercent / 100; + double maxRadius = ( windowsHeight_ / 2.0 ) * maxActiveZonePercent / 100; + + Ogre::Real yaw = 0, pitch = 0; + if ( relativToMidPointX < 0 ) { + yaw = (relativToMidPointX+minRadius) / (maxRadius - minRadius); + } else { + yaw = (relativToMidPointX-minRadius) / (maxRadius - minRadius); + } + if ( relativToMidPointY < 0 ) { + pitch = (relativToMidPointY + minRadius) / (maxRadius - minRadius); + } else { + pitch = (relativToMidPointY - minRadius) / (maxRadius - minRadius); + } + + if ( fabs( relativToMidPointX ) < minRadius ) yaw = 0.0; + if ( fabs( relativToMidPointY ) < minRadius ) pitch = 0.0; + + yaw = min( yaw, 1.0f ); yaw = max( yaw, -1.0f ); + pitch = min( pitch, 1.0f ); pitch = max( pitch, -1.0f ); + + // std::cout << ( String("Mouse rel: ") + StringConverter::toString( e.state.X.rel ) + + // String(" ") + StringConverter::toString( e.state.Y.rel ) + + // String(" abs: ") + StringConverter::toString( e.state.X.abs ) + + // String(" ") + StringConverter::toString( e.state.Y.abs ) + + // String(" relMid: ") + StringConverter::toString( relativToMidPointX ) + + // String(" ") + StringConverter::toString( relativToMidPointY ) + + // String(" yaw: ") + StringConverter::toString( yaw ) + + // String(" pitch ") + StringConverter::toString( pitch ) ) << std::endl; + + sector_->avatar()->setScaledYaw( -yaw ); + sector_->avatar()->setScaledPitch( -pitch ); + } // if avatar; + + if ( e.state.Z.rel < -10 ){ // mouse wheel up + setTarget( sector_->nextTarget() ); + } else if ( e.state.Z.rel > 10 ) { + setTarget( sector_->prevTarget() ); + } + } else { + CEGUI::System::getSingleton().injectMouseMove( e.state.X.rel,e.state.Y.rel ); } - return true; } -bool UnDockedState::mousePressed( const OIS::MouseEvent &e , OIS::MouseButtonID button ){ - if ( sector_->avatar() != NULL ){ - // std::cout << "Mouse Button: " << button << std::endl; - if ( button == 0){ - sector_->avatar()->setFirePressed( true ); +bool UnDockedState::mousePressed( const OIS::MouseEvent &e , OIS::MouseButtonID id ){ + if ( !configMode_ ){ + if ( sector_->avatar() != NULL ){ + // std::cout << "Mouse Button: " << id << std::endl; + if ( id == 0){ + sector_->avatar()->setFirePressed( true ); + } } + } else { + CEGUI::System::getSingleton().injectMouseButtonDown( convertOgreButtonToCegui( id ) ); } return true; } -bool UnDockedState::mouseReleased( const OIS::MouseEvent &e , OIS::MouseButtonID button ){ - if ( sector_->avatar() != NULL ){ - // std::cout << "Mouse Button: " << button << std::endl; - if ( button == 0){ - sector_->avatar()->setFirePressed( false); +bool UnDockedState::mouseReleased( const OIS::MouseEvent &e , OIS::MouseButtonID id ){ + if ( !configMode_ ){ + if ( sector_->avatar() != NULL ){ + // std::cout << "Mouse Button: " << id << std::endl; + if ( id == 0){ + sector_->avatar()->setFirePressed( false); + } } + } else{ + CEGUI::System::getSingleton().injectMouseButtonUp( convertOgreButtonToCegui( id ) ); } return true; } bool UnDockedState::axisMoved( const OIS::JoyStickEvent & e, int axis ){ - if ( sector_->avatar() != NULL ){ - //** axis definition for my MS Sidewinder FF2 - int joyStickAxisX = 0; - int joyStickAxisY = 1; - int joyStickAxisZ = 5; - int throwSliderAxis = 6; - double axisScale = 32768; - - //** deadzone; - int minActiveZonePercent = 10; - int maxActiveZonePercent = 95; - - double minRadius = ( axisScale ) * minActiveZonePercent / 100; - double maxRadius = ( axisScale ) * maxActiveZonePercent / 100; - - Ogre::Real yaw = (e.state.mAxes[ joyStickAxisX ].abs) / (maxRadius); - Ogre::Real pitch = (e.state.mAxes[ joyStickAxisY ].abs) / (maxRadius); - Ogre::Real roll = (e.state.mAxes[ joyStickAxisZ ].abs) / (maxRadius); - Ogre::Real thrust = ( -e.state.mAxes[ throwSliderAxis ].abs + axisScale ) / (maxRadius*2); - - yaw = min( yaw, 1.0f ); yaw = max( yaw, -1.0f ); - pitch = min( pitch, 1.0f ); pitch = max( pitch, -1.0f ); - roll = min( roll, 1.0f ); roll = max( roll, -1.0f ); - thrust = min( thrust, 1.0f ); thrust = max( thrust, 0.0f ); - - if ( fabs( e.state.mAxes[ joyStickAxisX ].abs ) < minRadius ) yaw = 0.0; - if ( fabs( e.state.mAxes[ joyStickAxisY ].abs ) < minRadius ) pitch = 0.0; - if ( fabs( e.state.mAxes[ joyStickAxisZ ].abs ) < minRadius ) roll = 0.0; - if ( fabs( -e.state.mAxes[ throwSliderAxis ].abs + axisScale ) < minRadius ) thrust = 0.0; - - //** little deadzone ; - // window_->setDebugText( "Joy Axis: X: " + StringConverter::toString( e.state.mAxes[ joyStickAxisX ].abs ) + - // " Y: " + StringConverter::toString( e.state.mAxes[ joyStickAxisY ].abs ) + - // " Z: " + StringConverter::toString( e.state.mAxes[ joyStickAxisZ ].abs ) + - // " T: " + StringConverter::toString( e.state.mAxes[ throwSliderAxis ].abs ) + - // " yaw: " + StringConverter::toString(yaw) + - // " pitch: " + StringConverter::toString(pitch) + - // " 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. ); - } // if avatar + if ( !configMode_ ){ + if ( sector_->avatar() != NULL ){ + //** axis definition for my MS Sidewinder FF2 + int joyStickAxisX = 0; + int joyStickAxisY = 1; + int joyStickAxisZ = 5; + int throwSliderAxis = 6; + double axisScale = 32768; + + //** deadzone; + int minActiveZonePercent = 10; + int maxActiveZonePercent = 95; + + double minRadius = ( axisScale ) * minActiveZonePercent / 100; + double maxRadius = ( axisScale ) * maxActiveZonePercent / 100; + + Ogre::Real yaw = (e.state.mAxes[ joyStickAxisX ].abs) / (maxRadius); + Ogre::Real pitch = (e.state.mAxes[ joyStickAxisY ].abs) / (maxRadius); + Ogre::Real roll = (e.state.mAxes[ joyStickAxisZ ].abs) / (maxRadius); + Ogre::Real thrust = ( -e.state.mAxes[ throwSliderAxis ].abs + axisScale ) / (maxRadius*2); + + yaw = min( yaw, 1.0f ); yaw = max( yaw, -1.0f ); + pitch = min( pitch, 1.0f ); pitch = max( pitch, -1.0f ); + roll = min( roll, 1.0f ); roll = max( roll, -1.0f ); + thrust = min( thrust, 1.0f ); thrust = max( thrust, 0.0f ); + + if ( fabs( e.state.mAxes[ joyStickAxisX ].abs ) < minRadius ) yaw = 0.0; + if ( fabs( e.state.mAxes[ joyStickAxisY ].abs ) < minRadius ) pitch = 0.0; + if ( fabs( e.state.mAxes[ joyStickAxisZ ].abs ) < minRadius ) roll = 0.0; + if ( fabs( -e.state.mAxes[ throwSliderAxis ].abs + axisScale ) < minRadius ) thrust = 0.0; + + //** little deadzone ; + // window_->setDebugText( "Joy Axis: X: " + StringConverter::toString( e.state.mAxes[ joyStickAxisX ].abs ) + + // " Y: " + StringConverter::toString( e.state.mAxes[ joyStickAxisY ].abs ) + + // " Z: " + StringConverter::toString( e.state.mAxes[ joyStickAxisZ ].abs ) + + // " T: " + StringConverter::toString( e.state.mAxes[ throwSliderAxis ].abs ) + + // " yaw: " + StringConverter::toString(yaw) + + // " pitch: " + StringConverter::toString(pitch) + + // " 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. ); + } // if avatar + } return true; } bool UnDockedState::buttonPressed( const OIS::JoyStickEvent & e , int button){ - // window_->setDebugText( "Joy: " + toStr( button ) ); - - if ( sector_->avatar() != NULL ){ - if ( button == 0){ - sector_->avatar()->setFirePressed( true ); - } - } // if avatar_ + if ( !configMode_ ){ + // window_->setDebugText( "Joy: " + toStr( button ) ); + if ( sector_->avatar() != NULL ){ + if ( button == 0){ + sector_->avatar()->setFirePressed( true ); + } + } // if avatar_ + } return true; } bool UnDockedState::buttonReleased( const OIS::JoyStickEvent & e , int button){ - // window_->setDebugText( "Joy: " + toStr( button ) ); - if ( sector_->avatar() != NULL ){ - - if ( button == 0){ - sector_->avatar()->setFirePressed( false ); - } - } // if avatar_ + if ( !configMode_ ){ + // window_->setDebugText( "Joy: " + toStr( button ) ); + if ( sector_->avatar() != NULL ){ + + if ( button == 0){ + sector_->avatar()->setFirePressed( false ); + } + } // if avatar_ + } return true; } @@ -917,9 +961,6 @@ return true; } -bool UnDockedState::handleMaximiseConsole( const CEGUI::EventArgs & e ){ maximiseConsole(); return true; } -bool UnDockedState::handleMinimiseConsole( const CEGUI::EventArgs & e ){ minimiseConsole(); return true; } - void UnDockedState::spawnAI( const std::string & name ){ sector_->spawnAiObject( name ); } Modified: branches/ogsector/src/UnDockedState.h =================================================================== --- branches/ogsector/src/UnDockedState.h 2007-05-20 19:41:21 UTC (rev 494) +++ branches/ogsector/src/UnDockedState.h 2007-05-20 20:42:09 UTC (rev 495) @@ -51,6 +51,8 @@ void exit(); + bool switchConfigDialog( ); + virtual void setupEventHandlers(); virtual bool frameStarted( const Ogre::FrameEvent & evt ); @@ -76,9 +78,6 @@ bool maximiseConsole( ); bool minimiseConsole( ); - bool handleMinimiseConsole( const CEGUI::EventArgs & e ); - bool handleMaximiseConsole( const CEGUI::EventArgs & e ); - SectorObject * target( ) { return target_; } Sector * sector( ) { return sector_; } @@ -89,12 +88,15 @@ UnDockedState( ); virtual ~UnDockedState( ){} + inline bool handleMaximiseConsole( const CEGUI::EventArgs & e ){ maximiseConsole(); return true; } + inline bool handleMinimiseConsole( const CEGUI::EventArgs & e ){ minimiseConsole(); return true; } + inline bool handleConfigBackButton( const CEGUI::EventArgs & e ){ return switchConfigDialog( ); } + void toggleNextCamera_( ); void updateCamera_( ); void updateHUD_( ); void updateRadar_( ); - CEGUI::Window * overlayRootWindow_; Ogre::RenderWindow * window_; Ogre::Root * root_; Ogre::SceneManager * sceneMgr_; @@ -133,6 +135,7 @@ std::string chatString_; bool chatMode_; + bool configMode_; bool consoleMax_; bool duelistPilot_; bool duelistTarget_; Modified: branches/ogsector/src/opengateclient.cpp =================================================================== --- branches/ogsector/src/opengateclient.cpp 2007-05-20 19:41:21 UTC (rev 494) +++ branches/ogsector/src/opengateclient.cpp 2007-05-20 20:42:09 UTC (rev 495) @@ -38,8 +38,9 @@ log->setLogFile( "OpenGate.log" ); log->setChatLogFile( "OpenGateChat.log" ); log->info("Starting up"); -#ifdef PACKAGE_STRING - log->info(PACKAGE_STRING); + +#ifdef PACKAGE_STRING + log->info(PACKAGE_STRING); #endif std::string username = "testuser"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2007-05-20 21:28:42
|
Revision: 501 http://svn.sourceforge.net/opengate/?rev=501&view=rev Author: egore Date: 2007-05-20 14:28:41 -0700 (Sun, 20 May 2007) Log Message: ----------- add commodity manager (possibly memleaking) Modified Paths: -------------- branches/ogsector/data/equipment.xml branches/ogsector/src/Entity.h branches/ogsector/src/EntityManager.cpp branches/ogsector/src/EntityManager.h branches/ogsector/src/GameStateManager.cpp branches/ogsector/src/GameStateManager.h Added Paths: ----------- branches/ogsector/data/commodities.xml Added: branches/ogsector/data/commodities.xml =================================================================== --- branches/ogsector/data/commodities.xml (rev 0) +++ branches/ogsector/data/commodities.xml 2007-05-20 21:28:41 UTC (rev 501) @@ -0,0 +1,5 @@ +<?xml version="1.0"?> + +<commodities> + <Resource id="1" location="../../trunk/data/commodities/aluminium.xml"/> +</commodities> Modified: branches/ogsector/data/equipment.xml =================================================================== --- branches/ogsector/data/equipment.xml 2007-05-20 21:27:12 UTC (rev 500) +++ branches/ogsector/data/equipment.xml 2007-05-20 21:28:41 UTC (rev 501) @@ -1,5 +1,6 @@ <?xml version="1.0"?> -<capacitor> - <Resource id="1" location="../../trunk/data/capacitors/s_c_15.xml"/> -</capacitor> +<equipment> + <Resource id="1" location="../../trunk/data/capacitors/s_c_15.xml" /> + <Resource id="2" location="../../trunk/data/ECMs/ghost.xml" /> +</equipment> Modified: branches/ogsector/src/Entity.h =================================================================== --- branches/ogsector/src/Entity.h 2007-05-20 21:27:12 UTC (rev 500) +++ branches/ogsector/src/Entity.h 2007-05-20 21:28:41 UTC (rev 501) @@ -21,8 +21,8 @@ #ifndef _OPENGATE_ENTITY_H #define _OPENGATE_ENTITY_H +#include <set> #include <string> -#include <vector> namespace OpenGate{ @@ -72,8 +72,9 @@ std::string className_; + /*! A unique ID to find this object \todo maybe push to a string and merge with Commodity.commodityID_ */ int id_; - + /*! The required tech level to interact with this object */ int techLevel_; /*! The mass of this entity. */ long mass_; @@ -93,23 +94,37 @@ class EquipmentTemplate : public EntityTemplate{ public: + inline void setDescription( const std::string & description ) { description_ = description; } + inline std::string description( ) const { return description_; } + + inline void setManufacturer( const std::string & manufacturer ) { manufacturer_ = manufacturer; } + inline std::string manufacturer( ) const { return manufacturer_; } + inline void setSize( short size ){ size_ = size; } inline short size( ) const { return size_; } + inline void setProductionCenters( const std::set < std::string > & productionCenter ) { productionCenter_ = productionCenter; } + inline std::set < std::string> productionCenters( ) const { return productionCenter_; } + + inline void setRequieredComponents( const std::set < Commodity * > & requieredComponents ) { requieredComponents_ = requieredComponents; } + inline std::set < Commodity * > requieredComponents( ) const { return requieredComponents_; } + protected: - EquipmentTemplate(): EntityTemplate() { + EquipmentTemplate(): EntityTemplate(), description_( "none" ), manufacturer_( "unkown" ) { size_ = 0; } - std::string _description; - // TODO: Company* _manufacturer; - // TODO: std::vector<char*> _productioncenter; - + /*! A rather long description of this component */ + std::string description_; + /*! Name of the company that produces this equipment */ + std::string manufacturer_; /*! The amount of slots necessary to plug in such a device. */ short size_; + /*! The places where this part of equipment is built */ + std::set < std::string > productionCenter_; + /*! The components required to build this equipment part */ + std::set < Commodity * > requieredComponents_; - std::vector<Commodity> _requierd_component[]; - }; /*! @@ -210,28 +225,37 @@ class Commodity : public EntityTemplate{ public: - Commodity(): EntityTemplate(), id_( "unknown" ) { + Commodity(): EntityTemplate(), commodityID_( "unknown" ) { meltingPoint_ = 0; + size_ = 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 setProductionCenters( const std::set < std::string > & productionCenters ) { productionCenters_ = productionCenters; } + inline std::set < std::string > productionCenters( ) const { return productionCenters_; } - 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_; } + inline void setCommodityID( const std::string & commodityID ) { commodityID_ = commodityID; } + inline std::string commodityID( ) const { return commodityID_; } + + inline void setSize( short size ){ size_ = size; } + inline short size( ) const { return size_; } + protected: - std::vector<std::string> productionCenter_; - std::string id_; - + /*! A list of all stations that produce this commodity */ + std::set < std::string > productionCenters_; + /*! The unique name of this commodity \todo check if that can be merged with EntityTemlpate.id_ */ + std::string commodityID_; + /*! The specific melting point of this commodity */ int meltingPoint_; + /*! The size this commodity requires in cargo unit (1 size = 1 cargo unit)*/ + short size_; + /*! The specific atomic wheight of this commodity */ double graviticSig_; }; Modified: branches/ogsector/src/EntityManager.cpp =================================================================== --- branches/ogsector/src/EntityManager.cpp 2007-05-20 21:27:12 UTC (rev 500) +++ branches/ogsector/src/EntityManager.cpp 2007-05-20 21:28:41 UTC (rev 501) @@ -67,6 +67,26 @@ } } +template<> EquipmentManager * Ogre::Singleton< EquipmentManager >::ms_Singleton = 0; + +EquipmentManager::EquipmentManager(): EntityManager(){ +} + +EquipmentManager::~EquipmentManager() { +} + +EquipmentManager & EquipmentManager::getSingleton( ){ + assert( ms_Singleton ); + return ( *ms_Singleton ); +} + +EquipmentManager * EquipmentManager::getSingletonPtr( ){ + if ( ms_Singleton == NULL ){ + LogManager::getSingleton().fatal( "CommodityManager not initialized." ); + } + return ms_Singleton; +} + EntityTemplate * EquipmentManager::loadAndCreate( int id, const std::string & fileName ){ TiXmlDocument doc( fileName ); @@ -161,6 +181,28 @@ //! \todo Add logic for things other than capacitors and ECMs } + // Production Data + std::set < std::string > productionCenters; + for ( pElem = hRoot.FirstChild( "production-center" ).Element(); pElem != 0; pElem = pElem->NextSiblingElement() ) { + productionCenters.insert( pElem->FirstChild()->Value() ); //!< \todo check return value! + } + entity->setProductionCenters( productionCenters ); + CommodityManager* commodityMgr = CommodityManager::getSingletonPtr(); + if ( !commodityMgr ) { + log_->fatal( "Cannot find the commodity manager, no production data available" ); + return NULL; + } + std::set < Commodity * > commodities; + for ( pElem = hRoot.FirstChild( "required-component" ).Element(); pElem != 0; pElem = pElem->NextSiblingElement() ) { + Commodity *commodity = commodityMgr->findByName ( pElem->FirstChild()->Value() ); //!< \todo check return value! + if ( commodity ) { + commodities.insert( commodity ); + } else { + log_->warn( fileName + " has unsatisfied commodities." ); + } + } + entity->setRequieredComponents( commodities ); + if ( templatesByName_.count( entity->name() ) == 0 ){ entity->setID( id ); templatesByName_[ entity->name() ] = entity; @@ -170,19 +212,111 @@ log_->info( std::string( "Loaded " ) + equipmentType + std::string( ": ") + entity->factionName() + "/" + entity->name() ); } else { log_->warn( std::string( "Equipment with name: " ) + entity->factionName() + "/" + entity->name() + - " allready loaded" ); + " already loaded" ); } return entity; } -template<> EquipmentManager * Ogre::Singleton< EquipmentManager >::ms_Singleton = 0; +template<> CommodityManager * Ogre::Singleton< CommodityManager >::ms_Singleton = 0; -EquipmentManager::EquipmentManager(): EntityManager(){ +CommodityManager::CommodityManager(): EntityManager(){ } -EquipmentManager::~EquipmentManager() { +CommodityManager::~CommodityManager() { } +CommodityManager & CommodityManager::getSingleton( ){ + assert( ms_Singleton ); + return ( *ms_Singleton ); } +CommodityManager * CommodityManager::getSingletonPtr( ){ + if ( ms_Singleton == NULL ){ + LogManager::getSingleton().fatal( "CommodityManager not initialized." ); + } + return ms_Singleton; +} +EntityTemplate * CommodityManager::loadAndCreate( int id, const std::string & fileName ){ + + TiXmlDocument doc( fileName ); + bool loadOkay = doc.LoadFile(); + + if ( !loadOkay ) { + log_->fatal( std::string( "Failed to load commodity 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( "component", pElem->Value() ) != 0 ){ + log_->fatal( fileName + " is no commodity description" ); + return NULL; + } + + Commodity *entity = new Commodity; + + // Naming + pElem = hRoot.ChildElement( "name_en", 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( "id", 0 ).Element(); + if ( pElem ) entity->setCommodityID( pElem->FirstChild()->Value() ); + pElem = hRoot.ChildElement( "melting-point", 0 ).Element(); + if ( pElem ) entity->setMeltingPoint( toInt( pElem->FirstChild()->Value() ) ); + pElem = hRoot.ChildElement( "gravitic-sig", 0 ).Element(); + if ( pElem ) entity->setGraviticSig( toFloat( pElem->FirstChild()->Value() ) ); + + // Production Data + std::set < std::string > productionCenters; + for ( pElem = hRoot.FirstChild( "production-center" ).Element(); pElem != 0; pElem = pElem->NextSiblingElement() ) { + productionCenters.insert( pElem->FirstChild()->Value() ); //!< \todo check return value! + } + entity->setProductionCenters( productionCenters ); + //! \todo Add required components + + 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 Commodity: " ) + entity->factionName() + "/" + entity->name() ); + } else { + log_->warn( std::string( "Equipment with name: " ) + entity->factionName() + "/" + entity->name() + + " allready loaded" ); + } + return entity; +} + +} + + Modified: branches/ogsector/src/EntityManager.h =================================================================== --- branches/ogsector/src/EntityManager.h 2007-05-20 21:27:12 UTC (rev 500) +++ branches/ogsector/src/EntityManager.h 2007-05-20 21:28:41 UTC (rev 501) @@ -92,6 +92,40 @@ }; +/*! + * \brief This class is able to load equipment (reactors, engines, guns, etc.) + * from XML files. + * \author Christoph Brill <eg...@us...> + */ +class CommodityManager : public Ogre::Singleton< CommodityManager >, public EntityManager{ +public: + + /*! Get the single instance of the EquipmentManager */ + static CommodityManager & getSingleton( ); + + /*! Get the pointer to single instance of the EquipmentManager */ + static CommodityManager * getSingletonPtr( ); + + /*! Constructor */ + CommodityManager(); + + /*! Destructor that free's all loaded vessels */ + virtual ~CommodityManager(); + + virtual EntityTemplate * loadAndCreate( int id, const std::string & filename ); + + /*! This returns a commodity by it's given name \remarks The commodity needs to be loaded before \param commodityName The name of a commodity */ + Commodity * findByName( const std::string & commodityName ){ + if ( templatesByName_.count( commodityName ) ){ + return static_cast<Commodity *>(templatesByName_[ commodityName ]); + } else { + log_->fatal( std::string( "Unknown commodity with name :" ) + commodityName ); + return NULL; + } + } + +}; + } // namespace OpenGate #endif //_OPENGATE_ENTITYMANAGER_H Modified: branches/ogsector/src/GameStateManager.cpp =================================================================== --- branches/ogsector/src/GameStateManager.cpp 2007-05-20 21:27:12 UTC (rev 500) +++ branches/ogsector/src/GameStateManager.cpp 2007-05-20 21:28:41 UTC (rev 501) @@ -310,6 +310,9 @@ vesselManager_ = new VesselManager( ); vesselManager_->load( resourcePaths_, "ships.xml" ); + commodityManager_ = new CommodityManager( ); + commodityManager_->load( resourcePaths_, "commodities.xml" ); + equipmentManager_ = new EquipmentManager( ); equipmentManager_->load( resourcePaths_, "equipment.xml" ); Modified: branches/ogsector/src/GameStateManager.h =================================================================== --- branches/ogsector/src/GameStateManager.h 2007-05-20 21:27:12 UTC (rev 500) +++ branches/ogsector/src/GameStateManager.h 2007-05-20 21:28:41 UTC (rev 501) @@ -33,6 +33,7 @@ class VesselManager; class ConfigDialog; class EquipmentManager; +class CommodityManager; /*! * \brief The class defines the gamestate manager. @@ -44,7 +45,8 @@ class GameStateManager : public GameStateListener { public: - /*! \brief 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; @@ -62,7 +64,11 @@ /*! 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.*/ + /*! \brief 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 ); /*! capture network, called every frame. */ @@ -105,6 +111,7 @@ LogManager * log_; VesselManager * vesselManager_; EquipmentManager * equipmentManager_; + CommodityManager * commodityManager_; std::set < std::string > resourcePaths_; std::vector< GameState * > stateStack_; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2007-05-23 21:24:49
|
Revision: 508 http://svn.sourceforge.net/opengate/?rev=508&view=rev Author: spom_spom Date: 2007-05-23 14:24:50 -0700 (Wed, 23 May 2007) Log Message: ----------- Add: starting support for JG style HUD. Not yet finished and Im not happy with the images but you will see the idea. Modified Paths: -------------- branches/ogsector/data/gui/layouts/opengateDocked.layout branches/ogsector/data/gui/layouts/opengateUnDocked.layout branches/ogsector/data/gui/schemes/opengate/opengate.scheme branches/ogsector/data/simpleHUD.overlay branches/ogsector/src/DockedState.cpp branches/ogsector/src/GameStateManager.cpp branches/ogsector/src/Makefile.in branches/ogsector/src/SectorObjects.cpp branches/ogsector/src/SectorObjects.h branches/ogsector/src/UnDockedState.cpp branches/ogsector/src/UnDockedState.h Added Paths: ----------- branches/ogsector/data/gui/schemes/opengate/hud/ branches/ogsector/data/gui/schemes/opengate/hud/defaultHUD.imageset branches/ogsector/data/gui/schemes/opengate/hud/defaultHUD.odg branches/ogsector/data/gui/schemes/opengate/hud/defaultHUD.png branches/ogsector/data/gui/schemes/opengate/hud/defaultHUD.xcf Modified: branches/ogsector/data/gui/layouts/opengateDocked.layout =================================================================== --- branches/ogsector/data/gui/layouts/opengateDocked.layout 2007-05-22 12:57:43 UTC (rev 507) +++ branches/ogsector/data/gui/layouts/opengateDocked.layout 2007-05-23 21:24:50 UTC (rev 508) @@ -15,6 +15,7 @@ <Property Name="UnifiedSize" Value="{{1.0,-18},{1.0,-16}}" /> <Property Name="BackgroundEnabled" Value="False" /> <Property Name="FrameEnabled" Value="false" /> + <Property Name="RiseOnClick" Value="false" /> <Property Name="Image" Value="set:opengate image:ConsoleBackground50" /> </Window> <Window Type="opengate/StaticImage" Name="Docked/MainWindow/ConsoleFrameTopLeftHS"> Modified: branches/ogsector/data/gui/layouts/opengateUnDocked.layout =================================================================== --- branches/ogsector/data/gui/layouts/opengateUnDocked.layout 2007-05-22 12:57:43 UTC (rev 507) +++ branches/ogsector/data/gui/layouts/opengateUnDocked.layout 2007-05-23 21:24:50 UTC (rev 508) @@ -6,6 +6,193 @@ <!-- <Property Name="UnifiedPosition" Value="{{0.0,23},{0.0,5}}" /> --> <!-- <Property Name="UnifiedSize" Value="{{1.0,-46},{1.0,-10}}" /> --> <Property Name="Alpha" Value="1" /> + <Window Type="opengate/StaticImage" Name="HUDCenterUp"> + <Property Name="UnifiedPosition" Value="{{0.5,-81},{0.5,-112}}" /> + <Property Name="UnifiedSize" Value="{{0.0,162},{0.0,50}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengateHUD image:CenterUp" /> + </Window> + <Window Type="opengate/StaticImage" Name="HUDCenterDown"> + <Property Name="UnifiedPosition" Value="{{0.5,-81},{0.5,62}}" /> + <Property Name="UnifiedSize" Value="{{0.0,162},{0.0,50}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengateHUD image:CenterDown" /> + </Window> + <Window Type="DefaultWindow" Name="HUDVelocityProgress"> + <Property Name="UnifiedPosition" Value="{{0.5,-112},{0.5,-73}}" /> + <Property Name="UnifiedSize" Value="{{0.0,40},{0.0,146}}" /> + <Window Type="opengate/StaticImage" Name="HUDVelocity"> + <Property Name="UnifiedPosition" Value="{{0.0,0},{0.0,0}}" /> + <Property Name="UnifiedSize" Value="{{0.0,40},{0.0,146}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengateHUD image:Velocity" /> + </Window> + </Window> + <Window Type="DefaultWindow" Name="HUDArmorProgress"> + <Property Name="UnifiedPosition" Value="{{0.5,-125},{0.5,-75}}" /> + <Property Name="UnifiedSize" Value="{{0.0,250},{0.0,150}}" /> + <Window Type="opengate/StaticImage" Name="HUDArmorLeft"> + <Property Name="UnifiedPosition" Value="{{0.0,0},{0.0,0}}" /> + <Property Name="UnifiedSize" Value="{{0.0,39},{0.0,150}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengateHUD image:ArmorLeft" /> + </Window> + <Window Type="opengate/StaticImage" Name="HUDArmorRight"> + <Property Name="UnifiedPosition" Value="{{1.0,-39},{0.0,0}}" /> + <Property Name="UnifiedSize" Value="{{0.0,39},{0.0,150}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengateHUD image:ArmorRight" /> + </Window> + </Window> + <Window Type="DefaultWindow" Name="HUDShieldProgress"> + <Property Name="UnifiedPosition" Value="{{0.5,-136},{0.5,-80}}" /> + <Property Name="UnifiedSize" Value="{{0.0,272},{0.0,160}}" /> + <Window Type="opengate/StaticImage" Name="HUDShieldLeft"> + <Property Name="UnifiedPosition" Value="{{0.0,0},{0.0,0}}" /> + <Property Name="UnifiedSize" Value="{{0.0,48},{0.0,160}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengateHUD image:ShieldLeft" /> + </Window> + <Window Type="opengate/StaticImage" Name="HUDShieldRight"> + <Property Name="UnifiedPosition" Value="{{1.0,-48},{0.0,0}}" /> + <Property Name="UnifiedSize" Value="{{0.0,48},{0.0,160}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengateHUD image:ShieldRight" /> + </Window> + </Window> + <Window Type="DefaultWindow" Name="HUDThrustProgress"> + <Property Name="UnifiedPosition" Value="{{0.5,-92},{0.5,-62}}" /> + <Property Name="UnifiedSize" Value="{{0.0,27},{0.0,124}}" /> + <Window Type="opengate/StaticImage" Name="HUDThrust"> + <Property Name="UnifiedPosition" Value="{{0.0,0},{0.0,0}}" /> + <Property Name="UnifiedSize" Value="{{0.0,27},{0.0,124}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengateHUD image:Thrust" /> + </Window> + </Window> + <Window Type="DefaultWindow" Name="HUDFuelProgress"> + <Property Name="UnifiedPosition" Value="{{0.5,65},{0.5,-62}}" /> + <Property Name="UnifiedSize" Value="{{0.0,27},{0.0,124}}" /> + <Window Type="opengate/StaticImage" Name="HUDFuel"> + <Property Name="UnifiedPosition" Value="{{0.0,0},{0.0,0}}" /> + <Property Name="UnifiedSize" Value="{{0.0,27},{0.0,124}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengateHUD image:Fuel" /> + </Window> + </Window> + <Window Type="DefaultWindow" Name="HUDCapacitorProgress"> + <Property Name="UnifiedPosition" Value="{{0.5,70},{0.5,-73}}" /> + <Property Name="UnifiedSize" Value="{{0.0,40},{0.0,146}}" /> + <Window Type="opengate/StaticImage" Name="HUDCapacitor"> + <Property Name="UnifiedPosition" Value="{{0.0,0},{0.0,0}}" /> + <Property Name="UnifiedSize" Value="{{0.0,40},{0.0,146}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengateHUD image:Capacitor" /> + </Window> + </Window> + <Window Type="opengate/StaticImage" Name="HUDFlightCurser"> + <Property Name="UnifiedPosition" Value="{{0.5,-20},{0.5,-20}}" /> + <Property Name="UnifiedSize" Value="{{0.0,20},{0.0,20}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengateHUD image:FlightCurser" /> + </Window> + <Window Type="opengate/StaticImage" Name="HUDCenter"> + <Property Name="UnifiedPosition" Value="{{0.5,-20},{0.5,-20}}" /> + <Property Name="UnifiedSize" Value="{{0.0,40},{0.0,40}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengateHUD image:Center" /> + </Window> + <Window Type="opengate/StaticImage" Name="HUDTargetCurser"> + <Property Name="UnifiedPosition" Value="{{0.0,0},{0.0,0}}" /> + <Property Name="UnifiedSize" Value="{{0.0,40},{0.0,40}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengateHUD image:TargetCurser" /> + </Window> + <Window Type="opengate/StaticImage" Name="HUDPilotFlightCurser"> + <Property Name="UnifiedPosition" Value="{{0.0,0},{0.0,0}}" /> + <Property Name="UnifiedSize" Value="{{0.0,20},{0.0,20}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengateHUD image:PilotFlightCurser" /> + </Window> + <Window Type="opengate/StaticImage" Name="HUDTargetFlightCurser"> + <Property Name="UnifiedPosition" Value="{{0.0,0},{0.0,0}}" /> + <Property Name="UnifiedSize" Value="{{0.0,40},{0.0,40}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengateHUD image:TargetFlightCurser" /> + </Window> + + <Window Type="opengate/StaticText" Name="HUDVelocityText"> + <Property Name="UnifiedPosition" Value="{{0.5,-100},{0.5,-120}}" /> + <Property Name="UnifiedSize" Value="{{0.0,60},{0.0,40}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Text" Value="V0.00" /> + </Window> + <Window Type="opengate/StaticText" Name="HUDConText"> + <Property Name="UnifiedPosition" Value="{{0.5,-100},{0.5,-105}}" /> + <Property Name="UnifiedSize" Value="{{0.0,60},{0.0,40}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Text" Value="C0.00" /> + </Window> + <Window Type="opengate/StaticText" Name="HUDShieldText"> + <Property Name="UnifiedPosition" Value="{{0.5,+60},{0.5,-120}}" /> + <Property Name="UnifiedSize" Value="{{0.0,60},{0.0,40}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Text" Value="S100%" /> + </Window> + <Window Type="opengate/StaticText" Name="HUDArmorText"> + <Property Name="UnifiedPosition" Value="{{0.5,+60},{0.5,-105}}" /> + <Property Name="UnifiedSize" Value="{{0.0,60},{0.0,40}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Text" Value="A100%" /> + </Window> + + <Window Type="opengate/StaticText" Name="HUDTargetDistanceText"> + <Property Name="UnifiedPosition" Value="{{0.5,-100},{0.5,65}}" /> + <Property Name="UnifiedSize" Value="{{0.0,60},{0.0,40}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Text" Value="D000" /> + </Window> + <Window Type="opengate/StaticText" Name="HUDTargetVelocityText"> + <Property Name="UnifiedPosition" Value="{{0.5,-100},{0.5,80}}" /> + <Property Name="UnifiedSize" Value="{{0.0,60},{0.0,40}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Text" Value="V0" /> + </Window> + <Window Type="opengate/StaticText" Name="HUDTargetShieldText"> + <Property Name="UnifiedPosition" Value="{{0.5,+60},{0.5,65}}" /> + <Property Name="UnifiedSize" Value="{{0.0,60},{0.0,40}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Text" Value="S100%" /> + </Window> + <Window Type="opengate/StaticText" Name="HUDTargetArmorText"> + <Property Name="UnifiedPosition" Value="{{0.5,+60},{0.5,80}}" /> + <Property Name="UnifiedSize" Value="{{0.0,60},{0.0,40}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Text" Value="A100%" /> + </Window> <Window Type="DefaultWindow" Name="UnDocked/MainWindow/ConsoleFrame"> <Property Name="UnifiedPosition" Value="{{0.0,62},{0.0,10}}" /> <Property Name="UnifiedSize" Value="{{1.0,-370},{0.0,100}}" /> Added: branches/ogsector/data/gui/schemes/opengate/hud/defaultHUD.imageset =================================================================== --- branches/ogsector/data/gui/schemes/opengate/hud/defaultHUD.imageset (rev 0) +++ branches/ogsector/data/gui/schemes/opengate/hud/defaultHUD.imageset 2007-05-23 21:24:50 UTC (rev 508) @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Imageset Name="opengateHUD" Imagefile="hud/defaultHUD.png"> + <Image Name="FlightCurser" XPos="3" YPos="4" Width="20" Height="20" /> + <Image Name="Center" XPos="0" YPos="30" Width="40" Height="40" /> + <Image Name="TargetCurser" XPos="0" YPos="71" Width="40" Height="40" /> + <Image Name="PilotFlightCurser" XPos="26" YPos="4" Width="20" Height="20" /> + <Image Name="TargetFlightCurser" XPos="45" YPos="71" Width="40" Height="40" /> + <Image Name="GreenShieldLeft" XPos="4" YPos="135" Width="98" Height="280" /> + <Image Name="Velocity" XPos="170" YPos="55" Width="40" Height="146" /> + <Image Name="Capacitor" XPos="213" YPos="55" Width="40" Height="146" /> + <Image Name="CenterUp" XPos="276" YPos="88" Width="162" Height="50" /> + <Image Name="CenterDown" XPos="276" YPos="37" Width="162" Height="50" /> + <Image Name="Thrust" XPos="444" YPos="14" Width="27" Height="124" /> + <Image Name="Fuel" XPos="481" YPos="14" Width="27" Height="124" /> + <Image Name="ArmorRight" XPos="432" YPos="138" Width="39" Height="149" /> + <Image Name="ArmorLeft" XPos="472" YPos="138" Width="39" Height="149" /> + <Image Name="ShieldLeft" XPos="334" YPos="139" Width="48" Height="160" /> + <Image Name="ShieldRight" XPos="384" YPos="139" Width="48" Height="160" /> +</Imageset> Added: branches/ogsector/data/gui/schemes/opengate/hud/defaultHUD.odg =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/gui/schemes/opengate/hud/defaultHUD.odg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/gui/schemes/opengate/hud/defaultHUD.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/gui/schemes/opengate/hud/defaultHUD.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/gui/schemes/opengate/hud/defaultHUD.xcf =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/gui/schemes/opengate/hud/defaultHUD.xcf ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: branches/ogsector/data/gui/schemes/opengate/opengate.scheme =================================================================== --- branches/ogsector/data/gui/schemes/opengate/opengate.scheme 2007-05-22 12:57:43 UTC (rev 507) +++ branches/ogsector/data/gui/schemes/opengate/opengate.scheme 2007-05-23 21:24:50 UTC (rev 508) @@ -1,6 +1,7 @@ <?xml version="1.0" ?> <GUIScheme Name="opengate"> <Imageset Name="opengate" Filename="opengate.imageset" /> + <Imageset Name="opengateHUD" Filename="hud/defaultHUD.imageset" /> <ImagesetFromImage Name="MainWindowTopLeft" Filename="textures/mainTopLeft.png" /> <ImagesetFromImage Name="MainWindowTopRight" Filename="textures/mainTopRight.png" /> Modified: branches/ogsector/data/simpleHUD.overlay =================================================================== --- branches/ogsector/data/simpleHUD.overlay 2007-05-22 12:57:43 UTC (rev 507) +++ branches/ogsector/data/simpleHUD.overlay 2007-05-23 21:24:50 UTC (rev 508) @@ -18,79 +18,79 @@ SimpleHUD { zorder 500 - container Panel(SimpleHUD/Console) - { - left 0.01 - top 0.01 - width 0.98 - height 0.5 +// container Panel(SimpleHUD/Console) +// { +// left 0.01 +// top 0.01 +// width 0.98 +// height 0.5 +//// material OpenGate/Console/Background +// +// element TextArea(SimpleHUD/Console/TextArea) +// { +// left 0.01 +// top 0.01 +// width 0.98 +// height 0.5 +// font_name Console +// char_height 0.02 +// colour_top 1 1 1 +// colour_bottom 1 1 1 +// } +// } +// +// container Panel(SimpleHUD/ConsoleShort) +// { +// left 0.01 +// top 0.01 +// width 0.98 +// height 0.075 +//// material OpenGate/Console/Background +// +// element TextArea(SimpleHUD/ConsoleShort/TextArea) +// { +// left 0.01 +// top 0.01 +// width 0.98 +// height 0.075 +// font_name Console +// char_height 0.02 +// colour_top 1.0 1.0 1.0 +// colour_bottom 1.0 1.0 1.0 +// } +// } +// +// container Panel(SimpleHUD/ChatIn) +// { +// left 0.01 +// top 0.52 +// width 0.98 +// height 0.025 // material OpenGate/Console/Background - - element TextArea(SimpleHUD/Console/TextArea) - { - left 0.01 - top 0.01 - width 0.98 - height 0.5 - font_name Console - char_height 0.02 - colour_top 1 1 1 - colour_bottom 1 1 1 - } - } - - container Panel(SimpleHUD/ConsoleShort) - { - left 0.01 - top 0.01 - width 0.98 - height 0.075 -// material OpenGate/Console/Background - - element TextArea(SimpleHUD/ConsoleShort/TextArea) - { - left 0.01 - top 0.01 - width 0.98 - height 0.075 - font_name Console - char_height 0.02 - colour_top 1.0 1.0 1.0 - colour_bottom 1.0 1.0 1.0 - } - } - - container Panel(SimpleHUD/ChatIn) - { - left 0.01 - top 0.52 - width 0.98 - height 0.025 - material OpenGate/Console/Background - - element TextArea(SimpleHUD/ChatIn/TextArea) - { - left 0.01 - top 0.005 - width 0.9 - height 0.025 - font_name Console - char_height 0.02 - colour_top 1.0 1.0 1.0 - colour_bottom 1.0 1.0 1.0 - } - } - - container Panel(SimpleHUD/CenterPointer) - { - metrics_mode pixels - top 0 - left 0 - width 48 - height 48 - material SimpleHUD/CenterPointer - } - +// +// element TextArea(SimpleHUD/ChatIn/TextArea) +// { +// left 0.01 +// top 0.005 +// width 0.9 +// height 0.025 +// font_name Console +// char_height 0.02 +// colour_top 1.0 1.0 1.0 +// colour_bottom 1.0 1.0 1.0 +// } +// } +// +// container Panel(SimpleHUD/CenterPointer) +// { +// metrics_mode pixels +// top 0 +// left 0 +// width 48 +// height 48 +// material SimpleHUD/CenterPointer +// } +// container Panel(SimpleHUD/FlightCurser) { metrics_mode pixels @@ -98,39 +98,39 @@ left 0 width 32 height 32 - material SimpleHUD/FlightCurser +// material SimpleHUD/FlightCurser } +// +// container Panel(SimpleHUD/TargetPointer) +// { +// metrics_mode pixels +// top 0 +// left 0 +// width 32 +// height 32 +// material SimpleHUD/TargetPointer +// } +// +// container Panel(SimpleHUD/DuelistPilotPointer) +// { +// metrics_mode pixels +// top 0 +// left 0 +// width 32 +// height 32 +// material SimpleHUD/DuelistPilotPointer +// } +// +// container Panel(SimpleHUD/DuelistTargetPointer) +// { +// metrics_mode pixels +// top 0 +// left 0 +// width 32 +// height 32 +// material SimpleHUD/DuelistTargetPointer +// } - container Panel(SimpleHUD/TargetPointer) - { - metrics_mode pixels - top 0 - left 0 - width 32 - height 32 - material SimpleHUD/TargetPointer - } - - container Panel(SimpleHUD/DuelistPilotPointer) - { - metrics_mode pixels - top 0 - left 0 - width 32 - height 32 - material SimpleHUD/DuelistPilotPointer - } - - container Panel(SimpleHUD/DuelistTargetPointer) - { - metrics_mode pixels - top 0 - left 0 - width 32 - height 32 - material SimpleHUD/DuelistTargetPointer - } - container Panel(SimpleHUD/MainPanel) { left 0 @@ -150,90 +150,90 @@ colour_top 1 1 0.7 colour_bottom 1 1 0.7 } - - element TextArea(SimpleHUD/MainPanel/TextVelocity) - { - left 0.25 - top 0.3 - width 0.1 - height 0.03 - caption Vel: - font_name BlueHighway - char_height 0.02 - colour_top 0.5 0.7 0.5 - colour_bottom 0.3 0.5 0.3 - } - element TextArea(SimpleHUD/MainPanel/TextVelocityMax) - { - left 0.31 - top 0.3 - width 0.1 - height 0.03 - caption / - font_name BlueHighway - char_height 0.02 - colour_top 0.5 0.7 0.5 - colour_bottom 0.3 0.5 0.3 - } - element TextArea(SimpleHUD/MainPanel/TextThr) - { - left 0.25 - top 0.33 - width 0.1 - height 0.03 - caption Thr: - font_name BlueHighway - char_height 0.02 - colour_top 0.5 0.7 0.5 - colour_bottom 0.3 0.5 0.3 - } - element TextArea(SimpleHUD/MainPanel/TextAcc) - { - left 0.25 - top 0.36 - width 0.03 - height 0.1 - caption Current Acc: - font_name BlueHighway - char_height 0.022 - colour_top 0.5 0.7 0.5 - colour_bottom 0.3 0.5 0.3 - } - element TextArea(SimpleHUD/MainPanel/TextShield) - { - left 0.25 - top 0.39 - width 0.1 - height 0.03 - font_name BlueHighway - char_height 0.02 - colour_top 0.5 0.7 0.5 - colour_bottom 0.3 0.5 0.3 - } - element TextArea(SimpleHUD/MainPanel/TextArmor) - { - left 0.25 - top 0.42 - width 0.1 - height 0.03 - font_name BlueHighway - char_height 0.02 - colour_top 0.5 0.7 0.5 - colour_bottom 0.3 0.5 0.3 - } - element TextArea(SimpleHUD/MainPanel/TextPosition) - { - left 0.25 - top 0.45 - width 0.1 - height 0.1 - caption Current Pos: - font_name BlueHighway - char_height 0.02 - colour_top 0.5 0.7 0.5 - colour_bottom 0.3 0.5 0.3 - } - +// +// element TextArea(SimpleHUD/MainPanel/TextVelocity) +// { +// left 0.25 +// top 0.3 +// width 0.1 +// height 0.03 +// caption Vel: +// font_name BlueHighway +// char_height 0.02 +// colour_top 0.5 0.7 0.5 +// colour_bottom 0.3 0.5 0.3 +// } +// element TextArea(SimpleHUD/MainPanel/TextVelocityMax) +// { +// left 0.31 +// top 0.3 +// width 0.1 +// height 0.03 +// caption / +// font_name BlueHighway +// char_height 0.02 +// colour_top 0.5 0.7 0.5 +// colour_bottom 0.3 0.5 0.3 +// } +// element TextArea(SimpleHUD/MainPanel/TextThr) +// { +// left 0.25 +// top 0.33 +// width 0.1 +// height 0.03 +// caption Thr: +// font_name BlueHighway +// char_height 0.02 +// colour_top 0.5 0.7 0.5 +// colour_bottom 0.3 0.5 0.3 +// } +// element TextArea(SimpleHUD/MainPanel/TextAcc) +// { +// left 0.25 +// top 0.36 +// width 0.03 +// height 0.1 +// caption Current Acc: +// font_name BlueHighway +// char_height 0.022 +// colour_top 0.5 0.7 0.5 +// colour_bottom 0.3 0.5 0.3 +// } +// element TextArea(SimpleHUD/MainPanel/TextShield) +// { +// left 0.25 +// top 0.39 +// width 0.1 +// height 0.03 +// font_name BlueHighway +// char_height 0.02 +// colour_top 0.5 0.7 0.5 +// colour_bottom 0.3 0.5 0.3 +// } +// element TextArea(SimpleHUD/MainPanel/TextArmor) +// { +// left 0.25 +// top 0.42 +// width 0.1 +// height 0.03 +// font_name BlueHighway +// char_height 0.02 +// colour_top 0.5 0.7 0.5 +// colour_bottom 0.3 0.5 0.3 +// } +// element TextArea(SimpleHUD/MainPanel/TextPosition) +// { +// left 0.25 +// top 0.45 +// width 0.1 +// height 0.1 +// caption Current Pos: +// font_name BlueHighway +// char_height 0.02 +// colour_top 0.5 0.7 0.5 +// colour_bottom 0.3 0.5 0.3 +// } +// element TextArea(SimpleHUD/MainPanel/TextTargetName) { left 0.015 Modified: branches/ogsector/src/DockedState.cpp =================================================================== --- branches/ogsector/src/DockedState.cpp 2007-05-22 12:57:43 UTC (rev 507) +++ branches/ogsector/src/DockedState.cpp 2007-05-23 21:24:50 UTC (rev 508) @@ -65,11 +65,7 @@ // camera->setAspectRatio( (Ogre::Real)devices_->renderWindow->getViewport( 0 )->getActualWidth() / // (Ogre::Real)devices_->renderWindow->getViewport( 0 )->getActualHeight() ); - devices_->guiSystem->setDefaultMouseCursor( (CEGUI::utf8*)"opengate", (CEGUI::utf8*)"MouseArrow" ); - CEGUI::MouseCursor::getSingleton().setImage( (CEGUI::utf8*)"opengate", (CEGUI::utf8*)"MouseArrow" ); - overlayRootWindow_ = CEGUI::WindowManager::getSingleton().loadWindowLayout((CEGUI::utf8*)"opengateDocked.layout"); - Ogre::SceneNode * backgroundNode = sceneMgr_->getRootSceneNode()->createChildSceneNode( "Background" ); Ogre::ManualObject * background = sceneMgr_->createManualObject( "BackgroundObject" ); @@ -116,6 +112,9 @@ devices_->inputManager->addKeyListener( this, "DockedStateKeyListener" ); devices_->inputManager->addMouseListener( this, "DockedStateMouseListener" ); + devices_->guiSystem->setDefaultMouseCursor( (CEGUI::utf8*)"opengate", (CEGUI::utf8*)"MouseArrow" ); + CEGUI::MouseCursor::getSingleton().setImage( (CEGUI::utf8*)"opengate", (CEGUI::utf8*)"MouseArrow" ); + Ogre::Viewport * vp = devices_->renderWindow->addViewport( sceneMgr_->getCamera( "StationCamera" ), 0, 0.0, 0.0, 1.0f, 1.0f ); vp->setBackgroundColour( Ogre::ColourValue( 0, 0, 0) ); minimiseConsole( ); Modified: branches/ogsector/src/GameStateManager.cpp =================================================================== --- branches/ogsector/src/GameStateManager.cpp 2007-05-22 12:57:43 UTC (rev 507) +++ branches/ogsector/src/GameStateManager.cpp 2007-05-23 21:24:50 UTC (rev 508) @@ -113,11 +113,6 @@ delete vesselManager_; vesselManager_ = NULL; } - if ( vesselManager_ ){ - log_->info( "Shutdown vesselmanager." ); - delete vesselManager_; - vesselManager_ = NULL; - } if ( devices_.inputManager ) { log_->info( "Shutdown inputmanager." ); delete devices_.inputManager; Modified: branches/ogsector/src/Makefile.in =================================================================== --- branches/ogsector/src/Makefile.in 2007-05-22 12:57:43 UTC (rev 507) +++ branches/ogsector/src/Makefile.in 2007-05-23 21:24:50 UTC (rev 508) @@ -51,12 +51,13 @@ am_opengateclient_OBJECTS = opengateclient.$(OBJEXT) common.$(OBJEXT) \ networkClient.$(OBJEXT) tinyxml.$(OBJEXT) \ tinyxmlerror.$(OBJEXT) tinyxmlparser.$(OBJEXT) \ - Console.$(OBJEXT) Entity.$(OBJEXT) EntityManager.$(OBJEXT) \ - LogManager.$(OBJEXT) InputManager.$(OBJEXT) \ - VesselManager.$(OBJEXT) GameStateManager.$(OBJEXT) \ - GameState.$(OBJEXT) DockedState.$(OBJEXT) \ - ShipConfigDialog.$(OBJEXT) UnDockedState.$(OBJEXT) \ - Sector.$(OBJEXT) SectorObjects.$(OBJEXT) + Console.$(OBJEXT) ConfigDialog.$(OBJEXT) Entity.$(OBJEXT) \ + EntityManager.$(OBJEXT) LogManager.$(OBJEXT) \ + InputManager.$(OBJEXT) VesselManager.$(OBJEXT) \ + GameStateManager.$(OBJEXT) GameState.$(OBJEXT) \ + DockedState.$(OBJEXT) ShipConfigDialog.$(OBJEXT) \ + UnDockedState.$(OBJEXT) Sector.$(OBJEXT) \ + SectorObjects.$(OBJEXT) opengateclient_OBJECTS = $(am_opengateclient_OBJECTS) opengateclient_LDADD = $(LDADD) am_opengateserver_OBJECTS = opengateserver.$(OBJEXT) common.$(OBJEXT) \ @@ -192,6 +193,8 @@ tinyxml/tinyxmlparser.cpp \ Console.h \ Console.cpp \ + ConfigDialog.h \ + ConfigDialog.cpp \ Entity.h \ Entity.cpp \ EntityManager.h \ @@ -310,6 +313,7 @@ distclean-compile: -rm -f *.tab.c +@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@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Entity.Po@am__quote@ Modified: branches/ogsector/src/SectorObjects.cpp =================================================================== --- branches/ogsector/src/SectorObjects.cpp 2007-05-22 12:57:43 UTC (rev 507) +++ branches/ogsector/src/SectorObjects.cpp 2007-05-23 21:24:50 UTC (rev 508) @@ -467,8 +467,11 @@ } shield_ += shieldRechargeBaseRate_ * elapsedTime; - shield_ = min( maxShield_, shield_ ); + shield_ = min( shield_, shieldMax_ ); + capacity_ += capacityRecharge_ * elapsedTime; + capacity_ = min( capacity_, capacityMax_ ); + fire( elapsedTime ); //** snap quaternion @@ -491,10 +494,14 @@ armor_ = vesselBluePrint_->armor(); //** omnus - maxShield_ = 5700.0; - shield_ = maxShield_; + shieldMax_ = 5700.0; + shield_ = shieldMax_; shieldRechargeBaseRate_ = 52.500; + capacity_ = 0; + capacityRecharge_ = 1000; + capacityMax_ = 1000; + ammoSpeed_ = 1000; velocity_ = 0.0; @@ -554,10 +561,14 @@ if ( fireDelay_ <= 0 ){ + Ogre::Real damage = 500.0; if ( firePressed_ ){ - projectiles_.insert( new Projectile( this, shotsFired_, ammoSpeed_ ) ); - fireDelay_ = delayTime; - shotsFired_++; + if ( capacity_ > damage ){ + projectiles_.insert( new Projectile( this, shotsFired_, ammoSpeed_ ) ); + fireDelay_ = delayTime; + shotsFired_++; + capacity_ -= damage; + } } // int nEmits = fireParticles_->getNumEmitters( ); Modified: branches/ogsector/src/SectorObjects.h =================================================================== --- branches/ogsector/src/SectorObjects.h 2007-05-22 12:57:43 UTC (rev 507) +++ branches/ogsector/src/SectorObjects.h 2007-05-23 21:24:50 UTC (rev 508) @@ -191,7 +191,7 @@ Ogre::Real rotFriction(){ return 0.4 + ( 0.6 * ( 100.0 - percentageThrust_ )/ 100.0 ); } - inline Ogre::Real thrustPercent() const { return 100.0 * thrust() / maxThrust(); } + inline Ogre::Real thrustPercent() const { return 100.0 * thrust() / thrustMax(); } inline void setThrustPercent( Ogre::Real thrust ) { percentageThrust_ = min( thrust, Ogre::Real( 100.0 ) ); percentageThrust_ = max( Ogre::Real( 0.0 ), thrust ); @@ -237,22 +237,21 @@ } inline bool breakPressed( ) const { return breakPressed_; } - inline Ogre::Real maxThrust( ) const { return maxThrust_; } - Ogre::Real thrust() const { - Ogre::Real thrust = maxThrust() * percentageThrust_ / 100.0; - if ( afterburnerPressed_ ) thrust *= 1.2; + Ogre::Real thrust = thrustMax() * percentageThrust_ / 100.0; + if ( afterburnerPressed_ ) thrust *= 1.3; if ( flashfire_ ) thrust *= 10; return thrust; } + 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)maxShield_, maxShield_ * shield / 100.0 ); } + inline void setShieldPercent( Ogre::Real shield ) { shield_ = min( (double)shieldMax_, shieldMax_ * shield / 100.0 ); } inline Ogre::Real shieldPercent() const { - if (maxShield_ > 0 ) return round( 100.0 * shield_ / maxShield_, 1 ); else return 0.0; + if ( shieldMax_ > 0 ) return round( 100.0 * shield_ / shieldMax_, 1 ); else return 0.0; } Ogre::Vector3 flightDirection() const { @@ -262,15 +261,21 @@ 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(); } - Ogre::Real velocityMax() const { return sqrt( maxThrust() / vesselBluePrint_->dragFactor() ); } void fire( Ogre::Real elapsedTime ); @@ -279,6 +284,7 @@ virtual Uint16 incNetSequence( ){ netSequence_++; return netSequence_; } protected: + Vessel * vesselBluePrint_; std::set < Projectile * > projectiles_; @@ -297,10 +303,14 @@ Ogre::Real ethernalDensity_; Ogre::Real armor_; - Ogre::Real maxShield_; + Ogre::Real shieldMax_; Ogre::Real shield_; Ogre::Real shieldRechargeBaseRate_; + Ogre::Real capacity_; + Ogre::Real capacityRecharge_; + Ogre::Real capacityMax_; + Ogre::Real yaw_; Ogre::Real pitch_; Ogre::Real roll_; Modified: branches/ogsector/src/UnDockedState.cpp =================================================================== --- branches/ogsector/src/UnDockedState.cpp 2007-05-22 12:57:43 UTC (rev 507) +++ branches/ogsector/src/UnDockedState.cpp 2007-05-23 21:24:50 UTC (rev 508) @@ -67,6 +67,72 @@ sector_ = new Sector( sceneMgr_, network_ ); sector_->setListener( this ); setupEventHandlers(); + + targetCurser_ = CEGUI::WindowManager::getSingleton().getWindow( "HUDTargetCurser" ); + targetCurserHalfWidth_ = targetCurser_->getWidth().asAbsolute( 0.0 ) / 2.0; + targetCurserHalfHeight_ = targetCurser_->getHeight().asAbsolute( 0.0 ) / 2.0; + targetCurser_->hide(); + + pilotFlightCurser_ = CEGUI::WindowManager::getSingleton().getWindow( "HUDPilotFlightCurser" ); + pilotFlightCurserHalfWidth_ = pilotFlightCurser_->getWidth().asAbsolute( 0.0 ) / 2.0; + pilotFlightCurserHalfHeight_ = pilotFlightCurser_->getHeight().asAbsolute( 0.0 ) / 2.0; + pilotFlightCurser_->hide(); + + targetFlightCurser_ = CEGUI::WindowManager::getSingleton().getWindow( "HUDTargetFlightCurser" ); + targetFlightCurserHalfWidth_ = targetFlightCurser_->getWidth().asAbsolute( 0.0 ) / 2.0; + targetFlightCurserHalfHeight_ = targetFlightCurser_->getHeight().asAbsolute( 0.0 ) / 2.0; + targetFlightCurser_->hide(); + + velocityProgress_ = CEGUI::WindowManager::getSingleton().getWindow( "HUDVelocityProgress" ); + velocityProgressHeight_ = velocityProgress_->getHeight().asAbsolute( 0.0 ); + velocityProgressImg_ = CEGUI::WindowManager::getSingleton().getWindow( "HUDVelocity" ); + velocityProgressImg_->setClippedByParent( true ); + + thrustProgress_ = CEGUI::WindowManager::getSingleton().getWindow( "HUDThrustProgress" ); + thrustProgressHeight_ = thrustProgress_->getHeight().asAbsolute( 0.0 ); + thrustProgressImg_ = CEGUI::WindowManager::getSingleton().getWindow( "HUDThrust" ); + thrustProgressImg_->setClippedByParent( true ); + + fuelProgress_ = CEGUI::WindowManager::getSingleton().getWindow( "HUDFuelProgress" ); + fuelProgressHeight_ = fuelProgress_->getHeight().asAbsolute( 0.0 ); + fuelProgressImg_ = CEGUI::WindowManager::getSingleton().getWindow( "HUDFuel" ); + fuelProgressImg_->setClippedByParent( true ); + + capacitorProgress_ = CEGUI::WindowManager::getSingleton().getWindow( "HUDCapacitorProgress" ); + capacitorProgressHeight_ = capacitorProgress_->getHeight().asAbsolute( 0.0 ); + capacitorProgressImg_ = CEGUI::WindowManager::getSingleton().getWindow( "HUDCapacitor" ); + capacitorProgressImg_->setClippedByParent( true ); + + armorProgress_ = CEGUI::WindowManager::getSingleton().getWindow( "HUDArmorProgress" ); + armorProgressHeight_ = armorProgress_->getHeight().asAbsolute( 0.0 ); + armorProgressLeftImg_ = CEGUI::WindowManager::getSingleton().getWindow( "HUDArmorLeft" ); + armorProgressRightImg_ = CEGUI::WindowManager::getSingleton().getWindow( "HUDArmorRight" ); + armorProgressLeftImg_->setClippedByParent( true ); + armorProgressRightImg_->setClippedByParent( true ); + + shieldProgress_ = CEGUI::WindowManager::getSingleton().getWindow( "HUDShieldProgress" ); + shieldProgressHeight_ = shieldProgress_->getHeight().asAbsolute( 0.0 ); + shieldProgressLeftImg_ = CEGUI::WindowManager::getSingleton().getWindow( "HUDShieldLeft" ); + shieldProgressRightImg_ = CEGUI::WindowManager::getSingleton().getWindow( "HUDShieldRight" ); + shieldProgressLeftImg_->setClippedByParent( true ); + shieldProgressRightImg_->setClippedByParent( true ); + + velocityText_ = CEGUI::WindowManager::getSingleton().getWindow( "HUDVelocityText" ); + conText_ = CEGUI::WindowManager::getSingleton().getWindow( "HUDConText" ); + shieldText_ = CEGUI::WindowManager::getSingleton().getWindow( "HUDShieldText" ); + armorText_ = CEGUI::WindowManager::getSingleton().getWindow( "HUDArmorText" ); + + targetDistanceText_ = CEGUI::WindowManager::getSingleton().getWindow( "HUDTargetDistanceText" ); + targetVelocity_ = CEGUI::WindowManager::getSingleton().getWindow( "HUDTargetVelocityText" ); + targetShieldText_ = CEGUI::WindowManager::getSingleton().getWindow( "HUDTargetShieldText" ); + targetArmorText_ = CEGUI::WindowManager::getSingleton().getWindow( "HUDTargetArmorText" ); + + devices_->guiSystem->setDefaultMouseCursor( (CEGUI::utf8*)"opengate", (CEGUI::utf8*)"MouseArrow" ); + CEGUI::MouseCursor::getSingleton().setImage( (CEGUI::utf8*)"opengate", (CEGUI::utf8*)"MouseArrow" ); + + flightCurser_ = CEGUI::WindowManager::getSingleton().getWindow( "HUDFlightCurser" ); + flightCurserHalfWidth_ = 10; + flightCurserHalfHeight_ = 10; } void UnDockedState::destroyContent( ){ @@ -98,29 +164,21 @@ vp1->setShadowsEnabled( false ); vp1->setOverlaysEnabled( false ); + CEGUI::MouseCursor::getSingleton().hide(); + overlayName_ = "SimpleHUD"; - hudOverlay_ = Ogre::OverlayManager::getSingleton().getByName( overlayName_ ); - hudOverlay_->getChild( overlayName_ + "/ChatIn" )->hide( ); + hudOverlay_->show( ); +// mousePointer_ = hudOverlay_->getChild( overlayName_ + "/FlightCurser" ); +// mousePointer_->setTop( windowsHalfHeight_ - mousePointer_->getHeight() / 2 ); +// mousePointer_->setLeft( windowsHalfWidth_ - mousePointer_->getWidth() / 2 ); +// mousePointer_->hide(); - Ogre::OverlayElement * centerPointer_ = hudOverlay_->getChild( overlayName_ + "/CenterPointer" ); - centerPointer_->setTop( windowsHalfHeight_ - centerPointer_->getHeight() / 2 ); - centerPointer_->setLeft( windowsHalfWidth_ - centerPointer_->getWidth() / 2 ); + flightCurserPos_[ 0 ] = windowsHalfWidth_ - flightCurserHalfWidth_; + flightCurserPos_[ 1 ] = windowsHalfHeight_ - flightCurserHalfHeight_; + flightCurser_->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.0, flightCurserPos_[ 0 ] ), + CEGUI::UDim( 0.0, flightCurserPos_[ 1 ] ) ) ); - mousePointer_ = hudOverlay_->getChild( overlayName_ + "/FlightCurser" ); - mousePointer_->setTop( windowsHalfHeight_ - mousePointer_->getHeight() / 2 ); - mousePointer_->setLeft( windowsHalfWidth_ - mousePointer_->getWidth() / 2 ); - - Ogre::OverlayElement * duelistPilotPointer = hudOverlay_->getChild( overlayName_ + "/DuelistPilotPointer" ); - duelistPilotPointer->setLeft( windowsHalfWidth_ - duelistPilotPointer->getWidth() / 2 ); - duelistPilotPointer->setTop( windowsHalfHeight_ - duelistPilotPointer->getHeight() / 2 ); - duelistPilotPointer->show(); - - hudOverlay_->getChild( overlayName_ + "/DuelistTargetPointer" )->hide(); - // hudOverlay_->getChild( overlayName_ + "/SimpleHUD/Console" )->hide(); - - duelistPilotPointer->show(); - hudOverlay_->show( ); Ogre::OverlayManager::getSingleton().getByName( "Radar" )->show(); deathSequence_ = false; @@ -196,6 +254,8 @@ if ( overlayRootWindow_ ) overlayRootWindow_->hide(); if ( devices_->console ) devices_->console->stop(); + CEGUI::MouseCursor::getSingleton().show(); + hudOverlay_->hide( ); Ogre::OverlayManager::getSingleton().getByName( "Radar" )->hide(); @@ -215,7 +275,9 @@ if ( configMode_ ){ hudOverlay_->hide( ); Ogre::OverlayManager::getSingleton().getByName( "Radar" )->hide(); + CEGUI::MouseCursor::getSingleton().show(); } else { + CEGUI::MouseCursor::getSingleton().hide(); hudOverlay_->show( ); Ogre::OverlayManager::getSingleton().getByName( "Radar" )->show(); } @@ -402,19 +464,33 @@ } bool UnDockedState::mouseMoved( const OIS::MouseEvent & e ){ - if (!configMode_){ - mousePointer_->setLeft( mousePointer_->getLeft( ) + e.state.X.rel ); - mousePointer_->setTop( mousePointer_->getTop( ) + e.state.Y.rel ); + if ( !configMode_ ){ + flightCurserPos_[ 0 ] += e.state.X.rel; + flightCurserPos_[ 1 ] += e.state.Y.rel; + + flightCurserPos_[ 0 ] = min ( flightCurserPos_[ 0 ], windowsWidth_- flightCurserHalfWidth_ ); + flightCurserPos_[ 1 ] = min ( flightCurserPos_[ 1 ], windowsHeight_- flightCurserHalfHeight_ ); + + flightCurserPos_[ 0 ] = max ( flightCurserPos_[ 0 ], -flightCurserHalfWidth_ ); + flightCurserPos_[ 1 ] = max ( flightCurserPos_[ 1 ], -flightCurserHalfHeight_ ); + + flightCurser_->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.0, flightCurserPos_[ 0 ] ), + CEGUI::UDim( 0.0, flightCurserPos_[ 1 ] ) ) ); + +// mousePointer_->setLeft( mousePointer_->getLeft( ) + e.state.X.rel ); +// mousePointer_->setTop( mousePointer_->getTop( ) + e.state.Y.rel ); - Ogre::Real mousePointerWidth = mousePointer_->getWidth(); - Ogre::Real mousePointerHeight = mousePointer_->getHeight(); - if ( mousePointer_->getLeft( ) < -mousePointerWidth ) mousePointer_->setLeft( -mousePointerWidth ); - if ( mousePointer_->getTop( ) < -mousePointerHeight ) mousePointer_->setTop( -mousePointerHeight ); +// Ogre::Real mousePointerWidth = mousePointer_->getWidth(); +// Ogre::Real mousePointerHeight = mousePointer_->getHeight(); +// if ( mousePointer_->getLeft( ) < -mousePointerWidth ) mousePointer_->setLeft( -mousePointerWidth ); +// if ( mousePointer_->getTop( ) < -mousePointerHeight ) mousePointer_->setTop( -mousePointerHeight ); + +// if ( mousePointer_->getLeft( ) > windowsWidth_-mousePointerWidth ) mousePointer_->setLeft( windowsWidth_- +// mousePointerWidth ); +// if ( mousePointer_->getTop( ) > windowsHeight_-mousePointerHeight ) mousePointer_->setTop( windowsHeight_- +// mousePointerHeight ); + - if ( mousePointer_->getLeft( ) > windowsWidth_-mousePointerWidth ) mousePointer_->setLeft( windowsWidth_- - mousePointerWidth ); - if ( mousePointer_->getTop( ) > windowsHeight_-mousePointerHeight ) mousePointer_->setTop( windowsHeight_- - mousePointerHeight ); if ( sector_->avatar() != NULL ){ // std::cout << "X" << e.state.X.abs << " " << e.state.X.rel << " " << mousePointer_->getLeft( ) << std::endl; @@ -422,8 +498,11 @@ // std::cout << "Z" << e.state.Z.abs << " " << e.state.Z.rel<< std::endl; // return true; - int relativToMidPointX = (int)rint( (mousePointer_->getLeft( ) + mousePointerWidth) - windowsHalfWidth_ ); - int relativToMidPointY = (int)rint( (mousePointer_->getTop( ) + mousePointerHeight) - windowsHalfHeight_ ); +// int relativToMidPointX = (int)rint( (mousePointer_->getLeft( ) + mousePointerWidth) - windowsHalfWidth_ ); +// int relativToMidPointY = (int)rint( (mousePointer_->getTop( ) + mousePointerHeight) - windowsHalfHeight_ ); + + int relativToMidPointX = (int)rint( ( flightCurserPos_[ 0 ] + flightCurserHalfWidth_ ) - windowsHalfWidth_ ); + int relativToMidPointY = (int)rint( ( flightCurserPos_[ 1 ] + flightCurserHalfHeight_ ) - windowsHalfHeight_ ); int minActiveZonePercent = 5; int maxActiveZonePercent = 90; @@ -660,7 +739,7 @@ target_ = target; if ( target_ != NULL ){ - hudOverlay_->getChild( overlayName_ + "/TargetPointer" )->show(); + // hudOverlay_->getChild( overlayName_ + "/TargetPointer" )->show(); Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/MainPanel/TextTargetName" )->setCaption( target_->name() ); @@ -709,140 +788,116 @@ } //** Start update targeting pointer and duelist pointers; + Ogre::Vector3 targetScreenPos; + + target_->mainNode()->needUpdate(); Ogre::Vector3 targetPos( target_->mainNode()->getPosition() ); - Ogre::Vector3 targetScreenPos( mainCamera_->getProjectionMatrix() * ( mainCamera_->getViewMatrix() * targetPos ) ); - -// poss.x = max( -1.0f, poss.x ); poss.x = min( 1.0f, poss.x ); -// poss.y = max( -1.0f, poss.y ); poss.y = min( 1.0f, poss.y ); - if ( targetScreenPos[ 2 ] < 1 ){ - //"getAABB()" || "Entity::getBoundingRadius" - Ogre::OverlayElement * hudTargetPointer = - Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/TargetPointer" ); + bool targetVisible = projectionPos_( mainCamera_, targetPos, targetScreenPos ); - hudTargetPointer->setPosition( windowsHalfWidth_ + ( windowsHalfWidth_ * targetScreenPos[ 0 ] ) - - hudTargetPointer->getWidth()/2, - windowsHalfHeight_ + ( windowsHalfHeight_ * -targetScreenPos[ 1 ] ) - - hudTargetPointer->getHeight()/2 ); - hudTargetPointer->_update(); + if ( targetVisible ){ + targetCurser_->show(); + targetCurser_->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.5 + targetScreenPos[ 0 ] / 2.0, + -targetCurserHalfWidth_ ), + CEGUI::UDim( 0.5 - targetScreenPos[ 1 ] / 2.0, + -targetCurserHalfHeight_ ) ) ); + } else { + targetCurser_->hide(); } Ogre::Real ammoTimeToTarget( distToTarget.length() / sector_->avatar()->ammoSpeed() ); - Ogre::OverlayElement * duelistPilotPointer = - Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/DuelistPilotPointer" ); 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 duelistPilotScreenPos( mainCamera_->getProjectionMatrix() * ( mainCamera_->getViewMatrix() * duelistPilotPos ) ); - if ( duelistPilotScreenPos[ 2 ] < 1 ){ - duelistPilotPointer->setPosition( windowsHalfWidth_ + (windowsHalfWidth_ * duelistPilotScreenPos[ 0 ] ) - - duelistPilotPointer->getWidth()/2, - windowsHalfHeight_ + (windowsHalfHeight_ * -duelistPilotScreenPos[ 1 ] ) - - duelistPilotPointer->getHeight()/2 ); - duelistPilotPointer->_update(); + Ogre::Vector3 duelistPilotPos( sector_->avatar()->mainNode()->getPosition() + + - sector_->avatar()->mainNode()->getOrientation().zAxis().normalisedCopy() + * sector_->avatar()->ammoSpeed() * ammoTimeToTarget + + sector_->avatar()->velDirection() * ammoTimeToTarget ); + + targetVisible = projectionPos_( mainCamera_, duelistPilotPos, targetScreenPos ); + if ( targetVisible ){ + pilotFlightCurser_->show(); + pilotFlightCurser_->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.5 + targetScreenPos[ 0 ] / 2.0, + - pilotFlightCurserHalfWidth_ ), + CEGUI::UDim( 0.5 - targetScreenPos[ 1 ] / 2.0, + - pilotFlightCurserHalfHeight_ ) ) ); + } else { + pilotFlightCurser_->hide(); } } else { - duelistPilotPointer->setPosition( windowsHalfWidth_ - duelistPilotPointer->getWidth()/2, - windowsHalfHeight_ - duelistPilotPointer->getHeight()/2 ); + pilotFlightCurser_->hide(); } + + if ( duelistTarget_ && ( target_->getTypeID() == SECTOROBJECTMOVABLE_RTTI || + target_->getTypeID() == SECTOROBJECTMOVABLE_AI_RTTI ) ){ - //** start duelist TargetPointer; - - Ogre::OverlayElement * duelistTargetPointer = - Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/DuelistTargetPointer" ); - - if ( duelistTarget_ && - ( target_->getTypeID() == SECTOROBJECTMOVABLE_RTTI || - target_->getTypeID() == SECTOROBJECTMOVABLE_AI_RTTI ) ){ - - Ogre::OverlayElement * duelistTargetPointer = - Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/DuelistTargetPointer" ); - duelistTargetPointer->show(); - Ogre::Vector3 duelistTargetPos( targetPos + dynamic_cast< SectorObjectMoveable *>( target_ )->velDirection() * ammoTimeToTarget ); - Ogre::Vector3 duelistTargetScreenPos( mainCamera_->getProjectionMatrix() * ( mainCamera_->getViewMatrix() * duelistTargetPos ) ); - if ( duelistTargetScreenPos[ 2 ] < 1 ){ - duelistTargetPointer->setPosition( windowsHalfWidth_ + (windowsHalfWidth_ * duelistTargetScreenPos[ 0 ] ) - - duelistTargetPointer->getWidth()/2, - windowsHalfHeight_ + (windowsHalfHeight_ * -duelistTargetScreenPos[ 1 ]) - - duelistTargetPointer->getHeight()/2 ); - duelistTargetPointer->_update(); + + targetVisible = projectionPos_( mainCamera_, duelistTargetPos, targetScreenPos ); + + if ( targetVisible ){ + targetFlightCurser_->show(); + targetFlightCurser_->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.5 + targetScreenPos[ 0 ] / 2.0, + - targetFlightCurserHalfWidth_ ), + CEGUI::UDim( 0.5 - targetScreenPos[ 1 ] / 2.0, + - targetFlightCurserHalfHeight_ ) ) ); + } else { + targetFlightCurser_->hide(); } } else { - duelistTargetPointer->hide(); + targetFlightCurser_->hide(); } - //** end duelist TargetPointer //** End update targeting pointer and duelist pointers; - Ogre::OverlayElement* hudTargetDist = - Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/MainPanel/TextTargetDistance" ); - hudTargetDist->setCaption( "D " + Ogre::StringConverter::toString( round( distToTarget.length(), 0 ) ) ); + targetDistanceText_->setText( "D" + Ogre::StringConverter::toString( round( distToTarget.length(), 0 ) ) ); - Ogre::OverlayElement * hudTargetShield = - Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/MainPanel/TextTargetShield" ); - Ogre::OverlayElement * hudTargetArmor = - Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/MainPanel/TextTargetArmor" ); - Ogre::OverlayElement * hudTargetVel = - Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/MainPanel/TextTargetVelocity" ); + if ( target_->getTypeID() == SECTOROBJECTMOVABLE_RTTI || target_->getTypeID() == SECTOROBJECTMOVABLE_AI_RTTI ){ + + targetVelocity_->setText( "V" + Ogre::StringConverter::toString( + dynamic_cast< SectorObjectMoveable *>( target_ )->velocity(), 6 ) ); + targetShieldText_->setText( "S" + Ogre::StringConverter::toString( + dynamic_cast< SectorObjectMoveable *>( target_ )->shieldPercent(), 4 ) ); + targetArmorText_->setText( "A" + Ogre::StringConverter::toString( + dynamic_cast< SectorObjectMoveable *>( target_ )->armorPercent(), 4 ) ); - if ( target_->getTypeID() == SECTOROBJECTMOVABLE_RTTI || target_->getTypeID() == SECTOROBJECTMOVABLE_AI_RTTI ){ - hudTargetShield->setCaption( "S " + Ogre::StringConverter::toString( dynamic_cast< SectorObjectMoveable *>( target_ )->shieldPercent(), 4 ) ); - hudTargetArmor->setCaption( "A " + Ogre::StringConverter::toString( dynamic_cast< SectorObjectMoveable *>( target_ )->armorPercent(), 4 ) ); - hudTargetVel->setCaption( "V " + Ogre::StringConverter::toString( dynamic_cast< SectorObjectMoveable *>( target_ )->velocity(), 6 ) ); } else{ - hudTargetVel->setCaption( "" ); - hudTargetShield->setCaption( "" ); - hudTargetArmor->setCaption( "" ); + targetVelocity_->setText( "" ); + targetShieldText_->setText( "" ); + targetArmorText_->setText( "" ); } } else { if ( sector_->avatar()->targetArrow() ) sector_->avatar()->targetArrow()->setVisible( false ); - Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/TargetPointer")->hide( ); } - Ogre::OverlayElement* hudVel = - Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/MainPanel/TextVelocity"); + Ogre::Real height = sector_->avatar()->velocity() * velocityProgressHeight_ / sector_->avatar()->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 ) ); - Ogre::OverlayElement* hudVelMax = - Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/MainPanel/TextVelocityMax"); + height = sector_->avatar()->capacity() * capacitorProgressHeight_ / sector_->avatar()->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 ) ); - Ogre::OverlayElement* hudThr = - Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/MainPanel/TextThr"); + height = sector_->avatar()->thrust() * thrustProgressHeight_ / sector_->avatar()->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 ) ); - Ogre::OverlayElement* hudAcc = - Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/MainPanel/TextAcc"); - Ogre::OverlayElement* hudPos = - Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/MainPanel/TextPosition"); + velocityText_->setText( "V" + Ogre::StringConverter::toString( round( sector_->avatar()->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 ) ); - Ogre::OverlayElement* hudShield = - Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/MainPanel/TextShield"); - Ogre::OverlayElement* hudArmor = - Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + "/MainPanel/TextArmor"); - hudVel->setCaption( "Vel: " + Ogre::StringConverter::toString( round( sector_->avatar()->velocity(), 2 ), 6 ) ); - hudVelMax->setCaption( " / " + Ogre::StringConverter::toString( round( sector_->avatar()->velocityMax(), 2), 6 ) ); - hudThr->setCaption( "Thr: " + Ogre::StringConverter::toString( sector_->avatar()->thrustPercent(), 4 ) + "%" ); - hudAcc->setCaption( "Acc: " + Ogre::StringConverter::toString( sector_->avatar()->acceleration(), 2 ) ); - hudShield->setCaption( "S " + Ogre::StringConverter::toString( sector_->avatar()->shieldPercent(), 4 ) ); - hudArmor->setCaption( "A " + Ogre::StringConverter::toString( sector_->avatar()->armorPercent(), 4 ) ); - Ogre::Vector3 pos( sector_->avatar()->mainNode()->getPosition() ); - hudPos->setCaption( "Pos: " + - Ogre::StringConverter::toString( Ogre::Real( rint( pos[ 0 ] ) ), 5, 5 ) + " " + - Ogre::StringConverter::toString( Ogre::Real( rint( pos[ 1 ] ) ), 5, 5 ) + " " + - Ogre::StringConverter::toString( Ogre::Real( rint( pos[ 2 ] ) ), 5, 5 ) ); - // OverlayElement* guiAvg = OverlayManager::getSingleton().getOverlayElement("Core/AverageFps"); // OverlayElement* guiCurr = OverlayManager::getSingleton().getOverlayElement("Core/CurrFps"); // OverlayElement* guiBest = OverlayManager::getSingleton().getOverlayElement("Core/BestFps"); @@ -943,6 +998,45 @@ return true; } +bool UnDockedState::projectionPos_( Ogre::Camera * cam, const Ogre::Vector3 & pos, Ogre::Vector3 & screenSpacePos ){ + Ogre::Vector3 eyeSpacePos = cam->getViewMatrix( true ) * pos; + // z < 0 means in front of cam + if ( eyeSpacePos.z < 0 ) { + // calculate projected pos + screenSpacePos = cam->getProjectionMatrix() * eyeSpacePos; + return true; + } else { + screenSpacePos.x = (-eyeSpacePos.x > 0) ? -1 : 1; + screenSpacePos.y = (-eyeSpacePos.y > 0) ? -1 : 1; + return false; + } +} + +bool UnDockedState::projectionPosAndSize_( Ogre::Camera * cam, const Ogre::Vector3 & pos, const Ogre::Real rad, + Ogre::Real & x, Ogre::Real & y, Ogre::Real & cx, Ogre::Real & cy ){ + + Ogre::Vector3 eyeSpacePos = cam->getViewMatrix( true ) * pos; + // z < 0 means in front of cam + if ( eyeSpacePos.z < 0 ) { + // calculate projected pos + Ogre::Vector3 screenSpacePos = cam->getProjectionMatrix() * eyeSpacePos; + x = screenSpacePos.x; + y = screenSpacePos.y; + // calculate projected size + Ogre::Vector3 spheresize( rad, rad, eyeSpacePos.z ); + spheresize = cam->getProjectionMatrix() * spheresize; + cx = spheresize.x; + cy = spheresize.y; + return true; + } else { + cx = 0; + cy = 0; + x = (-eyeSpacePos.x > 0) ? -1 : 1; + y = (-eyeSpacePos.y > 0) ? -1 : 1; + return false; + } +} + bool UnDockedState::maximiseConsole( ){ if ( overlayRootWindow_ ){ CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"UnDocked/MainWindow/ConsoleFrame")-> Modified: branches/ogsector/src/UnDockedState.h =================================================================== --- branches/ogsector/src/UnDockedState.h 2007-05-22 12:57:43 UTC (rev 507) +++ branches/ogsector/src/UnDockedState.h 2007-05-23 21:24:50 UTC (rev 508) @@ -97,6 +97,10 @@ void updateHUD_( ); void updateRadar_( ); + bool projectionPos_( Ogre::Camera * cam, const Ogre::Vector3 & pos, Ogre::Vector3 & screenPos ); + bool projectionPosAndSize_( Ogre::Camera * cam, const Ogre::Vector3 & pos, const Ogre::Real rad, + Ogre::Real & x, Ogre::Real & y, Ogre::Real & cx, Ogre::Real & cy ); + Ogre::RenderWindow * window_; Ogre::Root * root_; Ogre::SceneManager * sceneMgr_; @@ -106,14 +110,67 @@ Sector * sector_; NetworkClient * network_; + Ogre::Vector2 flightCurserPos_; + CEGUI::Window * flightCurser_; + Ogre::Real flightCurserHalfWidth_; + Ogre::Real flightCurserHalfHeight_; + + CEGUI::Window * targetCurser_; + Ogre::Real targetCurserHalfWidth_; + Ogre::Real targetCurserHalfHeight_; + + CEGUI::Window * pilotFlightCurser_; + Ogre::Real pilotFlightCurserHalfWidth_; + Ogre::Real pilotFlightCurserHalfHeight_; + + CEGUI::Window * targetFlightCurser_; + Ogre::Real targetFlightCurserHalfWidth_; + Ogre::Real targetFlightCurserHalfHeight_; + + CEGUI::Window * velocityProgress_; + CEGUI::Window * velocityProgressImg_; + Ogre::Real velocityProgressHeight_; + + CEGUI::Window * thrustProgress_; + CEGUI::Window * thrustProgressImg_; + Ogre::Real thrustProgressHeight_; + + CEGUI::Window * fuelProgress_; + CEGUI::Window * fuelProgressImg_; + Ogre::Real fuelProgressHeight_; + + CEGUI::Window * capacitorProgress_; + CEGUI::Window * capacitorProgressImg_; + Ogre::Real capacitorProgressHeight_; + + CEGUI::Window * armorProgress_; + CEGUI::Window * armorProgressLeftImg_; + CEGUI::Window * armorProgressRightImg_; + Ogre::Real armorProgressHeight_; + + CEGUI::Window * shieldProgress_; + CEGUI::Window * shieldProgressLeftImg_; + CEGUI::Window * shieldProgressRightImg_; + Ogre::R... [truncated message content] |
From: <spo...@us...> - 2007-05-27 14:46:29
|
Revision: 513 http://svn.sourceforge.net/opengate/?rev=513&view=rev Author: spom_spom Date: 2007-05-27 07:46:31 -0700 (Sun, 27 May 2007) Log Message: ----------- win compatibility commit Modified Paths: -------------- branches/ogsector/src/ShipConfigDialog.h branches/ogsector/win32/ogsectorclient/ogsectorclient.exe Modified: branches/ogsector/src/ShipConfigDialog.h =================================================================== --- branches/ogsector/src/ShipConfigDialog.h 2007-05-27 14:33:40 UTC (rev 512) +++ branches/ogsector/src/ShipConfigDialog.h 2007-05-27 14:46:31 UTC (rev 513) @@ -61,7 +61,7 @@ /*! 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(); + void setupEventHandlers(); CEGUI::Window * rootWindow(){ return rootWindow_; } @@ -78,13 +78,13 @@ 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 ); - + + CEGUI::Window * rootWindow_; DeviceInfo * devices_; Ogre::SceneManager * sceneMgr_; bool visible_; - CEGUI::Window * rootWindow_; - + CEGUI::Window * shipConfigWindowView_; CEGUI::PushButton * shipConfigWindowViewButton_; CEGUI::OgreCEGUITexture * ceguiTex_; Modified: branches/ogsector/win32/ogsectorclient/ogsectorclient.exe =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2007-06-01 23:33:29
|
Revision: 517 http://svn.sourceforge.net/opengate/?rev=517&view=rev Author: spom_spom Date: 2007-06-01 16:33:29 -0700 (Fri, 01 Jun 2007) Log Message: ----------- Hurray! Shopping Shopping Shopping. (Add: Market dialog, best viewed with 1024x786 or more.) Base Modified Paths: -------------- branches/ogsector/data/commodities.xml branches/ogsector/data/gui/layouts/dialogs/ShipConfigDialog.layout branches/ogsector/data/gui/layouts/opengateDocked.layout branches/ogsector/data/gui/schemes/opengate/opengate.imageset branches/ogsector/data/gui/schemes/opengate/opengate.png branches/ogsector/data/gui/schemes/opengate/opengate.scheme branches/ogsector/data/gui/schemes/opengate/opengateButtons.looknfeel branches/ogsector/data/gui/schemes/opengate/opengateContainers.looknfeel branches/ogsector/data/gui/schemes/opengate/opengateStatic.looknfeel branches/ogsector/ogre.cfg branches/ogsector/resources.cfg branches/ogsector/src/Avatar.cpp branches/ogsector/src/Avatar.h branches/ogsector/src/ConfigDialog.cpp branches/ogsector/src/ConfigDialog.h branches/ogsector/src/Console.cpp branches/ogsector/src/Console.h branches/ogsector/src/DockedState.cpp branches/ogsector/src/DockedState.h branches/ogsector/src/Entity.cpp branches/ogsector/src/Entity.h branches/ogsector/src/EntityManager.cpp branches/ogsector/src/EntityManager.h 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/SectorObjects.cpp branches/ogsector/src/ShipConfigDialog.cpp branches/ogsector/src/ShipConfigDialog.h branches/ogsector/src/UnDockedState.cpp branches/ogsector/src/VesselManager.cpp branches/ogsector/src/VesselManager.h Added Paths: ----------- branches/ogsector/data/gui/layouts/dialogs/MarketDialog.layout branches/ogsector/data/gui/layouts/dialogs/MarketItemShortDialog.layout branches/ogsector/data/gui/schemes/opengate/BlueHighway-14.font branches/ogsector/data/gui/schemes/opengate/BlueHighway-16.font branches/ogsector/data/gui/schemes/opengate/BlueHighway-18.font branches/ogsector/data/gui/schemes/opengate/BlueHighway-8.font branches/ogsector/src/BaseDialog.cpp branches/ogsector/src/BaseDialog.h branches/ogsector/src/DeviceManager.cpp branches/ogsector/src/DeviceManager.h branches/ogsector/src/MarketDialog.cpp branches/ogsector/src/MarketDialog.h branches/ogsector/src/Vessel.h Removed Paths: ------------- branches/ogsector/src/VesselTemplate.h Modified: branches/ogsector/data/commodities.xml =================================================================== --- branches/ogsector/data/commodities.xml 2007-06-01 01:11:40 UTC (rev 516) +++ branches/ogsector/data/commodities.xml 2007-06-01 23:33:29 UTC (rev 517) @@ -1,5 +1,23 @@ <?xml version="1.0"?> <commodities> - <Resource id="1" location="../../trunk/data/commodities/aluminium.xml"/> + <Resource id="1" location="../../trunk/data/commodities/aluminium.xml"/> + <Resource id="2" location="../../trunk/data/commodities/antimony.xml"/> + <Resource id="3" location="../../trunk/data/commodities/barium.xml"/> + <Resource id="4" location="../../trunk/data/commodities/cesium.xml"/> + <Resource id="5" location="../../trunk/data/commodities/chemicals.xml"/> + <Resource id="6" location="../../trunk/data/commodities/chromium.xml"/> + <Resource id="7" location="../../trunk/data/commodities/copper.xml"/> + <Resource id="8" location="../../trunk/data/commodities/cpu.xml"/> + <Resource id="9" location="../../trunk/data/commodities/fuel_cells.xml"/> + <Resource id="10" location="../../trunk/data/commodities/gold.xml"/> + <Resource id="11" location="../../trunk/data/commodities/helium.xml"/> + <Resource id="12" location="../../trunk/data/commodities/iron.xml"/> + <Resource id="12" location="../../trunk/data/commodities/laser_components.xml"/> + <Resource id="13" location="../../trunk/data/commodities/medical_supplies.xml"/> + <Resource id="14" location="../../trunk/data/commodities/nitrogen.xml"/> + <Resource id="15" location="../../trunk/data/commodities/octavia_light.xml"/> + <Resource id="16" location="../../trunk/data/commodities/rubber.xml"/> + <Resource id="17" location="../../trunk/data/commodities/xenon.xml"/> + <Resource id="18" location="../../trunk/data/commodities/ice.xml"/> </commodities> Added: branches/ogsector/data/gui/layouts/dialogs/MarketDialog.layout =================================================================== --- branches/ogsector/data/gui/layouts/dialogs/MarketDialog.layout (rev 0) +++ branches/ogsector/data/gui/layouts/dialogs/MarketDialog.layout 2007-06-01 23:33:29 UTC (rev 517) @@ -0,0 +1,781 @@ +<?xml version="1.0" ?> +<GUILayout> + <Window Type="opengate/StaticGreenImage" Name="MarketDialog"> +<!-- <Window Type="opengate/StaticGreenImage" Name="MarketDialog"> --> + <Property Name="MousePassThroughEnabled" Value="True" /> + <Property Name="UnifiedPosition" Value="{{0.0,100},{0.0,115}}" /> + <Property Name="UnifiedSize" Value="{{1.0,-167},{1.0,-217}}" /> + <Property Name="Text" Value="Market" /> + +<!-- ********************* --> +<!-- Item Detailed View --> +<!-- ********************* --> + <Window Type="opengate/StaticGreenImage" Name="MarketItemDetailedView"> + <Property Name="UnifiedPosition" Value="{{0,220},{0.0,10}}" /> + <Property Name="UnifiedSize" Value="{{1.0,-230},{1.0,-170}}" /> + <Property Name="BackgroundEnabled" Value="True" /> + <Property Name="FrameEnabled" Value="True" /> + <Property Name="Visible" Value="False" /> + <Window Type="opengate/StaticGreenImage" Name="MarketItemDetailedView/TopLeft"> + <Property Name="UnifiedPosition" Value="{{0.0, 0},{0.0, 0}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 31},{0.0, 31}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenTopLeft"/> + </Window> + <Window Type="opengate/StaticGreenImage" Name="MarketItemDetailedView/Top"> + <Property Name="UnifiedPosition" Value="{{0.0, 31},{ 0.0, 0}}" /> + <Property Name="UnifiedSize" Value="{{1.0, -62},{ 0.0, 31}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenTop"/> + <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/Top/Title"> + <Property Name="UnifiedPosition" Value="{{0.0, 10},{ 0.0, 10}}" /> + <Property Name="UnifiedSize" Value="{{1.0, 0},{ 0.0, 20}}" /> + <Property Name="Text" Value="Would you like to purchase this item?" /> + <Property Name="Font" Value="BlueHighway-16" /> + </Window> + </Window> + <Window Type="opengate/StaticGreenImage" Name="MarketItemDetailedView/TopRight"> + <Property Name="UnifiedPosition" Value="{{1.0, -31},{ 0.0, 0}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 31},{ 0.0, 31}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenTopRight"/> + </Window> + <Window Type="opengate/StaticGreenImage" Name="MarketItemDetailedView/Image"> + <!-- Filled within game --> + <Property Name="UnifiedPosition" Value="{{0.0, 20},{0.5, -120}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 250},{0.0, 240}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + </Window> + <Window Type="opengate/StaticGreenImage" Name="MarketItemDetailedView/TextFrame"> + <Property Name="UnifiedPosition" Value="{{0.0, 290},{0.5, -120}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 250},{0.0, 240}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/TextFrame/Name"> + <Property Name="UnifiedPosition" Value="{{0.0, 0},{0.0, 0}}" /> + <Property Name="UnifiedSize" Value="{{1.0, 0},{0.0, 20}}" /> + <Property Name="Text" Value="Name:" /> + <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/TextFrame/Name/Text"> + <Property Name="UnifiedPosition" Value="{{0.0, 100},{0.0, 0}}" /> + <Property Name="UnifiedSize" Value="{{1.0, -100},{1.0, 0}}" /> + </Window> + </Window> + <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/TextFrame/Size"> + <Property Name="UnifiedPosition" Value="{{0.0, 0},{0.0, 20}}" /> + <Property Name="UnifiedSize" Value="{{1.0, 0},{0.0, 20}}" /> + <Property Name="Text" Value="Size:" /> + <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/TextFrame/Size/Text"> + <Property Name="UnifiedPosition" Value="{{0.0, 100},{0.0, 0}}" /> + <Property Name="UnifiedSize" Value="{{1.0, -100},{1.0, 0}}" /> + </Window> + </Window> + <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/TextFrame/Mass"> + <Property Name="UnifiedPosition" Value="{{0.0, 0},{0.0, 40}}" /> + <Property Name="UnifiedSize" Value="{{1.0, 0},{0.0, 20}}" /> + <Property Name="Text" Value="Mass:" /> + <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/TextFrame/Mass/Text"> + <Property Name="UnifiedPosition" Value="{{0.0, 100},{0.0, 0}}" /> + <Property Name="UnifiedSize" Value="{{1.0, -100},{1.0, 0}}" /> + </Window> + </Window> + <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/TextFrame/Amount"> + <Property Name="UnifiedPosition" Value="{{0.0, 0},{0.0, 70}}" /> + <Property Name="UnifiedSize" Value="{{1.0, 0},{0.0, 20}}" /> + <Property Name="Text" Value="Amount available:" /> + <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/TextFrame/Amount/Text"> + <Property Name="UnifiedPosition" Value="{{0.0, 100},{0.0, 0}}" /> + <Property Name="UnifiedSize" Value="{{1.0, -100},{1.0, 0}}" /> + </Window> + </Window> + <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/TextFrame/Price"> + <Property Name="UnifiedPosition" Value="{{0.0, 0},{0.0, 100}}" /> + <Property Name="UnifiedSize" Value="{{1.0, 0},{0.0, 20}}" /> + <Property Name="Text" Value="Cost with tax:" /> + <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/TextFrame/Price/Text"> + <Property Name="UnifiedPosition" Value="{{0.0, 100},{0.0, 0}}" /> + <Property Name="UnifiedSize" Value="{{1.0, -100},{1.0, 0}}" /> + </Window> + </Window> + <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/TextFrame/Rank"> + <Property Name="UnifiedPosition" Value="{{0.0, 0},{1.0, -20}}" /> + <Property Name="UnifiedSize" Value="{{1.0, 0},{0.0, 20}}" /> + <Property Name="Text" Value="Required rank:" /> + </Window> + </Window> + <Window Type="opengate/StaticGreenImage" Name="MarketItemDetailedView/BottomLeft"> + <Property Name="UnifiedPosition" Value="{{0.0, 0},{1.0, -31}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 31},{0.0, 31}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenBottomLeft"/> + </Window> + <Window Type="opengate/StaticGreenImage" Name="MarketItemDetailedView/Bottom"> + <Property Name="UnifiedPosition" Value="{{0.0, 31},{1.0, -31}}" /> + <Property Name="UnifiedSize" Value="{{1.0, -62},{0.0, 31}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenBottom"/> + <Window Type="opengate/StaticBlueImage" Name="MarketItemDetailedView/NotNowButton/Highlight"> + <Property Name="UnifiedPosition" Value="{{1.0, -80},{1.0, -26}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 80},{0.0, 20}}" /> + <Property Name="Alpha" Value="0.8" /> + <Property Name="RiseOnClick" Value="False" /> + <Property Name="MousePassThroughEnabled" Value="True" /> + </Window> + <Window Type="opengate/EmptyButton" Name="MarketItemDetailedView/NotNowButton"> + <Property Name="UnifiedPosition" Value="{{1.0, -80},{1.0, -26}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 80},{0.0, 20}}" /> + <Property Name="Text" Value="Not now" /> + </Window> + <Window Type="opengate/StaticBlueImage" Name="MarketItemDetailedView/AcceptButton/Highlight"> + <Property Name="UnifiedPosition" Value="{{1.0, -170},{1.0, -26}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 80},{0.0, 20}}" /> + <Property Name="Alpha" Value="0.8" /> + <Property Name="RiseOnClick" Value="False" /> + <Property Name="MousePassThroughEnabled" Value="True" /> + </Window> + <Window Type="opengate/EmptyButton" Name="MarketItemDetailedView/AcceptButton"> + <Property Name="UnifiedPosition" Value="{{1.0, -170},{1.0, -26}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 80},{0.0, 20}}" /> + <Property Name="Text" Value="Accept now" /> + </Window> + <Window Type="opengate/EmptyButton" Name="MarketItemDetailedView/Decrease100"> + <Property Name="UnifiedPosition" Value="{{0.0, 0},{1.0, -24}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 22},{0.0, 17}}" /> + <Property Name="NormalImage" Value="set:opengate image:MarketDecrease100Normal" /> + <Property Name="HoverImage" Value="set:opengate image:MarketDecrease100Hover" /> + <Property Name="PushedImage" Value="set:opengate image:MarketDecrease100Pushed" /> + </Window> + <Window Type="opengate/EmptyButton" Name="MarketItemDetailedView/Decrease10"> + <Property Name="UnifiedPosition" Value="{{0.0, 25},{1.0, -24}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 22},{0.0, 17}}" /> + <Property Name="NormalImage" Value="set:opengate image:MarketDecrease10Normal" /> + <Property Name="HoverImage" Value="set:opengate image:MarketDecrease10Hover" /> + <Property Name="PushedImage" Value="set:opengate image:MarketDecrease10Pushed" /> + </Window> + <Window Type="opengate/EmptyButton" Name="MarketItemDetailedView/Decrease1"> + <Property Name="UnifiedPosition" Value="{{0.0, 50},{1.0, -24}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 22},{0.0, 17}}" /> + <Property Name="NormalImage" Value="set:opengate image:MarketDecrease1Normal" /> + <Property Name="HoverImage" Value="set:opengate image:MarketDecrease1Hover" /> + <Property Name="PushedImage" Value="set:opengate image:MarketDecrease1Pushed" /> + </Window> + <Window Type="opengate/StaticImage" Name="MarketItemDetailedView/AmountBackground"> + <Property Name="UnifiedPosition" Value="{{0.0, 76},{1.0, -24}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 41},{0.0, 17}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="RiseOnClick" Value="False" /> + <Property Name="Image" Value="set:opengate image:ConsoleBackground50" /> + </Window> + <Window Type="opengate/ConsoleEditbox" Name="MarketItemDetailedView/Amount" > + <Property Name="UnifiedPosition" Value="{{0.0, 76},{1.0, -24}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 41},{0.0, 17}}" /> + </Window> + <Window Type="opengate/EmptyButton" Name="MarketItemDetailedView/Increase1"> + <Property Name="UnifiedPosition" Value="{{0.0, 120},{1.0, -24}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 22},{0.0, 17}}" /> + <Property Name="NormalImage" Value="set:opengate image:MarketIncrease1Normal" /> + <Property Name="HoverImage" Value="set:opengate image:MarketIncrease1Hover" /> + <Property Name="PushedImage" Value="set:opengate image:MarketIncrease1Pushed" /> + </Window> + <Window Type="opengate/EmptyButton" Name="MarketItemDetailedView/Increase10"> + <Property Name="UnifiedPosition" Value="{{0.0, 145},{1.0, -24}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 22},{0.0, 17}}" /> + <Property Name="NormalImage" Value="set:opengate image:MarketIncrease10Normal" /> + <Property Name="HoverImage" Value="set:opengate image:MarketIncrease10Hover" /> + <Property Name="PushedImage" Value="set:opengate image:MarketIncrease10Pushed" /> + </Window> + <Window Type="opengate/EmptyButton" Name="MarketItemDetailedView/Increase100"> + <Property Name="UnifiedPosition" Value="{{0.0, 170},{1.0, -24}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 22},{0.0, 17}}" /> + <Property Name="NormalImage" Value="set:opengate image:MarketIncrease100Normal" /> + <Property Name="HoverImage" Value="set:opengate image:MarketIncrease100Hover" /> + <Property Name="PushedImage" Value="set:opengate image:MarketIncrease100Pushed" /> + </Window> + <Window Type="opengate/EmptyButton" Name="MarketItemDetailedView/SellAll"> + <Property Name="UnifiedPosition" Value="{{0.0, 195},{1.0, -24}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 22},{0.0, 17}}" /> + <Property Name="NormalImage" Value="set:opengate image:MarketSellAllNormal" /> + <Property Name="HoverImage" Value="set:opengate image:MarketSellAllHover" /> + <Property Name="PushedImage" Value="set:opengate image:MarketSellAllPushed" /> + <Property Name="Visible" Value="False" /> + </Window> + <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/QuantityLabel"> + <Property Name="UnifiedPosition" Value="{{0.0, 210},{1.0, -26}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 100},{0.0, 20}}" /> + <Property Name="Font" Value="BlueHighway-16" /> + <Property Name="Text" Value="Quantity" /> + </Window> + </Window> + <Window Type="opengate/StaticGreenImage" Name="MarketItemDetailedView/BottomRight"> + <Property Name="UnifiedPosition" Value="{{1.0, -31},{ 1.0, -31}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 31},{ 0.0, 31}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenBottomRight"/> + </Window> + </Window> + +<!-- ********************* --> +<!-- Description Section --> +<!-- ********************* --> + <Window Type="DefaultWindow" Name="ItemDescription"> + <Property Name="UnifiedPosition" Value="{{0,10},{1.0,-150}}" /> + <Property Name="UnifiedSize" Value="{{1.0,-20},{0.0,140}}" /> + <Window Type="opengate/StaticGreenImage" Name="ItemDescription/InventoryCapacityBottomLeft"> + <Property Name="UnifiedPosition" Value="{{1.0, -287},{0.0, -5}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 31},{0.0, 31}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="RiseOnClick" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenBottomLeft"/> + </Window> + <Window Type="opengate/StaticGreenImage" Name="ItemDescription/InventoryCapacityBottom"> + <Property Name="UnifiedPosition" Value="{{1.0, -256},{0.0, -5}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 225},{0.0, 31}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="RiseOnClick" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenBottom"/> + <Window Type="opengate/StaticLabel" Name="ItemDescription/InventoryChipCargoLabel"> + <Property Name="UnifiedPosition" Value="{{0.0, 0},{0.0, 11}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 50},{0.0, 15}}" /> + <Property Name="Text" Value="Ship cargo:"/> + <Property Name="Font" Value="BlueHighway-10"/> + </Window> + <Window Type="opengate/StaticLabel" Name="InventoryChipCargoText"> + <Property Name="UnifiedPosition" Value="{{0.0, 53},{0.0, 11}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 50},{0.0, 15}}" /> + <Property Name="Text" Value="0.0000/4"/> + <Property Name="Font" Value="BlueHighway-10"/> + </Window> + <Window Type="opengate/StaticLabel" Name="ItemDescription/InventoryStorageLabel"> + <Property Name="UnifiedPosition" Value="{{1.0, -60},{0.0, 11}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 25},{0.0, 15}}" /> + <Property Name="Font" Value="BlueHighway-10"/> + <Property Name="Text" Value="Floor:"/> + </Window> + <Window Type="opengate/StaticLabel" Name="InventoryStorageText"> + <Property Name="UnifiedPosition" Value="{{1.0, -30},{0.0, 11}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 25},{0.0, 15}}" /> + <Property Name="Text" Value="0000"/> + <Property Name="Font" Value="BlueHighway-10"/> + </Window> + </Window> + <Window Type="opengate/StaticGreenImage" Name="ItemDescription/InventoryCapacityTop"> + <Property Name="UnifiedPosition" Value="{{1.0, -281},{0.0, 0}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 250},{0.0, 1}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenHorizLine"/> + </Window> + <Window Type="opengate/StaticGreenImage" Name="ItemDescription/InventoryCapacityRight"> + <Property Name="UnifiedPosition" Value="{{1.0, -31},{0.0, -5}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 1},{0.0, 31}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenVertLine"/> + </Window> + <Window Type="opengate/StaticGreenImage" Name="ItemDescription/TopLeft"> + <Property Name="UnifiedPosition" Value="{{0.0, 0},{0.0, 0}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 31},{0.0, 31}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenTopLeft"/> + </Window> + <Window Type="opengate/StaticGreenImage" Name="ItemDescription/Background1"> + <Property Name="UnifiedPosition" Value="{{0.0, 31},{0.0, 31}}" /> + <Property Name="UnifiedSize" Value="{{1.0, -323},{1.0, -62}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenBackdrop"/> + </Window> + <Window Type="opengate/StaticGreenImage" Name="ItemDescription/Background2"> + <Property Name="UnifiedPosition" Value="{{1.0, -292},{0.0, 31}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 30},{1.0, -62}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenBackdrop"/> + </Window> + <Window Type="opengate/StaticGreenImage" Name="ItemDescription/Background3"> + <Property Name="UnifiedPosition" Value="{{1.0, -262},{0.0, 62}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 231},{1.0, -93}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenBackdrop"/> + </Window> + <Window Type="opengate/StaticGreenImage" Name="ItemDescription/Top1"> + <Property Name="UnifiedPosition" Value="{{0.0, 31},{ 0.0, 0}}" /> + <Property Name="UnifiedSize" Value="{{1.0, -323},{ 0.0, 31}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenTop"/> + </Window> + <Window Type="opengate/StaticGreenImage" Name="ItemDescription/TopRight1"> + <Property Name="UnifiedPosition" Value="{{1.0, -292},{0.0, 0}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 31},{0.0, 31}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenTopRight"/> + </Window> + <Window Type="opengate/StaticGreenImage" Name="ItemDescription/Top2"> + <Property Name="UnifiedPosition" Value="{{1.0, -262},{ 0.0, 31}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 231},{ 0.0, 31}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenTop"/> + </Window> + <Window Type="opengate/StaticGreenImage" Name="ItemDescription/TopRight2"> + <Property Name="UnifiedPosition" Value="{{1.0, -31},{0.0, 31}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 31},{0.0, 31}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenTopRight"/> + </Window> + <Window Type="opengate/StaticGreenImage" Name="ItemDescription/Right2"> + <Property Name="UnifiedPosition" Value="{{1.0, -31},{0.0, 62}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 31},{1.0, -93}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenRight"/> + </Window> + <Window Type="opengate/StaticGreenImage" Name="ItemDescription/BottomRight"> + <Property Name="UnifiedPosition" Value="{{1.0, -31},{1.0, -31}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 31},{0.0, 31}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenBottomRight"/> + </Window> + <Window Type="opengate/StaticGreenImage" Name="ItemDescription/Bottom"> + <Property Name="UnifiedPosition" Value="{{0.0, 31},{1.0, -31}}" /> + <Property Name="UnifiedSize" Value="{{1.0, -62},{0.0, 31}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenBottom"/> + </Window> + <Window Type="opengate/StaticGreenImage" Name="ItemDescription/BottomLeft"> + <Property Name="UnifiedPosition" Value="{{0.0, 0},{1.0, -31}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 31},{0.0, 31}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenBottomLeft"/> + </Window> + <Window Type="opengate/StaticGreenImage" Name="ItemDescription/Left"> + <Property Name="UnifiedPosition" Value="{{0.0, 0},{0.0, 31}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 31},{1.0, -62}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenLeft"/> + </Window> + + <Window Type="opengate/StaticLabel" Name="ItemDescription/Name/Label"> + <Property Name="UnifiedPosition" Value="{{0,50},{0.0,10}}" /> + <Property Name="UnifiedSize" Value="{{0.0,200},{0.0,20}}" /> + <Property Name="Visible" Value="False" /> + <Property Name="Text" Value="Name: " /> + <Window Type="opengate/StaticLabel" Name="ItemDescription/Name/Text"> + <Property Name="UnifiedPosition" Value="{{0.0, 50},{ 0.0, 0 }}" /> + <Property Name="UnifiedSize" Value="{{1.0, -50},{ 1.0, 0 }}" /> + </Window> + </Window> + <Window Type="opengate/StaticLabel" Name="ItemDescription/Size/Label"> + <Property Name="UnifiedPosition" Value="{{0.5,0},{0.0,10}}" /> + <Property Name="UnifiedSize" Value="{{0.0,200},{0.0,20}}" /> + <Property Name="Text" Value="Size: " /> + <Property Name="Visible" Value="False" /> + <Window Type="opengate/StaticLabel" Name="ItemDescription/Size/Text"> + <Property Name="UnifiedPosition" Value="{{0.0, 30},{ 0.0, 0 }}" /> + <Property Name="UnifiedSize" Value="{{1.0, -30},{ 1.0, 0 }}" /> + </Window> + </Window> + <Window Type="opengate/StaticLabel" Name="ItemDescription/Mass/Label"> + <Property Name="UnifiedPosition" Value="{{0.5,+60},{0.0,10}}" /> + <Property Name="UnifiedSize" Value="{{0.0,200},{0.0,20}}" /> + <Property Name="Text" Value="Mass: " /> + <Property Name="Visible" Value="False" /> + <Window Type="opengate/StaticLabel" Name="ItemDescription/Mass/Text"> + <Property Name="UnifiedPosition" Value="{{0.0, 35},{ 0.0, 0 }}" /> + <Property Name="UnifiedSize" Value="{{1.0, -35},{ 1.0, 0 }}" /> + </Window> + </Window> + <Window Type="opengate/StaticText" Name="ItemDescription/Text"> + <Property Name="UnifiedPosition" Value="{{0,10},{0.0,35}}" /> + <Property Name="UnifiedSize" Value="{{1.0,-20},{1.0,-45}}" /> + <Property Name="Text" Value="" /> + </Window> + </Window> +<!-- ********************* --> +<!-- Catagorie Selection --> +<!-- ********************* --> + <Window Type="opengate/StaticGreenImage" Name="CategorieSelection"> + <Property Name="UnifiedPosition" Value="{{0,10},{0.0,10}}" /> + <Property Name="UnifiedSize" Value="{{0.0,200},{1.0,-170}}" /> + <Window Type="opengate/StaticBlueImage" Name="CategorieHighlight"> + <Property Name="UnifiedPosition" Value="{{0,10},{0.0,27}}" /> + <Property Name="UnifiedSize" Value="{{1.0,-20},{0.0,30}}" /> + <Property Name="Alpha" Value="0.8" /> + </Window> + <Window Type="opengate/MarketButton" Name="CategorieCommodities"> + <Property Name="UnifiedPosition" Value="{{0,10},{0.0,27}}" /> + <Property Name="UnifiedSize" Value="{{1.0,-20},{0.0,30}}" /> + <Property Name="Text" Value="Commodities" /> + <Window Type="opengate/StaticImage" Name="CategorieCom"> + <Property Name="UnifiedPosition" Value="{{0.0,+10},{0.5,-7}}" /> + <Property Name="UnifiedSize" Value="{{0.0,15},{0.0,15}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:IconCommoditiesNormal" /> + </Window> + </Window> + <Window Type="opengate/MarketButton" Name="CategoriePowerPlants"> + <Property Name="UnifiedPosition" Value="{{0,10},{0.0,56}}" /> + <Property Name="UnifiedSize" Value="{{1.0,-20},{0.0,30}}" /> + <Property Name="Disabled" Value="True" /> + <Property Name="Text" Value="Power Plants" /> + </Window> + <Window Type="opengate/MarketButton" Name="CategorieEngines"> + <Property Name="UnifiedPosition" Value="{{0,10},{0.0,85}}" /> + <Property Name="UnifiedSize" Value="{{1.0,-20},{0.0,30}}" /> + <Property Name="Disabled" Value="True" /> + <Property Name="Text" Value="Engines" /> + </Window> + <Window Type="opengate/MarketButton" Name="CategorieRadars"> + <Property Name="UnifiedPosition" Value="{{0,10},{0.0,114}}" /> + <Property Name="UnifiedSize" Value="{{1.0,-20},{0.0,30}}" /> + <Property Name="Disabled" Value="True" /> + <Property Name="Text" Value="Radars" /> + </Window> + <Window Type="opengate/MarketButton" Name="CategorieECM"> + <Property Name="UnifiedPosition" Value="{{0,10},{0.0,143}}" /> + <Property Name="UnifiedSize" Value="{{1.0,-20},{0.0,30}}" /> + <Property Name="Disabled" Value="True" /> + <Property Name="Text" Value="ECM" /> + </Window> + <Window Type="opengate/MarketButton" Name="CategorieCapacitors"> + <Property Name="UnifiedPosition" Value="{{0,10},{0.0,172}}" /> + <Property Name="UnifiedSize" Value="{{1.0,-20},{0.0,30}}" /> + <Property Name="Disabled" Value="True" /> + <Property Name="Text" Value="Capacitors" /> + </Window> + <Window Type="opengate/MarketButton" Name="CategorieShields"> + <Property Name="UnifiedPosition" Value="{{0,10},{0.0,201}}" /> + <Property Name="UnifiedSize" Value="{{1.0,-20},{0.0,30}}" /> + <Property Name="Disabled" Value="True" /> + <Property Name="Text" Value="Shields" /> + </Window> + <Window Type="opengate/MarketButton" Name="CategorieGuns"> + <Property Name="UnifiedPosition" Value="{{0,10},{0.0,230}}" /> + <Property Name="UnifiedSize" Value="{{1.0,-20},{0.0,30}}" /> + <Property Name="Disabled" Value="True" /> + <Property Name="Text" Value="Guns" /> + </Window> + <Window Type="opengate/MarketButton" Name="CategorieMissiles"> + <Property Name="UnifiedPosition" Value="{{0,10},{0.0,259}}" /> + <Property Name="UnifiedSize" Value="{{1.0,-20},{0.0,30}}" /> + <Property Name="Disabled" Value="True" /> + <Property Name="Text" Value="Missiles" /> + </Window> + <Window Type="opengate/MarketButton" Name="CategorieMODx"> + <Property Name="UnifiedPosition" Value="{{0,10},{0.0,288}}" /> + <Property Name="UnifiedSize" Value="{{1.0,-20},{0.0,30}}" /> + <Property Name="Disabled" Value="True" /> + <Property Name="Text" Value="MODx" /> + </Window> + <Window Type="opengate/MarketButton" Name="CategorieStorage"> + <Property Name="UnifiedPosition" Value="{{0,10},{0.0,317}}" /> + <Property Name="UnifiedSize" Value="{{1.0,-20},{0.0,30}}" /> + <Property Name="Disabled" Value="True" /> + <Property Name="Text" Value="Storage" /> + </Window> + </Window> +<!-- ********************* --> +<!-- Market Item Selection --> +<!-- ********************* --> + <Window Type="opengate/StaticGreenImage" Name="MarketWindow"> + <Property Name="UnifiedPosition" Value="{{0,225},{0.0,10}}" /> + <Property Name="UnifiedSize" Value="{{1.0,-496},{1.0,-170}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Window Type="opengate/StaticGreenImage" Name="MarketItemWindow"> + <Property Name="UnifiedPosition" Value="{{0.0, 0},{0.0, 31}}" /> + <Property Name="UnifiedSize" Value="{{1.0, -31},{1.0, -31}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + </Window> + <Window Type="opengate/StaticGreenImage" Name="MarketItemWindowTopLeft"> + <Property Name="UnifiedPosition" Value="{{0.0,0},{0.0,0}}" /> + <Property Name="UnifiedSize" Value="{{0.0,31},{0.0,31}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenTopLeft"/> + </Window> + <Window Type="opengate/StaticGreenImage" Name="MarketItemWindowTop"> + <Property Name="UnifiedPosition" Value="{{0.0,31},{0.0,0}}" /> + <Property Name="UnifiedSize" Value="{{1.0,-62},{0.0,31}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenTop"/> + <Window Type="opengate/StaticLabel" Name="MarketItem/Title"> + <Property Name="UnifiedPosition" Value="{{0.0, 0},{0.0, 7}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 100},{1.0, 0}}" /> + <Property Name="Text" Value="Public market" /> + <Property Name="Font" Value="BlueHighway-14" /> + </Window> + <Window Type="opengate/StaticImage" Name="MarketItemSortCategoryHighlight"> + <Property Name="UnifiedPosition" Value="{{0.0,100},{0.0,8}}" /> + <Property Name="UnifiedSize" Value="{{0.0,16},{0.0,16}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="AlwaysOnTop" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="True" /> + <Property Name="Image" Value="set:opengate image:MarketItemSortHighlight" /> + </Window> + <Window Type="opengate/EmptyButton" Name="MarketItemSortAlphaAscend"> + <Property Name="UnifiedPosition" Value="{{0.0,100},{0.0,8}}" /> + <Property Name="UnifiedSize" Value="{{0.0,16},{0.0,16}}" /> + <Property Name="NormalImage" Value="set:opengate image:MarketItemSortAlphaAscendNormal" /> + <Property Name="HoverImage" Value="set:opengate image:MarketItemSortAlphaAscendHover" /> + <Property Name="PushedImage" Value="set:opengate image:MarketItemSortAlphaAscendHover" /> + </Window> + <Window Type="opengate/EmptyButton" Name="MarketItemSortAlphaDescend"> + <Property Name="UnifiedPosition" Value="{{0.0,100},{0.0,8}}" /> + <Property Name="UnifiedSize" Value="{{0.0,16},{0.0,16}}" /> + <Property Name="NormalImage" Value="set:opengate image:MarketItemSortAlphaDescendNormal" /> + <Property Name="HoverImage" Value="set:opengate image:MarketItemSortAlphaDescendHover" /> + <Property Name="PushedImage" Value="set:opengate image:MarketItemSortAlphaDescendHover" /> + <Property Name="Visible" Value="False" /> + </Window> + <Window Type="opengate/EmptyButton" Name="MarketItemSortCost"> + <Property Name="UnifiedPosition" Value="{{0.0,118},{0.0,8}}" /> + <Property Name="UnifiedSize" Value="{{0.0,16},{0.0,16}}" /> + <Property Name="NormalImage" Value="set:opengate image:MarketItemSortCostNormal" /> + <Property Name="HoverImage" Value="set:opengate image:MarketItemSortCostHover" /> + <Property Name="PushedImage" Value="set:opengate image:MarketItemSortCostHover" /> + <Property Name="Disabled" Value="True" /> + </Window> + <Window Type="opengate/EmptyButton" Name="MarketItemSortSizeAscend"> + <Property Name="UnifiedPosition" Value="{{0.0,136},{0.0,8}}" /> + <Property Name="UnifiedSize" Value="{{0.0,16},{0.0,16}}" /> + <Property Name="NormalImage" Value="set:opengate image:MarketItemSortSizeAscendNormal" /> + <Property Name="HoverImage" Value="set:opengate image:MarketItemSortSizeAscendHover" /> + <Property Name="PushedImage" Value="set:opengate image:MarketItemSortSizeAscendHover" /> + </Window> + <Window Type="opengate/EmptyButton" Name="MarketItemSortSizeDescend"> + <Property Name="UnifiedPosition" Value="{{0.0,136},{0.0,8}}" /> + <Property Name="UnifiedSize" Value="{{0.0,16},{0.0,16}}" /> + <Property Name="NormalImage" Value="set:opengate image:MarketItemSortSizeDescendNormal" /> + <Property Name="HoverImage" Value="set:opengate image:MarketItemSortSizeDescendHover" /> + <Property Name="PushedImage" Value="set:opengate image:MarketItemSortSizeDescendHover" /> + <Property Name="Visible" Value="False" /> + </Window> + <Window Type="opengate/EmptyButton" Name="MarketItemSortRank"> + <Property Name="UnifiedPosition" Value="{{0.0,154},{0.0,8}}" /> + <Property Name="UnifiedSize" Value="{{0.0,16},{0.0,16}}" /> + <Property Name="NormalImage" Value="set:opengate image:MarketItemSortRankNormal" /> + <Property Name="HoverImage" Value="set:opengate image:MarketItemSortRankHover" /> + <Property Name="PushedImage" Value="set:opengate image:MarketItemSortRankHover" /> + <Property Name="Disabled" Value="True" /> + </Window> + <Window Type="opengate/EmptyButton" Name="MarketItemSortAmountAscend"> + <Property Name="UnifiedPosition" Value="{{0.0,172},{0.0,8}}" /> + <Property Name="UnifiedSize" Value="{{0.0,16},{0.0,16}}" /> + <Property Name="NormalImage" Value="set:opengate image:MarketItemSortAmountAscendNormal" /> + <Property Name="HoverImage" Value="set:opengate image:MarketItemSortAmountAscendHover" /> + <Property Name="PushedImage" Value="set:opengate image:MarketItemSortAmountAscendHover" /> + <Property Name="Disabled" Value="True" /> + </Window> + <Window Type="opengate/EmptyButton" Name="MarketItemSortAmountDescend"> + <Property Name="UnifiedPosition" Value="{{0.0,172},{0.0,8}}" /> + <Property Name="UnifiedSize" Value="{{0.0,16},{0.0,16}}" /> + <Property Name="NormalImage" Value="set:opengate image:MarketItemSortAmountDescendNormal" /> + <Property Name="HoverImage" Value="set:opengate image:MarketItemSortAmountDescendHover" /> + <Property Name="PushedImage" Value="set:opengate image:MarketItemSortAmountDescendHover" /> + <Property Name="Visible" Value="False" /> + <Property Name="Disabled" Value="True" /> + </Window> + <Window Type="opengate/StaticImage" Name="MarketItemSortHighlight"> + <Property Name="UnifiedPosition" Value="{{0.0,195},{0.0,8}}" /> + <Property Name="UnifiedSize" Value="{{0.0,16},{0.0,16}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="AlwaysOnTop" Value="True" /> + <Property Name="Image" Value="set:opengate image:MarketItemSortHighlight" /> + <Property Name="Disabled" Value="True" /> + </Window> + <Window Type="opengate/EmptyButton" Name="MarketItemSortAscend"> + <Property Name="UnifiedPosition" Value="{{0.0,195},{0.0,8}}" /> + <Property Name="UnifiedSize" Value="{{0.0,16},{0.0,16}}" /> + <Property Name="NormalImage" Value="set:opengate image:MarketItemSortAscendNormal" /> + <Property Name="HoverImage" Value="set:opengate image:MarketItemSortAscendHover" /> + <Property Name="PushedImage" Value="set:opengate image:MarketItemSortAscendHover" /> + </Window> + <Window Type="opengate/EmptyButton" Name="MarketItemSortDescend"> + <Property Name="UnifiedPosition" Value="{{0.0,213},{0.0,8}}" /> + <Property Name="UnifiedSize" Value="{{0.0,16},{0.0,16}}" /> + <Property Name="NormalImage" Value="set:opengate image:MarketItemSortDescendNormal" /> + <Property Name="HoverImage" Value="set:opengate image:MarketItemSortDescendHover" /> + <Property Name="PushedImage" Value="set:opengate image:MarketItemSortDescendHover" /> + </Window> + <Window Type="opengate/EmptyButton" Name="MarketItemSortShowAll"> + <Property Name="UnifiedPosition" Value="{{1.0,-61},{0.0,8}}" /> + <Property Name="UnifiedSize" Value="{{0.0,61},{0.0,16}}" /> + <Property Name="NormalImage" Value="set:opengate image:MarketItemSortShowAllNormal" /> + <Property Name="HoverImage" Value="set:opengate image:MarketItemSortDescendHover" /> + <Property Name="PushedImage" Value="set:opengate image:MarketItemSortShowAllHover" /> + <Property Name="Disabled" Value="True" /> + </Window> + <Window Type="opengate/StaticImage" Name="MarketItemSortShowAllHighlight"> + <Property Name="UnifiedPosition" Value="{{1.0,-61},{0.0,8}}" /> + <Property Name="UnifiedSize" Value="{{0.0,61},{0.0,16}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:MarketItemSortShowAllHighlight" /> + </Window> + </Window> + <Window Type="opengate/StaticGreenImage" Name="MarketItemWindowBottom"> + <Property Name="UnifiedPosition" Value="{{0.0,0},{0.0,31}}" /> + <Property Name="UnifiedSize" Value="{{1.0,-31},{0.0,1}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenHorizLine"/> + </Window> + <Window Type="opengate/StaticGreenImage" Name="MarketItemWindowTopRight"> + <Property Name="UnifiedPosition" Value="{{1.0,-31},{0.0,0}}" /> + <Property Name="UnifiedSize" Value="{{0.0,31},{0.0,31}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenTopRight"/> + </Window> + <Window Type="opengate/StaticGreenImage" Name="MarketItemWindowRight"> + <Property Name="UnifiedPosition" Value="{{1.0,-31},{0.0,31}}" /> + <Property Name="UnifiedSize" Value="{{0.0,31},{1.0,-62}}" /> + <Property Name="RiseOnClick" Value="False" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenRight"/> + </Window> + <Window Type="opengate/StaticGreenImage" Name="MarketItemWindowBottomRight"> + <Property Name="UnifiedPosition" Value="{{1.0,-31},{1.0,-31}}" /> + <Property Name="UnifiedSize" Value="{{0.0,31},{0.0,31}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenBottomRight"/> + </Window> + <Window Type="opengate/StaticGreenImage" Name="MarketItemWindowLeft"> + <Property Name="UnifiedPosition" Value="{{1.0,-31},{0.0,31}}" /> + <Property Name="UnifiedSize" Value="{{0.0,1},{1.0,-31}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenVertLine"/> + </Window> + <Window Type="opengate/EmptyButton" Name="MarketItemWindow/UpButton"> + <Property Name="UnifiedPosition" Value="{{1.0,-23},{0.0,32}}" /> + <Property Name="UnifiedSize" Value="{{0.0,14},{ 0.0,56}}" /> + <Property Name="NormalImage" Value="set:opengate image:ScrollThumbUpNormal" /> + <Property Name="HoverImage" Value="set:opengate image:ScrollThumbUpHover" /> + <Property Name="PushedImage" Value="set:opengate image:ScrollThumbUpPushed" /> + </Window> + <Window Type="opengate/EmptyButton" Name="MarketItemWindow/DownButton"> + <Property Name="UnifiedPosition" Value="{{1.0,-23},{1.0,-88}}" /> + <Property Name="UnifiedSize" Value="{{0.0,14},{ 0.0,56}}" /> + <Property Name="NormalImage" Value="set:opengate image:ScrollThumbDownNormal" /> + <Property Name="HoverImage" Value="set:opengate image:ScrollThumbDownHover" /> + <Property Name="PushedImage" Value="set:opengate image:ScrollThumbDownPushed" /> + </Window> + </Window> +<!-- ********************* --> +<!-- Inventore Item Selection --> +<!-- ********************* --> + <Window Type="opengate/StaticGreenImage" Name="InventoryWindow"> + <Property Name="UnifiedPosition" Value="{{1,-256},{0.0,10}}" /> + <Property Name="UnifiedSize" Value="{{0.0,246},{1.0,-170}}" /> + <Property Name="RiseOnClick" Value="False" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Window Type="opengate/EmptyButton" Name="InventoryItemWindow/UpButton"> + <Property Name="UnifiedPosition" Value="{{1.0,-23},{0.0,32}}" /> + <Property Name="UnifiedSize" Value="{{0.0,14},{ 0.0,56}}" /> + <Property Name="AlwaysOnTop" Value="True" /> + <Property Name="NormalImage" Value="set:opengate image:ScrollThumbUpNormal" /> + <Property Name="HoverImage" Value="set:opengate image:ScrollThumbUpHover" /> + <Property Name="PushedImage" Value="set:opengate image:ScrollThumbUpPushed" /> + </Window> + <Window Type="opengate/EmptyButton" Name="InventoryItemWindow/DownButton"> + <Property Name="UnifiedPosition" Value="{{1.0,-23},{1.0,-88}}" /> + <Property Name="UnifiedSize" Value="{{0.0,14},{ 0.0,56}}" /> + <Property Name="AlwaysOnTop" Value="True" /> + <Property Name="NormalImage" Value="set:opengate image:ScrollThumbDownNormal" /> + <Property Name="HoverImage" Value="set:opengate image:ScrollThumbDownHover" /> + <Property Name="PushedImage" Value="set:opengate image:ScrollThumbDownPushed" /> + </Window> + <Window Type="opengate/StaticGreenImage" Name="InventoryItemWindow"> + <Property Name="UnifiedPosition" Value="{{0, 0},{0.0, 31}}" /> + <Property Name="UnifiedSize" Value="{{1.0, -31},{1.0, -31}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + </Window> + <Window Type="opengate/StaticGreenImage" Name="InventoryItemWindowTopLeft"> + <Property Name="UnifiedPosition" Value="{{0.0,0},{0.0,0}}" /> + <Property Name="UnifiedSize" Value="{{0.0,31},{0.0,31}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenTopLeft"/> + </Window> + <Window Type="opengate/StaticGreenImage" Name="InventoryItemWindowTop"> + <Property Name="UnifiedPosition" Value="{{0.0,31},{0.0,0}}" /> + <Property Name="UnifiedSize" Value="{{1.0,-62},{0.0,31}}" /> + <Property Name="RiseOnClick" Value="False" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenTop"/> + <Window Type="opengate/StaticLabel" Name="InventoryItemWindowTitle"> + <Property Name="UnifiedPosition" Value="{{0.0, 0},{0.0, 7}}" /> + <Property Name="UnifiedSize" Value="{{1.0, 0},{1.0, 0}}" /> + <Property Name="Text" Value="Private cargo hold" /> + <Property Name="Font" Value="BlueHighway-14" /> + </Window> + </Window> + <Window Type="opengate/StaticGreenImage" Name="InventoryItemWindowBottom"> + <Property Name="UnifiedPosition" Value="{{0.0,0},{0.0,31}}" /> + <Property Name="UnifiedSize" Value="{{1.0,-31},{0.0,1}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenHorizLine"/> + </Window> + <Window Type="opengate/StaticGreenImage" Name="InventoryItemWindowTopRight"> + <Property Name="UnifiedPosition" Value="{{1.0,-31},{0.0,0}}" /> + <Property Name="UnifiedSize" Value="{{0.0,31},{0.0,31}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenTopRight"/> + </Window> + <Window Type="opengate/StaticGreenImage" Name="InventoryItemWindowRight"> + <Property Name="UnifiedPosition" Value="{{1.0,-31},{0.0,31}}" /> + <Property Name="UnifiedSize" Value="{{0.0,31},{1.0,-62}}" /> + <Property Name="RiseOnClick" Value="False" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenRight"/> + </Window> + <Window Type="opengate/StaticGreenImage" Name="InventoryItemWindowBottomRight"> + <Property Name="UnifiedPosition" Value="{{1.0,-31},{1.0,-31}}" /> + <Property Name="UnifiedSize" Value="{{0.0,31},{0.0,31}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenBottomRight"/> + </Window> + <Window Type="opengate/StaticGreenImage" Name="InventoryItemWindowLeft"> + <Property Name="UnifiedPosition" Value="{{1.0,-31},{0.0,31}}" /> + <Property Name="UnifiedSize" Value="{{0.0,1},{1.0,-31}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="Image" Value="set:opengate image:StaticGreenVertLine"/> + </Window> + </Window> + </Window> +</GUILayout> Added: branches/ogsector/data/gui/layouts/dialogs/MarketItemShortDialog.layout =================================================================== --- branches/ogsector/data/gui/layouts/dialogs/MarketItemShortDialog.layout (rev 0) +++ branches/ogsector/data/gui/layouts/dialogs/MarketItemShortDialog.layout 2007-06-01 23:33:29 UTC (rev 517) @@ -0,0 +1,44 @@ +<?xml version="1.0" ?> +<GUILayout> + <Window Type="opengate/MarketShortInfoButton" Name="MarketShortItem"> + <Property Name="UnifiedPosition" Value="{{0.0,10},{0.0,10}}" /> + <Property Name="UnifiedSize" Value="{{0.0,98},{0.0,106}}" /> + <Property Name="AlwaysOnTop" Value="true" /> + <Property Name="Text" Value="ItemName" /> + <Window Type="opengate/StaticGreenImage" Name="MarketShortItemImage"> + <Property Name="UnifiedPosition" Value="{{0.0,12},{0.0,15}}" /> + <Property Name="UnifiedSize" Value="{{1.0,-30},{1.0,-40}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="false" /> + <Property Name="MousePassThroughEnabled" Value="true" /> + </Window> + <Window Type="opengate/StaticGreenImage" Name="MarketShortItemTypIcon"> + <Property Name="UnifiedPosition" Value="{{1.0, -15},{0,3}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 12},{0.0, 12}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="false" /> + <Property Name="Image" Value="set:opengate image:IconCommoditiesNeutral" /> + <Property Name="MousePassThroughEnabled" Value="true" /> + </Window> + <Window Type="opengate/StaticGreenImage" Name="MarketShortItemSizeIcon"> + <Property Name="UnifiedPosition" Value="{{1.0, -15},{1, -41}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 12},{0.0, 26}}" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="false" /> + <Property Name="Image" Value="set:opengate image:IconSize1" /> + <Property Name="MousePassThroughEnabled" Value="true" /> + </Window> + <Window Type="opengate/StaticLabel" Name="MarketShortItemAmount"> + <Property Name="UnifiedPosition" Value="{{0.0,10},{0.0,2}}" /> + <Property Name="UnifiedSize" Value="{{0.0,50},{0.0,10}}" /> + <Property Name="Font" Value="BlueHighway-10" /> + <Property Name="MousePassThroughEnabled" Value="true" /> + </Window> + <Window Type="opengate/StaticLabel" Name="MarketShortItemPrice"> + <Property Name="UnifiedPosition" Value=... [truncated message content] |
From: <spo...@us...> - 2007-06-02 16:14:11
|
Revision: 521 http://svn.sourceforge.net/opengate/?rev=521&view=rev Author: spom_spom Date: 2007-06-02 09:14:07 -0700 (Sat, 02 Jun 2007) Log Message: ----------- The marketdialog now support equipment. Modified Paths: -------------- branches/ogsector/data/equipment.xml branches/ogsector/data/gui/layouts/dialogs/MarketDialog.layout branches/ogsector/ogre.cfg branches/ogsector/resources.cfg branches/ogsector/src/Avatar.cpp branches/ogsector/src/Avatar.h branches/ogsector/src/Entity.h branches/ogsector/src/EntityManager.cpp branches/ogsector/src/EntityManager.h branches/ogsector/src/MarketDialog.cpp branches/ogsector/src/MarketDialog.h branches/ogsector/src/VesselManager.cpp Modified: branches/ogsector/data/equipment.xml =================================================================== --- branches/ogsector/data/equipment.xml 2007-06-02 02:36:57 UTC (rev 520) +++ branches/ogsector/data/equipment.xml 2007-06-02 16:14:07 UTC (rev 521) @@ -3,4 +3,5 @@ <equipment> <Resource id="1" location="../../trunk/data/capacitors/s_c_15.xml" /> <Resource id="2" location="../../trunk/data/ECMs/ghost.xml" /> + <Resource id="3" location="../../trunk/data/capacitors/deepol.xml" /> </equipment> Modified: branches/ogsector/data/gui/layouts/dialogs/MarketDialog.layout =================================================================== --- branches/ogsector/data/gui/layouts/dialogs/MarketDialog.layout 2007-06-02 02:36:57 UTC (rev 520) +++ branches/ogsector/data/gui/layouts/dialogs/MarketDialog.layout 2007-06-02 16:14:07 UTC (rev 521) @@ -242,25 +242,35 @@ <Property Name="FrameEnabled" Value="False" /> <Property Name="RiseOnClick" Value="False" /> <Property Name="Image" Value="set:opengate image:StaticGreenBottom"/> - <Window Type="opengate/StaticLabel" Name="ItemDescription/InventoryChipCargoLabel"> - <Property Name="UnifiedPosition" Value="{{0.0, 0},{0.0, 11}}" /> - <Property Name="UnifiedSize" Value="{{0.0, 50},{0.0, 15}}" /> + <Window Type="opengate/StaticLabel" Name="ItemDescription/InventoryShipCargoLabel"> + <Property Name="UnifiedPosition" Value="{{0.0, 0},{0.0, 11}}" /> + <Property Name="UnifiedSize" Value="{{0.5, 0},{0.0, 15}}" /> <Property Name="Text" Value="Ship cargo:"/> <Property Name="Font" Value="BlueHighway-10"/> + <Window Type="opengate/StaticLabel" Name="InventoryShipCargo/Text"> + <Property Name="UnifiedPosition" Value="{{0.0, 50},{0.0, 0}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 20},{1.0, 0}}" /> + <Property Name="Font" Value="BlueHighway-10"/> + </Window> + <Window Type="opengate/StaticLabel" Name="InventoryShipCargoTextSeparator"> + <Property Name="UnifiedPosition" Value="{{0.0, 71},{0.0, 0}}" /> + <Property Name="UnifiedSize" Value="{{0.0, 10},{1.0, 0}}" /> + <Property Name="Text" Value="/"/> + <Property Name="Font" Value="BlueHighway-10"/> + </Window> + <Window Type="opengate/StaticLabel" Name="InventoryShipCargoMax/Text"> + <Property Name="UnifiedPosition" Value="{{0.0, 81},{0.0, 0}}" /> + <Property Name="UnifiedSize" Value="{{1.0, -81},{1.0, 0}}" /> + <Property Name="Font" Value="BlueHighway-10"/> + </Window> </Window> - <Window Type="opengate/StaticLabel" Name="InventoryChipCargoText"> - <Property Name="UnifiedPosition" Value="{{0.0, 53},{0.0, 11}}" /> - <Property Name="UnifiedSize" Value="{{0.0, 50},{0.0, 15}}" /> - <Property Name="Text" Value="0.0000/4"/> - <Property Name="Font" Value="BlueHighway-10"/> - </Window> <Window Type="opengate/StaticLabel" Name="ItemDescription/InventoryStorageLabel"> <Property Name="UnifiedPosition" Value="{{1.0, -60},{0.0, 11}}" /> <Property Name="UnifiedSize" Value="{{0.0, 25},{0.0, 15}}" /> <Property Name="Font" Value="BlueHighway-10"/> <Property Name="Text" Value="Floor:"/> </Window> - <Window Type="opengate/StaticLabel" Name="InventoryStorageText"> + <Window Type="opengate/StaticLabel" Name="InventoryFloorSize/Text"> <Property Name="UnifiedPosition" Value="{{1.0, -30},{0.0, 11}}" /> <Property Name="UnifiedSize" Value="{{0.0, 25},{0.0, 15}}" /> <Property Name="Text" Value="0000"/> @@ -435,62 +445,52 @@ <Window Type="opengate/MarketButton" Name="CategoriePowerPlants"> <Property Name="UnifiedPosition" Value="{{0,10},{0.0,56}}" /> <Property Name="UnifiedSize" Value="{{1.0,-20},{0.0,30}}" /> - <Property Name="Disabled" Value="True" /> <Property Name="Text" Value="Power Plants" /> </Window> <Window Type="opengate/MarketButton" Name="CategorieEngines"> <Property Name="UnifiedPosition" Value="{{0,10},{0.0,85}}" /> <Property Name="UnifiedSize" Value="{{1.0,-20},{0.0,30}}" /> - <Property Name="Disabled" Value="True" /> <Property Name="Text" Value="Engines" /> </Window> <Window Type="opengate/MarketButton" Name="CategorieRadars"> <Property Name="UnifiedPosition" Value="{{0,10},{0.0,114}}" /> <Property Name="UnifiedSize" Value="{{1.0,-20},{0.0,30}}" /> - <Property Name="Disabled" Value="True" /> <Property Name="Text" Value="Radars" /> </Window> <Window Type="opengate/MarketButton" Name="CategorieECM"> <Property Name="UnifiedPosition" Value="{{0,10},{0.0,143}}" /> <Property Name="UnifiedSize" Value="{{1.0,-20},{0.0,30}}" /> - <Property Name="Disabled" Value="True" /> <Property Name="Text" Value="ECM" /> </Window> <Window Type="opengate/MarketButton" Name="CategorieCapacitors"> <Property Name="UnifiedPosition" Value="{{0,10},{0.0,172}}" /> <Property Name="UnifiedSize" Value="{{1.0,-20},{0.0,30}}" /> - <Property Name="Disabled" Value="True" /> <Property Name="Text" Value="Capacitors" /> </Window> <Window Type="opengate/MarketButton" Name="CategorieShields"> <Property Name="UnifiedPosition" Value="{{0,10},{0.0,201}}" /> <Property Name="UnifiedSize" Value="{{1.0,-20},{0.0,30}}" /> - <Property Name="Disabled" Value="True" /> <Property Name="Text" Value="Shields" /> </Window> <Window Type="opengate/MarketButton" Name="CategorieGuns"> <Property Name="UnifiedPosition" Value="{{0,10},{0.0,230}}" /> <Property Name="UnifiedSize" Value="{{1.0,-20},{0.0,30}}" /> - <Property Name="Disabled" Value="True" /> <Property Name="Text" Value="Guns" /> </Window> <Window Type="opengate/MarketButton" Name="CategorieMissiles"> <Property Name="UnifiedPosition" Value="{{0,10},{0.0,259}}" /> <Property Name="UnifiedSize" Value="{{1.0,-20},{0.0,30}}" /> - <Property Name="Disabled" Value="True" /> <Property Name="Text" Value="Missiles" /> </Window> <Window Type="opengate/MarketButton" Name="CategorieMODx"> <Property Name="UnifiedPosition" Value="{{0,10},{0.0,288}}" /> <Property Name="UnifiedSize" Value="{{1.0,-20},{0.0,30}}" /> - <Property Name="Disabled" Value="True" /> <Property Name="Text" Value="MODx" /> </Window> - <Window Type="opengate/MarketButton" Name="CategorieStorage"> + <Window Type="opengate/MarketButton" Name="CategorieAll"> <Property Name="UnifiedPosition" Value="{{0,10},{0.0,317}}" /> <Property Name="UnifiedSize" Value="{{1.0,-20},{0.0,30}}" /> - <Property Name="Disabled" Value="True" /> - <Property Name="Text" Value="Storage" /> + <Property Name="Text" Value="All" /> </Window> </Window> <!-- ********************* --> @@ -579,7 +579,6 @@ <Property Name="NormalImage" Value="set:opengate image:MarketItemSortRankNormal" /> <Property Name="HoverImage" Value="set:opengate image:MarketItemSortRankHover" /> <Property Name="PushedImage" Value="set:opengate image:MarketItemSortRankHover" /> - <Property Name="Disabled" Value="True" /> </Window> <Window Type="opengate/EmptyButton" Name="MarketItemSortAmountAscend"> <Property Name="UnifiedPosition" Value="{{0.0,172},{0.0,8}}" /> Modified: branches/ogsector/ogre.cfg =================================================================== --- branches/ogsector/ogre.cfg 2007-06-02 02:36:57 UTC (rev 520) +++ branches/ogsector/ogre.cfg 2007-06-02 16:14:07 UTC (rev 521) @@ -5,4 +5,4 @@ Full Screen=No RTT Preferred Mode=FBO Refresh Rate=Not applicable -Video Mode=1024 x 768 +Video Mode=800 x 600 Modified: branches/ogsector/resources.cfg =================================================================== --- branches/ogsector/resources.cfg 2007-06-02 02:36:57 UTC (rev 520) +++ branches/ogsector/resources.cfg 2007-06-02 16:14:07 UTC (rev 521) @@ -22,6 +22,7 @@ # FileSystem=../../trunk/data/ FileSystem=../../trunk/data/commodities +FileSystem=../../trunk/data/capacitors FileSystem=../../trunk/data/ships/octavius/apteryx FileSystem=../../trunk/data/ships/quantar/storm FileSystem=../../trunk/data/ships/tauseti/lady_kickstart Modified: branches/ogsector/src/Avatar.cpp =================================================================== --- branches/ogsector/src/Avatar.cpp 2007-06-02 02:36:57 UTC (rev 520) +++ branches/ogsector/src/Avatar.cpp 2007-06-02 16:14:07 UTC (rev 521) @@ -25,6 +25,7 @@ Avatar::Avatar( const std::string & name, int ID ): name_( name ), id_( ID ) { setVessel( *VesselManager::getSingleton().vessel( "apteryx" ) ); + cargoHold_ = 0; } Avatar::~Avatar( ){ @@ -42,13 +43,28 @@ if ( items.size() > 0 ){ for ( std::list< std::deque< Entity * > >::iterator it = floorCargo_.begin(); it != floorCargo_.end(); it ++ ){ if ( (*it)[ 0 ]->id() == items[ 0 ]->id() ){ - // if ( int i = 0; i < items.size(); i ++ ) (*it).push_back( items.begin(), items.end() ); - (*it).insert( (*it).end(), items.begin(), items.end() ); + for ( int i = 0; i < items.size(); i ++ ) { + if ( ( maxCargoHold_ - cargoHold_ ) >= items[ i ]->size() ){ + (*it).push_back( items[ i ] ); + cargoHold_ += items[ i ]->size(); + } else { + return; + } + } return; } } - std::deque< Entity * > newItem( items.begin(), items.end() ); - floorCargo_.push_back( newItem ); + std::deque< Entity * > newItem; + + for ( int i = 0; i < items.size(); i ++ ) { + if ( ( maxCargoHold_ - cargoHold_ ) >= items[ i ]->size() ){ + newItem.push_back( items[ i ] ); + cargoHold_ += items[ i ]->size(); + } else { + return; + } + } + if ( newItem.size() > 0 ) floorCargo_.push_back( newItem ); } } @@ -56,8 +72,9 @@ if ( items.size() > 0 ){ for ( std::list< std::deque< Entity * > >::iterator it = floorCargo_.begin(); it != floorCargo_.end(); it ++ ){ if ( (*it)[ 0 ]->id() == items[ 0 ]->id() ){ - for ( int i = 0; i < items.size(); i ++ ) { + for ( unsigned int i = 0; i < items.size(); i ++ ) { (*it).pop_back( ); + cargoHold_ -= items[ i ]->size(); if ( (*it).size() == 0 ) { floorCargo_.erase( it ); return; Modified: branches/ogsector/src/Avatar.h =================================================================== --- branches/ogsector/src/Avatar.h 2007-06-02 02:36:57 UTC (rev 520) +++ branches/ogsector/src/Avatar.h 2007-06-02 16:14:07 UTC (rev 521) @@ -49,7 +49,8 @@ void addCargoToFloor( const std::vector < Entity * > & item ); void delCargoToFloor( const std::vector < Entity * > & item ); - int maxCargoHold( ) const { return maxCargoHold_; } + int cargoHoldMax( ) const { return maxCargoHold_; } + int cargoHold( ) const { return cargoHold_; } std::list< std::deque < Entity * > > * floorCargo() { return & floorCargo_; } Modified: branches/ogsector/src/Entity.h =================================================================== --- branches/ogsector/src/Entity.h 2007-06-02 02:36:57 UTC (rev 520) +++ branches/ogsector/src/Entity.h 2007-06-02 16:14:07 UTC (rev 521) @@ -41,6 +41,8 @@ * \author Christoph Brill <eg...@us...> */ +enum EntityType{ENTITY,VESSEL,COMMODITY,POWERPLANT,ENGINE,RADAR,ECM,CAPACITOR,SHIELD,GUN,MISSILE,MODX}; + class Entity{ public: @@ -51,11 +53,13 @@ techLevel_ = 0; mass_ = 0; size_ = 0; + rtti_ = ENTITY; } - virtual ~Entity(){ - } + virtual ~Entity(){ } + virtual EntityType entityType() const { return rtti_; } + inline void setFactionName( const std::string & name ) { factionName_ = name; } inline std::string factionName( ) const { return factionName_; } @@ -105,6 +109,9 @@ long mass_; /*! The amount of slots necessary to plug in such a device. */ int size_; + + /*! For runtime identification of an entity item. */ + EntityType rtti_; }; /** @@ -117,7 +124,8 @@ * * \author Christoph Brill <eg...@us...> */ -class EquipmentTemplate : public Entity{ + +class Equipment : public Entity{ public: inline void setManufacturer( const std::string & manufacturer ) { manufacturer_ = manufacturer; } @@ -130,17 +138,18 @@ inline std::set < Commodity * > requieredComponents( ) const { return requieredComponents_; } protected: - EquipmentTemplate(): Entity(), manufacturer_( "unkown" ) { + Equipment() : Entity(), manufacturer_( "unkown" ) { size_ = 0; } + virtual ~Equipment() { } + /*! Name of the company that produces this equipment */ std::string manufacturer_; /*! The places where this part of equipment is built */ std::set < std::string > productionCenter_; /*! The components required to build this equipment part */ std::set < Commodity * > requieredComponents_; - }; /*! @@ -151,12 +160,13 @@ * is a component that is plugged into the ship. * \author Christoph Brill <eg...@us...> */ -class Capacitor : public EquipmentTemplate{ +class Capacitor : public Equipment{ public: - Capacitor(): EquipmentTemplate() { + Capacitor() : Equipment() { efficiency_ = 0; capacity_ = 0; + rtti_ = CAPACITOR; } inline void setEfficiency( long efficiency ) { efficiency_ = efficiency; } @@ -173,19 +183,20 @@ }; /*! - * \brief This class stores the basical information of an ECM (Evasion and Counter Measures) + * \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 + * 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{ +class Ecm : public Equipment{ public: - ECM(): EquipmentTemplate() { + Ecm() : Equipment() { sensorLevel_ = 0; powerConsumption_ = 0; + rtti_ = ECM; } inline void setSensorLevel( short sensorLevel ) { sensorLevel_ = sensorLevel; } @@ -195,9 +206,9 @@ inline long powerConsumption( ) { return powerConsumption_; } private: - /*! Stores the sensorlevel of this ECM */ + /*! Stores the sensorlevel of this Ecm */ short sensorLevel_; - /*! Stores the power consumption of this ECM */ + /*! Stores the power consumption of this Ecm */ long powerConsumption_; }; @@ -209,12 +220,13 @@ * is a component that is plugged into the ship. * \author Christoph Brill <eg...@us...> */ -class Engine : public EquipmentTemplate { +class Engine : public Equipment { public: - Engine(): EquipmentTemplate() { + Engine(): Equipment() { efficiency_ = 0.0; maxThrust_ = 0; + rtti_ = ENGINE; } inline void setEfficiency( double efficiency ) { efficiency_ = efficiency; } @@ -245,6 +257,7 @@ meltingPoint_ = 0; size_ = 0; graviticSig_ = 0.0; + rtti_ = COMMODITY; } inline void setProductionCenters( const std::set < std::string > & productionCenters ) { productionCenters_ = productionCenters; } Modified: branches/ogsector/src/EntityManager.cpp =================================================================== --- branches/ogsector/src/EntityManager.cpp 2007-06-02 02:36:57 UTC (rev 520) +++ branches/ogsector/src/EntityManager.cpp 2007-06-02 16:14:07 UTC (rev 521) @@ -99,7 +99,6 @@ TiXmlHandle docHandle( &doc ); TiXmlElement* pElem; - TiXmlNode* pNode; TiXmlHandle hRoot( 0 ); //** block: equipment; @@ -116,76 +115,94 @@ return NULL; } - EquipmentTemplate *entity = 0; - bool isCapacitor = false, isECM = false; //!< \todo Check if that is really necessary, seems hackish. should be somehow done in subclasses or something + Equipment * entity = 0; std::string equipmentType = pElem->Attribute("type"); - /*! \TODO add check, if type was found */ -#if 0 - if ( equipmentType ) { + + if ( equipmentType == "Engine" ) entity = new Engine(); + else if ( equipmentType == "ECM" ) entity = new Ecm(); + else if ( equipmentType == "Capacitor" ) entity = new Capacitor(); + else { log_->fatal( fileName + " has no type of equipment defined" ); return NULL; } -#endif - // Found capacitor - if ( strcmp( "Capacitor", equipmentType.c_str() ) == 0 ){ - entity = new Capacitor(); - isCapacitor = true; - } else if ( strcmp( "ECM", equipmentType.c_str() ) == 0 ){ - entity = new ECM(); - isECM = true; + //** Mandatory elements; + pElem = hRoot.ChildElement( "name", 0 ).Element(); + if ( pElem ) { + entity->setName( pElem->FirstChild()->Value() ); } else { - //! \todo Add logic for things other than capacitor and ECMs - log_->warn( fileName + " has unknown equipment type (mandatory)." ); + log_->fatal( fileName + " has no name (mandatory)." ); return NULL; } - - // Naming pElem = hRoot.ChildElement( "faction", 0 ).Element(); if ( pElem ) { entity->setFactionName( pElem->FirstChild()->Value() ); } else { - log_->fatal( fileName + " has no mandatory factionname (mandatory)." ); + log_->fatal( fileName + " has no 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 + //** Generic elements 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 - if ( isCapacitor ) { + pElem = hRoot.ChildElement( "description", 0 ).Element(); + if ( pElem ) entity->setDescription( pElem->FirstChild()->Value() ); + + pElem = hRoot.ChildElement( "image", 0 ).Element(); + if ( pElem ) entity->setImageName( pElem->FirstChild()->Value() ); + + + //** Specific elements; + switch ( entity->entityType() ){ + case POWERPLANT: + break; + case ENGINE: + break; + case RADAR: + break; + case ECM: + pElem = hRoot.ChildElement( "sensorlevel", 0 ).Element(); + if ( pElem ) static_cast<Ecm*>(entity)->setSensorLevel( toInt( pElem->FirstChild()->Value() ) ); + + pElem = hRoot.ChildElement( "power", 0 ).Element(); + if ( pElem ) static_cast<Ecm*>(entity)->setPowerConsumption( toInt( pElem->FirstChild()->Value() ) ); + break; + case CAPACITOR: pElem = hRoot.ChildElement( "efficiency", 0 ).Element(); if ( pElem ) static_cast<Capacitor*>(entity)->setEfficiency( toInt( pElem->FirstChild()->Value() ) ); + pElem = hRoot.ChildElement( "capacity", 0 ).Element(); if ( pElem ) static_cast<Capacitor*>(entity)->setCapacity( toInt( pElem->FirstChild()->Value() ) ); - } else if ( isECM ) { - pElem = hRoot.ChildElement( "sensorlevel", 0 ).Element(); - if ( pElem ) static_cast<ECM*>(entity)->setSensorLevel( toInt( pElem->FirstChild()->Value() ) ); - pElem = hRoot.ChildElement( "power", 0 ).Element(); - if ( pElem ) static_cast<ECM*>(entity)->setPowerConsumption( toInt( pElem->FirstChild()->Value() ) ); - } else { - //! \todo Add logic for things other than capacitors and ECMs + break; + case SHIELD: + break; + case GUN: + break; + case MISSILE: + break; + case MODX: + break; + default: + break; } - // Production Data + //** Additonal elements; + //** Production Data; std::set < std::string > productionCenters; for ( pElem = hRoot.FirstChild( "production-center" ).Element(); pElem != 0; pElem = pElem->NextSiblingElement() ) { productionCenters.insert( pElem->FirstChild()->Value() ); //!< \todo check return value! } + entity->setProductionCenters( productionCenters ); CommodityManager* commodityMgr = CommodityManager::getSingletonPtr(); if ( !commodityMgr ) { @@ -249,7 +266,6 @@ TiXmlHandle docHandle( &doc ); TiXmlElement* pElem; - TiXmlNode* pNode; TiXmlHandle hRoot( 0 ); //** block: equipment; Modified: branches/ogsector/src/EntityManager.h =================================================================== --- branches/ogsector/src/EntityManager.h 2007-06-02 02:36:57 UTC (rev 520) +++ branches/ogsector/src/EntityManager.h 2007-06-02 16:14:07 UTC (rev 521) @@ -31,6 +31,7 @@ * 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. @@ -44,6 +45,36 @@ inline std::set < std::string > factionNames( ) const { return factions_; } + EntityType categoryType( const std::string & category ){ + if ( category == "Commodity" || category == "Commoditys" || + category == "commodity" || category == "commoditys" ) return COMMODITY; + else if ( category == "Power Plant" || category == "Power Plants" || + category == "Powerplant" || category == "Powerplants" || + category == "Power plant" || category == "Power plants" || + category == "powerplant" || category == "powerplants" ) return POWERPLANT; + else if ( category == "Engine" || category == "Engines" || + category == "engine" || category == "engines" ) return ENGINE; + else if ( category == "Radar" || category == "Radars" || + category == "radar" || category == "radars" ) return RADAR; + else if ( category == "ECM" || category == "ECMs" || + category == "Ecm" || category == "Ecms" || + category == "ecm" || category == "ecms" ) return ECM; + else if ( category == "Capacitor" || category == "Capacitors" || + category == "capacitor" || category == "capacitors" ) return CAPACITOR; + else if ( category == "Shield" || category == "Shields" || + category == "shield" || category == "shields" ) return SHIELD; + else if ( category == "Gun" || category == "Guns" || + category == "gun" || category == "guns" ) return GUN; + else if ( category == "Missile" || category == "Missiles" || + category == "missile" || category == "missiles" ) return MISSILE; + else if ( category == "MODX" || category == "MODXs" || + category == "MODx" || category == "MODxs" || + category == "modx" || category == "modxs" ) return MODX; + + LogManager::getSingleton().warn("Request entity rtti for " + category + " unknown" ); + return ENTITY; + } + protected: /*! \brief This loads enities from there definition files, called from load() @@ -90,6 +121,17 @@ virtual Entity * loadAndCreate( int id, const std::string & filename ); + std::vector < Entity * > allByCategory( const std::string & category ){ + EntityType rtti = categoryType( category ); + std::vector < Entity * > items; + for ( std::map < std::string, Entity * >::iterator it = templatesByName_.begin(); it != templatesByName_.end(); it ++ ){ + if ( ( category == "All" ) || ( it->second->entityType() == rtti ) ){ + items.push_back( it->second ); + } + } + return items; + } + }; /*! @@ -124,13 +166,12 @@ } } - std::vector < Commodity * > allCommodities(){ - std::vector < Commodity * > comms; - + std::vector < Entity * > allCommodities(){ + std::vector < Entity * > items; for ( std::map < std::string, Entity * >::iterator it = templatesByName_.begin(); it != templatesByName_.end(); it ++ ){ - comms.push_back( static_cast<Commodity *>(it->second) ); + items.push_back( it->second ); } - return comms; + return items; } }; Modified: branches/ogsector/src/MarketDialog.cpp =================================================================== --- branches/ogsector/src/MarketDialog.cpp 2007-06-02 02:36:57 UTC (rev 520) +++ branches/ogsector/src/MarketDialog.cpp 2007-06-02 16:14:07 UTC (rev 521) @@ -80,9 +80,27 @@ CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton(); BIND_CEGUI_EVENT( wmgr.getWindow( (CEGUI::utf8*)"CategorieCommodities"), - CEGUI::PushButton::EventClicked, MarketDialog::handleCategorieCommodities ); + CEGUI::PushButton::EventClicked, MarketDialog::handleCategorieChanged ); + BIND_CEGUI_EVENT( wmgr.getWindow( (CEGUI::utf8*)"CategoriePowerPlants"), + CEGUI::PushButton::EventClicked, MarketDialog::handleCategorieChanged ); + BIND_CEGUI_EVENT( wmgr.getWindow( (CEGUI::utf8*)"CategorieEngines"), + CEGUI::PushButton::EventClicked, MarketDialog::handleCategorieChanged ); + BIND_CEGUI_EVENT( wmgr.getWindow( (CEGUI::utf8*)"CategorieRadars"), + CEGUI::PushButton::EventClicked, MarketDialog::handleCategorieChanged ); + BIND_CEGUI_EVENT( wmgr.getWindow( (CEGUI::utf8*)"CategorieECM"), + CEGUI::PushButton::EventClicked, MarketDialog::handleCategorieChanged ); BIND_CEGUI_EVENT( wmgr.getWindow( (CEGUI::utf8*)"CategorieCapacitors"), - CEGUI::PushButton::EventClicked, MarketDialog::handleCategorieCapacitors ); + CEGUI::PushButton::EventClicked, MarketDialog::handleCategorieChanged ); + BIND_CEGUI_EVENT( wmgr.getWindow( (CEGUI::utf8*)"CategorieShields"), + CEGUI::PushButton::EventClicked, MarketDialog::handleCategorieChanged ); + BIND_CEGUI_EVENT( wmgr.getWindow( (CEGUI::utf8*)"CategorieGuns"), + CEGUI::PushButton::EventClicked, MarketDialog::handleCategorieChanged ); + BIND_CEGUI_EVENT( wmgr.getWindow( (CEGUI::utf8*)"CategorieMissiles"), + CEGUI::PushButton::EventClicked, MarketDialog::handleCategorieChanged ); + BIND_CEGUI_EVENT( wmgr.getWindow( (CEGUI::utf8*)"CategorieMODx"), + CEGUI::PushButton::EventClicked, MarketDialog::handleCategorieChanged ); + BIND_CEGUI_EVENT( wmgr.getWindow( (CEGUI::utf8*)"CategorieAll"), + CEGUI::PushButton::EventClicked, MarketDialog::handleCategorieChanged ); BIND_CEGUI_EVENT( wmgr.getWindow( (CEGUI::utf8*)"MarketItemSortAlphaAscend"), CEGUI::PushButton::EventClicked, MarketDialog::handleMarketItemSortAlphaAscend ); @@ -148,15 +166,17 @@ } } -bool lesserMass( const Commodity * l, const Commodity * r ) { return ( l->mass() < r->mass() ); } -bool greaterMass( const Commodity * l, const Commodity * r ) { return ( l->mass() > r->mass() ); } +bool lesserMass( const Entity * l, const Entity * r ) { return ( l->mass() < r->mass() ); } +bool greaterMass( const Entity * l, const Entity * r ) { return ( l->mass() > r->mass() ); } -bool lesserName( const Commodity * l, const Commodity * r ) { return ( l->name() < r->name() ); } -bool greaterName( const Commodity * l, const Commodity * r ) { return ( l->name() > r->name() ); } +bool lesserName( const Entity * l, const Entity * r ) { return ( l->name() < r->name() ); } +bool greaterName( const Entity * l, const Entity * r ) { return ( l->name() > r->name() ); } -bool lesserSize( const Commodity * l, const Commodity * r ) { return ( l->size() < r->size() ); } -bool greaterSize( const Commodity * l, const Commodity * r ) { return ( l->size() > r->size() ); } +bool lesserSize( const Entity * l, const Entity * r ) { return ( l->size() < r->size() ); } +bool greaterSize( const Entity * l, const Entity * r ) { return ( l->size() > r->size() ); } +bool lesserRank( const Entity * l, const Entity * r ) { return ( l->techLevel() < r->techLevel() ); } +bool greaterRank( const Entity * l, const Entity * r ) { return ( l->techLevel() > r->techLevel() ); } void MarketDialog::updateMarketView(){ @@ -166,56 +186,65 @@ } else { CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"MarketItemWindow/UpButton")->show(); } - + + std::vector < Entity * > items; + if ( selectedCategory_ == "Commodities" ){ - std::vector < Commodity * > commodites = CommodityManager::getSingleton().allCommodities(); - - switch ( sortBy_ ){ - case Alphanumeric: - if ( sortAscending_ ) sort( commodites.begin(), commodites.end(), &OpenGate::lesserName ); - else sort( commodites.begin(), commodites.end(), &OpenGate::greaterName ); - break; - case Cost: - break; - case Size: - if ( sortAscending_ ) sort( commodites.begin(), commodites.end(), &OpenGate::lesserSize ); - else sort( commodites.begin(), commodites.end(), &OpenGate::greaterSize ); - break; - case Rank: - break; - case Amount: - break; - } - - int maxRow = (int)floor( commodites.size() / marketItemWindowRow_ )+1; - marketOffsetRow_ = min( marketOffsetRow_, maxRow ); - - if ( (marketOffsetRow_+1) > ( maxRow - marketItemWindowRow_ ) ){ - CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"MarketItemWindow/DownButton")->hide(); - } else { - CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"MarketItemWindow/DownButton")->show(); - } - - for ( int i = 0; i < marketItemWindowRow_; i ++ ){ - for ( int j = 0; j < marketItemWindowCol_; j ++ ){ - int widgetCount = i * marketItemWindowCol_ + j; - int commodCount = ( i + marketOffsetRow_ ) * marketItemWindowCol_ + j; - - if ( commodCount >= commodites.size() ) { - fillShortItemWindow( marketItems_[ widgetCount ] ); - } else { - fillShortItemWindow( marketItems_[ widgetCount ], commodites[ commodCount ], 1000, 1 ); - } + items = CommodityManager::getSingleton().allCommodities(); + } else { + items = EquipmentManager::getSingleton().allByCategory( selectedCategory_ ); + } + + switch ( sortBy_ ){ + case Alphanumeric: + if ( sortAscending_ ) sort( items.begin(), items.end(), &OpenGate::lesserName ); + else sort( items.begin(), items.end(), &OpenGate::greaterName ); + break; + case Cost: + break; + case Size: + if ( sortAscending_ ) sort( items.begin(), items.end(), &OpenGate::lesserSize ); + else sort( items.begin(), items.end(), &OpenGate::greaterSize ); + break; + case Rank: + if ( sortAscending_ ) sort( items.begin(), items.end(), &OpenGate::lesserRank ); + else sort( items.begin(), items.end(), &OpenGate::greaterRank ); + break; + case Amount: + break; + } + + int maxRow = (int)floor( items.size() / marketItemWindowRow_ )+1; + marketOffsetRow_ = min( marketOffsetRow_, maxRow ); + + if ( ( marketOffsetRow_ + 1 ) > ( maxRow - marketItemWindowRow_ ) ){ + CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"MarketItemWindow/DownButton")->hide(); + } else { + CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"MarketItemWindow/DownButton")->show(); + } + + 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; + + if ( itemCount >= items.size() ) { + fillShortItemWindow( marketItems_[ widgetCount ] ); + } else { + fillShortItemWindow( marketItems_[ widgetCount ], items[ itemCount ], 1000, 1 ); } } } } + void MarketDialog::updateInventView(){ - CEGUI::WindowManager::getSingleton().getWindow( "InventoryChipCargoText" ) - ->setProperty( "Text", CEGUI::String( "0000" ) + "/" + toStr( DeviceManager::getSingleton().avatar->vessel().cargoSize() ) ); - CEGUI::WindowManager::getSingleton().getWindow( "InventoryStorageText" ) - ->setProperty( "Text", toStr( DeviceManager::getSingleton().avatar->maxCargoHold() ) ); + CEGUI::WindowManager::getSingleton().getWindow( "InventoryShipCargo/Text" ) + ->setProperty( "Text", CEGUI::String( toStr( DeviceManager::getSingleton().avatar->cargoHold() ) ) ); + CEGUI::WindowManager::getSingleton().getWindow( "InventoryShipCargoMax/Text" ) + ->setProperty( "Text", CEGUI::String( toStr( DeviceManager::getSingleton().avatar->vessel().cargoSize() ) ) ); + CEGUI::WindowManager::getSingleton().getWindow( "InventoryFloorSize/Text" ) + ->setProperty( "Text", toStr( DeviceManager::getSingleton().avatar->cargoHoldMax() ) ); inventOffsetRow_ = max( 0, inventOffsetRow_ ); @@ -227,7 +256,7 @@ std::list< std::deque < Entity * > > * floorCargo = DeviceManager::getSingleton().avatar->floorCargo(); - int maxRow = (int)floor( floorCargo->size() / inventItemWindowCol_ )+1; + int maxRow = (int)floor( floorCargo->size() / inventItemWindowCol_ ) + 1; inventOffsetRow_ = min( inventOffsetRow_, maxRow ); if ( ( inventOffsetRow_ + 1 ) > ( maxRow - inventItemWindowRow_ ) ){ @@ -374,22 +403,19 @@ } } -bool MarketDialog::handleCategorieCommodities( const CEGUI::EventArgs & e ){ - CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"CategorieHighlight")->setPosition( - CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"CategorieCommodities")->getPosition() ); - selectedCategory_ = "Commodities"; - updateMarketView(); - return true; -} +bool MarketDialog::handleCategorieChanged( const CEGUI::EventArgs & e ){ + const CEGUI::WindowEventArgs & we = static_cast< const CEGUI::WindowEventArgs & >( e ); + selectedCategory_ = we.window->getText().c_str(); -bool MarketDialog::handleCategorieCapacitors( const CEGUI::EventArgs & e ){ CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"CategorieHighlight")->setPosition( - CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"CategorieCapacitors")->getPosition() ); - selectedCategory_ = "Capacitors"; + we.window->getPosition() ); + + marketOffsetRow_ = 0; updateMarketView(); return true; } + bool MarketDialog::handleMarketItemMouseEnters( const CEGUI::EventArgs & e ){ const CEGUI::WindowEventArgs & we = static_cast< const CEGUI::WindowEventArgs & >( e ); @@ -480,35 +506,51 @@ void MarketDialog::fillMarketItemDetailedView( CEGUI::Window * itemWindow ){ CEGUI::String amountText( CEGUI::WindowManager::getSingleton().getWindow( itemWindow->getName() + "MarketShortItemAmount" )->getText() ); - if ( buyMode_ ){ - CEGUI::WindowManager::getSingleton().getWindow( "MarketItemDetailedView/Top/Title") - ->setProperty("Text", CEGUI::String( "Would you like to purchase this item?" ) ); - } else { - CEGUI::WindowManager::getSingleton().getWindow( "MarketItemDetailedView/Top/Title") - ->setProperty("Text", CEGUI::String( "Would you like to sell this item?" ) ); - } + Entity * item = ( Entity * )itemWindow->getUserData(); + if ( item ){ - CEGUI::WindowManager::getSingleton().getWindow( "MarketItemDetailedView")->setUserData( itemWindow->getUserData() ); + int amount = 1; + if ( buyMode_ ){ + CEGUI::WindowManager::getSingleton().getWindow( "MarketItemDetailedView/Top/Title") + ->setProperty("Text", CEGUI::String( "Would you like to purchase this item?" ) ); + + amount = min( amount, + ( toInt( CEGUI::WindowManager::getSingleton().getWindow( "InventoryFloorSize/Text" )->getText( ).c_str() ) - + toInt( CEGUI::WindowManager::getSingleton().getWindow( "InventoryShipCargo/Text" )->getText( ).c_str() ) ) + / item->size() ); + if ( amount == 0 ){ + CEGUI::WindowManager::getSingleton().getWindow( "MarketItemDetailedView/AcceptButton" )->hide(); + CEGUI::WindowManager::getSingleton().getWindow( "MarketItemDetailedView/AcceptButton/Highlight" )->hide(); + } else { + CEGUI::WindowManager::getSingleton().getWindow( "MarketItemDetailedView/AcceptButton" )->show(); + CEGUI::WindowManager::getSingleton().getWindow( "MarketItemDetailedView/AcceptButton/Highlight" )->show(); + } - - Entity * item = ( Entity * )itemWindow->getUserData(); - - CEGUI::WindowManager::getSingleton().getWindow( "MarketItemDetailedView/Amount" ) - ->setProperty("Text", CEGUI::String( toStr( 1 ) ) ); - CEGUI::WindowManager::getSingleton().getWindow( "MarketItemDetailedView/Image" ) - ->setProperty("Image", item->ceguiImageName() ); - CEGUI::WindowManager::getSingleton().getWindow( "MarketItemDetailedView/TextFrame/Name/Text" ) - ->setProperty("Text", item->name() ); - CEGUI::WindowManager::getSingleton().getWindow( "MarketItemDetailedView/TextFrame/Size/Text" ) - ->setProperty("Text", CEGUI::String( toStr( item->size() ) ) ); - CEGUI::WindowManager::getSingleton().getWindow( "MarketItemDetailedView/TextFrame/Mass/Text" ) - ->setProperty("Text", CEGUI::String( toStr( item->mass() ) ) ); - CEGUI::WindowManager::getSingleton().getWindow( "MarketItemDetailedView/TextFrame/Amount/Text" ) - ->setProperty("Text", amountText ); - CEGUI::WindowManager::getSingleton().getWindow( "MarketItemDetailedView/TextFrame/Price/Text" ) - ->setProperty("Text", CEGUI::String( "c1" ) ); - CEGUI::WindowManager::getSingleton().getWindow( "MarketItemDetailedView/TextFrame/Rank" ) - ->setProperty("Text", CEGUI::String("Required rank:" + toStr( item->techLevel() ) ) ); + } else { + CEGUI::WindowManager::getSingleton().getWindow( "MarketItemDetailedView/Top/Title") + ->setProperty("Text", CEGUI::String( "Would you like to sell this item?" ) ); + } + + CEGUI::WindowManager::getSingleton().getWindow( "MarketItemDetailedView")->setUserData( itemWindow->getUserData() ); + + + CEGUI::WindowManager::getSingleton().getWindow( "MarketItemDetailedView/Amount" ) + ->setProperty("Text", CEGUI::String( toStr( amount ) ) ); + CEGUI::WindowManager::getSingleton().getWindow( "MarketItemDetailedView/Image" ) + ->setProperty("Image", item->ceguiImageName() ); + CEGUI::WindowManager::getSingleton().getWindow( "MarketItemDetailedView/TextFrame/Name/Text" ) + ->setProperty("Text", item->name() ); + CEGUI::WindowManager::getSingleton().getWindow( "MarketItemDetailedView/TextFrame/Size/Text" ) + ->setProperty("Text", CEGUI::String( toStr( item->size() ) ) ); + CEGUI::WindowManager::getSingleton().getWindow( "MarketItemDetailedView/TextFrame/Mass/Text" ) + ->setProperty("Text", CEGUI::String( toStr( item->mass() ) ) ); + CEGUI::WindowManager::getSingleton().getWindow( "MarketItemDetailedView/TextFrame/Amount/Text" ) + ->setProperty("Text", amountText ); + CEGUI::WindowManager::getSingleton().getWindow( "MarketItemDetailedView/TextFrame/Price/Text" ) + ->setProperty("Text", CEGUI::String( "c1" ) ); + CEGUI::WindowManager::getSingleton().getWindow( "MarketItemDetailedView/TextFrame/Rank" ) + ->setProperty("Text", CEGUI::String("Required rank:" + toStr( item->techLevel() ) ) ); + } } bool MarketDialog::handleMarketItemViewNotNowButton( const CEGUI::EventArgs & e ){ @@ -558,8 +600,9 @@ ->getText( ).c_str() ); if ( buyMode_ ){ - amount = min( amount, (int)floor(toInt( CEGUI::WindowManager::getSingleton().getWindow( "InventoryStorageText" ) - ->getText( ).c_str() ) / size ) ); + amount = min( amount, (int)floor( + ( toInt( CEGUI::WindowManager::getSingleton().getWindow( "InventoryFloorSize/Text" )->getText( ).c_str() ) - + toInt( CEGUI::WindowManager::getSingleton().getWindow( "InventoryShipCargo/Text" )->getText( ).c_str() ) ) / size ) ); } else { amount = min( amount, toInt( CEGUI::WindowManager::getSingleton().getWindow( "MarketItemDetailedView/TextFrame/Amount/Text" )->getText().c_str() ) ); } @@ -567,6 +610,13 @@ CEGUI::WindowManager::getSingleton().getWindow( "MarketItemDetailedView/Amount" ) ->setProperty("Text", CEGUI::String( toStr( (int)amount ) ) ); + if ( amount > 0 ){ + CEGUI::WindowManager::getSingleton().getWindow( "MarketItemDetailedView/AcceptButton/Highlight" )->show(); + CEGUI::WindowManager::getSingleton().getWindow( "MarketItemDetailedView/AcceptButton" )->show(); + } else { + CEGUI::WindowManager::getSingleton().getWindow( "MarketItemDetailedView/AcceptButton" )->hide(); + CEGUI::WindowManager::getSingleton().getWindow( "MarketItemDetailedView/AcceptButton/Highlight" )->hide(); + } } bool MarketDialog::buyItems( Entity * item , int amount ){ Modified: branches/ogsector/src/MarketDialog.h =================================================================== --- branches/ogsector/src/MarketDialog.h 2007-06-02 02:36:57 UTC (rev 520) +++ branches/ogsector/src/MarketDialog.h 2007-06-02 16:14:07 UTC (rev 521) @@ -57,8 +57,7 @@ void fillShortItemWindow( CEGUI::Window * win, Entity * item = NULL, int amount = 0, int price = 0 ); void fillMarketItemDetailedView( CEGUI::Window * itemWindow ); - bool handleCategorieCommodities( const CEGUI::EventArgs & e ); - bool handleCategorieCapacitors( const CEGUI::EventArgs & e ); + bool handleCategorieChanged( const CEGUI::EventArgs & e ); bool handleMarketItemSortAlphaAscend( const CEGUI::EventArgs & e ){ sortBy_ = Alphanumeric; updateSortIcons(); return true; } bool handleMarketItemSortAlphaDescend( const CEGUI::EventArgs & e ){ sortBy_ = Alphanumeric; updateSortIcons(); return true; } Modified: branches/ogsector/src/VesselManager.cpp =================================================================== --- branches/ogsector/src/VesselManager.cpp 2007-06-02 02:36:57 UTC (rev 520) +++ branches/ogsector/src/VesselManager.cpp 2007-06-02 16:14:07 UTC (rev 521) @@ -45,7 +45,7 @@ TiXmlHandle docHandle( &doc ); TiXmlElement* pElem; - TiXmlNode* pNode; +// TiXmlNode* pNode; TiXmlHandle hRoot( 0 ); //** block: Ship; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |