You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(27) |
Nov
(5) |
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(7) |
Feb
(20) |
Mar
(25) |
Apr
(8) |
May
(15) |
Jun
(4) |
Jul
(12) |
Aug
(5) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
2011 |
Jan
(10) |
Feb
|
Mar
(7) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <c_...@us...> - 2008-11-23 21:35:15
|
Revision: 125 http://oge.svn.sourceforge.net/oge/?rev=125&view=rev Author: c_j Date: 2008-11-23 21:31:27 +0000 (Sun, 23 Nov 2008) Log Message: ----------- 2008/11/23 - SVN TRUNK v0.3.88 Utilities - Removed ogeInitMemoryCheck() function calls from other plugins - Updated CMakeLists.txt - Few fixes - Updated VC9 project settings Modified Paths: -------------- oge/trunk/plugins/dummysublib/src/OgeDummyPluginSublib.cpp oge/trunk/plugins/guimygui/build/cmake/CMakeLists.txt oge/trunk/plugins/guimygui/src/OgeGuiPluginMyGUI.cpp oge/trunk/plugins/scriptlua/src/OgeScriptPluginLua.cpp oge/trunk/utilities/build/cmake/CMakeLists.txt oge/trunk/utilities/build/vc90/Utilities.vcproj oge/trunk/utilities/include/oge/OgeUtilitiesPrerequisites.h oge/trunk/utilities/include/oge/memory/OgeAllocatedObject.h This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <c_...@us...> - 2008-11-23 20:01:26
|
Revision: 124 http://oge.svn.sourceforge.net/oge/?rev=124&view=rev Author: c_j Date: 2008-11-23 20:01:22 +0000 (Sun, 23 Nov 2008) Log Message: ----------- 2008/11/23 - SVN TRUNK v0.3.87 Samples - Commented out ogeInitMemoryCheck() Modified Paths: -------------- samples/trunk/samples/CoreSample/main.cpp samples/trunk/samples/FirstEntity/main.cpp samples/trunk/samples/FpsSinglePlayer/Main.cpp samples/trunk/samples/HelloWorld/main.cpp samples/trunk/samples/ObjectSerialisation/main.cpp This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <c_...@us...> - 2008-11-23 19:59:49
|
Revision: 123 http://oge.svn.sourceforge.net/oge/?rev=123&view=rev Author: c_j Date: 2008-11-23 19:59:44 +0000 (Sun, 23 Nov 2008) Log Message: ----------- 2008/11/23 - SVN TRUNK v0.3.87 Utilities - Added OgeUtiltiesConfig which contains various settings for how the utilities library should be built, such as memory management - Added MemoryTracker which tracks memory allocations and reports memory leaks - Added AllocatedObject which is a template class that takes an Allocator. - It overrides new/new[]/delete/delete[] as well as providing versions that accept file, function and line number - Calls are passed to the Allocator - Added two types of Allocator, StandardAllocator and TBBAllocator - StandardAllocator uses malloc/free for allocations - TBBAllocator uses Intel TBB's scalable_malloc and scalable_free - Both allocators add/remove allocations to/from the MemoryTracker if memory tracking is enabled - Disabled on the old memory manager code - Commented out ogeInitMemoryCheck() calls from the log manager and core's engine manager - Removed AsyncFunction and the template implementations - Renamed OgeAsyncFunction.h to OgeAsyncValue.h - Added OgeTask.h containing a base class Task. - A task is something to be done that is executed by the tasks run() function - Added OgeDelegateTask.h - Template implementations of Task that call functions with given data when their run function is called - This offers the same functionality as AsyncFunction0,1,2 did - Added OgeTaskHandler.h (Not complete, WIP) - TaskHandler handles adding tasks to an internal queue and allows all task to be run, a number of tasks to be run, or to clear the queue - PriorityTaskHandler allows adding tasks to different priority level queues and allows running all tasks, a certain priority, a number of tasks or clearing them - These can, once complete, be used to make handling tasks easier and reduce the amount of code that needs to be written - Updated all code that used AsyncFunction's to use DelegateTask instead - Prerequisites - Added Visual studio 2008 SP1 version - Added full compiler version OGE_COMP_VER_FULL which uses _MSC_FULL_VER if available, for all other compilers, this is the same value as OGE_COMP_VER - Added OGE_DEBUG_MODE/OGE_RELEASE_MODE macros - Added OGE_MODE which is set to the above macros depending on how its built, this can be used to cleanly test if compiling in debug or release - Added test for Visual Studio 2008 SP1 in CPUDetect. Now __cpuidex will only be used if 2008 SP1 or higher is used, else uses one of the lesser methods Core - Added OgeCoreConfig.h which will contain various settings for how the core library should be built - Updated code using AsyncFunction's to DelegateTask Modified Paths: -------------- oge/trunk/core/build/vc90/Core.vcproj oge/trunk/core/include/oge/OgeCorePrerequisites.h oge/trunk/core/include/oge/engine/OgeEngineManager.h oge/trunk/core/include/oge/graphics/OgeGraphicsSceneManager.h oge/trunk/core/include/oge/system/OgeSystem.h oge/trunk/core/include/oge/system/OgeSystemGroup.h oge/trunk/core/include/oge/system/OgeSystemManager.h oge/trunk/core/src/engine/OgeEngineManager.cpp oge/trunk/core/src/engine/OgeEngineTimingHandler.cpp oge/trunk/core/src/system/OgeSystemGroup.cpp oge/trunk/core/src/system/OgeSystemGroupFast.cpp oge/trunk/plugins/audioopenal/src/OgeAudioPluginOpenAL.cpp oge/trunk/plugins/graphicsogre/include/oge/graphics/OgeGraphicsSceneManagerOGRE.h oge/trunk/plugins/graphicsogre/src/OgeGraphicsPlugin.cpp oge/trunk/plugins/graphicsogre/src/OgeGraphicsSceneManagerOGRE.cpp oge/trunk/plugins/inputois/src/OgeInputPlugin.cpp oge/trunk/utilities/build/vc90/Utilities.vcproj oge/trunk/utilities/include/oge/OgeMemoryManager.h oge/trunk/utilities/include/oge/OgeNonCopyable.h oge/trunk/utilities/include/oge/OgeUtilitiesPrerequisites.h oge/trunk/utilities/include/oge/containers/OgeQueue.h oge/trunk/utilities/include/oge/thread/OgeTaskThread.h oge/trunk/utilities/src/hardware/OgeCPUDetect.cpp oge/trunk/utilities/src/logging/OgeLogManager.cpp oge/trunk/utilities/src/thread/OgeTaskThread.cpp Added Paths: ----------- oge/trunk/core/include/oge/OgeCoreConfig.h oge/trunk/utilities/include/oge/OgeAsyncValue.h oge/trunk/utilities/include/oge/OgeUtilitiesConfig.h oge/trunk/utilities/include/oge/memory/ oge/trunk/utilities/include/oge/memory/OgeAllocatedObject.h oge/trunk/utilities/include/oge/memory/OgeMemoryTracker.h oge/trunk/utilities/include/oge/memory/OgeStandardAllocator.h oge/trunk/utilities/include/oge/memory/OgeTBBAllocator.h oge/trunk/utilities/include/oge/task/ oge/trunk/utilities/include/oge/task/OgeDelegateTask.h oge/trunk/utilities/include/oge/task/OgeTask.h oge/trunk/utilities/include/oge/task/OgeTaskHandler.h oge/trunk/utilities/src/memory/ oge/trunk/utilities/src/memory/OgeMemoryTracker.cpp oge/trunk/utilities/src/memory/OgeStandardAllocator.cpp oge/trunk/utilities/src/memory/OgeTBBAllocator.cpp oge/trunk/utilities/src/task/ oge/trunk/utilities/src/task/OgeTaskHandler.cpp Removed Paths: ------------- oge/trunk/utilities/include/oge/OgeAsyncFunction.h This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <laz...@us...> - 2008-11-12 07:22:45
|
Revision: 122 http://oge.svn.sourceforge.net/oge/?rev=122&view=rev Author: lazaruslong Date: 2008-11-12 07:22:41 +0000 (Wed, 12 Nov 2008) Log Message: ----------- 2008/11/12 - SVN TRUNK v0.3.86 (rev 122) - Updated the FpsSinglePlayer sample to use the Object/Component Message system. Revision Links: -------------- http://oge.svn.sourceforge.net/oge/?rev=122&view=rev Modified Paths: -------------- samples/trunk/samples/FpsSinglePlayer/InGameGameState.cpp samples/trunk/samples/FpsSinglePlayer/InGameIEH.cpp samples/trunk/samples/FpsSinglePlayer/Readme.txt samples/trunk/samples/FpsSinglePlayer/RobotStateComponent.cpp samples/trunk/samples/Jukebox/oge.xml This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <laz...@us...> - 2008-11-12 07:20:13
|
Revision: 121 http://oge.svn.sourceforge.net/oge/?rev=121&view=rev Author: lazaruslong Date: 2008-11-12 07:20:08 +0000 (Wed, 12 Nov 2008) Log Message: ----------- 2008/11/12 - SVN TRUNK v0.3.86 (rev 121) - Added Object/Component messaging system. Note that this is WIP - Added Math::round(Real value) & Math::round(Real value, unsigned int digits) - Added Some missing methods such as GraphicsComponentOGRE::getDimension() & getOrientation() -------- NOTE ------------------ An important note is that -for now- the messages can only be send directly to the objects. We must probably add a new parameter: ObjectId Message::mReceiverId to identify the receiver object. 1 - During coding: In the components you need to define the type of messages that can be processed by the component appendMessageDelegates(MessageDelegatesMap) Btw don't confuse the MessageDelegatesMap and MessageDelegateMap Note the extra 's' at Delegate. - The messages types are stored in the enum Object::ObjectMessage NOT in Message::Type! The reason for this is that Message is an utilities class which has no knowledge of the Core classes. Hence it is not logical to add message types at this level. We should probably add a registerMessageType() in the Message class along with a thread-safe: getNextTypeId() { return (MessageType) mTypeId++ } 2 - At Run time: - The components delegates are registered at the object creation in Object::addComponent(Component*) - Messages are send to objects via addMessage(Message&) - and processed in Object::update() via processMessage(Message) Note that all the messages in the objects are processed. There is no priority, timeout or timestamp. - Object::ProcessMessage() will send the message to all the components that registered a method for the message type Revision Links: -------------- http://oge.svn.sourceforge.net/oge/?rev=121&view=rev Modified Paths: -------------- oge/trunk/INSTALL.txt oge/trunk/core/include/oge/graphics/OgeCameraComponent.h oge/trunk/core/include/oge/graphics/OgeGraphicsComponent.h oge/trunk/core/include/oge/object/OgeComponent.h oge/trunk/core/include/oge/object/OgeLocationComponent.h oge/trunk/core/include/oge/object/OgeObject.h oge/trunk/core/include/oge/script/OgeStateComponent.h oge/trunk/core/src/graphics/OgeCameraComponent.cpp oge/trunk/core/src/graphics/OgeGraphicsComponent.cpp oge/trunk/core/src/object/OgeLocationComponent.cpp oge/trunk/core/src/object/OgeObject.cpp oge/trunk/core/src/script/OgeStateComponent.cpp oge/trunk/plugins/graphicsogre/include/oge/graphics/OgeAnimationComponentOGRE.h oge/trunk/plugins/graphicsogre/include/oge/graphics/OgeGraphicsComponentOGRE.h oge/trunk/plugins/graphicsogre/src/OgeAnimationComponentOGRE.cpp oge/trunk/plugins/graphicsogre/src/OgeGraphicsComponentOGRE.cpp oge/trunk/utilities/include/oge/OgeMessage.h oge/trunk/utilities/include/oge/math/OgeMath.h oge/trunk/utilities/src/OgeMessage.cpp oge/trunk/utilities/src/math/OgeMath.cpp This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <laz...@us...> - 2008-10-30 00:42:30
|
Revision: 120 http://oge.svn.sourceforge.net/oge/?rev=120&view=rev Author: lazaruslong Date: 2008-10-30 00:42:25 +0000 (Thu, 30 Oct 2008) Log Message: ----------- 2008/10/24 - SVN TRUNK v0.3.85 (rev 120) - Added build/cmake/modules/FindMyGUI.cmake - Updated .cmake files use .pc files Revision Links: -------------- http://oge.svn.sourceforge.net/oge/?rev=120&view=rev Modified Paths: -------------- oge/trunk/INSTALL.txt oge/trunk/build/cmake/modules/FindBullet.cmake oge/trunk/build/cmake/modules/FindLua.cmake oge/trunk/build/cmake/modules/FindOGG.cmake oge/trunk/build/cmake/modules/FindOGRE.cmake oge/trunk/build/cmake/modules/FindOIS.cmake oge/trunk/build/cmake/modules/FindOpenAL.cmake oge/trunk/build/cmake/modules/FindVorbis.cmake oge/trunk/plugins/graphicsogre/include/oge/graphics/OgeTextRendererOGRE.h oge/trunk/plugins/guimygui/build/cmake/CMakeLists.txt Added Paths: ----------- oge/trunk/build/cmake/modules/FindMyGUI.cmake This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <laz...@us...> - 2008-10-29 04:37:21
|
Revision: 119 http://oge.svn.sourceforge.net/oge/?rev=119&view=rev Author: lazaruslong Date: 2008-10-29 04:37:16 +0000 (Wed, 29 Oct 2008) Log Message: ----------- 2008/10/24 - SVN TRUNK v0.3.85 (rev 119) - Updated A bit nicer message text box for the robot creation. Revision Links: -------------- http://oge.svn.sourceforge.net/oge/?rev=119&view=rev Modified Paths: -------------- samples/trunk/samples/FpsSinglePlayer/InGameGameState.cpp samples/trunk/samples/FpsSinglePlayer/InGameIEH.cpp This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <laz...@us...> - 2008-10-29 04:27:46
|
Revision: 118 http://oge.svn.sourceforge.net/oge/?rev=118&view=rev Author: lazaruslong Date: 2008-10-29 04:27:40 +0000 (Wed, 29 Oct 2008) Log Message: ----------- 2008/10/24 - SVN TRUNK v0.3.85 (rev 118) - Fixed MT bug in the fps sample. The TextRenderer::addTextBox() & removeTextBox() are not yet thread safe. Revision Links: -------------- http://oge.svn.sourceforge.net/oge/?rev=118&view=rev Modified Paths: -------------- samples/trunk/samples/FpsSinglePlayer/InGameIEH.cpp This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <laz...@us...> - 2008-10-28 09:40:46
|
Revision: 117 http://oge.svn.sourceforge.net/oge/?rev=117&view=rev Author: lazaruslong Date: 2008-10-28 09:38:05 +0000 (Tue, 28 Oct 2008) Log Message: ----------- 2008/10/24 - SVN TRUNK v0.3.84 (rev 117) - Fixed Added the network manager in the CMakeLists.txt - Fixed The ordering value of the Gui Manager was wrong. It must be 20 instead of 10 to be initialised AFTER the graphics manager - Update correct some typos and code ordering Revision Links: -------------- http://oge.svn.sourceforge.net/oge/?rev=117&view=rev Modified Paths: -------------- oge/trunk/core/build/cmake/CMakeLists.txt oge/trunk/core/include/oge/gui/OgeGuiManager.h oge/trunk/core/src/system/OgeSystemManager.cpp oge/trunk/plugins/guimygui/src/OgeGuiManagerMyGUI.cpp This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <laz...@us...> - 2008-10-26 23:57:21
|
Revision: 116 http://oge.svn.sourceforge.net/oge/?rev=116&view=rev Author: lazaruslong Date: 2008-10-26 23:57:17 +0000 (Sun, 26 Oct 2008) Log Message: ----------- 2008/10/24 - SVN TRUNK v0.3.84 (rev 116) - Fixed typo in the CMakeLists.txt of the scriptlua plugin - Updated added some logging to better follow what happens when a System, SystemGroup or TaskThread fails to setup correctly - Added base of the NetworkManager interface Revision Links: -------------- http://oge.svn.sourceforge.net/oge/?rev=116&view=rev Modified Paths: -------------- oge/trunk/build/vc80/Oge.sln oge/trunk/core/build/vc80/Core.vcproj oge/trunk/core/include/oge/engine/OgeEngineManager.h oge/trunk/core/src/system/OgeSystemGroup.cpp oge/trunk/core/src/system/OgeSystemManager.cpp oge/trunk/plugins/graphicsogre/src/OgeGraphicsManagerOGRE.cpp oge/trunk/plugins/scriptlua/build/cmake/CMakeLists.txt oge/trunk/utilities/src/thread/OgeTaskThread.cpp Added Paths: ----------- oge/trunk/core/include/oge/network/ oge/trunk/core/include/oge/network/OgeNetworkManager.h oge/trunk/core/src/network/ oge/trunk/core/src/network/OgeNetworkManager.cpp This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <laz...@us...> - 2008-10-24 09:39:42
|
Revision: 115 http://oge.svn.sourceforge.net/oge/?rev=115&view=rev Author: lazaruslong Date: 2008-10-24 09:35:21 +0000 (Fri, 24 Oct 2008) Log Message: ----------- 2008/10/24 - SVN TRUNK v0.3.83 (rev 115) Preliminary work on the physics plugin - Added FindBullet.cmake - Added FindLua.cmake - Added OgePhysicsManager.cpp & .h - Modified OgeScriptManagerLua.h where the include path was modified from "lua/lua.h" to "lua.h" to conform to the path that is expected by lua. - Modified Removed from some .cmake files unnecessary settings. Revision Links: -------------- http://oge.svn.sourceforge.net/oge/?rev=115&view=rev Modified Paths: -------------- oge/trunk/build/cmake/modules/FindOGG.cmake oge/trunk/build/cmake/modules/FindOGRE.cmake oge/trunk/build/cmake/modules/FindOIS.cmake oge/trunk/build/cmake/modules/FindOpenAL.cmake oge/trunk/build/cmake/modules/FindVorbis.cmake oge/trunk/build/vc80/Oge.sln oge/trunk/core/build/cmake/CMakeLists.txt oge/trunk/core/build/vc80/Core.vcproj oge/trunk/plugins/scriptlua/build/cmake/CMakeLists.txt oge/trunk/plugins/scriptlua/build/vc80/ScriptLua.vcproj oge/trunk/plugins/scriptlua/include/oge/script/OgeScriptManagerLua.h Added Paths: ----------- oge/trunk/build/cmake/modules/FindBullet.cmake oge/trunk/build/cmake/modules/FindLua.cmake oge/trunk/core/include/oge/physics/ oge/trunk/core/include/oge/physics/OgePhysicsManager.h oge/trunk/core/src/physics/ oge/trunk/core/src/physics/OgePhysicsManager.cpp Added: oge/trunk/build/cmake/modules/FindBullet.cmake =================================================================== --- oge/trunk/build/cmake/modules/FindBullet.cmake (rev 0) +++ oge/trunk/build/cmake/modules/FindBullet.cmake 2008-10-24 09:35:21 UTC (rev 115) @@ -0,0 +1,33 @@ +MESSAGE("Looking for Bullet") + +IF (Bullet_INCLUDE_DIR AND Bullet_LIBRARY) + SET(Bullet_FIND_QUIETLY TRUE) +ENDIF (Bullet_INCLUDE_DIR AND Bullet_LIBRARY) + +FIND_PACKAGE(PkgConfig) +PKG_SEARCH_MODULE(Bullet bullet) +SET(Bullet_INCLUDE_DIR ${Bullet_INCLUDE_DIRS}) +SET(Bullet_LIB_DIR ${Bullet_LIBDIR}) +SET(Bullet_LIBRARIES ${Bullet_LIBRARIES} CACHE STRING "") + +SEPARATE_ARGUMENTS(Bullet_INCLUDE_DIR) +SEPARATE_ARGUMENTS(Bullet_LIBRARIES) + +SET(Bullet_INCLUDE_DIR ${Bullet_INCLUDE_DIR} CACHE PATH "") +SET(Bullet_LIBRARIES ${Bullet_LIBRARIES} CACHE STRING "") +SET(Bullet_LIB_DIR ${Bullet_LIB_DIR} CACHE PATH "") + +IF (Bullet_INCLUDE_DIR AND Bullet_LIBRARIES) + SET(Bullet_FOUND TRUE) +ENDIF (Bullet_INCLUDE_DIR AND Bullet_LIBRARIES) + +IF (Bullet_FOUND) + IF (NOT Bullet_FIND_QUIETLY) + MESSAGE(STATUS " libraries : ${Bullet_LIBRARIES} from ${Bullet_LIB_DIR}") + MESSAGE(STATUS " includes : ${Bullet_INCLUDE_DIR}") + ENDIF (NOT Bullet_FIND_QUIETLY) +ELSE (Bullet_FOUND) + IF (Bullet_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find Bullet") + ENDIF (Bullet_FIND_REQUIRED) +ENDIF (Bullet_FOUND) Added: oge/trunk/build/cmake/modules/FindLua.cmake =================================================================== --- oge/trunk/build/cmake/modules/FindLua.cmake (rev 0) +++ oge/trunk/build/cmake/modules/FindLua.cmake 2008-10-24 09:35:21 UTC (rev 115) @@ -0,0 +1,33 @@ +MESSAGE("Looking for LUA") + +IF (LUA_LIBRARIES AND LUA_INCLUDE_DIR) + SET(LUA_FIND_QUIETLY TRUE) +ENDIF (LUA_LIBRARIES AND LUA_INCLUDE_DIR) + +FIND_PACKAGE(PkgConfig) +PKG_SEARCH_MODULE(LUA lua lua51 lua5.1) +SET(LUA_INCLUDE_DIR ${LUA_INCLUDE_DIRS}) +SET(LUA_LIB_DIR ${LUA_LIBDIR}) +SET(LUA_LIBRARIES ${LUA_LIBRARIES} CACHE STRING "") + +SEPARATE_ARGUMENTS(LUA_INCLUDE_DIR) +SEPARATE_ARGUMENTS(LUA_LIBRARIES) + +SET(LUA_INCLUDE_DIR ${LUA_INCLUDE_DIR} CACHE PATH "") +SET(LUA_LIBRARIES ${LUA_LIBRARIES} CACHE STRING "") +SET(LUA_LIB_DIR ${LUA_LIB_DIR} CACHE PATH "") + +IF (LUA_INCLUDE_DIR AND LUA_LIBRARIES) + SET(LUA_FOUND TRUE) +ENDIF (LUA_INCLUDE_DIR AND LUA_LIBRARIES) + +IF (LUA_FOUND) + IF (NOT LUA_FIND_QUIETLY) + MESSAGE(STATUS " libraries : ${LUA_LIBRARIES} from ${LUA_LIB_DIR}") + MESSAGE(STATUS " includes : ${LUA_INCLUDE_DIR}") + ENDIF (NOT LUA_FIND_QUIETLY) +ELSE (LUA_FOUND) + IF (LUA_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find LUA") + ENDIF (LUA_FIND_REQUIRED) +ENDIF (LUA_FOUND) Modified: oge/trunk/build/cmake/modules/FindOGG.cmake =================================================================== --- oge/trunk/build/cmake/modules/FindOGG.cmake 2008-10-22 11:47:31 UTC (rev 114) +++ oge/trunk/build/cmake/modules/FindOGG.cmake 2008-10-24 09:35:21 UTC (rev 115) @@ -5,7 +5,7 @@ ENDIF (OGG_INCLUDE_DIR AND OGG_LIBRARY) FIND_PACKAGE(PkgConfig) -PKG_SEARCH_MODULE(OGG OGG /usr/lib/pkgconfig/ogg.pc) +PKG_SEARCH_MODULE(OGG OGG ogg) SET(OGG_INCLUDE_DIR ${OGG_INCLUDE_DIRS}) SET(OGG_LIB_DIR ${OGG_LIBDIR}) SET(OGG_LIBRARIES ${OGG_LIBRARIES} CACHE STRING "") Modified: oge/trunk/build/cmake/modules/FindOGRE.cmake =================================================================== --- oge/trunk/build/cmake/modules/FindOGRE.cmake 2008-10-22 11:47:31 UTC (rev 114) +++ oge/trunk/build/cmake/modules/FindOGRE.cmake 2008-10-24 09:35:21 UTC (rev 115) @@ -5,7 +5,7 @@ ENDIF (OGRE_LIBRARIES AND OGRE_INCLUDE_DIR) FIND_PACKAGE(PkgConfig) -PKG_SEARCH_MODULE(OGRE OGRE /usr/lib/pkgconfig/OGRE.pc) +PKG_SEARCH_MODULE(OGRE OGRE) SET(OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIRS}) SET(OGRE_LIB_DIR ${OGRE_LIBDIR}) SET(OGRE_LIBRARIES ${OGRE_LIBRARIES} CACHE STRING "") Modified: oge/trunk/build/cmake/modules/FindOIS.cmake =================================================================== --- oge/trunk/build/cmake/modules/FindOIS.cmake 2008-10-22 11:47:31 UTC (rev 114) +++ oge/trunk/build/cmake/modules/FindOIS.cmake 2008-10-24 09:35:21 UTC (rev 115) @@ -5,7 +5,7 @@ ENDIF (OIS_LIBRARIES AND OIS_INCLUDE_DIR) FIND_PACKAGE(PkgConfig) -PKG_SEARCH_MODULE(OIS OIS /usr/lib/pkgconfig/OIS.pc) +PKG_SEARCH_MODULE(OIS OIS) SET(OIS_INCLUDE_DIR ${OIS_INCLUDE_DIRS}) SET(OIS_LIB_DIR ${OIS_LIBDIR}) SET(OIS_LIBRARIES ${OIS_LIBRARIES} CACHE STRING "") Modified: oge/trunk/build/cmake/modules/FindOpenAL.cmake =================================================================== --- oge/trunk/build/cmake/modules/FindOpenAL.cmake 2008-10-22 11:47:31 UTC (rev 114) +++ oge/trunk/build/cmake/modules/FindOpenAL.cmake 2008-10-24 09:35:21 UTC (rev 115) @@ -5,7 +5,7 @@ ENDIF (OpenAL_LIBRARIES AND OpenAL_INCLUDE_DIR) FIND_PACKAGE(PkgConfig) -PKG_SEARCH_MODULE(OpenAL OpenAL /usr/lib/pkgconfig/openal.pc) +PKG_SEARCH_MODULE(OpenAL OpenAL) SET(OpenAL_INCLUDE_DIR ${OpenAL_INCLUDE_DIRS}) SET(OpenAL_LIB_DIR ${OpenAL_LIBDIR}) SET(OpenAL_LIBRARIES ${OpenAL_LIBRARIES} CACHE STRING "") Modified: oge/trunk/build/cmake/modules/FindVorbis.cmake =================================================================== --- oge/trunk/build/cmake/modules/FindVorbis.cmake 2008-10-22 11:47:31 UTC (rev 114) +++ oge/trunk/build/cmake/modules/FindVorbis.cmake 2008-10-24 09:35:21 UTC (rev 115) @@ -5,7 +5,7 @@ ENDIF (Vorbis_LIBRARIES AND Vorbis_INCLUDE_DIR) FIND_PACKAGE(PkgConfig) -PKG_SEARCH_MODULE(Vorbis Vorbis /usr/lib/pkgconfig/vorbis.pc) +PKG_SEARCH_MODULE(Vorbis Vorbis) SET(Vorbis_INCLUDE_DIR ${Vorbis_INCLUDE_DIRS}) SET(Vorbis_LIB_DIR ${Vorbis_LIBDIR}) SET(Vorbis_LIBRARIES ${Vorbis_LIBRARIES} CACHE STRING "") Modified: oge/trunk/build/vc80/Oge.sln =================================================================== --- oge/trunk/build/vc80/Oge.sln 2008-10-22 11:47:31 UTC (rev 114) +++ oge/trunk/build/vc80/Oge.sln 2008-10-24 09:35:21 UTC (rev 115) @@ -76,6 +76,8 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin Script Lua", "..\..\plugins\scriptlua\build\vc80\ScriptLua.vcproj", "{11D5EC72-AF94-518E-B58B-6984D3FFB4A4}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin Physics Bullet", "..\..\plugins\physicsbullet\build\vc80\PhysicsBullet.vcproj", "{A2D5ECB5-AF94-618E-B58B-7284E3F4B0A8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -134,6 +136,10 @@ {11D5EC72-AF94-518E-B58B-6984D3FFB4A4}.Debug|Win32.Build.0 = Debug|Win32 {11D5EC72-AF94-518E-B58B-6984D3FFB4A4}.Release|Win32.ActiveCfg = Release|Win32 {11D5EC72-AF94-518E-B58B-6984D3FFB4A4}.Release|Win32.Build.0 = Release|Win32 + {A2D5ECB5-AF94-618E-B58B-7284E3F4B0A8}.Debug|Win32.ActiveCfg = Debug|Win32 + {A2D5ECB5-AF94-618E-B58B-7284E3F4B0A8}.Debug|Win32.Build.0 = Debug|Win32 + {A2D5ECB5-AF94-618E-B58B-7284E3F4B0A8}.Release|Win32.ActiveCfg = Release|Win32 + {A2D5ECB5-AF94-618E-B58B-7284E3F4B0A8}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Modified: oge/trunk/core/build/cmake/CMakeLists.txt =================================================================== --- oge/trunk/core/build/cmake/CMakeLists.txt 2008-10-22 11:47:31 UTC (rev 114) +++ oge/trunk/core/build/cmake/CMakeLists.txt 2008-10-24 09:35:21 UTC (rev 115) @@ -34,6 +34,7 @@ ${Current_dir}/object/OgeObject.cpp ${Current_dir}/object/OgeObjectManager.cpp ${Current_dir}/object/OgeObjectSceneManager.cpp +${Current_dir}/physics/OgePhysicsManager.cpp ${Current_dir}/scene/OgeSceneManagerEnumerator.cpp ${Current_dir}/script/OgeScriptManager.cpp ${Current_dir}/script/OgeState.cpp Modified: oge/trunk/core/build/vc80/Core.vcproj =================================================================== --- oge/trunk/core/build/vc80/Core.vcproj 2008-10-22 11:47:31 UTC (rev 114) +++ oge/trunk/core/build/vc80/Core.vcproj 2008-10-24 09:35:21 UTC (rev 115) @@ -477,6 +477,18 @@ > </File> </Filter> + <Filter + Name="Physics" + > + <File + RelativePath="..\..\src\physics\OgePhysicsManager.cpp" + > + </File> + <File + RelativePath="..\..\include\oge\Physics\OgePhysicsManager.h" + > + </File> + </Filter> </Filter> </Files> <Globals> Added: oge/trunk/core/include/oge/physics/OgePhysicsManager.h =================================================================== --- oge/trunk/core/include/oge/physics/OgePhysicsManager.h (rev 0) +++ oge/trunk/core/include/oge/physics/OgePhysicsManager.h 2008-10-24 09:35:21 UTC (rev 115) @@ -0,0 +1,78 @@ +/* +----------------------------------------------------------------------------- +This source file is part of OGE (Open Game Engine) +For the latest info, see http://sourceforge.net/projects/oge + +Copyright (c) 2006-2008 The OGE Team +Also see acknowledgements in Readme.html + +This program is distributed under a dual-licensing scheme: + +1. The first license, which is the default one, state that this software + is free software; you can redistribute it and/or modify it under the terms + of the GNU Lesser General Public License (LGPL) as published by the + Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + +2. The second license, which is not free, apply only for licensee who got + a written agreement from the 'OGE Team'. The exact wording of this + license can be obtained from the 'OGE Team'. In essence this + OGE Unrestricted License state that the GNU Lesser General Public License + applies except that the software is distributed with no limitation or + requirements to publish or give back to the OGE Team changes made + to the OGE source code. + +By default, the first type of license applies (the GNU LGPL), the OGE +Unrestricted License apply only for those who got a written agreement +from the OGE Team. + +Under both licenses, 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 Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser 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, or go to +http://www.gnu.org/copyleft/lesser.txt. +For the OGE Unrestricted License contact the OGE Team. +----------------------------------------------------------------------------- +*/ +#ifndef __OGE_PHYSICSMANAGER_H__ +#define __OGE_PHYSICSMANAGER_H__ + +#include "oge/OgeCorePrerequisites.h" +#include "oge/system/OgeSystem.h" +#include "oge/OgeString.h" +#include "oge/input/OgeInputEvent.h" + +namespace oge +{ + class OGE_CORE_API PhysicsManager : public System + { + private: + static PhysicsManager* mManager; + + protected: + // ---------- Script specific --------------------- + + public: + PhysicsManager(const String& name, int systemOrdering = 10); + virtual ~PhysicsManager(); + + /// @see System::tick() + virtual void tick(double currentTime) {} + + /** + * Returns the manager + * @note The manager is a singleton so this method is equivalent + * to getSingletonPtr() however the instantiation i.e. PhysicsManagerBullet + * is also a singleton hence getManager() is to avoid name conflict. + * @see getSingletonPtr() which returns the actual implementation + */ + static PhysicsManager* getManager() { return mManager; } + + }; +} + +#endif // __OGE_PHYSICSMANAGER_H__ Property changes on: oge/trunk/core/include/oge/physics/OgePhysicsManager.h ___________________________________________________________________ Added: svn:eol-style + native Added: oge/trunk/core/src/physics/OgePhysicsManager.cpp =================================================================== --- oge/trunk/core/src/physics/OgePhysicsManager.cpp (rev 0) +++ oge/trunk/core/src/physics/OgePhysicsManager.cpp 2008-10-24 09:35:21 UTC (rev 115) @@ -0,0 +1,61 @@ +/* +----------------------------------------------------------------------------- +This source file is part of OGE (Open Game Engine) +For the latest info, see http://sourceforge.net/projects/oge + +Copyright (c) 2006-2008 The OGE Team +Also see acknowledgements in Readme.html + +This program is distributed under a dual-licensing scheme: + +1. The first license, which is the default one, state that this software + is free software; you can redistribute it and/or modify it under the terms + of the GNU Lesser General Public License (LGPL) as published by the + Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + +2. The second license, which is not free, apply only for licensee who got + a written agreement from the 'OGE Team'. The exact wording of this + license can be obtained from the 'OGE Team'. In essence this + OGE Unrestricted License state that the GNU Lesser General Public License + applies except that the software is distributed with no limitation or + requirements to publish or give back to the OGE Team changes made + to the OGE source code. + +By default, the first type of license applies (the GNU LGPL), the OGE +Unrestricted License apply only for those who got a written agreement +from the OGE Team. + +Under both licenses, 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 Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser 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, or go to +http://www.gnu.org/copyleft/lesser.txt. +For the OGE Unrestricted License contact the OGE Team. +----------------------------------------------------------------------------- +*/ +#include "oge/physics/OgePhysicsManager.h" +#include "oge/logging/OgeLogManager.h" + +namespace oge +{ + //------------------------------------------------------------------------- + PhysicsManager* PhysicsManager::mManager = 0; + //------------------------------------------------------------------------- + PhysicsManager::PhysicsManager(const String& name, int systemOrdering) : + System(name, systemOrdering) + { + mManager = this; + LOG("Created " + name); + } + //------------------------------------------------------------------------- + PhysicsManager::~PhysicsManager() + { + LOG("Destroyed "); + } + //------------------------------------------------------------------------- +} Property changes on: oge/trunk/core/src/physics/OgePhysicsManager.cpp ___________________________________________________________________ Added: svn:eol-style + native Modified: oge/trunk/plugins/scriptlua/build/cmake/CMakeLists.txt =================================================================== --- oge/trunk/plugins/scriptlua/build/cmake/CMakeLists.txt 2008-10-22 11:47:31 UTC (rev 114) +++ oge/trunk/plugins/scriptlua/build/cmake/CMakeLists.txt 2008-10-24 09:35:21 UTC (rev 115) @@ -34,12 +34,9 @@ ) INCLUDE(DefineFlags) -FIND_PACKAGE(Poco) -FIND_PACKAGE(TBB) -IF(Poco_FOUND AND TBB_FOUND) - INCLUDE_DIRECTORIES(${Current_Headers} ${Poco_Foundation_INCLUDE_DIR} ${Poco_Net_INCLUDE_DIR} -${Poco_Util_INCLUDE_DIR} ${Poco_XML_INCLUDE_DIR} ${TBB_INCLUDE_DIR}) +FIND_PACKAGE(Lua) +IF(LUA_FOUND) + INCLUDE_DIRECTORIES(${Current_Headers} ${LUA_INCLUDE_DIR}) ADD_LIBRARY(${Current_Lib} SHARED ${Current_Sources}) - TARGET_LINK_LIBRARIES(${Current_Lib} ${Poco_Foundation_LIBRARY} ${Poco_Net_LIBRARY} ${Poco_Util_LIBRARY} -${Poco_XML_LIBRARY} ${TBB_LIBRARY}) -ENDIF(Poco_FOUND AND TBB_FOUND) + TARGET_LINK_LIBRARIES($(Current_Lib} ${LUA_LIBRARIES}) +ENDIF(LUA_FOUND) Modified: oge/trunk/plugins/scriptlua/build/vc80/ScriptLua.vcproj =================================================================== --- oge/trunk/plugins/scriptlua/build/vc80/ScriptLua.vcproj 2008-10-22 11:47:31 UTC (rev 114) +++ oge/trunk/plugins/scriptlua/build/vc80/ScriptLua.vcproj 2008-10-24 09:35:21 UTC (rev 115) @@ -39,7 +39,7 @@ <Tool Name="VCCLCompilerTool" Optimization="0" - AdditionalIncludeDirectories="..\..\include;..\..\oge\;..\..\..\..\utilities\include;..\..\..\..\core\include;..\..\..\..\dependencies\include" + AdditionalIncludeDirectories="..\..\include;..\..\oge\;..\..\..\..\utilities\include;..\..\..\..\core\include;..\..\..\..\dependencies\include;..\..\..\..\dependencies\include\lua" PreprocessorDefinitions="WIN32;_DEBUG;_USRDLL;LOG_DEBUG;OGE_SCRIPTLUA_EXPORTS" MinimalRebuild="true" BasicRuntimeChecks="3" Modified: oge/trunk/plugins/scriptlua/include/oge/script/OgeScriptManagerLua.h =================================================================== --- oge/trunk/plugins/scriptlua/include/oge/script/OgeScriptManagerLua.h 2008-10-22 11:47:31 UTC (rev 114) +++ oge/trunk/plugins/scriptlua/include/oge/script/OgeScriptManagerLua.h 2008-10-24 09:35:21 UTC (rev 115) @@ -49,9 +49,9 @@ // Lua extern "C" { - #include "lua/lua.h" - #include "lua/lualib.h" - #include "lua/lauxlib.h" + #include "lua.h" + #include "lualib.h" + #include "lauxlib.h" } // luabind This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <c_...@us...> - 2008-10-22 11:47:50
|
Revision: 114 http://oge.svn.sourceforge.net/oge/?rev=114&view=rev Author: c_j Date: 2008-10-22 11:47:31 +0000 (Wed, 22 Oct 2008) Log Message: ----------- 2008/10/22 - SVN TRUNK v0.3.82 Utilities - Fix to detect older Intel Hyper-Threaded CPU's properly Modified Paths: -------------- oge/trunk/utilities/src/hardware/OgeCPUDetect.cpp Modified: oge/trunk/utilities/src/hardware/OgeCPUDetect.cpp =================================================================== --- oge/trunk/utilities/src/hardware/OgeCPUDetect.cpp 2008-10-21 14:17:04 UTC (rev 113) +++ oge/trunk/utilities/src/hardware/OgeCPUDetect.cpp 2008-10-22 11:47:31 UTC (rev 114) @@ -156,15 +156,15 @@ #endif #elif OGE_COMPILER == OGE_COMPILER_GNUC int reg[4] = {0}; - __asm__ __volatile__ - ( - "pushl %%ebx \n\t" /* save %ebx */ - "cpuid \n\t" - "movl %%ebx, %1 \n\t" /* save what cpuid just put in %ebx */ - "popl %%ebx \n\t" /* restore the old %ebx */ - : "=a"(reg[0]), "=r"(reg[1]), "=c"(reg[2]), "=d"(reg[3]) - : "a" (func), "c" (ecxInput) - : "cc" + __asm__ __volatile__ + ( + "pushl %%ebx \n\t" /* save %ebx */ + "cpuid \n\t" + "movl %%ebx, %1 \n\t" /* save what cpuid just put in %ebx */ + "popl %%ebx \n\t" /* restore the old %ebx */ + : "=a"(reg[0]), "=r"(reg[1]), "=c"(reg[2]), "=d"(reg[3]) + : "a" (func), "c" (ecxInput) + : "cc" ); return CPUIDResult(reg); @@ -445,20 +445,36 @@ UInt32 MASK_CORE_BITS = 0xFC000000; UInt32 MASK_LOGICAL_BITS = 0x00FF0000; - if (isMultithreaded() && getMaxCPUIDFunc() < 4) + // The CPU doesn't not support multiple hardware threads + if (!isMultithreaded()) return 1; + // CPUID function of 4 is required to retrieve the necessary + // information. If less than 4, Hyper-Threading is enabled + if (getMaxCPUIDFunc() < 4) + return 2; + + // Query the CPU for the max number of processor cores + // cpuid with EAX == 4, ECX == 0 CPUIDResult coreResult = cpuid(4, true, 0); + // Query the CPU for the max number of logical processors CPUIDResult logicalResult = cpuid(1); + // Make sure each results are valid, if not guess that + // Hyper-Threading is enabled as the CPU supports multiple + // hardware threads if (!coreResult.valid || !logicalResult.valid) - return 1; + return 2; + // Calculate the maximum number of cores and logical processors + // from the results of the queries size_t maxCores = ((coreResult.eax.get() & MASK_CORE_BITS) >> 26) + 1; size_t maxLogical = ((logicalResult.ebx.get() & MASK_LOGICAL_BITS) >> 16); + // Calculate the number of logical processors per core return maxLogical / maxCores; } + // Not an Intel CPU, doesn't support Hyper-Threading return 1; } //------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <c_...@us...> - 2008-10-21 14:17:06
|
Revision: 113 http://oge.svn.sourceforge.net/oge/?rev=113&view=rev Author: c_j Date: 2008-10-21 14:17:04 +0000 (Tue, 21 Oct 2008) Log Message: ----------- 2008/10/21 - SVN TRUNK v0.3.81 Utilities - Fixed CMakeLists.txt for utilities - Fix for GCC cpuid assembly code Modified Paths: -------------- oge/trunk/utilities/build/cmake/CMakeLists.txt oge/trunk/utilities/src/hardware/OgeCPUDetect.cpp Modified: oge/trunk/utilities/build/cmake/CMakeLists.txt =================================================================== --- oge/trunk/utilities/build/cmake/CMakeLists.txt 2008-10-21 12:46:38 UTC (rev 112) +++ oge/trunk/utilities/build/cmake/CMakeLists.txt 2008-10-21 14:17:04 UTC (rev 113) @@ -45,7 +45,7 @@ ${Current_dir}/filesystem/zip/OgeZipArchive.cpp ${Current_dir}/filesystem/zip/OgeZipFile.cpp ${Current_dir}/filesystem/zip/OgeZipStream.cpp -${Current_dir}/hardware/OgeCPUIDetect.cpp +${Current_dir}/hardware/OgeCPUDetect.cpp ${Current_dir}/logging/OgeConsoleLogger.cpp ${Current_dir}/logging/OgeHtmlLogger.cpp ${Current_dir}/logging/OgeLogger.cpp Modified: oge/trunk/utilities/src/hardware/OgeCPUDetect.cpp =================================================================== --- oge/trunk/utilities/src/hardware/OgeCPUDetect.cpp 2008-10-21 12:46:38 UTC (rev 112) +++ oge/trunk/utilities/src/hardware/OgeCPUDetect.cpp 2008-10-21 14:17:04 UTC (rev 113) @@ -155,14 +155,18 @@ return CPUIDResult(false); #endif #elif OGE_COMPILER == OGE_COMPILER_GNUC - int tempA, tempB, tempC, tempD; - __asm__ __volatile__ - ( - "cpuid" - : "=a" (tempA), "=b" (tempB), "=c" (tempC), "=d" (tempD) - : "a" (func), "c" (ecxInput) + int reg[4] = {0}; + __asm__ __volatile__ + ( + "pushl %%ebx \n\t" /* save %ebx */ + "cpuid \n\t" + "movl %%ebx, %1 \n\t" /* save what cpuid just put in %ebx */ + "popl %%ebx \n\t" /* restore the old %ebx */ + : "=a"(reg[0]), "=r"(reg[1]), "=c"(reg[2]), "=d"(reg[3]) + : "a" (func), "c" (ecxInput) + : "cc" ); - int reg[4] = {tempA, tempB, tempC, tempD}; + return CPUIDResult(reg); #else // Compiler unsupported This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <c_...@us...> - 2008-10-21 12:46:49
|
Revision: 112 http://oge.svn.sourceforge.net/oge/?rev=112&view=rev Author: c_j Date: 2008-10-21 12:46:38 +0000 (Tue, 21 Oct 2008) Log Message: ----------- 2008/10/21 - SVN TRUNK v0.3.80 Utilities - 32 bit VC80 CPUDetect::cpuid fix where ecx, edx outputs were swapped over - This bug stopped Intel CPU's being detected properly Modified Paths: -------------- oge/trunk/utilities/src/hardware/OgeCPUDetect.cpp Modified: oge/trunk/utilities/src/hardware/OgeCPUDetect.cpp =================================================================== --- oge/trunk/utilities/src/hardware/OgeCPUDetect.cpp 2008-10-21 11:47:51 UTC (rev 111) +++ oge/trunk/utilities/src/hardware/OgeCPUDetect.cpp 2008-10-21 12:46:38 UTC (rev 112) @@ -144,8 +144,8 @@ cpuid mov tempA, eax mov tempB, ebx - mov tempC, edx - mov tempD, ecx + mov tempC, ecx + mov tempD, edx } int reg[4] = {tempA, tempB, tempC, tempD}; @@ -414,7 +414,7 @@ if (info.logicalCount == 0 || logicalPerCore == 0) return false; - info.coreCount = info.logicalCount / _detectLogicalPerCore(); + info.coreCount = info.logicalCount / logicalPerCore; info.packageCount = 1; // TODO: How to detect this? info.cpuDetectMethod = CPUInfo::DM_SECONDARY; @@ -430,7 +430,7 @@ #elif OGE_PLATFORM == OGE_PLATFORM_LINUX return sysconf(_SC_NPROCESSORS_CONF); #else - return 0; + return 1; #endif } //------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <laz...@us...> - 2008-10-21 11:48:04
|
Revision: 111 http://oge.svn.sourceforge.net/oge/?rev=111&view=rev Author: lazaruslong Date: 2008-10-21 11:47:51 +0000 (Tue, 21 Oct 2008) Log Message: ----------- 2008/10/21 - SVN TRUNK v0.3.79 (rev 111) Sorry forgot to commit two files. - Added script/OgeScriptManager.h & .cpp Revision Links: -------------- http://oge.svn.sourceforge.net/oge/?rev=111&view=rev Added Paths: ----------- oge/trunk/core/include/oge/script/OgeScriptManager.h oge/trunk/core/src/script/OgeScriptManager.cpp Added: oge/trunk/core/include/oge/script/OgeScriptManager.h =================================================================== --- oge/trunk/core/include/oge/script/OgeScriptManager.h (rev 0) +++ oge/trunk/core/include/oge/script/OgeScriptManager.h 2008-10-21 11:47:51 UTC (rev 111) @@ -0,0 +1,78 @@ +/* +----------------------------------------------------------------------------- +This source file is part of OGE (Open Game Engine) +For the latest info, see http://sourceforge.net/projects/oge + +Copyright (c) 2006-2008 The OGE Team +Also see acknowledgements in Readme.html + +This program is distributed under a dual-licensing scheme: + +1. The first license, which is the default one, state that this software + is free software; you can redistribute it and/or modify it under the terms + of the GNU Lesser General Public License (LGPL) as published by the + Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + +2. The second license, which is not free, apply only for licensee who got + a written agreement from the 'OGE Team'. The exact wording of this + license can be obtained from the 'OGE Team'. In essence this + OGE Unrestricted License state that the GNU Lesser General Public License + applies except that the software is distributed with no limitation or + requirements to publish or give back to the OGE Team changes made + to the OGE source code. + +By default, the first type of license applies (the GNU LGPL), the OGE +Unrestricted License apply only for those who got a written agreement +from the OGE Team. + +Under both licenses, 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 Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser 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, or go to +http://www.gnu.org/copyleft/lesser.txt. +For the OGE Unrestricted License contact the OGE Team. +----------------------------------------------------------------------------- +*/ +#ifndef __OGE_SCRIPTMANAGER_H__ +#define __OGE_SCRIPTMANAGER_H__ + +#include "oge/OgeCorePrerequisites.h" +#include "oge/system/OgeSystem.h" +#include "oge/OgeString.h" +#include "oge/input/OgeInputEvent.h" + +namespace oge +{ + class OGE_CORE_API ScriptManager : public System + { + private: + static ScriptManager* mManager; + + protected: + // ---------- Script specific --------------------- + + public: + ScriptManager(const String& name, int systemOrdering = 10); + virtual ~ScriptManager(); + + /// @see System::tick() + virtual void tick(double currentTime) {} + + /** + * Returns the manager + * @note The script manager is a singleton so this method is equivalent + * to getSingletonPtr() however the instantiation i.e. ScriptManagerLua + * is also a singleton hence getManager() is to avoid name conflict. + * @see getSingletonPtr() which returns the actual implementation + */ + static ScriptManager* getManager() { return mManager; } + + }; +} + +#endif // __OGE_SCRIPTMANAGER_H__ Property changes on: oge/trunk/core/include/oge/script/OgeScriptManager.h ___________________________________________________________________ Added: svn:eol-style + native Added: oge/trunk/core/src/script/OgeScriptManager.cpp =================================================================== --- oge/trunk/core/src/script/OgeScriptManager.cpp (rev 0) +++ oge/trunk/core/src/script/OgeScriptManager.cpp 2008-10-21 11:47:51 UTC (rev 111) @@ -0,0 +1,61 @@ +/* +----------------------------------------------------------------------------- +This source file is part of OGE (Open Game Engine) +For the latest info, see http://sourceforge.net/projects/oge + +Copyright (c) 2006-2008 The OGE Team +Also see acknowledgements in Readme.html + +This program is distributed under a dual-licensing scheme: + +1. The first license, which is the default one, state that this software + is free software; you can redistribute it and/or modify it under the terms + of the GNU Lesser General Public License (LGPL) as published by the + Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + +2. The second license, which is not free, apply only for licensee who got + a written agreement from the 'OGE Team'. The exact wording of this + license can be obtained from the 'OGE Team'. In essence this + OGE Unrestricted License state that the GNU Lesser General Public License + applies except that the software is distributed with no limitation or + requirements to publish or give back to the OGE Team changes made + to the OGE source code. + +By default, the first type of license applies (the GNU LGPL), the OGE +Unrestricted License apply only for those who got a written agreement +from the OGE Team. + +Under both licenses, 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 Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser 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, or go to +http://www.gnu.org/copyleft/lesser.txt. +For the OGE Unrestricted License contact the OGE Team. +----------------------------------------------------------------------------- +*/ +#include "oge/script/OgeScriptManager.h" +#include "oge/logging/OgeLogManager.h" + +namespace oge +{ + //------------------------------------------------------------------------- + ScriptManager* ScriptManager::mManager = 0; + //------------------------------------------------------------------------- + ScriptManager::ScriptManager(const String& name, int systemOrdering) : + System(name, systemOrdering) + { + mManager = this; + LOG("Created " + name); + } + //------------------------------------------------------------------------- + ScriptManager::~ScriptManager() + { + LOG("Destroyed "); + } + //------------------------------------------------------------------------- +} Property changes on: oge/trunk/core/src/script/OgeScriptManager.cpp ___________________________________________________________________ Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <laz...@us...> - 2008-10-21 07:50:33
|
Revision: 110 http://oge.svn.sourceforge.net/oge/?rev=110&view=rev Author: lazaruslong Date: 2008-10-21 07:50:27 +0000 (Tue, 21 Oct 2008) Log Message: ----------- 2008/10/21 - SVN TRUNK v0.3.78 (rev 110) Lua based Script Manager plugin - Added Lua based plugin Revision Links: -------------- http://oge.svn.sourceforge.net/oge/?rev=110&view=rev Added Paths: ----------- oge/trunk/plugins/scriptlua/ oge/trunk/plugins/scriptlua/Readme.txt oge/trunk/plugins/scriptlua/build/ oge/trunk/plugins/scriptlua/build/cmake/ oge/trunk/plugins/scriptlua/build/cmake/CMakeLists.txt oge/trunk/plugins/scriptlua/build/postbuild_win32.bat oge/trunk/plugins/scriptlua/build/vc80/ oge/trunk/plugins/scriptlua/build/vc80/ScriptLua.vcproj oge/trunk/plugins/scriptlua/include/ oge/trunk/plugins/scriptlua/include/oge/ oge/trunk/plugins/scriptlua/include/oge/script/ oge/trunk/plugins/scriptlua/include/oge/script/OgeScriptManagerLua.h oge/trunk/plugins/scriptlua/include/oge/script/OgeScriptPluginLua.h oge/trunk/plugins/scriptlua/include/oge/script/OgeScriptPrerequisitesLua.h oge/trunk/plugins/scriptlua/src/ oge/trunk/plugins/scriptlua/src/OgeScriptManagerLua.cpp oge/trunk/plugins/scriptlua/src/OgeScriptPluginLua.cpp Added: oge/trunk/plugins/scriptlua/Readme.txt =================================================================== --- oge/trunk/plugins/scriptlua/Readme.txt (rev 0) +++ oge/trunk/plugins/scriptlua/Readme.txt 2008-10-21 07:50:27 UTC (rev 110) @@ -0,0 +1,12 @@ + Lua Plugin +============ + + * We discussed on the forum if we should use a binder or not to expose the C++ + classes and methods to Lua: http://forum.opengameengine.org/viewtopic.php?f=12&t=31 + + We decided to use LuaBind. Perhaps later we will investigate others solution. + + * 5.1 Manual http://www.lua.org/manual/5.1/manual.html + + + \ No newline at end of file Property changes on: oge/trunk/plugins/scriptlua/Readme.txt ___________________________________________________________________ Added: svn:eol-style + native Added: oge/trunk/plugins/scriptlua/build/cmake/CMakeLists.txt =================================================================== --- oge/trunk/plugins/scriptlua/build/cmake/CMakeLists.txt (rev 0) +++ oge/trunk/plugins/scriptlua/build/cmake/CMakeLists.txt 2008-10-21 07:50:27 UTC (rev 110) @@ -0,0 +1,45 @@ +# CMakeLists.txt - Version usable for OGE 0.3.64 or later. +# +# This file is part of OGE (Open Game Engine) +# For the latest info, see http://sourceforge.net/projects/oge +# Copyright (c) 2008 The OGE Team +# Also see acknowledgements in Readme.txt +# + +SET(Current_Lib +OgeScriptLua +) + +SET(Current_dir +../../src +) + +SET(Current_Sources +${Current_dir}/OgeScriptManagerLua.cpp +${Current_dir}/OgeScriptPluginLua.cpp +) + +SET(Current_dir +../../include +) + +SET(Current_include +../../../.. +) + +SET(Current_Headers +${Current_dir}/ +${Current_include}/utilities/include +${Current_include}/core/include +) + +INCLUDE(DefineFlags) +FIND_PACKAGE(Poco) +FIND_PACKAGE(TBB) +IF(Poco_FOUND AND TBB_FOUND) + INCLUDE_DIRECTORIES(${Current_Headers} ${Poco_Foundation_INCLUDE_DIR} ${Poco_Net_INCLUDE_DIR} +${Poco_Util_INCLUDE_DIR} ${Poco_XML_INCLUDE_DIR} ${TBB_INCLUDE_DIR}) + ADD_LIBRARY(${Current_Lib} SHARED ${Current_Sources}) + TARGET_LINK_LIBRARIES(${Current_Lib} ${Poco_Foundation_LIBRARY} ${Poco_Net_LIBRARY} ${Poco_Util_LIBRARY} +${Poco_XML_LIBRARY} ${TBB_LIBRARY}) +ENDIF(Poco_FOUND AND TBB_FOUND) Property changes on: oge/trunk/plugins/scriptlua/build/cmake/CMakeLists.txt ___________________________________________________________________ Added: svn:eol-style + native Added: oge/trunk/plugins/scriptlua/build/postbuild_win32.bat =================================================================== --- oge/trunk/plugins/scriptlua/build/postbuild_win32.bat (rev 0) +++ oge/trunk/plugins/scriptlua/build/postbuild_win32.bat 2008-10-21 07:50:27 UTC (rev 110) @@ -0,0 +1,46 @@ +@echo off +echo Copying project output... + +set config=%1 + +rem echo config: %config% +rem echo Current Directory: %CD% +set bin_src=..\..\bin\%config% +set lib_src=..\..\lib\%config% + +set bin_dest_root=..\..\..\..\bin +set lib_dest_root=..\..\..\..\lib + +set bin_dest=%bin_dest_root%\%config% +set lib_dest=%lib_dest_root%\%config% + +if not exist %bin_dest_root% mkdir %bin_dest_root% +if not exist %lib_dest_root% mkdir %lib_dest_root% +if not exist %bin_dest% mkdir %bin_dest% +if not exist %lib_dest% mkdir %lib_dest% + +rem echo bin source: %bin_src% +rem echo bin destination: %bin_dest% +rem echo lib source: %lib_src% +rem echo lib destination: %lib_dest% + +copy %bin_src%\*.dll %bin_dest% +if %config%==debug copy %bin_src%\*.pdb %bin_dest% +copy %lib_src%\*.lib %lib_dest% + + +rem Samples +set samples_root=..\..\..\..\..\samples +set samples_bin=%samples_root%\bin\%config% + +if not exist %samples_root% goto SKIP_SAMPLES + +if not exist %samples_bin% mkdir %samples_bin% +if not exist %samples_root%\bin mkdir %samples_root%\bin +if not exist %samples_bin% mkdir %samples_bin% + +@echo bin samples destination: %samples_bin% +@copy %bin_src%\*.dll %samples_bin% +@if exist %bin_src%\*.pdb copy %bin_src%\*.pdb %samples_bin% + +:SKIP_SAMPLES Property changes on: oge/trunk/plugins/scriptlua/build/postbuild_win32.bat ___________________________________________________________________ Added: svn:eol-style + native Added: oge/trunk/plugins/scriptlua/build/vc80/ScriptLua.vcproj =================================================================== --- oge/trunk/plugins/scriptlua/build/vc80/ScriptLua.vcproj (rev 0) +++ oge/trunk/plugins/scriptlua/build/vc80/ScriptLua.vcproj 2008-10-21 07:50:27 UTC (rev 110) @@ -0,0 +1,210 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="8.00" + Name="Plugin Script Lua" + ProjectGUID="{11D5EC72-AF94-518E-B58B-6984D3FFB4A4}" + RootNamespace="ScriptLuavcproj" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|Win32" + OutputDirectory="..\..\bin\$(ConfigurationName)" + IntermediateDirectory="$(ConfigurationName)" + ConfigurationType="2" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + AdditionalIncludeDirectories="..\..\include;..\..\oge\;..\..\..\..\utilities\include;..\..\..\..\core\include;..\..\..\..\dependencies\include" + PreprocessorDefinitions="WIN32;_DEBUG;_USRDLL;LOG_DEBUG;OGE_SCRIPTLUA_EXPORTS" + MinimalRebuild="true" + BasicRuntimeChecks="3" + RuntimeLibrary="3" + WarningLevel="3" + Detect64BitPortabilityProblems="true" + DebugInformationFormat="4" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="OgeUtilities_d.lib OgeCore_d.lib lua_d.lib luabind_d.lib" + OutputFile="$(OutDir)\OgeScriptLua_d.dll" + AdditionalLibraryDirectories=""..\..\..\..\lib\$(ConfigurationName)";"..\..\..\..\dependencies\lib\$(ConfigurationName)";"..\..\lib\$(ConfigurationName)"" + GenerateDebugInformation="true" + ImportLibrary="..\..\lib\$(ConfigurationName)\$(TargetName).lib" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + CommandLine="..\..\..\..\build\postbuild_win32 debug plugin" + /> + </Configuration> + <Configuration + Name="Release|Win32" + OutputDirectory="..\..\bin\$(ConfigurationName)" + IntermediateDirectory="$(ConfigurationName)" + ConfigurationType="2" + CharacterSet="2" + WholeProgramOptimization="1" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="..\..\include;..\..\oge\;..\..\..\..\utilities\include;..\..\..\..\core\include;..\..\..\..\dependencies\include;..\..\..\..\dependencies\include\lua" + PreprocessorDefinitions="WIN32;NDEBUG;_USRDLL;LOG_NORMAL;OGE_SCRIPTLUA_EXPORTS" + RuntimeLibrary="2" + WarningLevel="3" + Detect64BitPortabilityProblems="true" + DebugInformationFormat="3" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="OgeUtilities.lib OgeCore.lib lua.lib luabind.lib" + OutputFile="$(OutDir)\OgeScriptLua.dll" + AdditionalLibraryDirectories=""..\..\..\..\lib\$(ConfigurationName)";"..\..\..\..\dependencies\lib\$(ConfigurationName)";"..\..\lib\$(ConfigurationName)"" + GenerateDebugInformation="true" + OptimizeReferences="2" + EnableCOMDATFolding="2" + ImportLibrary="..\..\lib\$(ConfigurationName)\$(TargetName).lib" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + CommandLine="..\..\..\..\build\postbuild_win32 release plugin" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source Files" + Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" + UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" + > + <File + RelativePath="..\..\src\OgeScriptManagerLua.cpp" + > + </File> + <File + RelativePath="..\..\include\oge\script\OgeScriptManagerLua.h" + > + </File> + <File + RelativePath="..\..\src\OgeScriptPluginLua.cpp" + > + </File> + <File + RelativePath="..\..\include\oge\script\OgeScriptPluginLua.h" + > + </File> + <File + RelativePath="..\..\include\oge\script\OgeScriptPrerequisitesLua.h" + > + </File> + </Filter> + <File + RelativePath="..\..\Readme.txt" + > + </File> + </Files> + <Globals> + </Globals> +</VisualStudioProject> Added: oge/trunk/plugins/scriptlua/include/oge/script/OgeScriptManagerLua.h =================================================================== --- oge/trunk/plugins/scriptlua/include/oge/script/OgeScriptManagerLua.h (rev 0) +++ oge/trunk/plugins/scriptlua/include/oge/script/OgeScriptManagerLua.h 2008-10-21 07:50:27 UTC (rev 110) @@ -0,0 +1,169 @@ +/* +----------------------------------------------------------------------------- +This source file is part of OGE (Open Game Engine) +For the latest info, see http://sourceforge.net/projects/oge + +Copyright (c) 2006-2008 The OGE Team +Also see acknowledgements in Readme.html + +This program is distributed under a dual-licensing scheme: + +1. The first license, which is the default one, state that this software + is free software; you can redistribute it and/or modify it under the terms + of the GNU Lesser General Public License (LGPL) as published by the + Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + +2. The second license, which is not free, apply only for licensee who got + a written agreement from the 'OGE Team'. The exact wording of this + license can be obtained from the 'OGE Team'. In essence this + OGE Unrestricted License state that the GNU Lesser General Public License + applies except that the software is distributed with no limitation or + requirements to publish or give back to the OGE Team changes made + to the OGE source code. + +By default, the first type of license applies (the GNU LGPL), the OGE +Unrestricted License apply only for those who got a written agreement +from the OGE Team. + +Under both licenses, 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 Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser 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, or go to +http://www.gnu.org/copyleft/lesser.txt. +For the OGE Unrestricted License contact the OGE Team. +----------------------------------------------------------------------------- +*/ +#ifndef __OGE_SCRIPTMANAGERLUA_H__ +#define __OGE_SCRIPTMANAGERLUA_H__ + +#include "oge/script/OgeScriptPrerequisitesLua.h" +#include "oge/resource/OgeResourceControllerOgeImpl.h" +#include "oge/script/OgeScriptManager.h" +#include "oge/OgeSingleton.h" + +// Lua +extern "C" +{ + #include "lua/lua.h" + #include "lua/lualib.h" + #include "lua/lauxlib.h" +} + +// luabind +#include "luabind/luabind.hpp" +#include "luabind/adopt_policy.hpp" +#include "luabind/out_value_policy.hpp" +#include "luabind/return_reference_to_policy.hpp" + +namespace oge +{ + + + /** + * @brief Manages and execute the lua scripts + * + * @author Steven GAY + */ + class OGE_SCRIPT_API ScriptManagerLua : public ScriptManager, + public Singleton<ScriptManagerLua> + { + private: + lua_State* mLuaState; + + public: + + static ScriptManagerLua* createSingleton(); + static void destroySingleton(); + static ScriptManagerLua* getSingletonPtr() { return mSingleton; } + static ScriptManagerLua& getSingleton() + { + assert(mSingleton); + return *mSingleton; + } + + /// Create a new lua state and load additional libraries + void openState(); + void closeState(); + /// Close the current lua state and calls openState() + void resetState(); + + /** + * Execute a script file. + * Able to execute pre-compiled chunks. It detects whether + * the file is text or not, and loads it accordingly (see luac). + */ + bool doFile( const String& script ); + /// Execute a script string. + bool doString( const String& script ); + /// Execute a script from STDIN + bool doStdin(); + /// Returns a dump of lua as a string + String getStackDump(lua_State* state = 0); + + lua_State* getLuaState() { return mLuaState; } + + protected: + // System methods + bool initialise(); + void shutdown(); + void tick(double currentTime); + + /** + * Bind classes to lua. + * It will defines lua functions that we can call + * @note The classes are hard-coded in this method. + */ + void bindClasses( lua_State* luaState ); + +/* Experimental code + void call( const char* const function ) + { + luabind::call_function<void>(mState, function); + } + + template<typename T0> + void call( const char * const function, + const T0& parameter0 ) + { + luabind::call_function<void>(mState, function, parameter0); + } + + template<typename T0, typename T1> + void call( const char* const function, const T0& parameter0, + const T1& parameter1 ) + { + luabind::call_function<void>( mState, function, parameter0, + parameter1); + } + + template<typename T0, typename T1, typename T2> + void call(const char* const function, const T0& parameter0, + const T1& parameter1, const T2& parameter2 ) + { + luabind::call_function<void>( mState, function, parameter0, + parameter1, parameter2); + } + + template< typename T0, typename T1, typename T2, typename T3> + void call(const char* const function, const T0& parameter0, + const T1& parameter1, const T2& parameter2, const T3& parameter3 ) + { + luabind::call_function<void>( mState, function, parameter0, + parameter1, parameter2, parameter3); + } +*/ + + private: + ScriptManagerLua(); + ~ScriptManagerLua(); + }; +} +#endif // __OGE_SCRIPTMANAGERLUA_H__ + +/* Prospective code +*/ \ No newline at end of file Property changes on: oge/trunk/plugins/scriptlua/include/oge/script/OgeScriptManagerLua.h ___________________________________________________________________ Added: svn:eol-style + native Added: oge/trunk/plugins/scriptlua/include/oge/script/OgeScriptPluginLua.h =================================================================== --- oge/trunk/plugins/scriptlua/include/oge/script/OgeScriptPluginLua.h (rev 0) +++ oge/trunk/plugins/scriptlua/include/oge/script/OgeScriptPluginLua.h 2008-10-21 07:50:27 UTC (rev 110) @@ -0,0 +1,84 @@ +/* +----------------------------------------------------------------------------- +This source file is part of OGE (Open Game Engine) +For the latest info, see http://sourceforge.net/projects/oge + +Copyright (c) 2006-2008 The OGE Team +Also see acknowledgements in Readme.html + +This program is distributed under a dual-licensing scheme: + +1. The first license, which is the default one, state that this software + is free software; you can redistribute it and/or modify it under the terms + of the GNU Lesser General Public License (LGPL) as published by the + Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + +2. The second license, which is not free, apply only for licensee who got + a written agreement from the 'OGE Team'. The exact wording of this + license can be obtained from the 'OGE Team'. In essence this + OGE Unrestricted License state that the GNU Lesser General Public License + applies except that the software is distributed with no limitation or + requirements to publish or give back to the OGE Team changes made + to the OGE source code. + +By default, the first type of license applies (the GNU LGPL), the OGE +Unrestricted License apply only for those who got a written agreement +from the OGE Team. + +Under both licenses, 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 Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser 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, or go to +http://www.gnu.org/copyleft/lesser.txt. +For the OGE Unrestricted License contact the OGE Team. +----------------------------------------------------------------------------- +*/ +#ifndef __OGE_SCRIPTPLUGINLUA_H__ +#define __OGE_SCRIPTPLUGINLUA_H__ + +#include "oge/script/OgeScriptPrerequisitesLua.h" +#include "oge/plugin/OgePluginManager.h" +#include "oge/plugin/OgePlugin.h" + +#if defined(OGE_SCRIPT_LUA_STATIC_LIB) + // Note that this global C method must be unique + extern "C" OGE_SCRIPT_API bool ScriptLuaPluginStaticInit( + const oge::PluginServices* ps, void* hdll); +#endif + +namespace oge +{ + /** + * Lua based Script Plugin + * + */ + class OGE_SCRIPT_API ScriptPluginLua : public Plugin + { + private: + PluginManager& mPluginManager; + String mName; + String mVersion; + + ScriptManagerLua* mScriptManager; + public: + ScriptPluginLua(PluginManager& mgr); + ~ScriptPluginLua(); + + const String& getName() const; + const String& getVersion() const; + bool initialise(); + bool shutdown(); + + // ------------- Static plugin interface --------------- + /// @todo The parameters are not used yet + static Plugin* createInstance(Plugin_Params* params); + static int destroyInstance(Plugin* plugin); + }; +} + +#endif // __OGE_SCRIPTPLUGINLUA_H__ Property changes on: oge/trunk/plugins/scriptlua/include/oge/script/OgeScriptPluginLua.h ___________________________________________________________________ Added: svn:eol-style + native Added: oge/trunk/plugins/scriptlua/include/oge/script/OgeScriptPrerequisitesLua.h =================================================================== --- oge/trunk/plugins/scriptlua/include/oge/script/OgeScriptPrerequisitesLua.h (rev 0) +++ oge/trunk/plugins/scriptlua/include/oge/script/OgeScriptPrerequisitesLua.h 2008-10-21 07:50:27 UTC (rev 110) @@ -0,0 +1,69 @@ +/* +----------------------------------------------------------------------------- +This source file is part of OGE (Open Game Engine) +For the latest info, see http://sourceforge.net/projects/oge + +Copyright (c) 2006-2008 The OGE Team +Also see acknowledgements in Readme.html + +This program is distributed under a dual-licensing scheme: + +1. The first license, which is the default one, state that this software + is free software; you can redistribute it and/or modify it under the terms + of the GNU Lesser General Public License (LGPL) as published by the + Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + +2. The second license, which is not free, apply only for licensee who got + a written agreement from the 'OGE Team'. The exact wording of this + license can be obtained from the 'OGE Team'. In essence this + OGE Unrestricted License state that the GNU Lesser General Public License + applies except that the software is distributed with no limitation or + requirements to publish or give back to the OGE Team changes made + to the OGE source code. + +By default, the first type of license applies (the GNU LGPL), the OGE +Unrestricted License apply only for those who got a written agreement +from the OGE Team. + +Under both licenses, 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 Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser 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, or go to +http://www.gnu.org/copyleft/lesser.txt. +For the OGE Unrestricted License contact the OGE Team. +----------------------------------------------------------------------------- +*/ +#ifndef __OGE_SCRIPTLUAPREREQUISITES_H__ +#define __OGE_SCRIPTLUAPREREQUISITES_H__ + +#include "oge/OgeUtilitiesPrerequisites.h" + +#if (OGE_PLATFORM == OGE_PLATFORM_WIN32) && !defined(OGE_SCRIPT_LUA_STATIC_LIB) +# ifdef OGE_SCRIPTLUA_EXPORTS +# define OGE_SCRIPT_API __declspec(dllexport) +# else +# if defined( __MINGW32__ ) +# define OGE_SCRIPT_API +# else +# define OGE_SCRIPT_API __declspec(dllimport) +# endif +# endif +#elif defined ( OGE_GCC_VISIBILITY ) +# define OGE_SCRIPT_API __attribute__ ((visibility("default"))) +#else +# define OGE_SCRIPT_API +#endif // OGE_WIN32 + +namespace oge +{ + // Forward declaration + class ScriptManagerLua; + +} // namespace + +#endif // __OGE_SCRIPTLUAPREREQUISITES_H__ Property changes on: oge/trunk/plugins/scriptlua/include/oge/script/OgeScriptPrerequisitesLua.h ___________________________________________________________________ Added: svn:eol-style + native Added: oge/trunk/plugins/scriptlua/src/OgeScriptManagerLua.cpp =================================================================== --- oge/trunk/plugins/scriptlua/src/OgeScriptManagerLua.cpp (rev 0) +++ oge/trunk/plugins/scriptlua/src/OgeScriptManagerLua.cpp 2008-10-21 07:50:27 UTC (rev 110) @@ -0,0 +1,255 @@ +/* +----------------------------------------------------------------------------- +This source file is part of OGE (Open Game Engine) +For the latest info, see http://sourceforge.net/projects/oge + +Copyright (c) 2006-2008 The OGE Team +Also see acknowledgements in Readme.html + +This program is distributed under a dual-licensing scheme: + +1. The first license, which is the default one, state that this software + is free software; you can redistribute it and/or modify it under the terms + of the GNU Lesser General Public License (LGPL) as published by the + Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + +2. The second license, which is not free, apply only for licensee who got + a written agreement from the 'OGE Team'. The exact wording of this + license can be obtained from the 'OGE Team'. In essence this + OGE Unrestricted License state that the GNU Lesser General Public License + applies except that the software is distributed with no limitation or + requirements to publish or give back to the OGE Team changes made + to the OGE source code. + +By default, the first type of license applies (the GNU LGPL), the OGE +Unrestricted License apply only for those who got a written agreement +from the OGE Team. + +Under both licenses, 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 Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser 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, or go to +http://www.gnu.org/copyleft/lesser.txt. +For the OGE Unrestricted License contact the OGE Team. +----------------------------------------------------------------------------- +*/ +#include "oge/script/OgeScriptManagerLua.h" +#include "oge/resource/OgeResourceRegistry.h" +#include "oge/logging/OgeLogManager.h" + +//------- class to bind --------------- +#include "oge/OgeMessage.h" + + +/** + * Error method to by-pass the exit that is called by the standard + * lua_atpanic. + * @todo Not sure this works. Should we also throw? + * http://www.gamedev.net/community/forums/topic.asp?topic_id=284645 + */ +extern "C" +{ + int OgeLuaError(lua_State* state) + { + if (state) + { + std::string str( lua_tostring(state, -1) ); + lua_pop(state, 1); // remove error mesage + lua_getglobal(state, "ERROR"); + // TODO is throw LUAI_THROW also needed to avoid the exit? + } + return 0; + } +} + + +namespace oge +{ + //------------------------------------------------------------------------- + template<> ScriptManagerLua* Singleton<ScriptManagerLua>::mSingleton = 0; + //------------------------------------------------------------------------- + ScriptManagerLua::ScriptManagerLua() : + ScriptManager("ScriptManager"), // Not ScriptManagerLua as we -for now- want only one mgr for each type + mLuaState(0) + { + + } + //------------------------------------------------------------------------- + ScriptManagerLua::~ScriptManagerLua() + { + closeState(); + } + //------------------------------------------------------------------------- + bool ScriptManagerLua::initialise() + { + // if (!setupResourceManagement()) + // return false; + + // Create a new lua state + openState(); + + if (!System::initialise()) + return false; + + return true; + } + //------------------------------------------------------------------------- + void ScriptManagerLua::shutdown() + { + System::shutdown(); + + closeState(); + + // shutdownResourceManagement(); + } + //------------------------------------------------------------------------- + void ScriptManagerLua::tick(double currentTime) + { + LOGE("yes it works"); + } + //------------------------------------------------------------------------- + ScriptManagerLua* ScriptManagerLua::createSingleton() + { + if (!mSingleton) + mSingleton = new ScriptManagerLua(); + + return mSingleton; + } + //------------------------------------------------------------------------- + void ScriptManagerLua::destroySingleton() + { + if (mSingleton) + { + delete mSingleton; + mSingleton = 0; + } + } + //------------------------------------------------------------------------- + void ScriptManagerLua::openState() + { + // Create a new lua state (was lua_open() ) + // TODO use lua_newstate to create a state with a standard allocation + // function (based on realloc). + mLuaState = luaL_newstate(); + + // luaL_newstate creates a standard panic function that uses exit() + // which kills the application (see lua_atpanic ) + // If you want that lua exit with fatal error then comment out this method + lua_register( mLuaState, "_ALERT", OgeLuaError); + + if (!mLuaState) + { + LOGE("A lua state couldn't be created."); + return; + } + + // Opens all standard Lua libraries into the given state. + luaL_openlibs(mLuaState); + + // The above method is similar to: + // luaopen_base(mLuaState); + // luaopen_package(mLuaState); // was luaopen_loadlib() + // luaopen_string(mLuaState); + // luaopen_table(mLuaState); + // luaopen_math(mLuaState); + // luaopen_io(mLuaState); + // luaopen_os(mLuaState); + // luaopen_debug(mLuaState); + + luabind::open(mLuaState); // is this performed by luaL_openlibs() ? + + // Connect LuaBind to the lua state + luabind::open(mLuaState); + + // Bind the oge class to lua + bindClasses(mLuaState); + } + //------------------------------------------------------------------------- + void ScriptManagerLua::closeState() + { + if (mLuaState) + { + lua_close(mLuaState); + mLuaState = 0; + } + } + //------------------------------------------------------------------------- + void ScriptManagerLua::resetState() + { + LOGV("Reset Lua state"); + closeState(); + openState(); + } + //------------------------------------------------------------------------- + bool ScriptManagerLua::doFile( const String& script ) + { + if (script.empty()) + return false; + + return (0 == luaL_dofile( mLuaState, script.c_str()) ); // was lua_dofile + } + //------------------------------------------------------------------------- + bool ScriptManagerLua::doStdin() + { + return (0 == luaL_dofile( mLuaState, 0 )); + } + //------------------------------------------------------------------------- + bool ScriptManagerLua::doString(const String& script) + { + if (script.empty()) + return false; + return (0 == luaL_dostring(mLuaState, script.c_str()) ); // was lua_dostring + } + //------------------------------------------------------------------------- + String ScriptManagerLua::getStackDump(lua_State* state) + { + if (state == 0) + state = mLuaState; + + int top = lua_gettop(state); + String dump; + + for (int i = 1; i <= top; i++) + { + int t = lua_type(state, i); + + switch (t) + { + case LUA_TSTRING: + dump += lua_tostring(state, i); + break; + case LUA_TBOOLEAN: + dump += (lua_toboolean(state, i) ? "true" : "false"); + break; + case LUA_TNUMBER: + dump += StringUtil::toString((oge::Real)lua_tonumber(state, i)); + break; + default: + dump += lua_typename(state, t); + } + dump += " "; + } + dump += "\n"; + return dump; + } + //------------------------------------------------------------------------- + void ScriptManagerLua::bindClasses( lua_State* luaState ) + { + luabind::module( luaState ) + [ // Note: '[' and not '{' + // Bind our String type (LuaBind already knows about std::string, so no need for more) + luabind::class_<String>("String"), + + // The template paramater is the C++ class, the "Message" is the class name for Lua + luabind::class_<Message>("Message") + // luabind::.def( "setMessage", &MessageBoy::setMessage ) // bind the setMessage method + // luabind::.def( "getMessage", &MessageBoy::getMessage ) // bind the getMessage method + ]; + } + //------------------------------------------------------------------------- +} Property changes on: oge/trunk/plugins/scriptlua/src/OgeScriptManagerLua.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: oge/trunk/plugins/scriptlua/src/OgeScriptPluginLua.cpp =================================================================== --- oge/trunk/plugins/scriptlua/src/OgeScriptPluginLua.cpp (rev 0) +++ oge/trunk/plugins/scriptlua/src/OgeScriptPluginLua.cpp 2008-10-21 07:50:27 UTC (rev 110) @@ -0,0 +1,201 @@ +/* +----------------------------------------------------------------------------- +This source file is part of OGE (Open Game Engine) +For the latest info, see http://sourceforge.net/projects/oge + +Copyright (c) 2006-2008 The OGE Team +Also see acknowledgements in Readme.html + +This program is distributed under a dual-licensing scheme: + +1. The first license, which is the default one, state that this software + is free software; you can redistribute it and/or modify it under the terms + of the GNU Lesser General Public License (LGPL) as published by the + Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + +2. The second license, which is not free, apply only for licensee who got + a written agreement from the 'OGE Team'. The exact wording of this + license can be obtained from the 'OGE Team'. In essence this + OGE Unrestricted License state that the GNU Lesser General Public License + applies except that the software is distributed with no limitation or + requirements to publish or give back to the OGE Team changes made + to the OGE source code. + +By default, the first type of license applies (the GNU LGPL), the OGE +Unrestricted License apply only for those who got a written agreement +from the OGE Team. + +Under both licenses, 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 Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser 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, or go to +http://www.gnu.org/copyleft/lesser.txt. +For the OGE Unrestricted License contact the OGE Team. +----------------------------------------------------------------------------- +*/ +#include "oge/script/OgeScriptPluginLua.h" +#include "oge/script/OgeScriptManagerLua.h" +#include "oge/system/OgeSystemManager.h" +#include "oge/logging/OgeLogManager.h" + +/* This define is ugly but we when build statically we need to be + in the oge namespace and outside when building dynamically. + Also the entry point is common to all plugins when dynamic + (pluginRegistration) and unique when static (or there would be conflicts). +*/ +#if defined(OGE_SCRIPT_LUA_STATIC_LIB) +extern "C" +{ + /** @note I am not sure if I need a different name per plugin or if I can reuse it! + * See in PluginFramework the plugin.h + * @note The name registered is used to retrieve the plugin in PluginManager + * We use the shortened dll plugin (without _d & .dll/.os/.dynlib) + */ + OGE_SCRIPT_API bool ScriptLuaPluginStaticInit(const oge::PluginServices* ps, void* hdll) + { + oge::PluginManager::PluginRegisterParams rp; + rp.versionMajor = 1; + rp.versionMinor = 0; + rp.hDll = hdll; + rp.createFct = oge::ScriptPlugin::createInstance; + rp.destroyFct = oge::ScriptPlugin::destroyInstance; + + if (!ps->mgr->registerPluginInstance((const unsigned char*) "OgeScriptLua", &rp)) + return false; + + // NEXT Note that several plugin can be registered at once! + + return true; + } +} // extern "C" + +//PluginRegistrar StaticPlugin_registrar(PluginRegistrar); + +#else // if not defined OGE_SCRIPT_LUA_STATIC_LIB + +namespace oge +{ + extern "C" + { + /** + * @note Several plugin can be registered at once with this method. + * @note The name registered is used to retrieve the plugin in PluginManager + * We use the shortened dll plugin (without _d & .dll/.os/.dynlib) + */ + OGE_SCRIPT_API bool pluginRegistration(const PluginServices * ps, void* hdll) + { + PluginManager::PluginRegisterParams rp; + rp.versionMajor = 1; + rp.versionMinor = 0; + rp.hDll = hdll; + rp.createFct = ScriptPluginLua::createInstance; + rp.destroyFct = ScriptPluginLua::destroyInstance; + + if (!ps->mgr->registerPluginInstance((const unsigned char*) "OgeScriptLua", &rp)) + return false; + + return true; + } + //--------------------------------------------------------------------- + // Plugin factory function + OGE_SCRIPT_API Plugin* createPlugin(PluginManager& manager) + { + return new ScriptPluginLua( manager ); + + // NEXT We should register and not assume that the dll was created! + // Register + // oge::EngineManager::getSingleton().installPlugin( mSingleton ); + + } + //--------------------------------------------------------------------- + // Plugin cleanup function + OGE_SCRIPT_API void releasePlugin(Plugin* plugin) + { + // NEXT We should unregister btw see Ogre::BspSceneManaer::bspPlugin + // in OgreBspSceneManagerDll.cpp + // Unregister + // oge::EngineManager::getSingleton().uninstallPlugin( plugin ); + delete (ScriptPluginLua*) plugin; + } + } // extern "C" +} + +#endif + +namespace oge +{ + //------------------------------------------------------------------------- + ScriptPluginLua::ScriptPluginLua(PluginManager& mgr) : + mPluginManager(mgr), mName("ScriptPluginLua"), mVersion("0.0.1"), + mScriptManager(0) + { + ogeInitMemoryCheck(); + LOG("ScriptPluginLua created."); + } + //------------------------------------------------------------------------- + ScriptPluginLua::~ScriptPluginLua() + { + shutdown(); + LOG("ScriptPluginLua deleted."); + } + //------------------------------------------------------------------------- + const String& ScriptPluginLua::getName() const + { + return mName; + } + //------------------------------------------------------------------------- + const String& ScriptPluginLua::getVersion() const + { + return mVersion; + } + //------------------------------------------------------------------------- + bool ScriptPluginLua::initialise() + { + LOG("Initialise ScriptPluginLua..."); + mScriptManager = ScriptManagerLua::createSingleton(); + if (!SystemManager::getSingleton().registerSystem(mScriptManager)) + { + LOGE("Couldn't register ScriptPluginLua as system!"); + return false; + } + return true; + } + //------------------------------------------------------------------------- + bool ScriptPluginLua::shutdown() + { + LOG("Shuting down ScriptPluginLua..."); + if (mScriptManager) + { + SystemManager::getSingleton().unregisterSystem(mScriptManager); + ScriptManagerLua::destroySingleton(); + } + + return true; + } + //------------------------------------------------------------------------- + Plugin* ScriptPluginLua::createInstance(Plugin_Params* params) + { + return new ScriptPluginLua(*params->mgr); + } + //------------------------------------------------------------------------- + int ScriptPluginLua::destroyInstance(Plugin* plugin) + { + if (!plugin) + return -1; + + // make sure p can be cast to ScriptPluginLua* + ScriptPluginLua* scriptPlugin = dynamic_cast<ScriptPluginLua*>(plugin); + + if (!scriptPlugin) + return -1; + + delete scriptPlugin; + return 0; + } + //------------------------------------------------------------------------- +} Property changes on: oge/trunk/plugins/scriptlua/src/OgeScriptPluginLua.cpp ___________________________________________________________________ Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <laz...@us...> - 2008-10-21 07:43:57
|
Revision: 109 http://oge.svn.sourceforge.net/oge/?rev=109&view=rev Author: lazaruslong Date: 2008-10-21 07:43:50 +0000 (Tue, 21 Oct 2008) Log Message: ----------- 2008/10/21 - SVN TRUNK v0.3.77 (rev 109) Lua based Script Manager plugin & CPUDetect update - Updated On linux prepend "lib" on the name of plugins to be loaded. - Updated vc80 and CMakeLists.txt file for CPUDetect - Updated EngineManager to initialise the ScriptManager - Fixed Added last empty line for gcc warnings. - Updated Made the logging of the cpu info detected as LOGR. So that this info is nearly always present in the log. Revision Links: -------------- http://oge.svn.sourceforge.net/oge/?rev=109&view=rev Modified Paths: -------------- oge/trunk/build/vc80/Oge.sln oge/trunk/core/build/cmake/CMakeLists.txt oge/trunk/core/build/vc80/Core.vcproj oge/trunk/core/src/engine/OgeEngineManager.cpp oge/trunk/plugins/guimygui/src/OgeGuiManagerMyGUI.cpp oge/trunk/utilities/build/cmake/CMakeLists.txt oge/trunk/utilities/build/vc80/Utilities.vcproj oge/trunk/utilities/include/oge/hardware/OgeCPUDetect.h oge/trunk/utilities/src/hardware/OgeCPUDetect.cpp oge/trunk/utilities/src/plugin/OgePluginManager.cpp Modified: oge/trunk/build/vc80/Oge.sln =================================================================== --- oge/trunk/build/vc80/Oge.sln 2008-10-20 12:58:05 UTC (rev 108) +++ oge/trunk/build/vc80/Oge.sln 2008-10-21 07:43:50 UTC (rev 109) @@ -74,6 +74,8 @@ {EA2B8BC6-16CB-417B-BB77-A6DB0FDD398B} = {EA2B8BC6-16CB-417B-BB77-A6DB0FDD398B} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin Script Lua", "..\..\plugins\scriptlua\build\vc80\ScriptLua.vcproj", "{11D5EC72-AF94-518E-B58B-6984D3FFB4A4}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -128,6 +130,10 @@ {000000B5-0000-0000-0000-000000000000}.Debug|Win32.Build.0 = Debug|Win32 {000000B5-0000-0000-0000-000000000000}.Release|Win32.ActiveCfg = Release|Win32 {000000B5-0000-0000-0000-000000000000}.Release|Win32.Build.0 = Release|Win32 + {11D5EC72-AF94-518E-B58B-6984D3FFB4A4}.Debug|Win32.ActiveCfg = Debug|Win32 + {11D5EC72-AF94-518E-B58B-6984D3FFB4A4}.Debug|Win32.Build.0 = Debug|Win32 + {11D5EC72-AF94-518E-B58B-6984D3FFB4A4}.Release|Win32.ActiveCfg = Release|Win32 + {11D5EC72-AF94-518E-B58B-6984D3FFB4A4}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Modified: oge/trunk/core/build/cmake/CMakeLists.txt =================================================================== --- oge/trunk/core/build/cmake/CMakeLists.txt 2008-10-20 12:58:05 UTC (rev 108) +++ oge/trunk/core/build/cmake/CMakeLists.txt 2008-10-21 07:43:50 UTC (rev 109) @@ -35,6 +35,7 @@ ${Current_dir}/object/OgeObjectManager.cpp ${Current_dir}/object/OgeObjectSceneManager.cpp ${Current_dir}/scene/OgeSceneManagerEnumerator.cpp +${Current_dir}/script/OgeScriptManager.cpp ${Current_dir}/script/OgeState.cpp ${Current_dir}/script/OgeStateComponent.cpp ${Current_dir}/system/OgeSystem.cpp Modified: oge/trunk/core/build/vc80/Core.vcproj =================================================================== --- oge/trunk/core/build/vc80/Core.vcproj 2008-10-20 12:58:05 UTC (rev 108) +++ oge/trunk/core/build/vc80/Core.vcproj 2008-10-21 07:43:50 UTC (rev 109) @@ -393,6 +393,14 @@ Name="Script" > <File + RelativePath="..\..\src\script\OgeScriptManager.cpp" + > + </File> + <File + RelativePath="..\..\include\oge\script\OgeScriptManager.h" + > + </File> + <File RelativePath="..\..\src\script\OgeState.cpp" > </File> Modified: oge/trunk/core/src/engine/OgeEngineManager.cpp =================================================================== --- oge/trunk/core/src/engine/OgeEngineManager.cpp 2008-10-20 12:58:05 UTC (rev 108) +++ oge/trunk/core/src/engine/OgeEngineManager.cpp 2008-10-21 07:43:50 UTC (rev 109) @@ -355,6 +355,10 @@ { LOGE("OgeAudioOpenAL couldn't be initialised."); } + if (!PluginManager::getSingletonPtr()->initialisePlugin("OgeScriptLua")) + { + LOGE("OgeScriptLua couldn't be initialised."); + } } //------------------------------------------------------------------------- void EngineManager::setupThreads() @@ -378,16 +382,16 @@ if (info.HT) { message += "Hyper-Threaded; "; } - message += "(p: " + StringUtil::toString(info.packageCount) + - ", c: " + StringUtil::toString(info.coreCount) + - ", l: " + StringUtil::toString(info.logicalCount) + ")"; + message += "(p: " + StringUtil::toString((unsigned int)info.packageCount) + + ", c: " + StringUtil::toString((unsigned int)info.coreCount) + + ", l: " + StringUtil::toString((unsigned int)info.logicalCount) + ")"; LOGD(message) // TODO: Use these values better threadCount = info.logicalCount; - LOGD("Thread Count: " + StringUtil::toString(threadCount)) + LOGR("Thread Count: " + StringUtil::toString((unsigned int)threadCount)) } else { Modified: oge/trunk/plugins/guimygui/src/OgeGuiManagerMyGUI.cpp =================================================================== --- oge/trunk/plugins/guimygui/src/OgeGuiManagerMyGUI.cpp 2008-10-20 12:58:05 UTC (rev 108) +++ oge/trunk/plugins/guimygui/src/OgeGuiManagerMyGUI.cpp 2008-10-21 07:43:50 UTC (rev 109) @@ -247,7 +247,7 @@ { // TODO replace by return list->getItemNameAt( index ); // because next line is obsolete - return list->getItemNameAt( index ); + return list->getItem( index ); } } } Modified: oge/trunk/utilities/build/cmake/CMakeLists.txt =================================================================== --- oge/trunk/utilities/build/cmake/CMakeLists.txt 2008-10-20 12:58:05 UTC (rev 108) +++ oge/trunk/utilities/build/cmake/CMakeLists.txt 2008-10-21 07:43:50 UTC (rev 109) @@ -45,10 +45,7 @@ ${Current_dir}/filesystem/zip/OgeZipArchive.cpp ${Current_dir}/filesystem/zip/OgeZipFile.cpp ${Current_dir}/filesystem/zip/OgeZipStream.cpp -${Current_dir}/hardware/OgeCPUExtendedInfoAMD.cpp -${Current_dir}/hardware/OgeCPUExtendedInfoIntel.cpp -${Current_dir}/hardware/OgeCPUID.cpp -${Current_dir}/hardware/OgeCPUInfo.cpp +${Current_dir}/hardware/OgeCPUIDetect.cpp ${Current_dir}/logging/OgeConsoleLogger.cpp ${Current_dir}/logging/OgeHtmlLogger.cpp ${Current_dir}/logging/OgeLogger.cpp Modified: oge/trunk/utilities/build/vc80/Utilities.vcproj =================================================================== --- oge/trunk/utilities/build/vc80/Utilities.vcproj 2008-10-20 12:58:05 UTC (rev 108) +++ oge/trunk/utilities/build/vc80/Utilities.vcproj 2008-10-21 07:43:50 UTC (rev 109) @@ -629,34 +629,14 @@ Name="Hardware" > <File - RelativePath="..\..\src\hardware\OgeCPUExtendedInfoAMD.cpp" + RelativePath="..\..\src\hardware\OgeCPUDetect.cpp" > </File> <File - RelativePath="..\..\include\oge\hardware\OgeCPUExtendedInfoAMD.h" + RelativePath="..\..\include\oge\hardware\OgeCPUDetect.h" > </File> <File - RelativePath="..\..\src\hardware\OgeCPUExtendedInfoIntel.cpp" - > - </File> - <File - RelativePath="..\..\include\oge\hardware\OgeCPUExtendedInfoIntel.h" - > - </File> - <File - RelativePath="..\..\src\hardware\OgeCPUID.cpp" - > - </File> - <File - RelativePath="..\..\include\oge\hardware\OgeCPUID.h" - > - </File> - <File - RelativePath="..\..\src\hardware\OgeCPUInfo.cpp" - > - </File> - <File RelativePath="..\..\include\oge\hardware\OgeCPUInfo.h" > </File> Modified: oge/trunk/utilities/include/oge/hardware/OgeCPUDetect.h =================================================================== --- oge/trunk/utilities/include/oge/hardware/OgeCPUDetect.h 2008-10-20 12:58:05 UTC (rev 108) +++ oge/trunk/utilities/include/oge/hardware/OgeCPUDetect.h 2008-10-21 07:43:50 UTC (rev 109) @@ -103,4 +103,4 @@ }; } -#endif \ No newline at end of file +#endif Modified: oge/trunk/utilities/src/hardware/OgeCPUDetect.cpp =================================================================== --- oge/trunk/utilities/src/hardware/OgeCPUDetect.cpp 2008-10-20 12:58:05 UTC (rev 108) +++ oge/trunk/utilities/src/hardware/OgeCPUDetect.cpp 2008-10-21 07:43:50 UTC (rev 109) @@ -473,4 +473,4 @@ return count; } //------------------------------------------------------------------------- -} \ No newline at end of file +} Modified: oge/trunk/utilities/src/plugin/OgePluginManager.cpp =================================================================== --- oge/trunk/utilities/src/plugin/OgePluginManager.cpp 2008-10-20 12:58:05 UTC (rev 108) +++ oge/trunk/utilities/src/plugin/OgePluginManager.cpp 2008-10-21 07:43:50 UTC (rev 109) @@ -108,7 +108,8 @@ return false; } #else - std::string plugin = filename; + std::string plugin("lib"); + plugin += filename; plugin += OGE_PLUGIN_EXTENSION; void* hDll = ::dlopen(plugin.c_str(), RTLD_NOW); if (!hDll) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <c_...@us...> - 2008-10-20 12:58:13
|
Revision: 108 http://oge.svn.sourceforge.net/oge/?rev=108&view=rev Author: c_j Date: 2008-10-20 12:58:05 +0000 (Mon, 20 Oct 2008) Log Message: ----------- 2008/10/20 - SVN TRUNK v0.3.76 Utilities - Rewritten CPU Detection code, detects the number of packages/cores/logical processors as well as if it is hyper-threaded Core - EngineManager now takes the logical processor count as the number of threads it creates - EngineManager logs the processor information - 7 files deleted, 2 files added Modified Paths: -------------- oge/trunk/core/src/engine/OgeEngineManager.cpp oge/trunk/utilities/build/vc90/Utilities.vcproj oge/trunk/utilities/include/oge/OgeUtilitiesPrerequisites.h oge/trunk/utilities/include/oge/hardware/OgeCPUInfo.h Added Paths: ----------- oge/trunk/utilities/include/oge/hardware/OgeCPUDetect.h oge/trunk/utilities/src/hardware/OgeCPUDetect.cpp Removed Paths: ------------- oge/trunk/utilities/include/oge/hardware/OgeCPUExtendedInfoAMD.h oge/trunk/utilities/include/oge/hardware/OgeCPUExtendedInfoIntel.h oge/trunk/utilities/include/oge/hardware/OgeCPUID.h oge/trunk/utilities/src/hardware/OgeCPUExtendedInfoAMD.cpp oge/trunk/utilities/src/hardware/OgeCPUExtendedInfoIntel.cpp oge/trunk/utilities/src/hardware/OgeCPUID.cpp oge/trunk/utilities/src/hardware/OgeCPUInfo.cpp Modified: oge/trunk/core/src/engine/OgeEngineManager.cpp =================================================================== --- oge/trunk/core/src/engine/OgeEngineManager.cpp 2008-10-19 08:27:59 UTC (rev 107) +++ oge/trunk/core/src/engine/OgeEngineManager.cpp 2008-10-20 12:58:05 UTC (rev 108) @@ -52,6 +52,7 @@ #include "oge/game/OgeGameManager.h" #include "oge/object/OgeObjectManager.h" #include "oge/logging/OgeLogManager.h" +#include "oge/hardware/OgeCPUDetect.h" #include "oge/hardware/OgeCPUInfo.h" #include "zzip/zzip.h" @@ -365,16 +366,28 @@ // explicit settings if (settings.getAutoDetect()) { - // TODO: Improve taking into account packages/cores/logical/HT etc - CPUInfoCollector collector; - CPUInfo cpuCaps = collector.retrieveInformation(); - threadCount = cpuCaps.getLogicalProcessorCount(); - if (threadCount == 0) - { - threadCount = 1; - LOGE("Error detecting the number of logical processors, " - "defaulting to 1 thread"); - } + CPUInfo info = CPUDetect::getCPUInfo(); + + String message = "CPU Information: "; + if (info.packageCount > 1) { message += "Multi-Package; "; } + + if ((info.coreCount / info.packageCount) > 1) + message += "Multi-Core; "; + else + message += "Single-Core; "; + + if (info.HT) { message += "Hyper-Threaded; "; } + + message += "(p: " + StringUtil::toString(info.packageCount) + + ", c: " + StringUtil::toString(info.coreCount) + + ", l: " + StringUtil::toString(info.logicalCount) + ")"; + + LOGD(message) + + // TODO: Use these values better + threadCount = info.logicalCount; + + LOGD("Thread Count: " + StringUtil::toString(threadCount)) } else { Modified: oge/trunk/utilities/build/vc90/Utilities.vcproj =================================================================== --- oge/trunk/utilities/build/vc90/Utilities.vcproj 2008-10-19 08:27:59 UTC (rev 107) +++ oge/trunk/utilities/build/vc90/Utilities.vcproj 2008-10-20 12:58:05 UTC (rev 108) @@ -656,34 +656,14 @@ Name="Hardware Detection" > <File - RelativePath="..\..\src\hardware\OgeCPUExtendedInfoAMD.cpp" + RelativePath="..\..\src\hardware\OgeCPUDetect.cpp" > </File> <File - RelativePath="..\..\include\oge\hardware\OgeCPUExtendedInfoAMD.h" + RelativePath="..\..\include\oge\hardware\OgeCPUDetect.h" > </File> <File - RelativePath="..\..\src\hardware\OgeCPUExtendedInfoIntel.cpp" - > - </File> - <File - RelativePath="..\..\include\oge\hardware\OgeCPUExtendedInfoIntel.h" - > - </File> - <File - RelativePath="..\..\src\hardware\OgeCPUID.cpp" - > - </File> - <File - RelativePath="..\..\include\oge\hardware\OgeCPUID.h" - > - </File> - <File - RelativePath="..\..\src\hardware\OgeCPUInfo.cpp" - > - </File> - <File RelativePath="..\..\include\oge\hardware\OgeCPUInfo.h" > </File> Modified: oge/trunk/utilities/include/oge/OgeUtilitiesPrerequisites.h =================================================================== --- oge/trunk/utilities/include/oge/OgeUtilitiesPrerequisites.h 2008-10-19 08:27:59 UTC (rev 107) +++ oge/trunk/utilities/include/oge/OgeUtilitiesPrerequisites.h 2008-10-20 12:58:05 UTC (rev 108) @@ -50,6 +50,12 @@ #define OGE_COMPILER_GNUC 2 #define OGE_COMPILER_MSVC 3 +#define OGE_COMPILER_MSVC_6 1200 // Not supported +#define OGE_COMPILER_MSVC_7 1310 // Not supported +#define OGE_COMPILER_MSVC_71 1300 +#define OGE_COMPILER_MSVC_8 1400 +#define OGE_COMPILER_MSVC_9 1500 + #define OGE_ENDIAN_BIG 1 #define OGE_ENDIAN_LITTLE 2 @@ -74,6 +80,13 @@ # pragma error "Sorry, compiler not supported -> Aborting!" #endif +// 32 or 64 architecture +#if defined(_M_X64) || defined(__x86_64__) +# define OGE_ARCHITECTURE OGE_ARCHITECTURE_64 +#else +# define OGE_ARCHITECTURE OGE_ARCHITECTURE_32 +#endif + #ifdef _MSC_VER # pragma warning (disable : 4251) // dll interface to be used by clients... Added: oge/trunk/utilities/include/oge/hardware/OgeCPUDetect.h =================================================================== --- oge/trunk/utilities/include/oge/hardware/OgeCPUDetect.h (rev 0) +++ oge/trunk/utilities/include/oge/hardware/OgeCPUDetect.h 2008-10-20 12:58:05 UTC (rev 108) @@ -0,0 +1,106 @@ +/* +----------------------------------------------------------------------------- +This source file is part of OGE (Open Game Engine) +For the latest info, see http://sourceforge.net/projects/oge + +Copyright (c) 2006-2008 The OGE Team +Also see acknowledgements in Readme.html + +This program is distributed under a dual-licensing scheme: + +1. The first license, which is the default one, state that this software + is free software; you can redistribute it and/or modify it under the terms + of the GNU Lesser General Public License (LGPL) as published by the + Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + +2. The second license, which is not free, apply only for licensee who got + a written agreement from the 'OGE Team'. The exact wording of this + license can be obtained from the 'OGE Team'. In essence this + OGE Unrestricted License state that the GNU Lesser General Public License + applies except that the software is distributed with no limitation or + requirements to publish or give back to the OGE Team changes made + to the OGE source code. + +By default, the first type of license applies (the GNU LGPL), the OGE +Unrestricted License apply only for those who got a written agreement +from the OGE Team. + +Under both licenses, 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 Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser 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, or go to +http://www.gnu.org/copyleft/lesser.txt. +For the OGE Unrestricted License contact the OGE Team. +----------------------------------------------------------------------------- +*/ +#ifndef __OGE_CPUID_H__ +#define __OGE_CPUID_H__ + +#include "oge/OgeUtilitiesPrerequisites.h" +#include "oge/hardware/OgeCPUInfo.h" +#include "oge/OgeString.h" + +// TODO: Add Mac Support (may be the same as Linux) + +#if OGE_COMPILER == OGE_COMPILER_MSVC +# include <intrin.h> +#endif + +#if OGE_PLATFORM == OGE_PLATFORM_LINUX +# include <sched.h> +#endif + +namespace oge +{ + struct CPURegister + { + private: + int reg; + public: + inline CPURegister(int value = 0) : reg(value) {} + inline int operator[](int bits) const { return (reg & (1 << bits)); } + inline void set(int value) { reg = value; } + inline int get() const { return reg; } + }; + + struct CPUIDResult + { + bool valid; + CPURegister eax, ebx, ecx, edx; + inline CPUIDResult(bool v = true) : valid(v) {} + inline CPUIDResult(int registers[4], bool v = true) : valid(v), + eax(registers[0]), ebx(registers[1]), ecx(registers[2]), + edx(registers[3]) { } + }; + + class OGE_UTIL_API CPUDetect + { + private: + enum CPUID { CPUID_HT = (1 << 28) }; + public: + static bool isCPUIDSupported(); + static CPUIDResult cpuid(int func, bool useECX = false, int ecx = 0); + static int getMaxCPUIDFunc(); + static const String& getVendorID(); + static bool isMultithreaded(); + static const CPUInfo& getCPUInfo(); + private: + static bool _isCPUIDSupported(); + static String _getVendorID(); + static bool _isMultithreaded(); + static CPUInfo _getCPUInfo(); + static bool _fillProcCountsPrimary(CPUInfo& info); + static bool _fillProcCountsSecondary(CPUInfo& info); + static size_t _detectLogicalPerCore(); + static size_t _detectLogicalProcessorCount(); + static UInt32 _utilCountSetBits(UInt64 value); + static int _getMaxCPUIDFunc(); + }; +} + +#endif \ No newline at end of file Property changes on: oge/trunk/utilities/include/oge/hardware/OgeCPUDetect.h ___________________________________________________________________ Added: svn:eol-style + native Deleted: oge/trunk/utilities/include/oge/hardware/OgeCPUExtendedInfoAMD.h =================================================================== --- oge/trunk/utilities/include/oge/hardware/OgeCPUExtendedInfoAMD.h 2008-10-19 08:27:59 UTC (rev 107) +++ oge/trunk/utilities/include/oge/hardware/OgeCPUExtendedInfoAMD.h 2008-10-20 12:58:05 UTC (rev 108) @@ -1,87 +0,0 @@ -/* ------------------------------------------------------------------------------ -This source file is part of OGE (Open Game Engine) -For the latest info, see http://sourceforge.net/projects/oge - -Copyright (c) 2006-2008 The OGE Team -Also see acknowledgements in Readme.html - -This program is distributed under a dual-licensing scheme: - -1. The first license, which is the default one, state that this software - is free software; you can redistribute it and/or modify it under the terms - of the GNU Lesser General Public License (LGPL) as published by the - Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - -2. The second license, which is not free, apply only for licensee who got - a written agreement from the 'OGE Team'. The exact wording of this - license can be obtained from the 'OGE Team'. In essence this - OGE Unrestricted License state that the GNU Lesser General Public License - applies except that the software is distributed with no limitation or - requirements to publish or give back to the OGE Team changes made - to the OGE source code. - -By default, the first type of license applies (the GNU LGPL), the OGE -Unrestricted License apply only for those who got a written agreement -from the OGE Team. - -Under both licenses, 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 Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser 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, or go to -http://www.gnu.org/copyleft/lesser.txt. -For the OGE Unrestricted License contact the OGE Team. ------------------------------------------------------------------------------ -*/ -#ifndef __OGE_CPUEXTENDEDINFOAMD_H__ -#define __OGE_CPUEXTENDEDINFOAMD_H__ - -#include "oge/OgeUtilitiesPrerequisites.h" -#include "oge/hardware/OgeCPUInfo.h" -#include "oge/OgeString.h" - -namespace oge -{ - /** - * Implementation of CPUExtendedInfo for AMD processors (* Experimental) - * - * (* Experimental) : This has not yet been fully tested - */ - class OGE_UTIL_API CPUExtendedInfoAMD : public CPUExtendedInfo - { - public: - enum BitMask - { - MASK_MT_BIT = 0x10000000, - MASK_LOGICAL_BITS = 0x00FF0000, - MASK_INITIAL_APIC_ID_BITS = 0xFF000000 - }; - public: - bool getInformation(String& brand, CPUInfo::Type& type, bool& ht, - CPUInfo::ProcessorID::Vector& processors, - CPUInfo::ProcessorIndex::Vector& processorsIndex); - protected: - int getMaxCPUIDValue(); - String getBrand(); - bool hasHardwareMT(); - unsigned int getMaxCoresPerPackage(); - unsigned int getMaxLogicalPerPackage(); - unsigned char getAPICID(); - unsigned char getCoreIDWidth(); - bool getProcessorIDs(CPUInfo::ProcessorID::Vector& processors, - CPUInfo::ProcessorIndex::Vector& processorsIndex, - unsigned int& coreCount, unsigned int& logicalCount); - void addProcessorID(CPUInfo::ProcessorID::Vector& processors, - CPUInfo::ProcessorIndex::Vector& processorsIndex, - unsigned int& coreCount, unsigned int packageID, - unsigned int coreID, unsigned char APICID, - unsigned int affinityMask); - }; -} - -#endif // __OGE_CPUEXTENDEDINFOAMD_H__ Deleted: oge/trunk/utilities/include/oge/hardware/OgeCPUExtendedInfoIntel.h =================================================================== --- oge/trunk/utilities/include/oge/hardware/OgeCPUExtendedInfoIntel.h 2008-10-19 08:27:59 UTC (rev 107) +++ oge/trunk/utilities/include/oge/hardware/OgeCPUExtendedInfoIntel.h 2008-10-20 12:58:05 UTC (rev 108) @@ -1,89 +0,0 @@ -/* ------------------------------------------------------------------------------ -This source file is part of OGE (Open Game Engine) -For the latest info, see http://sourceforge.net/projects/oge - -Copyright (c) 2006-2008 The OGE Team -Also see acknowledgements in Readme.html - -This program is distributed under a dual-licensing scheme: - -1. The first license, which is the default one, state that this software - is free software; you can redistribute it and/or modify it under the terms - of the GNU Lesser General Public License (LGPL) as published by the - Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - -2. The second license, which is not free, apply only for licensee who got - a written agreement from the 'OGE Team'. The exact wording of this - license can be obtained from the 'OGE Team'. In essence this - OGE Unrestricted License state that the GNU Lesser General Public License - applies except that the software is distributed with no limitation or - requirements to publish or give back to the OGE Team changes made - to the OGE source code. - -By default, the first type of license applies (the GNU LGPL), the OGE -Unrestricted License apply only for those who got a written agreement -from the OGE Team. - -Under both licenses, 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 Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser 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, or go to -http://www.gnu.org/copyleft/lesser.txt. -For the OGE Unrestricted License contact the OGE Team. ------------------------------------------------------------------------------ -*/ -#ifndef __OGE_CPUEXTENDEDINFOINTEL_H__ -#define __OGE_CPUEXTENDEDINFOINTEL_H__ - -#include "oge/OgeUtilitiesPrerequisites.h" -#include "oge/hardware/OgeCPUInfo.h" - -namespace oge -{ - /** - * Implementation of CPUExtendedInfo for Intel processors - * - * This has had some testing - */ - class OGE_UTIL_API CPUExtendedInfoIntel : public CPUExtendedInfo - { - public: - enum BitMask - { - MASK_MT_BIT = 0x10000000, - MASK_CORE_BITS = 0xFC000000, - MASK_LOGICAL_BITS = 0x00FF0000, - MASK_INITIAL_APIC_ID_BITS = 0xFF000000 - }; - public: - bool getInformation(String& brand, CPUInfo::Type& type, bool& ht, - CPUInfo::ProcessorID::Vector& processors, - CPUInfo::ProcessorIndex::Vector& processorsIndex); - protected: - int getMaxCPUIDValue(); - String getBrand(); - bool hasHardwareMT(); - unsigned int getMaxCoresPerPackage(); - unsigned int getMaxLogicalPerPackage(); - unsigned char getAPICID(); - unsigned int getMaskWidth(unsigned int countItem); - unsigned char getSMTID(unsigned char fullID, - unsigned char maxSubIDValue, unsigned char shiftCount); - bool getProcessorIDs(CPUInfo::ProcessorID::Vector& processors, - CPUInfo::ProcessorIndex::Vector& processorsIndex, - unsigned int& coreCount, unsigned int& logicalCount); - void addProcessorID(CPUInfo::ProcessorID::Vector& processors, - CPUInfo::ProcessorIndex::Vector& processorsIndex, - unsigned int& coreCount, unsigned int& logicalCount, - unsigned int packageID, unsigned int coreID,unsigned int logicalID, - unsigned char APICID, unsigned int affinityMask); - }; -} - -#endif // __OGE_CPUEXTENDEDINFOINTEL_H__ Deleted: oge/trunk/utilities/include/oge/hardware/OgeCPUID.h =================================================================== --- oge/trunk/utilities/include/oge/hardware/OgeCPUID.h 2008-10-19 08:27:59 UTC (rev 107) +++ oge/trunk/utilities/include/oge/hardware/OgeCPUID.h 2008-10-20 12:58:05 UTC (rev 108) @@ -1,71 +0,0 @@ -/* ------------------------------------------------------------------------------ -This source file is part of OGE (Open Game Engine) -For the latest info, see http://sourceforge.net/projects/oge - -Copyright (c) 2006-2008 The OGE Team -Also see acknowledgements in Readme.html - -This program is distributed under a dual-licensing scheme: - -1. The first license, which is the default one, state that this software - is free software; you can redistribute it and/or modify it under the terms - of the GNU Lesser General Public License (LGPL) as published by the - Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - -2. The second license, which is not free, apply only for licensee who got - a written agreement from the 'OGE Team'. The exact wording of this - license can be obtained from the 'OGE Team'. In essence this - OGE Unrestricted License state that the GNU Lesser General Public License - applies except that the software is distributed with no limitation or - requirements to publish or give back to the OGE Team changes made - to the OGE source code. - -By default, the first type of license applies (the GNU LGPL), the OGE -Unrestricted License apply only for those who got a written agreement -from the OGE Team. - -Under both licenses, 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 Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser 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, or go to -http://www.gnu.org/copyleft/lesser.txt. -For the OGE Unrestricted License contact the OGE Team. ------------------------------------------------------------------------------ -*/ -#ifndef __OGE_CPUID_H__ -#define __OGE_CPUID_H__ - -#include "oge/OgeUtilitiesPrerequisites.h" - -// TODO: Add Mac Support (may be the same as Linux) - -#if OGE_COMPILER == OGE_COMPILER_MSVC -#include <intrin.h> -#endif - -#if OGE_PLATFORM == OGE_PLATFORM_WIN32 -#include <Windows.h> - -void OGE_UTIL_API ogeAsmCPUID(int* reg); - -#elif OGE_PLATFORM == OGE_PLATFORM_LINUX -#include <sched.h> - -#define ogeAsmCPUID(reg) \ - __asm__ __volatile__ ("cpuid": \ - "=a" (reg[0]), "=r" (reg[1]), "=c" (reg[2]), "=d" (reg[3]) : \ - "a" (reg[0]), "r" (reg[1]), "c" (reg[2]), "d" (reg[3])); - -#define __cpuid(reg, func) \ - reg[0] = func; \ - ogeAsmCPUID(reg); -#endif - -#endif // __OGE_CPUID_H__ - Modified: oge/trunk/utilities/include/oge/hardware/OgeCPUInfo.h =================================================================== --- oge/trunk/utilities/include/oge/hardware/OgeCPUInfo.h 2008-10-19 08:27:59 UTC (rev 107) +++ oge/trunk/utilities/include/oge/hardware/OgeCPUInfo.h 2008-10-20 12:58:05 UTC (rev 108) @@ -46,128 +46,24 @@ namespace oge { - /** - * Contains information about a CPU. - * - * This is given by the CPUInfoCollector once it has set the values - * taken from the CPU it's running on. - */ - class CPUInfo - { - public: - enum Vendor { VENDOR_UNKNOWN = 0, VENDOR_INTEL, VENDOR_AMD }; - enum Type { TYPE_UNKNOWN = 0, TYPE_SINGLE_CORE, TYPE_MULTI_CORE }; - - struct ProcessorIndex - { - typedef std::vector<ProcessorIndex> Vector; - unsigned int package, core, logical; - ProcessorIndex(unsigned int p, unsigned int c, unsigned int l) : - package(p), core(c), logical(l) { } - }; - struct LogicalID - { - typedef std::vector<LogicalID> Vector; - unsigned char ID; - unsigned int affinityMask; - unsigned char APICID; - LogicalID(unsigned char id, unsigned int affinity, - unsigned char apicId) : ID(id), affinityMask(affinity), - APICID(apicId) { } - }; - struct CoreID - { - typedef std::vector<CoreID> Vector; - unsigned char ID; - LogicalID::Vector logicalProcessors; - CoreID(unsigned char id) : ID(id) {} - }; - struct ProcessorID - { - typedef std::vector<ProcessorID> Vector; - unsigned char ID; - CoreID::Vector cores; - ProcessorID(unsigned char id) : ID(id) {} - }; - - private: - Vendor mVendor; - String mBrand; - Type mType; - size_t mPackageCount, mCoreCount, mLogicalCount; - bool mHT; - ProcessorID::Vector mProcessors; - ProcessorIndex::Vector mProcessorsIndex; - public: - CPUInfo(Vendor vendor = VENDOR_UNKNOWN, bool defaultProcessors = true) : - mVendor(VENDOR_UNKNOWN), mBrand("Unknown"), mType(TYPE_SINGLE_CORE), - mPackageCount(1), mCoreCount(1), mLogicalCount(1), mHT(false) - { - if (!defaultProcessors) - return; + struct CPUInfo + { + enum DetectMethod { DM_PRIMARY = 0, DM_SECONDARY, DM_FAIL }; - ProcessorID processor(0); - CoreID core(0); - LogicalID logical(0, 1, 1); - - core.logicalProcessors.push_back(logical); - processor.cores.push_back(core); - mProcessors.push_back(processor); + String vendor; + String name; + size_t packageCount; + size_t coreCount; + size_t logicalCount; + bool HT; + DetectMethod cpuDetectMethod; - mProcessorsIndex.push_back(ProcessorIndex(0, 0, 0)); - } - CPUInfo(Vendor vendor, const String& brand, Type type, - size_t packageCount, size_t coreCount, size_t logicalCount, bool ht, - ProcessorID::Vector& processors, ProcessorIndex::Vector& index) : - mVendor(vendor), mBrand(brand), mType(type), - mPackageCount(packageCount), mCoreCount(coreCount), - mLogicalCount(logicalCount), mHT(ht), mProcessors(processors), - mProcessorsIndex(index) + CPUInfo() : vendor("Unknown"), name("Unknown"), packageCount(1), + coreCount(1), logicalCount(1), HT(false), cpuDetectMethod(DM_FAIL) { - + } - Vendor getVendor() const { return mVendor; } - const String& getBrand() const { return mBrand; } - Type getType() const { return mType; } - size_t getPackageCount() const { return mPackageCount; } - size_t getCoreCount() const { return mCoreCount; } - size_t getLogicalProcessorCount() const { return mLogicalCount; } - bool getHyperThreading() const { return mHT; } - const ProcessorID::Vector& getProcessors() const { return mProcessors; } - const ProcessorIndex::Vector& getProcessorsIndex() const - { - return mProcessorsIndex; - } }; - - /** - * Each vendor extends this class to provide extended information - * about this processor. - */ - class CPUExtendedInfo - { - public: - virtual ~CPUExtendedInfo() {} - virtual bool getInformation(String& brand, CPUInfo::Type& type, - bool& ht, CPUInfo::ProcessorID::Vector& processors, - CPUInfo::ProcessorIndex::Vector& processorsIndex) = 0; - }; - - /** - * Retrieves basic CPU information and gets extended information from - * a specific CPUExtendedInfo implementation depending on the vendor - * - * Currently supports x86 instruction set only - */ - class OGE_UTIL_API CPUInfoCollector - { - public: - CPUInfo retrieveInformation(); - protected: - bool isCPUIDSupported(); - int getMaxCPUIDValue(); - CPUInfo::Vendor getVendor(); - }; } #endif // __OGE_CPUINFO_H__ Copied: oge/trunk/utilities/src/hardware/OgeCPUDetect.cpp (from rev 105, oge/trunk/utilities/src/hardware/OgeCPUID.cpp) =================================================================== --- oge/trunk/utilities/src/hardware/OgeCPUDetect.cpp (rev 0) +++ oge/trunk/utilities/src/hardware/OgeCPUDetect.cpp 2008-10-20 12:58:05 UTC (rev 108) @@ -0,0 +1,476 @@ +/* +----------------------------------------------------------------------------- +This source file is part of OGE (Open Game Engine) +For the latest info, see http://sourceforge.net/projects/oge + +Copyright (c) 2006-2008 The OGE Team +Also see acknowledgements in Readme.html + +This program is distributed under a dual-licensing scheme: + +1. The first license, which is the default one, state that this software + is free software; you can redistribute it and/or modify it under the terms + of the GNU Lesser General Public License (LGPL) as published by the + Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + +2. The second license, which is not free, apply only for licensee who got + a written agreement from the 'OGE Team'. The exact wording of this + license can be obtained from the 'OGE Team'. In essence this + OGE Unrestricted License state that the GNU Lesser General Public License + applies except that the software is distributed with no limitation or + requirements to publish or give back to the OGE Team changes made + to the OGE source code. + +By default, the first type of license applies (the GNU LGPL), the OGE +Unrestricted License apply only for those who got a written agreement +from the OGE Team. + +Under both licenses, 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 Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser 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, or go to +http://www.gnu.org/copyleft/lesser.txt. +For the OGE Unrestricted License contact the OGE Team. +----------------------------------------------------------------------------- +*/ +#include "oge/hardware/OgeCPUDetect.h" + +namespace oge +{ + //------------------------------------------------------------------------- + bool CPUDetect::isCPUIDSupported() + { + static bool supported = _isCPUIDSupported(); + return supported; + } + //------------------------------------------------------------------------- + bool CPUDetect::_isCPUIDSupported() + { +#if OGE_ARCHITECTURE == OGE_ARCHITECTURE_64 + return true; // All x86/64, 64bit CPU's support CPUID +#else + oge::UInt32 originalEFLAGS = 0; + oge::UInt32 modifiedEFLAGS = 0; + +# if OGE_COMPILER == OGE_COMPILER_MSVC + // If bit 21 of the EFLAGS register can be written to, + // CPUID is supported + __asm + { + // Make a copy of the EFLAGS register onto the stack + pushfd + // Pop EFLAGS from the stack into EAX + pop eax + // EAX is to be modified, ECX is to compare EAX against + mov ecx, eax + // Invert bit 21 + xor eax, 0x200000 + // Push EAX back onto the stack + push eax + // Write to the EFLAGS register with the value popped from the stack + popfd + // Make another copy of EFLAGS register to compare against ECX + pushfd + // Copy EFLAGS from the stack into EAX + pop eax + // Copy the original and modified values for EFLAGS + mov originalEFLAGS, ecx + mov modifiedEFLAGS, eax + // Push the original EFLAGS value onto the stack + push ecx + // Write to EFLAGS with the value from the stack + popfd + } +#elif OGE_COMPILER == OGE_COMPILER_GNUC + // Same as the MSVC version but for GNUC + __asm__ + ( + "pushfl \n\t" + "pop %0 \n\t" + "mov %0, %1 \n\t" + "xor %2, %0 \n\t" + "push %0 \n\t" + "popfl \n\t" + "pushfl \n\t" + "pop %0 \n\t" + "push %1 \n\t" + "popfl \n\t" + : "=r" (originalEFLAGS), "=r" (modifiedEFLAGS) + : "n" (0x200000) + ); +# endif // Compiler Dependent Code + // If the two are different, CPUID is supported + return originalEFLAGS != modifiedEFLAGS; +#endif // 32 bit architecture + } + //------------------------------------------------------------------------- + CPUIDResult CPUDetect::cpuid(int func, bool useECX, int ecxInput) + { +#if OGE_COMPILER == OGE_COMPILER_MSVC + // VC8 and above has __cpuid, VC9 has __cpuidex + #if OGE_COMP_VER >= OGE_COMPILER_MSVC_9 + int reg[4] = {0}; + if (useECX) + { + __cpuidex(reg, func, ecxInput); + } + else + { + __cpuid(reg, func); + } + + return CPUIDResult(reg); + #elif OGE_COMP_VER == OGE_COMPILER_MSVC_8 && OGE_ARCHITECTURE == OGE_ARCHITECTURE_64 + // 64 bit VC8 only supports basic __cpuid intrinsic + if (useECX) + return CPUIDResult(false); + + int reg[4] = {0}; + __cpuid(reg, func); + return CPUIDResult(reg); + #elif OGE_ARCHITECTURE == OGE_ARCHITECTURE_32 + int tempA, tempB, tempC, tempD; + __asm + { + mov eax, func + mov ebx, 0 + mov ecx, ecxInput + mov edx, 0 + cpuid + mov tempA, eax + mov tempB, ebx + mov tempC, edx + mov tempD, ecx + } + + int reg[4] = {tempA, tempB, tempC, tempD}; + return CPUIDResult(reg); + #else + // No corresponding cpuid operation available + return CPUIDResult(false); + #endif +#elif OGE_COMPILER == OGE_COMPILER_GNUC + int tempA, tempB, tempC, tempD; + __asm__ __volatile__ + ( + "cpuid" + : "=a" (tempA), "=b" (tempB), "=c" (tempC), "=d" (tempD) + : "a" (func), "c" (ecxInput) + ); + int reg[4] = {tempA, tempB, tempC, tempD}; + return CPUIDResult(reg); +#else + // Compiler unsupported + return CPUIDResult(false); +#endif + } + //------------------------------------------------------------------------- + int CPUDetect::getMaxCPUIDFunc() + { + static int max = _getMaxCPUIDFunc(); + return max; + } + //------------------------------------------------------------------------- + int CPUDetect::_getMaxCPUIDFunc() + { + CPUIDResult result = cpuid(0); + if (!result.valid) + return -1; + + return result.eax.get(); + } + //------------------------------------------------------------------------- + const String& CPUDetect::getVendorID() + { + static String id = _getVendorID(); + return id; + } + //------------------------------------------------------------------------- + String CPUDetect::_getVendorID() + { + if (!isCPUIDSupported()) + return ""; + + CPUIDResult result = CPUDetect::cpuid(0); + return String((char*)&result.ebx, 4) + + String((char*)&result.edx, 4) + + String((char*)&result.ecx, 4); + } + //------------------------------------------------------------------------- + bool CPUDetect::isMultithreaded() + { + static bool mt = _isMultithreaded(); + return mt; + } + //------------------------------------------------------------------------- + bool CPUDetect::_isMultithreaded() + { + if (getVendorID() != "GenuineIntel") + return false; + + CPUIDResult result = cpuid(1); + if (!result.valid) + return false; + + return result.edx[CPUID_HT] != 0; + } + //------------------------------------------------------------------------- + const CPUInfo& CPUDetect::getCPUInfo() + { + static CPUInfo info = _getCPUInfo(); + return info; + } + //------------------------------------------------------------------------- + CPUInfo CPUDetect::_getCPUInfo() + { + CPUInfo info; + info.vendor = getVendorID(); + if (!_fillProcCountsPrimary(info) && !_fillProcCountsSecondary(info)) + { + info.packageCount = info.coreCount = info.logicalCount = 1; + info.cpuDetectMethod = CPUInfo::DM_FAIL; + } + + info.HT = info.logicalCount > info.coreCount; + + return info; + } + //------------------------------------------------------------------------- + bool CPUDetect::_fillProcCountsPrimary(CPUInfo& info) + { +#if OGE_PLATFORM == OGE_PLATFORM_WIN32 && OGE_COMPILER >= OGE_COMPILER_MSVC_9 + typedef BOOL (WINAPI *GLPIFn)( + PSYSTEM_LOGICAL_PROCESSOR_INFORMATION, PDWORD); + + GLPIFn func = (GLPIFn)GetProcAddress(GetModuleHandle(TEXT("kernel32")), + "GetLogicalProcessorInformation"); + + if (func == 0) + return false; + + bool done = false; + PSYSTEM_LOGICAL_PROCESSOR_INFORMATION buffer = NULL; + PSYSTEM_LOGICAL_PROCESSOR_INFORMATION ptr = NULL; + DWORD returnLength = 0; + DWORD byteOffset = 0; + + while(true) + { + if (func(buffer, &returnLength) == TRUE) + break; + + if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) + { + if (buffer) + free(buffer); + + buffer = (PSYSTEM_LOGICAL_PROCESSOR_INFORMATION)malloc( + returnLength); + + if (buffer == NULL) + return false; + } + else + { + return false; + } + } + + ptr = buffer; + info.packageCount = info.coreCount = info.logicalCount = 0; + + size_t sizeOfStruct = sizeof(SYSTEM_LOGICAL_PROCESSOR_INFORMATION); + while (byteOffset + sizeOfStruct <= returnLength) + { + switch (ptr->Relationship) + { + case RelationProcessorCore: + info.coreCount++; + info.logicalCount += _utilCountSetBits(ptr->ProcessorMask); + break; + case RelationProcessorPackage: + info.packageCount++; + break; + } + + byteOffset += sizeOfStruct; + ptr++; + } + + free(buffer); +#elif OGE_PLATFORM == OGE_PLATFORM_LINUX + typedef std::map<String, String> StringMap; + typedef std::map<int, StringMap> IntStringMap; + IntStringMap logicalProcessors; + + typedef std::map<int, int> IntMap; + typedef std::map<int, IntMap> IntMapMap; + IntMapMap coreIDs; + + std::ifstream file("/proc/cpuinfo"); + + if (!file.is_open()) + return false; + + const int bufSize = 512; + char buffer[bufSize] = {0}; + + int currentLogical = 0; + + while(!file.eof()) + { + file.getline(buffer, bufSize - 1, 10); + String line = buffer; + + String::size_type split = line.find("\t"); + + if (split != String::npos) + { + String name = line.substr(0, split); + + split = line.find(": "); + String value = line.substr(split + 2, line.length()); + + if (name == "processor") + { + currentLogical = atoi(value.c_str()); + if (logicalProcessors.find(currentLogical) == logicalProcessors.end()) + { + logicalProcessors[currentLogical] = StringMap(); + } + } + else + { + logicalProcessors[currentLogical][name] = value; + } + } + } + + file.close(); + + size_t packageCount = 0; + size_t coreCount = 0; + size_t logicalCount = logicalProcessors.size(); + + if (logicalCount > 1) + { + for (size_t curLogical = 0; curLogical < logicalCount; ++curLogical) + { + String coreIDStr = logicalProcessors[curLogical]["core id"]; + String packageIDStr = logicalProcessors[curLogical]["physical id"]; + + if (coreIDStr != "" && packageIDStr != "") + { + int coreID = atoi(coreIDStr.c_str()); + int packageID = atoi(packageIDStr.c_str()); + + IntMap& pID = coreIDs[packageID]; + + if (pID.find(coreID) == pID.end()) + { + pID[coreID] = 1; + } + else + { + pID[coreID]++; + } + } + } + + packageCount = coreIDs.size(); + + for (size_t index = 0; index < packageCount; ++index) + { + coreCount += coreIDs[index].size(); + } + } + else + { + packageCount = coreCount = 1; + } + + info.packageCount = packageCount; + info.coreCount = coreCount; + info.logicalCount = logicalCount; +#else + return false; +#endif + + info.cpuDetectMethod = CPUInfo::DM_PRIMARY; + return true; + } + //------------------------------------------------------------------------- + bool CPUDetect::_fillProcCountsSecondary(CPUInfo& info) + { + info.logicalCount = _detectLogicalProcessorCount(); + size_t logicalPerCore = _detectLogicalPerCore(); + + // Couldn't detect the number of logical processors + if (info.logicalCount == 0 || logicalPerCore == 0) + return false; + + info.coreCount = info.logicalCount / _detectLogicalPerCore(); + info.packageCount = 1; // TODO: How to detect this? + + info.cpuDetectMethod = CPUInfo::DM_SECONDARY; + return true; + } + //------------------------------------------------------------------------- + size_t CPUDetect::_detectLogicalProcessorCount() + { +#if OGE_PLATFORM == OGE_PLATFORM_WIN32 + SYSTEM_INFO systemInfo; + GetSystemInfo(&systemInfo); + return systemInfo.dwNumberOfProcessors; +#elif OGE_PLATFORM == OGE_PLATFORM_LINUX + return sysconf(_SC_NPROCESSORS_CONF); +#else + return 0; +#endif + } + //------------------------------------------------------------------------- + size_t CPUDetect::_detectLogicalPerCore() + { + if (getVendorID() == "GenuineIntel") + { + UInt32 MASK_CORE_BITS = 0xFC000000; + UInt32 MASK_LOGICAL_BITS = 0x00FF0000; + + if (isMultithreaded() && getMaxCPUIDFunc() < 4) + return 1; + + CPUIDResult coreResult = cpuid(4, true, 0); + CPUIDResult logicalResult = cpuid(1); + if (!coreResult.valid || !logicalResult.valid) + return 1; + + size_t maxCores = ((coreResult.eax.get() & MASK_CORE_BITS) >> 26) + 1; + size_t maxLogical = ((logicalResult.ebx.get() & MASK_LOGICAL_BITS) >> 16); + + return maxLogical / maxCores; + } + + return 1; + } + //------------------------------------------------------------------------- + UInt32 CPUDetect::_utilCountSetBits(UInt64 value) + { + UInt32 shift = sizeof(UInt64) * 8 - 1; + UInt32 count = 0; + UInt64 test = (UInt64)1 << shift; + + for (UInt32 index = 0; index <= shift; ++index) + { + count += (value & test) ? 1 : 0; + test /= 2; + } + + return count; + } + //------------------------------------------------------------------------- +} \ No newline at end of file Property changes on: oge/trunk/utilities/src/hardware/OgeCPUDetect.cpp ___________________________________________________________________ Added: svn:mergeinfo + Deleted: oge/trunk/utilities/src/hardware/OgeCPUExtendedInfoAMD.cpp =================================================================== --- oge/trunk/utilities/src/hardware/OgeCPUExtendedInfoAMD.cpp 2008-10-19 08:27:59 UTC (rev 107) +++ oge/trunk/utilities/src/hardware/OgeCPUExtendedInfoAMD.cpp 2008-10-20 12:58:05 UTC (rev 108) @@ -1,320 +0,0 @@ -/* ------------------------------------------------------------------------------ -This source file is part of OGE (Open Game Engine) -For the latest info, see http://sourceforge.net/projects/oge - -Copyright (c) 2006-2008 The OGE Team -Also see acknowledgements in Readme.html - -This program is distributed under a dual-licensing scheme: - -1. The first license, which is the default one, state that this software - is free software; you can redistribute it and/or modify it under the terms - of the GNU Lesser General Public License (LGPL) as published by the - Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - -2. The second license, which is not free, apply only for licensee who got - a written agreement from the 'OGE Team'. The exact wording of this - license can be obtained from the 'OGE Team'. In essence this - OGE Unrestricted License state that the GNU Lesser General Public License - applies except that the software is distributed with no limitation or - requirements to publish or give back to the OGE Team changes made - to the OGE source code. - -By default, the first type of license applies (the GNU LGPL), the OGE -Unrestricted License apply only for those who got a written agreement -from the OGE Team. - -Under both licenses, 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 Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser 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, or go to -http://www.gnu.org/copyleft/lesser.txt. -For the OGE Unrestricted License contact the OGE Team. ------------------------------------------------------------------------------ -*/ -#include "oge/hardware/OgeCPUExtendedInfoAMD.h" -#include "oge/hardware/OgeCPUID.h" - -namespace oge -{ - //------------------------------------------------------------------------- - bool CPUExtendedInfoAMD::getInformation(String& brand, - CPUInfo::Type& type, bool& ht, CPUInfo::ProcessorID::Vector& processors, - CPUInfo::ProcessorIndex::Vector& processorsIndex) - { - ht = false; - brand = getBrand(); - - unsigned int coreCount = 0; - unsigned int logicalCount = 0; - - if (!getProcessorIDs(processors, processorsIndex, coreCount, - logicalCount)) - { - type = CPUInfo::TYPE_SINGLE_CORE; - return false; - } - - if (((float)coreCount / (float)processors.size()) > 1) - { - type = CPUInfo::TYPE_MULTI_CORE; - } - else - { - type = CPUInfo::TYPE_SINGLE_CORE; - } - - return true; - } - //------------------------------------------------------------------------- - int CPUExtendedInfoAMD::getMaxCPUIDValue() - { - int reg[4]; - - __cpuid(reg, 0); - - return reg[0]; - } - //------------------------------------------------------------------------- - String CPUExtendedInfoAMD::getBrand() - { - int reg[4]; - - __cpuid(reg, 0x80000000); - - bool extendedSupported = (reg[0] & 0x80000000) != 0; - - // Is brand string supported? - if (extendedSupported && (unsigned) reg[0] >= 0x80000004) - { - String brand; - - for (int index = 0; index < 3; ++index) - { - __cpuid(reg, 0x80000002 + index); - - char name[17]; - memcpy(&name, ®[0], 4); - memcpy(&name[4], ®[1], 4); - memcpy(&name[8], ®[2], 4); - memcpy(&name[12], ®[3], 4); - name[16] = '\0'; - - brand += name; - } - - return brand; - } - else - { - return "Unknown"; - } - } - //------------------------------------------------------------------------- - bool CPUExtendedInfoAMD::hasHardwareMT() - { - int reg[4]; - - __cpuid(reg, 1); - - return (reg[3] & MASK_MT_BIT) != 0; - } - //------------------------------------------------------------------------- - unsigned int CPUExtendedInfoAMD::getMaxCoresPerPackage() - { - if (!hasHardwareMT()) - return 1; - - unsigned char coreIDWidth = getCoreIDWidth(); - if (!coreIDWidth) - { - int reg[4] = {0, 0, 0, 0}; - __cpuid(reg, 80000008); - return (unsigned char)reg[2]; - } - - return 2 ^ coreIDWidth; - } - //------------------------------------------------------------------------- - unsigned int CPUExtendedInfoAMD::getMaxLogicalPerPackage() - { - if (!hasHardwareMT()) - return 1; - - int reg[4]; - __cpuid(reg, 1); - - return ((reg[1] & MASK_LOGICAL_BITS) >> 16); - } - //------------------------------------------------------------------------- - unsigned char CPUExtendedInfoAMD::getAPICID() - { - int reg[4]; - __cpuid(reg, 1); - - return (reg[1] & MASK_INITIAL_APIC_ID_BITS) >> 24; - } - //------------------------------------------------------------------------- - unsigned char CPUExtendedInfoAMD::getCoreIDWidth() - { - int reg[4] = {0, 0, 0, 0}; - - __cpuid(reg, 80000008); - - return (unsigned char)(reg[2] & 0x0000F000); - } - //------------------------------------------------------------------------- - bool CPUExtendedInfoAMD::getProcessorIDs( - CPUInfo::ProcessorID::Vector& processors, - CPUInfo::ProcessorIndex::Vector& processorsIndex, - unsigned int& coreCount, unsigned int& logicalCount) - { - -#if OGE_PLATFORM == OGE_PLATFORM_WIN32 - DWORD dwProcessAffinity, dwSystemAffinity; - GetProcessAffinityMask(GetCurrentProcess(), &dwProcessAffinity, - &dwSystemAffinity); - - if (dwProcessAffinity != dwSystemAffinity) - return false; -#elif OGE_PLATFORM == OGE_PLATFORM_LINUX - int numOfProcessors = sysconf(_SC_NPROCESSORS_CONF); - - cpu_set_t availableProcessors; - sched_getaffinity(0, sizeof(availableProcessors), &availableProcessors); - - for (int index = 0; index < numOfProcessors; ++index) - { - if (!CPU_ISSET(index, &availableProcessors)) - return false; - } -#endif - - unsigned long dwAffinityMask = 1; - int index = 0; - -#if OGE_PLATFORM == OGE_PLATFORM_WIN32 - for (; dwAffinityMask && dwAffinityMask <= dwSystemAffinity; - dwAffinityMask = 1 << (++index)) - { - if (SetThreadAffinityMask(GetCurrentThread(), dwAffinityMask)) - { - //OSThread::yield(); - Sleep(0); -#elif OGE_PLATFORM == OGE_PLATFORM_LINUX - cpu_set_t currentProcessor; - - for(; index < numOfProcessors; dwAffinityMask = 1 << (++index)) - { - CPU_ZERO(¤tProcessor); - CPU_SET(index, ¤tProcessor); - if (!sched_setaffinity(0, sizeof(currentProcessor), ¤tProcessor)) - { - sleep(0); -#endif - - // local APIC ID - unsigned char apic = getAPICID(); - unsigned char coreIDWidth = getCoreIDWidth(); - - unsigned char coreID = apic & (0xff >> coreIDWidth); - unsigned char packageID = apic & (0xff << coreIDWidth); - - - addProcessorID(processors, processorsIndex, coreCount, - packageID, coreID, apic, dwAffinityMask); - - processorsIndex.push_back( - CPUInfo::ProcessorIndex(packageID, coreID, 0)); - } - } - -#if OGE_PLATFORM == OGE_PLATFORM_WIN32 - // put the current thread back to its original state - SetThreadAffinityMask(GetCurrentThread(), dwProcessAffinity); - //OSThread::yield(); - Sleep(0); -#elif OGE_PLATFORM == OGE_PLATFORM_LINUX - sched_setaffinity (0, sizeof(availableProcessors), &availableProcessors); - sleep(0); -#endif - - logicalCount = coreCount; - - return true; - } - //------------------------------------------------------------------------- - void CPUExtendedInfoAMD::addProcessorID( - CPUInfo::ProcessorID::Vector& processors, - CPUInfo::ProcessorIndex::Vector& processorsIndex, - unsigned int& coreCount, unsigned int packageID, - unsigned int coreID, unsigned char APICID, - unsigned int affinityMask) - { - typedef CPUInfo::ProcessorID::Vector ProcVector; - typedef CPUInfo::CoreID::Vector CoreVector; - - bool found = false; - ProcVector::iterator procIter = processors.begin(); - for (; procIter != processors.end(); ++procIter) - { - if (procIter->ID == packageID) - { - found = true; - break; - } - } - - if (!found) - { - if (processors.size() < packageID) - { - processors.push_back(CPUInfo::ProcessorID(packageID)); - } - else - { - procIter = processors.insert(processors.begin() + packageID, - CPUInfo::ProcessorID(packageID)); - } - } - - found = false; - - CoreVector::iterator coreIter = procIter->cores.begin(); - for (; coreIter != procIter->cores.end(); ++coreIter) - { - if (coreIter->ID == coreID) - { - found = true; - break; - } - } - - if (!found) - { - if (procIter->cores.size() < coreID) - { - procIter->cores.push_back(CPUInfo::CoreID(coreID)); - size_t size = procIter->cores.size(); - coreIter = procIter->cores.begin() + (size - 1); - } - else - { - coreIter = procIter->cores.insert( - procIter->cores.begin() + coreID, CPUInfo::CoreID(coreID)); - } - - coreIter->logicalProcessors.push_back( - CPUInfo::LogicalID(0, affinityMask, APICID)); - - ++coreCount; - } - } - //------------------------------------------------------------------------- -} Deleted: oge/trunk/utilities/src/hardware/OgeCPUExtendedInfoIntel.cpp =================================================================== --- oge/trunk/utilities/src/hardware/OgeCPUExtendedInfoIntel.cpp 2008-10-19 08:27:59 UTC (rev 107) +++ oge/trunk/utilities/src/hardware/OgeCPUExtendedInfoIntel.cpp 2008-10-20 12:58:05 UTC (rev 108) @@ -1,424 +0,0 @@ -/* ------------------------------------------------------------------------------ -This source file is part of OGE (Open Game Engine) -For the latest info, see http://sourceforge.net/projects/oge - -Copyright (c) 2006-2008 The OGE Team -Also see acknowledgements in Readme.html - -This program is distributed under a dual-licensing scheme: - -1. The first license, which is the default one, state that this software - is free software; you can redistribute it and/or modify it under the terms - of the GNU Lesser General Public License (LGPL) as published by the - Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - -2. The second license, which is not free, apply only for licensee who got - a written agreement from the 'OGE Team'. The exact wording of this - license can be obtained from the 'OGE Team'. In essence this - OGE Unrestricted License state that the GNU Lesser General Public License - applies except that the software is distributed with no limitation or - requirements to publish or give back to the OGE Team changes made - to the OGE source code. - -By default, the first type of license applies (the GNU LGPL), the OGE -Unrestricted License apply only for those who got a written agreement -from the OGE Team. - -Under both licenses, 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 Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser 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, or go to -http://www.gnu.org/copyleft/lesser.txt. -For the OGE Unrestricted License contact the OGE Team. ------------------------------------------------------------------------------ -*/ -#include "oge/hardware/OgeCPUExtendedInfoIntel.h" -#include "oge/hardware/OgeCPUID.h" - -namespace oge -{ - //------------------------------------------------------------------------- - bool CPUExtendedInfoIntel::getInformation(String& brand, - CPUInfo::Type& type, bool& ht, CPUInfo::ProcessorID::Vector& processors, - CPUInfo::ProcessorIndex::Vector& processorsIndex) - { - ht = false; - - brand = getBrand(); - - //bool hardwareMT = hasHardwareMT(); - - int maxLogicalPerCore = getMaxLogicalPerPackage() / - getMaxCoresPerPackage(); - - unsigned int logicalCount = 0; - unsigned int coreCount = 0; - - if (!getProcessorIDs(processors, processorsIndex, coreCount, - logicalCount)) - { - type = CPUInfo::TYPE_SINGLE_CORE; - ht = false; - return false; - } - - ht = (maxLogicalPerCore > 1 && logicalCount > coreCount); - if (((float)coreCount / (float)processors.size()) > 1) - { - type = CPUInfo::TYPE_MULTI_CORE; - } - else - { - type = CPUInfo::TYPE_SINGLE_CORE; - } - - return true; - } - //------------------------------------------------------------------------- - int CPUExtendedInfoIntel::getMaxCPUIDValue() - { - int reg[4]; - - __cpuid(reg, 0); - - return reg[0]; - } - //------------------------------------------------------------------------- - String CPUExtendedInfoIntel::getBrand() - { - int reg[4]; - - __cpuid(reg, 0x80000000); - - bool extendedSupported = (reg[0] & 0x80000000) != 0; - - // Is brand string supported? - if (extendedSupported && (unsigned int) reg[0] >= 0x80000004) - { - String brand; - - for (int index = 0; index < 3; ++index) - { - __cpuid(reg, 0x80000002 + index); - - char name[17]; - memcpy(&name, ®[0], 4); - memcpy(&name[4], ®[1], 4); - memcpy(&name[8], ®[2], 4); - memcpy(&name[12], ®[3], 4); - name[16] = '\0'; - - brand += name; - } - - return brand; - } - else - { - // Attempt for brand index - __cpuid(reg, 1); - - // Get the brand index - unsigned char lowByte = reg[1]; - - // Brand String and Index methods failed - if (lowByte == 0) - return "Unknown"; - - switch(lowByte) - { - case 0x01: - case 0x0A: - case 0x14: - return "Intel(R) Celeron(R) processor"; - break; - case 0x02: - case 0x04: - return "Intel(R) Pentium(R) III processor"; - break; - case 0x03: // * - return "Intel(R) Pentium(R) III Xeon(R) processor"; - break; - case 0x06: - return "Mobile Intel(R) Pentium(R) III processor-M"; - break; - case 0x07: - case 0x0F: - case 0x13: - case 0x17: - return "Mobile Intel(R) Celeron(R) processor"; - break; - case 0x08: - case 0x09: - return "Intel(R) Pentium(R) 4 processor"; - break; - case 0x0B: // * - return "Intel(R) Xeon(R) processor"; - break; - case 0x0C: - return "Intel(R) Xeon(R) processor MP"; - break; - case 0x0E: //... [truncated message content] |
From: <laz...@us...> - 2008-10-19 08:29:01
|
Revision: 107 http://oge.svn.sourceforge.net/oge/?rev=107&view=rev Author: lazaruslong Date: 2008-10-19 08:27:59 +0000 (Sun, 19 Oct 2008) Log Message: ----------- 2008/10/19 - SVN TRUNK v0.3.75 (rev 107) - Added The core MyGUI media (cursor, font, basic layout, ...) Revision Links: -------------- http://oge.svn.sourceforge.net/oge/?rev=107&view=rev Modified Paths: -------------- samples/trunk/samples/Jukebox/PlayState.cpp Added Paths: ----------- samples/trunk/media/gui/ samples/trunk/media/gui/mygui_core/ samples/trunk/media/gui/mygui_core/DejaVuSans-ExtraLight.ttf samples/trunk/media/gui/mygui_core/DejaVuSans.ttf samples/trunk/media/gui/mygui_core/core.png samples/trunk/media/gui/mygui_core/core.xml samples/trunk/media/gui/mygui_core/core_font.xml samples/trunk/media/gui/mygui_core/core_keyboard.xml samples/trunk/media/gui/mygui_core/core_language.xml samples/trunk/media/gui/mygui_core/core_language_english.txt samples/trunk/media/gui/mygui_core/core_language_russian.txt samples/trunk/media/gui/mygui_core/core_layer.xml samples/trunk/media/gui/mygui_core/core_pointer.png samples/trunk/media/gui/mygui_core/core_pointer.xml samples/trunk/media/gui/mygui_core/core_resource.xml samples/trunk/media/gui/mygui_core/core_skin.xml Added: samples/trunk/media/gui/mygui_core/DejaVuSans-ExtraLight.ttf =================================================================== (Binary files differ) Property changes on: samples/trunk/media/gui/mygui_core/DejaVuSans-ExtraLight.ttf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: samples/trunk/media/gui/mygui_core/DejaVuSans.ttf =================================================================== (Binary files differ) Property changes on: samples/trunk/media/gui/mygui_core/DejaVuSans.ttf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: samples/trunk/media/gui/mygui_core/core.png =================================================================== (Binary files differ) Property changes on: samples/trunk/media/gui/mygui_core/core.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: samples/trunk/media/gui/mygui_core/core.xml =================================================================== --- samples/trunk/media/gui/mygui_core/core.xml (rev 0) +++ samples/trunk/media/gui/mygui_core/core.xml 2008-10-19 08:27:59 UTC (rev 107) @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<MyGUI> + + <MyGUI type="List"> + <List file="core_resource.xml" group="General"/> + <List file="core_keyboard.xml" group="General"/> + <List file="core_language.xml" group="General"/> + <List file="core_layer.xml" group="General"/> + <List file="core_font.xml" group="General"/> + <List file="core_skin.xml" group="General"/> + <List file="core_pointer.xml" group="General"/> + </MyGUI> + +</MyGUI> Added: samples/trunk/media/gui/mygui_core/core_font.xml =================================================================== --- samples/trunk/media/gui/mygui_core/core_font.xml (rev 0) +++ samples/trunk/media/gui/mygui_core/core_font.xml 2008-10-19 08:27:59 UTC (rev 107) @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<MyGUI type="Font"> + + <Font name="Default" default_height="17" source="DejaVuSans.ttf" size="19" resolution="50" antialias_colour="false" space_width="4" tab_width="8" cursor_width="2" distance="6" offset_height="0"> + <Code range="33 126"/> + <Code range="1025 1105"/> + <Code range="8470 8470" help="�"/> + <Code hide="128"/> + <Code hide="1026 1039"/> + <Code hide="1104"/> + </Font> + + <Font name="DejaVuSans.17" default_height="17" source="DejaVuSans.ttf" size="19" resolution="50" antialias_colour="false" space_width="4" tab_width="8" cursor_width="2" distance="5" offset_height="0"> + <Code range="33 126"/> + <Code range="1025 1105"/> + <Code range="8470 8470" help="�"/> + <Code hide="128"/> + <Code hide="1026 1039"/> + <Code hide="1104"/> + </Font> + <Font name="DejaVuSans.14" default_height="14" source="DejaVuSans.ttf" size="16" resolution="50" antialias_colour="false" space_width="4" tab_width="8" cursor_width="2" distance="7" offset_height="0"> + <Code range="33 126"/> + <Code range="1025 1105"/> + <Code range="8470 8470" help="�"/> + <Code hide="128"/> + <Code hide="1026 1039"/> + <Code hide="1104"/> + </Font> + +</MyGUI> Added: samples/trunk/media/gui/mygui_core/core_keyboard.xml =================================================================== --- samples/trunk/media/gui/mygui_core/core_keyboard.xml (rev 0) +++ samples/trunk/media/gui/mygui_core/core_keyboard.xml 2008-10-19 08:27:59 UTC (rev 107) @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<MyGUI type="Lang"> + + <Help name="name_language"> + "unassigned, escape, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, -, =, backspace, tab, q, w, e, r, t, y, u, i, o, p, [, ], enter, lcontrol, a, s, d, f, g, h, j, k, l, ;, ', `, lshift, \, z, x, c, v, b, n, m, comma, ., /, rshift, * on numeric keypad, leftalt, space, + unassigned, escape, !, @, #, $, %, ^, &, *, (, ), _, +, backspace, tab, Q, W, E, R, T, Y, U, I, O, P, {, }, enter, lcontrol, A, S, D, F, G, H, J, K, L, :, double quotes, ~, lshift, |, Z, X, C, V, B, N, M, <, >, ?, rshift, * on numeric keypad, leftalt, space" + </Help> + + <Lang name="Russian"> + 0, 0, 49, 50, 51, 52, 53, 54, 55, 56, 57, 48, 45, 61, 0, 0, 1081, 1094, 1091, 1082, 1077, 1085, 1075, 1096, 1097, 1079, 1093, 1098, 0, 0, 1092, 1099, 1074, 1072, 1087, 1088, 1086, 1083, 1076, 1078, 1101, 1105, 0, 92, 1103, 1095, 1089, 1084, 1080, 1090, 1100, 1073, 1102, 46, 0, 42, 0, 32, + 0, 0, 33, 34, 8470, 59, 37, 58, 63, 42, 40, 41, 95, 43, 0, 0, 1049, 1062, 1059, 1050, 1045, 1053, 1043, 1064, 1065, 1047, 1061, 1066, 0, 0, 1060, 1067, 1042, 1040, 1055, 1056, 1054, 1051, 1044, 1046, 1069, 1025, 0, 47, 1071, 1063, 1057, 1052, 1048, 1058, 1068, 1041, 1070, 44, 0, 42, 0, 32 + </Lang> + +</MyGUI> Added: samples/trunk/media/gui/mygui_core/core_language.xml =================================================================== --- samples/trunk/media/gui/mygui_core/core_language.xml (rev 0) +++ samples/trunk/media/gui/mygui_core/core_language.xml 2008-10-19 08:27:59 UTC (rev 107) @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<MyGUI type="Language"> + + <Language default="English"> + <Info name="English"> + <Source>core_language_english.txt</Source> + </Info> + <Info name="Russian"> + <Source>core_language_russian.txt</Source> + </Info> + </Language> + +</MyGUI> Added: samples/trunk/media/gui/mygui_core/core_language_english.txt =================================================================== --- samples/trunk/media/gui/mygui_core/core_language_english.txt (rev 0) +++ samples/trunk/media/gui/mygui_core/core_language_english.txt 2008-10-19 08:27:59 UTC (rev 107) @@ -0,0 +1,9 @@ +MessageBox_Ok Ok +MessageBox_Yes Yes +MessageBox_No No +MessageBox_Abort Abort +MessageBox_Retry Retry +MessageBox_Ignore Ignore +MessageBox_Cancel Cancel +MessageBox_Try Try +MessageBox_Continue Continue \ No newline at end of file Added: samples/trunk/media/gui/mygui_core/core_language_russian.txt =================================================================== --- samples/trunk/media/gui/mygui_core/core_language_russian.txt (rev 0) +++ samples/trunk/media/gui/mygui_core/core_language_russian.txt 2008-10-19 08:27:59 UTC (rev 107) @@ -0,0 +1,9 @@ +MessageBox_Ok Ок +MessageBox_Yes Да +MessageBox_No Нет +MessageBox_Abort Отмена +MessageBox_Retry Повторить +MessageBox_Ignore Игнорировать +MessageBox_Cancel Отмена +MessageBox_Try Повторить +MessageBox_Continue Продолжить Added: samples/trunk/media/gui/mygui_core/core_layer.xml =================================================================== --- samples/trunk/media/gui/mygui_core/core_layer.xml (rev 0) +++ samples/trunk/media/gui/mygui_core/core_layer.xml 2008-10-19 08:27:59 UTC (rev 107) @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<MyGUI type="Layer"> + + <Layer name="Back" overlapped="false" peek="true"/> + <Layer name="Overlapped" overlapped="true" peek="true"/> + <Layer name="Middle" overlapped="false" peek="true"/> + <Layer name="Modal" overlapped="true" peek="true"/> + <Layer name="Main" overlapped="false" peek="true"/> + <Layer name="Popup" overlapped="true" peek="true"/> + <Layer name="FadeMiddle" overlapped="false" peek="false"/> + <Layer name="Info" overlapped="true" peek="true"/> + <Layer name="ToolTip"overlapped="false" peek="false"/> + <Layer name="DragAndDrop"overlapped="false" peek="false"/> + <Layer name="FadeBusy" overlapped="false" peek="false"/> + <Layer name="Pointer" overlapped="false" peek="false"/> + <Layer name="Fade" overlapped="false" peek="false"/> + <Layer name="Statistic" overlapped="false" peek="false"/> + +</MyGUI> Added: samples/trunk/media/gui/mygui_core/core_pointer.png =================================================================== (Binary files differ) Property changes on: samples/trunk/media/gui/mygui_core/core_pointer.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: samples/trunk/media/gui/mygui_core/core_pointer.xml =================================================================== --- samples/trunk/media/gui/mygui_core/core_pointer.xml (rev 0) +++ samples/trunk/media/gui/mygui_core/core_pointer.xml 2008-10-19 08:27:59 UTC (rev 107) @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<MyGUI type="Pointer"> + + <Pointer layer="Pointer" texture="core_pointer.png" default="arrow"> + <Info name="arrow" point="1 1" size="32 32" resource="pic_CorePointerArrow"/> + <Info name="beam" point="16 16" size="32 32" resource="pic_CorePointerBeam"/> + <Info name="size_left" point="16 16" size="32 32" resource="pic_CorePointerSizeLeft"/> + <Info name="size_right" point="16 16" size="32 32" resource="pic_CorePointerSizeRight"/> + <Info name="hand" point="16 16" size="32 32" resource="pic_CorePointerHand"/> + </Pointer> + +</MyGUI> Added: samples/trunk/media/gui/mygui_core/core_resource.xml =================================================================== --- samples/trunk/media/gui/mygui_core/core_resource.xml (rev 0) +++ samples/trunk/media/gui/mygui_core/core_resource.xml 2008-10-19 08:27:59 UTC (rev 107) @@ -0,0 +1,87 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<MyGUI type="Resource"> + + <Resource type="ResourceImageSet" name="pic_CoreMessageIcon" id="{99AAEC52-6A43-47d6-B1DA-0477C12CE500}"> + <Group name="Icons" texture="core.png" size="50 50"> + <Index name="Info"> + <Frame point="0 203"/> + </Index> + <Index name="Quest"> + <Frame point="50 203"/> + </Index> + <Index name="Error"> + <Frame point="100 203"/> + </Index> + <Index name="Warning"> + <Frame point="150 203"/> + </Index> + </Group> + </Resource> + + <Resource type="ResourceImageSet" name="pic_CorePointerArrow" id="{C7ECFCE4-6021-4628-9BFF-1F36D594D7CB}"> + <Group name="Pointer" texture="core_pointer.png" size="32 32"> + <Index name="Pointer" rate="0.3"> + <Frame point="13 11" count="10"/> + <Frame point="13 52"/> + <Frame point="56 52"/> + <Frame point="13 52"/> + </Index> + </Group> + </Resource> + + <Resource type="ResourceImageSet" name="pic_CorePointerBeam" id="{C62588E6-E9A5-451a-B6B3-60DD0B3A1F92}"> + <Group name="Pointer" texture="core_pointer.png" size="32 32"> + <Index name="Pointer" > + <Frame point="45 11"/> + </Index> + </Group> + </Resource> + + <Resource type="ResourceImageSet" name="pic_CorePointerSizeLeft" id="{089025E6-8FD8-4436-BB59-39C25F73243D}"> + <Group name="Pointer" texture="core_pointer.png" size="32 32"> + <Index name="Pointer" > + <Frame point="86 11"/> + </Index> + </Group> + </Resource> + + <Resource type="ResourceImageSet" name="pic_CorePointerSizeRight" id="{9B68E5CF-A473-45ae-BE33-42F8F1835FD6}"> + <Group name="Pointer" texture="core_pointer.png" size="32 32"> + <Index name="Pointer" > + <Frame point="118 11"/> + </Index> + </Group> + </Resource> + + <Resource type="ResourceImageSet" name="pic_CorePointerHand" id="{4FAA172A-C27F-49a0-B7AE-BA507389186C}"> + <Group name="Pointer" texture="core_pointer.png" size="32 32"> + <Index name="Pointer" > + <Frame point="154 11"/> + </Index> + </Group> + </Resource> + + <Resource type="ResourceImageSet" name="pic_CoreMultiListIcon" id="{2CD9A5FB-9C14-4a50-A427-7BC282026008}"> + <Group name="Icons" texture="core.png" size="14 10"> + <Index name="None" > + <Frame point="504 3"/> + </Index> + <Index name="Up" > + <Frame point="504 15"/> + </Index> + <Index name="Down" > + <Frame point="504 28"/> + </Index> + </Group> + </Resource> + + <Resource type="ResourceImageSet" name="pic_CorePopupMenu" id="{54871B95-9A2C-482b-8A2B-3A6243396BBB}"> + <Group name="Icons" texture="core.png" size="10 12"> + <Index name="Popup" > + <Frame point="505 44"/> + </Index> + </Group> + </Resource> + +</MyGUI> Added: samples/trunk/media/gui/mygui_core/core_skin.xml =================================================================== --- samples/trunk/media/gui/mygui_core/core_skin.xml (rev 0) +++ samples/trunk/media/gui/mygui_core/core_skin.xml 2008-10-19 08:27:59 UTC (rev 107) @@ -0,0 +1,1576 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<MyGUI type="Skin"> + + <Skin name = "RawRect" size = "16 16" texture = "core.png"> + <BasisSkin type="RawRect" offset = "0 0 16 16" align = "Stretch"> + <State name="normal" offset = "677 68 1 1"/> + </BasisSkin> + </Skin> + + <Skin name = "StaticText" size = "16 16"> + <Property key="FontName" value = "Default" /> + <Property key="AlignText" value = "Default" /> + <Property key="Colour" value = "0 0 0" /> + + <BasisSkin type="SimpleText" offset = "0 0 16 16" align = "Stretch"/> + </Skin> + + <Skin name = "StaticImage" size = "16 16"> + <BasisSkin type="MainSkin" offset = "0 0 16 16"/> + </Skin> + + <Skin name = "RenderBox" size = "10 10"> + <Property key="Pointer" value = "hand" /> + <BasisSkin type="MainSkin" offset = "0 0 16 16"/> + </Skin> + + + <Skin name = "TileClient" size = "32 32" texture = "core.png"> + <BasisSkin type="TileRect" offset = "0 0 32 32" align = "Stretch"> + <Property key="TileH" value = "true" /> + <Property key="TileV" value = "true" /> + <State name="normal" offset = "458 73 32 32"/> + </BasisSkin> + </Skin> + + <Skin name = "DefaultClient" size = "65 57" texture = "core.png" > + <BasisSkin type="MainSkin" offset = "0 0 65 57" align = "Stretch"> + <State name="normal" offset = "432 5 65 57"/> + </BasisSkin> + </Skin> + + + <Skin name = "Separator4" size = "2 2" texture = "core.png"> + <BasisSkin type="MainSkin" offset = "0 0 2 2" align = "Stretch"> + <State name="normal" offset = "304 124 2 2"/> + </BasisSkin> + </Skin> + + <Skin name = "Separator3" size = "2 2" texture = "core.png"> + <BasisSkin type="MainSkin" offset = "0 0 2 2" align = "Stretch"> + <State name="normal" offset = "304 128 2 2"/> + </BasisSkin> + </Skin> + + <Skin name = "Separator2" size = "2 2" texture = "core.png"> + <BasisSkin type="MainSkin" offset = "0 0 2 2" align = "Stretch"> + <State name="normal" offset = "313 126 2 2"/> + </BasisSkin> + </Skin> + + <Skin name = "Separator1" size = "2 2" texture = "core.png"> + <BasisSkin type="MainSkin" offset = "0 0 2 2" align = "Stretch"> + <State name="normal" offset = "317 126 2 2"/> + </BasisSkin> + </Skin> + + + <Skin name = "MarkerGreen" size = "1 1" texture = "core.png" > + <BasisSkin type="MainSkin" offset = "0 0 1 1" align = "Stretch"> + <State name="normal" offset = "678 18 1 1"/> + <State name="active" offset = "678 6 1 1"/> + <State name="select" offset = "678 6 1 1"/> + </BasisSkin> + </Skin> + + <Skin name = "MarkerYellow" size = "1 1" texture = "core.png" > + <BasisSkin type="MainSkin" offset = "0 0 1 1" align = "Stretch"> + <State name="normal" offset = "678 42 1 1"/> + <State name="active" offset = "678 30 1 1"/> + <State name="select" offset = "678 30 1 1"/> + </BasisSkin> + </Skin> + + <Skin name = "MarkerBlack" size = "1 1" texture = "core.png" > + <BasisSkin type="MainSkin" offset = "0 0 1 1" align = "Stretch"> + <State name="normal" offset = "678 54 1 1"/> + </BasisSkin> + </Skin> + + <Skin name = "MarkerWhite" size = "1 1" texture = "core.png" > + <BasisSkin type="MainSkin" offset = "0 0 1 1" align = "Stretch"> + <State name="normal" offset = "678 66 1 1"/> + </BasisSkin> + </Skin> + + <Skin name = "RectBlue" size = "11 10" texture = "core.png" > + <BasisSkin type="SubSkin" offset = "0 0 1 1" align = "Left Top"> + <State name="normal" offset = "674 74 1 1"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "1 0 9 1" align = "HStretch Top"> + <State name="normal" offset = "676 74 1 1"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "10 0 1 1" align = "HStretch Top"> + <State name="normal" offset = "684 74 1 1"/> + </BasisSkin> + + <BasisSkin type="SubSkin" offset = "0 1 1 8" align = "Left VStretch"> + <State name="normal" offset = "674 77 1 1"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "1 1 9 8" align = "Stretch"> + <State name="normal" offset = "676 77 1 1"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "10 1 1 8" align = "Right VStretch"> + <State name="normal" offset = "684 77 1 1"/> + </BasisSkin> + + <BasisSkin type="SubSkin" offset = "0 9 1 1" align = "Left Bottom"> + <State name="normal" offset = "674 83 1 1"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "1 9 9 1" align = "HStretch Bottom"> + <State name="normal" offset = "676 83 1 1"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "10 9 1 1" align = "Right Bottom"> + <State name="normal" offset = "684 83 1 1"/> + </BasisSkin> + </Skin> + + <Skin name = "RectGreen" size = "11 10" texture = "core.png" > + <BasisSkin type="SubSkin" offset = "0 0 1 1" align = "Left Top"> + <State name="normal" offset = "674 86 1 1"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "1 0 9 1" align = "HStretch Top"> + <State name="normal" offset = "676 86 1 1"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "10 0 1 1" align = "HStretch Top"> + <State name="normal" offset = "684 86 1 1"/> + </BasisSkin> + + <BasisSkin type="SubSkin" offset = "0 1 1 8" align = "Left VStretch"> + <State name="normal" offset = "674 89 1 1"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "1 1 9 8" align = "Stretch"> + <State name="normal" offset = "676 89 1 1"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "10 1 1 8" align = "Right VStretch"> + <State name="normal" offset = "684 89 1 1"/> + </BasisSkin> + + <BasisSkin type="SubSkin" offset = "0 9 1 1" align = "Left Bottom"> + <State name="normal" offset = "674 95 1 1"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "1 9 9 1" align = "HStretch Bottom"> + <State name="normal" offset = "676 95 1 1"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "10 9 1 1" align = "Right Bottom"> + <State name="normal" offset = "684 95 1 1"/> + </BasisSkin> + </Skin> + + <Skin name = "StretchRectangle" size = "50 50" texture = "core.png" > + <Property key="ToStick" value = "false" /> + <Property key="MainMove" value = "true" /> + + <Child type="Widget" skin="MarkerGreen" offset = "0 0 50 1" align = "HStretch Top"/> + <Child type="Widget" skin="MarkerGreen" offset = "0 49 50 1" align = "HStretch Bottom"/> + <Child type="Widget" skin="MarkerGreen" offset = "0 1 1 48" align = "Left VStretch"/> + <Child type="Widget" skin="MarkerGreen" offset = "49 1 1 48" align = "Right VStretch"/> + + <Child type="Button" skin="MarkerGreen" offset = "1 1 7 7" align = "Left Top" name = "Action"> + <Property key="Scale" value = "1 1 -1 -1"/> + </Child> + + <Child type="Button" skin="MarkerGreen" offset = "42 42 7 7" align = "Right Bottom" name = "Action"> + <Property key="Scale" value = "0 0 1 1"/> + </Child> + + <Child type="Button" skin="MarkerGreen" offset = "42 1 7 7" align = "Right Top" name = "Action"> + <Property key="Scale" value = "0 1 1 -1"/> + </Child> + + <Child type="Button" skin="MarkerGreen" offset = "1 42 7 7" align = "Left Bottom" name = "Action"> + <Property key="Scale" value = "1 0 -1 1"/> + </Child> + + <Child type="Button" skin="MarkerGreen" offset = "1 22 7 7" align = "Left VCenter" name = "Action"> + <Property key="Scale" value = "1 0 -1 0"/> + </Child> + + <Child type="Button" skin="MarkerGreen" offset = "42 22 7 7" align = "Right VCenter" name = "Action"> + <Property key="Scale" value = "0 0 1 0"/> + </Child> + + <Child type="Button" skin="MarkerGreen" offset = "22 1 7 7" align = "HCenter Top" name = "Action"> + <Property key="Scale" value = "0 1 0 -1"/> + </Child> + + <Child type="Button" skin="MarkerGreen" offset = "22 42 7 7" align = "HCenter Bottom" name = "Action"> + <Property key="Scale" value = "0 0 0 1"/> + </Child> + + </Skin> + + + <Skin name = "ItemBox" size = "11 11" texture = "core.png"> + <Property key="NeedKey" value = "true" /> + <Property key="SkinLine" value = "ListLine" /> + <Property key="HeightLine" value = "20" /> + + <Child type="VScroll" skin="VScroll" offset = "-9 3 15 3" align = "Right VStretch" name = "VScroll"/> + <Child type="Widget" skin="DefaultClient" offset = "3 3 -12 3" align = "Stretch" name = "Client"/> + + <BasisSkin type="SubSkin" offset = "0 0 3 3" align = "Left Top"> + <State name="normal" offset = "429 70 3 3"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "3 0 3 3" align = "HStretch Top"> + <State name="normal" offset = "435 70 3 3"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "6 0 5 3" align = "Right Top"> + <State name="normal" offset = "447 70 5 3"/> + </BasisSkin> + + <BasisSkin type="SubSkin" offset = "0 3 3 3" align = "Left VStretch"> + <State name="normal" offset = "429 76 3 3"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "6 3 5 3" align = "Right VStretch"> + <State name="normal" offset = "447 76 5 3"/> + </BasisSkin> + + <BasisSkin type="SubSkin" offset = "0 6 3 5" align = "Left Bottom"> + <State name="normal" offset = "429 87 3 5"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "3 6 3 5" align = "HStretch Bottom"> + <State name="normal" offset = "435 87 3 5"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "6 6 5 5" align = "Right Bottom"> + <State name="normal" offset = "447 87 5 5"/> + </BasisSkin> + </Skin> + + + <Skin name = "CheckBox" size = "100 21" texture = "core.png"> + <Property key="FontName" value = "Default" /> + <Property key="AlignText" value = "Left VCenter" /> + <Property key="Colour" value = "0 0 0" /> + + <BasisSkin type="SubSkin" offset = "0 0 21 21" align = "Left VCenter"> + <State name="disable" offset = "2 2 21 21"/> + <State name="normal" offset = "2 24 21 21"/> + <State name="active" offset = "2 46 21 21"/> + <State name="pressed" offset = "2 68 21 21"/> + <State name="disable_check" offset = "2 90 21 21"/> + <State name="normal_check" offset = "2 112 21 21"/> + <State name="active_check" offset = "2 134 21 21"/> + <State name="pressed_check" offset = "2 156 21 21"/> + </BasisSkin> + + <BasisSkin type="SimpleText" offset = "24 0 76 21" align = "Stretch"> + </BasisSkin> + </Skin> + + <Skin name = "RadioBox" size = "100 19" texture = "core.png"> + <Property key="FontName" value = "Deafult" /> + <Property key="AlignText" value = "Left VCenter" /> + <Property key="Colour" value = "0 0 0" /> + + <BasisSkin type="SubSkin" offset = "0 0 19 19" align = "Left VCenter"> + <State name="disable" offset = "27 2 19 19"/> + <State name="normal" offset = "27 23 19 19"/> + <State name="active" offset = "27 44 19 19"/> + <State name="pressed" offset = "27 65 19 19"/> + <State name="disable_check" offset = "27 86 19 19"/> + <State name="normal_check" offset = "27 107 19 19"/> + <State name="active_check" offset = "27 128 19 19"/> + <State name="pressed_check" offset = "27 149 19 19"/> + </BasisSkin> + + <BasisSkin type="SimpleText" offset = "24 0 76 19" align = "Stretch"> + </BasisSkin> + </Skin> + + <Skin name = "ButtonMinusPlus" size = "18 18" texture = "core.png"> + <BasisSkin type="MainSkin" offset = "0 0 18 18" align = "Stretch"> + <State name="disable" offset = "49 2 18 18"/> + <State name="normal" offset = "49 23 18 18"/> + <State name="active" offset = "49 44 18 18"/> + <State name="pressed" offset = "49 65 18 18"/> + <State name="disable_check" offset = "49 84 18 18"/> + <State name="normal_check" offset = "49 107 18 18"/> + <State name="active_check" offset = "49 128 18 18"/> + <State name="pressed_check" offset = "49 149 18 18"/> + </BasisSkin> + </Skin> + + <Skin name = "ButtonX" size = "18 17" texture = "core.png"> + <BasisSkin type="MainSkin" offset = "0 0 18 17" align = "Stretch"> + <State name="disable" offset = "72 2 18 17"/> + <State name="normal" offset = "72 21 18 17"/> + <State name="active" offset = "72 40 18 17"/> + <State name="pressed" offset = "72 59 18 17"/> + <State name="select" offset = "72 78 18 17"/> + </BasisSkin> + </Skin> + + <Skin name = "ButtonV" size = "17 15" texture = "core.png"> + <BasisSkin type="MainSkin" offset = "0 0 17 15" align = "Stretch"> + <State name="disable" offset = "72 98 17 15"/> + <State name="normal" offset = "72 114 17 15"/> + <State name="active" offset = "72 130 17 15"/> + <State name="pressed" offset = "72 146 17 15"/> + <State name="select" offset = "72 162 17 15"/> + </BasisSkin> + </Skin> + + <Skin name = "ButtonDown" size = "14 12" texture = "core.png"> + <BasisSkin type="MainSkin" offset = "0 0 14 12" align = "Stretch"> + <State name="disable" offset = "95 2 14 12"/> + <State name="normal" offset = "95 15 14 12"/> + <State name="active" offset = "95 28 14 12"/> + <State name="pressed" offset = "95 41 14 12"/> + <State name="select" offset = "95 54 14 12"/> + </BasisSkin> + </Skin> + + <Skin name = "ButtonUp" size = "14 12" texture = "core.png"> + <BasisSkin type="MainSkin" offset = "0 0 14 12" align = "Stretch"> + <State name="disable" offset = "95 68 14 12"/> + <State name="normal" offset = "95 82 14 12"/> + <State name="active" offset = "95 96 14 12"/> + <State name="pressed" offset = "95 110 14 12"/> + <State name="select" offset = "95 124 14 12"/> + </BasisSkin> + </Skin> + + <Skin name = "ButtonLeft" size = "12 14" texture = "core.png"> + <BasisSkin type="MainSkin" offset = "0 0 12 14" align = "Stretch"> + <State name="disable" offset = "112 2 12 14"/> + <State name="normal" offset = "112 18 12 14"/> + <State name="active" offset = "112 34 12 14"/> + <State name="pressed" offset = "112 50 12 14"/> + <State name="select" offset = "112 66 12 14"/> + </BasisSkin> + </Skin> + + <Skin name = "ButtonRight" size = "12 14" texture = "core.png"> + <BasisSkin type="MainSkin" offset = "0 0 12 14" align = "Stretch"> + <State name="disable" offset = "112 84 12 14"/> + <State name="normal" offset = "112 100 12 14"/> + <State name="active" offset = "112 116 12 14"/> + <State name="pressed" offset = "112 132 12 14"/> + <State name="select" offset = "112 148 12 14"/> + </BasisSkin> + </Skin> + + <Skin name = "ButtonSmall" size = "29 21" texture = "core.png"> + <Property key="FontName" value = "Default" /> + <Property key="AlignText" value = "HCenter VCenter" /> + <Property key="Colour" value = "0 0 0" /> + + <BasisSkin type="SubSkin" offset = "0 0 10 21" align = "Left VStretch"> + <State name="disable" offset = "169 2 10 21"/> + <State name="normal" offset = "169 24 10 21"/> + <State name="active" offset = "169 46 10 21"/> + <State name="pressed" offset = "169 68 10 21"/> + <State name="select" offset = "169 90 10 21"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "10 0 7 21" align = "HStretch VStretch"> + <State name="disable" offset = "179 2 7 21"/> + <State name="normal" offset = "179 24 7 21"/> + <State name="active" offset = "179 46 7 21"/> + <State name="pressed" offset = "179 68 7 21"/> + <State name="select" offset = "179 90 7 21"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "17 0 12 21" align = "Right VStretch"> + <State name="disable" offset = "186 2 12 21"/> + <State name="normal" offset = "186 24 12 21"/> + <State name="active" offset = "186 46 12 21"/> + <State name="pressed" offset = "186 68 12 21"/> + <State name="select" offset = "186 90 12 21"/> + </BasisSkin> + + <BasisSkin type="SimpleText" offset = "1 1 25 17" align = "Stretch"> + <State name="disable" shift = "false"/> + <State name="normal" shift = "false"/> + <State name="active" shift = "false"/> + <State name="pressed" shift = "true"/> + <State name="select" shift = "true"/> + </BasisSkin> + </Skin> + + <Skin name = "Button" size = "29 26" texture = "core.png"> + <Property key="FontName" value = "Default" /> + <Property key="AlignText" value = "HCenter VCenter" /> + <Property key="Colour" value = "0 0 0" /> + + <BasisSkin type="SubSkin" offset = "0 0 10 26" align = "Left VStretch"> + <State name="disable" offset = "202 2 10 26"/> + <State name="normal" offset = "202 29 10 26"/> + <State name="active" offset = "202 56 10 26"/> + <State name="pressed" offset = "202 83 10 26"/> + <State name="select" offset = "202 110 10 26"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "10 0 7 26" align = "HStretch VStretch"> + <State name="disable" offset = "212 2 7 26"/> + <State name="normal" offset = "212 29 7 26"/> + <State name="active" offset = "212 56 7 26"/> + <State name="pressed" offset = "212 83 7 26"/> + <State name="select" offset = "212 110 7 26"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "17 0 12 26" align = "Right VStretch"> + <State name="disable" offset = "219 2 12 26"/> + <State name="normal" offset = "219 29 12 26"/> + <State name="active" offset = "219 56 12 26"/> + <State name="pressed" offset = "219 83 12 26"/> + <State name="select" offset = "219 110 12 26"/> + </BasisSkin> + + <BasisSkin type="SimpleText" offset = "1 1 25 22" align = "Stretch"> + <State name="disable" shift = "false"/> + <State name="normal" shift = "false"/> + <State name="active" shift = "false"/> + <State name="pressed" shift = "true"/> + <State name="select" shift = "true"/> + </BasisSkin> + </Skin> + + + <Skin name = "EditClientSimple" size = "32 32"> + <Property key="FontName" value = "Default" /> + <Property key="AlignText" value = "Default" /> + <Property key="Colour" value = "0 0 0" /> + <BasisSkin type="EditText" offset = "0 0 32 32" align = "Stretch"/> + </Skin> + + <Skin name = "WordWrapSimple" size = "32 32" texture = "core.png" > + <Property key="WordWrap" value = "true" /> + <Child type="Widget" skin="EditClientSimple" offset = "0 0 32 32" align = "Stretch" name = "Client"/> + </Skin> + + <Skin name = "WordWrap" size = "32 32" texture = "core.png" > + <Property key="WordWrap" value = "true" /> + <Child type="Widget" skin="EditClientSimple" offset = "0 0 16 32" align = "Stretch" name = "Client"/> + <Child type="VScroll" skin="VScroll" offset = "17 0 15 32" align = "Right VStretch" name = "VScroll"/> + </Skin> + + <Skin name = "EditClient" size = "10 10"> + <Property key="FontName" value = "Default" /> + <Property key="AlignText" value = "Left VCenter" /> + <Property key="Colour" value = "0 0 0" /> + <Property key="Pointer" value = "beam" /> + <BasisSkin type="EditText" offset = "0 0 10 10" align = "Stretch"/> + </Skin> + + <Skin name = "EditStretch" size = "29 26" texture = "core.png" > + + <Child type="Widget" skin="EditClient" offset = "2 3 7 3" align = "Stretch" name = "Client"/> + <Child type="VScroll" skin="VScroll" offset = "10 2 15 5" align = "Right VStretch" name = "VScroll"/> + <Child type="HScroll" skin="HScroll" offset = "2 7 8 15" align = "HStretch Bottom" name = "HScroll"/> + + <BasisSkin type="SubSkin" offset = "0 0 10 8" align = "Left Top"> + <State name="disable" offset = "235 2 10 8"/> + <State name="normal" offset = "235 29 10 8"/> + <State name="active" offset = "235 56 10 8"/> + <State name="pressed" offset = "235 83 10 8"/> + <State name="select" offset = "235 110 10 8"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "10 0 7 8" align = "HStretch Top"> + <State name="disable" offset = "245 2 7 8"/> + <State name="normal" offset = "245 29 7 8"/> + <State name="active" offset = "245 56 7 8"/> + <State name="pressed" offset = "245 83 7 8"/> + <State name="select" offset = "245 110 7 8"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "17 0 12 8" align = "Right Top"> + <State name="disable" offset = "252 2 12 8"/> + <State name="normal" offset = "252 29 12 8"/> + <State name="active" offset = "252 56 12 8"/> + <State name="pressed" offset = "252 83 12 8"/> + <State name="select" offset = "252 110 12 8"/> + </BasisSkin> + + <BasisSkin type="SubSkin" offset = "0 8 10 8" align = "Left VStretch"> + <State name="disable" offset = "235 10 10 8"/> + <State name="normal" offset = "235 37 10 8"/> + <State name="active" offset = "235 64 10 8"/> + <State name="pressed" offset = "235 91 10 8"/> + <State name="select" offset = "235 118 10 8"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "10 8 7 8" align = "HStretch VStretch"> + <State name="disable" offset = "245 10 7 8"/> + <State name="normal" offset = "245 37 7 8"/> + <State name="active" offset = "245 64 7 8"/> + <State name="pressed" offset = "245 91 7 8"/> + <State name="select" offset = "245 118 7 8"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "17 8 12 8" align = "Right VStretch"> + <State name="disable" offset = "252 10 12 8"/> + <State name="normal" offset = "252 37 12 8"/> + <State name="active" offset = "252 64 12 8"/> + <State name="pressed" offset = "252 91 12 8"/> + <State name="select" offset = "252 118 12 8"/> + </BasisSkin> + + <BasisSkin type="SubSkin" offset = "0 16 10 10" align = "Left Bottom"> + <State name="disable" offset = "235 18 10 10"/> + <State name="normal" offset = "235 45 10 10"/> + <State name="active" offset = "235 72 10 10"/> + <State name="pressed" offset = "235 99 10 10"/> + <State name="select" offset = "235 126 10 10"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "10 16 7 10" align = "HStretch Bottom"> + <State name="disable" offset = "245 18 7 10"/> + <State name="normal" offset = "245 45 7 10"/> + <State name="active" offset = "245 72 7 10"/> + <State name="pressed" offset = "245 99 7 10"/> + <State name="select" offset = "245 126 7 10"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "17 16 12 10" align = "Right Bottom"> + <State name="disable" offset = "252 18 12 10"/> + <State name="normal" offset = "252 45 12 10"/> + <State name="active" offset = "252 72 12 10"/> + <State name="pressed" offset = "252 99 12 10"/> + <State name="select" offset = "252 126 12 10"/> + </BasisSkin> + + </Skin> + + <Skin name = "Edit" size = "29 26" texture = "core.png" > + <Child type="Widget" skin="EditClient" offset = "2 1 23 22" align = "Stretch" name = "Client"/> + + <BasisSkin type="SubSkin" offset = "0 0 10 26" align = "Left VStretch"> + <State name="disable" offset = "235 2 10 26"/> + <State name="normal" offset = "235 29 10 26"/> + <State name="active" offset = "235 56 10 26"/> + <State name="pressed" offset = "235 83 10 26"/> + <State name="select" offset = "235 110 10 26"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "10 0 7 26" align = "Stretch"> + <State name="disable" offset = "245 2 7 26"/> + <State name="normal" offset = "245 29 7 26"/> + <State name="active" offset = "245 56 7 26"/> + <State name="pressed" offset = "245 83 7 26"/> + <State name="select" offset = "245 110 7 26"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "17 0 12 26" align = "Right VStretch"> + <State name="disable" offset = "252 2 12 26"/> + <State name="normal" offset = "252 29 12 26"/> + <State name="active" offset = "252 56 12 26"/> + <State name="pressed" offset = "252 83 12 26"/> + <State name="select" offset = "252 110 12 26"/> + </BasisSkin> + </Skin> + + <Skin name = "ComboBox" size = "29 26" texture = "core.png" > + <Property key="HeightList" value = "100" /> + <Property key="ListSmoothShow" value = "true" /> + <Property key="ListSkin" value = "List" /> + <Property key="ListLayer" value = "Popup" /> + + <Child type="Widget" skin="EditClient" offset = "2 1 5 22" align = "Stretch" name = "Client"/> + <Child type="Button" skin="ButtonDown" offset = "9 4 14 12" align = "Right VCenter" name = "Button"/> + + <BasisSkin type="SubSkin" offset = "0 0 10 26" align = "Left VStretch"> + <State name="disable" offset = "235 2 10 26"/> + <State name="normal" offset = "235 29 10 26"/> + <State name="active" offset = "235 56 10 26"/> + <State name="pressed" offset = "235 83 10 26"/> + <State name="select" offset = "235 110 10 26"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "10 0 7 26" align = "Stretch"> + <State name="disable" offset = "245 2 7 26"/> + <State name="normal" offset = "245 29 7 26"/> + <State name="active" offset = "245 56 7 26"/> + <State name="pressed" offset = "245 83 7 26"/> + <State name="select" offset = "245 110 7 26"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "17 0 12 26" align = "Right VStretch"> + <State name="disable" offset = "252 2 12 26"/> + <State name="normal" offset = "252 29 12 26"/> + <State name="active" offset = "252 56 12 26"/> + <State name="pressed" offset = "252 83 12 26"/> + <State name="select" offset = "252 110 12 26"/> + </BasisSkin> + </Skin> + + + <Skin name = "WindowCaption" size = "68 28" texture = "core.png"> + <Property key="FontName" value = "Default" /> + <Property key="AlignText" value = "Center" /> + <Property key="Colour" value = "0 0 0" /> + + <BasisSkin type="SubSkin" offset = "0 0 15 28" align = "Left VStretch"> + <State name="normal" offset = "356 36 15 28"/> + <State name="active" offset = "356 70 15 28"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "15 0 36 28" align = "Stretch"> + <State name="normal" offset = "371 36 36 28"/> + <State name="active" offset = "371 70 36 28"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "51 0 17 28" align = "Right VStretch"> + <State name="normal" offset = "407 36 17 28"/> + <State name="active" offset = "407 70 17 28"/> + </BasisSkin> + <BasisSkin type="SimpleText" offset = "10 0 46 24" align = "Stretch"/> + </Skin> + + <Skin name = "WindowCaptionDisable" size = "68 28" texture = "core.png"> + <Property key="FontName" value = "Default" /> + <Property key="AlignText" value = "Center" /> + <Property key="Colour" value = "0 0 0" /> + + <BasisSkin type="SubSkin" offset = "0 0 15 28" align = "Left VStretch"> + <State name="normal" offset = "356 2 15 28"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "15 0 36 28" align = "Stretch"> + <State name="normal" offset = "371 2 36 28"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "51 0 17 28" align = "Right VStretch"> + <State name="normal" offset = "407 2 17 28"/> + </BasisSkin> + <BasisSkin type="SimpleText" offset = "5 4 56 24" align = "Stretch"/> + </Skin> + + <Skin name = "WindowCaptionSmall" size = "40 28" texture = "core.png"> + <Property key="FontName" value = "Default" /> + <Property key="AlignText" value = "Center" /> + <Property key="Colour" value = "0 0 0" /> + + <BasisSkin type="SubSkin" offset = "0 0 15 28" align = "Left VStretch"> + <State name="normal" offset = "356 104 15 28"/> + <State name="active" offset = "356 138 15 28"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "15 0 13 28" align = "Stretch"> + <State name="normal" offset = "371 104 13 28"/> + <State name="active" offset = "371 138 13 28"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "28 0 12 28" align = "Right VStretch"> + <State name="normal" offset = "384 104 12 28"/> + <State name="active" offset = "384 138 12 28"/> + </BasisSkin> + <BasisSkin type="SimpleText" offset = "10 0 24 24" align = "Stretch"/> + </Skin> + + <Skin name = "WindowResizeRight" size = "9 9" texture = "core.png" > + <Property key="Pointer" value = "size_left" /> + <BasisSkin type="MainSkin" offset = "0 0 9 9" align = "Stretch"> + <State name="normal" offset = "369 185 9 9"/> + <State name="active" offset = "369 172 9 9"/> + </BasisSkin> + </Skin> + + <Skin name = "WindowResizeLeft" size = "9 9" texture = "core.png" > + <Property key="Pointer" value = "size_right" /> + <BasisSkin type="MainSkin" offset = "0 0 9 9" align = "Stretch"> + <State name="normal" offset = "356 185 9 9"/> + <State name="active" offset = "356 172 9 9"/> + </BasisSkin> + </Skin> + + <Skin name = "Window" size = "68 49" texture = "core.png" > + <Property key="ToStick" value = "true" /> + + <Child type="Button" skin="WindowCaptionDisable" offset = "0 0 68 28" align = "HStretch Top" name = "Caption"> + <Property key="Scale" value = "1 1 0 0"/> + </Child> + + <Child type="Widget" skin="DefaultClient" offset = "4 31 58 12" align = "Stretch" name = "Client"/> + + <BasisSkin type="SubSkin" offset = "0 28 4 3" align = "Left Top"> + <State name="normal" offset = "384 173 4 3"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "4 28 58 3" align = "HStretch Top"> + <State name="normal" offset = "390 173 3 3"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "62 28 6 3" align = "Right Top"> + <State name="normal" offset = "401 173 6 3"/> + </BasisSkin> + + <BasisSkin type="SubSkin" offset = "0 31 4 12" align = "Left VStretch"> + <State name="normal" offset = "384 176 4 12"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "62 31 6 12" align = "Right VStretch"> + <State name="normal" offset = "401 176 6 12"/> + </BasisSkin> + + <BasisSkin type="SubSkin" offset = "0 43 4 6" align = "Left Bottom"> + <State name="normal" offset = "384 188 4 6"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "4 43 58 6" align = "HStretch Bottom"> + <State name="normal" offset = "390 188 3 6"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "62 43 6 6" align = "Right Bottom"> + <State name="normal" offset = "401 188 6 6"/> + </BasisSkin> + + </Skin> + + <Skin name = "WindowC" size = "68 49" texture = "core.png" > + <Property key="ToStick" value = "true" /> + + <Child type="Button" skin="WindowCaption" offset = "0 0 68 28" align = "HStretch Top" name = "Caption"> + <Property key="Scale" value = "1 1 0 0"/> + </Child> + + <Child type="Widget" skin="DefaultClient" offset = "4 31 58 12" align = "Stretch" name = "Client"/> + + <BasisSkin type="SubSkin" offset = "0 28 4 3" align = "Left Top"> + <State name="normal" offset = "384 173 4 3"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "4 28 58 3" align = "HStretch Top"> + <State name="normal" offset = "390 173 3 3"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "62 28 6 3" align = "Right Top"> + <State name="normal" offset = "401 173 6 3"/> + </BasisSkin> + + <BasisSkin type="SubSkin" offset = "0 31 4 12" align = "Left VStretch"> + <State name="normal" offset = "384 176 4 12"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "62 31 6 12" align = "Right VStretch"> + <State name="normal" offset = "401 176 6 12"/> + </BasisSkin> + + <BasisSkin type="SubSkin" offset = "0 43 4 6" align = "Left Bottom"> + <State name="normal" offset = "384 188 4 6"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "4 43 58 6" align = "HStretch Bottom"> + <State name="normal" offset = "390 188 3 6"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "62 43 6 6" align = "Right Bottom"> + <State name="normal" offset = "401 188 6 6"/> + </BasisSkin> + + </Skin> + + <Skin name = "WindowCS" size = "68 49" texture = "core.png" > + <Property key="ToStick" value = "true" /> + + <Child type="Button" skin="WindowCaption" offset = "0 0 68 28" align = "HStretch Top" name = "Caption"> + <Property key="Scale" value = "1 1 0 0"/> + </Child> + + <Child type="Widget" skin="DefaultClient" offset = "4 31 58 12" align = "Stretch" name = "Client"/> + + <Child type="Button" skin="WindowResizeRight" offset = "57 38 9 9" align = "Right Bottom" name = "Action"> + <Property key="Scale" value = "0 0 1 1"/> + </Child> + <Child type="Button" skin="WindowResizeLeft" offset = "0 38 9 9" align = "Left Bottom" name = "Action"> + <Property key="Scale" value = "1 0 -1 1"/> + </Child> + + <BasisSkin type="SubSkin" offset = "0 28 4 3" align = "Left Top"> + <State name="normal" offset = "384 173 4 3"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "4 28 58 3" align = "HStretch Top"> + <State name="normal" offset = "390 173 3 3"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "62 28 6 3" align = "Right Top"> + <State name="normal" offset = "401 173 6 3"/> + </BasisSkin> + + <BasisSkin type="SubSkin" offset = "0 31 4 12" align = "Left VStretch"> + <State name="normal" offset = "384 176 4 12"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "62 31 6 12" align = "Right VStretch"> + <State name="normal" offset = "401 176 6 12"/> + </BasisSkin> + + <BasisSkin type="SubSkin" offset = "0 43 4 6" align = "Left Bottom"> + <State name="normal" offset = "384 188 4 6"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "4 43 58 6" align = "HStretch Bottom"> + <State name="normal" offset = "390 188 3 6"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "62 43 6 6" align = "Right Bottom"> + <State name="normal" offset = "401 188 6 6"/> + </BasisSkin> + + </Skin> + + <Skin name = "WindowCSX" size = "68 49" texture = "core.png" > + <Property key="ToStick" value = "true" /> + + <Child type="Button" skin="WindowCaptionSmall" offset = "0 0 40 28" align = "HStretch Top" name = "Caption"> + <Property key="Scale" value = "1 1 0 0"/> + </Child> + + <Child type="Widget" skin="DefaultClient" offset = "4 31 58 12" align = "Stretch" name = "Client"/> + + <Child type="Button" skin="WindowResizeRight" offset = "57 38 9 9" align = "Right Bottom" name = "Action"> + <Property key="Scale" value = "0 0 1 1"/> + </Child> + <Child type="Button" skin="WindowResizeLeft" offset = "0 38 9 9" align = "Left Bottom" name = "Action"> + <Property key="Scale" value = "1 0 -1 1"/> + </Child> + + <Child type="Button" skin="ButtonX" offset = "43 6 18 17" align = "Right Top" name = "Button"> + <Property key="Event" value = "close"/> + </Child> + + <BasisSkin type="SubSkin" offset = "40 0 28 28" align = "Right Top"> + <State name="normal" offset = "396 104 28 28"/> + </BasisSkin> + + <BasisSkin type="SubSkin" offset = "0 28 4 3" align = "Left Top"> + <State name="normal" offset = "384 173 4 3"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "4 28 58 3" align = "HStretch Top"> + <State name="normal" offset = "390 173 3 3"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "62 28 6 3" align = "Right Top"> + <State name="normal" offset = "401 173 6 3"/> + </BasisSkin> + + <BasisSkin type="SubSkin" offset = "0 31 4 12" align = "Left VStretch"> + <State name="normal" offset = "384 176 4 12"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "62 31 6 12" align = "Right VStretch"> + <State name="normal" offset = "401 176 6 12"/> + </BasisSkin> + + <BasisSkin type="SubSkin" offset = "0 43 4 6" align = "Left Bottom"> + <State name="normal" offset = "384 188 4 6"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "4 43 58 6" align = "HStretch Bottom"> + <State name="normal" offset = "390 188 3 6"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "62 43 6 6" align = "Right Bottom"> + <State name="normal" offset = "401 188 6 6"/> + </BasisSkin> + + </Skin> + + + <Skin name = "MessageClient" size = "16 16"> + <Property key="FontName" value = "Default" /> + <Property key="AlignText" value = "Left VCenter" /> + <Property key="Colour" value = "0 0 0" /> + + <BasisSkin type="SimpleText" offset = "0 0 16 16" align = "Stretch"/> + </Skin> + + <Skin name = "MessageIcon" size = "50 50"> + <Property key="ImageResource" value = "pic_CoreMessageIcon" /> + <Property key="ImageGroup" value = "Icons" /> + + <BasisSkin type="MainSkin" offset = "0 0 50 50" align = "Stretch"/> + </Skin> + + <Skin name = "Message" size = "68 49" texture = "core.png" > + <Property key="ToStick" value = "true" /> + <Property key="ButtonSkin" value = "Button" /> + <Property key="ButtonType" value = "Button" /> + <Property key="ButtonSize" value = "100 26" /> + <Property key="ButtonOffset" value = "20 43" /> + <Property key="DefaultLayer" value = "Info" /> + <Property key="FadeSkin" value = "MarkerBlack" /> + <Property key="FadeLayer" value = "FadeMiddle" /> + + <Child type="Widget" skin="MessageClient" offset = "10 35 32 -36" align = "Stretch" name = "Text"/> + <Child type="StaticImage" skin="MessageIcon" offset = "6 34 50 50" align = "Default" name = "Icon"/> + + <Child type="Button" skin="WindowCaption" offset = "0 0 68 28" align = "HStretch Top" name = "Caption"> + <Property key="Scale" value = "1 1 0 0"/> + </Child> + + <BasisSkin type="SubSkin" offset = "0 28 4 3" align = "Left Top"> + <State name="normal" offset = "384 173 4 3"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "4 28 58 3" align = "HStretch Top"> + <State name="normal" offset = "390 173 3 3"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "62 28 6 3" align = "Right Top"> + <State name="normal" offset = "401 173 6 3"/> + </BasisSkin> + + <BasisSkin type="SubSkin" offset = "0 31 4 12" align = "Left VStretch"> + <State name="normal" offset = "384 176 4 12"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "4 31 58 12" align = "Stretch"> + <State name="normal" offset = "432 5 65 57"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "62 31 6 12" align = "Right VStretch"> + <State name="normal" offset = "401 176 6 12"/> + </BasisSkin> + + <BasisSkin type="SubSkin" offset = "0 43 4 6" align = "Left Bottom"> + <State name="normal" offset = "384 188 4 6"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "4 43 58 6" align = "HStretch Bottom"> + <State name="normal" offset = "390 188 3 6"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "62 43 6 6" align = "Right Bottom"> + <State name="normal" offset = "401 188 6 6"/> + </BasisSkin> + + </Skin> + + + <Skin name = "Panel" size = "11 11" texture = "core.png"> + + <BasisSkin type="SubSkin" offset = "0 0 3 3" align = "Left Top"> + <State name="normal" offset = "429 70 3 3"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "3 0 3 3" align = "HStretch Top"> + <State name="normal" offset = "435 70 3 3"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "6 0 5 3" align = "Right Top"> + <State name="normal" offset = "447 70 5 3"/> + </BasisSkin> + + <BasisSkin type="SubSkin" offset = "0 3 3 3" align = "Left VStretch"> + <State name="normal" offset = "429 76 3 3"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "3 3 3 3" align = "Stretch"> + <State name="normal" offset = "432 5 65 57"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "6 3 5 3" align = "Right VStretch"> + <State name="normal" offset = "447 76 5 3"/> + </BasisSkin> + + <BasisSkin type="SubSkin" offset = "0 6 3 5" align = "Left Bottom"> + <State name="normal" offset = "429 87 3 5"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "3 6 3 5" align = "HStretch Bottom"> + <State name="normal" offset = "435 87 3 5"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "6 6 5 5" align = "Right Bottom"> + <State name="normal" offset = "447 87 5 5"/> + </BasisSkin> + </Skin> + + <Skin name = "PanelSmall" size = "11 11" texture = "core.png"> + + <BasisSkin type="SubSkin" offset = "0 0 3 3" align = "Left Top"> + <State name="normal" offset = "429 95 3 3"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "3 0 3 3" align = "HStretch Top"> + <State name="normal" offset = "435 95 3 3"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "6 0 5 3" align = "Right Top"> + <State name="normal" offset = "447 95 5 3"/> + </BasisSkin> + + <BasisSkin type="SubSkin" offset = "0 3 3 3" align = "Left VStretch"> + <State name="normal" offset = "429 100 3 3"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "3 3 3 3" align = "Stretch"> + <State name="normal" offset = "432 5 65 57"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "6 3 5 3" align = "Right VStretch"> + <State name="normal" offset = "447 100 5 3"/> + </BasisSkin> + + <BasisSkin type="SubSkin" offset = "0 6 3 5" align = "Left Bottom"> + <State name="normal" offset = "429 112 3 5"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "3 6 3 5" align = "HStretch Bottom"> + <State name="normal" offset = "435 112 3 5"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "6 6 5 5" align = "Right Bottom"> + <State name="normal" offset = "447 112 5 5"/> + </BasisSkin> + </Skin> + + + <Skin name = "ScrollView" size = "11 11" texture = "core.png"> + <Property key="NeedKey" value = "true" /> + + <Child type="VScroll" skin="VScroll" offset = "-9 3 15 -12" align = "Right VStretch" name = "VScroll"/> + <Child type="HScroll" skin="HScroll" offset = "3 -9 -12 15" align = "HStretch Bottom" name = "HScroll"/> + <Child type="Widget" skin="Widget" offset = "3 3 -12 -12" align = "Stretch" name = "Client"/> + + <BasisSkin type="SubSkin" offset = "0 0 3 3" align = "Left Top"> + <State name="normal" offset = "429 70 3 3"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "3 0 3 3" align = "HStretch Top"> + <State name="normal" offset = "435 70 3 3"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "6 0 5 3" align = "Right Top"> + <State name="normal" offset = "447 70 5 3"/> + </BasisSkin> + + <BasisSkin type="SubSkin" offset = "0 3 3 3" align = "Left VStretch"> + <State name="normal" offset = "429 76 3 3"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "3 3 3 3" align = "Stretch"> + <State name="normal" offset = "432 5 65 57"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "6 3 5 3" align = "Right VStretch"> + <State name="normal" offset = "447 76 5 3"/> + </BasisSkin> + + <BasisSkin type="SubSkin" offset = "0 6 3 5" align = "Left Bottom"> + <State name="normal" offset = "429 87 3 5"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "3 6 3 5" align = "HStretch Bottom"> + <State name="normal" offset = "435 87 3 5"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "6 6 5 5" align = "Right Bottom"> + <State name="normal" offset = "447 87 5 5"/> + </BasisSkin> + </Skin> + + <Skin name = "ScrollViewEmpty" size = "30 30" texture = "core.png"> + <Property key="NeedKey" value = "true" /> + + <Child type="VScroll" skin="VScroll" offset = "15 0 15 15" align = "Right VStretch" name = "VScroll"/> + <Child type="HScroll" skin="HScroll" offset = "0 15 15 15" align = "HStretch Bottom" name = "HScroll"/> + <Child type="Widget" skin="Default" offset = "0 0 15 15" align = "Stretch" name = "Client"/> + </Skin> + + + <Skin name = "TabButton" size = "51 26" texture = "core.png" > + <Property key="FontName" value = "Default" /> + <Property key="AlignText" value = "Center" /> + <Property key="Colour" value = "0 0 0" /> + + <BasisSkin type="SubSkin" offset = "0 0 11 26" align = "Left VStretch"> + <State name="normal" offset = "597 2 11 26"/> + <State name="active" offset = "597 33 11 26"/> + <State name="pressed" offset = "545 2 11 26"/> + <State name="select" offset = "545 33 11 26"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "11 0 26 26" align = "Stretch"> + <State name="normal" offset = "608 2 26 26"/> + <State name="active" offset = "608 33 26 26"/> + <State name="pressed" offset = "556 2 26 26"/> + <State name="select" offset = "556 33 26 26"/> + </BasisSkin> + <BasisSkin type="SubSkin" offset = "37 0 14 26" align = "Right VStretch"> + <State name="normal" offset = "634 2 14 26"/> + <State name="active" offset = "634 33 14 26"/> + <State name="pressed" offset = "582 2 14 26"/> + <State name="select" offset = "582 33 14 26"/> + </BasisSkin> + + <BasisSkin type="SimpleText" offset = "10 0 28 26" align = "Stretch"> + <State name="pressed" shift="true"/> + <State name="select" shift="true"/> + </BasisSkin> + + </Skin> + + <Skin name = "TabEmpty" size = "2 26" texture = "core.png" > + <BasisSkin type="MainSkin" offset = "0 0 2 26" align = "Stretch"> + <State name="normal" offset = "650 2 2 26"/> + </BasisSkin> + </Skin> + + <Skin name = "TabPatch" size = "17 5" texture = "core.png" > + <BasisSkin type="MainSkin" offset = "0 0 17 5" align = "Stretch"> + <State name="normal" offset = "538 64 17 5"/> + </BasisSkin> + </Skin> + + <Skin name = "Tab" size = "43 60" texture = "core.png" > + <Property key="OffsetBar" value = "17" /> + <Property key="ButtonSkin" value = "TabButton" /> + <Property key="EmptyBarSkin" value = "TabEmpty" /> + + <Child type="Widget" skin="Default" offset = "4 26 34 28" align = "Stretch" name = "Sheet"/> + <Child type="Widget" skin="Default" offset = "8 0 22 26" align = "HStretch Top" name = "Bar"/> + <Child type="Button" skin="ButtonLeft" offset = "13 4 12 14" align = "Right Top" name = "Left"/> + <Child type="Button" skin="ButtonRight" offset = "29 4 12 14" align = "Right Top" name = "Right"/> + <Child type="Widget" skin="TabPatch" offset = "13 21 17 5" align = "Right Top" name = "ShowPatch"/> + + + <BasisSkin type="SubSkin" offset = "0 21 8 5" align = "Left... [truncated message content] |
From: <laz...@us...> - 2008-10-19 08:23:28
|
Revision: 106 http://oge.svn.sourceforge.net/oge/?rev=106&view=rev Author: lazaruslong Date: 2008-10-19 08:22:27 +0000 (Sun, 19 Oct 2008) Log Message: ----------- 2008/10/19 - SVN TRUNK v0.3.75 (rev 106) - Updated Path to the (for now) hard coded MyGUI medias Revision Links: -------------- http://oge.svn.sourceforge.net/oge/?rev=106&view=rev Modified Paths: -------------- oge/trunk/plugins/guimygui/src/OgeGuiManagerMyGUI.cpp Modified: oge/trunk/plugins/guimygui/src/OgeGuiManagerMyGUI.cpp =================================================================== --- oge/trunk/plugins/guimygui/src/OgeGuiManagerMyGUI.cpp 2008-10-17 11:00:48 UTC (rev 105) +++ oge/trunk/plugins/guimygui/src/OgeGuiManagerMyGUI.cpp 2008-10-19 08:22:27 UTC (rev 106) @@ -78,7 +78,7 @@ // TODO does not work??? See in BaseManager.h BaseManager::addResourceLocation() LOGE("TODO: The resource locations for the gui mgr are hard coded!"); -Ogre::ResourceGroupManager::getSingleton().addResourceLocation("../../media/MyGUI_Media/", "FileSystem"); +Ogre::ResourceGroupManager::getSingleton().addResourceLocation("../../media/gui/mygui_core/", "FileSystem"); Ogre::ResourceGroupManager::getSingleton().addResourceLocation("../../samples/Jukebox/", "FileSystem"); mGUI = new MyGUI::Gui(); @@ -240,10 +240,14 @@ MyGUI::ListPtr list = mGUI->findWidget<MyGUI::List>(widget); if (list) { + // TODO replace by return list->getItemIndexSelected(); + // because next line is obsolete size_t index = list->getItemSelect(); if (index != MyGUI::ITEM_NONE) { - return list->getItem( index ); + // TODO replace by return list->getItemNameAt( index ); + // because next line is obsolete + return list->getItemNameAt( index ); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <laz...@us...> - 2008-10-17 11:00:58
|
Revision: 105 http://oge.svn.sourceforge.net/oge/?rev=105&view=rev Author: lazaruslong Date: 2008-10-17 11:00:48 +0000 (Fri, 17 Oct 2008) Log Message: ----------- 2008/10/17 - SVN TRUNK v0.3.74 (rev 105) - Added Sample "Jukebox" to demonstrate gui & basic audio capabilities. - Updated The base class InputEventHandler will now call automatically the GuiManager to pass the events (this is the reason for the "dummy" manager). Revision Links: -------------- http://oge.svn.sourceforge.net/oge/?rev=105&view=rev Modified Paths: -------------- samples/trunk/samples/FirstEntity/Readme.txt samples/trunk/samples/FirstEntity/oge.xml samples/trunk/samples/FpsSinglePlayer/InGameIEH.cpp samples/trunk/samples/FpsSinglePlayer/InGameIEH.h samples/trunk/samples/FpsSinglePlayer/Readme.txt samples/trunk/samples/FpsSinglePlayer/oge.xml samples/trunk/samples/HelloWorld/main.cpp Added Paths: ----------- samples/trunk/samples/Jukebox/ samples/trunk/samples/Jukebox/Jukebox.layout samples/trunk/samples/Jukebox/Load.layout samples/trunk/samples/Jukebox/PlayIEH.cpp samples/trunk/samples/Jukebox/PlayIEH.h samples/trunk/samples/Jukebox/PlayState.cpp samples/trunk/samples/Jukebox/PlayState.h samples/trunk/samples/Jukebox/Readme.txt samples/trunk/samples/Jukebox/YodaStopCritico.wav samples/trunk/samples/Jukebox/build/ samples/trunk/samples/Jukebox/build/vc80/ samples/trunk/samples/Jukebox/build/vc80/Jukebox.vcproj samples/trunk/samples/Jukebox/build/vc90/ samples/trunk/samples/Jukebox/m16burst1.wav samples/trunk/samples/Jukebox/main.cpp samples/trunk/samples/Jukebox/oge.xml Modified: samples/trunk/samples/FirstEntity/Readme.txt =================================================================== --- samples/trunk/samples/FirstEntity/Readme.txt 2008-10-17 10:57:21 UTC (rev 104) +++ samples/trunk/samples/FirstEntity/Readme.txt 2008-10-17 11:00:48 UTC (rev 105) @@ -1,3 +1,4 @@ + ---- First Entity sample ---- Shows a simple entity Modified: samples/trunk/samples/FirstEntity/oge.xml =================================================================== --- samples/trunk/samples/FirstEntity/oge.xml 2008-10-17 10:57:21 UTC (rev 104) +++ samples/trunk/samples/FirstEntity/oge.xml 2008-10-17 11:00:48 UTC (rev 105) @@ -10,20 +10,20 @@ <system name="GameManager" tickInterval="20" start="schedule" /> </profile> <!--<threading type="automatic" prefix="OGE_Thread_" suffix="" />--> - <threading type="manual" count="2"> + <threading type="manual" count="1"> <!--<thread name="ExplicitThreadName" priority="normal" />--> </threading> <plugins name="debug" folder="./"> <plugin name="OgeInputOIS_d" /> <plugin name="OgeGraphicsOGRE_d" /> <plugin name="OgeAudioOpenAL_d" /> - <plugin name="OgeGuiMyGUI_d" /> + <!--plugin name="OgeGuiMyGUI_d" /--> </plugins> <plugins name="release" folder="./"> <plugin name="OgeInputOIS" /> <plugin name="OgeGraphicsOGRE" /> <plugin name="OgeAudioOpenAL" /> - <plugin name="OgeGuiMyGUI" /> + <!--plugin name="OgeGuiMyGUI" /--> </plugins> <graphics> <plugins name="Debug"> Modified: samples/trunk/samples/FpsSinglePlayer/InGameIEH.cpp =================================================================== --- samples/trunk/samples/FpsSinglePlayer/InGameIEH.cpp 2008-10-17 10:57:21 UTC (rev 104) +++ samples/trunk/samples/FpsSinglePlayer/InGameIEH.cpp 2008-10-17 11:00:48 UTC (rev 105) @@ -32,7 +32,7 @@ { } //----------------------------------------------------------------------------- - bool InGameIEH::keyPressed (const KeyEvent& arg) + void InGameIEH::keyPressed (const KeyEvent& arg) { //_ GraphicsManager::getManager()->getGuiManager()->keyPressed( arg ); @@ -98,11 +98,9 @@ // Screenshot GraphicsManager::getManager()->saveScreenshot("oge_fps.jpg"); } - - return true; } //----------------------------------------------------------------------------- - bool InGameIEH::keyReleased (const KeyEvent& arg) + void InGameIEH::keyReleased (const KeyEvent& arg) { if (arg.mKeyCode == KC_W) { @@ -124,10 +122,9 @@ { GraphicsManager::getManager()->removeTextBox("Robot"); } - return true; } //----------------------------------------------------------------------------- - bool InGameIEH::mousePressed (const MouseEvent& arg) + void InGameIEH::mousePressed (const MouseEvent& arg) { LOG_ADDLINES(10); @@ -143,11 +140,9 @@ { mRightMouseDown = true; } - - return true; } //----------------------------------------------------------------------------- - bool InGameIEH::mouseReleased(const MouseEvent& arg) + void InGameIEH::mouseReleased(const MouseEvent& arg) { LOG_ADDLINES(10); @@ -159,11 +154,9 @@ { mRightMouseDown = false; } - - return true; } //----------------------------------------------------------------------------- - bool InGameIEH::mouseMoved(const MouseEvent& arg) + void InGameIEH::mouseMoved(const MouseEvent& arg) { // If we don't the cursor will not move... :) // TODO Can we do it automatically? Shouldn't we pass through a GuiSceneManager? @@ -175,8 +168,6 @@ camera->yaw(-arg.getRelX() * 0.1); camera->pitch(-arg.getRelY() * 0.1); } - - return true; } //----------------------------------------------------------------------------- void InGameIEH::createRobot() Modified: samples/trunk/samples/FpsSinglePlayer/InGameIEH.h =================================================================== --- samples/trunk/samples/FpsSinglePlayer/InGameIEH.h 2008-10-17 10:57:21 UTC (rev 104) +++ samples/trunk/samples/FpsSinglePlayer/InGameIEH.h 2008-10-17 11:00:48 UTC (rev 105) @@ -39,15 +39,15 @@ InGameIEH(); virtual ~InGameIEH(); - virtual bool keyPressed (const KeyEvent& arg); - virtual bool keyReleased (const KeyEvent& arg); - virtual bool mousePressed (const MouseEvent& arg); - virtual bool mouseReleased (const MouseEvent& arg); - virtual bool mouseMoved (const MouseEvent& arg); - virtual bool joyButtonPressed (const JoystickEvent& arg) { return true; } - virtual bool joyButtonReleased (const JoystickEvent& arg) { return true; } - virtual bool joyAxisMoved (const JoystickEvent& arg) { return true; } - virtual bool joyPovMoved (const JoystickEvent& arg) { return true; } + virtual void keyPressed (const KeyEvent& arg); + virtual void keyReleased (const KeyEvent& arg); + virtual void mousePressed (const MouseEvent& arg); + virtual void mouseReleased (const MouseEvent& arg); + virtual void mouseMoved (const MouseEvent& arg); + virtual void joyButtonPressed (const JoystickEvent& arg) {} + virtual void joyButtonReleased (const JoystickEvent& arg) {} + virtual void joyAxisMoved (const JoystickEvent& arg) {} + virtual void joyPovMoved (const JoystickEvent& arg) {} void createRobot(); Real getRandomValue( Real value, unsigned int range, Real min, Real max ); Modified: samples/trunk/samples/FpsSinglePlayer/Readme.txt =================================================================== --- samples/trunk/samples/FpsSinglePlayer/Readme.txt 2008-10-17 10:57:21 UTC (rev 104) +++ samples/trunk/samples/FpsSinglePlayer/Readme.txt 2008-10-17 11:00:48 UTC (rev 105) @@ -46,10 +46,7 @@ WASD = movement ( Space = jump ) R = creates a new robot where the mouse is showing - U = pass in unbuffered mode - B = pass in buffered mode - C = chat : pass in buffered mode to go back to the game press ESC - O = take control of the object pointed by the cursor +todo O = take control of the object pointed by the cursor (Pointing on the terrain + 'C' will free the camera) ESC = pause or quit (it depends in which state you are) @@ -57,7 +54,7 @@ "SysRq/PringScreen" = Screenshot F2 = toggle bounding box : it's used for collision F3 = cycle through some available object "info panels" - F4 = cycle through the camera mode (1rs person, 3rd-chased, 3rd-fixed) +todo F4 = cycle through the camera mode (1rs person, 3rd-chased, 3rd-fixed) F5 = cycle through the shadows techniques: used to study impact on framerate... Modified: samples/trunk/samples/FpsSinglePlayer/oge.xml =================================================================== --- samples/trunk/samples/FpsSinglePlayer/oge.xml 2008-10-17 10:57:21 UTC (rev 104) +++ samples/trunk/samples/FpsSinglePlayer/oge.xml 2008-10-17 11:00:48 UTC (rev 105) @@ -10,7 +10,7 @@ </profile> <!--<threading type="automatic" prefix="OGE_Thread_" suffix="" />--> - <threading type="manual" count="2"> + <threading type="manual" count="1"> <!--<thread name="ExplicitThreadName" priority="normal" />--> </threading> Modified: samples/trunk/samples/HelloWorld/main.cpp =================================================================== --- samples/trunk/samples/HelloWorld/main.cpp 2008-10-17 10:57:21 UTC (rev 104) +++ samples/trunk/samples/HelloWorld/main.cpp 2008-10-17 11:00:48 UTC (rev 105) @@ -48,5 +48,5 @@ EngineManager::destroySingleton(); LogManager::destroySingleton(); system("PAUSE"); - return 0; + return 0; } Added: samples/trunk/samples/Jukebox/Jukebox.layout =================================================================== --- samples/trunk/samples/Jukebox/Jukebox.layout (rev 0) +++ samples/trunk/samples/Jukebox/Jukebox.layout 2008-10-17 11:00:48 UTC (rev 105) @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?> +<MyGUI type="Layout"> + <Widget type="Window" skin="WindowCSX" position="160 72 224 408" layer="Back" name="Jukebox"> + <Property key="Widget_Caption" value="Jukebox"/> + <Property key="Widget_FontName" value="DejaVuSans.17"/> + <Property key="Widget_Caption" value="Jukebox"/> + <Widget type="Button" skin="Button" position="20 7 80 26" name="Button_Load"> + <Property key="Widget_Caption" value="Load"/> + </Widget> + <Widget type="Button" skin="Button" position="120 7 80 26" name="Button_Save"> + <Property key="Widget_Caption" value="Save"/> + </Widget> + <Widget type="Button" skin="CheckBox" position="20 34 76 48" name="Repeat"> + <Property key="Button_Pressed" value="true"/> + <Property key="Widget_Caption" value="Repeat"/> + </Widget> + <Widget type="HScroll" skin="HSlider" position="232 322 0 136"/> + <Widget type="HScroll" skin="HSlider" position="20 82 168 16" name="Volume"> + <Property key="Widget_Caption" value="Volume"/> + </Widget> + <Widget type="Progress" skin="Progress" position="24 322 164 8" name="Progress"> + <Property key="Widget_Caption" value="Progress"/> + </Widget> + <Widget type="Button" skin="ButtonLeft" position="28 338 24 24" name="Replay"/> + <Widget type="Button" skin="ButtonX" position="68 338 24 24" name="Stop"/> + <Widget type="Button" skin="ButtonRight" position="100 338 24 24" name="Play"/> + <Widget type="Button" skin="ButtonUp" position="132 338 24 24" name="Previous"/> + <Widget type="Button" skin="ButtonDown" position="164 338 24 24" name="Next"> + <Property key="Widget_Caption" value="Next"/> + </Widget> + <Widget type="List" skin="ItemBox" position="4 113 208 200" name="List"> + <Property key="Widget_Caption" value="Play List"/> + </Widget> + <Widget type="Button" skin="CheckBox" position="108 34 104 48" name="InMemory"> + <Property key="Button_Pressed" value="true"/> + <Property key="Widget_Caption" value="In-Memory"/> + <Widget type="Button" skin="CheckBox" position="416 184 88 64"/> + </Widget> + <Widget type="MenuBar" skin="MenuBar" position="640 104 208 32" align="HStretch Top" layer="Main" name="Menu"> + <Property key="Widget_Caption" value="Menu"/> + </Widget> + </Widget> +</MyGUI> Added: samples/trunk/samples/Jukebox/Load.layout =================================================================== --- samples/trunk/samples/Jukebox/Load.layout (rev 0) +++ samples/trunk/samples/Jukebox/Load.layout 2008-10-17 11:00:48 UTC (rev 105) @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<MyGUI type="Layout"> + <Widget type="Window" skin="WindowCS" position="0 32 384 100" align="Left Top" layer="Overlapped" name="Jukebox_load"> + <Property key="Widget_Caption" value="#{Select_file_name}"/> + <Property key="Window_MinMax" value="384 100 600 100"/> + <Widget type="ComboBox" skin="ComboBox" position="13 3 352 24" align="HStretch Top" name="Jukebox_editFileName"> + <Property key="Widget_Caption" value=""/> + </Widget> + <Widget type="Button" skin="Button" position="13 35 160 24" align="Left Top" name="Jukebox_buttonLoad"> + <Property key="Widget_Caption" value="#{OK}"/> + </Widget> + <Widget type="Button" skin="Button" position="205 35 160 24" align="Right Top" name="Jukebox_buttonCancel"> + <Property key="Widget_Caption" value="#{Cancel}"/> + </Widget> + </Widget> +</MyGUI> Added: samples/trunk/samples/Jukebox/PlayIEH.cpp =================================================================== --- samples/trunk/samples/Jukebox/PlayIEH.cpp (rev 0) +++ samples/trunk/samples/Jukebox/PlayIEH.cpp 2008-10-17 11:00:48 UTC (rev 105) @@ -0,0 +1,143 @@ + +#include "PlayIEH.h" +#include "PlayState.h" + +#include "oge/logging/OgeLogManager.h" +#include "oge/input/OgeInputEvent.h" +#include "oge/graphics/OgeGraphicsManager.h" +#include "oge/engine/OgeEngineManager.h" + +namespace oge +{ + //----------------------------------------------------------------------------- + PlayIEH::PlayIEH() : + mRightMouseDown(false) + { + } + //----------------------------------------------------------------------------- + PlayIEH::~PlayIEH() + { + } + //----------------------------------------------------------------------------- + void PlayIEH::keyPressed (const KeyEvent& arg) + { + InputEventHandler::keyPressed(arg); + + if (arg.mKeyCode == KC_LSHIFT) + { + } + else if (arg.mKeyCode == KC_W) + { + } + else if (arg.mKeyCode == KC_S) + { + } + else if (arg.mKeyCode == KC_A) + { + } + else if (arg.mKeyCode == KC_D) + { + } + else if (arg.mKeyCode == KC_R) + { + } + else if (arg.mKeyCode == KC_F1) + { + GraphicsManager::getManager()->toggleDebugOverlay(); + } + else if (arg.mKeyCode == KC_F2) + { + //LOGR("Toggle BoundingBox"); + //ObjectManager::getSingletonPtr()->getObjectSceneManager() + // ->toggleBoundingBox(); + } + else if (arg.mKeyCode == KC_F3) + { + } + else if (arg.mKeyCode == KC_F4) + { + } + else if (arg.mKeyCode == KC_F5) + { + } + else if(arg.mKeyCode == KC_ESCAPE) + { + EngineManager::getSingletonPtr()->stop(); + } + else if (arg.mKeyCode == KC_SYSRQ) + { + GraphicsManager::getManager()->saveScreenshot("oge_jukebox.jpg"); + } + } + //----------------------------------------------------------------------------- + void PlayIEH::keyReleased (const KeyEvent& arg) + { + InputEventHandler::keyReleased(arg); + + if (arg.mKeyCode == KC_W) + { + } + else if (arg.mKeyCode == KC_S) + { + } + else if (arg.mKeyCode == KC_A) + { + } + else if (arg.mKeyCode == KC_D) + { + } + else if (arg.mKeyCode == KC_R) + { + } + } + //----------------------------------------------------------------------------- + void PlayIEH::mousePressed (const MouseEvent& arg) + { + LOG_ADDLINES(10); + InputEventHandler::mousePressed(arg); + + int button = arg.getButton(); +//_ GraphicsManager::getSingletonPtr()->getGuiManager() +//_ ->mousePressed( arg, button ); + + if (button == MB_Left) + { + //shoot(); + } + else if (button == MB_Right) + { + mRightMouseDown = true; + } + } + //----------------------------------------------------------------------------- + void PlayIEH::mouseReleased(const MouseEvent& arg) + { + LOG_ADDLINES(10); + InputEventHandler::mouseReleased(arg); + + int button = arg.getButton(); +//_ GraphicsManager::getSingletonPtr()->getGuiManager() +//_ ->mouseReleased( arg, button ); + + if (button == MB_Right) + { + mRightMouseDown = false; + } + } + //----------------------------------------------------------------------------- + void PlayIEH::mouseMoved(const MouseEvent& arg) + { + InputEventHandler::mouseMoved(arg); + // If we don't the cursor will not move... :) + // TODO Can we do it automatically? Shouldn't we pass through a GuiSceneManager? +//_ GraphicsManager::getSingletonPtr()->getGuiManager()->mouseMoved( arg ); + + if (mRightMouseDown) + { + //CameraComponent* camera = (CameraComponent*) mCamera->getComponent("Graphics"); + //camera->yaw(-arg.getRelX() * 0.1); + //camera->pitch(-arg.getRelY() * 0.1); + } + } + //----------------------------------------------------------------------------- +} // namespace Added: samples/trunk/samples/Jukebox/PlayIEH.h =================================================================== --- samples/trunk/samples/Jukebox/PlayIEH.h (rev 0) +++ samples/trunk/samples/Jukebox/PlayIEH.h 2008-10-17 11:00:48 UTC (rev 105) @@ -0,0 +1,35 @@ + +#ifndef __PLAYIEH_H__ +#define __PLAYIEH_H__ + +#include "oge/OgeCorePrerequisites.h" +#include "oge/input/OgeInputEventHandler.h" + +// Forward declaration +class PlayState; + +namespace oge +{ + /// InGame Input Event Handler + class PlayIEH : public InputEventHandler + { + private: + bool mRightMouseDown; + + public: + PlayIEH(); + virtual ~PlayIEH(); + + virtual void keyPressed (const KeyEvent& arg); + virtual void keyReleased (const KeyEvent& arg); + virtual void mousePressed (const MouseEvent& arg); + virtual void mouseReleased (const MouseEvent& arg); + virtual void mouseMoved (const MouseEvent& arg); + virtual void joyButtonPressed (const JoystickEvent& arg) {} + virtual void joyButtonReleased (const JoystickEvent& arg) {} + virtual void joyAxisMoved (const JoystickEvent& arg) {} + virtual void joyPovMoved (const JoystickEvent& arg) {} + + }; +} // namespace +#endif // __PLAYIEH_H__ Added: samples/trunk/samples/Jukebox/PlayState.cpp =================================================================== --- samples/trunk/samples/Jukebox/PlayState.cpp (rev 0) +++ samples/trunk/samples/Jukebox/PlayState.cpp 2008-10-17 11:00:48 UTC (rev 105) @@ -0,0 +1,222 @@ + +#include "PlayState.h" +#include "oge/object/OgeObject.h" +#include "oge/object/OgeObjectManager.h" +#include "oge/input/OgeInputManager.h" + +// OGRE plugin specific! +#include "oge/graphics/OgeGraphicsSceneManagerOGRE.h" +#include "oge/graphics/OgeGraphicsManagerOGRE.h" +#include "oge/graphics/OgeRenderTargetManager.h" + +#include "oge/gui/OgeGuiManagerMyGUI.h" +#include "oge/audio/OgeAudioManagerOpenAL.h" + +using namespace oge; + +//----------------------------------------------------------------------------- +PlayState::PlayState() : GameState("PlayState") +{ + mIEH = new PlayIEH(); + //((PlayIEH*)mIEH)->setGameState( this ); +} +//----------------------------------------------------------------------------- +PlayState::~PlayState() +{ + delete mIEH; +} +//----------------------------------------------------------------------------- +void PlayState::tick(double currentTime) +{ +} +//----------------------------------------------------------------------------- +bool PlayState::activate(const Any& param) +{ + LOG("Activating"); + + InputManager::getManager()->getFirstKeyboard()->setInputEventHandler(mIEH); + InputManager::getManager()->getFirstMouse()->setInputEventHandler(mIEH); + + GuiManager::getManager()->loadLayout( "Jukebox.layout", "Jukebox" ); + + // MyGUI specific + mMainWidget = (MyGUI::WindowPtr)(dynamic_cast<GuiManagerMyGUI*> ( + GuiManager::getManager())->getWidget( "Jukebox" )); + mMainWidget->eventWindowButtonPressed = + MyGUI::delegates::newDelegate(this, &PlayState::notifyWindowButtonPressed); + + MyGUI::EnumeratorWidgetPtr childs = mMainWidget->getEnumerator(); + MyGUI::WidgetPtr combo = 0; + while(childs.next()) + { + combo = childs.current(); + if (combo->getName() == "Button_Load") + { + MyGUI::ButtonPtr button = (MyGUI::ButtonPtr) combo; + button->eventMouseButtonClick = + MyGUI::delegates::newDelegate(this, &PlayState::notifyLoad); + } + else if (combo->getName() == "Button_Save") + { +LOG("todo"); + } + else if (combo->getName() == "Repeat") + { +LOG("todo"); + } + else if (combo->getName() == "Volume") + { +LOG("todo"); + } + else if (combo->getName() == "Progress") + { +LOG("todo"); + } + else if (combo->getName() == "Replay") + { +LOG("todo"); + } + else if (combo->getName() == "Stop") + { +LOG("todo"); + } + else if (combo->getName() == "Play") + { + ((MyGUI::ButtonPtr) combo)->eventMouseButtonClick = + MyGUI::delegates::newDelegate(this, &PlayState::play); + } + else if (combo->getName() == "Previous") + { +LOG("todo"); + } + else if (combo->getName() == "Next") + { +LOG("todo"); + } + }; + + mList = (MyGUI::ListPtr)(dynamic_cast<GuiManagerMyGUI*> ( + GuiManager::getManager())->getWidgetT( "List" )); + +/* + MyGUI::ButtonPtr button = (MyGUI::ButtonPtr) (dynamic_cast<GuiManagerMyGUI*> ( + GuiManager::getManager())->getWidget( "Button_Load" )); + button->eventMouseButtonClick = + MyGUI::delegates::newDelegate(this, &PlayState::notifyLoad); +*/ + return true; +} +//----------------------------------------------------------------------------- +bool PlayState::deactivate() +{ + LOG("Deactivating..."); + return true; +} +//----------------------------------------------------------------------------- +void PlayState::notifyWindowButtonPressed(MyGUI::WidgetPtr sender, + const std::string & _button) +{ + if (_button == "close") + { + mMainWidget->hide(); + } +} +//----------------------------------------------------------------------------- +void PlayState::notifyLoad(MyGUI::WidgetPtr sender) +{ + // create message box with file name and two buttons + MyGUI::WidgetPtr messageWindow = MyGUI::LayoutManager::getInstance().load("Load.layout")[0]; +// MyGUI::IntSize view(mGUI->getViewSize()); + MyGUI::IntSize view(600,400); + MyGUI::IntSize size(messageWindow->getSize()); + messageWindow->setPosition((view.width-size.width)/2, (view.height-size.height)/2, size.width, size.height); + MyGUI::InputManager::getInstance().addWidgetModal(messageWindow); + + //MyGUI::VectorWidgetPtr childs = messageWindow->getChilds(); + //if (_save) childs[1]->setCaption("Save"); + //else childs[1]->setCaption("Load"); + //childs[1]->eventMouseButtonClick = newDelegate(this, &EditorState::notifyLoadSaveAccept); + //childs[2]->eventMouseButtonClick = newDelegate(this, &EditorState::notifyLoadSaveCancel); + + // \xE6\xE5\xF1\xF2\xEA\xE8\xE9 \xEA\xEE\xE4, \xED\xEE \xEE\xF0\xE8\xE3\xE8\xED\xE0\xEB \xED\xE5 \xEB\xF3\xF7\xF8\xE5 =/ + MyGUI::WidgetPtr combo2 = null, button1 = null, button2 = null; + size_t pos = 0; + + MyGUI::EnumeratorWidgetPtr childs = messageWindow->getEnumerator(); + while(childs.next()) + { + if (pos == 0) combo2 = childs.current(); + else if (pos == 1) button1 = childs.current(); + else if (pos == 2) button2 = childs.current(); + pos++; + }; + + button1->eventMouseButtonClick = MyGUI::delegates::newDelegate(this, &PlayState::notifyLoadAccept); + button2->eventMouseButtonClick = MyGUI::delegates::newDelegate(this, &PlayState::notifyLoadCancel); + + // set fileName in edit + MyGUI::ComboBoxPtr combo = combo2->castType<MyGUI::ComboBox>(); + + if (mFilename != "") + { + const Ogre::DisplayString & item = mFilename; // anci_to_utf16(fileName); + combo->setCaption(item); + } + combo->eventEditSelectAccept = MyGUI::delegates::newDelegate(this, &PlayState::notifyLoadAccept); + std::vector<Ogre::String> strs = MyGUI::helper::getVectorResourcePath("*.wav"); + for (std::vector<Ogre::String>::iterator iter = strs.begin(); + iter != strs.end(); ++iter) + { + const Ogre::DisplayString & item = *iter; // anci_to_utf16(*iter); + combo->addItem(item); + } + // TODO is it possible to compbine in one call? like ("*.wav|.ogg") + std::vector<Ogre::String> strs2 = MyGUI::helper::getVectorResourcePath("*.ogg"); + for (std::vector<Ogre::String>::iterator iter = strs2.begin(); + iter != strs2.end(); ++iter) + { + const Ogre::DisplayString & item = *iter; // anci_to_utf16(*iter); + combo->addItem(item); + } +} +//----------------------------------------------------------------------------- +void PlayState::notifyLoadCancel(MyGUI::WidgetPtr sender) +{ + MyGUI::InputManager::getInstance().removeWidgetModal( + (dynamic_cast<GuiManagerMyGUI*> (GuiManager::getManager())) + ->getWidgetT("Jukebox_load")); + MyGUI::WidgetManager::getInstance().destroyWidget( + (dynamic_cast<GuiManagerMyGUI*> (GuiManager::getManager())) + ->getWidgetT("Jukebox_load")); +} +//----------------------------------------------------------------------------- +void PlayState::notifyLoadAccept(MyGUI::WidgetPtr sender) +{ + String filename = (dynamic_cast<GuiManagerMyGUI*> (GuiManager::getManager())) + ->getSelected("Jukebox_editFileName", "Edit"); + + // Add file to list + mList->addItem(Ogre::UTFString(filename)); + mList->beginToEnd(); + + // Close the load panel + notifyLoadCancel( sender ); +} +//----------------------------------------------------------------------------- +void PlayState::play(MyGUI::WidgetPtr sender) +{ + String audio = (dynamic_cast<GuiManagerMyGUI*> (GuiManager::getManager())) + ->getSelected("List", "List"); + + if (audio == "") + return; + + AudioManagerOpenAL* am = AudioManagerOpenAL::getSingletonPtr(); + + + mAudio = am->createAudio(audio); + mAudio->load(); + //mAudio->setAudio(Vector3(0,0,0), Vector3(0,0,0), Vector3(0,0,0), 1000, 200, 1, 1, 200); + mAudio->play(); +} +//----------------------------------------------------------------------------- Added: samples/trunk/samples/Jukebox/PlayState.h =================================================================== --- samples/trunk/samples/Jukebox/PlayState.h (rev 0) +++ samples/trunk/samples/Jukebox/PlayState.h 2008-10-17 11:00:48 UTC (rev 105) @@ -0,0 +1,44 @@ + +#ifndef __PLAYSTATE_H__ +#define __PLAYSTATE_H__ + +#include "PlayIEH.h" +#include "oge/OgeCorePrerequisites.h" +#include "oge/game/OgeGameState.h" + +// TEMP +#include "MyGUI/MyGUI.h" +#include "oge/audio/OgeAudio.h" + +using namespace oge; + +/// Play State +class PlayState : public GameState +{ +private: + PlayIEH* mIEH; + + AudioPtr mAudio; + + // MyGUI Specific + MyGUI::WindowPtr mMainWidget; + String mFilename; + MyGUI::ListPtr mList; + +public: + PlayState(); + ~PlayState(); + + void tick(double currentTime); + bool activate(const Any& param); + bool deactivate(); + + void notifyWindowButtonPressed(MyGUI::WidgetPtr sender, const std::string & _button); + // Copied from LayoutEditor - EditorState.cpp - EditorState::notifyLoadSaveAs + void notifyLoad(MyGUI::WidgetPtr sender); + void notifyLoadCancel(MyGUI::WidgetPtr sender); + void notifyLoadAccept(MyGUI::WidgetPtr sender); + void play(MyGUI::WidgetPtr sender); +}; + +#endif // __PLAYSTATE_H__ Added: samples/trunk/samples/Jukebox/Readme.txt =================================================================== --- samples/trunk/samples/Jukebox/Readme.txt (rev 0) +++ samples/trunk/samples/Jukebox/Readme.txt 2008-10-17 11:00:48 UTC (rev 105) @@ -0,0 +1,37 @@ + +---- Jukebox - simple audio & gui sample ---- + +A simple gui permitting to select audio and playing them. + + +------------------- Goals ------------------------------ + + 1- Demonstrate gui usage + 2- Demonstrate audio usage + 3- Simple graphical audio player + - Loading (wav & ogg files) + - (todo) Loading "play list" + - (todo) Saving "play list" + - Play selected audio + - (todo) Volume + - (todo) Play continuous (go to the next audio when finished) + - (todo) Stop + - (todo) Replay + - (todo) Next/Previous + - (todo) Streaming : Stream the audio from memory (only works for ogg audios) + - (todo) In-Memory : Load the audio in-memory and play it from there. + + 4 - (todo) Use wxWidget to create a "true" realmedia replacement :) + + +------------------- MAJOR TODO -------------------------- + + 1 - Remove all direct dependencies to the plugins + + +------------------- Instructions ---------------------- + +If you are on a single machine you need to run them in windowed mode. + + 1- Run "Jukebox.exe" + 2- Type "Esc" to escape :) Added: samples/trunk/samples/Jukebox/YodaStopCritico.wav =================================================================== (Binary files differ) Property changes on: samples/trunk/samples/Jukebox/YodaStopCritico.wav ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: samples/trunk/samples/Jukebox/build/vc80 ___________________________________________________________________ Added: svn:ignore + Release Debug *.user Added: samples/trunk/samples/Jukebox/build/vc80/Jukebox.vcproj =================================================================== --- samples/trunk/samples/Jukebox/build/vc80/Jukebox.vcproj (rev 0) +++ samples/trunk/samples/Jukebox/build/vc80/Jukebox.vcproj 2008-10-17 11:00:48 UTC (rev 105) @@ -0,0 +1,218 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="8.00" + Name="Sample Jukebox" + ProjectGUID="{000000B5-0000-0000-0000-000000000000}" + RootNamespace="Jukebox" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|Win32" + OutputDirectory="..\..\..\..\bin\$(ConfigurationName)" + IntermediateDirectory="$(ConfigurationName)" + ConfigurationType="1" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + AdditionalIncludeDirectories="..\..;..\..\..\..\..\oge\dependencies\include;..\..\..\..\..\oge\utilities\include;..\..\..\..\..\oge\core\include;..\..\..\..\..\oge\plugins\graphicsogre\include;..\..\..\..\..\oge\plugins\guimygui\include;..\..\..\..\..\oge\dependencies\include\OGRE;..\..\..\..\..\oge\plugins\audioopenal\include" + PreprocessorDefinitions="LOG_DEBUG" + MinimalRebuild="true" + BasicRuntimeChecks="3" + RuntimeLibrary="3" + WarningLevel="3" + Detect64BitPortabilityProblems="true" + DebugInformationFormat="4" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + LinkLibraryDependencies="false" + AdditionalDependencies="tbb_debug.lib OgeUtilities_d.lib OgeCore_d.lib tbbmalloc_debug.lib OgreMain_d.lib OgeGuiMyGUI_d.lib OgeGraphicsOgre_d.lib MyGUI_d.lib OgeAudioOpenAL_d.lib" + OutputFile="$(OutDir)\$(ProjectName)_d.exe" + AdditionalLibraryDirectories=""..\..\..\..\..\oge\dependencies\lib\$(ConfigurationName)";"..\..\..\..\..\oge\lib\$(ConfigurationName)"" + GenerateDebugInformation="true" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Win32" + OutputDirectory="..\..\..\..\bin\$(ConfigurationName)" + IntermediateDirectory="$(ConfigurationName)" + ConfigurationType="1" + CharacterSet="2" + WholeProgramOptimization="1" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="..\..;..\..\..\..\..\oge\dependencies\include;..\..\..\..\..\oge\utilities\include;..\..\..\..\..\oge\core\include;..\..\..\..\..\oge\plugins\graphicsogre\include;..\..\..\..\..\oge\plugins\guimygui\include;..\..\..\..\..\oge\dependencies\include\OGRE;..\..\..\..\..\oge\plugins\audioopenal\include" + PreprocessorDefinitions="LOG_NORMAL" + RuntimeLibrary="2" + WarningLevel="3" + Detect64BitPortabilityProblems="true" + DebugInformationFormat="3" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="tbb.lib OgeUtilities.lib OgeCore.lib tbbmalloc.lib OgreMain.lib MyGUI.lib OgeAudioOpenAL.lib" + AdditionalLibraryDirectories=""..\..\..\..\..\oge\dependencies\lib\$(ConfigurationName)";"..\..\..\..\..\oge\lib\$(ConfigurationName)"" + GenerateDebugInformation="true" + OptimizeReferences="2" + EnableCOMDATFolding="2" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source Files" + Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" + UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" + > + <File + RelativePath="..\..\main.cpp" + > + </File> + <File + RelativePath="..\..\PlayIEH.cpp" + > + </File> + <File + RelativePath="..\..\PlayIEH.h" + > + </File> + <File + RelativePath="..\..\PlayState.cpp" + > + </File> + <File + RelativePath="..\..\PlayState.h" + > + </File> + </Filter> + <File + RelativePath="..\..\Jukebox.layout" + > + </File> + <File + RelativePath="..\..\Load.layout" + > + </File> + <File + RelativePath="..\..\oge.xml" + > + </File> + <File + RelativePath="..\..\Readme.txt" + > + </File> + </Files> + <Globals> + </Globals> +</VisualStudioProject> Added: samples/trunk/samples/Jukebox/m16burst1.wav =================================================================== (Binary files differ) Property changes on: samples/trunk/samples/Jukebox/m16burst1.wav ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: samples/trunk/samples/Jukebox/main.cpp =================================================================== --- samples/trunk/samples/Jukebox/main.cpp (rev 0) +++ samples/trunk/samples/Jukebox/main.cpp 2008-10-17 11:00:48 UTC (rev 105) @@ -0,0 +1,77 @@ +#include "oge/OgeUtilitiesPrerequisites.h" + +#include "PlayState.h" + +#include "oge/logging/OgeLogManager.h" +#include "oge/engine/OgeEngineManager.h" +#include "oge/engine/OgeEngineListener.h" +#include "oge/system/OgeSystemManager.h" +#include "oge/system/OgeSystem.h" +#include "oge/game/OgeGameManager.h" +#include "oge/game/OgeGameState.h" + +#include "oge/graphics/OgeGraphicsSceneManagerOGRE.h" +#include "oge/graphics/OgeGraphicsManager.h" +#include "oge/graphics/OgeGraphicsSceneManager.h" +#include "oge/input/OgeInputManager.h" +#include "OGRE/OgreSceneManager.h" + +using namespace oge; + +//------------------------- Main ---------------------------------- +int main(int argc, char** argv) +{ + // When run in debugging in VC this method will report leak + // when the application terminates + ogeInitMemoryCheck(); + + // This method will stop the step-by-step debugging on the block specified + // See the oge wiki for usage + //_CrtSetBreakAlloc(177488); + + LogManager* log = LogManager::createSingleton( LogManager::LOGTYPE_HTML ); + + // optional + log->setHeader( "Jukebox Sample", true, "Core", "0.0.1", "001" ); + log->initLogs(true,true); + + std::cout << "Creating engine..." << std::endl; + EngineManager* engine = EngineManager::createSingleton(); + + std::cout << "Creating systems" << std::endl; + SystemManager* systemManager = SystemManager::getSingletonPtr(); + + std::cout << "Initialising the engine manager..." << std::endl; + if (!engine->initialise("../../samples/Jukebox/oge.xml", "client")) + { + engine->shutdown(); + LOGE("Initialisation failed"); + } + else + { + std::cout << "Creating the play state" << std::endl; + PlayState* ps = new PlayState(); + GameManager* gm = GameManager::getSingletonPtr(); + gm->addGameState(ps); + + gm->setNextGameState("PlayState"); + + std::cout << "Running engine..." << std::endl; + if (!engine->run()) + { + LOGE("An error occurred when attempting to run the engine") + } + + std::cout << "Engine shutdown." << std::endl; + engine->shutdown(); + + delete ps; + } + + std::cout << "Destroying engine." << std::endl; + EngineManager::destroySingleton(); + + LogManager::destroySingleton(); + //system("PAUSE"); + return 0; +} Added: samples/trunk/samples/Jukebox/oge.xml =================================================================== --- samples/trunk/samples/Jukebox/oge.xml (rev 0) +++ samples/trunk/samples/Jukebox/oge.xml 2008-10-17 11:00:48 UTC (rev 105) @@ -0,0 +1,113 @@ +<configs> + <config root="oge.engine" clearValues="1" clearOptions="1" overrideStrict="1" setToModified="0"> + <profile selected="Client" /> + <profile name="Client" timingHandler="Simple"> + <system name="GraphicsManager" tickInterval="16.6666667" start="schedule" /> + <system name="InputManager" tickInterval="20" start="initialise" /> + <system name="AudioManager" tickInterval="20" start="initialise" /> + <system name="GuiManager" tickInterval="20" start="schedule" /> + <system name="GameManager" tickInterval="20" start="schedule" /> + </profile> + <!--<threading type="automatic" prefix="OGE_Thread_" suffix="" />--> + <threading type="manual" count="1"> + <!--<thread name="ExplicitThreadName" priority="normal" />--> + </threading> + <plugins name="debug" folder="./"> + <plugin name="OgeInputOIS_d" /> + <plugin name="OgeGraphicsOGRE_d" /> + <plugin name="OgeAudioOpenAL_d" /> + <plugin name="OgeGuiMyGUI_d" /> + </plugins> + <plugins name="release" folder="./"> + <plugin name="OgeInputOIS" /> + <plugin name="OgeGraphicsOGRE" /> + <plugin name="OgeAudioOpenAL" /> + <plugin name="OgeGuiMyGUI" /> + </plugins> + <graphics> + <plugins name="Debug"> + <plugin>Plugin_BSPSceneManager_d</plugin> + <plugin>Plugin_CgProgramManager_d</plugin> + <plugin>Plugin_OctreeSceneManager_d</plugin> + <plugin>Plugin_ParticleFX_d</plugin> + <plugin>Plugin_OctreeZone_d</plugin> + <plugin>Plugin_PCZSceneManager_d</plugin> + <plugin>RenderSystem_Direct3D9_d</plugin> + <plugin>RenderSystem_GL_d</plugin> + </plugins> + <plugins name="Release"> + <plugin>Plugin_BSPSceneManager</plugin> + <plugin>Plugin_CgProgramManager</plugin> + <plugin>Plugin_OctreeSceneManager</plugin> + <plugin>Plugin_ParticleFX</plugin> + <plugin>Plugin_OctreeZone</plugin> + <plugin>Plugin_PCZSceneManager</plugin> + <plugin>RenderSystem_Direct3D9</plugin> + <plugin>RenderSystem_GL</plugin> + </plugins> + <rendersystem selected="OpenGL" /> + <rendersystem name="Direct3D9" + Width="800" + Height="600" + ColourDepth="32" + FloatingPointMode="Fastest" /> + <rendersystem name="OpenGL" + Width="800" + Height="600" + ColourDepth="32" + RTT="FBO" /> + <renderwindow name="MainWindow" + Title="OGE Render Window" + Width="800" + Height="600" + Left="Center" + Top="Center" + DepthBuffer="True" + Fullscreen="False" + FSAA="0" + VSync="False" + Border="Resize" + UseOuterDimensions="False" + UseNVPerfHUD="False" /> + </graphics> + </config> + <config root="oge.filesystem" clearValues="1" clearOptions="1" overrideStrict="1" setToModified="0"> + <archive>../../../samples/media/graphics</archive> + <!--archive>../../media/MyGUI_Media</archive--> + <!--archive>../../samples/Jukebox</archive--> + <group name="GraphicsGeneral"> + <archive>../../../samples/media/graphics</archive> + <archive>../../../samples/media/graphics/fonts</archive> + <archive>../../../samples/media/graphics/materials/programs</archive> + <archive>../../../samples/media/graphics/materials/textures</archive> + <archive>../../../samples/media/graphics/materials/scripts</archive> + <archive>../../../samples/media/graphics/models</archive> + <archive>../../../samples/media/graphics/packs/OgreCore.zip</archive> + </group> + </config> + <config root="oge.graphicsystem" clearValues="1" clearOptions="1" + overrideStrict="1" setToModified="0"> + <archive>./</archive> + <archive>../../media/graphics/packs/OgreCore.zip</archive> + <group name="GraphicsGeneral"> + <archive>./</archive> + <archive>../../media/graphics/</archive> + <archive>../../media/graphics/oge/</archive> + <archive>../../media/graphics/fonts</archive> + <archive>../../media/graphics/materials/programs</archive> + <archive>../../media/graphics/materials/scripts</archive> + <archive>../../media/graphics/materials/textures</archive> + <archive>../../media/graphics/models</archive> + <archive>../../media/graphics/overlays</archive> + <archive>../../media/graphics/particle</archive> + <archive>../../media/graphics/gui</archive> + <archive>../../media/graphics/DeferredShadingMedia</archive> + <!--archive>../../media/graphics/packs/cubemap.zip</archive--> + <!--archive>../../media/graphics/packs/cubemapsJS.zip</archive--> + <!--archive>../../media/graphics/packs/dragon.zip</archive--> + <!--archive>../../media/graphics/packs/fresneldemo.zip</archive--> + <!--archive>../../media/graphics/packs/ogretestmap.zip</archive--> + <!--archive>../../media/graphics/packs/skybox.zip</archive--> + </group> + </config> +</configs> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <laz...@us...> - 2008-10-17 10:57:32
|
Revision: 104 http://oge.svn.sourceforge.net/oge/?rev=104&view=rev Author: lazaruslong Date: 2008-10-17 10:57:21 +0000 (Fri, 17 Oct 2008) Log Message: ----------- 2008/10/17 - SVN TRUNK v0.3.74 (rev 104) Sample "Jukebox" to demonstrate gui & basic audio capabilities. Core & Plugins - Added The EngineManager creates some "dummy" managers (especially the GuiManager) In order for some methods to make automatic calls: see the InputEventHandler - Updated GuiManager - Updated MyGui plugin - Updated The base class InputEventHandler will now call automatically the GuiManager to pass the events (this is the reason for the "dummy" manager). - Modified Now the InputEventHandler and Devices don't return a bool for each event. - Added GraphicsManagerOGRE::unloadAllPlugin() - Modified InputManager will now pass the windowResized event to the underlying library. Revision Links: -------------- http://oge.svn.sourceforge.net/oge/?rev=104&view=rev Modified Paths: -------------- oge/trunk/build/vc80/Oge.sln oge/trunk/core/include/oge/engine/OgeEngineManager.h oge/trunk/core/include/oge/gui/OgeGuiManager.h oge/trunk/core/include/oge/input/OgeInputEvent.h oge/trunk/core/include/oge/input/OgeInputEventHandler.h oge/trunk/core/include/oge/input/OgeInputManager.h oge/trunk/core/src/engine/OgeEngineManager.cpp oge/trunk/core/src/gui/OgeGuiManager.cpp oge/trunk/core/src/input/OgeInputEventHandler.cpp oge/trunk/plugins/audioopenal/build/vc80/AudioOpenAL.vcproj oge/trunk/plugins/graphicsogre/include/oge/graphics/OgeGraphicsManagerOGRE.h oge/trunk/plugins/graphicsogre/include/oge/graphics/OgeRenderTargetManager.h oge/trunk/plugins/graphicsogre/src/OgeGraphicsManagerOGRE.cpp oge/trunk/plugins/graphicsogre/src/OgeGraphicsSceneManagerOGRE.cpp oge/trunk/plugins/guimygui/Readme.txt oge/trunk/plugins/guimygui/build/vc80/GuiMyGUI.vcproj oge/trunk/plugins/guimygui/include/oge/gui/OgeGuiManagerMyGUI.h oge/trunk/plugins/guimygui/src/OgeGuiManagerMyGUI.cpp oge/trunk/plugins/inputois/include/oge/input/OgeDefaultInputEventHandler.h oge/trunk/plugins/inputois/include/oge/input/OgeInputManagerOIS.h oge/trunk/plugins/inputois/src/OgeDefaultInputEventHandler.cpp oge/trunk/plugins/inputois/src/OgeInputManagerOIS.cpp oge/trunk/plugins/inputois/src/OgeJoystickDevice.cpp oge/trunk/plugins/inputois/src/OgeKeyboardDevice.cpp oge/trunk/plugins/inputois/src/OgeMouseDevice.cpp Modified: oge/trunk/build/vc80/Oge.sln =================================================================== --- oge/trunk/build/vc80/Oge.sln 2008-10-11 10:09:23 UTC (rev 103) +++ oge/trunk/build/vc80/Oge.sln 2008-10-17 10:57:21 UTC (rev 104) @@ -10,37 +10,45 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin Input OIS", "..\..\plugins\inputois\build\vc80\InputOIS.vcproj", "{7D79D419-684D-4B34-B86C-BB129BE00289}" ProjectSection(ProjectDependencies) = postProject + {AF068815-F5D8-4BB4-9366-A2566B3D4623} = {AF068815-F5D8-4BB4-9366-A2566B3D4623} {9F6EFFA6-858E-4458-8FF4-C101F626ECDB} = {9F6EFFA6-858E-4458-8FF4-C101F626ECDB} - {AF068815-F5D8-4BB4-9366-A2566B3D4623} = {AF068815-F5D8-4BB4-9366-A2566B3D4623} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin Graphics OGRE", "..\..\plugins\graphicsogre\build\vc80\GraphicsOgre.vcproj", "{EA2B8BC6-16CB-417B-BB77-A6DB0FDD398B}" ProjectSection(ProjectDependencies) = postProject + {9F6EFFA6-858E-4458-8FF4-C101F626ECDB} = {9F6EFFA6-858E-4458-8FF4-C101F626ECDB} {AF068815-F5D8-4BB4-9366-A2566B3D4623} = {AF068815-F5D8-4BB4-9366-A2566B3D4623} - {9F6EFFA6-858E-4458-8FF4-C101F626ECDB} = {9F6EFFA6-858E-4458-8FF4-C101F626ECDB} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin Audio OpenAL", "..\..\plugins\audioopenal\build\vc80\AudioOpenAL.vcproj", "{10D5EC71-AF84-418E-A58B-6884D3AFB4A4}" ProjectSection(ProjectDependencies) = postProject + {AF068815-F5D8-4BB4-9366-A2566B3D4623} = {AF068815-F5D8-4BB4-9366-A2566B3D4623} {9F6EFFA6-858E-4458-8FF4-C101F626ECDB} = {9F6EFFA6-858E-4458-8FF4-C101F626ECDB} - {AF068815-F5D8-4BB4-9366-A2566B3D4623} = {AF068815-F5D8-4BB4-9366-A2566B3D4623} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Sample Hello World", "..\..\..\samples\samples\HelloWorld\build\vc80\HelloWorld.vcproj", "{81C5419F-358D-48C6-BC37-9F9931BB720F}" ProjectSection(ProjectDependencies) = postProject + {AF068815-F5D8-4BB4-9366-A2566B3D4623} = {AF068815-F5D8-4BB4-9366-A2566B3D4623} {9F6EFFA6-858E-4458-8FF4-C101F626ECDB} = {9F6EFFA6-858E-4458-8FF4-C101F626ECDB} - {AF068815-F5D8-4BB4-9366-A2566B3D4623} = {AF068815-F5D8-4BB4-9366-A2566B3D4623} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Sample Core Sample", "..\..\..\samples\samples\CoreSample\build\vc80\CoreSample.vcproj", "{FBB56A83-4D44-42BC-88CE-FC55F59953C6}" ProjectSection(ProjectDependencies) = postProject + {EA2B8BC6-16CB-417B-BB77-A6DB0FDD398B} = {EA2B8BC6-16CB-417B-BB77-A6DB0FDD398B} + {9F6EFFA6-858E-4458-8FF4-C101F626ECDB} = {9F6EFFA6-858E-4458-8FF4-C101F626ECDB} + {7D79D419-684D-4B34-B86C-BB129BE00289} = {7D79D419-684D-4B34-B86C-BB129BE00289} {AF068815-F5D8-4BB4-9366-A2566B3D4623} = {AF068815-F5D8-4BB4-9366-A2566B3D4623} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Sample First Entity", "..\..\..\samples\samples\FirstEntity\build\vc80\FirstEntity.vcproj", "{B5CFDFBC-0644-4DD8-A29E-5D03F8096550}" + ProjectSection(ProjectDependencies) = postProject + {AF068815-F5D8-4BB4-9366-A2566B3D4623} = {AF068815-F5D8-4BB4-9366-A2566B3D4623} {7D79D419-684D-4B34-B86C-BB129BE00289} = {7D79D419-684D-4B34-B86C-BB129BE00289} {9F6EFFA6-858E-4458-8FF4-C101F626ECDB} = {9F6EFFA6-858E-4458-8FF4-C101F626ECDB} {EA2B8BC6-16CB-417B-BB77-A6DB0FDD398B} = {EA2B8BC6-16CB-417B-BB77-A6DB0FDD398B} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Sample First Entity", "..\..\..\samples\samples\FirstEntity\build\vc80\FirstEntity.vcproj", "{B5CFDFBC-0644-4DD8-A29E-5D03F8096550}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Sample Fps Single Player", "..\..\..\samples\samples\FpsSinglePlayer\build\vc80\FpsSinglePlayer.vcproj", "{FC60AD18-7C47-49F1-8014-6B3DD493A1F7}" ProjectSection(ProjectDependencies) = postProject {EA2B8BC6-16CB-417B-BB77-A6DB0FDD398B} = {EA2B8BC6-16CB-417B-BB77-A6DB0FDD398B} {9F6EFFA6-858E-4458-8FF4-C101F626ECDB} = {9F6EFFA6-858E-4458-8FF4-C101F626ECDB} @@ -48,22 +56,24 @@ {AF068815-F5D8-4BB4-9366-A2566B3D4623} = {AF068815-F5D8-4BB4-9366-A2566B3D4623} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Sample Fps Single Player", "..\..\..\samples\samples\FpsSinglePlayer\build\vc80\FpsSinglePlayer.vcproj", "{FC60AD18-7C47-49F1-8014-6B3DD493A1F7}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Sample Object Serialisation", "..\..\..\samples\samples\ObjectSerialisation\build\vc80\ObjectSerialisation.vcproj", "{03936CEC-8BAB-4136-B3B5-6A6199954536}" ProjectSection(ProjectDependencies) = postProject + {9F6EFFA6-858E-4458-8FF4-C101F626ECDB} = {9F6EFFA6-858E-4458-8FF4-C101F626ECDB} {AF068815-F5D8-4BB4-9366-A2566B3D4623} = {AF068815-F5D8-4BB4-9366-A2566B3D4623} - {7D79D419-684D-4B34-B86C-BB129BE00289} = {7D79D419-684D-4B34-B86C-BB129BE00289} - {9F6EFFA6-858E-4458-8FF4-C101F626ECDB} = {9F6EFFA6-858E-4458-8FF4-C101F626ECDB} - {EA2B8BC6-16CB-417B-BB77-A6DB0FDD398B} = {EA2B8BC6-16CB-417B-BB77-A6DB0FDD398B} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Sample Object Serialisation", "..\..\..\samples\samples\ObjectSerialisation\build\vc80\ObjectSerialisation.vcproj", "{03936CEC-8BAB-4136-B3B5-6A6199954536}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin Gui MyGUI", "..\..\plugins\guimygui\build\vc80\GuiMyGUI.vcproj", "{10D5EC71-0000-0000-0000-000000000000}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Sample Jukebox", "..\..\..\samples\samples\Jukebox\build\vc80\Jukebox.vcproj", "{000000B5-0000-0000-0000-000000000000}" ProjectSection(ProjectDependencies) = postProject {AF068815-F5D8-4BB4-9366-A2566B3D4623} = {AF068815-F5D8-4BB4-9366-A2566B3D4623} + {7D79D419-684D-4B34-B86C-BB129BE00289} = {7D79D419-684D-4B34-B86C-BB129BE00289} + {10D5EC71-0000-0000-0000-000000000000} = {10D5EC71-0000-0000-0000-000000000000} + {10D5EC71-AF84-418E-A58B-6884D3AFB4A4} = {10D5EC71-AF84-418E-A58B-6884D3AFB4A4} {9F6EFFA6-858E-4458-8FF4-C101F626ECDB} = {9F6EFFA6-858E-4458-8FF4-C101F626ECDB} + {EA2B8BC6-16CB-417B-BB77-A6DB0FDD398B} = {EA2B8BC6-16CB-417B-BB77-A6DB0FDD398B} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin Gui MyGUI", "..\..\plugins\guimygui\build\vc80\GuiMyGUI.vcproj", "{10D5EC71-0000-0000-0000-000000000000}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -114,6 +124,10 @@ {10D5EC71-0000-0000-0000-000000000000}.Debug|Win32.Build.0 = Debug|Win32 {10D5EC71-0000-0000-0000-000000000000}.Release|Win32.ActiveCfg = Release|Win32 {10D5EC71-0000-0000-0000-000000000000}.Release|Win32.Build.0 = Release|Win32 + {000000B5-0000-0000-0000-000000000000}.Debug|Win32.ActiveCfg = Debug|Win32 + {000000B5-0000-0000-0000-000000000000}.Debug|Win32.Build.0 = Debug|Win32 + {000000B5-0000-0000-0000-000000000000}.Release|Win32.ActiveCfg = Release|Win32 + {000000B5-0000-0000-0000-000000000000}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Modified: oge/trunk/core/include/oge/engine/OgeEngineManager.h =================================================================== --- oge/trunk/core/include/oge/engine/OgeEngineManager.h 2008-10-11 10:09:23 UTC (rev 103) +++ oge/trunk/core/include/oge/engine/OgeEngineManager.h 2008-10-17 10:57:21 UTC (rev 104) @@ -47,6 +47,7 @@ #include "oge/containers/OgeMap.h" #include "oge/OgeSingleton.h" #include "oge/OgeString.h" +#include "oge/gui/OgeGuiManager.h" namespace oge { @@ -71,6 +72,9 @@ EngineTimingHandler* mTimingHandler; EngineListener* mListener; SystemManager* mSystemManager; + + GuiManager* mDummyGuiManager; + private: EngineManager(); ~EngineManager(); @@ -109,6 +113,13 @@ void shutdownThreads(); bool setupTimingHandler(); void destroyTimingHandler(); + /** + * Create dummy manager + * Like the default gui manager which does nothing but is + * necessary for class like the InputEventHandler + */ + void createDummyManagers(); + void deleteDummyManagers(); }; } Modified: oge/trunk/core/include/oge/gui/OgeGuiManager.h =================================================================== --- oge/trunk/core/include/oge/gui/OgeGuiManager.h 2008-10-11 10:09:23 UTC (rev 103) +++ oge/trunk/core/include/oge/gui/OgeGuiManager.h 2008-10-17 10:57:21 UTC (rev 104) @@ -44,6 +44,7 @@ #include "oge/OgeCorePrerequisites.h" #include "oge/system/OgeSystem.h" #include "oge/OgeString.h" +#include "oge/input/OgeInputEvent.h" namespace oge { @@ -54,12 +55,19 @@ protected: // ---------- Gui specific --------------------- - /// Window handle created by the graphics manager. - size_t mWindowHandle; + /** + * Render window created by the graphics manager. + * @note must be cast in the plugin to the correct type + */ + size_t mRenderWindow; public: GuiManager(const String& name, int systemOrdering = 10); virtual ~GuiManager(); + + /// @see System::tick() + virtual void tick(double currentTime) {} + /** * Returns the manager * @note The gui manager is a singleton so this method is equivalent @@ -70,20 +78,35 @@ static GuiManager* getManager() { return mManager; } /** - * @note The window handle must be set before the OIS::InputManager - * can be created. A handler must be provided. + * @note The Render Window must be set before most Gui Manager + * can be created. As this method must work for any gui + * and grapics libraries we pass a size_t that must + * be cast afterwards. * @note This method will assert if a null pointer is given. - * Use clearWindowHandle() instead with cautious. */ - void setWindowHandle( size_t windowHnd ) + void setRenderWindow( size_t renderWindow ) { - assert(windowHnd); - mWindowHandle = windowHnd; + assert(renderWindow); + mRenderWindow = renderWindow; } - void clearWindowHandle() - { - mWindowHandle = 0; - } + + virtual void keyPressed (const KeyEvent& arg) {} + virtual void keyReleased (const KeyEvent& arg) {} + virtual void mousePressed (const MouseEvent& arg) {} + virtual void mouseReleased (const MouseEvent& arg) {} + virtual void mouseMoved (const MouseEvent& arg) {} + virtual void joyButtonPressed (const JoystickEvent& arg) {} + virtual void joyButtonReleased (const JoystickEvent& arg) {} + virtual void joyAxisMoved (const JoystickEvent& arg) {} + virtual void joyPovMoved (const JoystickEvent& arg) {} + + /** + * Load a gui layout from file. + * Only for the gui library supporting this method will this + * method do something. + */ + virtual void loadLayout(const String& filename, const String& layout) {} + }; } Modified: oge/trunk/core/include/oge/input/OgeInputEvent.h =================================================================== --- oge/trunk/core/include/oge/input/OgeInputEvent.h 2008-10-11 10:09:23 UTC (rev 103) +++ oge/trunk/core/include/oge/input/OgeInputEvent.h 2008-10-17 10:57:21 UTC (rev 104) @@ -244,7 +244,7 @@ KeyEvent(KeyCode key) : mKeyCode(key) {} virtual ~KeyEvent() {} - inline const KeyCode getKeyCode() { return mKeyCode; } + virtual inline const KeyCode& getKeyCode() { return this->mKeyCode; } /** * (optional) Returns the key as text character * @see OIS TextTranslationMode Modified: oge/trunk/core/include/oge/input/OgeInputEventHandler.h =================================================================== --- oge/trunk/core/include/oge/input/OgeInputEventHandler.h 2008-10-11 10:09:23 UTC (rev 103) +++ oge/trunk/core/include/oge/input/OgeInputEventHandler.h 2008-10-17 10:57:21 UTC (rev 104) @@ -45,6 +45,8 @@ #include "oge/input/OgeInputDevice.h" #include "oge/input/OgeInputEvent.h" +#include "oge/gui/OgeGuiManager.h" + namespace oge { /** @@ -65,28 +67,34 @@ virtual ~InputEventHandler() {} // Oge event-base buffered methods - virtual bool keyPressed (const KeyEvent& arg) = 0; - virtual bool keyReleased (const KeyEvent& arg) = 0; - virtual bool mousePressed (const MouseEvent& arg) = 0; - virtual bool mouseReleased (const MouseEvent& arg) = 0; - virtual bool mouseMoved (const MouseEvent& arg) = 0; - virtual bool joyButtonPressed (const JoystickEvent& arg) = 0; - virtual bool joyButtonReleased (const JoystickEvent& arg) = 0; - virtual bool joyAxisMoved (const JoystickEvent& arg) = 0; - virtual bool joyPovMoved (const JoystickEvent& arg) = 0; + // + // WIP: Before the gui code the method were pure virtual ( = 0; ) + virtual void keyPressed (const KeyEvent& arg) { GuiManager::getManager()->keyPressed( arg ); } + virtual void keyReleased (const KeyEvent& arg) { GuiManager::getManager()->keyReleased( arg ); } + virtual void mousePressed (const MouseEvent& arg) { GuiManager::getManager()->mousePressed( arg ); } + virtual void mouseReleased (const MouseEvent& arg) { GuiManager::getManager()->mouseReleased( arg ); } + virtual void mouseMoved (const MouseEvent& arg) { GuiManager::getManager()->mouseMoved( arg ); } + virtual void joyButtonPressed (const JoystickEvent& arg) { GuiManager::getManager()->joyButtonPressed( arg ); } + virtual void joyButtonReleased (const JoystickEvent& arg) { GuiManager::getManager()->joyButtonReleased( arg ); } + virtual void joyAxisMoved (const JoystickEvent& arg) { GuiManager::getManager()->joyAxisMoved( arg ); } + virtual void joyPovMoved (const JoystickEvent& arg) { GuiManager::getManager()->joyPovMoved( arg ); } // Any-based buffered methods // Those methods should be implemented and used only if you want // to have direct access to the event of the underlying input library - virtual bool keyPressedAny (Any arg) { return true; } - virtual bool keyReleasedAny (Any arg) { return true; } - virtual bool mousePressedAny (Any arg, const int mousebutton) { return true; } - virtual bool mouseReleasedAny (Any arg, const int mousebutton) { return true; } - virtual bool mouseMovedAny (Any arg) { return true; } - virtual bool joyButtonPressedAny (Any arg, int button) { return true; } - virtual bool joyButtonReleasedAny (Any arg, int button) { return true; } - virtual bool joyAxisMovedAny (Any arg, int axis) { return true; } - virtual bool joyPovMovedAny (Any arg, int pov) { return true; } + // + // WIP: Before the gui code the method were only {} + //virtual bool keyPressedAny (Any arg) { const OIS::KeyEvent* evt = FastAnyCast(const OIS::KeyEvent*, arg); + // GuiManager::getManager()->keyPressed( arg );} + virtual void keyPressedAny (Any arg) {} + virtual void keyReleasedAny (Any arg) {} + virtual void mousePressedAny (Any arg, const int mousebutton) {} + virtual void mouseReleasedAny (Any arg, const int mousebutton) {} + virtual void mouseMovedAny (Any arg) {} + virtual void joyButtonPressedAny (Any arg, int button) {} + virtual void joyButtonReleasedAny (Any arg, int button) {} + virtual void joyAxisMovedAny (Any arg, int axis) {} + virtual void joyPovMovedAny (Any arg, int pov) {} }; /** @@ -100,25 +108,25 @@ DummyInputEventHandler(); // Oge event-base buffered methods - bool keyPressed (const KeyEvent& arg); - bool keyReleased (const KeyEvent& arg); - bool mousePressed (const MouseEvent& arg); - bool mouseReleased (const MouseEvent& arg); - bool mouseMoved (const MouseEvent& arg); - bool joyButtonPressed (const JoystickEvent& arg); - bool joyButtonReleased (const JoystickEvent& arg); - bool joyAxisMoved (const JoystickEvent& arg); - bool joyPovMoved (const JoystickEvent& arg); + void keyPressed (const KeyEvent& arg); + void keyReleased (const KeyEvent& arg); + void mousePressed (const MouseEvent& arg); + void mouseReleased (const MouseEvent& arg); + void mouseMoved (const MouseEvent& arg); + void joyButtonPressed (const JoystickEvent& arg); + void joyButtonReleased (const JoystickEvent& arg); + void joyAxisMoved (const JoystickEvent& arg); + void joyPovMoved (const JoystickEvent& arg); - bool keyPressedAny (Any arg); - bool keyReleasedAny (Any arg); - bool mousePressedAny (Any arg, const int mousebutton); - bool mouseReleasedAny (Any arg, const int mousebutton); - bool mouseMovedAny (Any arg); - bool joyButtonPressedAny (Any arg, int button); - bool joyButtonReleasedAny (Any arg, int button); - bool joyAxisMovedAny (Any arg, int axis); - bool joyPovMovedAny (Any arg, int pov); + void keyPressedAny (Any arg); + void keyReleasedAny (Any arg); + void mousePressedAny (Any arg, const int mousebutton); + void mouseReleasedAny (Any arg, const int mousebutton); + void mouseMovedAny (Any arg); + void joyButtonPressedAny (Any arg, int button); + void joyButtonReleasedAny (Any arg, int button); + void joyAxisMovedAny (Any arg, int axis); + void joyPovMovedAny (Any arg, int pov); }; } #endif Modified: oge/trunk/core/include/oge/input/OgeInputManager.h =================================================================== --- oge/trunk/core/include/oge/input/OgeInputManager.h 2008-10-11 10:09:23 UTC (rev 103) +++ oge/trunk/core/include/oge/input/OgeInputManager.h 2008-10-17 10:57:21 UTC (rev 104) @@ -96,6 +96,10 @@ */ virtual InputDevice* createInputDevice(const String& name, DeviceType devType) = 0; + /** Called by RenderTargetManager::windowResized() + */ + virtual void windowResized(unsigned int width, unsigned int height) = 0; + /** * @note The window handle must be set before the OIS::InputManager * can be created. A handler must be provided. Modified: oge/trunk/core/src/engine/OgeEngineManager.cpp =================================================================== --- oge/trunk/core/src/engine/OgeEngineManager.cpp 2008-10-11 10:09:23 UTC (rev 103) +++ oge/trunk/core/src/engine/OgeEngineManager.cpp 2008-10-17 10:57:21 UTC (rev 104) @@ -71,12 +71,19 @@ ResourceRegistry::createSingleton(); GameManager::createSingleton(); ObjectManager::createSingleton(); + + // Create dummies like the dummy gui manager + createDummyManagers(); + LOGR("EngineManager created"); } //------------------------------------------------------------------------- EngineManager::~EngineManager() { LOGR("Destroying EngineManager..."); + + deleteDummyManagers(); + ObjectManager::destroySingleton(); GameManager::destroySingleton(); ResourceRegistry::destroySingleton(); @@ -475,4 +482,14 @@ } } //------------------------------------------------------------------------- + void EngineManager::createDummyManagers() + { + mDummyGuiManager = new GuiManager("Dummy Gui Manager"); + } + //------------------------------------------------------------------------- + void EngineManager::deleteDummyManagers() + { + delete mDummyGuiManager; + } + //------------------------------------------------------------------------- } Modified: oge/trunk/core/src/gui/OgeGuiManager.cpp =================================================================== --- oge/trunk/core/src/gui/OgeGuiManager.cpp 2008-10-11 10:09:23 UTC (rev 103) +++ oge/trunk/core/src/gui/OgeGuiManager.cpp 2008-10-17 10:57:21 UTC (rev 104) @@ -47,7 +47,7 @@ GuiManager* GuiManager::mManager = 0; //------------------------------------------------------------------------- GuiManager::GuiManager(const String& name, int systemOrdering) : - System(name, systemOrdering), mWindowHandle(0) + System(name, systemOrdering), mRenderWindow(0) { mManager = this; LOG("Created " + name); Modified: oge/trunk/core/src/input/OgeInputEventHandler.cpp =================================================================== --- oge/trunk/core/src/input/OgeInputEventHandler.cpp 2008-10-11 10:09:23 UTC (rev 103) +++ oge/trunk/core/src/input/OgeInputEventHandler.cpp 2008-10-17 10:57:21 UTC (rev 104) @@ -39,6 +39,7 @@ ----------------------------------------------------------------------------- */ #include "oge/input/OgeInputEventHandler.h" +#include "oge/gui/OgeGuiManager.h" namespace oge { @@ -47,52 +48,44 @@ { } //------------------------------------------------------------------------- - bool DummyInputEventHandler::keyPressed (const KeyEvent& arg) + void DummyInputEventHandler::keyPressed (const KeyEvent& arg) { - return true; + // TODO Should we put also here the InputEventHandler::keyPressed( arg ); } //------------------------------------------------------------------------- - bool DummyInputEventHandler::keyReleased (const KeyEvent& arg) + void DummyInputEventHandler::keyReleased (const KeyEvent& arg) { - return true; } //------------------------------------------------------------------------- - bool DummyInputEventHandler::mousePressed (const MouseEvent& arg) + void DummyInputEventHandler::mousePressed (const MouseEvent& arg) { - return true; } //------------------------------------------------------------------------- - bool DummyInputEventHandler::mouseReleased (const MouseEvent& arg) + void DummyInputEventHandler::mouseReleased (const MouseEvent& arg) { - return true; } //------------------------------------------------------------------------- - bool DummyInputEventHandler::mouseMoved (const MouseEvent& arg) + void DummyInputEventHandler::mouseMoved (const MouseEvent& arg) { - return true; } //------------------------------------------------------------------------- - bool DummyInputEventHandler::joyButtonPressed (const JoystickEvent& arg) + void DummyInputEventHandler::joyButtonPressed (const JoystickEvent& arg) { - return true; } //------------------------------------------------------------------------- - bool DummyInputEventHandler::joyButtonReleased (const JoystickEvent& arg) + void DummyInputEventHandler::joyButtonReleased (const JoystickEvent& arg) { - return true; } //------------------------------------------------------------------------- - bool DummyInputEventHandler::joyAxisMoved (const JoystickEvent& arg) + void DummyInputEventHandler::joyAxisMoved (const JoystickEvent& arg) { - return true; } //------------------------------------------------------------------------- - bool DummyInputEventHandler::joyPovMoved (const JoystickEvent& arg) + void DummyInputEventHandler::joyPovMoved (const JoystickEvent& arg) { - return true; } //------------------------------------------------------------------------- - bool DummyInputEventHandler::keyPressedAny(Any arg) + void DummyInputEventHandler::keyPressedAny(Any arg) { /*_ This dummy shouldn't do anything! if (arg.keyEvent.key == OIS::KC_ESCAPE) @@ -116,48 +109,38 @@ GraphicsManager::getSingletonPtr()->toggleDebugOverlay(); } */ - return true; } //------------------------------------------------------------------------- - bool DummyInputEventHandler::keyReleasedAny(Any arg) + void DummyInputEventHandler::keyReleasedAny(Any arg) { - return true; } //------------------------------------------------------------------------- - bool DummyInputEventHandler::mousePressedAny(Any arg, const int mousebutton) + void DummyInputEventHandler::mousePressedAny(Any arg, const int mousebutton) { - return true; } //------------------------------------------------------------------------- - bool DummyInputEventHandler::mouseReleasedAny(Any arg, const int mousebutton) + void DummyInputEventHandler::mouseReleasedAny(Any arg, const int mousebutton) { - return true; } //------------------------------------------------------------------------- - bool DummyInputEventHandler::mouseMovedAny(Any arg) + void DummyInputEventHandler::mouseMovedAny(Any arg) { -//_ GraphicsManager::getSingletonPtr()->getGuiManager()->mouseMoved( arg ); - return true; } //------------------------------------------------------------------------- - bool DummyInputEventHandler::joyButtonPressedAny(Any arg, int button) + void DummyInputEventHandler::joyButtonPressedAny(Any arg, int button) { - return true; } //------------------------------------------------------------------------- - bool DummyInputEventHandler::joyButtonReleasedAny(Any arg, int button) + void DummyInputEventHandler::joyButtonReleasedAny(Any arg, int button) { - return true; } //------------------------------------------------------------------------- - bool DummyInputEventHandler::joyAxisMovedAny(Any arg, int axis) + void DummyInputEventHandler::joyAxisMovedAny(Any arg, int axis) { - return true; } //------------------------------------------------------------------------- - bool DummyInputEventHandler::joyPovMovedAny(Any arg, int pov) + void DummyInputEventHandler::joyPovMovedAny(Any arg, int pov) { - return true; } //------------------------------------------------------------------------- } // namespace Modified: oge/trunk/plugins/audioopenal/build/vc80/AudioOpenAL.vcproj =================================================================== --- oge/trunk/plugins/audioopenal/build/vc80/AudioOpenAL.vcproj 2008-10-11 10:09:23 UTC (rev 103) +++ oge/trunk/plugins/audioopenal/build/vc80/AudioOpenAL.vcproj 2008-10-17 10:57:21 UTC (rev 104) @@ -118,7 +118,7 @@ <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories="..\..\include;..\..\oge\;..\..\..\..\utilities\include;..\..\..\..\core\include;..\..\..\..\dependencies\include" - PreprocessorDefinitions="WIN32;NDEBUG;_USRDLL;LOG_NORMAL;OGE_AUDIOOPENAL_EXPORTS" + PreprocessorDefinitions="WIN32;NDEBUG;_USRDLL;LOG_VERBOSE;OGE_AUDIOOPENAL_EXPORTS" RuntimeLibrary="2" WarningLevel="3" Detect64BitPortabilityProblems="true" Modified: oge/trunk/plugins/graphicsogre/include/oge/graphics/OgeGraphicsManagerOGRE.h =================================================================== --- oge/trunk/plugins/graphicsogre/include/oge/graphics/OgeGraphicsManagerOGRE.h 2008-10-11 10:09:23 UTC (rev 103) +++ oge/trunk/plugins/graphicsogre/include/oge/graphics/OgeGraphicsManagerOGRE.h 2008-10-17 10:57:21 UTC (rev 104) @@ -155,6 +155,7 @@ bool setupResourceManagement(); bool loadPlugins(); + void unloadAllPlugins(); bool configureRenderer(); Ogre::RenderSystem* findRenderSystem( const String& name ); void configureRenderSystem(); Modified: oge/trunk/plugins/graphicsogre/include/oge/graphics/OgeRenderTargetManager.h =================================================================== --- oge/trunk/plugins/graphicsogre/include/oge/graphics/OgeRenderTargetManager.h 2008-10-11 10:09:23 UTC (rev 103) +++ oge/trunk/plugins/graphicsogre/include/oge/graphics/OgeRenderTargetManager.h 2008-10-17 10:57:21 UTC (rev 104) @@ -45,14 +45,13 @@ #include "oge/containers/OgeMap.h" #include "oge/OgeString.h" #include "oge/object/OgeObject.h" +#include "oge/input/OgeInputManager.h" #include "OGRE/OgrePrerequisites.h" #include "OGRE/OgreCommon.h" #include "OGRE/OgreWindowEventUtilities.h" #include "OGRE/OgreRenderWindow.h" -//_#include "oge/input/OgeInputManager.h" - /* TODO: - http://www.ogre3d.org/phpBB2/viewtopic.php?t=24861&highlight=remove+viewport @@ -132,9 +131,9 @@ /// Ogre::WindowEventListener methods virtual void windowResized(Ogre::RenderWindow* rw) { -/*_ if (InputManager::getSingletonPtr()) - InputManager::getSingletonPtr()->windowResized( rw->getWidth(), rw->getHeight() ); - // TODO ? + if (InputManager::getManager()) + InputManager::getManager()->windowResized( rw->getWidth(), rw->getHeight() ); +/*_ // TODO ? //if (GuiManager::getSingletonPtr()) // GuiManager::getSingletonPtr()->windowResized( rw->getWidth(), rw->getHeight() ); // if (GraphicsManager::getSingletonPtr()) Modified: oge/trunk/plugins/graphicsogre/src/OgeGraphicsManagerOGRE.cpp =================================================================== --- oge/trunk/plugins/graphicsogre/src/OgeGraphicsManagerOGRE.cpp 2008-10-11 10:09:23 UTC (rev 103) +++ oge/trunk/plugins/graphicsogre/src/OgeGraphicsManagerOGRE.cpp 2008-10-17 10:57:21 UTC (rev 104) @@ -175,7 +175,7 @@ // Initialise the gui manager: can only be done when ogre is running! if (GuiManager::getManager()) { - //GuiManager::getManager()->setRenderWindow( (size_t) mRenderWindow ); + GuiManager::getManager()->setRenderWindow( (size_t) mRenderWindow ); } else LOGR("The GuiManager was not created: nothing to send to it."); @@ -274,6 +274,7 @@ delete mRws; LOGD("Ogre root present: deleting..."); + unloadAllPlugins(); // This shouldn't be necessary delete mOgreRoot; LOGD("Ogre root deleted."); mOgreRoot = 0; @@ -487,6 +488,16 @@ return true; } //------------------------------------------------------------------------- + void GraphicsManagerOGRE::unloadAllPlugins() + { + LOGD("Unload all plugins..."); + Ogre::Root::PluginInstanceList list = mOgreRoot->getInstalledPlugins(); + for (size_t i=0; i<list.size(); i++) + { + mOgreRoot->unloadPlugin( list[i]->getName() ); + } + } + //------------------------------------------------------------------------- bool GraphicsManagerOGRE::configureRenderer() { LOGD("Configuring Ogre renderer..."); Modified: oge/trunk/plugins/graphicsogre/src/OgeGraphicsSceneManagerOGRE.cpp =================================================================== --- oge/trunk/plugins/graphicsogre/src/OgeGraphicsSceneManagerOGRE.cpp 2008-10-11 10:09:23 UTC (rev 103) +++ oge/trunk/plugins/graphicsogre/src/OgeGraphicsSceneManagerOGRE.cpp 2008-10-17 10:57:21 UTC (rev 104) @@ -53,6 +53,9 @@ //------------------------------------------------------------------------- GraphicsSceneManagerOGRE::GraphicsSceneManagerOGRE(const String& name) : GraphicsSceneManager(name), + mSceneManager(0), + mCameraObject(0), + mCamera(0), mOrphanedSceneNode(0), mRaySceneQuery(0), mRaySceneQuery2(0), @@ -69,6 +72,8 @@ if (mOrphanedSceneNode) mSceneManager->destroySceneNode( mOrphanedSceneNode->getName() ); + + clearScene(); } //------------------------------------------------------------------------- void GraphicsSceneManagerOGRE::init() @@ -116,7 +121,8 @@ //------------------------------------------------------------------------- void GraphicsSceneManagerOGRE::clearScene() { - mSceneManager->clearScene(); // todo not used ! + if (mSceneManager) + mSceneManager->clearScene(); // todo not used ! } //------------------------------------------------------------------------- Ogre::SceneNode* GraphicsSceneManagerOGRE::createSceneNode(const String& name) Modified: oge/trunk/plugins/guimygui/Readme.txt =================================================================== --- oge/trunk/plugins/guimygui/Readme.txt 2008-10-11 10:09:23 UTC (rev 103) +++ oge/trunk/plugins/guimygui/Readme.txt 2008-10-17 10:57:21 UTC (rev 104) @@ -1,7 +1,23 @@ Gui MyGui Plugin - ================== + ------------------- + NOTE +====== + + * In MyGUI.h there is IMO a small typos the line 58 should be + #include "MyGUI_CastWidget.h" and not #include <MyGUI_CastWidget.h> + Please, change it before compiling the gui plugin. + * In MyGUI:gui.cpp I had to comment out the line 133 + (delete mFontManager;) or a segfault occurs at shutdown. + + TODOs + ======= + + * Use the MyGUI::StatisticInfo as a base for a debug panel - non ogre based. + + + Documentation =============== * MyGUI quickstart http://www.ogre3d.org/wiki/index.php/MyGUI_quickstart Modified: oge/trunk/plugins/guimygui/build/vc80/GuiMyGUI.vcproj =================================================================== --- oge/trunk/plugins/guimygui/build/vc80/GuiMyGUI.vcproj 2008-10-11 10:09:23 UTC (rev 103) +++ oge/trunk/plugins/guimygui/build/vc80/GuiMyGUI.vcproj 2008-10-17 10:57:21 UTC (rev 104) @@ -39,7 +39,7 @@ <Tool Name="VCCLCompilerTool" Optimization="0" - AdditionalIncludeDirectories="..\..\include;..\..\oge\;..\..\..\..\utilities\include;..\..\..\..\core\include;..\..\..\..\dependencies\include" + AdditionalIncludeDirectories="..\..\include;..\..\oge\;..\..\..\..\utilities\include;..\..\..\..\core\include;..\..\..\..\dependencies\include;..\..\..\..\dependencies\include\OGRE" PreprocessorDefinitions="WIN32;_DEBUG;_USRDLL;LOG_DEBUG;OGE_GUIMYGUI_EXPORTS" MinimalRebuild="true" BasicRuntimeChecks="3" @@ -59,7 +59,7 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="OgeUtilities_d.lib OgeCore_d.lib MyGUI_d.lib" + AdditionalDependencies="OgeUtilities_d.lib OgeCore_d.lib MyGUI_d.lib OgreMain_d.lib" OutputFile="$(OutDir)\OgeGuiMyGUI_d.dll" AdditionalLibraryDirectories=""..\..\..\..\lib\$(ConfigurationName)";"..\..\..\..\dependencies\lib\$(ConfigurationName)";"..\..\lib\$(ConfigurationName)"" GenerateDebugInformation="true" @@ -117,7 +117,7 @@ /> <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="..\..\include;..\..\oge\;..\..\..\..\utilities\include;..\..\..\..\core\include;..\..\..\..\dependencies\include" + AdditionalIncludeDirectories="..\..\include;..\..\oge\;..\..\..\..\utilities\include;..\..\..\..\core\include;..\..\..\..\dependencies\include;..\..\..\..\dependencies\include\OGRE" PreprocessorDefinitions="WIN32;NDEBUG;_USRDLL;LOG_NORMAL;OGE_GUIMYGUI_EXPORTS" RuntimeLibrary="2" WarningLevel="3" @@ -135,7 +135,7 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="OgeUtilities.lib OgeCore.lib MyGUI.lib" + AdditionalDependencies="OgeUtilities.lib OgeCore.lib MyGUI.lib OgreMain.lib" OutputFile="$(OutDir)\OgeGuiMyGUI.dll" AdditionalLibraryDirectories=""..\..\..\..\lib\$(ConfigurationName)";"..\..\..\..\dependencies\lib\$(ConfigurationName)";"..\..\lib\$(ConfigurationName)"" GenerateDebugInformation="true" Modified: oge/trunk/plugins/guimygui/include/oge/gui/OgeGuiManagerMyGUI.h =================================================================== --- oge/trunk/plugins/guimygui/include/oge/gui/OgeGuiManagerMyGUI.h 2008-10-11 10:09:23 UTC (rev 103) +++ oge/trunk/plugins/guimygui/include/oge/gui/OgeGuiManagerMyGUI.h 2008-10-17 10:57:21 UTC (rev 104) @@ -45,16 +45,22 @@ #include "oge/resource/OgeResourceControllerOgeImpl.h" #include "oge/gui/OgeGuiManager.h" #include "oge/OgeSingleton.h" -//#include "AL/al.h" your lib -//#include "AL/alc.h" +// wip +#include "oge/input/OgeInputEvent.h" +#include "MyGUI/MyGUI.h" + namespace oge { class OGE_GUI_API GuiManagerMyGUI : public GuiManager, public Singleton<GuiManagerMyGUI> { private: + MyGUI::Gui* mGUI; + MyGUI::WidgetPtr mMainWidget; + MyGUI::VectorWidgetPtr mListWindowRoot; + public: static GuiManagerMyGUI* createSingleton(); @@ -73,6 +79,50 @@ private: GuiManagerMyGUI(); ~GuiManagerMyGUI(); + + /** + * @note This method works because the key event uses + * the same enum values than the OIS one + * (a simple cast (MyGUI::KeyCode) is used). + */ + void keyPressed (const KeyEvent& arg); + /** + * @note This method works because the key event uses + * the same enum values than the OIS one + * (a simple cast (MyGUI::KeyCode) is used). + */ + void keyReleased (const KeyEvent& arg); + /** + * @note This method works because the mouse button uses + * the same enum values than the OIS one + * (a simple cast (MyGUI::MouseButton) is used). + */ + void mousePressed (const MouseEvent& arg); + /** + * @note This method works because the mouse button uses + * the same enum values than the OIS one + * (a simple cast (MyGUI::MouseButton) is used). + */ + void mouseReleased (const MouseEvent& arg); + void mouseMoved (const MouseEvent& arg); + void joyButtonPressed (const JoystickEvent& arg); + void joyButtonReleased (const JoystickEvent& arg); + void joyAxisMoved (const JoystickEvent& arg); + void joyPovMoved (const JoystickEvent& arg); + + /** + * Load a gui layout from file. + * In the case of MyGui those are .layout files. + */ + void loadLayout(const String& filename, const String& layout); + + public: + // ------------- MyGui Specific methods --------------- + MyGUI::WidgetPtr getWidget(const String& layout); + MyGUI::WidgetPtr getWidgetT(const String& layout); + + // TEMP how to do a "general" solution :(const String& widget, enum type) and a switch? + String getSelected(const String& widget, const String& widgetType); }; } #endif // __OGE_GUIMANAGERMYGUI_H__ Modified: oge/trunk/plugins/guimygui/src/OgeGuiManagerMyGUI.cpp =================================================================== --- oge/trunk/plugins/guimygui/src/OgeGuiManagerMyGUI.cpp 2008-10-11 10:09:23 UTC (rev 103) +++ oge/trunk/plugins/guimygui/src/OgeGuiManagerMyGUI.cpp 2008-10-17 10:57:21 UTC (rev 104) @@ -48,7 +48,9 @@ template<> GuiManagerMyGUI* Singleton<GuiManagerMyGUI>::mSingleton = 0; //------------------------------------------------------------------------- GuiManagerMyGUI::GuiManagerMyGUI() : - GuiManager("GuiManager") // Not GuiManagerMyGUI as we -for now- want only one mgr for each type + GuiManager("GuiManager"), // Not GuiManagerMyGUI as we -for now- want only one mgr for each type + mGUI(0), + mMainWidget(0) { } @@ -64,15 +66,25 @@ // The window handle MUST be set because the ois::inputmanager // needs it in its constructor! - if (!mWindowHandle) + if (!mRenderWindow) { //EngineManager::getSingletonPtr()->controlSystem("GuiManager", System::INITIALISE); -LOGE("KO::::::::::::::::::::"); + LOGE("The render window is not set!"); return false; } -LOGE("OK::::::::::::::::::::"); + LOG("Got a render window: initialising the MyGUI based gui manager"); + +// TODO does not work??? See in BaseManager.h BaseManager::addResourceLocation() +LOGE("TODO: The resource locations for the gui mgr are hard coded!"); +Ogre::ResourceGroupManager::getSingleton().addResourceLocation("../../media/MyGUI_Media/", "FileSystem"); +Ogre::ResourceGroupManager::getSingleton().addResourceLocation("../../samples/Jukebox/", "FileSystem"); + + mGUI = new MyGUI::Gui(); + mGUI->initialise( (Ogre::RenderWindow*) mRenderWindow, "core.xml" ); // TODO Set parameters + + /* if (!createMyGUI()) { LOGE("The OIS::InputManager couldn't be created! We should abort!"); @@ -91,6 +103,20 @@ LOGE("Gui Shutdown..."); System::shutdown(); + if (mGUI) + { +// TODO if (mParentWidget == null) { + MyGUI::LayoutManager::getInstance().unloadLayout(mListWindowRoot); +// } + mListWindowRoot.clear(); + + //TODO MT PROBLEM !!! + mGUI->shutdown(); + + delete mGUI; + mGUI = 0; + } + // if (mGuiListener) // delete mGuiListener; @@ -100,7 +126,8 @@ //------------------------------------------------------------------------- void GuiManagerMyGUI::tick(double currentTime) { - LOGE("yes it works"); + //LOGE("yes it works"); + mGUI->injectFrameEntered(1); // todo evt.timeSinceLastFrame } //------------------------------------------------------------------------- GuiManagerMyGUI* GuiManagerMyGUI::createSingleton() @@ -120,4 +147,108 @@ } } //------------------------------------------------------------------------- + void GuiManagerMyGUI::keyPressed (const KeyEvent& arg) + { + mGUI->injectKeyPress((MyGUI::KeyCode)(arg.mKeyCode)); + } + //------------------------------------------------------------------------- + void GuiManagerMyGUI::keyReleased (const KeyEvent& arg) + { + mGUI->injectKeyRelease((MyGUI::KeyCode)arg.mKeyCode); + } + //------------------------------------------------------------------------- + void GuiManagerMyGUI::mousePressed (const MouseEvent& arg) + { + mGUI->injectMousePress(arg.getAbsX(), arg.getAbsY(), (MyGUI::MouseButton)arg.getButton()); + } + //------------------------------------------------------------------------- + void GuiManagerMyGUI::mouseReleased (const MouseEvent& arg) + { + mGUI->injectMouseRelease(arg.getAbsX(), arg.getAbsY(), (MyGUI::MouseButton)arg.getButton()); + } + //------------------------------------------------------------------------- + void GuiManagerMyGUI::mouseMoved(const MouseEvent& arg) + { + mGUI->injectMouseMove(arg.getAbsX(), arg.getAbsY(), arg.getAbsZ()); + } + //------------------------------------------------------------------------- + void GuiManagerMyGUI::joyButtonPressed (const JoystickEvent& arg) + { + LOGV("joy button pressed todo"); + } + //------------------------------------------------------------------------- + void GuiManagerMyGUI::joyButtonReleased (const JoystickEvent& arg) + { + LOGV("joy button released todo"); + } + //------------------------------------------------------------------------- + void GuiManagerMyGUI::joyAxisMoved (const JoystickEvent& arg) + { + LOGV("joyAxisMoved todo"); + } + //------------------------------------------------------------------------- + void GuiManagerMyGUI::joyPovMoved (const JoystickEvent& arg) + { + LOGV("joyPovMoved todo"); + } + //------------------------------------------------------------------------- + void GuiManagerMyGUI::loadLayout(const String& filename, const String& layout) + { + // TODO See _parent in BaseLayout::loadLayout(MyGUI::WidgetPtr _parent) + mListWindowRoot = MyGUI::LayoutManager::getInstance().load(filename); // TODO use the Ogre::ResourceGroupManager::Group parameter + + for (MyGUI::VectorWidgetPtr::iterator iter=mListWindowRoot.begin(); iter!=mListWindowRoot.end(); ++iter) { + if ((*iter)->getName() == layout) { + mMainWidget = (*iter); + return; + } + } + //mMainWidget->show(); + LOGE("Root widget named: '"+layout+"' was not found."); + } + //------------------------------------------------------------------------- + MyGUI::WidgetPtr GuiManagerMyGUI::getWidget(const String& layout) + { + for (MyGUI::VectorWidgetPtr::iterator iter=mListWindowRoot.begin(); iter!=mListWindowRoot.end(); ++iter) { + if ((*iter)->getName() == layout) { + return (*iter); + } + } + return 0; + } + //------------------------------------------------------------------------- + MyGUI::WidgetPtr GuiManagerMyGUI::getWidgetT(const String& layout) + { + return mGUI->findWidgetT(layout); + } + //------------------------------------------------------------------------- + String GuiManagerMyGUI::getSelected(const String& widget, const String& widgetType) + { + String selection; +// TODO catch the error because findWidget can throw an error +// but be sure to log correctly +// try + // todo switch for each type fo widget type! + if (widgetType == "Edit") + { + MyGUI::EditPtr edit = mGUI->findWidget<MyGUI::Edit>(widget); + if (edit) + return edit->getCaption(); + } + else if (widgetType == "List") + { + MyGUI::ListPtr list = mGUI->findWidget<MyGUI::List>(widget); + if (list) + { + size_t index = list->getItemSelect(); + if (index != MyGUI::ITEM_NONE) + { + return list->getItem( index ); + } + } + } +// catch + return selection; + } + //------------------------------------------------------------------------- } Modified: oge/trunk/plugins/inputois/include/oge/input/OgeDefaultInputEventHandler.h =================================================================== --- oge/trunk/plugins/inputois/include/oge/input/OgeDefaultInputEventHandler.h 2008-10-11 10:09:23 UTC (rev 103) +++ oge/trunk/plugins/inputois/include/oge/input/OgeDefaultInputEventHandler.h 2008-10-17 10:57:21 UTC (rev 104) @@ -57,26 +57,26 @@ DefaultInputEventHandler(); // Event-based buffered mode methods - bool keyPressed (const KeyEvent& arg); - bool keyReleased (const KeyEvent& arg); - bool mousePressed (const MouseEvent& arg); - bool mouseReleased (const MouseEvent& arg); - bool mouseMoved (const MouseEvent& arg); - bool joyButtonPressed (const JoystickEvent& arg); - bool joyButtonReleased (const JoystickEvent& arg); - bool joyAxisMoved (const JoystickEvent& arg); - bool joyPovMoved (const JoystickEvent& arg); + void keyPressed (const KeyEvent& arg); + void keyReleased (const KeyEvent& arg); + void mousePressed (const MouseEvent& arg); + void mouseReleased (const MouseEvent& arg); + void mouseMoved (const MouseEvent& arg); + void joyButtonPressed (const JoystickEvent& arg); + void joyButtonReleased (const JoystickEvent& arg); + void joyAxisMoved (const JoystickEvent& arg); + void joyPovMoved (const JoystickEvent& arg); // Any-based buffered mode methods - bool keyPressedAny (Any arg); - bool keyReleasedAny (Any arg); - bool mousePressedAny (Any arg, const int mousebutton); - bool mouseReleasedAny (Any arg, const int mousebutton); - bool mouseMovedAny (Any arg); - bool joyButtonPressedAny (Any arg, int button); - bool joyButtonReleasedAny (Any arg, int button); - bool joyAxisMovedAny (Any arg, int axis); - bool joyPovMovedAny (Any arg, int pov); + void keyPressedAny (Any arg); + void keyReleasedAny (Any arg); + void mousePressedAny (Any arg, const int mousebutton); + void mouseReleasedAny (Any arg, const int mousebutton); + void mouseMovedAny (Any arg); + void joyButtonPressedAny (Any arg, int button); + void joyButtonReleasedAny (Any arg, int button); + void joyAxisMovedAny (Any arg, int axis); + void joyPovMovedAny (Any arg, int pov); }; } #endif Modified: oge/trunk/plugins/inputois/include/oge/input/OgeInputManagerOIS.h =================================================================== --- oge/trunk/plugins/inputois/include/oge/input/OgeInputManagerOIS.h 2008-10-11 10:09:23 UTC (rev 103) +++ oge/trunk/plugins/inputois/include/oge/input/OgeInputManagerOIS.h 2008-10-17 10:57:21 UTC (rev 104) @@ -98,6 +98,10 @@ */ InputDevice* createInputDevice(const String& name, DeviceType devType); + /** Called by RenderTargetManager::windowResized() + */ + void windowResized(unsigned int width, unsigned int height); + private: InputManagerOIS(); /// Create the OIS input manager Modified: oge/trunk/plugins/inputois/src/OgeDefaultInputEventHandler.cpp =================================================================== --- oge/trunk/plugins/inputois/src/OgeDefaultInputEventHandler.cpp 2008-10-11 10:09:23 UTC (rev 103) +++ oge/trunk/plugins/inputois/src/OgeDefaultInputEventHandler.cpp 2008-10-17 10:57:21 UTC (rev 104) @@ -51,11 +51,12 @@ { } //------------------------------------------------------------------------- - bool DefaultInputEventHandler::keyPressed (const KeyEvent& arg) + void DefaultInputEventHandler::keyPressed (const KeyEvent& arg) { // We could also do this // const OIS::KeyEvent& evt = static_cast<const KeyEventOIS&>(arg).mEvent; // if (evt.key == OIS::KC_ESCAPE) + InputEventHandler::keyPressed( arg ); if (arg.mKeyCode == KC_ESCAPE) { @@ -71,51 +72,56 @@ if (GraphicsManager::getManager()) GraphicsManager::getManager()->toggleDebugOverlay(); } - return true; } //------------------------------------------------------------------------- - bool DefaultInputEventHandler::keyReleased (const KeyEvent& arg) + void DefaultInputEventHandler::keyReleased (const KeyEvent& arg) { - return true; + InputEventHandler::keyReleased( arg ); } //------------------------------------------------------------------------- - bool DefaultInputEventHandler::mousePressed (const MouseEvent& arg) + void DefaultInputEventHandler::mousePressed (const MouseEvent& arg) { - return true; + InputEventHandler::mousePressed( arg ); } //------------------------------------------------------------------------- - bool DefaultInputEventHandler::mouseReleased (const MouseEvent& arg) + void DefaultInputEventHandler::mouseReleased (const MouseEvent& arg) { - return true; + InputEventHandler::mouseReleased( arg ); } //------------------------------------------------------------------------- - bool DefaultInputEventHandler::mouseMoved (const MouseEvent& arg) + void DefaultInputEventHandler::mouseMoved (const MouseEvent& arg) { - return true; + InputEventHandler::mouseMoved( arg ); } //------------------------------------------------------------------------- - bool DefaultInputEventHandler::joyButtonPressed (const JoystickEvent& arg) + void DefaultInputEventHandler::joyButtonPressed (const JoystickEvent& arg) { - return true; + InputEventHandler::joyButtonPressed( arg ); } //------------------------------------------------------------------------- - bool DefaultInputEventHandler::joyButtonReleased (const JoystickEvent& arg) + void DefaultInputEventHandler::joyButtonReleased (const JoystickEvent& arg) { - return true; + InputEventHandler::joyButtonReleased( arg ); } //------------------------------------------------------------------------- - bool DefaultInputEventHandler::joyAxisMoved (const JoystickEvent& arg) + void DefaultInputEventHandler::joyAxisMoved (const JoystickEvent& arg) { - return true; + InputEventHandler::joyAxisMoved( arg ); } //------------------------------------------------------------------------- - bool DefaultInputEventHandler::joyPovMoved (const JoystickEvent& arg) + void DefaultInputEventHandler::joyPovMoved (const JoystickEvent& arg) { - return true; + InputEventHandler::joyPovMoved( arg ); } //------------------------------------------------------------------------- - bool DefaultInputEventHandler::keyPressedAny(Any arg) + + //------------- Any-based input event handler ----------------------------- + + //------------------------------------------------------------------------- + void DefaultInputEventHandler::keyPressedAny(Any arg) { + InputEventHandler::keyPressedAny( arg ); + const OIS::KeyEvent* evt = FastAnyCast(const OIS::KeyEvent*, arg); if (evt->key == OIS::KC_ESCAPE) @@ -132,49 +138,46 @@ if (GraphicsManager::getManager()) GraphicsManager::getManager()->toggleDebugOverlay(); } - - return true; } //------------------------------------------------------------------------- - bool DefaultInputEventHandler::keyReleasedAny(Any arg) + void DefaultInputEventHandler::keyReleasedAny(Any arg) { - return true; + InputEventHandler::keyReleasedAny( arg ); } //------------------------------------------------------------------------- - bool DefaultInputEventHandler::mousePressedAny(Any arg, const int mousebutton) + void DefaultInputEventHandler::mousePressedAny(Any arg, const int mousebutton) { - return true; + InputEventHandler::mousePressedAny( arg, mousebutton ); } //------------------------------------------------------------------------- - bool DefaultInputEventHandler::mouseReleasedAny(Any arg, const int mousebutton) + void DefaultInputEventHandler::mouseReleasedAny(Any arg, const int mousebutton) { - return true; + InputEventHandler::mouseReleasedAny( arg, mousebutton ); } //------------------------------------------------------------------------- - bool DefaultInputEventHandler::mouseMovedAny(Any arg) + void DefaultInputEventHandler::mouseMovedAny(Any arg) { -//_ GraphicsManager::getSingletonPtr()->getGuiManager()->mouseMoved( arg ); - return true; + InputEventHandler::mouseMovedAny( arg ); } //------------------------------------------------------------------------- - bool DefaultInputEventHandler::joyButtonPressedAny(Any arg, int button) + void DefaultInputEventHandler::joyButtonPressedAny(Any arg, int button) { - return true; + InputEventHandler::joyButtonPressedAny( arg, button ); } //------------------------------------------------------------------------- - bool DefaultInputEventHandler::joyButtonReleasedAny(Any arg, int button) + void DefaultInputEventHandler::joyButtonReleasedAny(Any arg, int button) { - return true; + InputEventHandler::joyButtonReleasedAny( arg, button ); } //------------------------------------------------------------------------- - bool DefaultInputEventHandler::joyAxisMovedAny(Any arg, int axis) + void DefaultInputEventHandler::joyAxisMovedAny(Any arg, int axis) { - return true; + InputEventHandler::joyAxisMovedAny( arg, axis ); } //------------------------------------------------------------------------- - bool DefaultInputEventHandler::joyPovMovedAny(Any arg, int pov) + void DefaultInputEventHandler::joyPovMovedAny(Any arg, int pov) { - return true; + InputEventHandler::joyPovMovedAny( arg, pov ); } //------------------------------------------------------------------------- } // namespace Modified: oge/trunk/plugins/inputois/src/OgeInputManagerOIS.cpp =================================================================== --- oge/trunk/plugins/inputois/src/OgeInputManagerOIS.cpp 2008-10-11 10:09:23 UTC (rev 103) +++ oge/trunk/plugins/inputois/src/OgeInputManagerOIS.cpp 2008-10-17 10:57:21 UTC (rev 104) @@ -305,4 +305,20 @@ return addInputDevice(inpDevice); } //------------------------------------------------------------------------- + void InputManagerOIS::windowResized(unsigned int width, unsigned int height) + { + if (width == 0 || height == 0) + return; + + DeviceMap::Iterator iter = mInputDevices.begin(); + for (; iter != mInputDevices.end(); ++iter) + { + // TODO also the others types? How to do with MouseDeviceAny? + if (iter->second->getDeviceType() == OGE_INPUT_MOUSE) + { + ((MouseDevice*) (iter->second))->setRenderSizes(width, height); + } + } + } + //------------------------------------------------------------------------- } Modified: oge/trunk/plugins/inputois/src/OgeJoystickDevice.cpp =================================================================== --- oge/trunk/plugins/inputois/src/OgeJoystickDevice.cpp 2008-10-11 10:09:23 UTC (rev 103) +++ oge/trunk/plugins/inputois/src/OgeJoystickDevice.cpp 2008-10-17 10:57:21 UTC (rev 104) @@ -72,22 +72,26 @@ //--------------------------------------------------------------------------- bool JoystickDeviceAny::buttonPressed(const OIS::JoyStickEvent &arg, int button) { - return mEventHandler->joyButtonPressedAny(&arg, button); + mEvent... [truncated message content] |
From: <laz...@us...> - 2008-10-11 10:09:33
|
Revision: 103 http://oge.svn.sourceforge.net/oge/?rev=103&view=rev Author: lazaruslong Date: 2008-10-11 10:09:23 +0000 (Sat, 11 Oct 2008) Log Message: ----------- 2008/10/11 - SVN TRUNK v0.3.73 (rev 103) Update the CMake DefineFlags file for Linux - Updated DefineFlags.cmake and the related CMakeLists.txt Revision Links: -------------- http://oge.svn.sourceforge.net/oge/?rev=103&view=rev Modified Paths: -------------- oge/trunk/build/cmake/modules/DefineFlags.cmake oge/trunk/core/build/cmake/CMakeLists.txt oge/trunk/plugins/dummysublib/build/cmake/CMakeLists.txt oge/trunk/plugins/graphicsogre/build/cmake/CMakeLists.txt oge/trunk/plugins/guimygui/build/cmake/CMakeLists.txt oge/trunk/plugins/inputois/build/cmake/CMakeLists.txt oge/trunk/utilities/build/cmake/CMakeLists.txt Modified: oge/trunk/build/cmake/modules/DefineFlags.cmake =================================================================== --- oge/trunk/build/cmake/modules/DefineFlags.cmake 2008-10-10 03:26:46 UTC (rev 102) +++ oge/trunk/build/cmake/modules/DefineFlags.cmake 2008-10-11 10:09:23 UTC (rev 103) @@ -1,4 +1,5 @@ IF (UNIX_STYLE_FLAGS) + MESSAGE("UNIX STYLE FLAGS selected!") # shall we save fullpath information in (shared) libs # to find the corresponding lib during rutime (or use LD_RUNPATH) @@ -10,24 +11,24 @@ # -do not warn on "long long" type (int64) although it's not ISO ++ standard. (JW) # see http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html SET(CMAKE_CXX_FLAGS_DEBUG - "-DLOG_DEBUG -g -Wall -pedantic -g3 -ggdb -gdwarf-2 -Wunused-variable -Wno-long-long -Wno-unknown-pragmas --Wno-system-headers" + "-DLOG_DEBUG -g -Wall -std=c++98 -g3 -ggdb -gdwarf-2 -Wunused-variable -Wno-long-long -Wno-unknown-pragmas" + #-pedantic -Wno-system-headers" CACHE STRING "Debug builds CMAKE CXX flags " FORCE ) - SET(CMAKE_CXX_FLAGS_DEBUG_OPENMP - "-DLOG_DEBUG -g -Wall -pedantic -g3 -ggdb -gdwarf-2 -Wunused-variable -Wno-long-long -Wno-unknown-pragmas --Wno-system-headers -fopenmp" - CACHE STRING "Debug builds CMAKE CXX flags " FORCE ) +# SET(CMAKE_CXX_FLAGS_DEBUG_OPENMP +# "-DLOG_DEBUG -g -Wall -pedantic -g3 -ggdb -gdwarf-2 -Wunused-variable -Wno-long-long -Wno-unknown-pragmas +#-Wno-system-headers -fopenmp" +# CACHE STRING "Debug builds CMAKE CXX flags " FORCE ) SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -Wall -pedantic -Wno-long-long" CACHE STRING "Flags used by the compiler during release builds." FORCE ) - SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -Wall -pedantic -Wno-long-long" - CACHE STRING "Flags used by the compiler during release builds." FORCE ) + SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -Wall -pedantic -Wno-long-long -DLOG_DEBUG" + CACHE STRING "Flags used by the compiler during release builds." FORCE ) - MARK_AS_ADVANCED( - CMAKE_CXX_FLAGS_DEBUG - CMAKE_CXX_FLAGS_DEBUG_OPENMP - ) - +# MARK_AS_ADVANCED( +# CMAKE_CXX_FLAGS_DEBUG +# CMAKE_CXX_FLAGS_DEBUG_OPENMP +# ) +SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS_DEBUG}) ENDIF(UNIX_STYLE_FLAGS) Modified: oge/trunk/core/build/cmake/CMakeLists.txt =================================================================== --- oge/trunk/core/build/cmake/CMakeLists.txt 2008-10-10 03:26:46 UTC (rev 102) +++ oge/trunk/core/build/cmake/CMakeLists.txt 2008-10-11 10:09:23 UTC (rev 103) @@ -57,6 +57,7 @@ ${Current_util}/ ) +INCLUDE(DefineFlags) FIND_PACKAGE(Poco) FIND_PACKAGE(TBB) IF(Poco_FOUND AND TBB_FOUND) Modified: oge/trunk/plugins/dummysublib/build/cmake/CMakeLists.txt =================================================================== --- oge/trunk/plugins/dummysublib/build/cmake/CMakeLists.txt 2008-10-10 03:26:46 UTC (rev 102) +++ oge/trunk/plugins/dummysublib/build/cmake/CMakeLists.txt 2008-10-11 10:09:23 UTC (rev 103) @@ -33,6 +33,7 @@ ${Current_include}/core/include ) +INCLUDE(DefineFlags) FIND_PACKAGE(Poco) FIND_PACKAGE(TBB) IF(Poco_FOUND AND TBB_FOUND) Modified: oge/trunk/plugins/graphicsogre/build/cmake/CMakeLists.txt =================================================================== --- oge/trunk/plugins/graphicsogre/build/cmake/CMakeLists.txt 2008-10-10 03:26:46 UTC (rev 102) +++ oge/trunk/plugins/graphicsogre/build/cmake/CMakeLists.txt 2008-10-11 10:09:23 UTC (rev 103) @@ -43,6 +43,7 @@ ${Current_include}/core/include ) +INCLUDE(DefineFlags) FIND_PACKAGE(Poco) FIND_PACKAGE(OGRE) IF(OGRE_FOUND AND Poco_FOUND) Modified: oge/trunk/plugins/guimygui/build/cmake/CMakeLists.txt =================================================================== --- oge/trunk/plugins/guimygui/build/cmake/CMakeLists.txt 2008-10-10 03:26:46 UTC (rev 102) +++ oge/trunk/plugins/guimygui/build/cmake/CMakeLists.txt 2008-10-11 10:09:23 UTC (rev 103) @@ -33,6 +33,7 @@ ${Current_include}/core/include ) +INCLUDE(DefineFlags) FIND_PACKAGE(OGRE) IF(OGRE_FOUND) INCLUDE_DIRECTORIES(${Current_Headers} ${OGRE_INCLUDE_DIR}) Modified: oge/trunk/plugins/inputois/build/cmake/CMakeLists.txt =================================================================== --- oge/trunk/plugins/inputois/build/cmake/CMakeLists.txt 2008-10-10 03:26:46 UTC (rev 102) +++ oge/trunk/plugins/inputois/build/cmake/CMakeLists.txt 2008-10-11 10:09:23 UTC (rev 103) @@ -37,6 +37,7 @@ ${Current_include}/core/include ) +INCLUDE(DefineFlags) FIND_PACKAGE(OIS) IF(OIS_FOUND) INCLUDE_DIRECTORIES(${Current_Headers} ${OIS_INCLUDE_DIR}) Modified: oge/trunk/utilities/build/cmake/CMakeLists.txt =================================================================== --- oge/trunk/utilities/build/cmake/CMakeLists.txt 2008-10-10 03:26:46 UTC (rev 102) +++ oge/trunk/utilities/build/cmake/CMakeLists.txt 2008-10-11 10:09:23 UTC (rev 103) @@ -97,6 +97,7 @@ ${Current_dir}/oge/thread/ ) +INCLUDE(DefineFlags) FIND_PACKAGE(Poco) FIND_PACKAGE(TBB) IF(Poco_FOUND AND TBB_FOUND) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <laz...@us...> - 2008-10-10 03:26:52
|
Revision: 102 http://oge.svn.sourceforge.net/oge/?rev=102&view=rev Author: lazaruslong Date: 2008-10-10 03:26:46 +0000 (Fri, 10 Oct 2008) Log Message: ----------- 2008/10/08 - SVN TRUNK v0.3.73 (rev 102) Fixes for linux - Fixed Clock which was in usec not msec - Fixed Linux mouse & keyboard grabbing by the InputManagerOIS. We still need to make it configurable. - Fixed various warnings Revision Links: -------------- http://oge.svn.sourceforge.net/oge/?rev=102&view=rev Modified Paths: -------------- oge/trunk/core/src/engine/OgeEngineManager.cpp oge/trunk/plugins/audioopenal/src/codecs/OgeAudioOgg.cpp oge/trunk/plugins/audioopenal/src/codecs/OgeAudioOggStream.cpp oge/trunk/plugins/inputois/src/OgeInputManagerOIS.cpp oge/trunk/utilities/src/OgeClock.cpp oge/trunk/utilities/src/config/OgeOptionManager.cpp oge/trunk/utilities/src/hardware/OgeCPUExtendedInfoAMD.cpp oge/trunk/utilities/src/hardware/OgeCPUExtendedInfoIntel.cpp Modified: oge/trunk/core/src/engine/OgeEngineManager.cpp =================================================================== --- oge/trunk/core/src/engine/OgeEngineManager.cpp 2008-10-08 09:14:01 UTC (rev 101) +++ oge/trunk/core/src/engine/OgeEngineManager.cpp 2008-10-10 03:26:46 UTC (rev 102) @@ -351,7 +351,7 @@ //------------------------------------------------------------------------- void EngineManager::setupThreads() { - unsigned int threadCount = 0; + size_t threadCount = 0; const ThreadingSettings& settings = mEngineSettings.getThreadingSettings(); // Set the number of threads to create either automatically or from @@ -378,7 +378,7 @@ settings.getThreadsSettings(); // Create each thread that has been specifically defined - for ( size_t index = 0; + for (size_t index = 0; index < explicitThreads.size() && index < threadCount; ++index) { @@ -396,17 +396,17 @@ // Create the remaining threads size_t remaining = threadCount - mThreads.size(); - for (int index = 0; index < remaining; ++index) + for (size_t index = 0; index < remaining; ++index) { String name = settings.getNamePrefix() + - StringUtil::toString(index + 1) + settings.getNameSuffix(); + StringUtil::toString((unsigned int) index + 1) + settings.getNameSuffix(); TaskThread* thread = new TaskThread(name); mThreads.push_back(thread); } // Start all threads - for (int index = 0; index < mThreads.size(); ++index) + for (size_t index = 0; index < mThreads.size(); ++index) { mThreads[index]->start(); } @@ -416,13 +416,13 @@ { // Tell each thread to stop size_t count = mThreads.size(); - for (int index = 0; index < count; ++index) + for (size_t index = 0; index < count; ++index) { mThreads[index]->stop(); } // Wait for each thread to fully shutdown then delete each - for (int index = 0; index < count; ++index) + for (size_t index = 0; index < count; ++index) { TaskThread* thread = mThreads[index]; // TODO: Change for try join so not to stall if problem occurs Modified: oge/trunk/plugins/audioopenal/src/codecs/OgeAudioOgg.cpp =================================================================== --- oge/trunk/plugins/audioopenal/src/codecs/OgeAudioOgg.cpp 2008-10-08 09:14:01 UTC (rev 101) +++ oge/trunk/plugins/audioopenal/src/codecs/OgeAudioOgg.cpp 2008-10-10 03:26:46 UTC (rev 102) @@ -162,7 +162,8 @@ delete[] array; - // LOGV("Vorbis : " + getParameters(vorbisInfo, vorbisComment)); + LOGV("Vorbis : " + getParameters(vorbisInfo, vorbisComment)); + (void) vorbisComment; // To avoid an unused variable with gcc // Must be set before ov_clear!!! size_t rate = vorbisInfo->rate; Modified: oge/trunk/plugins/audioopenal/src/codecs/OgeAudioOggStream.cpp =================================================================== --- oge/trunk/plugins/audioopenal/src/codecs/OgeAudioOggStream.cpp 2008-10-08 09:14:01 UTC (rev 101) +++ oge/trunk/plugins/audioopenal/src/codecs/OgeAudioOggStream.cpp 2008-10-10 03:26:46 UTC (rev 102) @@ -147,7 +147,8 @@ return false; } - LOGV("Streaming Vorbis : " + getParameters(vorbisInfo, vorbis_comment)); + LOGV("Streaming Vorbis : " + getParameters(vorbisInfo, vorbisComment)); + (void) vorbisComment; // To avoid an unused variable with gcc // Must be set before ov_clear which clears orbis_info & vorbis_comment! mRate = vorbisInfo->rate; Modified: oge/trunk/plugins/inputois/src/OgeInputManagerOIS.cpp =================================================================== --- oge/trunk/plugins/inputois/src/OgeInputManagerOIS.cpp 2008-10-08 09:14:01 UTC (rev 101) +++ oge/trunk/plugins/inputois/src/OgeInputManagerOIS.cpp 2008-10-10 03:26:46 UTC (rev 102) @@ -188,7 +188,11 @@ pl.insert(std::make_pair( String("w32_mouse"), String("DISCL_FOREGROUND" ))); } #else - // TODO LINUX and MAC support ! + // TODO LINUX and MAC support ! + pl.insert(std::make_pair(std::string("x11_mouse_grab"), std::string("false"))); + pl.insert(std::make_pair(std::string("x11_mouse_hide"), std::string("false"))); + pl.insert(std::make_pair(std::string("x11_keyboard_grab"), std::string("false"))); + pl.insert(std::make_pair(std::string("XAutoRepeatOn"), std::string("true"))); #endif mOIS = OIS::InputManager::createInputSystem(pl); Modified: oge/trunk/utilities/src/OgeClock.cpp =================================================================== --- oge/trunk/utilities/src/OgeClock.cpp 2008-10-08 09:14:01 UTC (rev 101) +++ oge/trunk/utilities/src/OgeClock.cpp 2008-10-10 03:26:46 UTC (rev 102) @@ -80,16 +80,16 @@ #else // ------------------ Linux + Mac --------------------------------------- //------------------------------------------------------------------------- - Clock::Clock() : mNewTicks(0), mStartTicks(0) + Clock::Clock() : mNewTicks(0) { gettimeofday(&mStartTime, 0); - mStartTicks = (double)(mStartTime.tv_sec * 1000000 + mStartTime.tv_usec); + mStartTicks = (double)(mStartTime.tv_sec * 1000 + mStartTime.tv_usec / 1000.0); } //------------------------------------------------------------------------- void Clock::update() { gettimeofday(&mCurrentTime, 0); - double ticks = (double)(mCurrentTime.tv_sec*1000000 + mCurrentTime.tv_usec); + double ticks = (double)(mCurrentTime.tv_sec * 1000 + mCurrentTime.tv_usec / 1000.0); mNewTicks = ticks - mStartTicks; } //------------------------------------------------------------------------- Modified: oge/trunk/utilities/src/config/OgeOptionManager.cpp =================================================================== --- oge/trunk/utilities/src/config/OgeOptionManager.cpp 2008-10-08 09:14:01 UTC (rev 101) +++ oge/trunk/utilities/src/config/OgeOptionManager.cpp 2008-10-10 03:26:46 UTC (rev 102) @@ -268,7 +268,7 @@ bool success = reader->parse(dataStream, mRootOption); reader->getCreator()->destroyReader(reader); - return true; + return success; } //------------------------------------------------------------------------- OptionReader* OptionManager::createReaderFromType(const String& type) Modified: oge/trunk/utilities/src/hardware/OgeCPUExtendedInfoAMD.cpp =================================================================== --- oge/trunk/utilities/src/hardware/OgeCPUExtendedInfoAMD.cpp 2008-10-08 09:14:01 UTC (rev 101) +++ oge/trunk/utilities/src/hardware/OgeCPUExtendedInfoAMD.cpp 2008-10-10 03:26:46 UTC (rev 102) @@ -91,7 +91,7 @@ bool extendedSupported = (reg[0] & 0x80000000) != 0; // Is brand string supported? - if (extendedSupported && reg[0] >= 0x80000004) + if (extendedSupported && (unsigned) reg[0] >= 0x80000004) { String brand; Modified: oge/trunk/utilities/src/hardware/OgeCPUExtendedInfoIntel.cpp =================================================================== --- oge/trunk/utilities/src/hardware/OgeCPUExtendedInfoIntel.cpp 2008-10-08 09:14:01 UTC (rev 101) +++ oge/trunk/utilities/src/hardware/OgeCPUExtendedInfoIntel.cpp 2008-10-10 03:26:46 UTC (rev 102) @@ -52,7 +52,7 @@ brand = getBrand(); - bool hardwareMT = hasHardwareMT(); + //bool hardwareMT = hasHardwareMT(); int maxLogicalPerCore = getMaxLogicalPerPackage() / getMaxCoresPerPackage(); @@ -99,7 +99,7 @@ bool extendedSupported = (reg[0] & 0x80000000) != 0; // Is brand string supported? - if (extendedSupported && reg[0] >= 0x80000004) + if (extendedSupported && (unsigned int) reg[0] >= 0x80000004) { String brand; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <laz...@us...> - 2008-10-08 09:18:23
|
Revision: 101 http://oge.svn.sourceforge.net/oge/?rev=101&view=rev Author: lazaruslong Date: 2008-10-08 09:14:01 +0000 (Wed, 08 Oct 2008) Log Message: ----------- 2008/10/08 - SVN TRUNK v0.3.72 (rev 101) - Fix Numerous gcc warnings generated by -Wall - Updated CMakeLists.txt for the GuiManager Revision Links: -------------- http://oge.svn.sourceforge.net/oge/?rev=101&view=rev Modified Paths: -------------- oge/trunk/core/build/cmake/CMakeLists.txt oge/trunk/core/src/object/OgeObject.cpp oge/trunk/plugins/audioopenal/include/oge/audio/OgeAudioContext.h oge/trunk/plugins/audioopenal/src/OgeAudioContext.cpp oge/trunk/plugins/graphicsogre/include/oge/graphics/OgeDebugOverlay.h oge/trunk/plugins/graphicsogre/src/OgeDebugOverlay.cpp oge/trunk/plugins/graphicsogre/src/OgeGraphicsManagerOGRE.cpp oge/trunk/plugins/guimygui/build/cmake/CMakeLists.txt oge/trunk/utilities/include/oge/OgeUtilitiesPrerequisites.h oge/trunk/utilities/include/oge/OgeUtilitiesSystemHeaders.h oge/trunk/utilities/include/oge/serialisation/OgeAddressTranslator.h oge/trunk/utilities/include/oge/serialisation/OgeBinarySerialiser.h oge/trunk/utilities/include/oge/serialisation/OgeSerialiser.h oge/trunk/utilities/src/datastreams/OgeMemoryStream.cpp oge/trunk/utilities/src/filesystem/zip/OgeZipStream.cpp oge/trunk/utilities/src/serialisation/OgeAddressTranslator.cpp oge/trunk/utilities/src/serialisation/OgeBinarySerialiser.cpp Modified: oge/trunk/core/build/cmake/CMakeLists.txt =================================================================== --- oge/trunk/core/build/cmake/CMakeLists.txt 2008-10-06 14:46:03 UTC (rev 100) +++ oge/trunk/core/build/cmake/CMakeLists.txt 2008-10-08 09:14:01 UTC (rev 101) @@ -26,6 +26,7 @@ ${Current_dir}/graphics/OgeGraphicsComponent.cpp ${Current_dir}/graphics/OgeGraphicsManager.cpp ${Current_dir}/graphics/OgeGraphicsSceneManager.cpp +${Current_dir}/gui/OgeGuiManager.cpp ${Current_dir}/input/OgeInputDevice.cpp ${Current_dir}/input/OgeInputEventHandler.cpp ${Current_dir}/input/OgeInputManager.cpp Modified: oge/trunk/core/src/object/OgeObject.cpp =================================================================== --- oge/trunk/core/src/object/OgeObject.cpp 2008-10-06 14:46:03 UTC (rev 100) +++ oge/trunk/core/src/object/OgeObject.cpp 2008-10-08 09:14:01 UTC (rev 101) @@ -324,9 +324,7 @@ // TODO ? object->write( params ); - #pragma warning (disable: 4311) - serialiser->writeInt((int) object); - #pragma warning (default: 4311) + serialiser->writePointer(static_cast<void*>(object)); object->write( serialiser ); // stream the specific data } //------------------------------------------------------------------------- @@ -340,9 +338,7 @@ LOGV( " -----> "+type ); assert( object!= 0 ); - #pragma warning (disable: 4312) - void * oldAddress = (void*) serialiser->readInt(); - #pragma warning (default: 4312) + void * oldAddress = serialiser->readPointer(); AddressTranslator::addAddress(oldAddress, object); object->read(serialiser); Modified: oge/trunk/plugins/audioopenal/include/oge/audio/OgeAudioContext.h =================================================================== --- oge/trunk/plugins/audioopenal/include/oge/audio/OgeAudioContext.h 2008-10-06 14:46:03 UTC (rev 100) +++ oge/trunk/plugins/audioopenal/include/oge/audio/OgeAudioContext.h 2008-10-08 09:14:01 UTC (rev 101) @@ -77,6 +77,7 @@ friend class AudioManagerOpenAL; private: + FastMutex mSourcesManagerMutex; /** * Maximum number of OpenAL sources (64 by default) * @note The number of sources is platform & hardware dependent @@ -84,13 +85,10 @@ * So you will need to experiment to find the right number for you. */ unsigned int mMaxSources; - FastMutex mSourcesManagerMutex; - ALuint* mSources; bool* mAvailableSources; std::vector<AudioSourcePtr> mAudioSources; - private: /** * There is only one active listener at a time (and one per context). * @note Don't forget to set it when you move the listener Modified: oge/trunk/plugins/audioopenal/src/OgeAudioContext.cpp =================================================================== --- oge/trunk/plugins/audioopenal/src/OgeAudioContext.cpp 2008-10-06 14:46:03 UTC (rev 100) +++ oge/trunk/plugins/audioopenal/src/OgeAudioContext.cpp 2008-10-08 09:14:01 UTC (rev 101) @@ -47,8 +47,7 @@ { //------------------------------------------------------------------------- AudioContext::AudioContext(ALCcontext* context, const String& name) - : mContext(context), mName(name), mSources(0), - mMaxSources(16) + : mMaxSources(16), mSources(0), mContext(context), mName(name) { // The sources can only be created when the context is active! // NO createAllSources(); cannot be called here. @@ -108,7 +107,7 @@ if (mSources[0] == 0) LOGE("No sources genereated: Are you sure the Context is active?"); - for (int i=0;i<mMaxSources; i++) + for (unsigned int i=0;i<mMaxSources; i++) { AudioSourcePtr audioSource = new AudioSource(); audioSource->mSource = mSources[i]; @@ -121,7 +120,7 @@ //----------------------------------------------------------------------------- AudioSourcePtr AudioContext::getNextFreeSource(Audio* audio) { - for (int i=0; i<mMaxSources; i++) + for (unsigned int i=0; i<mMaxSources; i++) { if (mAvailableSources[i] == true) { @@ -142,7 +141,7 @@ // AL_SOURCE_STATE = AL_INITIAL, AL_PLAYING, AL_PAUSED, AL_STOPPED // Test if the sources are in state: AL_STOPPED // TODO NOTE This shouldn't be called at each cycle (each seconde should be enough) - for (int i=0; i<mMaxSources; i++) + for (unsigned int i=0; i<mMaxSources; i++) { if (mAvailableSources[i] == false) { Modified: oge/trunk/plugins/graphicsogre/include/oge/graphics/OgeDebugOverlay.h =================================================================== --- oge/trunk/plugins/graphicsogre/include/oge/graphics/OgeDebugOverlay.h 2008-10-06 14:46:03 UTC (rev 100) +++ oge/trunk/plugins/graphicsogre/include/oge/graphics/OgeDebugOverlay.h 2008-10-08 09:14:01 UTC (rev 101) @@ -66,7 +66,6 @@ Ogre::RenderWindow* mRenderWindow; Ogre::OverlayManager* mOgreOverlayManager; Ogre::Overlay* mDebugOverlay; - bool mShowOverlay; bool mIsInitialised; String mCaption; Modified: oge/trunk/plugins/graphicsogre/src/OgeDebugOverlay.cpp =================================================================== --- oge/trunk/plugins/graphicsogre/src/OgeDebugOverlay.cpp 2008-10-06 14:46:03 UTC (rev 100) +++ oge/trunk/plugins/graphicsogre/src/OgeDebugOverlay.cpp 2008-10-08 09:14:01 UTC (rev 101) @@ -53,8 +53,7 @@ //------------------------------------------------------------------------- DebugOverlay::DebugOverlay(Ogre::Root* ogreRoot, Ogre::RenderWindow* renderWindow) : - mOgreRoot(ogreRoot), mRenderWindow(renderWindow), mShowOverlay(false), - mValid(false) + mValid(false), mOgreRoot(ogreRoot), mRenderWindow(renderWindow) { mOgreOverlayManager = Ogre::OverlayManager::getSingletonPtr(); Modified: oge/trunk/plugins/graphicsogre/src/OgeGraphicsManagerOGRE.cpp =================================================================== --- oge/trunk/plugins/graphicsogre/src/OgeGraphicsManagerOGRE.cpp 2008-10-06 14:46:03 UTC (rev 100) +++ oge/trunk/plugins/graphicsogre/src/OgeGraphicsManagerOGRE.cpp 2008-10-08 09:14:01 UTC (rev 101) @@ -175,9 +175,7 @@ // Initialise the gui manager: can only be done when ogre is running! if (GuiManager::getManager()) { - GuiManager::getManager()->setWindowHandle( mWindowHnd ); -//_ GuiManager::getManager()->initialise(mRenderWindow, -//_ mSceneManager->getOgreSceneManager()); + //GuiManager::getManager()->setRenderWindow( (size_t) mRenderWindow ); } else LOGR("The GuiManager was not created: nothing to send to it."); @@ -743,8 +741,11 @@ settings.miscParams["useNVPerfHUD"] = "false"; // == "False"; } +// TODO Something is wrong on Linux it causes a segfault in Ogre. Why? we are passing 0! +#if (OGE_PLATFORM == OGE_PLATFORM_WIN32) settings.miscParams["externalWindowHandle"] = externalWindowHandle; settings.miscParams["parentWindowHandle"] = parentWindowHandle; +#endif // Create the ogre render window ! mRenderWindow = mRenderTargetManager->createRenderWindow(settings); Modified: oge/trunk/plugins/guimygui/build/cmake/CMakeLists.txt =================================================================== --- oge/trunk/plugins/guimygui/build/cmake/CMakeLists.txt 2008-10-06 14:46:03 UTC (rev 100) +++ oge/trunk/plugins/guimygui/build/cmake/CMakeLists.txt 2008-10-08 09:14:01 UTC (rev 101) @@ -33,12 +33,9 @@ ${Current_include}/core/include ) -FIND_PACKAGE(Poco) -FIND_PACKAGE(TBB) -IF(Poco_FOUND AND TBB_FOUND) - INCLUDE_DIRECTORIES(${Current_Headers} ${Poco_Foundation_INCLUDE_DIR} ${Poco_Net_INCLUDE_DIR} -${Poco_Util_INCLUDE_DIR} ${Poco_XML_INCLUDE_DIR} ${TBB_INCLUDE_DIR}) - ADD_LIBRARY(${Current_Lib} SHARED ${Current_Sources}) - TARGET_LINK_LIBRARIES(${Current_Lib} ${Poco_Foundation_LIBRARY} ${Poco_Net_LIBRARY} ${Poco_Util_LIBRARY} -${Poco_XML_LIBRARY} ${TBB_LIBRARY}) -ENDIF(Poco_FOUND AND TBB_FOUND) +FIND_PACKAGE(OGRE) +IF(OGRE_FOUND) + INCLUDE_DIRECTORIES(${Current_Headers} ${OGRE_INCLUDE_DIR}) + ADD_LIBRARY(${Current_Lib} SHARED ${Current_Sources}) + TARGET_LINK_LIBRARIES(${Current_Lib} ${OGRE_LIBRARIES}) +ENDIF(OGRE_FOUND) Modified: oge/trunk/utilities/include/oge/OgeUtilitiesPrerequisites.h =================================================================== --- oge/trunk/utilities/include/oge/OgeUtilitiesPrerequisites.h 2008-10-06 14:46:03 UTC (rev 100) +++ oge/trunk/utilities/include/oge/OgeUtilitiesPrerequisites.h 2008-10-08 09:14:01 UTC (rev 101) @@ -136,10 +136,8 @@ /// NEXT Gcc 4.1.2 & 4.2 seems to have trouble with the hash_map /// until we find a solution we will replace it by a std::map #if OGE_COMPILER == OGE_COMPILER_GNUC && OGE_COMP_VER >= 310 && !defined(STLPORT) - # if OGE_COMP_VER >= 430 + # if OGE_COMP_VER >= 400 # define OgeHashMap ::std::tr1::unordered_map - # elif OGE_COMP_VER < 430 && OGE_COMP_VER > 400 - # define OgeHashMap ::std::map # else # define OgeHashMap ::__gnu_cxx::hash_map # endif @@ -284,6 +282,8 @@ # define FastAnyCast(x, y) Poco::AnyCast<x>(y) #endif + // To avoid gcc "unused variable" warnings (we could use -Wno-unused-variable + #define OGE_UNUSED(x) (void)x; } #endif // __OGE_UTILITIESPREREQUISITES_H__ Modified: oge/trunk/utilities/include/oge/OgeUtilitiesSystemHeaders.h =================================================================== --- oge/trunk/utilities/include/oge/OgeUtilitiesSystemHeaders.h 2008-10-06 14:46:03 UTC (rev 100) +++ oge/trunk/utilities/include/oge/OgeUtilitiesSystemHeaders.h 2008-10-08 09:14:01 UTC (rev 101) @@ -66,7 +66,7 @@ // Not in the original STL, but exists in SGI STL and STLport // For gcc 4.3 see http://gcc.gnu.org/gcc-4.3/changes.html #if (OGE_COMPILER == OGE_COMPILER_GNUC) && !defined(STLPORT) -# if OGE_COMP_VER >= 430 +# if OGE_COMP_VER >= 400 # include <tr1/unordered_map> # include <tr1/unordered_set> # else Modified: oge/trunk/utilities/include/oge/serialisation/OgeAddressTranslator.h =================================================================== --- oge/trunk/utilities/include/oge/serialisation/OgeAddressTranslator.h 2008-10-06 14:46:03 UTC (rev 100) +++ oge/trunk/utilities/include/oge/serialisation/OgeAddressTranslator.h 2008-10-08 09:14:01 UTC (rev 101) @@ -55,7 +55,7 @@ class OGE_UTIL_API AddressTranslator { private: - typedef OgeHashMap<int, int> AddressTable; + typedef OgeHashMap<void*, void*> AddressTable; static AddressTable sAddressTable; public: Modified: oge/trunk/utilities/include/oge/serialisation/OgeBinarySerialiser.h =================================================================== --- oge/trunk/utilities/include/oge/serialisation/OgeBinarySerialiser.h 2008-10-06 14:46:03 UTC (rev 100) +++ oge/trunk/utilities/include/oge/serialisation/OgeBinarySerialiser.h 2008-10-08 09:14:01 UTC (rev 101) @@ -68,6 +68,7 @@ virtual String readString(); virtual Vector3 readVector3(); virtual Quaternion readQuaternion(); + virtual void* readPointer(); // Write methods (must have a read equivalent) virtual void writeInt(int i); @@ -75,6 +76,7 @@ virtual void writeString(const String& s); virtual void writeVector3(const Vector3& v); virtual void writeQuaternion(const Quaternion& q); + virtual void writePointer(void* p); }; } Modified: oge/trunk/utilities/include/oge/serialisation/OgeSerialiser.h =================================================================== --- oge/trunk/utilities/include/oge/serialisation/OgeSerialiser.h 2008-10-06 14:46:03 UTC (rev 100) +++ oge/trunk/utilities/include/oge/serialisation/OgeSerialiser.h 2008-10-08 09:14:01 UTC (rev 101) @@ -74,6 +74,7 @@ virtual String readString() = 0; virtual Vector3 readVector3() = 0; virtual Quaternion readQuaternion() = 0; + virtual void* readPointer() = 0; // Write methods (must have a read equivalent) virtual void writeInt (int i) = 0; @@ -81,6 +82,7 @@ virtual void writeString (const String & s) = 0; virtual void writeVector3 (const Vector3& v) = 0; virtual void writeQuaternion (const Quaternion& q) = 0; + virtual void writePointer (void* p) = 0; }; } Modified: oge/trunk/utilities/src/datastreams/OgeMemoryStream.cpp =================================================================== --- oge/trunk/utilities/src/datastreams/OgeMemoryStream.cpp 2008-10-06 14:46:03 UTC (rev 100) +++ oge/trunk/utilities/src/datastreams/OgeMemoryStream.cpp 2008-10-08 09:14:01 UTC (rev 101) @@ -44,8 +44,8 @@ { //------------------------------------------------------------------------- MemoryStream::MemoryStream(DataStreamOwner* owner) : DataStream(owner), - mDataStart(0), mDataCurrent(0), mDataEnd(0), mSize(0), mIsOpen(false), - mOwnsData(false) + mOwnsData(false), mDataStart(0), mDataCurrent(0), mDataEnd(0), + mSize(0), mIsOpen(false), mName("") { } Modified: oge/trunk/utilities/src/filesystem/zip/OgeZipStream.cpp =================================================================== --- oge/trunk/utilities/src/filesystem/zip/OgeZipStream.cpp 2008-10-06 14:46:03 UTC (rev 100) +++ oge/trunk/utilities/src/filesystem/zip/OgeZipStream.cpp 2008-10-08 09:14:01 UTC (rev 101) @@ -127,7 +127,8 @@ if (!isValid()) return false; - return zzip_seek(mFileHandle, (zzip_off_t) position, SEEK_SET) == position; + return position == + (size_t)(zzip_seek(mFileHandle, (zzip_off_t) position, SEEK_SET)); } //------------------------------------------------------------------------- size_t ZipStream::getPosition() const Modified: oge/trunk/utilities/src/serialisation/OgeAddressTranslator.cpp =================================================================== --- oge/trunk/utilities/src/serialisation/OgeAddressTranslator.cpp 2008-10-06 14:46:03 UTC (rev 100) +++ oge/trunk/utilities/src/serialisation/OgeAddressTranslator.cpp 2008-10-08 09:14:01 UTC (rev 101) @@ -49,15 +49,12 @@ //------------------------------------------------------------------------- void AddressTranslator::addAddress(void* oldAddress, void* newAddress) { - #pragma warning (disable: 4311) - sAddressTable[(int)oldAddress] = (int)newAddress; - #pragma warning (default: 4311) + sAddressTable[oldAddress] = newAddress; } //------------------------------------------------------------------------- void* AddressTranslator::translateAddress(void* oldAddress) { - #pragma warning (disable: 4311 4312) - AddressTable::iterator it = sAddressTable.find((int)oldAddress); + AddressTable::iterator it = sAddressTable.find(oldAddress); if (it == sAddressTable.end()) { //_ LOGE(String("Potential Error: Couldn't find a translation for the address:") @@ -65,7 +62,6 @@ return 0; } void* ptr = (void*)(*it).second; - #pragma warning (default: 4311 4312) return ptr; } //------------------------------------------------------------------------- Modified: oge/trunk/utilities/src/serialisation/OgeBinarySerialiser.cpp =================================================================== --- oge/trunk/utilities/src/serialisation/OgeBinarySerialiser.cpp 2008-10-06 14:46:03 UTC (rev 100) +++ oge/trunk/utilities/src/serialisation/OgeBinarySerialiser.cpp 2008-10-08 09:14:01 UTC (rev 101) @@ -87,6 +87,13 @@ return q; } //------------------------------------------------------------------------- + void* BinarySerialiser::readPointer() + { + void* p; + mDataStream->read((char*)&p, sizeof(void*)); + return p; + } + //------------------------------------------------------------------------- void BinarySerialiser::writeInt(int n) { mDataStream->write((char*)&n, sizeof(int)); @@ -125,4 +132,9 @@ writeFloat( q.z ); } //------------------------------------------------------------------------- + void BinarySerialiser::writePointer(void *p) + { + mDataStream->write((char*)&p, sizeof(void*)); + } + //------------------------------------------------------------------------- } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |